/* Firmline: the app's design system. Self-hosted font, no third-party requests.
   The app is a product window set into the navy band: navy frame, paper sheet, white panels.
   Sections follow src/views/ui.tsx. Colour lives in the tokens; components never use raw hex. */

@font-face {
  font-family: "Instrument Sans";
  src: url("/static/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens */

:root {
  --navy: #041b3a;
  --navy-raise: rgba(255, 255, 255, 0.07);
  --navy-ink: #c9d5e8;
  --navy-ink-2: #8fa3c2;
  --navy-line: rgba(255, 255, 255, 0.1);

  --paper: #f6f8fb;
  --surface: #ffffff;
  --ink: #0a1a33;
  --ink-2: #3d4b63;
  --ink-3: #66748d;
  --line: #e1e7ef;
  --line-2: #edf1f6;

  --accent: #074598;
  --accent-strong: #05357a;
  --accent-soft: #edf2fa;
  --accent-line: #c9d8ee;
  --on-accent: #ffffff;

  --met: #157f46;
  --met-soft: #e6f5ec;
  --warn: #8f5500;
  --warn-mark: #e5a12a;
  --warn-soft: #fff3dc;
  --danger: #c4323a;
  --danger-soft: #fdeeee;

  --apx-1: var(--accent);
  --apx-2: #8fb3ea;
  --apx-3: var(--warn-mark);
  --apx-4: var(--met);
  --apx-5: #7a5cc2;
  --apx-6: var(--ink-3);
  --apx-text: var(--ink-3);
  --apx-grid: var(--line-2);

  --shadow-panel: 0 0 0 1px rgba(10, 26, 51, 0.06), 0 1px 2px rgba(10, 26, 51, 0.04);
  --shadow-card: 0 0 0 1px rgba(10, 26, 51, 0.06), 0 1px 2px rgba(10, 26, 51, 0.05), 0 24px 48px -24px rgba(4, 27, 58, 0.45);
  --radius-sheet: 20px;
  --radius-panel: 12px;
  --radius-control: 8px;

  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #020a17;
    --navy-raise: rgba(255, 255, 255, 0.06);
    --navy-line: rgba(255, 255, 255, 0.08);
    --paper: #0a1628;
    --surface: #0f1f37;
    --ink: #e6ecf5;
    --ink-2: #b2bfd2;
    --ink-3: #8191aa;
    --line: #22365a;
    --line-2: #182a48;
    --accent: #8eb5f2;
    --accent-strong: #b6cff7;
    --accent-soft: #13284a;
    --accent-line: #29467a;
    --on-accent: #041b3a;
    --met: #57c991;
    --met-soft: #0e2e22;
    --warn: #f2bf62;
    --warn-mark: #f2bf62;
    --warn-soft: #33280f;
    --danger: #f27c83;
    --danger-soft: #3b171d;
    --apx-2: #3d6bb0;
  --apx-5: #a891e6;
    --apx-5: #a891e6;
    --shadow-panel: 0 0 0 1px rgba(142, 181, 242, 0.08);
    --shadow-card: 0 0 0 1px rgba(142, 181, 242, 0.1), 0 24px 48px -24px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #020a17;
  --navy-raise: rgba(255, 255, 255, 0.06);
  --navy-line: rgba(255, 255, 255, 0.08);
  --paper: #0a1628;
  --surface: #0f1f37;
  --ink: #e6ecf5;
  --ink-2: #b2bfd2;
  --ink-3: #8191aa;
  --line: #22365a;
  --line-2: #182a48;
  --accent: #8eb5f2;
  --accent-strong: #b6cff7;
  --accent-soft: #13284a;
  --accent-line: #29467a;
  --on-accent: #041b3a;
  --met: #57c991;
  --met-soft: #0e2e22;
  --warn: #f2bf62;
  --warn-mark: #f2bf62;
  --warn-soft: #33280f;
  --danger: #f27c83;
  --danger-soft: #3b171d;
  --apx-2: #3d6bb0;
  --shadow-panel: 0 0 0 1px rgba(142, 181, 242, 0.08);
  --shadow-card: 0 0 0 1px rgba(142, 181, 242, 0.1), 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--navy);
  color: var(--ink);
  font: 400 0.9375rem/1.55 var(--font);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
p {
  margin: 0 0 0.75em;
  max-width: 72ch;
}
p:last-child {
  margin-bottom: 0;
}
a {
  color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--accent-strong);
}
code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.icon {
  flex: none;
  vertical-align: -0.2em;
}
.muted {
  color: var(--ink-3);
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -9999px;
  z-index: 10;
}
.skip:focus {
  left: 12px;
  top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
}
.stack {
  display: grid;
  gap: 18px;
}
.stack-sm {
  display: grid;
  gap: 12px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.small {
  font-size: 0.8125rem;
}
.top-gap {
  margin-top: 14px;
}
.prewrap {
  white-space: pre-wrap;
}
.narrow {
  max-width: 980px;
}

/* ---------------------------------------------------------------- the frame: navy rail, paper sheet */

.frame {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}
.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 22px 14px 16px;
  overflow: hidden;
  color: var(--navy-ink);
}
.rail-brand {
  display: block;
  padding: 2px 10px;
  line-height: 0;
}
.rail-nav {
  display: grid;
  gap: 2px;
}
.rail-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  color: var(--navy-ink);
  font-weight: 500;
  text-decoration: none;
}
.rail-nav a .icon {
  color: var(--navy-ink-2);
}
.rail-nav a:hover {
  background: var(--navy-raise);
  color: #fff;
}
.rail-nav a[aria-current="page"] {
  background: rgba(142, 181, 242, 0.16);
  color: #fff;
}
.rail-nav a[aria-current="page"] .icon {
  color: #8eb5f2;
}
.rail-count {
  min-width: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: #8eb5f2;
  color: #041b3a;
  font-size: 0.75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
  text-align: center;
}
.rail-foot {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid var(--navy-line);
}
.rail-account {
  display: grid;
  min-width: 0;
}
.rail-org {
  overflow: hidden;
  color: #fff;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-email {
  overflow: hidden;
  color: var(--navy-ink-2);
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rail-actions form {
  margin: 0;
}
.theme-switch {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: var(--navy-raise);
}
.theme-switch button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--navy-ink-2);
  cursor: pointer;
}
.theme-switch button:hover {
  color: #fff;
}
.theme-switch button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.rail-signout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 0;
  background: none;
  color: var(--navy-ink-2);
  font: 500 0.8125rem var(--font);
  cursor: pointer;
}
.rail-signout:hover {
  color: #fff;
}
.legal {
  display: flex;
  gap: 14px;
  font-size: 0.75rem;
}
.legal a {
  color: var(--navy-ink-2);
  text-decoration: none;
}
.legal a:hover {
  color: #fff;
  text-decoration: underline;
}
/* the brand's stripes, large and faint, cropped by the rail's foot */
.rail-mark {
  position: absolute;
  bottom: -70px;
  left: -90px;
  width: 300px;
  height: auto;
  opacity: 0.05;
  pointer-events: none;
}
.sheet {
  min-width: 0;
  min-height: calc(100vh - 20px);
  margin: 10px 10px 10px 0;
  padding: 36px clamp(20px, 3.6vw, 52px) 72px;
  border-radius: var(--radius-sheet);
  background: var(--paper);
}
.sheet > * {
  max-width: 1180px;
}

@media (max-width: 880px) {
  .frame {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    position: static;
    height: auto;
    gap: 14px;
    padding: 14px 16px 12px;
  }
  .rail-nav {
    display: flex;
    gap: 4px;
    margin: 0 -16px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .rail-nav a {
    flex: none;
    padding: 7px 12px;
  }
  .rail-foot {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding-top: 10px;
  }
  .rail-email,
  .rail-mark {
    display: none;
  }
  .rail-foot .legal {
    grid-column: 1 / -1;
  }
  .sheet {
    min-height: 0;
    margin: 0;
    padding: 24px 16px 56px;
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  }
}

/* ---------------------------------------------------------------- signed out: one card on the band */

/* the glow and the stripes are fixed to the viewport, so they never make the page taller or repeat */
.band {
  min-height: 100vh;
  background: radial-gradient(900px 520px at 100% 0%, rgba(47, 111, 208, 0.35), rgba(47, 111, 208, 0) 65%) no-repeat fixed, var(--navy);
}
.band-mark {
  position: fixed;
  bottom: -120px;
  left: -140px;
  width: min(720px, 90vw);
  opacity: 0.05;
  pointer-events: none;
}
.band-main {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 28px;
  min-height: 100vh;
  padding: 48px 16px 28px;
  align-content: center;
}
.band-brand {
  line-height: 0;
}
.auth {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
}
.auth-card {
  display: grid;
  gap: 16px;
  padding: 32px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.auth-card h1 {
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.auth-lead {
  color: var(--ink-2);
}
.auth-foot {
  color: var(--navy-ink);
  font-size: 0.875rem;
  text-align: center;
}
.auth-foot a {
  color: #fff;
}
.band .legal a {
  color: var(--navy-ink-2);
}
@media (max-width: 480px) {
  .auth-card {
    padding: 24px 20px;
  }
}

/* ---------------------------------------------------------------- page structure */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 28px;
}
.page-head-text {
  min-width: 0;
}
.page-head h1 {
  font-size: clamp(1.625rem, 2.6vw, 2rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.page-sub {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 1.0625rem;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 0.8125rem;
}
.crumbs a {
  color: var(--ink-3);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--accent);
}
.crumbs .icon {
  color: var(--ink-3);
}

.panel {
  min-width: 0;
  padding: 22px 24px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
.panel-flush {
  padding: 0;
}
.panel-flush > .panel-head {
  padding: 20px 24px 14px;
  margin: 0;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-head h2 {
  font-size: 1.0625rem;
  line-height: 1.3;
}
.panel-sub {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 0.875rem;
}
.panel > .table-wrap:last-child .table tr:last-child > * {
  border-bottom: 0;
}
@media (max-width: 560px) {
  .panel {
    padding: 18px 16px;
  }
  .panel-flush > .panel-head {
    padding: 16px 16px 12px;
  }
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.tabs a {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  margin-bottom: -1px;
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
}
.tabs a:hover {
  color: var(--ink);
}
.tabs a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}
.tab-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--line-2);
  color: var(--ink-3);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
  text-align: center;
}

/* ---------------------------------------------------------------- actions */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: 550 0.875rem/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(10, 26, 51, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-primary:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-secondary:hover {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  background: var(--accent-soft);
}
.btn-ghost {
  background: none;
  color: var(--ink-2);
}
.btn-ghost:hover {
  background: var(--line-2);
  color: var(--ink);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  filter: brightness(0.92);
}
.btn-sm {
  height: 30px;
  padding: 0 12px;
  gap: 6px;
  font-size: 0.8125rem;
}
.btn.is-done {
  box-shadow: inset 0 0 0 1px var(--met);
  color: var(--met);
}

/* ---------------------------------------------------------------- forms */

.field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}
.field-label,
.choices legend {
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 550;
}
.field-hint {
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.field-message {
  color: var(--danger);
  font-size: 0.8125rem;
  font-weight: 500;
}
input:not([type="checkbox"], [type="radio"], [type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  min-height: 84px;
  resize: vertical;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--accent-line);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-error input,
.field-error select,
.field-error textarea {
  border-color: var(--danger);
}
::placeholder {
  color: var(--ink-3);
  opacity: 0.8;
}
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}
.choices {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.choices legend {
  margin-bottom: 8px;
  padding: 0;
}
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
  gap: 18px 20px;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 18px;
}
.inline-form .grow {
  flex: 1 1 260px;
}

/* ---------------------------------------------------------------- messages and status */

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--met-soft);
  color: var(--ink);
}
.notice > .icon {
  margin-top: 2px;
  color: var(--met);
}
.notice-title {
  font-weight: 600;
}
.notice-info {
  background: var(--accent-soft);
}
.notice-info > .icon {
  color: var(--accent);
}
.notice-warn {
  background: var(--warn-soft);
}
.notice-warn > .icon {
  color: var(--warn);
}
.notice-error {
  background: var(--danger-soft);
}
.notice-error > .icon {
  color: var(--danger);
}
.stack-sm > .notice,
.auth-card .notice {
  margin-bottom: 0;
}
.token-reveal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.token-reveal code {
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--surface);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}
.status-met .icon {
  color: var(--met);
}
.status-partial .icon {
  color: var(--warn-mark);
}
.status-open .icon,
.status-unknown .icon,
.status-na .icon {
  color: var(--ink-3);
}
.status-na,
.status-unknown {
  color: var(--ink-3);
}
.status-overdue {
  color: var(--danger);
}
.status-overdue .icon {
  color: var(--danger);
}
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--line-2);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 550;
  line-height: 1.6;
  vertical-align: 0.1em;
  white-space: nowrap;
}
/* the one recurring device: every claim traces to its source */
.cite {
  color: var(--accent);
  font-size: 0.875em;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-decoration: none;
}
.cite::before {
  content: "§\2009";
  opacity: 0.6;
}
a.cite:hover {
  text-decoration: underline;
}
.clause {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid var(--accent-line);
  border-radius: 5px;
  color: var(--ink-2);
  font-size: 0.8125em;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  white-space: nowrap;
}
.clause-std {
  color: var(--ink-3);
}
.ai-draft {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- empty states, facts, tables */

.empty {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 8px 0;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.empty h2 {
  font-size: 1.0625rem;
}
.empty-text {
  color: var(--ink-2);
}
.empty-action {
  margin-top: 6px;
}
.sheet > .empty {
  max-width: 560px;
  margin: 12vh auto 0;
}

.facts {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 8px 24px;
  margin: 0;
}
.facts dt {
  color: var(--ink-3);
}
.facts dd {
  margin: 0;
  min-width: 0;
}

.table-wrap {
  position: relative; /* contains visually hidden labels, which would otherwise widen the page */
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.table th,
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  vertical-align: middle;
}
.table thead th {
  border-bottom-color: var(--line);
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-weight: 550;
  white-space: nowrap;
}
.table tbody th {
  font-weight: 500;
}
.table th:first-child,
.table td:first-child {
  padding-left: 0;
}
.table th:last-child,
.table td:last-child {
  padding-right: 0;
}
.panel-flush .table th:first-child,
.panel-flush .table td:first-child {
  padding-left: 24px;
}
.panel-flush .table th:last-child,
.panel-flush .table td:last-child {
  padding-right: 24px;
}
.table tbody tr:hover > * {
  background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
}
.table .num {
  text-align: right;
}
.table .actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}
.table .actions form {
  margin: 0;
}
.cell-main {
  display: block;
  font-weight: 550;
}
.cell-sub {
  display: block;
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-weight: 400;
}
.row-pending th,
.row-pending td {
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- activity */

.activity {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.activity li {
  position: relative;
  display: grid;
  gap: 1px;
  padding: 9px 0 9px 18px;
  border-bottom: 1px solid var(--line-2);
}
.activity li:last-child {
  border-bottom: 0;
}
.activity li::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-line);
}
.activity time {
  color: var(--ink-3);
  font-size: 0.8125rem;
}

/* ---------------------------------------------------------------- progress rings and charts */

.ring {
  position: relative;
  display: inline-grid;
  flex: none;
  width: var(--size);
  height: var(--size);
}
.ring circle {
  fill: none;
}
.ring-track {
  stroke: var(--line-2);
}
.ring-value {
  stroke: var(--accent);
  stroke-linecap: round;
}
.ring-met .ring-value {
  stroke: var(--met);
}
.ring-warn .ring-value {
  stroke: var(--warn-mark);
}

.chart {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
}
.chart-title {
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 550;
}
.chart-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  color: var(--ink-3);
  font-size: 0.8125rem;
  list-style: none;
}
.chart-key li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.chart-drawing svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart .apexcharts-text {
  fill: var(--apx-text);
  font-family: var(--font);
}
/* every <line> is grid or axis (series are paths); some carry a fixed colour and no class */
.chart .chart-drawing line {
  stroke: var(--apx-grid);
}
.chart .apexcharts-xcrosshairs,
.chart .apexcharts-ycrosshairs,
.chart .apexcharts-ycrosshairs-hidden {
  display: none;
}
.chart .apexcharts-bar-series .apexcharts-series[rel="1"] path,
.chart .apexcharts-rangebar-series .apexcharts-series[rel="1"] path {
  fill: var(--apx-1);
}
.chart .apexcharts-bar-series .apexcharts-series[rel="2"] path {
  fill: var(--apx-2);
}
.chart .apexcharts-bar-series .apexcharts-series[rel="3"] path {
  fill: var(--apx-3);
}
.chart .apexcharts-bar-series .apexcharts-series[rel="4"] path {
  fill: var(--apx-4);
}
.chart .apexcharts-bar-series .apexcharts-series[rel="5"] path {
  fill: var(--apx-5);
}
.chart .apexcharts-bar-series .apexcharts-series[rel="6"] path {
  fill: var(--apx-6);
}
.chart .apexcharts-area-series .apexcharts-series[rel="1"] path.apexcharts-area[fill^="url"] {
  fill: var(--apx-1);
  fill-opacity: 0.12;
}
.chart .apexcharts-area-series .apexcharts-series[rel="1"] path.apexcharts-area[fill="none"],
.chart .apexcharts-line-series .apexcharts-series[rel="1"] path {
  stroke: var(--apx-1);
  stroke-width: 2.5px;
}
.chart .apexcharts-area-series .apexcharts-series[rel="2"] path.apexcharts-area[fill^="url"] {
  fill: var(--apx-2);
  fill-opacity: 0.12;
}
.chart .apexcharts-area-series .apexcharts-series[rel="2"] path.apexcharts-area[fill="none"],
.chart .apexcharts-line-series .apexcharts-series[rel="2"] path {
  stroke: var(--apx-2);
  stroke-width: 2.5px;
}
.chart .apexcharts-line-series .apexcharts-series[rel="3"] path {
  stroke: var(--apx-3);
  stroke-width: 2.5px;
}
.chart .apexcharts-line-series .apexcharts-series[rel="4"] path {
  stroke: var(--apx-4);
  stroke-width: 2.5px;
}
.chart .apexcharts-line-series .apexcharts-series[rel="5"] path {
  stroke: var(--apx-5);
  stroke-width: 2.5px;
}
.chart .apexcharts-line-series .apexcharts-series[rel="6"] path {
  stroke: var(--apx-6);
  stroke-width: 2.5px;
  stroke-dasharray: 5 4;
}
.chart-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}
.chart-data summary {
  width: max-content;
  color: var(--ink-3);
  font-size: 0.8125rem;
  cursor: pointer;
}
.chart-data summary:hover {
  color: var(--accent);
}
.chart-data .table {
  margin-top: 8px;
  font-size: 0.875rem;
}

/* ---------------------------------------------------------------- the regime map */

.regime-map {
  margin: 0;
}
.regime-map-title {
  margin-bottom: 12px;
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 550;
}
.regime-map table {
  width: 100%;
  border-collapse: collapse;
}
.regime-map thead th {
  padding: 0 0 8px;
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-weight: 550;
  text-align: left;
  vertical-align: bottom;
}
.regime-map .rm-progress-head {
  padding-left: 20px;
  text-align: right;
  white-space: nowrap;
}
.rm-axis {
  position: relative;
  height: 30px;
}
.rm-year {
  position: absolute;
  bottom: 8px;
  left: var(--at);
  padding-left: 5px;
  border-left: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.rm-today {
  position: absolute;
  top: 0;
  left: var(--today);
  transform: translateX(-50%);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.5;
}
.rm-row > * {
  padding: 12px 0;
  border-top: 1px solid var(--line-2);
  vertical-align: middle;
}
.rm-name {
  width: 32%;
  padding-right: 20px;
  font-weight: 400;
  text-align: left;
}
.rm-regime {
  margin-right: 6px;
  color: var(--ink);
  font-weight: 600;
}
.rm-when {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.rm-track {
  position: relative;
  min-width: 160px;
}
/* today: one line down every row, since the cells meet */
.rm-track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--today);
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  opacity: 0.85;
}
.rm-bar {
  position: absolute;
  top: 50%;
  left: var(--start);
  right: calc(100% - var(--end));
  height: 12px;
  border-radius: 999px;
  transform: translateY(-50%);
  /* in force so far: solid; still to come: pale */
  background: linear-gradient(90deg, var(--accent) var(--now), var(--accent-line) var(--now));
}
.rm-via .rm-bar {
  background:
    repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--surface) 55%, transparent) 4px 7px),
    linear-gradient(90deg, var(--accent) var(--now), var(--accent-line) var(--now));
}
.rm-may .rm-bar {
  background: repeating-linear-gradient(135deg, var(--accent-line) 0 4px, transparent 4px 8px);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.rm-may .rm-regime {
  color: var(--ink-2);
}
.rm-progress {
  width: 112px;
  padding-left: 20px;
  text-align: right;
  white-space: nowrap;
}
.rm-progress .ring {
  vertical-align: middle;
}
.rm-count {
  display: inline-block;
  min-width: 42px;
  margin-left: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: left;
  vertical-align: middle;
}
.rm-progress > .muted {
  font-size: 0.8125rem;
}
@media (max-width: 680px) {
  .regime-map thead th:first-child,
  .regime-map .rm-progress-head {
    display: none;
  }
  .regime-map thead tr,
  .rm-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .rm-axis {
    grid-column: 1 / -1;
  }
  .rm-row {
    border-top: 1px solid var(--line-2);
    padding: 10px 0 12px;
  }
  .rm-row > * {
    padding: 0;
    border-top: 0;
  }
  .rm-name {
    width: auto;
  }
  .rm-track {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 22px;
    margin-top: 8px;
    min-width: 0;
  }
  .rm-progress {
    width: auto;
  }
}

/* ---------------------------------------------------------------- pages */

.overview,
.settings,
.admin,
.design {
  display: grid;
  gap: 20px;
}
.overview {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}
/* blocks stacked straight on the sheet */
.sheet > .panel + .panel,
.sheet > .panel + .overview,
.sheet > .overview + .panel,
.sheet > .overview + .overview {
  margin-top: 20px;
}
@media (max-width: 1080px) {
  .overview {
    grid-template-columns: minmax(0, 1fr);
  }
}
.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
  align-items: start;
}

.choices-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 8px 16px;
}
.choices-grid legend {
  grid-column: 1 / -1;
}

/* reviewing an AI draft: the form, and what it rests on */
.review {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 1080px) {
  .review {
    grid-template-columns: minmax(0, 1fr);
  }
}
.panel-head h2 .ai-draft {
  margin-left: 8px;
  vertical-align: 0.15em;
}
.evidence {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.evidence li {
  display: grid;
  gap: 2px;
  padding-left: 12px;
  border-left: 2px solid var(--accent-line);
}
.evidence-fact {
  font-size: 0.8125rem;
  font-weight: 600;
}
.evidence q,
.quoted {
  color: var(--ink-2);
}
.quoted {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 2px solid var(--accent-line);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--paper);
}

.product-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.product-list li {
  display: grid;
  gap: 1px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.product-list li:last-child {
  border-bottom: 0;
}
.product-list a {
  font-weight: 600;
  text-decoration: none;
}
.product-list a:hover {
  text-decoration: underline;
}

.ai-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}
.ai-usage {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ai-usage p {
  margin: 0;
}
.ai-switch {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ai-switch form {
  margin: 0;
}

.welcome {
  max-width: 720px;
}
.welcome-form {
  gap: 28px;
  padding: 28px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
@media (max-width: 560px) {
  .welcome-form {
    padding: 20px 16px;
  }
}

.danger-zone {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
}
.danger-zone summary {
  width: max-content;
  color: var(--danger);
  font-weight: 550;
  cursor: pointer;
}
.danger-zone[open] summary {
  margin-bottom: 12px;
}

.answers summary {
  list-style: none;
  cursor: pointer;
}
.answers summary::-webkit-details-marker {
  display: none;
}
.answers .facts {
  margin-top: 10px;
  font-size: 0.875rem;
  white-space: normal;
}

.swatches {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.swatches li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
}
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.swatches code {
  color: var(--ink-3);
}
.type-scale {
  display: grid;
  gap: 10px;
}
.type-scale p {
  margin: 0;
}
.t-display {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.t-h1 {
  font-size: 1.875rem;
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.t-h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.t-h3 {
  font-size: 1.0625rem;
  font-weight: 600;
}
.t-small {
  font-size: 0.8125rem;
}
.t-num {
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media print {
  body,
  .sheet {
    background: #fff;
  }
  .rail {
    display: none;
  }
  .frame {
    display: block;
  }
  .sheet {
    margin: 0;
    padding: 0;
  }
  .panel {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ---------------------------------------------------------------- the product: overview, settings, architecture */

.block {
  display: block;
}
.mono {
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.panel-pad {
  margin: 0;
  padding: 0 24px 20px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.table-group th {
  padding-top: 16px;
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.table tbody tr.table-group:hover > * {
  background: none;
}

.question-list,
.warning-list,
.dates,
.candidates,
.template-list,
.regime-readings,
.context-review {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.question-list {
  gap: 8px;
}
.question-list li {
  padding-left: 12px;
  border-left: 2px solid var(--warn-mark);
}
.warning-list {
  gap: 12px;
}
.warning-list li {
  display: grid;
  gap: 1px;
}
.dates {
  gap: 0;
}
.dates li {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-2);
}
.dates li:last-child {
  border-bottom: 0;
}
.dates time {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  font-weight: 550;
}
.dates .past {
  color: var(--ink-3);
}
.dates .past time {
  color: var(--ink-3);
  font-weight: 400;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 1080px) {
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* a question that would settle a regime that may apply */
.field-asked,
fieldset.field-asked {
  padding: 10px 12px;
  border-left: 3px solid var(--warn-mark);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--warn-soft);
}
.candidates {
  gap: 10px;
}
.candidates li {
  padding-left: 12px;
  border-left: 2px solid var(--accent-line);
}
.regime-readings {
  gap: 0;
}
.regime-readings > li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}
.regime-readings > li:first-child {
  padding-top: 0;
}
.regime-readings > li:last-child {
  border-bottom: 0;
}
.regime-reading-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.reading {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 0.875rem;
}
.override {
  margin-top: 8px;
}
.override summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.875rem;
}
.override form {
  margin-top: 8px;
}
.template-list {
  gap: 0;
}
.template-list li {
  border-bottom: 1px solid var(--line-2);
}
.template-list li:last-child {
  border-bottom: 0;
}
.template-list form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 12px 0;
}
.template-list p {
  margin: 2px 0 0;
}
.review-table input:not([type]) {
  width: 100%;
  min-width: 10em;
}
.review-table td:first-child {
  width: 1%;
}
.context-review {
  gap: 10px;
}

/* the architecture diagram: plain SVG, coloured by the tokens */
.diagram {
  margin: 0;
}
.diagram-scroll {
  overflow-x: auto;
  padding: 16px 20px;
}
/* scales down to fit, but no further than 80%, then scrolls */
.diagram-svg {
  display: block;
  width: 100%;
  max-width: max-content;
  height: auto;
  font-family: var(--font);
}
.dg-zone rect {
  fill: color-mix(in srgb, var(--accent-soft) 40%, transparent);
  stroke: var(--accent-line);
  stroke-dasharray: 6 4;
  stroke-width: 1.5;
}
.dg-depth-1 rect {
  fill: var(--surface);
}
.dg-zone-label {
  fill: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
}
.dg-node rect {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 1.25;
}
.dg-hardware rect {
  stroke: var(--ink-3);
}
.dg-firmware rect,
.dg-software rect {
  stroke: var(--accent);
}
.dg-cloud rect {
  fill: var(--accent-soft);
  stroke: var(--accent-line);
}
.dg-interface rect {
  fill: var(--paper);
  stroke: var(--ink-3);
}
.dg-data rect {
  stroke: var(--warn-mark);
}
.dg-name {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.dg-interface .dg-name {
  font-size: 12px;
  font-weight: 550;
}
.dg-kind {
  fill: var(--ink-3);
  font-size: 11px;
}
.dg-edge path {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.25;
}
.dg-data_flow path {
  stroke: var(--accent);
  stroke-width: 1.5;
}
.dg-runs_on path {
  stroke-dasharray: 2 3;
}
.dg-arrowhead {
  fill: var(--accent);
}
.dg-edge-label {
  fill: var(--ink-2);
  font-size: 11px;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
}
.dg-badge circle {
  fill: var(--danger);
}
.dg-badge text {
  fill: #fff;
  font-size: 11px;
  font-weight: 700;
}
.diagram-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0 20px 16px;
  color: var(--ink-3);
  font-size: 0.8125rem;
  list-style: none;
}
.diagram-key li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dg-key-line {
  width: 22px;
  height: 0;
  border-top: 1.5px solid var(--ink-3);
}
.dg-key-data_flow {
  border-top-color: var(--accent);
}
.dg-key-runs_on {
  border-top-style: dotted;
}
.dg-key-zone {
  width: 18px;
  height: 12px;
  border: 1.5px dashed var(--accent-line);
  border-radius: 3px;
}

.choices-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.choices-row legend,
.choices-row .field-hint {
  flex-basis: 100%;
}
.choices-grid .field-hint {
  grid-column: 1 / -1;
  margin: 0;
}

/* the requirements checklist */
.filter-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.filter-list a {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-control);
  color: var(--ink-2);
  text-decoration: none;
}
.filter-list a:hover {
  background: var(--paper);
}
.filter-list a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}
.matrix .matrix-col {
  text-align: center;
}
.matrix-cell {
  text-align: center;
  white-space: nowrap;
}
.matrix-none {
  color: var(--line);
  font-size: 1.25rem;
  line-height: 1;
}
.text-danger {
  color: var(--danger);
  font-weight: 550;
}
.control-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 4px;
  font-size: 1.375rem;
}
.plain-list {
  margin: 0;
  padding-left: 18px;
}
.clause-group + .clause-group {
  margin-top: 18px;
}
.clause-group h3 {
  margin-bottom: 8px;
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-weight: 600;
}
.clause-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.clause-list p {
  margin: 4px 0 0;
}
.legal-text summary {
  margin-top: 4px;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8125rem;
}
.legal-text .quoted {
  margin-top: 6px;
  font-size: 0.875rem;
}
.guidance-draft {
  padding: 12px 14px;
  border: 1px dashed var(--accent-line);
  border-radius: var(--radius-control);
}
.guidance-draft ol {
  margin: 8px 0;
  padding-left: 20px;
}
.nowrap {
  white-space: nowrap;
}

/* the threat model */
.risk {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.risk-low {
  background: var(--met-soft);
  color: var(--met);
}
.risk-medium {
  background: var(--warn-soft);
  color: var(--warn);
}
.risk-high {
  background: var(--danger-soft);
  color: var(--danger);
}
.matrices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 16px;
  margin-bottom: 12px;
}
.risk-matrix {
  margin: 0;
}
.risk-matrix figcaption {
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 600;
}
.risk-matrix table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  font-size: 0.75rem;
}
.risk-matrix th {
  color: var(--ink-3);
  font-weight: 500;
  text-align: center;
}
.risk-matrix tbody th {
  text-align: right;
  white-space: nowrap;
}
.risk-cell {
  height: 38px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}
.risk-cell.risk-empty {
  opacity: 0.45;
}
.proposal {
  color: var(--warn);
}

/* ---------------------------------------------------------------- vulnerabilities, cases, advisories */

.top-gap-sm {
  margin-top: 6px;
}
.form-section {
  margin: 8px 0 -4px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
}
.eu-states summary,
.tracker-connect summary,
.decide summary,
.cpe-edit summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 550;
}
.eu-states[open] summary,
.tracker-connect[open] summary {
  margin-bottom: 10px;
}
.tracker-connect {
  padding: 12px 0;
  border-top: 1px solid var(--line-2);
}
.tracker-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tracker-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
pre.code {
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre;
}

/* known vulnerabilities, linked to their cases */
.vuln-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.vuln-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.checked-by .mono {
  overflow-wrap: anywhere;
}
.cpe-edit {
  margin-top: 4px;
}
.cpe-edit form {
  margin-top: 6px;
}
.cpe-edit input {
  min-width: 0;
  flex: 1 1 200px;
}

/* the Article 14 clocks */
.clocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 12px;
  margin-top: 12px;
}
.clock {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}
.clock .btn {
  justify-self: start;
  margin-top: 8px;
}
.clock-label {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 600;
}
.clock-time {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.clock-sub {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.clock-done {
  border-color: var(--met-soft);
  background: var(--met-soft);
}
.clock-done .clock-time {
  color: var(--met);
}
.clock-urgent {
  border-color: var(--warn-mark);
  background: var(--warn-soft);
}
.clock-urgent .clock-time {
  color: var(--warn);
}
.clock-overdue {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.clock-overdue .clock-time {
  color: var(--danger);
}

/* a decision per version */
.decision {
  padding: 14px 0;
  border-top: 1px solid var(--line-2);
}
.decision:first-child {
  padding-top: 0;
  border-top: 0;
}
.decision-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.decision p {
  margin: 6px 0 0;
}
.decide {
  margin-top: 8px;
}
.decide[open] > summary {
  margin-bottom: 10px;
}
.decide .notice {
  margin-bottom: 12px;
}

/* the draft for ENISA's platform */
.draft-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 12px;
}
.draft-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, 2fr) 5.5rem;
  align-items: start;
  gap: 8px 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-2);
}
.draft-row:first-child {
  border-top: 0;
}
.draft-label {
  display: grid;
  gap: 2px;
}
.draft-name {
  font-weight: 550;
}
.draft-status {
  color: var(--ink-3);
  font-size: 0.75rem;
}
.draft-status.req {
  color: var(--ink-2);
}
.draft-row.missing .draft-status,
.draft-row.too-long .draft-status {
  color: var(--danger);
  font-weight: 600;
}
.draft-value {
  overflow-wrap: anywhere;
}
.draft-row > .btn {
  justify-self: end;
}
@media (max-width: 720px) {
  .draft-row {
    grid-template-columns: 1fr 5.5rem;
  }
  .draft-value {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* evidence hints on the checklist */
.hints {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.hint .icon {
  flex: none;
  margin-top: 2px;
}
.hint-ok .icon {
  color: var(--met);
}
.hint-gap .icon {
  color: var(--warn-mark);
}
.cell-sub.hint {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

/* a public advisory, on the band */
.public-doc {
  width: min(760px, 100%);
  padding: 36px 40px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.public-doc h1 {
  margin: 4px 0 8px;
  font-size: 1.625rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.public-doc h2 {
  margin: 24px 0 8px;
  font-size: 1.0625rem;
}
@media (max-width: 480px) {
  .public-doc {
    padding: 24px 20px;
  }
}
.prose > :first-child {
  margin-top: 0;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 10px;
}
.prose pre {
  overflow-x: auto;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--paper);
  font-size: 0.8125rem;
}
.compare-form {
  gap: 6px;
}
.compare-form select {
  width: auto;
  min-height: 32px;
  padding-block: 4px;
}

/* ---------------------------------------------------------------- the demo */

.demo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: -12px 0 24px;
  padding: 10px 14px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-panel);
  background: var(--accent-soft);
}
.demo-banner > .icon {
  flex: none;
  color: var(--accent);
}
.demo-banner p {
  flex: 1 1 320px;
  margin: 0;
  font-size: 0.9375rem;
}
.demo-banner-actions {
  display: flex;
  gap: 8px;
}

/* ---------------------------------------------------------------- evidence */

.control-picker summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 550;
}
.control-picker[open] summary {
  margin-bottom: 10px;
}
.evidence-check {
  display: grid;
  gap: 14px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.evidence-check li + li {
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}
.evidence-check-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.evidence-check .quoted {
  margin: 8px 0;
  font-size: 0.875rem;
}
.break {
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- documents */

.doc-actions {
  display: grid;
  gap: 10px;
  margin: 8px 0 20px;
}
.doc-actions .notice {
  margin: 0;
}
.doc-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 1600px) {
  .doc-editor {
    grid-template-columns: minmax(0, 1fr);
  }
}
.doc-preview {
  min-width: 0;
  padding: 20px;
  border-radius: var(--radius-panel);
  background: color-mix(in srgb, var(--paper) 70%, var(--line));
  overflow-x: auto;
}
.doc-preview .doc {
  max-width: 100%;
}

/* ---------------------------------------------------------------- the public security page (on the band) */

.public-page {
  display: grid;
  gap: 18px;
  width: min(860px, 100%);
  min-width: 0;
}
.public-page > * {
  min-width: 0;
  overflow-wrap: break-word;
}
.public-page-head,
.public-section {
  padding: 28px 32px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.public-page-head h1 {
  margin: 2px 0 6px;
  font-size: 1.875rem;
  letter-spacing: -0.025em;
}
.public-page-head p {
  margin: 0;
}
.public-section h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}
.public-section .doc {
  max-width: none;
  padding: 0;
  box-shadow: none;
}
.public-products,
.public-advisories {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.public-products ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.public-code {
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.8125rem;
  white-space: pre;
}
.public-warning {
  padding: 8px 12px;
  border-radius: var(--radius-control);
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 550;
}
/* The page leads with reporting: who they are, how to tell them, what happens then. */
.pp-hero {
  display: grid;
  gap: 22px;
  padding: 30px 32px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.pp-who h1 {
  margin: 0 0 4px;
  font-size: 2rem;
  letter-spacing: -0.025em;
}
.pp-report {
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
}
.pp-report h2 {
  margin: 0 0 12px;
  font-size: 1.375rem;
  letter-spacing: -0.015em;
}
.pp-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 0 0 6px;
}
.pp-address {
  margin: 0 0 18px;
}
.pp-expect {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.pp-expect div {
  padding: 12px 14px;
  border-radius: var(--radius-control);
  background: var(--accent-soft);
}
.pp-expect dt {
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.pp-expect dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 600;
}
.pp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.public-products li {
  display: grid;
  gap: 2px;
}
.pp-policy .doc h1 {
  font-size: 1.375rem;
}
@media (max-width: 720px) {
  .pp-expect,
  .pp-grid {
    grid-template-columns: 1fr;
  }
  .pp-hero {
    padding: 24px 18px;
  }
}
.public-foot {
  color: var(--navy-ink);
  font-size: 0.875rem;
  text-align: center;
}
.public-foot a {
  color: #fff;
}
@media (max-width: 560px) {
  .public-page-head,
  .public-section {
    padding: 22px 18px;
  }
}

/* ---------------------------------------------------------------- Ask Firmline */

.answer-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
}
.answer-sources {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding-left: 0;
  list-style: none;
  font-size: 0.875rem;
}
.answer-sources .quoted {
  margin: 4px 0 0;
  font-size: 0.8125rem;
}

/* the company layer */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 var(--space-4, 16px);
  padding: 0;
  list-style: none;
}
.filter-row a {
  display: inline-flex;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-control);
  color: var(--ink-2);
  text-decoration: none;
}
.filter-row a:hover {
  background: var(--paper);
}
.filter-row a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}
.ring-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ring-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.row-closed th,
.row-closed td {
  color: var(--ink-3);
}
.halves {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 20px;
  align-items: start;
}
.sheet > .panel + .halves,
.sheet > .halves + .panel,
.sheet > .overview + .halves,
.sheet > .halves + .overview {
  margin-top: 20px;
}
.panel-foot {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
}

/* every deadline */
.deadlines {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--line);
}
.deadline {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto) auto;
  gap: 6px 16px;
  align-items: start;
  padding: 12px 0 12px 18px;
  border-bottom: 1px solid var(--line);
}
.deadline::before {
  content: "";
  position: absolute;
  top: 18px;
  left: -7px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}
.deadline-next::before {
  border-color: var(--accent);
  background: var(--accent);
}
.deadline-overdue::before {
  border-color: var(--danger);
  background: var(--danger);
}
.deadline-done::before {
  border-color: var(--met);
  background: var(--met);
}
.deadline-done .deadline-main strong {
  color: var(--ink-3);
}
.deadline-next .deadline-when > span:first-child {
  font-weight: 700;
}
.deadline-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.deadline-when {
  display: grid;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}
.deadline-tag {
  justify-self: start;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 600;
}
.deadline-send summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.875rem;
}
.deadline-send form {
  margin-top: 8px;
}
@media (max-width: 720px) {
  .deadline {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* questionnaires */
.q-items {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.q-item {
  min-width: 0;
  padding: 16px 20px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
.q-approved {
  box-shadow: inset 3px 0 0 var(--met), var(--shadow-panel);
}
.q-drafted {
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow-panel);
}
.q-failed {
  box-shadow: inset 3px 0 0 var(--danger), var(--shadow-panel);
}
.q-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.q-question {
  margin: 6px 0 10px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.q-draft {
  margin-bottom: 8px;
}
.q-sources {
  margin: 4px 0 8px;
  padding-left: 18px;
  font-size: 0.875rem;
}
.q-form textarea {
  width: 100%;
}
.bottom-gap {
  margin-bottom: 16px;
}

/* the organisation switcher */
.rail-switch summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}
.rail-switch summary::-webkit-details-marker {
  display: none;
}
.rail-switch summary::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--navy-ink-2);
  border-bottom: 1.5px solid var(--navy-ink-2);
  transform: rotate(45deg) translateY(-2px);
}
.rail-switch[open] summary::after {
  transform: rotate(225deg) translateY(-1px);
}
.rail-switch ul {
  display: grid;
  gap: 2px;
  margin: 6px 0 8px;
  padding: 0;
  list-style: none;
}
.rail-switch button,
.rail-switch a,
.rail-link {
  display: block;
  width: 100%;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--navy-ink-2);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.rail-switch button:hover,
.rail-switch a:hover,
.rail-link:hover {
  color: #fff;
}
.rail-switch button:focus-visible,
.rail-switch a:focus-visible,
.rail-link:focus-visible,
.rail-switch summary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* sign in with Google: white, the "G" and the words, as Google's branding asks, in both themes */
.btn-google {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 1px solid #747775;
  background: #fff;
  color: #1f1f1f;
  font-weight: 500;
}
.btn-google:hover {
  background: #f2f2f2;
  color: #1f1f1f;
}
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Build systems in the CI instructions: what to run, and which file to send. */
.small-head {
  margin: 18px 0 6px;
  font-size: 0.875rem;
  font-weight: 600;
}
.build-systems p {
  margin: 10px 0 6px;
}
.build-systems pre.code {
  margin: 0 0 6px;
}

/* Deadlines running: overdue ones stand out. */
.dates.running li {
  grid-template-columns: 11.5em 1fr;
}
.dates.running li.overdue time {
  color: var(--danger);
  font-weight: 600;
}
.dates + .small-head {
  margin-top: 16px;
}
.plain-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.diagram-note {
  margin: 0;
  padding: 0 20px 14px;
}

/* ---------------------------------------------------------------- the overview */
.ov-section {
  margin-top: 28px;
}
.ov-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ov-head h2 {
  margin: 0;
  font-size: 1.125rem;
}

/* What needs you: the first thing on the page. Each row carries its urgency on the left edge. */
.needs {
  margin-top: 8px;
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.needs ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.needs li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 14px 16px;
  border-left: 4px solid var(--accent-line);
}
.needs li + li {
  border-top: 1px solid var(--line-2);
}
.needs li.needs-overdue {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}
.needs li.needs-warn {
  border-left-color: var(--warn-mark);
}
.needs-text {
  font-weight: 550;
}
.needs-clear {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-left: 4px solid var(--met);
  color: var(--ink-2);
}
.needs-clear .icon {
  flex: none;
  color: var(--met);
}
.needs-clear p {
  margin: 0;
}

/* A product's vitals: its rules on top, then five figures that each open their tab. */
.vitals-card {
  padding: 0;
  overflow: hidden;
}
.vitals-card + .vitals-card {
  margin-top: 14px;
}
.vitals-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 18px 20px 14px;
}
.vitals-head h3 {
  margin: 0;
  font-size: 1.1875rem;
}
.vitals-head h3 a {
  color: var(--ink);
  text-decoration: none;
}
.vitals-head h3 a:hover {
  color: var(--accent);
}
.vitals-head p {
  margin: 2px 0 0;
}
.vitals-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.vitals {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line-2);
}
.vital {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 14px 20px 16px;
  color: inherit;
  text-decoration: none;
  border-top: 3px solid transparent;
}
.vital + .vital {
  border-left: 1px solid var(--line-2);
}
.vital:hover {
  background: var(--accent-soft);
}
.vital:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.vital-label {
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.vital-value {
  color: var(--ink);
  font-size: 1.375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.vital-note {
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.vital-warn {
  border-top-color: var(--warn-mark);
}
.vital-warn .vital-note {
  color: var(--warn);
}
.vital-danger {
  border-top-color: var(--danger);
}
.vital-danger .vital-note {
  color: var(--danger);
}
.vital-ok .vital-note {
  color: var(--met);
}
@media (max-width: 900px) {
  .vitals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vital + .vital {
    border-left: 0;
  }
  .vital {
    border-bottom: 1px solid var(--line-2);
  }
  .vital:nth-child(even) {
    border-left: 1px solid var(--line-2);
  }
  .vitals-rules {
    justify-content: flex-start;
  }
}

/* The company's controls as one bar: met, in progress, not applicable; the rest is not started. */
.ov-bar {
  display: flex;
  height: 10px;
  margin: 4px 0 6px;
  border-radius: 5px;
  background: var(--line-2);
  overflow: hidden;
}
.ov-bar-met {
  background: var(--met);
}
.ov-bar-partial {
  background: var(--warn-mark);
}
.ov-bar-na {
  background: var(--ink-3);
  opacity: 0.4;
}
.ov-risks {
  margin: 4px 0 6px;
  padding: 0;
  list-style: none;
}
.ov-risks li {
  display: grid;
  grid-template-columns: 8px 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
}
.risk-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-1px);
}
.risk-high {
  background: var(--danger);
}
.risk-medium {
  background: var(--warn-mark);
}
.risk-low {
  background: var(--met);
}
.ov-activity .activity-list,
.ov-activity ul {
  margin-bottom: 0;
}

