.box-search-app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 48px;
  color: #29251f;
  text-align: left;
}

.box-search-hero {
  padding: 28px;
  border: 1px solid #d7c8af;
  border-radius: 18px;
  background: linear-gradient(135deg, #fffaf1, #f2e7d6);
  box-shadow: 0 12px 32px rgba(72, 52, 28, 0.12);
}

.box-search-hero h1 {
  margin: 0 0 10px;
  color: #49361f;
}

.box-search-lead {
  margin: 0 0 22px;
  line-height: 1.75;
}

.box-search-controls {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.box-search-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 2px solid #9d896c;
  border-radius: 10px;
  background: #fff;
  color: #29251f;
  font-size: 18px;
}

.box-search-input:focus {
  outline: 3px solid rgba(196, 137, 50, 0.25);
  border-color: #c07819;
}

.box-search-modes {
  display: flex;
  gap: 6px;
}

.box-search-mode,
.box-link-button,
.box-result-card {
  font: inherit;
}

.box-search-mode {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #9d896c;
  border-radius: 999px;
  background: #fff;
  color: #49361f;
  cursor: pointer;
}

.box-search-mode.is-active {
  background: #6b4d2e;
  color: #fff;
}

.box-search-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}

.box-stat,
.box-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eee3d3;
  color: #634926;
  font-size: 13px;
}

.box-era-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 8px;
  border: 1px solid #9b6d80;
  border-radius: 999px;
  background: #f6e8ef;
  color: #7a3f59;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.box-badge.is-box {
  background: #e0edff;
  color: #174b83;
}

.box-badge.is-item {
  background: #e8f2df;
  color: #315f24;
}

.box-search-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(440px, 1.25fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.box-panel {
  border: 1px solid #d7c8af;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(72, 52, 28, 0.08);
}

.box-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #e5d9c7;
}

.box-panel-heading h2,
.box-detail h2,
.box-detail h3 {
  margin: 0;
  color: #49361f;
}

.box-result-count {
  color: #796b58;
  white-space: nowrap;
}

.box-results {
  max-height: 760px;
  overflow: auto;
  padding: 10px;
}

.box-result-card {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f8f4ed;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.box-result-card:hover,
.box-result-card:focus-visible,
.box-result-card.is-selected {
  border-color: #c58a38;
  background: #fff9ee;
  outline: none;
}

.box-result-title {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
}

.box-result-title img,
.box-content-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: auto;
}

.box-result-meta,
.box-path {
  margin-top: 8px;
  color: #6e6252;
  font-size: 13px;
  line-height: 1.55;
}

.box-path strong {
  color: #49361f;
}

.box-detail {
  min-height: 420px;
  padding: 20px;
}

.box-detail-empty {
  display: grid;
  min-height: 380px;
  place-items: center;
  color: #786d5d;
  text-align: center;
}

.box-detail-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.box-detail-topline > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.box-detail-summary {
  margin: 10px 0 18px;
  color: #6e6252;
}

.box-section {
  margin-top: 22px;
}

.box-section h3 {
  padding-bottom: 7px;
  border-bottom: 2px solid #e3d2b9;
  font-size: 18px;
}

.box-content-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.box-link-button {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: 1px solid #dfd2c1;
  border-radius: 9px;
  background: #fff;
  color: #352b20;
  text-align: left;
  cursor: pointer;
}

.box-link-button:hover,
.box-link-button:focus-visible {
  border-color: #c58a38;
  background: #fff9ee;
  outline: none;
}

.box-link-name {
  min-width: 0;
  flex: 1;
}

.box-link-name small {
  display: block;
  margin-top: 3px;
  color: #776956;
}

.box-source-list {
  margin: 10px 0 0;
  padding-left: 20px;
  line-height: 1.75;
}

.box-source-list a {
  color: #075e9c;
}

.box-item-view {
  display: grid;
  grid-template-columns: minmax(260px, 330px) 1fr;
  gap: 20px;
  margin-top: 16px;
  align-items: start;
}

.box-item-variants {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.box-item-variant {
  padding: 14px;
  border: 1px solid #dfd2c1;
  border-radius: 10px;
  background: #fffdf9;
}

.box-item-variant h4 {
  margin: 0;
  color: #49361f;
}

.box-variant-boxes {
  margin: 6px 0 0;
  color: #6e6252;
  line-height: 1.6;
}

.box-image-text {
  padding: 14px;
  border-radius: 10px;
  background: #f8f4ed;
}

.box-image-text p {
  margin: 0;
}

.box-detail-image {
  display: block;
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  border: 1px solid #252525;
  border-radius: 8px;
  background: #000;
}

.box-item-data {
  padding: 14px;
  border-radius: 10px;
  background: #f8f4ed;
}

.box-item-data dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 12px;
  margin: 0 0 14px;
}

.box-item-data dt {
  color: #746550;
}

.box-item-data dd {
  margin: 0;
}

.box-item-description {
  margin: 0;
  line-height: 1.7;
  white-space: normal;
}

.box-path-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.box-path-button {
  padding: 10px 12px;
  border: 1px solid #d6c7b0;
  border-radius: 8px;
  background: #fffaf1;
  color: #49361f;
  text-align: left;
  cursor: pointer;
}

.box-no-results {
  padding: 36px 18px;
  color: #756957;
  text-align: center;
}

@media (max-width: 860px) {
  .box-search-controls,
  .box-search-layout,
  .box-item-view {
    grid-template-columns: 1fr;
  }

  .box-search-modes {
    justify-content: flex-start;
  }

  .box-results {
    max-height: none;
  }
}
