/* DocketWatch: "the public record, carefully kept".
   One hand-written stylesheet, no build step. Self-hosted IBM Plex (OFL, see /static/fonts/).
   Contrast (WCAG AA) checked for every text/background pair below; ratios noted next to the tokens. */

/* ---------------------------------------------------------------- fonts */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------------------------------------------------------------- tokens */
:root {
  --ink: #1F2A44;          /* 13.2:1 on paper, 14.3:1 on white */
  --ink-hover: #141C30;
  --ink-soft: #EEF0F4;     /* tint behind ink text, 12.5:1 */
  --paper: #F7F6F2;
  --paper-deep: #F0EEE8;
  --surface: #FFFFFF;
  --line: #E3E0D8;
  --line-strong: #CFCBC0;
  --muted: #5B6475;        /* 5.5:1 on paper, 6.0:1 on white, 5.1:1 on paper-deep */

  --red: #B42318;          /* 6.6:1 on white, 6.0:1 on its tint */
  --red-tint: #FEF3F2;
  --red-line: #F4C7C2;
  --amber: #B54708;        /* 5.4:1 on white, 5.2:1 on its tint */
  --amber-tint: #FFFAEB;
  --amber-line: #F5D9A8;
  --green: #2F7D4F;        /* 5.0:1 on white, 4.6:1 on its tint */
  --green-tint: #EDF6F0;
  --green-line: #BFDCC9;
  --slate: #475467;        /* 7.0:1 on its tint */
  --slate-tint: #F2F4F7;
  --slate-line: #D5DAE1;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* 4px scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px;

  --r-sm: 4px; --r: 6px;
  --shadow: 0 1px 2px rgba(31, 42, 68, 0.06), 0 8px 24px -12px rgba(31, 42, 68, 0.18);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink);
  --container: 1120px;
  --measure: 680px;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
main:focus { outline: none; }
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
p + p { margin-top: var(--s3); }
ul, ol { margin: 0; padding: 0; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
    text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: currentColor; }
strong { font-weight: 600; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--paper-deep); padding: 1px 5px; border-radius: var(--r-sm); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.muted { color: var(--muted); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s4); top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: var(--s2) var(--s4); border-radius: var(--r);
  text-decoration: none; font-weight: 500;
}
.skip-link:focus { top: var(--s4); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s6); }
@media (max-width: 480px) { .container { padding: 0 var(--s4); } }

.eyebrow {
  font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: var(--s3);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s4);
  font: inherit; font-size: 15px; font-weight: 500; line-height: 1.2; text-align: center;
  border-radius: var(--r); border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--ink-hover); color: var(--paper); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--ink); }
.btn--quiet { background: transparent; color: var(--ink); text-decoration: underline;
  text-decoration-color: var(--line-strong); text-underline-offset: 3px; padding: 0 var(--s2); }
.btn--quiet:hover { text-decoration-color: currentColor; background: var(--paper-deep); }
.btn--sm { min-height: 32px; font-size: 14px; padding: 0 var(--s3); }
.btn--quiet.btn--sm { padding: 0 var(--s2); }
.btn--lg { min-height: 48px; padding: 0 var(--s6); font-size: 16px; }
.btn--block { display: flex; width: 100%; }
.btn.is-disabled { color: var(--muted); background: var(--paper-deep); border-color: var(--line); cursor: default; }
@media (max-width: 480px) { .btn { white-space: normal; } }

.inline-form { display: inline; margin: 0; }
.stack { display: grid; gap: var(--s2); }

/* ---------------------------------------------------------------- badges, pills, banners */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; line-height: 1; letter-spacing: 0.01em;
  padding: 5px 8px; border-radius: var(--r-sm); border: 1px solid; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge--red { color: var(--red); background: var(--red-tint); border-color: var(--red-line); }
.badge--amber { color: var(--amber); background: var(--amber-tint); border-color: var(--amber-line); }
.badge--green { color: var(--green); background: var(--green-tint); border-color: var(--green-line); }
.badge--slate { color: var(--slate); background: var(--slate-tint); border-color: var(--slate-line); }

.pill {
  display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 500; line-height: 1;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-strong); white-space: nowrap;
}
.pill--plan { background: var(--ink-soft); color: var(--ink); border-color: #D3D8E2; }
.pill--none { background: var(--amber-tint); color: var(--amber); border-color: var(--amber-line); }

.messages { display: grid; gap: var(--s3); }
.messages:empty { display: none; }
.messages + * { margin-top: var(--s6); }
.banner {
  border: 1px solid; border-radius: var(--r);
  padding: var(--s3) var(--s4); font-size: 15px; color: var(--ink);
}
.banner p + p { margin-top: var(--s2); }
.banner--success { background: var(--green-tint); border-color: var(--green-line); }
.banner--warning { background: var(--amber-tint); border-color: var(--amber-line); }
.banner--error { background: var(--red-tint); border-color: var(--red-line); }
.banner--info { background: var(--slate-tint); border-color: var(--slate-line); }
.banner__label { font-weight: 600; }
.banner--success .banner__label { color: var(--green); }
.banner--warning .banner__label { color: var(--amber); }
.banner--error .banner__label { color: var(--red); }
.banner--info .banner__label { color: var(--slate); }
.banner .mono { word-break: break-word; }

/* ---------------------------------------------------------------- forms */
.form { display: grid; gap: var(--s4); }
.field { display: grid; gap: 6px; }
.field__label { font-size: 14px; font-weight: 500; }
.field__hint { font-size: 13px; color: var(--muted); }
.input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 10px 12px; min-height: 44px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input::placeholder { color: #6B7280; }
.input:hover { border-color: #B4AFA2; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(31, 42, 68, 0.12); }
.input--area { resize: vertical; min-height: 128px; line-height: 1.5; font-size: 15px; }
.file-input { font: inherit; font-size: 14px; color: var(--muted); max-width: 100%; }
.file-input::file-selector-button {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); margin-right: var(--s3);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 7px 12px; cursor: pointer;
}
.file-input::file-selector-button:hover { border-color: var(--ink); }
.file-input:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------------------------------------------------------------- marketing header & footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 68px; }
.site-header__logo img { width: 160px; }
.site-header__nav { display: flex; align-items: center; gap: var(--s5); }
.site-header__link { font-size: 15px; font-weight: 500; text-decoration: none; color: var(--ink); padding: var(--s1) 0; }
.site-header__link:hover { text-decoration: underline; }
.site-header__link.is-active { text-decoration: underline; text-decoration-color: var(--ink); text-underline-offset: 6px; }
@media (max-width: 560px) {
  .site-header__logo img { width: 128px; }
  .site-header__nav { gap: var(--s3); }
  .site-header__nav .btn--sm { padding: 0 var(--s2); }
}
@media (max-width: 400px) {
  .site-header__signin { display: none; }
}

.site-footer { border-top: 1px solid var(--line); margin-top: var(--s20); padding: var(--s10) 0 var(--s12); font-size: 14px; color: var(--muted); }
.site-footer__inner { display: grid; grid-template-columns: 1fr auto; gap: var(--s4) var(--s8); align-items: start; }
.site-footer__logo { display: inline-block; margin-bottom: var(--s3); }
.site-footer__logo img { width: 137px; }
.site-footer__disclaimer { max-width: 46ch; }
.site-footer__nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.site-footer__nav a { color: var(--ink); text-decoration: none; }
.site-footer__nav a:hover { text-decoration: underline; }
.site-footer__copy { grid-column: 1 / -1; padding-top: var(--s4); border-top: 1px solid var(--line); }
.site-footer--compact { margin-top: var(--s16); padding: var(--s6) 0 var(--s8); font-size: 13px; }
.site-footer--compact .site-footer__inner { grid-template-columns: 1fr auto; }
.site-footer--compact .site-footer__copy { border-top: 0; padding-top: 0; }
@media (max-width: 720px) {
  .site-footer__inner, .site-footer--compact .site-footer__inner { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- landing */
.hero { padding: var(--s16) 0 var(--s20); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: var(--s16); align-items: start; }
.hero__copy { padding-top: var(--s10); }
.hero__title { font-size: clamp(34px, 4.6vw, 50px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 600; }
.hero__lede { margin-top: var(--s6); font-size: 19px; line-height: 1.55; color: var(--ink); max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s8); }
.hero__note { margin-top: var(--s4); font-size: 14px; color: var(--muted); }
@media (max-width: 960px) {
  .hero { padding: var(--s10) 0 var(--s16); }
  .hero__inner { grid-template-columns: 1fr; gap: var(--s12); }
  .hero__copy { padding-top: 0; }
  .hero__lede { font-size: 17px; }
}
@media (max-width: 480px) {
  .hero__actions .btn { width: 100%; }
}

/* sample digest email */
.sample-mail { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); scroll-margin-top: var(--s6); }
.sample-mail__chrome { border-bottom: 1px solid var(--line); padding: var(--s3) var(--s5) var(--s4); background: #FCFBF9; border-radius: var(--r) var(--r) 0 0; }
.sample-mail__bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.sample-tag {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); border: 1px dashed var(--ink); border-radius: var(--r-sm); padding: 3px 7px;
}
.sample-mail__kind { font-size: 12.5px; color: var(--muted); }
.sample-mail__meta { margin: 0; display: grid; gap: 2px; font-size: 13.5px; }
.sample-mail__meta div { display: grid; grid-template-columns: 64px 1fr; gap: var(--s2); }
.sample-mail__meta dt { color: var(--muted); }
.sample-mail__meta dd { margin: 0; font-weight: 500; }
.sample-mail__body { padding: var(--s5); }
.sample-mail__title { font-size: 18px; font-weight: 600; }
.sample-mail__summary { margin-top: 2px; font-size: 14px; color: var(--muted); }
.sample-mail__caption { padding: var(--s3) var(--s5); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

.digest { list-style: none; margin-top: var(--s4); display: grid; gap: var(--s3); }
.digest__item { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3) var(--s4); }
.digest__item--high { border-color: var(--red-line); }
.digest__head { font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.digest__head .badge { font-size: 11.5px; padding: 3px 6px; margin-right: 6px; vertical-align: 1px; }
.digest__head .mono, .alert-item__headline .mono { font-weight: 500; }
.digest__lines { margin: var(--s2) 0 var(--s2) var(--s5); font-size: 13.5px; color: var(--ink); }
.digest__lines li + li { margin-top: 2px; }
.digest__link { font-size: 13.5px; }

/* sections */
.section { padding: var(--s16) 0; }
.section--tight { padding: var(--s8) 0 var(--s12); }
.section--rule { border-top: 1px solid var(--line); }
.section__head { max-width: var(--measure); margin-bottom: var(--s10); }
.section__head h2 { font-size: clamp(26px, 3vw, 32px); letter-spacing: -0.02em; }
.section__head .muted { margin-top: var(--s3); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--s12); align-items: start; }
.split__aside { margin-bottom: 0; }
@media (max-width: 860px) {
  .section { padding: var(--s12) 0; }
  .split { grid-template-columns: 1fr; gap: var(--s8); }
}

.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s8); }
.step { border-top: 1px solid var(--line-strong); padding-top: var(--s5); }
.step__num { display: block; font-size: 13px; color: var(--muted); margin-bottom: var(--s3); }
.step__title { font-size: 19px; margin-bottom: var(--s2); }
.step p { color: var(--ink); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; gap: var(--s6); } }

.watch-grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.watch-grid__item { padding: var(--s5) var(--s6) var(--s5) 0; border-bottom: 1px solid var(--line); }
.watch-grid__item:nth-child(odd) { border-right: 1px solid var(--line); }
.watch-grid__item:nth-child(even) { padding-left: var(--s6); padding-right: 0; }
.watch-grid__item:last-child:nth-child(odd) { border-right: 0; }
.watch-grid dt { font-weight: 600; margin-bottom: var(--s1); }
.watch-grid dd { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 640px) {
  .watch-grid { grid-template-columns: 1fr; }
  .watch-grid__item, .watch-grid__item:nth-child(even) { padding: var(--s4) 0; border-right: 0; }
  .watch-grid__item:nth-child(odd) { border-right: 0; }
}

.notice { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--s12);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s8) var(--s10); }
.notice__title { font-size: 22px; }
.notice__body { max-width: var(--measure); }
@media (max-width: 860px) { .notice { grid-template-columns: 1fr; gap: var(--s4); padding: var(--s6); } }

.teaser { display: flex; align-items: center; justify-content: space-between; gap: var(--s8); flex-wrap: wrap; }
.teaser h2 { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; }
.teaser__price { font-family: var(--mono); font-weight: 500; font-size: 1.25em; letter-spacing: -0.02em; }
.teaser__copy p:last-child { margin-top: var(--s2); color: var(--muted); }
.teaser__actions { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: var(--s4) var(--s8) var(--s4) 0; position: relative;
  font-weight: 500; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: var(--s1); top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg);
  transition: transform 150ms ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq summary:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.faq summary:focus-visible { outline-offset: 4px; }
.faq details p { padding: 0 var(--s8) var(--s5) 0; color: var(--ink); max-width: var(--measure); }

.cta { border-top: 1px solid var(--line); text-align: center; padding: var(--s20) 0 var(--s8); }
.cta__title { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.02em; }
.cta__lede { margin: var(--s3) auto var(--s8); color: var(--muted); max-width: 40em; font-size: 17px; }

/* ---------------------------------------------------------------- pricing */
.page-hero { padding: var(--s16) 0 var(--s8); }
.page-hero__title { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.025em; max-width: 20em; }
.page-hero__lede { margin-top: var(--s4); font-size: 18px; max-width: 38em; color: var(--ink); }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); align-items: stretch; }
.plans--console { margin-top: var(--s6); }
.plans__note { margin-top: var(--s4); font-size: 14px; color: var(--muted); }
.plans__portal { margin-top: var(--s3); }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

.plan { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s8); }
.plan--featured { border-color: var(--ink); box-shadow: var(--shadow); }
.plan__label { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.plan__title { margin-top: var(--s3); font-weight: 400; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--s1); }
.plan__price { font-family: var(--mono); font-size: 44px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.plan__per { font-size: 16px; color: var(--muted); margin-right: var(--s2); }
.plan__carriers { font-size: 18px; font-weight: 500; flex-basis: 100%; margin-top: var(--s2); }
.plan__billed { margin-top: var(--s3); font-size: 14px; color: var(--ink); }
.plan__founding { margin-top: 2px; font-size: 14px; color: var(--muted); }
.plan .checklist { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); flex: 1 0 auto; }
.plan__action { margin-top: var(--s8); }
@media (max-width: 480px) { .plan { padding: var(--s6); } .plan__price { font-size: 38px; } }

.checklist { list-style: none; display: grid; gap: var(--s3); font-size: 15px; }
.checklist li { position: relative; padding-left: 26px; }
.checklist li::before {
  content: ""; position: absolute; left: 3px; top: 5px; width: 6px; height: 11px;
  border-right: 1.75px solid var(--green); border-bottom: 1.75px solid var(--green); transform: rotate(45deg);
}

/* ---------------------------------------------------------------- legal / prose */
.legal { padding: var(--s16) 0 0; }
.legal__inner { max-width: calc(var(--measure) + 2 * var(--s6)); }
.legal__head { padding-bottom: var(--s8); border-bottom: 1px solid var(--line); margin-bottom: var(--s8); }
.legal__title { font-size: clamp(30px, 4vw, 40px); letter-spacing: -0.025em; }
.legal__meta { margin-top: var(--s3); font-size: 14px; color: var(--muted); }
.prose { font-size: 16.5px; line-height: 1.65; }
.prose h2 { font-size: 20px; margin: var(--s10) 0 var(--s3); }
.prose > :first-child { margin-top: 0; }
.prose p + p { margin-top: var(--s4); }
.prose ul { margin: var(--s3) 0 0; padding-left: var(--s5); display: grid; gap: var(--s2); }
.prose ul + p, .prose p + ul { margin-top: var(--s3); }
.prose li::marker { color: var(--muted); }
.prose .lede { font-size: 19px; line-height: 1.55; }
.contact-list { margin: var(--s8) 0 0; border-top: 1px solid var(--line); }
.contact-list div { display: grid; grid-template-columns: 160px 1fr; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.contact-list dt { color: var(--muted); font-size: 15px; }
.contact-list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 480px) { .contact-list div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------------------------------------------------------------- errors */
.error-page { padding: var(--s24) 0 var(--s16); }
.error-page__inner { max-width: calc(var(--measure) + 2 * var(--s6)); }
.error-page__code { font-size: 14px; color: var(--muted); border: 1px solid var(--line-strong); display: inline-block; padding: 2px 8px; border-radius: var(--r-sm); }
.error-page__title { margin-top: var(--s5); font-size: clamp(30px, 4vw, 40px); letter-spacing: -0.025em; }
.error-page__lede { margin-top: var(--s4); font-size: 18px; color: var(--muted); }
.error-page__actions { margin-top: var(--s8); display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- auth */
.auth { display: flex; flex-direction: column; align-items: center; padding: var(--s16) var(--s4) 0; }
.auth__logo img { width: 175px; }
.auth__logo { margin-bottom: var(--s8); }
.auth__card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: var(--s8); box-shadow: var(--shadow); display: grid; gap: var(--s5); }
.auth__card > * { margin: 0; }
.auth__title { font-size: 24px; letter-spacing: -0.015em; }
.auth__lede { color: var(--ink); font-size: 15.5px; }
.auth__fine { font-size: 14px; color: var(--muted); }
.auth__aside { margin-top: var(--s5); font-size: 14px; color: var(--muted); text-align: center; }
.auth__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--ink-soft); display: grid; place-items: center; }
.auth__icon-mark { width: 20px; height: 14px; border: 1.75px solid var(--ink); border-radius: 2px; position: relative; overflow: hidden; }
.auth__icon-mark::before { content: ""; position: absolute; left: 50%; top: -9px; width: 14px; height: 14px;
  border: 1.75px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
@media (max-width: 480px) { .auth { padding-top: var(--s10); } .auth__card { padding: var(--s6); } }

.figures { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); }
.figures div { padding: var(--s3); }
.figures div + div { border-left: 1px solid var(--line); }
.figures dt { font-size: 12.5px; color: var(--muted); }
.figures dd { margin: 2px 0 0; font-size: 20px; font-weight: 500; }

/* ---------------------------------------------------------------- console shell */
.app-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.app-bar__inner { display: flex; align-items: center; gap: var(--s8); min-height: 60px; }
.app-bar__logo img { width: 146px; }
.app-nav { display: flex; align-items: stretch; gap: var(--s1); align-self: stretch; }
.app-nav__link {
  display: flex; align-items: center; padding: 0 var(--s3); font-size: 15px; font-weight: 500;
  color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.app-nav__link:hover { color: var(--ink); }
.app-nav__link.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.app-nav__link:focus-visible { outline-offset: -2px; }
.app-bar__account { margin-left: auto; display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.app-bar__email { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
@media (max-width: 860px) {
  .app-bar__inner { flex-wrap: wrap; gap: 0 var(--s4); padding-top: var(--s3); }
  .app-bar__logo { order: 1; }
  .app-bar__account { order: 2; }
  .app-nav { order: 3; width: 100%; margin-top: var(--s2); margin-left: calc(-1 * var(--s3)); }
  .app-nav__link { min-height: 44px; }
  .app-bar__email { display: none; }
}
@media (max-width: 400px) { .app-bar__logo img { width: 120px; } }

.app-main { padding: var(--s10) 0 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s6); flex-wrap: wrap;
  padding-bottom: var(--s6); margin-bottom: var(--s6); border-bottom: 1px solid var(--line); }
.page-head__title { font-size: 30px; letter-spacing: -0.02em; }
.page-head__sub { margin-top: var(--s2); color: var(--muted); font-size: 15.5px; }
.page-head__sub strong { color: var(--ink); }
.page-head__count { font-size: 14px; color: var(--muted); }

.usage { min-width: 220px; }
.usage__label { margin-top: 6px; font-size: 13px; color: var(--muted); text-align: right; }
.usage__meter { display: block; width: 100%; height: 6px; appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: 0; border-radius: 3px; background: var(--paper-deep); overflow: hidden; }
.usage__meter::-webkit-meter-bar { background: var(--line); border: 0; border-radius: 3px; height: 6px; }
.usage__meter::-webkit-meter-optimum-value { background: var(--ink); border-radius: 3px; }
.usage__meter::-webkit-meter-suboptimum-value { background: var(--amber); border-radius: 3px; }
.usage__meter::-webkit-meter-even-less-good-value { background: var(--red); border-radius: 3px; }
.usage__meter::-moz-meter-bar { background: var(--ink); border-radius: 3px; }
.usage__meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--amber); }
.usage__meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--red); }
@media (max-width: 560px) { .usage { width: 100%; } .usage__label { text-align: left; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s6); }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s4); }
.panel__title { font-size: 18px; }
.panel__sub { font-size: 14px; color: var(--muted); }
@media (max-width: 480px) { .panel { padding: var(--s4); } }

.add-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: var(--s6); align-items: start; }
.add-form__side { display: grid; gap: var(--s5); justify-items: start; padding-top: 0; }
.add-form__side .btn { min-width: 120px; }
@media (max-width: 760px) { .add-form { grid-template-columns: 1fr; gap: var(--s4); } }

.section-block { margin-top: var(--s10); }
.section-block__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s3); }
.section-block__title { font-size: 18px; }
.section-block__meta { font-size: 13px; color: var(--muted); }

.table-wrap { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.data-table th, .data-table td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table thead th { font-size: 12.5px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  background: #FCFBF9; padding-top: 10px; padding-bottom: 10px; white-space: nowrap; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:hover { background: #FCFBF9; }
.data-table tbody th { font-weight: 500; }
.cell-docket { white-space: nowrap; }
.cell-name { font-weight: 500; }
.cell-status { line-height: 1.9; }
.cell-status .badge { margin: 2px 4px 2px 0; }
.cell-date { white-space: nowrap; color: var(--muted); font-size: 14px; }
.cell-action { text-align: right; white-space: nowrap; width: 1%; }
.cell-action form { margin: 0; }

.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r); padding: var(--s10) var(--s8); max-width: 100%; }
.empty__title { font-size: 18px; margin-bottom: var(--s3); }
.empty p { max-width: var(--measure); color: var(--ink); }
.empty p + p { margin-top: var(--s3); }
.empty .btn { margin-top: var(--s2); }
@media (max-width: 480px) { .empty { padding: var(--s6) var(--s5); } }

.footnote { margin-top: var(--s8); font-size: 13px; color: var(--muted); max-width: var(--measure); }

/* alerts */
.alert-log { display: grid; gap: var(--s8); }
.alert-day__date { font-size: 13px; font-weight: 500; color: var(--muted); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); margin-bottom: var(--s3); }
.alert-list { list-style: none; display: grid; gap: var(--s3); }
.alert-item { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: var(--s4); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4) var(--s5); }
.alert-item--high { border-color: var(--red-line); }
.alert-item__badges { display: flex; flex-wrap: wrap; gap: var(--s2); align-content: flex-start; padding-top: 1px; }
.alert-item__headline { font-size: 16px; font-weight: 600; line-height: 1.35; }
.alert-item__lines { margin: var(--s2) 0 0 var(--s5); font-size: 14.5px; }
.alert-item__lines li + li { margin-top: 2px; }
.alert-item__link { display: inline-block; margin-top: var(--s2); font-size: 14px; font-weight: 500; }
@media (max-width: 640px) {
  .alert-item { grid-template-columns: 1fr; gap: var(--s2); padding: var(--s4); }
}
.pager { margin-top: var(--s8); display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
.pager__status { font-size: 14px; color: var(--muted); }

/* billing */
.current-plan { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s10); padding: var(--s8); }
.current-plan__title { font-size: 28px; letter-spacing: -0.02em; }
.current-plan__usage { margin-top: var(--s2); margin-bottom: var(--s4); color: var(--ink); }
.current-plan .usage__meter { max-width: 360px; }
.current-plan__founding { margin-top: var(--s5); font-size: 14px; color: var(--muted); }
.current-plan__side { display: grid; gap: var(--s4); align-content: start; border-left: 1px solid var(--line); padding-left: var(--s10); }
@media (max-width: 760px) {
  .current-plan { grid-template-columns: 1fr; gap: var(--s6); padding: var(--s5); }
  .current-plan__side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: var(--s5); }
}
.kv { margin: 0; display: grid; gap: var(--s2); font-size: 14.5px; }
.kv div { display: flex; justify-content: space-between; gap: var(--s4); align-items: center; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* metrics (operator only) */
.metrics-section + .metrics-section { margin-top: var(--s12); padding-top: var(--s8); border-top: 1px solid var(--line); }
.metrics-section > * + * { margin-top: var(--s4); }
.metrics-section > .section-block__head { margin-bottom: 0; }
.metrics-section > .section-block__head .section-block__meta { max-width: 60ch; }
.metrics-subtitle { margin-top: var(--s8); font-size: 15px; font-weight: 600; }
.metrics-section > .metrics-subtitle { margin-top: var(--s8); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); }
.stat { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); }
.stat--warn { border-color: var(--amber-line); background: var(--amber-tint); }
.stat__label { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat__value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 500;
  line-height: 1.2; letter-spacing: -0.02em; }
.stat__value--text { font-family: var(--sans); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.stat__meta { font-size: 13px; color: var(--muted); }
.stat__foot { margin-top: auto; padding-top: var(--s3); display: flex; align-items: center; justify-content: space-between;
  gap: var(--s2); flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.flag-list { display: grid; gap: var(--s2); }
.metrics-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.panel--compact { padding: var(--s4); }
.panel--compact .panel__title { font-size: 15px; margin-bottom: var(--s3); }
@media (max-width: 860px) { .metrics-cols { grid-template-columns: 1fr; } }
.metrics-table tbody th { white-space: nowrap; }
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .stat { padding: var(--s3); }
  .stat__value { font-size: 21px; }
  .stat__value--text { font-size: 16px; }
}
.data-table .num { text-align: right; }
.data-table tbody tr.is-held > *, .data-table tbody tr.is-flagged > * { background: var(--red-tint); }
.cmd { font-family: var(--mono); font-size: 13.5px; background: var(--surface); border: 1px solid var(--red-line);
  border-radius: var(--r-sm); padding: 1px 6px; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------------------------------------------------------------- print */
@media print {
  .site-header, .app-bar, .site-footer, .skip-link, .btn { display: none !important; }
  body { background: #fff; }
}

/* ---------------------------------------------------------------- tender-check records (/r/<uuid>) and checks */
.record { padding-top: 24px; padding-bottom: 48px; max-width: 960px; }
.record__brand { display: flex; align-items: center; justify-content: space-between; margin: 0 0 24px; }
.record__title { font-size: 1.6rem; margin: 4px 0 12px; }
.record__facts { margin-bottom: 24px; }
.record__hash { word-break: break-all; }
.record__dataset { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.record__ds-title { font-size: 1.05rem; margin: 0 0 4px; }
.record__ds-id { font-weight: 400; color: var(--muted); font-size: .85em; }
.record__ds-meta { margin: 0 0 6px; color: var(--muted); }
.record__empty { color: var(--muted); font-style: italic; }
.record__table { margin-top: 8px; }
.record__note { margin-top: 32px; color: var(--muted); font-size: .9rem; }
.record__footer { margin-top: 16px; padding-top: 12px; border-top: 2px solid var(--ink); font-weight: 600; }
.stack-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media print {
  .record__pdf { display: none !important; }
  .record__dataset { break-inside: avoid; }
}
