/* ==========================================================================
   FiveLeak

   Design intent: a file index, not a landing page. Utilitarian, tactile,
   archival — closer to a package registry or a drafting sheet than to a SaaS
   product site.

   The four rules that hold it together:
     1. Monospace is load-bearing. Anything that is data — filenames, versions,
        byte counts, slugs, counts, timestamps — is set in mono. Prose is not.
     2. The accent is scarce. The brand violet appears on small marks and text
        only, never as a large fill, or it stops meaning anything.
     3. The gradient lives in the logo, not the interface. No gradient text, no
        gradient buttons, no glass. The mark carries the shine; the UI stays flat
        so the mark is the only thing that shines.
     4. Motion is near-zero. Nothing lifts, nothing scales, nothing exceeds
        120ms. Tools feel fast when they hold still.

   Sections: tokens · reset · primitives · header · index rows · masthead ·
             browse · detail · requests · auth · admin · legal · 404 · ban ·
             footer · responsive
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* Cool near-black, drawn from the brand assets, which are chrome-on-black.
     Not pure #000: a few points of lift keeps long reading comfortable and
     lets the surface steps read as distinct planes. */
  --bg:          #0a0a0d;
  --bg-sunk:     #060608;
  --surface:     #131318;
  --surface-2:   #1b1b22;
  --surface-3:   #24242c;

  --line:        #282830;
  --line-soft:   #1b1b22;
  --line-hi:     #383842;

  /* Cool off-white matching the logo's chrome. Four distinct steps, every one
     clearing WCAG AA (4.5:1) against both --bg and --surface. Solved for, not
     eyeballed. Contrast on --surface: 15.97 / 9.25 / 6.27 / 4.57. */
  --text:        #eceef5;
  --text-2:      #b5b7bf;
  --text-3:      #94969e;
  --text-4:      #7c7e86;

  /* The periwinkle violet from the logo's gradient, taken as one flat colour.
     The gradient belongs to the mark; the interface does not repeat it.
     Small marks and text only — never a large fill. */
  --accent:      #9f8cff;
  --accent-dim:  #6f5fd0;
  --accent-wash: rgba(159, 140, 255, .12);

  --rust:        #ff7a6b;
  --rust-wash:   rgba(255, 122, 107, .10);
  --sage:        #5fd6a4;
  --sage-wash:   rgba(95, 214, 164, .10);
  --amber:       #ffc46b;

  /* Framework identity colours. Deliberately desaturated so they read as
     categorisation, never as decoration competing with the accent. */
  --fw-standalone: #8a8d99;
  --fw-esx:        #6fb3d9;
  --fw-qbcore:     #e08a7a;
  --fw-qbox:       #c08ae0;
  --fw-other:      #8a8d99;

  /* 3px, not 20px. Rounded cards are the template signature. */
  --r:     3px;
  --r-lg:  4px;

  --font:  'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1220px;
  --fast:  90ms ease-out;

  /*
    Spacing scale. Every padding, margin and gap in this file is one of:
      2  4  6  8  10  12  16  20  24  32  40  48  56  64  80  96
    Nothing off-scale. Arbitrary one-off values are the single most reliable
    sign that a layout was assembled rather than designed, because they leave
    the page with no underlying rhythm for the eye to lock onto.
  */
}

/* --- Reset ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.08; letter-spacing: -.025em; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }

a { color: var(--accent); text-decoration: none; transition: color var(--fast); }
a:hover { color: var(--text); }

img, svg { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; }

code, kbd { font-family: var(--mono); font-size: .9em; color: var(--text-2); }

/* Hard focus ring, no glow. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.dim, .muted { color: var(--text-3); }
.is-accent { color: var(--accent) !important; }
.is-muted { color: var(--text-3) !important; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 24px; }
.site-main { flex: 1; padding-bottom: 96px; }
.section { padding-top: 56px; }

/* --- Primitives ----------------------------------------------------------- */

/* Structural label: small, uppercase, wide. Used as a section marker only. */
.rail-label, .field-label, .metric-label, .legal-toc-label, .admin-inline-label,
.ban-eyebrow, .download-eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  /* text-3 rather than text-4: at 10.5px uppercase these are near the limit of
     legibility, and --text-4 only clears ~3.2:1 against the surface. */
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 1.0625rem; font-weight: 700; display: flex; align-items: baseline; gap: 12px; }

/* Numbered sections. A print/index convention — cheap, and it signals order. */
.section-index {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: .1em;
}

.rule-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .9375rem;
  margin-bottom: 16px;
}
.rule-head span { flex-shrink: 0; }
.rule-head::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.link-arrow { font-size: .8125rem; color: var(--text-3); font-family: var(--mono); }
.link-arrow::after { content: ' →'; }
.link-arrow:hover { color: var(--accent); }

/* Flat panel. No shadow, no big radius — this is a sheet, not a floating card. */
.panel, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

/*
  Signature: corner ticks. 1px L-shaped drafting marks instead of rounded
  corners and drop shadows. Two pseudo-elements, four corners, no extra markup.
*/
.ticked { position: relative; }
.ticked::before, .ticked::after {
  content: '';
  position: absolute;
  width: 7px; height: 7px;
  pointer-events: none;
  border-color: var(--accent);
  border-style: solid;
}
.ticked::before {
  top: -1px; left: -1px;
  border-width: 1px 0 0 1px;
}
.ticked::after {
  bottom: -1px; right: -1px;
  border-width: 0 1px 1px 0;
}

/* Buttons: square, flat, no gradient. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--r);
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.btn svg { width: 14px; height: 14px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #0d0a1a; }
.btn-primary:hover { background: #b3a3ff; border-color: #b3a3ff; color: #0d0a1a; }

.btn-ghost { background: transparent; border-color: var(--line-hi); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--text-4); color: var(--text); }

/* Affirmative but subordinate: reads as the primary of its group without
   claiming the page's attention the way a filled accent block would. */
.btn-ghost.is-affirm { border-color: var(--accent-dim); color: var(--accent); }
.btn-ghost.is-affirm:hover { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }

.btn-danger { background: transparent; border-color: rgba(255, 122, 107, .4); color: var(--rust); }
.btn-danger:hover { background: var(--rust-wash); border-color: var(--rust); color: var(--rust); }

.btn-sm { padding: 6px 12px; font-size: .75rem; }
.btn-lg { padding: 12px 20px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .5; pointer-events: none; }

/* Search: a mono slash prefix instead of a magnifier icon. Reads as a command. */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  background: var(--bg-sunk);
  transition: border-color var(--fast);
}
.search-bar:focus-within { border-color: var(--accent-dim); }
.search-prefix {
  padding: 0 2px 0 12px;
  font-family: var(--mono);
  font-size: .875rem;
  color: var(--accent);
  user-select: none;
}
.search-bar input {
  flex: 1;
  min-width: 0;
  padding: 12px 12px;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: .8125rem;
}
.search-bar input:focus { outline: none; }
.search-bar input::placeholder { color: var(--text-4); }
.search-bar button {
  padding: 12px 16px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.search-bar button:hover { background: var(--accent); color: #0d0a1a; }
.search-bar--sm input { padding: 8px 10px; font-size: .75rem; }

.input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  background: var(--bg-sunk);
  color: var(--text);
  font: inherit;
  font-size: .8125rem;
  transition: border-color var(--fast);
}
.input::placeholder { color: var(--text-4); }
.input:focus { outline: none; border-color: var(--accent-dim); }
.input-sm { padding: 4px 8px; font-size: .75rem; }

select.input {
  appearance: none;
  font-family: var(--mono);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c7a72' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
  padding-right: 32px;
}

.textarea { resize: vertical; min-height: 120px; line-height: 1.6; font-family: var(--font); }

.input-file { padding: 8px 10px; cursor: pointer; font-family: var(--mono); font-size: .75rem; }
.input-file::file-selector-button {
  margin-right: 10px;
  padding: 4px 12px;
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: .6875rem;
  font-weight: 600;
  cursor: pointer;
}
.input-file::file-selector-button:hover { background: var(--surface-3); color: var(--text); }

.field { display: block; margin-bottom: 16px; }
.field-label { margin-bottom: 8px; }
.field-label em { font-style: normal; color: var(--accent); margin-left: 6px; }
.field-hint { display: block; margin-top: 6px; font-size: .75rem; color: var(--text-4); letter-spacing: 0; text-transform: none; font-family: var(--font); }

.checkbox, .radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: .8125rem;
  color: var(--text-2);
  cursor: pointer;
}
.checkbox input, .radio input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.checkbox:hover, .radio:hover { color: var(--text); }

.form-error {
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 122, 107, .35);
  border-left-width: 2px;
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--rust-wash);
  color: #ffa593;
  font-size: .8125rem;
}
.form-error ul { margin-top: 8px; padding-left: 16px; list-style: disc; }

.form-actions { display: flex; gap: 8px; margin-top: 4px; }

/* Turnstile renders a fixed-height iframe; the slot reserves the space so the
   submit button does not jump when the widget finishes loading. */
.turnstile-slot { margin: 0 0 16px; min-height: 65px; }
.turnstile-slot:empty { display: none; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/*
  The manifest block. Metadata as an aligned mono key/value stack, echoing an
  fxmanifest.lua excerpt. Used identically on the masthead, the resource page
  and anywhere else metadata appears — that repetition is what makes it a motif
  rather than a one-off flourish.
*/
.manifest { margin: 0; display: grid; gap: 0; font-family: var(--mono); font-size: .75rem; }
.manifest > div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.manifest > div:last-child { border-bottom: 0; }
.manifest dt { color: var(--text-4); }
.manifest dd { margin: 0; color: var(--text); }

/* A filename is one long unbreakable token and the value column is narrow, so
   it gets its own line rather than being hyphen-hacked in half. */
.manifest > div.is-stacked { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.manifest dd.is-wrap { overflow-wrap: anywhere; color: var(--text-2); }

/* Framework tag: a coloured dot plus mono text. Quieter than a filled pill. */
.fw-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: .6875rem;
  color: var(--text-3);
  white-space: nowrap;
}
.fw-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--fw, var(--fw-standalone)); flex-shrink: 0; }
.fw-tag--lg { font-size: .8125rem; gap: 8px; }
.fw-tag--lg .fw-dot { width: 6px; height: 6px; }

.res-row--standalone { --fw: var(--fw-standalone); }
.res-row--esx        { --fw: var(--fw-esx); }
.res-row--qbcore     { --fw: var(--fw-qbcore); }
.res-row--qbox       { --fw: var(--fw-qbox); }
.res-row--other      { --fw: var(--fw-other); }

.res-flag {
  font-family: var(--mono);
  font-size: .625rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  border: 1px solid rgba(212, 224, 67, .3);
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
}
.res-flag--warn { color: var(--amber); border-color: rgba(255, 196, 107, .3); }

.chip {
  padding: 4px 8px;
  border: 1px solid var(--line-hi);
  border-radius: 2px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: .6875rem;
  color: var(--text-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: .625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}
.badge-ok     { background: var(--sage-wash); color: var(--sage); }
.badge-muted  { background: var(--surface-2); color: var(--text-3); }
.badge-accent { background: var(--accent-wash); color: var(--accent); }
.badge-danger { background: var(--rust-wash); color: var(--rust); }
.badge-soft   { background: var(--surface-2); color: var(--text-2); }
.badge-draft  { background: rgba(217, 164, 65, .1); color: var(--amber); }

.pill {
  display: inline-block;
  padding: 0 4px;
  border-radius: 2px;
  background: var(--surface-3);
  color: var(--text-3);
  font-family: var(--mono);
  font-size: .625rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.pill-accent { background: var(--accent-wash); color: var(--accent); }

/* --- Header --------------------------------------------------------------- */

/*
  Flat and opaque. The blurred translucent header is a template signature; a
  solid bar with a single hairline reads as an application chrome instead.
*/
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; gap: 24px; height: 56px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); }

/*
  The monogram, two-tone like the original: chrome-white F, violet L. The source
  logo carries a bevel, a gradient and an outer glow — all of which turn to mush
  at this size, so the UI uses a flat cut of the same geometry and leaves the
  glossy lockup for display contexts.
*/
.mark { width: 24px; height: 24px; flex-shrink: 0; overflow: visible; }
.mark .mark-f { fill: currentColor; }
.mark .mark-l { fill: var(--accent); stroke: var(--bg); }

.brand { color: var(--text); }
.brand-text { font-size: .9375rem; font-weight: 800; letter-spacing: -.04em; }

/* Footer sits on --bg-sunk, so the knockout stroke has to match that instead. */
.footer-brand .mark { width: 26px; height: 26px; }
.footer-brand .mark .mark-f { fill: var(--text-3); }
.footer-brand .mark .mark-l { stroke: var(--bg-sunk); }

.brand-mark-lg { display: block; margin-bottom: 16px; color: var(--text); }
.brand-mark-lg .mark { width: 34px; height: 34px; }
.brand-mark-lg .mark .mark-l { stroke: var(--surface); }

/* Display lockup. Given room to breathe and nothing stacked on top of it. */
.auth-wordmark { width: 100%; max-width: 210px; height: auto; margin-bottom: 20px; }

.site-nav { display: flex; gap: 2px; }
.site-nav a {
  padding: 4px 10px;
  border-radius: 2px;
  color: var(--text-3);
  font-size: .8125rem;
  font-weight: 500;
  transition: color var(--fast), background var(--fast);
}
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a.is-active { color: var(--text); background: var(--surface-2); }

/* The header bar is itself a .search-bar, so these are compound rather than
   descendant selectors — it has no inner wrapper to target. */
.header-search {
  flex: 1;
  max-width: 260px;
  margin-left: auto;
  background: var(--surface);
  border-color: var(--line);
}
.header-search input { padding: 6px 10px; font-size: .75rem; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.avatar {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 2px;
  background: var(--surface-3);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: .625rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-chip { position: relative; }
.user-chip-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: .8125rem;
  cursor: pointer;
  transition: border-color var(--fast), color var(--fast);
}
.user-chip-button:hover { border-color: var(--line-hi); color: var(--text); }
.user-chip-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
}
.user-menu-head { padding: 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu-head strong { display: block; font-size: .8125rem; }
.user-menu-head span { font-family: var(--mono); font-size: .625rem; color: var(--text-4); text-transform: uppercase; letter-spacing: .1em; }
.user-menu a, .user-menu-signout {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: .8125rem;
  text-align: left;
  cursor: pointer;
}
.user-menu a:hover, .user-menu-signout:hover { background: var(--surface-2); color: var(--text); }
.user-menu-signout { color: var(--rust); }

/* --- Flash ---------------------------------------------------------------- */

.flash-stack { padding-top: 16px; display: grid; gap: 8px; }
.flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-hi);
  border-left-width: 2px;
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--surface);
  font-size: .8125rem;
}
.flash-mark { font-family: var(--mono); font-weight: 700; color: var(--text-3); }
.flash-success { border-left-color: var(--sage); background: var(--sage-wash); }
.flash-success .flash-mark { color: var(--sage); }
.flash-error { border-left-color: var(--rust); background: var(--rust-wash); }
.flash-error .flash-mark { color: var(--rust); }
.flash-close {
  margin-left: auto;
  border: 0; background: none; color: var(--text-4);
  font-size: 1.125rem; line-height: 1; cursor: pointer; padding: 0 2px;
}
.flash-close:hover { color: var(--text); }

/* --- Masthead ------------------------------------------------------------- */

.masthead { padding: 64px 0 8px; border-bottom: 1px solid var(--line); }
.masthead-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 64px;
  align-items: end;
  padding-bottom: 48px;
}

.masthead h1 {
  font-size: clamp(2.125rem, 4.6vw, 3.375rem);
  font-weight: 800;
  letter-spacing: -.042em;
  line-height: 1.02;
}
.masthead-copy > p {
  margin-top: 16px;
  max-width: 46ch;
  color: var(--text-2);
  font-size: .9375rem;
}
.masthead .search-bar { margin-top: 24px; max-width: 460px; }

.masthead-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: .75rem;
}
.masthead-jump span { color: var(--text-4); }
.masthead-jump a { color: var(--text-3); }
.masthead-jump a:hover { color: var(--accent); }

.masthead-manifest { border: 1px solid var(--line); padding: 4px 16px; background: var(--surface); }

/* --- Index rows ----------------------------------------------------------- */

/*
  The core layout. Rows, not cards: a resource is a file plus metadata, and a
  dense list lets the eye run down the version/size/pulls columns to compare.
  Hairline separators only — no per-row borders, shadows or hover lift.
*/
.res-index { border-top: 1px solid var(--line-soft); }

.res-row {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 16px 16px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--fast);
}
.res-row:hover { background: var(--surface); }

/* Accent edge on hover instead of a lift. Instant, no easing drama. */
.res-row::before {
  content: '';
  position: absolute;
  left: 0; top: -1px; bottom: -1px;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--fast);
}
.res-row:hover::before { opacity: 1; }
.res-row.is-featured::before { opacity: .45; }

.res-thumb {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-sunk);
  overflow: hidden;
}
.res-thumb img { width: 100%; height: 100%; object-fit: cover; }
.res-thumb-initials {
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--fw, var(--text-4));
  letter-spacing: -.03em;
}

.res-main { min-width: 0; }
.res-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }

.res-title { font-size: .9375rem; font-weight: 600; letter-spacing: -.015em; }
/* Whole-row click target without nesting links inside links. */
.res-title a { color: var(--text); }
.res-title a::after { content: ''; position: absolute; inset: 0; }
.res-row:hover .res-title a { color: var(--accent); }

.res-summary {
  margin-top: 4px;
  max-width: 78ch;
  color: var(--text-3);
  font-size: .8125rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.res-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: .6875rem;
}
.res-cat { color: var(--text-4); }
.res-cat::before { content: '# '; }

.res-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.res-tags a {
  position: relative;
  z-index: 1;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text-4);
  font-family: var(--mono);
  font-size: .6875rem;
}
.res-tags a:hover { border-color: var(--accent-dim); color: var(--accent); }
.res-tags--lg { gap: 8px; }
.res-tags--lg a { padding: 4px 10px; font-size: .75rem; }

/* The scan rail. Fixed column widths so values line up down the whole index. */
.res-meta {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 24px;
  padding-top: 2px;
  text-align: right;
}
.res-meta-cell { display: grid; gap: 2px; min-width: 52px; }
.res-meta-cell b {
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.res-meta-cell em {
  font-style: normal;
  font-family: var(--mono);
  font-size: .5625rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .11em;
}
.res-row:hover .res-meta-cell b { color: var(--text); }

/* --- Categories ----------------------------------------------------------- */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 2px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.cat-cell {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  transition: background var(--fast);
}
.cat-cell:hover { background: var(--surface); color: var(--text); }
.cat-count { font-family: var(--mono); font-size: .6875rem; color: var(--accent); letter-spacing: .08em; }
.cat-name { font-size: .9375rem; font-weight: 600; letter-spacing: -.02em; }
.cat-desc { font-size: .75rem; color: var(--text-4); line-height: 1.5; }

.empty-state {
  padding: 48px 24px;
  border: 1px dashed var(--line-hi);
  text-align: center;
}
.empty-state h3 { font-size: 1rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-3); font-size: .8125rem; }

/* --- Page heads & browse -------------------------------------------------- */

.page-head { padding: 40px 0 24px; }
.page-head h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.035em; }
.page-head-meta, .page-head > p { margin-top: 8px; font-family: var(--mono); font-size: .75rem; color: var(--text-3); }
.page-head-split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }

.narrow-page { max-width: 780px; }

.browse-layout { display: grid; grid-template-columns: 186px minmax(0, 1fr); gap: 40px; align-items: start; }

/* No card chrome on the rail — it would compete with the index it filters. */
.filter-rail { position: sticky; top: 74px; }
.filter-group { margin-bottom: 24px; }
.filter-group .rail-label { margin-bottom: 8px; }
.rail-list { display: grid; gap: 2px; }

.rail-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.rail-opt:hover { background: var(--surface); color: var(--text); }
.rail-opt input { appearance: none; width: 5px; height: 5px; border-radius: 50%; background: var(--line-hi); margin: 0; flex-shrink: 0; cursor: pointer; }
.rail-opt input:checked { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.rail-opt:has(input:checked) { color: var(--text); }
.rail-opt em { margin-left: auto; font-style: normal; color: var(--text-4); font-size: .6875rem; }
.filter-actions { display: grid; gap: 6px; }

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 30px;
  padding-bottom: 12px;
}
.active-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: .6875rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .1em;
  flex-shrink: 0;
}

.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 32px; }
.page-num, .page-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px; height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: .75rem;
  transition: border-color var(--fast), color var(--fast), background var(--fast);
}
.page-num:hover, .page-arrow:hover { border-color: var(--line-hi); background: var(--surface); color: var(--text); }
.page-num.is-current { background: var(--accent); border-color: var(--accent); color: #0d0a1a; }
.page-arrow.is-disabled { opacity: .3; pointer-events: none; }
.page-gap { color: var(--text-4); padding: 0 2px; font-family: var(--mono); }

/* --- Resource detail ------------------------------------------------------ */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 24px 0 0;
  font-family: var(--mono);
  font-size: .6875rem;
  color: var(--text-4);
}
.breadcrumb a { color: var(--text-4); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-current { color: var(--text-2); }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 48px; align-items: start; padding-top: 24px; }
.detail-main { min-width: 0; }

.detail-head { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.detail-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.detail-head h1 { font-size: clamp(1.625rem, 3.4vw, 2.25rem); font-weight: 800; letter-spacing: -.038em; }
.detail-summary { margin-top: 12px; max-width: 62ch; color: var(--text-2); font-size: .9375rem; }

.detail-byline { display: flex; align-items: center; gap: 8px; margin-top: 20px; font-size: .8125rem; color: var(--text-3); }
.detail-byline strong { color: var(--text-2); font-weight: 600; }

.detail-shot { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--bg-sunk); }
.detail-shot img { width: 100%; }

.detail-section { margin-top: 32px; }

.prose { color: var(--text-2); font-size: .875rem; line-height: 1.75; max-width: 68ch; }
.prose p { margin-bottom: 12px; }
.prose p:last-child { margin-bottom: 0; }

.detail-side { position: sticky; top: 74px; display: grid; gap: 12px; }

.download-panel { padding: 16px; }
.download-panel .manifest { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.download-panel .btn-ghost { margin-top: 12px; }
.download-note { margin-top: 10px; font-size: .6875rem; color: var(--text-4); line-height: 1.5; text-align: center; }

.admin-inline-card { padding: 12px; }
.admin-inline-label { margin-bottom: 10px; color: var(--amber); }

/* --- Requests ------------------------------------------------------------- */

.status-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.status-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 2px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: .75rem;
  transition: background var(--fast), color var(--fast);
}
.status-tabs a span { color: var(--text-4); font-size: .6875rem; }
.status-tabs a:hover { background: var(--surface); color: var(--text); }
.status-tabs a.is-active { background: var(--surface-2); color: var(--text); }
.status-tabs a.is-active span { color: var(--accent); }

.sort-link { font-family: var(--mono); font-size: .75rem; color: var(--text-4); padding: 2px 4px; text-transform: none; letter-spacing: 0; }
.sort-link.is-active { color: var(--accent); }

.request-list { border-top: 1px solid var(--line-soft); }
.request-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 12px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  transition: background var(--fast);
}
.request-card:hover { background: var(--surface); }
.request-card.is-closed { opacity: .6; }
.request-card:target { background: var(--accent-wash); }

.vote-cell { display: flex; justify-content: center; }
.vote-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 46px;
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-sunk);
  color: var(--text-3);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--fast), color var(--fast), background var(--fast);
}
.vote-button svg { width: 14px; height: 14px; }
.vote-count { font-family: var(--mono); font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.vote-button:hover { border-color: var(--accent-dim); color: var(--accent); }
.vote-button.is-voted { border-color: var(--accent-dim); background: var(--accent-wash); color: var(--accent); }
.vote-button.is-static { cursor: default; opacity: .6; }
.vote-button.is-static:hover { border-color: var(--line); color: var(--text-3); }

.request-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.request-category { font-family: var(--mono); font-size: .6875rem; color: var(--text-4); }
.request-title { font-size: .9375rem; font-weight: 600; margin-bottom: 8px; letter-spacing: -.015em; }
.request-details { font-size: .8125rem; color: var(--text-3); white-space: pre-wrap; max-width: 80ch; }
.request-reference { display: inline-block; margin-top: 8px; font-family: var(--mono); font-size: .75rem; }

/*
  These two used to wear a coloured left bar. Neither is an alert, and a left
  accent stripe on ordinary content is a well-worn tell — it borrows an alert's
  urgency for something that is just a note. Both now use the site's own
  language instead: a mono label and a hairline.
*/
.request-resolution {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 12px;
  color: var(--sage);
  font-family: var(--mono);
  font-size: .75rem;
}
.request-resolution::before { content: '→'; }

.request-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-hi);
  font-size: .75rem;
  color: var(--text-3);
}
.request-note strong {
  font-family: var(--mono);
  font-size: .6875rem;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-right: 6px;
}
.request-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-family: var(--mono); font-size: .6875rem; color: var(--text-4); }

/* --- Auth ----------------------------------------------------------------- */

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 340px);
  gap: 56px;
  align-items: center;
  justify-content: center;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 64px 24px;
}
.auth-card { padding: 32px; }
.auth-head { margin-bottom: 24px; }
.auth-head .brand-mark-lg { width: 30px; height: 30px; margin-bottom: 16px; }
.auth-head h1 { font-size: 1.375rem; font-weight: 800; letter-spacing: -.035em; }
.auth-head p { margin-top: 8px; color: var(--text-3); font-size: .8125rem; }
.auth-alt { margin-top: 16px; font-size: .8125rem; color: var(--text-4); }

.auth-aside h2 { font-size: 1.125rem; letter-spacing: -.03em; }
.auth-points { margin-top: 20px; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 10px; font-size: .8125rem; color: var(--text-3); }
.auth-points span { color: var(--accent); font-family: var(--mono); font-size: .625rem; line-height: 2; }
.auth-back { display: inline-block; margin-top: 24px; font-family: var(--mono); font-size: .75rem; color: var(--text-4); }

/* --- Admin ---------------------------------------------------------------- */

.admin-layout { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 40px; padding-top: 32px; align-items: start; }

.admin-nav { display: grid; gap: 2px; position: sticky; top: 74px; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 2px;
  color: var(--text-3);
  font-size: .8125rem;
  transition: background var(--fast), color var(--fast);
}
.admin-nav a svg { width: 14px; height: 14px; opacity: .7; }
.admin-nav a:hover { background: var(--surface); color: var(--text); }
.admin-nav a.is-active { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.admin-nav-cta { margin-top: 12px; border: 1px dashed var(--line-hi); color: var(--accent) !important; }
.admin-nav-cta:hover { border-color: var(--accent-dim); background: var(--accent-wash) !important; }

.admin-content { display: grid; gap: 20px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.admin-head h1 { font-size: 1.375rem; font-weight: 800; letter-spacing: -.035em; }
.admin-head p { margin-top: 8px; color: var(--text-3); font-size: .8125rem; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 2px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.metric { padding: 16px 16px; background: var(--bg); border: 0; border-radius: 0; }
.metric-value {
  display: block;
  margin: 8px 0 4px;
  font-family: var(--mono);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.metric-sub { font-size: .6875rem; color: var(--text-4); }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.admin-grid-sidebar { grid-template-columns: minmax(0, 1fr) 284px; align-items: start; }

.admin-panel { padding: 16px 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: .875rem; }
.panel-note, .panel-link { font-family: var(--mono); font-size: .6875rem; color: var(--text-4); }
.panel-link:hover { color: var(--accent); }

.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 132px; }
.bar-slot { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar { width: 100%; background: var(--accent-dim); transition: background var(--fast); }
.bar-slot:hover .bar { background: var(--accent); }
.bar-label { margin-top: 6px; font-family: var(--mono); font-size: .5625rem; color: var(--text-4); }

.rank-list, .stack-list { display: grid; gap: 2px; }
.rank-list li, .stack-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px;
  border-radius: 2px;
  font-size: .8125rem;
  transition: background var(--fast);
}
.rank-list li:hover, .stack-list li:hover { background: var(--surface-2); }
.rank-index { font-family: var(--mono); font-size: .6875rem; color: var(--text-4); width: 18px; flex-shrink: 0; }
.rank-list a, .stack-main a { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list a:hover, .stack-main a:hover { color: var(--accent); }
.rank-count { margin-left: auto; font-family: var(--mono); font-size: .6875rem; color: var(--text-4); font-variant-numeric: tabular-nums; }
.stack-main { display: grid; gap: 2px; min-width: 0; }
.stack-main span { font-size: .6875rem; }

.trail-list { display: grid; gap: 8px; }
.trail-list li { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); font-size: .75rem; }
.trail-list li:last-child { border-bottom: 0; }
.trail-list code { color: var(--accent); }
.trail-target { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trail-list .muted { margin-left: auto; font-family: var(--mono); font-size: .6875rem; white-space: nowrap; }

.toolbar { display: flex; gap: 8px; padding: 12px; }
.toolbar .input { flex: 1; }
.toolbar select.input { flex: 0 0 150px; }

.table-card { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.data-table th {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-4);
  font-family: var(--mono);
  font-size: .625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  text-align: left;
  white-space: nowrap;
}
.data-table td { padding: 12px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background var(--fast); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr.is-highlighted { background: var(--accent-wash); box-shadow: inset 2px 0 0 var(--accent); }
.data-table tbody tr.is-banned { opacity: .5; }

.table-title { display: block; color: var(--text); font-weight: 600; }
a.table-title:hover { color: var(--accent); }
.table-sub { display: block; margin-top: 2px; font-size: .6875rem; color: var(--text-4); }
.table-file { font-family: var(--mono); font-size: .625rem; }
.table-user { display: flex; align-items: center; gap: 10px; }
.table-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.table-actions form { display: inline; }

.form-columns { display: grid; grid-template-columns: minmax(0, 1fr) 308px; gap: 16px; align-items: start; }
.form-main, .form-side { display: grid; gap: 16px; }
.form-side { position: sticky; top: 74px; }
.form-section { padding: 16px 20px; }
.form-section h2 { font-size: .875rem; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.form-section .field:last-of-type { margin-bottom: 0; }
.form-submit { display: grid; gap: 8px; }
.upload-hint { text-align: center; }

/* Chunk progress. A single filled bar driven by a --pct custom property, so
   the script sets one value rather than touching layout. */
.upload-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}
.upload-progress::after {
  content: '';
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  background: var(--accent);
  transition: width 120ms linear;
}

.admin-request-list { display: grid; gap: 12px; }
.admin-request { position: relative; padding: 16px 20px; }
.admin-request-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.admin-request-head h2 { font-size: .9375rem; }
.admin-request-details { margin-top: 10px; font-size: .75rem; color: var(--text-3); white-space: pre-wrap; max-height: 130px; overflow-y: auto; }
.admin-request-form { display: grid; grid-template-columns: 140px 1fr 76px; gap: 10px; align-items: start; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.admin-request-form .field { margin-bottom: 0; }
.admin-request-note { grid-column: 1 / -1; }
.admin-request-actions { display: flex; align-items: flex-end; height: 100%; }
.admin-request-delete { position: absolute; right: 20px; bottom: 18px; }

/* --- Ban dialog ----------------------------------------------------------- */

.ban-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 8, 7, .8);
  overflow-y: auto;
}
.ban-dialog[hidden] { display: none; }
.ban-dialog-panel { width: min(520px, 100%); padding: 24px; }
.ban-dialog-panel h2 { font-size: 1rem; margin-bottom: 4px; }
.ban-dialog-panel > .field-hint { margin-bottom: 16px; }
.ban-scope-fields { border: 0; margin: 4px 0 16px; padding: 0; }
.ban-scope-fields legend { margin-bottom: 8px; padding: 0; }
.ban-scope-fields .checkbox { align-items: flex-start; padding: 8px 0; }
.ban-scope-fields .checkbox input { margin-top: 4px; }
.ban-scope-fields .checkbox span { display: grid; gap: 2px; }
.ban-scope-fields .checkbox strong { font-size: .8125rem; color: var(--text); }
.ban-scope-fields .checkbox em { font-style: normal; font-size: .6875rem; color: var(--text-4); line-height: 1.5; }

/* --- Legal ---------------------------------------------------------------- */

.legal-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 40px; }
.legal-toc { position: sticky; top: 74px; display: grid; gap: 12px; }
.legal-toc nav { display: grid; gap: 2px; }
.legal-toc nav a {
  padding: 4px 8px;
  border-radius: 2px;
  color: var(--text-4);
  font-family: var(--mono);
  font-size: .75rem;
  transition: background var(--fast), color var(--fast);
}
.legal-toc nav a:hover { background: var(--surface); color: var(--text); }

.legal-doc { max-width: 700px; }
.legal-head { padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.legal-eyebrow { font-family: var(--mono); font-size: .625rem; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; }
.legal-head h1 { margin-top: 10px; font-size: clamp(1.625rem, 3.6vw, 2.125rem); font-weight: 800; letter-spacing: -.035em; }
.legal-updated { margin-top: 10px; font-family: var(--mono); font-size: .75rem; color: var(--text-4); }

/* Was a left-accent stripe. Now carries the corner-tick motif used elsewhere,
   so it reads as part of this site rather than as a generic callout. */
.legal-callout {
  position: relative;
  padding: 16px;
  margin-bottom: 32px;
  border: 1px solid var(--line-hi);
  background: var(--surface);
  font-size: .8125rem;
  color: var(--text-2);
}
.legal-callout::before, .legal-callout::after {
  content: '';
  position: absolute;
  width: 7px; height: 7px;
  pointer-events: none;
  border-color: var(--accent);
  border-style: solid;
}
.legal-callout::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.legal-callout::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.legal-callout strong { color: var(--text); }
.legal-callout-sm { margin: 4px 0 16px; font-size: .75rem; padding: 12px 12px; }

.legal-doc section { margin-bottom: 32px; scroll-margin-top: 80px; }
.legal-doc h2 { font-size: 1.0625rem; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.legal-doc h3 { font-size: .875rem; margin: 16px 0 8px; }
.legal-doc p { margin-bottom: 12px; font-size: .875rem; color: var(--text-2); line-height: 1.72; }
.legal-doc p:last-child { margin-bottom: 0; }

.legal-list { display: grid; gap: 8px; margin-bottom: 16px; }
.legal-list li { position: relative; padding-left: 20px; font-size: .875rem; color: var(--text-2); line-height: 1.68; }
.legal-list li::before {
  content: '—';
  position: absolute;
  left: 0; top: 0;
  font-family: var(--mono);
  color: var(--accent-dim);
  font-size: .75rem;
}
.legal-list strong { color: var(--text); }

/*
  Term/definition pairs. These used to be list items reading
  "<strong>Label</strong> — description", repeated fourteen times in one
  document. That construction is doing markup's job with punctuation, and the
  repetition is itself a tell. The label now carries the site's mono treatment
  and the relationship is expressed by the element, not by a dash.
*/
.def-list { margin: 0 0 16px; display: grid; gap: 12px; }
.def-list > div {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.def-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.def-list dt {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--accent-dim);
  line-height: 1.6;
}
.def-list dt code { color: inherit; font-size: 1em; }
.def-list dd { margin: 0; font-size: .875rem; color: var(--text-2); line-height: 1.68; }

@media (max-width: 640px) {
  .def-list > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

.legal-missing { padding: 12px 12px; border: 1px dashed var(--line-hi); color: var(--text-4) !important; font-size: .75rem !important; font-family: var(--mono); }
.legal-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.legal-foot p { font-size: .75rem; color: var(--text-4); }

/* --- 404 ------------------------------------------------------------------ */

.notfound { padding: 80px 0 96px; display: flex; flex-direction: column; align-items: flex-start; max-width: 720px; }
.notfound-art { display: none; }

.notfound-console {
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--text-4);
  padding: 12px 12px;
  border: 1px solid var(--line);
  background: var(--bg-sunk);
  border-radius: var(--r);
  width: 100%;
  word-break: break-all;
}
.notfound-prompt { color: var(--rust); margin-right: 8px; }
.notfound-console code { color: var(--text-2); }

.notfound h1 { margin-top: 24px; font-size: clamp(1.75rem, 4.4vw, 2.75rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.notfound-lead { margin-top: 12px; max-width: 52ch; color: var(--text-3); font-size: .9375rem; }
.notfound-search { margin-top: 24px; width: min(440px, 100%); }

.notfound-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 2px;
  width: 100%;
  margin-top: 32px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.notfound-link { display: grid; gap: 4px; padding: 16px 16px; background: var(--bg); color: var(--text); transition: background var(--fast); }
.notfound-link:hover { background: var(--surface); color: var(--text); }
.notfound-link strong { font-size: .875rem; font-weight: 600; }
.notfound-link span { font-size: .75rem; color: var(--text-4); line-height: 1.5; }

/* --- Ban screen ----------------------------------------------------------- */

.banned-page { background: var(--bg); }
.ban-wrap { flex: 1; display: grid; place-items: center; padding: 56px 24px; }
.ban-card {
  width: min(560px, 100%);
  padding: 32px;
  border: 1px solid var(--line-hi);
  border-top: 2px solid var(--rust);
  border-radius: var(--r);
  background: var(--surface);
}
.ban-icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 122, 107, .35);
  border-radius: var(--r);
  background: var(--rust-wash);
  color: var(--rust);
}
.ban-icon svg { width: 19px; height: 19px; }
.ban-eyebrow { color: var(--rust); }
.ban-card h1 { margin-top: 12px; font-size: clamp(1.25rem, 3.2vw, 1.625rem); font-weight: 800; letter-spacing: -.035em; }
.ban-lead { margin-top: 12px; color: var(--text-2); font-size: .875rem; }

.ban-details { margin: 24px 0 0; display: grid; font-family: var(--mono); font-size: .75rem; }
.ban-details > div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ban-details > div:last-child { border-bottom: 0; }
.ban-details dt { color: var(--text-4); text-transform: lowercase; letter-spacing: 0; font-size: .75rem; }
.ban-details dd { margin: 0; color: var(--text); }
.ban-ago { color: var(--text-4); }
.ban-scope { color: var(--rust) !important; }

.ban-appeal { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.ban-appeal h2 { font-size: .9375rem; margin-bottom: 8px; }
.ban-appeal p { font-size: .8125rem; color: var(--text-3); margin-bottom: 8px; }
.ban-note { font-size: .75rem !important; color: var(--text-4) !important; }

.ban-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: .6875rem; color: var(--text-4); }
.ban-foot a { color: var(--text-4); }
.ban-foot a:hover { color: var(--accent); }

/* --- Footer --------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-sunk); padding-top: 40px; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; padding-bottom: 32px; }
.footer-brand { display: grid; gap: 12px; justify-items: start; }
.footer-brand p { max-width: 40ch; font-size: .75rem; color: var(--text-4); line-height: 1.6; }

.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-links h4 { margin-bottom: 12px; font-family: var(--mono); font-size: .625rem; color: var(--text-4); text-transform: uppercase; letter-spacing: .14em; font-weight: 500; }
.footer-links a { display: block; padding: 4px 0; font-family: var(--mono); font-size: .75rem; color: var(--text-3); }
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 16px;
  padding-bottom: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .6875rem;
  color: var(--text-4);
}
.footer-note { max-width: 60ch; text-align: right; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 1080px) {
  .masthead-inner { grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
  .browse-layout, .detail-layout, .form-columns, .admin-grid-sidebar, .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .filter-rail, .detail-side, .form-side, .admin-nav, .legal-toc { position: static; }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-nav, .legal-toc nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 4px; }
  .admin-nav-cta { margin-top: 0; }
  .admin-request-form { grid-template-columns: minmax(0, 1fr); }
  .admin-request-delete { position: static; margin-top: 10px; }
  .res-meta-cell--age { display: none; }
}

@media (max-width: 860px) {
  .header-search { display: none; }
  .site-nav { margin-left: auto; }
  .auth-shell { grid-template-columns: minmax(0, 440px); }
  .auth-aside { display: none; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-note { text-align: left; }
}

@media (max-width: 640px) {
  .shell { padding-inline: 16px; }
  .masthead { padding-top: 40px; }
  .section { padding-top: 40px; }

  /* The metadata rail wraps under the title rather than being cut off. */
  .res-row { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 16px 10px; }
  .res-thumb { width: 36px; height: 36px; }
  .res-meta { grid-column: 2; grid-template-columns: repeat(3, auto); justify-content: start; gap: 16px; text-align: left; margin-top: 12px; }
  .res-meta-cell--age { display: grid; }
  .res-summary { -webkit-line-clamp: 3; line-clamp: 3; }

  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head, .admin-head, .page-head-split { flex-direction: column; align-items: flex-start; gap: 10px; }
  .results-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .user-chip-name { display: none; }
  .request-card { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 16px 10px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .toolbar { flex-wrap: wrap; }
  .toolbar select.input { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --- Recovery ------------------------------------------------------------- */

.auth-forgot { margin: -8px 0 16px; text-align: right; }
.auth-forgot a { font-size: .75rem; color: var(--text-3); }
.auth-forgot a:hover { color: var(--accent); }

.notice {
  padding: 12px 16px;
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  background: var(--surface-2);
  font-size: .8125rem;
  color: var(--text-2);
  line-height: 1.6;
}
.notice strong { display: block; color: var(--text); margin-bottom: 4px; }

.reset-dead { font-size: .8125rem; color: var(--text-3); margin-bottom: 20px; line-height: 1.6; }
