/* ==========================================================================
   GCB Horizon documentation

   Palette blends the game's own UI colors (ColorPalette.cs) with the gold from
   the store cover art: navy surfaces, protoss blue links, nano gold headings.
   ========================================================================== */

:root {
  --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, 'SF Mono', Menlo, monospace;

  --topbar-h: 56px;
  --sidebar-w: 272px;
  --toc-w: 232px;
  --content-max: 46rem;
  --radius: 8px;
  --radius-sm: 5px;
}

/* ---- Dark (default) ---- */
html[data-theme='dark'] {
  --bg: #192a56;             /* picoVoidBlue  */
  --bg-sunken: #111d3d;      /* below bg, for code and table headers */
  --bg-elevated: #1f3468;
  --surface: #273c75;        /* mazarineBlue  */
  --surface-hover: #31488a;
  --border: #37538f;
  --border-strong: #40739e;  /* navalBlue     */

  --text: #f5f6fa;           /* lynxWhite     */
  --text-strong: #ffffff;
  --text-muted: #a8b4c8;
  --text-faint: #7f8fa6;     /* blueberryGray */

  --logo: #f2e6c1;           /* Wardstone mark, dark theme */
  --heading: #e1b12c;        /* nanoGold      */
  --heading-soft: #f0c552;
  --link: #00a8ff;           /* protossBlue   */
  --link-hover: #5cc8ff;
  --accent-soft: rgba(225, 177, 44, 0.13);
  --accent-border: rgba(225, 177, 44, 0.45);

  --code-bg: #111d3d;
  --code-text: #d8e2f2;
  --kbd-bg: #223b78;

  --note: #00a8ff;
  --tip: #44bd32;            /* skirretGreen  */
  --warning: #e1b12c;

  --t-air: #00a8ff;
  --t-surface: #44bd32;
  --t-sub: #8c7ae6;          /* mattPurple    */
  --t-land: #e1b12c;
  --t-hostile: #e84118;      /* nasturcianRed */

  --shadow: 0 4px 24px rgba(9, 16, 38, 0.55);
  --shadow-panel: 0 18px 50px rgba(9, 16, 38, 0.75);
  color-scheme: dark;
}

/* ---- Light ---- */
html[data-theme='light'] {
  --bg: #ffffff;
  --bg-sunken: #eef1f7;
  --bg-elevated: #ffffff;
  --surface: #f2f5fa;
  --surface-hover: #e6ebf4;
  --border: #d3dae7;
  --border-strong: #b3bfd2;

  --text: #22304f;
  --text-strong: #101b33;
  --text-muted: #55637f;
  --text-faint: #7f8fa6;

  --logo: #806623;           /* Wardstone mark, light theme */
  --heading: #8a6410;
  --heading-soft: #a0761a;
  --link: #0060a8;
  --link-hover: #0082dd;
  --accent-soft: rgba(138, 100, 16, 0.09);
  --accent-border: rgba(138, 100, 16, 0.4);

  --code-bg: #eef1f7;
  --code-text: #22304f;
  --kbd-bg: #e6ebf4;

  --note: #0060a8;
  --tip: #2b7a1f;
  --warning: #8a6410;

  --t-air: #0060a8;
  --t-surface: #2b7a1f;
  --t-sub: #5f4bc4;
  --t-land: #8a6410;
  --t-hostile: #b32c10;

  --shadow: 0 1px 3px rgba(16, 27, 51, 0.12);
  --shadow-panel: 0 18px 50px rgba(16, 27, 51, 0.24);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

svg { width: 100%; height: 100%; fill: none; stroke: currentColor;
      stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.muted { color: var(--text-faint); }
.unlinked { color: var(--text-muted); border-bottom: 1px dotted var(--border-strong); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--heading); color: #101b33; padding: 10px 16px;
  border-radius: 0 0 var(--radius) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex; align-items: center; gap: 9px;
  color: var(--text-strong); font-weight: 600; font-size: 15px;
  white-space: nowrap; text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--text-strong); }
/* logo.png is a white shield on transparent. Only its alpha is used: the mask
   punches the shape out of a solid --logo fill, so one asset serves both themes.
   The url is relative to this stylesheet, so it resolves from any page depth. */
.brand-mark {
  height: 24px; aspect-ratio: 343 / 441; flex: none; display: block;
  background-color: var(--logo);
  -webkit-mask: url(logo.png) no-repeat center / contain;
  mask: url(logo.png) no-repeat center / contain;
}
.brand-text em {
  font-style: normal; color: var(--text-faint); font-weight: 500;
  padding-left: 7px; margin-left: 5px; border-left: 1px solid var(--border-strong);
}

.icon-btn {
  width: 34px; height: 34px; flex: none; padding: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-muted);
  border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-strong); }
.menu-toggle { display: none; }

.theme-toggle .icon-moon { display: none; }
html[data-theme='light'] .theme-toggle .icon-sun { display: none; }
html[data-theme='light'] .theme-toggle .icon-moon { display: block; }
.units-toggle .icon-imperial { display: none; }
html[data-units='imperial'] .units-toggle .icon-metric { display: none; }
html[data-units='imperial'] .units-toggle .icon-imperial { display: block; }
.units-toggle text {
  fill: currentColor; stroke: none; font: 700 8px var(--font-sans);
}

.search-trigger {
  flex: 1 1 auto; max-width: 400px; margin-left: auto;
  display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 9px;
  background: var(--bg-sunken); color: var(--text-faint);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: 13.5px; cursor: pointer; text-align: left;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-muted); }
.search-trigger svg { width: 15px; height: 15px; flex: none; }
.search-trigger span { flex: 1; overflow: hidden; text-overflow: ellipsis;
                       white-space: nowrap; }

kbd {
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
  padding: 3px 6px; border-radius: 4px;
  background: var(--kbd-bg); border: 1px solid var(--border);
  color: var(--text-faint);
}

.topbar-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar-link {
  padding: 6px 10px; font-size: 13.5px; color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.topbar-link:hover { color: var(--text-strong); background: var(--surface-hover);
                     text-decoration: none; }

/* ==========================================================================
   Layout
   ========================================================================== */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  max-width: 1560px; margin: 0 auto;
}

.sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 24px 12px 60px 18px;
  border-right: 1px solid var(--border);
}
.sidebar-scrim { display: none; }

.nav-section + .nav-section { margin-top: 22px; }
.nav-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 0 10px 7px;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }

.nav-item a, .nav-item span {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; margin: 1px 0;
  font-size: 14px; color: var(--text-muted);
  border-radius: var(--radius-sm); border-left: 2px solid transparent;
}
.nav-item a:hover {
  background: var(--surface-hover); color: var(--text-strong); text-decoration: none;
}
.nav-item.active a {
  background: var(--accent-soft); color: var(--heading-soft);
  border-left-color: var(--heading); font-weight: 600;
}
.nav-item.soon span { color: var(--text-faint); cursor: default; }
.nav-item.soon em {
  font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 2px 6px; border-radius: 20px;
  background: var(--bg-sunken); border: 1px solid var(--border); color: var(--text-faint);
}

main { min-width: 0; padding: 34px 48px 64px; }

.toc {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; padding: 34px 22px 60px 8px;
}
.toc-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px;
}
.toc ul { list-style: none; margin: 0; padding: 0;
          border-left: 1px solid var(--border); }
.toc a {
  display: block; padding: 5px 12px; font-size: 13px; color: var(--text-muted);
  border-left: 2px solid transparent; margin-left: -1px;
}
.toc a:hover { color: var(--text-strong); text-decoration: none; }
.toc a.active { color: var(--heading-soft); border-left-color: var(--heading); }
.toc-l3 a { padding-left: 24px; font-size: 12.5px; }

/* ==========================================================================
   Content
   ========================================================================== */

.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-faint); margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .current { color: var(--text); }

.content { max-width: var(--content-max); }

/* Browse pages have no on-this-page list, so the third column is given back to
   the table. */
.catalog-page .content { max-width: none; }
.catalog-page .toc { display: none; }
.catalog-page .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.catalog-page main { padding-right: 32px; }

.content h1 {
  font-size: 2.15rem; line-height: 1.2; letter-spacing: -0.02em;
  color: var(--heading); margin: 0 0 14px; font-weight: 700;
}
.content h2 {
  font-size: 1.4rem; line-height: 1.3; letter-spacing: -0.01em;
  color: var(--heading-soft); font-weight: 650;
  margin: 44px 0 14px; padding-top: 22px; border-top: 1px solid var(--border);
}
.content h3 {
  font-size: 1.08rem; color: var(--text-strong); font-weight: 650;
  margin: 30px 0 10px;
}
.content h4 {
  font-size: 0.97rem; color: var(--text-strong); font-weight: 650;
  margin: 24px 0 8px;
}

.anchor {
  opacity: 0; margin-left: 8px; font-weight: 400; color: var(--text-faint);
  text-decoration: none; transition: opacity 0.15s;
}
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
.anchor:hover { color: var(--heading); text-decoration: none; }

.lede { font-size: 1.08rem; line-height: 1.6; color: var(--text-muted); margin: 0 0 8px; }

.content p { margin: 0 0 16px; }
.content ul, .content ol { margin: 0 0 16px; padding-left: 24px; }
.content li { margin-bottom: 7px; }
.content strong { color: var(--text-strong); font-weight: 650; }
.content hr { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }

.content code {
  font-family: var(--font-mono); font-size: 0.855em;
  padding: 0.15em 0.4em; border-radius: 4px;
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--border);
}
.content pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  overflow-x: auto; margin: 0 0 18px; line-height: 1.55;
}
.content pre code {
  background: none; border: 0; padding: 0; font-size: 13px; color: var(--code-text);
  white-space: pre;
}

/* Tables carry most of a data reference. */
.table-wrap {
  overflow-x: auto; margin: 0 0 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elevated);
}
.content table { border-collapse: collapse; width: 100%; font-size: 14px; }
.content thead th {
  background: var(--bg-sunken); color: var(--text-strong);
  font-weight: 650; font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 9px 14px; border-bottom: 1px solid var(--border-strong);
  white-space: nowrap; text-align: left;
}
.content tbody td, .content tbody th {
  padding: 9px 14px; border-top: 1px solid var(--border);
  vertical-align: top; text-align: left; font-weight: 400;
}
.content tbody tr:first-child td, .content tbody tr:first-child th { border-top: 0; }
.content tbody tr:hover { background: var(--surface); }
.align-left { text-align: left; }
.align-right { text-align: right; }
.align-center { text-align: center; }
.content td code { white-space: nowrap; }

/* Stat block on an entry page: label column, value column, inline hint. */
.stat-table tbody th {
  width: 190px; color: var(--text-muted); font-weight: 500; white-space: nowrap;
}
.stat-table tbody td strong { color: var(--text-strong); font-size: 15px; }
.stat-hint { display: block; font-size: 12.5px; color: var(--text-faint);
             line-height: 1.45; margin-top: 2px; }

.item-list { line-height: 2; }
.item-list a { white-space: nowrap; }

/* Callouts */
.callout {
  display: flex; gap: 12px; margin: 0 0 20px;
  padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--note); border-radius: var(--radius);
}
.callout-tip { border-left-color: var(--tip); }
.callout-warning { border-left-color: var(--warning); }
.callout-label {
  flex: none; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--note); padding-top: 4px; width: 62px;
}
.callout-tip .callout-label { color: var(--tip); }
.callout-warning .callout-label { color: var(--warning); }
.callout-body { min-width: 0; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-body p { margin-bottom: 10px; }

/* Card grids */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 14px; margin: 0 0 24px;
}
.card {
  display: block; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover {
  border-color: var(--accent-border); text-decoration: none;
  transform: translateY(-2px); box-shadow: var(--shadow);
}
.card-soon { opacity: 0.6; }
.card strong { display: block; color: var(--heading-soft); margin-bottom: 5px;
               font-size: 15px; }
.card span { display: block; font-size: 13.5px; color: var(--text-muted);
             line-height: 1.5; }

/* ==========================================================================
   Entry pages
   ========================================================================== */

.entry-photo { margin: 0 0 20px; }
.entry-photo img {
  display: block; width: 100%; max-width: 560px; height: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-sunken);
}
.entry-photo figcaption { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }

/* Screenshots on written pages. No width is set, so a wide capture fills the
   column and a narrow strip of toolbar icons stays at its own size instead of
   being blown up. */
.shot { margin: 0 0 22px; }
.shot img {
  display: block; max-width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-sunken);
}
.shot figcaption { font-size: 12.5px; color: var(--text-faint); margin-top: 7px; }

/* A single icon lifted out of a screenshot, sitting in running prose. */
.glyph {
  height: 1.35em; width: auto; vertical-align: text-bottom;
  border-radius: 3px; background: var(--bg-sunken);
}

/* A placeholder is a hint, not the subject of the page. */
.entry-photo.is-placeholder { display: flex; align-items: center; gap: 12px; }
.entry-photo.is-placeholder img {
  width: 132px; height: 88px; object-fit: cover; opacity: 0.45;
}
.entry-photo.is-placeholder figcaption { margin-top: 0; }

.entry-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px;
}
.entry-meta span {
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 5px 11px; font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text);
}
.entry-meta em {
  font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-faint);
}

/* Country ensign, on entry pages and in the browse tables. Decorative, so the
   alt is empty and the country name beside it carries the meaning. The hairline
   keeps a white or light flag from dissolving into the light theme. */
.ensign {
  height: 12px; width: auto; border-radius: 2px;
  border: 1px solid var(--border); vertical-align: baseline;
}
.entry-meta .ensign { align-self: center; height: 13px; }
.catalog-table .ensign { margin-right: 7px; }

details.setup {
  margin: 0 0 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-elevated);
}
details.setup summary {
  padding: 10px 14px; cursor: pointer; font-weight: 600;
  color: var(--text-strong); font-size: 14.5px;
}
details.setup summary:hover { background: var(--surface); }
details.setup[open] summary { border-bottom: 1px solid var(--border); }
details.setup .table-wrap { margin: 0; border: 0; border-radius: 0; }

/* ==========================================================================
   Catalog browse tables
   ========================================================================== */

.filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  padding: 14px 16px; margin: 0 0 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filters label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-faint);
}
.filters label.grow { flex: 1; min-width: 180px; }
.filters select, .filters input {
  font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0;
  padding: 7px 10px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.filters input[type="number"] { width: 110px; }
.filters select:focus, .filters input:focus {
  outline: 2px solid var(--link); outline-offset: -1px;
}
.filters button {
  font: inherit; font-size: 14px; padding: 8px 14px; cursor: pointer;
  color: var(--text); background: var(--bg-sunken);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.filters button:hover { background: var(--surface-hover); color: var(--text-strong); }

.result-count { font-size: 13px; color: var(--text-faint); margin: 0 0 10px; }

.catalog-wrap { max-height: 74vh; overflow: auto; }
.catalog-table { font-size: 13.5px; }
.catalog-table thead th { position: sticky; top: 0; z-index: 2; }
.catalog-table th.sortable { cursor: pointer; user-select: none; padding-right: 26px; }
.catalog-table th.sortable:hover { color: var(--heading-soft); }
.catalog-table th.sortable::after {
  content: '\2195'; position: absolute; right: 10px; opacity: 0.3; font-size: 11px;
}
.catalog-table th.sort-asc::after { content: '\2191'; opacity: 1; color: var(--heading); }
.catalog-table th.sort-desc::after { content: '\2193'; opacity: 1; color: var(--heading); }
.catalog-table tbody td { padding: 7px 14px; white-space: nowrap; }
.catalog-table tbody td.col-name { white-space: normal; min-width: 200px; }
.catalog-table tbody tr:hover { background: var(--surface); }

/* Keep catalog scrolling inside the table region. This leaves the heading and
   filters in place and gives the sticky column headers a stable scroll container. */
@media (min-width: 861px) {
  .catalog-page .layout { height: calc(100vh - var(--topbar-h)); }
  .catalog-page main { height: 100%; overflow: hidden; padding-bottom: 24px; }
  .catalog-page .content {
    display: flex; flex-direction: column; height: 100%; min-height: 0;
  }
  .catalog-page .catalog-wrap {
    flex: 1 1 auto; min-height: 0; max-height: none;
  }
}

/* Target-type chips, colored from the game's own affiliation palette. */
.tgt { display: inline-block; width: 17px; margin-right: 2px; text-align: center;
       font-size: 11px; font-weight: 700; line-height: 16px; border-radius: 3px;
       color: var(--bg); }
.tgt-A { background: var(--t-air); }
.tgt-U { background: var(--t-surface); }
.tgt-S { background: var(--t-sub); }
.tgt-L { background: var(--t-land); }
html[data-theme='light'] .tgt { color: #ffffff; }

/* ==========================================================================
   Pager, footer
   ========================================================================== */

.pager {
  display: flex; gap: 14px; max-width: var(--content-max);
  margin: 52px 0 0; padding-top: 24px; border-top: 1px solid var(--border);
}
.pager-link {
  flex: 1; padding: 13px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.pager-link:hover { border-color: var(--accent-border); text-decoration: none; }
.pager-link span { display: block; font-size: 12px; color: var(--text-faint);
                   margin-bottom: 3px; }
.pager-link strong { display: block; color: var(--text-strong); font-size: 14.5px;
                     font-weight: 600; }
.pager-link.next { text-align: right; }
.pager-link.prev + .pager-link.next { margin-left: auto; }
.pager-link.next:only-child { margin-left: auto; flex: 0 1 50%; }

.page-footer {
  max-width: var(--content-max); margin-top: 44px; padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-faint);
}
.footer-note { margin-top: 6px; }

/* ==========================================================================
   Search
   ========================================================================== */

.search-modal {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(9, 16, 38, 0.7);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 20px 20px;
}
.search-modal[hidden] { display: none; }

.search-panel {
  width: 100%; max-width: 660px;
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow-panel); overflow: hidden;
}
.search-input-row {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.search-input-row svg { width: 17px; height: 17px; flex: none; color: var(--text-faint); }
#search-input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--text-strong); font: inherit; font-size: 15.5px;
}
#search-input::placeholder { color: var(--text-faint); }

.search-results { max-height: 58vh; overflow-y: auto; padding: 8px; }
.search-empty { padding: 26px 16px; text-align: center; color: var(--text-faint);
                font-size: 14px; }
.search-group-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-faint); padding: 10px 12px 5px;
}
.search-hit {
  display: block; padding: 9px 12px; border-radius: var(--radius-sm);
  color: inherit; border: 1px solid transparent;
}
.search-hit:hover, .search-hit.selected {
  background: var(--surface-hover); text-decoration: none; border-color: var(--border);
}
.search-hit .hit-section { font-size: 11.5px; color: var(--text-faint);
                           text-transform: uppercase; letter-spacing: 0.05em; }
.search-hit .hit-title { color: var(--text-strong); font-weight: 600;
                         font-size: 14.5px; margin: 2px 0; }
.search-hit .hit-snippet { font-size: 13px; color: var(--text-muted); line-height: 1.5;
                           display: -webkit-box; -webkit-line-clamp: 2;
                           -webkit-box-orient: vertical; overflow: hidden; }
.search-hit mark { background: var(--accent-soft); color: var(--heading-soft);
                   border-radius: 3px; padding: 0 2px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1240px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
  main { padding: 30px 32px 60px; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: inline-flex; }
  .brand-text em { display: none; }
  .topbar-link { display: none; }
  .search-trigger { flex: none; width: 34px; justify-content: center; padding: 0;
                    max-width: none; }
  .search-trigger span, .search-trigger kbd { display: none; }

  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; z-index: 80;
    width: min(84vw, var(--sidebar-w));
    background: var(--bg);
    transform: translateX(-102%); transition: transform 0.22s ease;
    box-shadow: var(--shadow-panel);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-scrim {
    display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 70;
    background: rgba(9, 16, 38, 0.6);
  }
  main { padding: 24px 18px 56px; }
  .content h1 { font-size: 1.78rem; }
  .pager { flex-direction: column; }
  .search-modal { padding: 6vh 12px 12px; }
  .filters label.grow { min-width: 140px; }
  .stat-table tbody th { width: auto; }
  .catalog-wrap { max-height: 70vh; }
}

@media print {
  .topbar, .sidebar, .toc, .pager, .search-modal, .breadcrumb, .filters { display: none; }
  .layout { display: block; }
  main { padding: 0; }
  .catalog-wrap { max-height: none; overflow: visible; }
}
