/* Classical — design-system tokens and component classes. This file is the source of truth for the system's look; retune it here and see readme.md. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600&family=Lora:wght@400;600&display=swap');

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201f1d;
  --color-accent: #b68235;
  --color-accent-2: #ac803e;
  --color-divider: color-mix(in srgb, #201f1d 16%, transparent);

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f8f4f4;
  --color-neutral-200: #eae7e7;
  --color-neutral-300: #d7d3d3;
  --color-neutral-400: #bab6b6;
  --color-neutral-500: #9b9797;
  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;
  --color-neutral-900: #2d2b2b;

  --color-accent-100: #fff3e4;
  --color-accent-200: #ffe3bf;
  --color-accent-300: #facb8d;
  --color-accent-400: #e1ad66;
  --color-accent-500: #c28d41;
  --color-accent-600: #a06f24;
  --color-accent-700: #7d5411;
  --color-accent-800: #5a3b0a;
  --color-accent-900: #3a270d;

  --color-accent-2-100: #fff3e4;
  --color-accent-2-200: #ffe3be;
  --color-accent-2-300: #f5cd96;
  --color-accent-2-400: #dbaf70;
  --color-accent-2-500: #bc8f4e;
  --color-accent-2-600: #9b7232;
  --color-accent-2-700: #79561f;
  --color-accent-2-800: #573d14;
  --color-accent-2-900: #382810;

  --font-heading: "Cormorant Garamond", system-ui, sans-serif;
  --font-heading-weight: 600; /* review round 3: bold retired — semibold is the
     interface headings' ceiling (they need the weight at small sizes); display
     text goes lighter still, to the normal cut (see the deck) */
  --font-body: "Lora", system-ui, sans-serif;

  /* Type scale — one ladder, 16px base. 16px is the floor for anything a
     person reads a sentence of, and it is also the number iOS watches: a
     focused form control under 16px makes WKWebView zoom the whole page, so
     every input, select and button sits on --text-md exactly.
     Headings hold the brief's ratios against that base: h3 1.5x, h2 1.7x. */
  --text-2xs: 12px;  /* uppercase micro-eyebrows and legal footnotes only */
  --text-xs: 13px;   /* dense metadata: timestamps, table column meta */
  --text-sm: 14px;   /* supporting text beside a primary line */
  --text-md: 16px;   /* body, form controls, buttons, nav — the floor */
  --text-lg: 18px;   /* lead paragraphs, card titles */
  --text-xl: 20px;   /* h4 */
  --text-2xl: 24px;  /* h3 — 1.5x body */
  --text-3xl: 27px;  /* h2 — 1.7x body */
  --text-4xl: 34px;
  --text-5xl: 40px;  /* h1 */

  --leading-body: 1.6;   /* 1.5-1.7 band for running text */
  --leading-tight: 1.25; /* headings and single-line UI */

  --space-1: 4.6px;
  --space-2: 9.2px;
  --space-3: 13.8px;
  --space-4: 18.4px;
  --space-6: 27.6px;
  --space-8: 36.8px;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 7px;

  /* Elevation — derived from the ground: soft ink-tinted shadows on a
     light theme, a hairline edge + ambient darkness on a dark one. */
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

.plate{filter:sepia(0.22) saturate(0.82) contrast(1.05);box-sizing:border-box;
  border:6px solid var(--color-surface);outline:1px solid var(--color-divider)}

/* ══════════════════════════════════════════════════════════════════════════
   Components — built with the tokens above. Plain CSS
   on plain HTML: no JavaScript, no build step. Each class is documented in
   readme.md and demonstrated in foundations/ and components/.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
/* Never let a phone reflow-inflate our own type; the scale below is already
   sized for a phone, so the heuristic can only fight it. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-size: var(--text-md); line-height: var(--leading-body); font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: var(--leading-tight); letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-xs); }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: var(--text-xs); margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
.hr {
  height: 1px; border: 0; margin: var(--space-4) 0;
  background: var(--color-divider);
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: var(--text-md); line-height: var(--leading-tight); color: var(--color-text); /* matches the
     .input — the pair sits side by side in sign-up rows, and both must be 16px
     or iOS zooms the page the moment the field takes focus */
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.btn-primary:active { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* — the 16px floor, enforced —
   iOS zooms the viewport whenever a focused form control computes under 16px,
   and it never zooms back out. Nothing that takes focus may sit below the
   body floor, whatever else styles it. */
input, select, textarea, button { font-family: inherit; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea { font-size: max(var(--text-md), 1em); }

/* — forms — */
.field > label {
  display: block; font-size: var(--text-sm); margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
/* A grid or flex item is min-width: auto by default, so a <select> holding a
   long option ("Any attorney of record") sets a floor wider than a phone and
   pushes the whole page sideways. A field always yields to its column. */
.field { min-width: 0; }
.input {
  /* min-width: 0 for the same reason, one level down: a date input's own
     intrinsic width would otherwise set the floor of the 1fr track holding it. */
  width: 100%; max-width: 100%; min-width: 0; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: var(--text-md); color: var(--color-text); caret-color: var(--color-accent);
  background: transparent;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--text-md); }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: var(--text-sm); cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: transparent; border: 1px solid var(--color-divider);
}
.card-kicker { font-size: var(--text-2xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: var(--text-lg); line-height: var(--leading-tight);
}
/* A card body is read as prose, so it holds the body floor. */
.card-body { margin: 0; font-size: var(--text-md); line-height: var(--leading-body); opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: var(--text-xs);
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: var(--text-2xs);
  letter-spacing: 0.02em; padding: 4px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }
/* An outcome no human has checked. Dashed where a verified one is filled, so
   the two are told apart at a glance across the whole app; the dash is never
   the only signal — OutcomeTagComponent carries a visually-hidden phrase and a
   title alongside it. Distinct from .tag-outline, which is solid and means
   something else entirely. */
.tag-ai {
  border: 1px dashed color-mix(in srgb, var(--color-accent) 60%, transparent);
  color: var(--color-accent-800);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: var(--text-lg); margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: var(--text-md); }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: var(--text-md); }
.table th {
  text-align: left; font-size: var(--text-2xs); letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 1px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg); border: 1px solid var(--color-divider);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: var(--text-xl);
}
.dialog-body { font-size: var(--text-md); opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* ══════════════════════════════════════════════════════════════════════════
   HowJudgesRule app-layer additions — small extensions in the system's
   grammar (stroke over fill, hairlines, tag tints from the ramps).
   ══════════════════════════════════════════════════════════════════════ */

/* The verbatim quote is the product's hero typography: the heading face,
   italic, behind a gold rule. */
.quote-block {
  border-left: 2px solid var(--color-accent);
  padding-left: clamp(11px, 1.8vw, 16px);
  font-family: var(--font-heading);
  font-size: clamp(20px, 2.4vw, 24px); line-height: 1.4;
  font-weight: 500; font-style: italic;
  margin: 0;
}


/* — brand vars (the kit's grounds: marketing sits on paper, the product in the vault) — */
:root {
  --vault: #14120e;
  --bone: #ede7da;
  --glow: #c9973f;
  --paper-leaf: #fffdfa;
}

/* — motion: the mark, while it reads (brand kit §11) —
   The loading state is not a spinner. The gold rule drops onto the line below,
   the displaced rule is pushed up into its place, and the whole stack scrolls
   one line further down the page. 2.2s a cycle; it never speeds up to imply
   progress it does not have. */
@keyframes hjr-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes hjr-spin { to { transform: rotate(360deg); } }
@keyframes hjr-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes hjr-fade { from { opacity: 0; } to { opacity: 1; } }

/* Aperture scan — 8 identical rects (x=8 w=48 h=4 at y=0); position and taper
   come entirely from the keyframe transform (translateY slots, scaleX tapers:
   .2083→10, .3333→16, .5833→28, .7917→38, 1→48). */
@keyframes hjr-ap0 { 0%,40% { transform: translateY(6px) scaleX(.3333); opacity: 1 } 72%,100% { transform: translateY(-2px) scaleX(.2083); opacity: 0 } }
@keyframes hjr-ap1 { 0%,40% { transform: translateY(14px) scaleX(.5833) } 72%,100% { transform: translateY(6px) scaleX(.3333) } }
@keyframes hjr-ap2 { 0%,40% { transform: translateY(22px) scaleX(.7917) } 72%,100% { transform: translateY(14px) scaleX(.5833) } }
@keyframes hjr-apGold { 0%,14% { transform: translateY(30px) scaleX(1) } 26%,40% { transform: translateY(38px) scaleX(.7917) } 72%,100% { transform: translateY(30px) scaleX(1) } }
@keyframes hjr-apReact { 0%,17% { transform: translateY(38px) scaleX(.7917) } 29%,40% { transform: translateY(30px) scaleX(1) } 72%,100% { transform: translateY(22px) scaleX(.7917) } }
@keyframes hjr-ap5 { 0%,40% { transform: translateY(46px) scaleX(.5833) } 72%,100% { transform: translateY(38px) scaleX(.7917) } }
@keyframes hjr-ap6 { 0%,40% { transform: translateY(54px) scaleX(.3333) } 72%,100% { transform: translateY(46px) scaleX(.5833) } }
@keyframes hjr-ap7 { 0%,40% { transform: translateY(62px) scaleX(.2083); opacity: 0 } 72%,100% { transform: translateY(54px) scaleX(.3333); opacity: 1 } }

/* Sizes the animated mark. Each rect carries its 0%-frame transform inline, so
   holding the animation (reduced motion) settles the static aperture. */
.mark-loading { flex: none; display: inline-block; vertical-align: middle; }
.mark-loading rect {
  transform-box: fill-box; transform-origin: center;
  animation-duration: 2.2s;
  animation-timing-function: cubic-bezier(.65, 0, .35, 1);
  animation-iteration-count: infinite;
}

/* Below 24px the scan drops to the three-rule reduction: the gold rule alone
   reads down the stack — the full choreography is illegible at that size. */
@keyframes hjr-m3scan {
  0%, 12% { transform: translateY(12px); }
  24%, 44% { transform: translateY(27px); }
  56%, 76% { transform: translateY(42px); }
  88%, 100% { transform: translateY(12px); }
}

@media (prefers-reduced-motion: reduce) { rect, g { animation: none !important; } }

/* — slice 2: global chrome, marketing ground, responsive floor — */

.kicker { font-size: var(--text-2xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-accent-700); }
.tnum { font-variant-numeric: tabular-nums; }

/* One sticky chrome for client and staff. The link rail scrolls when tight;
   below 640px it wraps to a full-width row of 40px pill links — pure CSS,
   nothing hidden. */
.nav { position: sticky; top: 0; z-index: 6; background: var(--color-bg); flex-wrap: wrap; row-gap: 8px; }
.nav-rail {
  display: flex; align-items: center; gap: clamp(12px, 2.4vw, 22px);
  overflow-x: auto; flex: 1 1 auto; min-width: 0; white-space: nowrap;
  scrollbar-width: none;
}
@media (max-width: 640px) {
  .nav-rail { flex-basis: 100%; order: 9; gap: 6px; }
  .nav-rail a {
    display: inline-flex; align-items: center; min-height: 40px;
    padding: 0 14px; border-radius: var(--radius-md);
    border: 1px solid var(--color-divider); text-decoration: none;
    color: color-mix(in srgb, var(--color-text) 68%, transparent);
  }
  .nav-rail a[aria-current="page"] {
    border-color: var(--color-accent);
    background: var(--color-accent-100); color: var(--color-accent-800);
  }
}
.nav-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--color-divider); display: grid;
  place-items: center; font-size: var(--text-2xs);
  font-family: var(--font-heading); font-weight: 600;
}
.account-switcher > summary.nav-avatar:hover,
.account-switcher[open] > summary.nav-avatar { border-color: var(--color-accent); color: var(--color-accent-800); }
.nav-juris { display: none; }
@media (min-width: 1000px) { .nav-juris { display: inline; } }

/* Staff pill rail under the nav on /ops and /admin. */
.subnav {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 10px clamp(14px, 3vw, 24px);
  border-bottom: 1px solid var(--color-divider);
}
.subnav a {
  display: inline-flex; align-items: center; min-height: 36px;
  padding: 0 14px; border-radius: var(--radius-md);
  border: 1px solid var(--color-divider); text-decoration: none;
  font-size: var(--text-sm); color: color-mix(in srgb, var(--color-text) 68%, transparent);
}
.subnav a:hover { border-color: var(--color-accent); color: var(--color-text); }
.subnav a[aria-current="page"] {
  border-color: var(--color-accent);
  background: var(--color-accent-100); color: var(--color-accent-800);
}

/* A gap, not a fact: the outcome we could not state. Dashed and italic
   because it is the absence of an answer, and must never read as one. */
.tag-gap {
  border: 1px dashed var(--color-divider); font-style: italic;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}

/* Facet rails: one filter dimension per row, each pill carrying its count.
   Same pill as .subnav — choosing a section and narrowing a list are the same
   gesture, and the system should not have two shapes for it. */
.facets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.facets-label {
  font-size: var(--text-2xs); letter-spacing: 0.1em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
  margin-right: 4px; flex: none;
}
.facet {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px;
  padding: 0 12px; border-radius: var(--radius-md);
  border: 1px solid var(--color-divider); text-decoration: none;
  font-size: var(--text-sm); color: color-mix(in srgb, var(--color-text) 68%, transparent);
}
a.facet:hover { border-color: var(--color-accent); color: var(--color-text); }
.facet[aria-current="true"] {
  border-color: var(--color-accent);
  background: var(--color-accent-100); color: var(--color-accent-800);
}
.facet-count { font-size: var(--text-2xs); opacity: 0.7; }
/* A facet nothing matches: still legible, plainly not a link. */
.facet-dead { opacity: 0.45; }

/* Wide content scrolls inside its own container — the body never does. */
.scroll-x { overflow-x: auto; max-width: 100%; }
.scroll-x > .table-wide { min-width: 700px; }

.hairline-grid { display: grid; gap: 1px; background: var(--color-divider); }
.hairline-grid > * { background: var(--color-bg); }

.stat-figure {
  font-family: var(--font-heading); font-weight: 400;
  font-size: clamp(25px, 3.4vw, 40px); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: var(--text-2xs); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 6px; }

.auth-col { max-width: min(100%, 420px); margin-inline: auto; }
.auth-lockup { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: var(--space-4); }
.auth-lockup-word { font-family: var(--font-heading); font-weight: 400; font-size: var(--text-2xl); line-height: 1.05; }
.auth-lockup-descriptor { font-size: var(--text-2xs); letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-accent-700); }

@media (pointer: coarse) {
  .btn, .input, .seg-opt { min-height: 44px; }
  .btn-ghost, .subnav a { min-height: 40px; }
  .nav-rail a { min-height: 44px; }
  .btn-icon { min-width: 44px; }
  .nav-avatar { width: 40px; height: 40px; }
  .marketing-nav-links a { min-height: 44px; display: inline-flex; align-items: center; }
  textarea.input { min-height: 88px; }
}
@media (max-width: 640px) {
  /* Only h1 steps down — h2/h3 must stay in the 1.5-1.7x band on a phone,
     which is exactly where hierarchy is easiest to lose. */
  h1 { font-size: var(--text-4xl); }
}

/* — the marketing ground (used only by the marketing layout/page) — */

.marketing-nav { padding: 10px clamp(16px, 5vw, 44px); }
.marketing-nav-links { display: none; align-items: center; gap: clamp(13px, 2.2vw, 26px); margin-left: auto; }
.marketing-menu-toggle {
  margin-left: auto; width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  color: var(--color-text); cursor: pointer;
}
.marketing-menu-toggle:hover { border-color: var(--color-accent); }
.marketing-menu {
  width: 100%; display: flex; flex-direction: column;
  border-top: 1px solid var(--color-divider); padding-top: 8px; margin-top: 4px;
}
.marketing-menu[hidden] { display: none; }
.marketing-menu a:not(.btn) { padding: 13px 2px; border-bottom: 1px solid var(--color-divider); text-decoration: none; font-size: var(--text-md); }
.marketing-menu .btn { margin-top: 12px; }
@media (min-width: 860px) {
  .marketing-nav-links { display: flex; }
  .marketing-menu-toggle { display: none; }
  .marketing-menu { display: none; }
}

/* Hero on solid vault: the photo never shipped, so the gradient reads as light
   entering from the right (the og card's treatment) with the corpus in shadow. */
.marketing-hero { position: relative; background: var(--vault); color: var(--bone); overflow: hidden; }
.marketing-hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.marketing-hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    var(--vault) 8%,
    color-mix(in srgb, var(--vault) 74%, transparent) 52%,
    color-mix(in srgb, var(--vault) 40%, transparent) 100%);
}
.marketing-wrap { max-width: 1180px; margin: 0 auto; padding-inline: clamp(20px, 5vw, 44px); }
.marketing-section { padding-block: clamp(38px, 7vw, 64px); border-bottom: 1px solid var(--color-divider); }
.marketing-seam {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
  gap: 1px; background: var(--color-divider);
  margin-inline: calc(-1 * clamp(16px, 2.4vw, 30px));
}
.marketing-seam > * { background: var(--color-bg); padding: clamp(16px, 2.2vw, 24px) clamp(16px, 2.4vw, 30px); }
.marketing-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(26px, 5vw, 56px);
}
.marketing-footer { background: var(--vault); color: color-mix(in srgb, var(--bone) 70%, transparent); padding: 30px clamp(20px, 5vw, 44px); }

/* — slice 3: the client portal's vocabulary — */

/* Completeness chips: one bordered pill, segmented by hairlines. The middle
   world's per-tier honesty; an accent border marks a card filling in live. */
/* A weak AI fact is the quietest thing on the page — never outline-gold. */
.tag-low { border: 1px solid var(--color-divider); color: color-mix(in srgb, var(--color-text) 55%, transparent); }

.chips {
  display: inline-flex; align-items: center; max-width: 100%;
  overflow-x: auto; border: 1px solid var(--color-divider);
  border-radius: var(--radius-md); font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--color-text) 75%, transparent);
}
.chips--live { border-color: var(--color-accent); }
.chip-seg { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; white-space: nowrap; }
.chip-seg + .chip-seg { box-shadow: -1px 0 0 0 var(--color-divider); }
.chip-seg.is-pending { font-style: italic; opacity: 0.7; }
.chip-seg .tick { color: var(--color-accent); }

.pulse-dot {
  flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-accent);
  animation: hjr-pulse 1.4s ease-in-out infinite;
}

/* Queue depth / spend meters (accent-700 near cap — never red). */
.meter { height: 6px; border-radius: 3px; background: var(--color-neutral-200); overflow: hidden; }
.meter-fill { height: 100%; background: var(--color-accent); }
.meter-fill--warn { background: var(--color-accent-700); }

/* Outcome distribution: segments are ramp steps, never new hues. */
.dist-bar {
  display: flex; height: 12px; border: 1px solid var(--color-divider);
  border-radius: 2px; overflow: hidden;
}
.dist-seg--600 { background: var(--color-accent-600); }
.dist-seg--400 { background: var(--color-accent-400); }
.dist-seg--300 { background: var(--color-accent-300); }
.dist-seg--100 { background: var(--color-accent-100); }
.dist-seg--hatched {
  background: repeating-linear-gradient(45deg,
    var(--color-neutral-200) 0 3px, transparent 3px 6px);
}
.dist-swatch { flex: none; width: 9px; height: 9px; border-radius: 2px; border: 1px solid var(--color-divider); }

/* A named blockage: work has stopped somewhere the meters structurally cannot
   show. Accent rule down the left, faint accent wash — loud enough to read as
   stopped, quiet enough to sit above a working board. */
.blockage {
  border: 1px solid var(--color-accent);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-accent) 7%, transparent);
  padding: var(--space-3) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2);
}
/* Name the blockage, then say what it cost — a two-part voice, so both parts
   belong to the class rather than to a style attribute on the markup. */
.blockage-title { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: var(--text-md); }
.blockage-meta { font-size: var(--text-xs); }

/* Unharvested territory: a deliberately unfinished texture — dashed border,
   translucent surface. A search past Coverage never 404s. */
.unharvested {
  border: 1px dashed color-mix(in srgb, var(--color-text) 30%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface) 45%, transparent);
  padding: var(--space-3) var(--space-4);
  display: flex; flex-direction: column; gap: 8px;
}

/* Miniature page skeleton — the stand-in when no preview image exists yet.
   Accent lines mark where the quoted passage sits. */
.minipage {
  aspect-ratio: 8.5 / 11; border: 1px solid var(--color-divider);
  background: var(--color-neutral-100); border-radius: var(--radius-sm);
  padding: 12px 10px; display: flex; flex-direction: column; gap: 4px;
}
.minipage-line {
  height: 2.5px; border-radius: 1px;
  background: color-mix(in srgb, var(--color-text) 14%, transparent);
}
.minipage-hit {
  background: var(--color-accent-300);
  box-shadow: 0 0 0 2px var(--color-accent-100);
}

/* The viewer's paper pane. */
.paper-page { width: min(660px, 100%); margin-inline: auto; background: var(--paper-leaf); }
.viewer-body { display: grid; gap: var(--space-4); align-items: start; }
@media (min-width: 1000px) { .viewer-body { grid-template-columns: minmax(0, 1fr) 300px; } }

/* Docket timeline: date gutter / marker rail / body. Hearings take the circled
   marker, filings the square; cancellations are struck, reason kept legible. */
.timeline-row {
  display: grid; grid-template-columns: minmax(58px, 96px) 16px minmax(0, 1fr);
  column-gap: clamp(9px, 1.6vw, 16px);
}
.timeline-date { text-align: right; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.timeline-rail { display: flex; flex-direction: column; align-items: center; }
.timeline-rail::after { content: ""; width: 1px; flex: 1; min-height: 12px; background: var(--color-divider); }
.timeline-row:last-child .timeline-rail::after { content: none; }
.timeline-marker--filing {
  flex: none; width: 11px; height: 11px; margin-top: 4px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--color-neutral-500);
}
.timeline-marker--hearing {
  flex: none; width: 12px; height: 12px; margin-top: 4px;
  border-radius: 50%; border: 1.5px solid var(--color-accent);
}
.timeline-marker--struck {
  flex: none; width: 12px; height: 12px; margin-top: 4px;
  border-radius: 50%; border: 1.5px dashed var(--color-neutral-400);
}
.timeline-title--struck {
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--color-text) 45%, transparent);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.timeline-reason { color: var(--color-accent-700); font-style: italic; font-size: var(--text-xs); }

/* Outcome criteria: custom checkboxes in the design's grammar — a native
   (visually hidden) input drives an accent box whose check appears on :checked. */
.crit { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: var(--text-md); min-height: 32px; }
.crit input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.crit-box {
  flex: none; width: 15px; height: 15px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-divider); display: grid; place-items: center;
  color: var(--color-bg);
}
.crit-box svg { display: none; }
.crit input:checked + .crit-box { border-color: var(--color-accent); background: var(--color-accent); }
.crit input:checked + .crit-box svg { display: block; }
.crit input:focus-visible + .crit-box { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.crit:has(input:not(:checked)) { color: color-mix(in srgb, var(--color-text) 70%, transparent); }
@media (pointer: coarse) { .crit { min-height: 40px; } }

/* Button busy affordance: Turbo sets aria-busy on the submitting form; the
   spinner ring appears without any JS. */
.btn-spinner {
  display: none; flex: none; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 35%, transparent);
  border-top-color: currentColor;
  animation: hjr-spin 0.7s linear infinite;
}
form[aria-busy] .btn-spinner { display: inline-block; }
form[aria-busy] .btn[type="submit"], form[aria-busy] button.btn { opacity: 0.72; cursor: progress; }

/* The page_modal frame's busy state: the mark, while it reads. Hidden until
   Turbo marks the frame busy; replaced wholesale once the viewer lands. */
#page_modal > .frame-loading { display: none; }
#page_modal[busy] > .frame-loading {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: color-mix(in srgb, var(--color-neutral-900) 30%, transparent);
}

/* — slice 4: the ops cockpit — */

/* Two independently-flowing panes ≥1040px; a single column below. */
.ops-cockpit { display: grid; gap: var(--space-4); align-items: start; }
@media (min-width: 1040px) { .ops-cockpit { grid-template-columns: minmax(0, 1fr) 440px; } }

/* One bordered box, hairline-separated rows (source sessions, small rosters). */
.roster { border: 1px solid var(--color-divider); border-radius: var(--radius-md); }
.roster-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; flex-wrap: wrap; }
.roster-row + .roster-row { box-shadow: 0 -1px 0 0 var(--color-divider); }

/* Session/health dots: solid = healthy, hollow pulsing = act soon, hollow
   neutral = down. Warning is accent-700 — never red. */
.status-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }
.status-dot--warn {
  background: var(--color-accent-100); border: 1.5px solid var(--color-accent-700);
  animation: hjr-pulse 1.4s ease-in-out infinite;
}
.status-dot--off { background: transparent; border: 1.5px solid var(--color-neutral-400); }

/* Queue depth rows: lane tag / meter / note. Stack on phones. */
.queue-row { display: grid; grid-template-columns: 118px minmax(40px, 1fr) auto; gap: 12px; align-items: center; }
@media (max-width: 640px) { .queue-row { grid-template-columns: 1fr; gap: 6px; } }

/* The live pipeline feed: dot rail + body per event; dots age down the ramp. */
.feed-row { display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 12px; }
.feed-rail { display: flex; flex-direction: column; align-items: center; }
.feed-rail::after { content: ""; width: 1px; flex: 1; min-height: 10px; background: var(--color-divider); }
.feed-row:last-child .feed-rail::after { content: none; }
.feed-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; }
.feed-dot--now { background: var(--color-accent); animation: hjr-pulse 1.4s ease-in-out infinite; }
.feed-dot--recent { background: var(--color-accent-300); }
.feed-dot--old { background: var(--color-neutral-300); }
.feed-body { padding-bottom: 16px; min-width: 0; animation: hjr-rise 0.4s ease both; }

/* Ingest-run ledger rows: a grid summary that expands to the stored log. */
.runs { min-width: 900px; }
.run-grid {
  display: grid; align-items: center; gap: 12px; padding: 10px 12px;
  grid-template-columns: 76px 110px minmax(170px, 2fr) minmax(150px, 1.4fr) minmax(110px, 1fr) 96px 92px;
}
.runs > .run-grid--head { padding-block: 6px; }
.run-row { border-top: 1px solid var(--color-divider); }
.run-row summary { list-style: none; cursor: pointer; }
.run-row summary::-webkit-details-marker { display: none; }
.run-row summary:hover .run-grid { background: var(--color-neutral-100); }
.run-log { background: var(--color-neutral-100); padding: 12px 14px; animation: hjr-fade 0.22s ease both; }

/* Coverage strips: swept fill, in-flight hatch, today's tick. */
.coverage-row { display: flex; flex-direction: column; gap: 5px; }
.coverage-track {
  position: relative; height: 6px; border-radius: 3px;
  background: var(--color-neutral-200); overflow: hidden;
}
.coverage-swept { position: absolute; top: 0; bottom: 0; background: var(--color-accent-400); }
.coverage-inflight {
  position: absolute; top: 0; bottom: 0;
  background: repeating-linear-gradient(45deg, var(--color-accent-200) 0 3px, transparent 3px 6px);
}
.coverage-tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--color-accent-700); }

/* The directive lane board. */
.lane-board {
  display: grid; gap: var(--space-4); align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr));
}
.lane-empty {
  border: 1px dashed var(--color-divider); border-radius: var(--radius-md);
  padding: 18px 14px; text-align: center; font-style: italic; font-size: var(--text-sm);
}

/* Joined filter links (the ledger's All / With errors / Running group). */
.seg-links {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-links a {
  display: inline-flex; align-items: center; padding: 7px 12px;
  font-size: var(--text-sm); text-decoration: none;
  color: color-mix(in srgb, var(--color-text) 68%, transparent);
}
.seg-links a + a { border-left: 1px solid var(--color-divider); }
.seg-links a[aria-current="page"] { background: var(--color-accent-100); color: var(--color-accent-800); }
.seg-links a:not([aria-current="page"]):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
@media (pointer: coarse) { .seg-links a { min-height: 40px; } }

/* ── The native shells' tab bar ────────────────────────────────────────────
   Fixed to the bottom of the web view, above the home indicator. The shells
   own the title bar; this owns everything else, which is why it is a route
   list in Rails and not a UITabBarController in Swift. */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--color-bg);
  border-top: 1px solid var(--color-divider);
  /* The inset is 0 on a device with a physical home button, so this is the
     bar's own breathing room plus whatever the hardware demands. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 52px; padding: 7px 2px 6px;
  text-decoration: none;
  color: color-mix(in srgb, var(--color-text) 58%, transparent);
  -webkit-tap-highlight-color: transparent;
}
.tabbar-tab[aria-current="page"] { color: var(--color-accent-800); }
.tabbar-tab[aria-current="page"] .tabbar-icon { color: var(--color-accent); }
/* A tab label is a landmark, not prose: 12px is the platform's own tab size
   (iOS uses 10-11pt), and it never has to be read as a sentence. */
.tabbar-label {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: var(--text-2xs); line-height: 1; letter-spacing: 0.01em;
}
.tabbar-icon { flex: none; }
/* The bar floats over the page, so the page has to end above it. */
body.has-tabbar main { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
body.has-tabbar footer { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }

/* A grid child is min-width: auto, so one wide table or one long unbroken
   string sets a floor wider than a phone and drags the whole page sideways
   with it. Nothing in this app wants that: wide content scrolls inside
   .scroll-x, and everything else wraps. */
.grid > *, .hairline-grid > * { min-width: 0; }
.scroll-x { min-width: 0; }
