:root {
  --ink: #e8e2d7;
  --muted: #aaa397;
  --faint: #777168;
  --paper: #161514;
  --panel: #1d1b19;
  --panel-2: #24211e;
  --line: #3b3631;
  --line-soft: #2e2a26;
  --ember: #d87335;
  --ember-soft: #6e3e27;
  --gold: #c6a567;
  --danger: #b85145;
  --sans: "Karla", sans-serif;
  --serif: "Spectral", serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; min-height: 100vh; font-family: var(--sans); background: #161514; }
button, input, select { font: inherit; }
a { color: inherit; }

.comp-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #121110;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { width: 42px; height: 42px; border-radius: 6px; }
.brand span { display: grid; line-height: 1.05; }
.brand small { color: var(--muted); font-size: 12px; }
.brand strong { margin-top: 4px; font: 600 20px var(--serif); }
.edition { display: flex; align-items: baseline; gap: 10px; color: var(--muted); font-size: 12px; }
.edition strong { color: var(--gold); font-size: 14px; }
.edition-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.edition-switch button { min-width: 52px; border: 0; border-right: 1px solid var(--line); padding: 7px 10px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.edition-switch button:last-child { border-right: 0; }
.edition-switch button.is-active { background: var(--gold); color: #17130e; font-weight: 700; }

.comp-shell {
  display: grid;
  grid-template-columns: 240px minmax(300px, 430px) minmax(440px, 1fr);
  height: calc(100vh - 72px);
  min-height: 620px;
}
.comp-sidebar, .comp-browser, .entry-detail { min-width: 0; overflow-y: auto; }
.comp-sidebar { padding: 20px 14px; border-right: 1px solid var(--line); background: #181715; }
.comp-browser { border-right: 1px solid var(--line); background: var(--panel); }
.entry-detail { padding: 32px clamp(24px, 4vw, 56px) 64px; background: #1a1817; }

.search-wrap label { display: block; margin: 0 4px 7px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.search-field { display: grid; grid-template-columns: 1fr 34px; border: 1px solid var(--line); background: #11100f; }
.search-field:focus-within { border-color: var(--ember); }
.search-field input { width: 100%; border: 0; outline: 0; padding: 10px 11px; color: var(--ink); background: transparent; }
.search-field button { border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 20px; }

.category-nav { margin-top: 20px; display: grid; gap: 3px; }
.category-button {
  width: 100%; min-height: 42px; display: grid; grid-template-columns: 1fr auto; align-items: center;
  border: 1px solid transparent; padding: 8px 10px; color: var(--muted); background: transparent;
  text-align: left; cursor: pointer;
}
.category-button:hover { color: var(--ink); background: var(--panel-2); }
.category-button.is-active { color: #fff; border-color: var(--ember-soft); background: #2b211b; }
.category-button small { color: var(--faint); }
.category-button.is-active small { color: var(--gold); }
.category-divider { margin: 10px 8px 5px; color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; }

.license-note { margin: 24px 6px 0; padding-top: 16px; border-top: 1px solid var(--line-soft); color: var(--faint); font-size: 12px; line-height: 1.45; }
.license-note strong { color: var(--muted); }
.license-note p { margin: 6px 0; }
.license-note a { color: var(--gold); }

.browser-head { min-height: 92px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 20px; border-bottom: 1px solid var(--line); }
.browser-head p { margin: 0 0 5px; color: var(--ember); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.browser-head h1 { margin: 0; font: 600 28px var(--serif); }
.result-count { text-align: right; color: var(--faint); font-size: 11px; }
.result-count strong { display: block; color: var(--ink); font-size: 18px; }
.filter-row { display: flex; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.filter-row button { white-space: nowrap; border: 1px solid var(--line); padding: 6px 9px; color: var(--muted); background: #171513; cursor: pointer; }
.filter-row button.is-active { border-color: var(--ember); color: #fff; background: #3a261c; }

.entry-list { display: grid; }
.entry-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; width: 100%; min-height: 76px; padding: 10px 18px; border: 0; border-bottom: 1px solid var(--line-soft); color: inherit; background: transparent; text-align: left; cursor: pointer; }
.entry-row:hover { background: #25211e; }
.entry-row.is-active { box-shadow: inset 3px 0 var(--ember); background: #2a241f; }
.entry-thumb { width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); background: #111; color: var(--gold); font: 700 13px var(--serif); }
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; }
.entry-copy { min-width: 0; }
.entry-copy strong { display: block; overflow: hidden; color: var(--ink); font: 600 17px var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.entry-copy span { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.entry-meta { color: var(--gold); font-size: 12px; white-space: nowrap; }
.list-status { padding: 28px 20px; color: var(--muted); text-align: center; }

.detail-empty { min-height: 70vh; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.detail-empty h2 { margin: 18px 0 4px; color: var(--ink); font: 600 26px var(--serif); }
.detail-empty p { margin: 0; }
.detail-glyph { width: 72px; height: 72px; display: grid; place-items: center; border: 1px solid var(--ember-soft); color: var(--gold); font: 700 20px var(--serif); transform: rotate(45deg); }
.detail-glyph::first-line { transform: rotate(-45deg); }

.detail-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.detail-hero.with-image { grid-template-columns: 150px minmax(0, 1fr); }
.detail-image { width: 150px; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); }
.detail-kicker { margin: 0 0 6px; color: var(--ember); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.detail-title { margin: 0; color: #fff; font: 700 clamp(28px, 4vw, 44px) var(--serif); line-height: 1.05; }
.detail-alias { margin: 8px 0 0; color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tag { border: 1px solid var(--line); padding: 5px 8px; color: var(--muted); background: #141311; font-size: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(95px, 1fr)); gap: 1px; margin: 24px 0; background: var(--line); border: 1px solid var(--line); }
.stat-grid-1 { grid-template-columns: minmax(95px, 1fr); }
.stat-grid-2 { grid-template-columns: repeat(2, minmax(95px, 1fr)); }
.stat { min-height: 68px; padding: 12px; background: #211e1b; }
.stat span { display: block; color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.stat strong { display: block; margin-top: 5px; color: var(--ink); font-size: 16px; }
.detail-section { margin-top: 28px; }
.detail-section h2 { margin: 0 0 10px; color: var(--gold); font: 600 20px var(--serif); }
.detail-section h3 { margin: 20px 0 6px; color: var(--ink); font: 600 17px var(--serif); }
.detail-section p, .detail-section li { color: #cbc5bb; line-height: 1.65; }
.detail-section p { margin: 8px 0; }
.detail-section ul, .detail-section ol { padding-left: 22px; }
.action-block { margin: 12px 0; padding: 14px 16px; border-left: 2px solid var(--ember-soft); background: #211e1b; }
.action-block strong { color: var(--ink); }
.kv-table { width: 100%; border-collapse: collapse; }
.kv-table th, .kv-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.kv-table th { width: 34%; color: var(--muted); font-weight: 500; }
.kv-table td { color: var(--ink); }
.license-copy { max-width: 780px; }
.license-copy a { color: var(--gold); }

@media (max-width: 1050px) {
  .comp-shell { grid-template-columns: 210px minmax(300px, 1fr); }
  .entry-detail { position: fixed; z-index: 5; inset: 72px 0 0 210px; display: none; }
  .entry-detail.is-open { display: block; }
  .detail-close { display: block; }
}
@media (min-width: 1051px) { .detail-close { display: none; } }
@media (max-width: 680px) {
  .comp-header { height: 64px; padding: 0 14px; }
  .brand small, .edition span { display: none; }
  .brand strong { font-size: 17px; }
  .edition { gap: 0; }
  .comp-shell { display: block; height: auto; min-height: calc(100vh - 64px); }
  .comp-sidebar { position: static; overflow: visible; padding: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .category-nav { display: flex; margin-top: 12px; overflow-x: auto; }
  .category-button { width: auto; min-width: max-content; grid-template-columns: auto auto; gap: 8px; }
  .category-divider, .license-note { display: none; }
  .comp-browser { min-height: calc(100vh - 210px); border-right: 0; }
  .browser-head { min-height: 76px; padding: 15px; }
  .browser-head h1 { font-size: 23px; }
  .entry-detail { inset: 64px 0 0; padding: 22px 18px 48px; }
  .detail-hero.with-image { grid-template-columns: 92px minmax(0, 1fr); }
  .detail-image { width: 92px; }
  .detail-title { font-size: 28px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(95px, 1fr)); }
}
