/* =============================================================================
   KilusNa design layer — aligned to kilusna.ph

   Inter, the logo's gold, warm paper in light and near-black in dark, compact
   cards with 10px corners, icon nav on a gold-soft pill, and the cream
   "repository" panel that sits on the dark page. Both grades share one set of
   tokens; the theme is set before paint by the inline head script and remembered
   by the header toggle.

   The section nav is a full-screen sheet under 900px. Nothing here adds a
   second component vocabulary.

   This layer overrides the base and never restates it: a rule that would be
   identical to one in app.css belongs there, once. Only the properties that
   actually differ are written below.
   ============================================================================= */

/* ----- Base type ---------------------------------------------------------- */

body {
  font-size: var(--fs);
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: var(--font);
  color: var(--ink);
  letter-spacing: -.01em;
}

h1 { font-size: clamp(26px, 2.4vw, 34px); font-weight: 800; line-height: 1.15; }
h2 { font-size: 21px; font-weight: 700; line-height: 1.3; }
h3 { font-size: 15.5px; font-weight: 700; }

::selection { background: var(--accent-soft); color: var(--ink); }

/* ----- Header, theme toggle and section nav ------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  gap: var(--sp-3);
  max-width: var(--shell);
  min-height: 60px;
  padding: 0 var(--sp-5);
}

.wordmark { min-height: 44px; }
.wordmark-logo { height: 40px; max-width: min(46vw, 210px); }
.wordmark:hover { opacity: .84; }

.header-search {
  display: flex;
  max-width: 520px;
  min-height: 40px;
  margin: 0 auto;
  padding: 0 3px 0 14px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.header-search:focus-within {
  background: var(--card);
  border-color: var(--accent-text);
  box-shadow: var(--ring);
}

.header-search input[type="search"] {
  min-height: 36px;
  font-size: 13.5px;
}

.header-search .search-submit {
  width: 34px;
  min-height: 34px;
  background: var(--accent);
  border: 1px solid var(--accent-text);
  border-radius: 50%;
  color: var(--on-accent);
}

.header-search .search-submit:hover { background: var(--accent-dark); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius);
  color: var(--ink-3);
  transition: background .18s var(--ease), color .18s var(--ease);
}

.theme-toggle:hover { background: var(--surface); color: var(--ink); }
.theme-icon { width: 18px; height: 18px; }
.theme-icon--sun { display: none; }
[data-theme="dark"] .theme-icon--sun { display: block; }
[data-theme="dark"] .theme-icon--moon { display: none; }

.header-actions { gap: var(--sp-2); }
.header-actions .btn { min-height: 44px; padding: 8px 16px; font-size: 13.5px; }

.header-user {
  width: 34px;
  height: 34px;
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
  font-size: 13px;
}

.header-actions .header-signout { min-height: 40px; font-size: 13.5px; }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

.menu-toggle:hover { background: var(--surface); border-color: var(--ink-3); }
.menu-toggle-icon { width: 18px; height: 18px; }

.nav-bar {
  background: var(--card);
  border-top: 1px solid var(--line);
}

.nav-bar-inner {
  gap: 4px;
  max-width: var(--shell);
  padding: 8px var(--sp-5);
}

.nav-link {
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
}

.nav-link:hover { background: var(--surface); color: var(--ink); }

.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
}

.nav-icon { width: 16px; height: 16px; color: var(--accent-text); }

.nav-close,
.nav-search,
.nav-account { display: none; }

@media (min-width: 900px) {
  .nav-bar-inner { justify-content: center; }
}

@media (max-width: 899px) {
  .header-inner { min-height: 56px; padding: 0 var(--sp-4); }
  .wordmark-logo { height: 34px; }
  .header-search,
  .header-actions { display: none; }
  .theme-toggle { width: 44px; height: 44px; margin-left: auto; }
  .menu-toggle { display: inline-flex; margin-left: 0; }
  .nav-bar { display: none; }

  .is-menu-open .nav-bar {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    overflow-y: auto;
    padding: 0 var(--sp-5) var(--sp-5);
    background: var(--bg);
  }

  .is-menu-open .nav-bar-inner {
    flex-direction: column;
    align-items: stretch;
    max-width: none;
    padding: 88px 0 0;
    gap: 0;
  }

  .is-menu-open .nav-close {
    position: fixed;
    top: 10px;
    right: var(--sp-4);
    z-index: 100;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--ink);
    font-size: 26px;
    line-height: 1;
  }

  .is-menu-open .nav-link {
    min-height: 56px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 500;
  }

  .is-menu-open .nav-link[aria-current="page"] {
    padding-left: 12px;
    box-shadow: inset 3px 0 0 var(--accent);
    color: var(--accent-text);
    font-weight: 600;
  }

  .is-menu-open .nav-icon { width: 20px; height: 20px; }

  .is-menu-open .nav-search {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-height: 48px;
    margin-top: var(--sp-5);
    padding: 0 3px 0 14px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
  }

  .is-menu-open .nav-search input[type="search"] {
    flex: 1 1 auto;
    width: auto;
    min-height: 42px;
    padding: 0;
    background: transparent;
    border: 0;
    font-size: 15px;
  }

  .is-menu-open .nav-search .search-submit {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    background: var(--accent);
    border: 1px solid var(--accent-text);
    border-radius: 50%;
    color: var(--on-accent);
  }

  .is-menu-open .nav-account {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: var(--sp-5);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--line);
  }

  .nav-account-link,
  .nav-account .link-button {
    display: flex;
    align-items: center;
    min-height: 48px;
    color: var(--ink-2);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
  }

  body.menu-open { overflow: hidden; }
}

/* A tablet keeps the primary action beside the menu button; the phone keeps it
   inside the sheet. */
@media (min-width: 768px) and (max-width: 899px) {
  .header-actions { display: flex; margin-left: auto; }
  .header-actions .header-user,
  .header-actions .header-signout-form { display: none; }
  .header-actions .btn { min-height: 44px; }
  .theme-toggle { margin-left: 0; }
}

/* ----- Page shell --------------------------------------------------------- */

.page {
  max-width: var(--shell);
  padding: 0 var(--sp-5);
}

.page-layout { padding: var(--sp-5) 0 var(--sp-8); gap: var(--gap); }

/* ----- Feed masthead ------------------------------------------------------ */

.hero {
  padding: var(--sp-7) var(--sp-6);
  overflow: hidden;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-card);
}

.hero::before { background: var(--hero-glow); }
.hero-content { max-width: 640px; }

.hero-eyebrow {
  display: block;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero-title {
  margin-top: var(--sp-3);
  font-size: clamp(28px, 2.8vw, 36px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.02em;
  color: var(--ink);
}

.hero-description {
  margin-top: var(--sp-3);
  max-width: 56ch;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px var(--sp-4);
  margin-top: var(--sp-4);
  padding: 0;
  border: 0;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0;
  border: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
}

.hero-feature-dot {
  display: block;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  background: var(--accent);
  border-radius: 50%;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

/* ----- Feed tabs ---------------------------------------------------------- */

.feed-tabs {
  gap: var(--sp-2);
  padding-bottom: 2px;
  border-bottom: 0;
}

.feed-tab {
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 600;
}

.feed-tab:hover { background: transparent; border-color: var(--line); color: var(--ink); }

.feed-tab[aria-current="page"],
.feed-tab[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
}

.feed-sort {
  align-items: center;
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--line);
}

.feed-sort-label {
  flex: 0 0 auto;
  padding-right: var(--sp-1);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ----- Report cards ------------------------------------------------------- */

.reports-feed { gap: var(--sp-4); }

.report-card {
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}

.report-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }

.report-meta {
  gap: 6px var(--sp-2);
  margin-bottom: 6px;
  font-size: 12px;
}

.report-category {
  padding: 3px 9px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
}

.report-title {
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
}

.report-title a {
  color: var(--ink);
  background-image: none;
  transition: color .18s var(--ease);
}

.report-title a:hover { color: var(--accent-text); text-decoration: none; }

.report-summary {
  margin-bottom: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

.not-reviewed {
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.pub-rel { margin-top: 10px; gap: 6px; }

.pub-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
}

.pub-pill small { color: var(--ink-3); font-size: 12px; }

.pub-pill.pub-pill-topic {
  padding: 4px 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
}

.pub-pill-topic a { color: var(--accent-text); }

.report-footer {
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding-top: 0;
  border-top: 0;
  color: var(--ink-3);
  font-size: 12.5px;
}

.react-btn,
.react-count { min-height: 40px; font-size: 12.5px; }

.vote { padding-top: 2px; }
.vote-icon { width: 24px; height: 22px; border-radius: 4px; }
.vote-num { font-size: 12.5px; }

/* ----- Chips and small labels --------------------------------------------- */

.chip {
  padding: 2px 8px;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.chip--alias { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

.chip--own { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }

.section-count {
  padding: 1px 8px;
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
}

.meta,
.meta-inline,
.claim-summary,
.pub-empty { font-size: 12.5px; }

.help { font-size: 12.5px; line-height: 1.5; }
.error { font-size: 12.5px; }

/* ----- Tooltips ----------------------------------------------------------- */

.field-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.field-label-row label { margin-bottom: 0; }

.tip-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.tip-icon:hover,
.tip-icon:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
}

.term[data-tip] {
  border-bottom: 1px dotted currentColor;
  cursor: help;
}

[data-tip]:not(a):not(button):not(input):not(select):not(textarea):not(summary) {
  cursor: help;
}

.tooltip-bubble {
  position: fixed;
  z-index: 300;
  max-width: min(280px, calc(100vw - 24px));
  padding: 8px 10px;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 22%);
  color: var(--bg);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .12s var(--ease), transform .12s var(--ease);
}

.tooltip-bubble.is-open {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .tooltip-bubble { transition: none; }
}

.rail-heading,
.sidebar-nav-heading {
  padding-bottom: var(--sp-2);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sidebar-nav-heading--next {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}

/* ----- Sidebar and rails -------------------------------------------------- */

.sidebar-card-title {
  margin-bottom: var(--sp-3);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0;
}

.sidebar-note {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.55;
}

.sidebar-list {
  gap: 7px;
  margin: var(--sp-3) 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.sidebar-list li { position: relative; padding: 0 0 0 14px; border: 0; }

.sidebar-list li::before {
  content: "";
  position: absolute;
  top: .55em;
  left: 1px;
  display: block;
  width: 5px;
  height: 5px;
  background: var(--accent-text);
  border-radius: 50%;
}

.sidebar-link { min-height: 44px; font-size: 13.5px; font-weight: 600; }

/* One link line where a card used to be: the page it opens is the explanation. */
.rail-link-line {
  margin: var(--sp-3) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
.sidebar-nav-link { min-height: 40px; font-size: 13.5px; }

.sidebar-nav-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

.impact-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.impact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
}

.impact-list svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-text); }

.impact-list strong {
  margin-left: auto;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.trend-list { display: grid; gap: 0; margin: 0; }

.trend-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.trend-list li:first-child { padding-top: 0; border-top: 0; }
.trend-list a { color: var(--accent-text); font-weight: 600; }
.trend-list span { color: var(--ink-3); font-size: 12px; }

/* Search results reuse the claim list shell. */
.claim h3 { margin-bottom: 4px; font-size: 16px; font-weight: 700; }
.claim h3 a { color: var(--ink); }
.claim h3 a:hover { color: var(--accent-text); text-decoration: none; }

/* ----- Buttons ------------------------------------------------------------ */

.btn,
button[type="submit"]:not(.link-button):not(.nav-link--button):not(.button-secondary):not(.btn-secondary):not(.vote-arrow):not(.search-submit):not(.vote-icon),
.button-secondary {
  font-size: 13.5px;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}

.btn-primary:hover,
button[type="submit"]:not(.link-button):not(.nav-link--button):not(.button-secondary):not(.btn-secondary):not(.vote-arrow):not(.search-submit):not(.vote-icon):hover {
  transform: translateY(-1px);
}

.btn-primary:active,
button[type="submit"]:not(.link-button):not(.nav-link--button):not(.button-secondary):not(.btn-secondary):not(.vote-arrow):not(.search-submit):not(.vote-icon):active {
  transform: translateY(0);
}

.btn-secondary,
.button-secondary {
  border-color: var(--line-strong);
}

.btn-secondary:hover,
.button-secondary:hover {
  transform: translateY(-1px);
}

.btn-secondary:active,
.button-secondary:active { transform: translateY(0); }

.link-button { font-size: 13.5px; }

/* ----- Forms -------------------------------------------------------------- */

.form { max-width: 680px; }
.field { margin-bottom: var(--sp-4); }

.field label {
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.field .check-label { min-height: 44px; font-size: 14px; }

.search-form { align-items: flex-end; }
.search-form button[type="submit"] { min-height: 48px; }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not(.search-input),
select,
textarea {
  min-height: 42px;
  padding: 9px 12px;
  background: var(--card);
  border-color: var(--input-border);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
}

textarea { line-height: 1.55; }
select { padding-right: 32px; }

[data-theme="dark"] option { background: var(--card); color: var(--ink); }

input[type="file"] { padding: 8px; font-size: 13px; }

input[type="file"]::file-selector-button {
  padding: 7px 11px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
}

input[type="checkbox"],
input[type="radio"] { width: 17px; height: 17px; }

/* ----- Panels, cards and page heads --------------------------------------- */

.card-title {
  margin: 0 0 var(--sp-2);
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}

.section-panel { margin-top: var(--sp-4); }

.page-head { padding: var(--sp-2) 0 var(--sp-3); }
.page-head h1 { margin-bottom: var(--sp-1); }
.page-head p { max-width: var(--measure); color: var(--ink-2); font-size: 14px; line-height: 1.55; }

.empty-state { padding: var(--sp-8) var(--sp-5); font-size: 14px; }

.messages {
  padding: var(--sp-3) var(--sp-4);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent-dark);
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: 13.5px;
}

/* The light repository panel on a dark page, as on kilusna.ph/cases/. */
.repo-hero {
  padding: var(--sp-6);
  background: var(--hero-paper);
  border: 1px solid var(--hero-line);
  border-radius: var(--radius-card);
  color: var(--hero-ink);
}

.repo-hero h1 { margin: var(--sp-2) 0 6px; color: var(--hero-ink); }
.repo-hero p { max-width: 62ch; color: #4a4234; font-size: 14px; }

.repo-label {
  display: inline-flex;
  padding: 3px 9px;
  background: #fff0bf;
  border: 1px solid #e8d28a;
  border-radius: var(--radius-pill);
  color: #7a5400;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ----- Publication pages: post, person, case ------------------------------ */

.pub-page { max-width: 1200px; gap: var(--sp-4); }

.pub-back {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink-2);
  font-size: 13px;
}

.pub-hero {
  background: var(--hero-paper);
  border-color: var(--hero-line);
  color: var(--hero-ink);
}

.pub-titleblock { padding: var(--sp-6); }

.pub-titleblock h1 {
  margin-bottom: var(--sp-2);
  color: var(--hero-ink);
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.15;
  letter-spacing: -.02em;
}

.pub-hero .pub-meta-row { color: #4a4234; }
.pub-hero .pub-meta-row a { color: #6b4a00; font-weight: 600; }
.pub-hero .report-category {
  background: #fff0bf;
  border-color: #e8d28a;
  color: #7a5400;
}
.pub-hero .chip {
  background: rgba(21, 18, 14, .06);
  border-color: rgba(21, 18, 14, .18);
  color: var(--hero-ink);
}
.pub-hero .chip--alias { background: var(--accent); border-color: #c99a12; color: var(--on-accent); }

.pub-meta-row { gap: 6px var(--sp-4); font-size: 13px; }

.pub-body { padding: var(--sp-5); }
.pub-section { padding: var(--sp-5); }
.pub-section-header { margin-bottom: var(--sp-3); }

.pub-section h2 {
  gap: var(--sp-2);
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.rich-content p { font-size: 15px; line-height: 1.65; }

.eng-bar { padding: var(--sp-2) var(--sp-4); }

.inline-heading { font-size: 16px; font-weight: 700; }

/* ----- Records: outcome band and sourced facts ---------------------------- */

.summary-band {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat,
.pub-section .stat {
  padding: 12px 16px;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
}

.stat:first-child { border-left: 0; }

.stat b {
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.stat span {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.case-facts dt {
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.case-facts dd { margin-top: 3px; color: var(--ink); font-size: 14px; }

.case-block { margin-top: var(--sp-4); }
.case-block h3 { margin-bottom: 6px; color: var(--ink); font-size: 13px; font-weight: 700; }
.case-block > p { color: var(--ink-2); font-size: 14px; line-height: 1.6; }

.case-parties,
.case-sources {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
}

.case-parties li,
.case-sources li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.case-parties li:first-child,
.case-sources li:first-child { padding-top: 0; border-top: 0; }

.case-parties a,
.case-sources a { font-weight: 600; }
.case-parties .meta,
.case-sources .meta { margin: 0; }

.case-timeline { gap: var(--sp-3); }
.case-timeline li { padding-left: var(--sp-3); border-left: 2px solid var(--accent-line); }
.case-timeline p { color: var(--ink-2); font-size: 14px; }
.case-timeline p strong { color: var(--ink); font-weight: 600; }

/* ----- Claims, assessments and discussion -------------------------------- */

.claim-list { gap: var(--sp-3); }

.claim-item {
  padding: var(--sp-4);
  background: var(--surface);
  border-radius: var(--radius);
}

.claim-text {
  margin-bottom: var(--sp-2);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
}

.claim-explanation { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.claim-foot { padding-top: 0; font-size: 12.5px; }

.claim-item .assessment {
  margin-top: var(--sp-2);
  padding: var(--sp-3);
  background: var(--card);
  border-radius: var(--radius);
}

.pub-section .claim-item {
  padding: var(--sp-3);
  background: var(--surface);
  border-radius: var(--radius);
}

.pub-section .claim-item:first-child { padding-top: var(--sp-3); }

.quote {
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface);
  border-left: 2px solid var(--accent-line);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.status-line {
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface);
  border-left: 2px solid var(--line-strong);
  color: var(--ink-2);
  font-size: 13px;
}

.assessment { background: var(--surface); border-color: var(--line); }
.assessment.withdrawn { opacity: .68; }

.citation { font-size: 12.5px; }
.citations { gap: var(--sp-1); }
.citation + .citation { padding-top: var(--sp-1); }

.attachment { padding: var(--sp-2) var(--sp-3); font-size: 13px; }
.attachment .hash { font-size: 12px; }

.comment {
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.comment-header strong { font-size: 14px; }
.comment-time { font-size: 12.5px; }
.comment-body { color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.comment.reply .comment-body { font-size: 13.5px; }

.comment-actions .vote-icon { width: 24px; height: 24px; }
.comment-login { font-size: 14px; }

.comments-list .comment { padding: var(--sp-3) 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.comments-list > .comment:last-child { padding-bottom: 0; border-bottom: 0; }

/* ----- Desks and tables --------------------------------------------------- */

.source-text {
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Quote picking: the post stays beside the form on a wide screen, and the
   add-quote dialog carries its own scrollable copy so the modal cannot hide
   the text the curator needs to select. */
.quote-workbench {
  display: grid;
  gap: var(--sp-4);
  align-items: start;
}

.quote-source-panel { min-width: 0; }
.quote-source-panel h2 { margin-bottom: var(--sp-2); }

.source-text[data-quote-source] {
  padding: var(--sp-4);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  cursor: text;
}

.source-text[data-quote-source]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.quote-source-panel--dialog .source-text {
  max-height: 30vh;
  overflow: auto;
  background: var(--surface);
}

@media (min-width: 900px) {
  .quote-workbench {
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
  }
  .quote-workbench .quote-form {
    position: sticky;
    top: calc(60px + var(--sp-4));
  }
  .quote-workbench .source-text[data-quote-source] {
    max-height: calc(100vh - 230px);
    overflow: auto;
  }
}

.table { font-size: 13.5px; }

.table th {
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table th,
.table td { padding: 9px 11px; }

.table td[data-label]::before { font-size: 11.5px; }

.formset-row { padding: var(--sp-4); border-radius: var(--radius); }

.formset-row legend {
  padding: 0 6px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.form-section > summary { font-size: 15px; }

details > summary { color: var(--accent-text); font-size: 13px; }
details > summary:hover { color: var(--ink); text-decoration: none; }

.tombstone { padding: var(--sp-8) var(--sp-6); }
.tombstone p { font-size: 14px; }

/* A dialog is a scroll container of its own, so the workbench's sticky column and
   its viewport-height source stop making sense inside one. */
.modal .quote-workbench .quote-form { position: static; }
.modal .quote-workbench .source-text[data-quote-source] { max-height: 42vh; }

/* ----- Dialogs ------------------------------------------------------------ */

.modal-head { padding: var(--sp-3) var(--sp-5); }
.modal-head h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: var(--sp-5); }
.modal-close { font-size: 22px; }

/* ----- Motion ------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-content,
  .hero-features {
    animation: kn-rise .5s var(--ease) both;
  }

  .hero-features { animation-delay: .06s; }

  @keyframes kn-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }

  .sidebar-link,
  .react-btn,
  .nav-link,
  .feed-tab,
  .link-button {
    transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
  }
}

/* ----- Small screens ------------------------------------------------------ */

/* Below 900 the header is already in sheet mode and the pointer is a finger, so the
   vote controls keep a 44px target whatever the content reflow is doing. */
@media (max-width: 899px) {
  .report-card { grid-template-columns: 44px minmax(0, 1fr); }
  .vote-icon,
  .comment-actions .vote-icon { width: 44px; height: 44px; }
}

@media (max-width: 767px) {
  .page { padding: 0 var(--sp-4); }
  .page-layout { padding: var(--sp-4) 0 var(--sp-7); gap: var(--sp-4); }
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not(.search-input),
  select,
  textarea { font-size: 16px; }
  .hero { padding: var(--sp-6) var(--sp-5); }
  .hero-title { font-size: clamp(26px, 6vw, 32px); }
  .hero-features { gap: var(--sp-2); }
  .hero-feature { width: 100%; }
  .report-card { gap: var(--sp-3); padding: var(--sp-4); }

  .report-title { font-size: 16px; }
  .summary-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(4) { border-top: 1px solid var(--line); }
  .pub-titleblock { padding: var(--sp-5); }
  .pub-titleblock h1 { font-size: clamp(24px, 5vw, 30px); }
  .pub-body,
  .pub-section { padding: var(--sp-4); }
  .pub-section h2 { font-size: 17px; }
  .repo-hero { padding: var(--sp-5); }
}

@media (max-width: 520px) {
  .hero { padding: var(--sp-5) var(--sp-4); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .feed-tabs { flex-wrap: wrap; overflow: visible; }
  .report-card { padding: var(--sp-3); }
  .pub-titleblock,
  .pub-body,
  .pub-section { padding: var(--sp-4); }
  .pub-page { gap: var(--sp-3); }
  .stat { padding: var(--sp-3); }
  .stat b { font-size: 20px; }
  .section-panel { padding: var(--sp-4); }
  .comment { padding: var(--sp-3) 0; }
  .modal-body { padding: var(--sp-4); }
}

