/* Pacta site v4 — shadcn/ui design system, compiled to static CSS (no build step, no third-party requests).
   Tokens follow the shadcn/ui theme contract (background, foreground, card, popover, primary, secondary, muted, accent,
   destructive, border, input, ring, radius) plus Pacta's custom brand / success / warning / info tokens. Components are
   addressed by their shadcn data-slot anatomy ([data-slot="button"], [data-slot="card"], ...); legacy class names used by
   the generated record pages map onto the same components.
   Type scale (Tailwind): 12 · 14 · 16 · 18 · 20 · 24 · 30 · 36 · 48 px — nothing else, nothing below 12 px.
   Control heights: sm 32 px (h-8), default 36 px (h-9), lg 40 px (h-10). Containers: wide 1200 px, prose 880 px.
   Theme: Light / Dark / System on a .dark class on <html>; System follows prefers-color-scheme. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  --radius: 0.375rem;
  --background: #f7f7f5;
  --foreground: #14161a;
  --card: #ffffff;
  --card-foreground: #14161a;
  --popover: #ffffff;
  --popover-foreground: #14161a;
  --primary: #14161a;
  --primary-foreground: #f7f7f5;
  --secondary: #efefeb;
  --secondary-foreground: #14161a;
  --muted: #f0f0ed;
  --muted-foreground: #5b616c;
  --accent: #e9eefb;
  --accent-foreground: #1e3a8a;
  --destructive: #b42318;
  --destructive-foreground: #ffffff;
  --border: #e1e1dc;
  --input: #cdcdc6;
  --input-border: #868b94;   /* v4.5 R2-03: editable controls, >= 3:1 against card and page */
  --ring: #1d4ed8;
  --brand: #1d4ed8;
  --link: #1d4ed8;
  --success: #0b6b44;
  --success-bg: #e6f4ec;
  --success-border: #b9dfca;
  --warning: #8f5400;
  --warning-bg: #fcf2df;
  --warning-border: #ecd3a3;
  --info: #0e6466;
  --info-bg: #e6f2f2;
  --info-border: #9cc9c9;
  --neutral-bg: #efefeb;
  --neutral-border: #d8d8d1;
  --rosette-strong: #15803d;
  --rosette-moderate: #ca8a04;
  --rosette-weak: #dc2626;
  --rosette-none: #8b919b;
  --code-bg: #0f1114;
  --code-foreground: #e3e6ea;
  --code-muted: #9ca3ae;
  --code-border: #24272d;
  --header-bg: rgba(247, 247, 245, 0.92);
  --shadow-xs: 0 1px 2px rgba(20, 22, 26, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 22, 26, 0.12), 0 2px 6px rgba(20, 22, 26, 0.06);
  --container-wide: 75rem;
  --container-prose: 55rem;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

.dark {
  --background: #0a0b0d;
  --foreground: #e8eaed;
  --card: #101216;
  --card-foreground: #e8eaed;
  --popover: #13161b;
  --popover-foreground: #e8eaed;
  --primary: #e8eaed;
  --primary-foreground: #0a0b0d;
  --secondary: #181a1f;
  --secondary-foreground: #e8eaed;
  --muted: #15181d;
  --muted-foreground: #9aa0aa;
  --accent: #161c2b;
  --accent-foreground: #c9d6f5;
  --destructive: #f87171;
  --destructive-foreground: #0a0b0d;
  --border: #23262c;
  --input: #343840;
  --input-border: #646b76;
  --ring: #a3b8ec;
  --brand: #a3b8ec;
  --link: #a3b8ec;
  --success: #5cc394;
  --success-bg: #0e1f17;
  --success-border: #1c3f2e;
  --warning: #e3a540;
  --warning-bg: #221a0c;
  --warning-border: #4a3713;
  --info: #4fbdbd;
  --info-bg: #0d2223;
  --info-border: #1f4f50;
  --neutral-bg: #181a1f;
  --neutral-border: #2c3037;
  --rosette-strong: #4ade80;
  --rosette-moderate: #facc15;
  --rosette-weak: #f87171;
  --rosette-none: #7d838d;
  --code-bg: #07080a;
  --code-border: #1e2126;
  --header-bg: rgba(10, 11, 13, 0.9);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* No JavaScript: follow the operating system (theme.js sets the class otherwise) */
@media (prefers-color-scheme: dark) {
  :root:not(.js) {
    --background: #0a0b0d; --foreground: #e8eaed; --card: #101216; --card-foreground: #e8eaed; --popover: #13161b;
    --popover-foreground: #e8eaed; --primary: #e8eaed; --primary-foreground: #0a0b0d; --secondary: #181a1f;
    --secondary-foreground: #e8eaed; --muted: #15181d; --muted-foreground: #9aa0aa; --accent: #161c2b; --accent-foreground: #c9d6f5;
    --destructive: #f87171; --destructive-foreground: #0a0b0d; --border: #23262c; --input: #343840; --input-border: #646b76; --ring: #a3b8ec; --brand: #a3b8ec;
    --link: #a3b8ec; --success: #5cc394; --success-bg: #0e1f17; --success-border: #1c3f2e; --warning: #e3a540; --warning-bg: #221a0c;
    --warning-border: #4a3713; --info: #4fbdbd; --info-bg: #0d2223; --info-border: #1f4f50; --neutral-bg: #181a1f; --neutral-border: #2c3037;
    --rosette-strong: #4ade80; --rosette-moderate: #facc15; --rosette-weak: #f87171; --rosette-none: #7d838d; --code-bg: #07080a;
    --code-border: #1e2126; --header-bg: rgba(10, 11, 13, 0.9); color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; font-size: 16px; }
body {
  margin: 0; min-height: 100vh; background: var(--background); color: var(--foreground);
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.5; font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
html, body { overflow-x: clip; }
h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--foreground); font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 2.25rem; line-height: 1.15; }
h2 { font-size: 1.5rem; line-height: 1.25; }
h3 { font-size: 1.125rem; line-height: 1.4; }
h4, h5, h6 { font-size: 1rem; line-height: 1.5; }
p { margin: 0; }
a { color: var(--link); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
p a:not([data-slot="button"]):not(.btn):not(.copy), dd a:not([data-slot="button"]):not(.btn):not(.copy),
li a:not([data-slot="button"]):not(.btn):not(.copy), td a:not([data-slot="button"]):not(.btn):not(.copy) {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--accent-foreground); }
small { font-size: 0.75rem; }
b, strong { font-weight: 600; }
code, kbd, samp, pre, .mono { font-family: var(--font-mono); font-size: inherit; font-variant-numeric: tabular-nums; }
code, .mono, .hx, .addr { overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted-foreground); }
.s, .note, .hint { color: var(--muted-foreground); font-size: 0.875rem; }
img, svg, video, canvas { max-width: 100%; height: auto; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
svg.i.i-fill { fill: currentColor; stroke: none; }   /* v4.5: filled brand marks (X) */
svg.ia { width: 0.875em; height: 0.875em; margin-left: 0.25em; vertical-align: -0.125em; }   /* v4.4 R-V4: link arrows (inline Lucide) */
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.sr-only, .skip-l {
  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 { position: absolute; left: -9999px; top: 8px; z-index: 60; }
.skip:focus { left: 12px; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--radius);
  background: var(--card); color: var(--foreground); border: 1px solid var(--input); box-shadow: var(--shadow-md); }

/* ---------------------------------------------------------------- layout */
.wrap { width: 100%; max-width: var(--container-wide); margin: 0 auto; padding: 0 24px; }
.wrap-prose, .memo-wrap { width: 100%; max-width: var(--container-prose); margin: 0 auto; padding: 0 24px; }
.memo-wrap { padding-top: 40px; padding-bottom: 80px; }
.sec { padding: 72px 0 0; }
main > .sec:last-child, main > section:last-child { padding-bottom: 80px; }
.stack > * + * { margin-top: 16px; }

/* Section header (V1/R1): heading column never narrower than 16rem; one column below 768 px */
.sec-head {
  display: grid; grid-template-columns: minmax(16rem, max-content) minmax(0, 1fr); align-items: end; gap: 8px 40px;
  padding-bottom: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--border);
}
.sec-head > :only-child { grid-column: 1 / -1; }
.sec-head h1, .sec-head h2 { font-size: 1.875rem; line-height: 1.2; max-width: 40rem; }
.sec-head .aside, .sec-head p { justify-self: end; max-width: var(--container-prose); color: var(--muted-foreground); font-size: 1rem; text-align: right; }
.sec-head .n { display: none; }
.sec-intro { max-width: var(--container-prose); margin: 0 0 24px; color: var(--muted-foreground); font-size: 1rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 16px; font-size: 0.875rem; color: var(--muted-foreground); }
.crumbs a { display: inline-flex; align-items: center; min-height: 24px; color: var(--muted-foreground); }
.crumbs a:hover { color: var(--foreground); }
.eyebrow, .label, .tier, .kicker {
  display: inline-block; font-size: 0.75rem; line-height: 1.4; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-foreground);
}
.lede { color: var(--muted-foreground); font-size: 1.125rem; line-height: 1.6; }

/* ---------------------------------------------------------------- button (shadcn Button) */
[data-slot="button"], .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0;
  height: 36px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--input);
  background: var(--card); color: var(--foreground); box-shadow: var(--shadow-xs);
  font-size: 0.875rem; line-height: 1; font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
[data-slot="button"]:hover, .btn:hover { text-decoration: none; background: var(--accent); color: var(--accent-foreground); }
[data-slot="button"]:focus-visible, .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 45%, transparent); border-color: var(--ring); }
[data-slot="button"][data-variant="default"], .btn.primary {
  background: var(--primary); color: var(--primary-foreground); border-color: var(--primary);
}
[data-slot="button"][data-variant="default"]:hover, .btn.primary:hover { background: color-mix(in srgb, var(--primary) 88%, var(--background)); color: var(--primary-foreground); }
[data-slot="button"][data-variant="secondary"] { background: var(--secondary); color: var(--secondary-foreground); border-color: transparent; box-shadow: none; }
[data-slot="button"][data-variant="ghost"], .copy { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted-foreground); }
[data-slot="button"][data-variant="ghost"]:hover, .copy:hover { background: var(--accent); color: var(--accent-foreground); }
[data-slot="button"][data-variant="link"] { background: none; border-color: transparent; box-shadow: none; color: var(--link); padding: 0 4px; }
[data-slot="button"][data-variant="link"]:hover { text-decoration: underline; background: none; }
[data-slot="button"][data-size="sm"], .btn.sm, .copy { height: 32px; padding: 0 12px; font-size: 0.875rem; gap: 6px; }
[data-slot="button"][data-size="lg"], .btn.lg { height: 40px; padding: 0 24px; font-size: 1rem; }
[data-slot="button"][data-size="icon"] { width: 36px; padding: 0; }
[data-slot="button"][data-size="icon-sm"] { width: 32px; height: 32px; padding: 0; }
[data-slot="button"]:disabled, .btn:disabled, [data-slot="button"][aria-disabled="true"] { opacity: 0.6; pointer-events: none; }
[data-slot="button"] svg, .btn svg { width: 16px; height: 16px; flex: none; }
.btn .arr { display: none; }
.copy { margin-left: 4px; vertical-align: middle; font-weight: 500; }
.copy.done, [data-slot="button"].done { color: var(--success); }
.linkish { display: inline-flex; align-items: center; min-height: 32px; padding: 0 4px; border: 0; background: none; color: var(--link); font-size: inherit; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- form controls (Input, Select, Textarea, Label) */
input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="tel"], select, textarea, [data-slot="input"] {
  display: block; width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--input-border); border-radius: var(--radius);
  background: var(--card); color: var(--foreground); box-shadow: var(--shadow-xs); font-size: 0.875rem; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
select { padding-right: 32px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%), linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { height: auto; min-height: 96px; padding: 8px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted-foreground); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible, [data-slot="input"]:focus-visible {
  outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 35%, transparent);
}
[aria-invalid="true"] { border-color: var(--destructive) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 22%, transparent) !important; }
[data-slot="input"][data-size="lg"], .input-lg { height: 40px; font-size: 1rem; }
label, [data-slot="label"] { font-size: 0.875rem; font-weight: 500; line-height: 1.4; }
.field { margin-bottom: 16px; }
.field > label { display: block; margin-bottom: 8px; }
.field .hint, [data-slot="form-description"] { margin-top: 8px; font-size: 0.75rem; color: var(--muted-foreground); }
[data-slot="form-message"], .form-message { margin-top: 8px; font-size: 0.875rem; color: var(--destructive); font-weight: 500; }
input[type="radio"], input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; flex: none; cursor: pointer; border: 0;
  background: radial-gradient(circle at center, var(--card) 0 6px, var(--input-border) 6.5px 7.5px, transparent 8px);
}
input[type="checkbox"] { background: linear-gradient(var(--card), var(--card)) center / 14px 14px no-repeat, linear-gradient(var(--input-border), var(--input-border)) center / 16px 16px no-repeat; }
input[type="radio"]:checked { background: radial-gradient(circle at center, var(--primary) 0 3.5px, var(--card) 4px 6px, var(--primary) 6.5px 7.5px, transparent 8px); }
input[type="checkbox"]:checked { background: linear-gradient(var(--primary), var(--primary)) center / 16px 16px no-repeat; }
input[type="radio"]:focus-visible, input[type="checkbox"]:focus-visible { outline: 2px solid var(--ring); outline-offset: 0; border-radius: 50%; }
fieldset { margin: 0 0 24px; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: 0.875rem; font-weight: 600; color: var(--foreground); }
.legend-note { font-weight: 400; color: var(--muted-foreground); }

/* RadioGroup as cards */
.opts { display: grid; gap: 8px; }
.opts.scroll { max-height: 280px; overflow-y: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px; border: 1px solid var(--border); border-radius: var(--radius); }
.opts label, [data-slot="radio-card"] {
  display: flex; align-items: flex-start; gap: 12px; min-height: 40px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card); font-size: 0.875rem; font-weight: 400; cursor: pointer; min-width: 0;
}
.opts label:hover { background: var(--accent); }
.opts label:has(input:checked) { border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring); background: color-mix(in srgb, var(--accent) 60%, var(--card)); }
.opts label b { display: block; font-weight: 600; color: var(--foreground); }
.opts .sub, .opts .tag { display: block; margin-top: 4px; color: var(--muted-foreground); font-size: 0.875rem; }
.opts .tag { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------------------------------------------------------------- badge (shadcn Badge) */
[data-slot="badge"], .badge, .grade, .opstate {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border: 1px solid var(--neutral-border);
  border-radius: var(--radius); background: var(--neutral-bg); color: var(--foreground);
  font-size: 0.75rem; line-height: 1; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; vertical-align: middle;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; flex: none; }
.badge.plain::before, .grade::before, .opstate::before { display: none; }
[data-slot="badge"][data-variant="warning"], .badge.delta, .grade.g-delta, .badge-amber, .opstate.ready, .chip.warn {
  background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning);
}
[data-slot="badge"][data-variant="info"], .badge.protect, .grade.g-protective { background: var(--info-bg); border-color: var(--info-border); color: var(--info); }
/* M2: Aligned is neutral (it says the docs are accurate, not that the protocol is safe) */
[data-slot="badge"][data-variant="neutral"], .badge.aligned, .grade.g-aligned, .badge-green { background: var(--neutral-bg); border-color: var(--neutral-border); color: var(--foreground); }
[data-slot="badge"][data-variant="outline"], .badge.observed, .grade.g-observed { background: transparent; border-style: dashed; border-color: var(--input); color: var(--muted-foreground); }
.badge.final, .badge.ok, .badge-cyan { background: transparent; border-color: var(--input); color: var(--muted-foreground); }
.badge.final::before, .badge-cyan::before { display: none; }
[data-slot="badge"][data-variant="destructive"] { background: color-mix(in srgb, var(--destructive) 12%, transparent); border-color: color-mix(in srgb, var(--destructive) 40%, transparent); color: var(--destructive); }
.grade { font-family: var(--font-mono); letter-spacing: 0.04em; }
.grade-sub { display: inline-flex; align-items: center; height: 22px; margin-left: 6px; padding: 0 8px; border: 1px solid var(--input); border-radius: var(--radius); font-size: 0.75rem; font-weight: 600; color: var(--muted-foreground); }
.opstate.executed { background: var(--secondary); border-color: var(--neutral-border); color: var(--muted-foreground); }
.opstate.pending { background: transparent; border-color: var(--input); color: var(--foreground); }
.opstate.mixed, .opstate.unknown { border-style: dashed; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted-foreground); flex: none; }
.dot.live { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.dot.delta { background: var(--warning); }
.dot.protect { background: var(--info); }

/* N2 (v4.3): staging copies only (tools/build_site.py stage_site); the canonical build never carries this line */
.staging-banner { padding: 4px 16px; border-bottom: 1px solid var(--border); background: var(--muted); color: var(--muted-foreground); font-size: 0.75rem; line-height: 1.5; text-align: center; }

/* ---------------------------------------------------------------- card (shadcn Card) */
[data-slot="card"] {
  display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  background: var(--card); color: var(--card-foreground); box-shadow: var(--shadow-xs); min-width: 0;
}
[data-slot="card-header"] { display: grid; gap: 6px; }
[data-slot="card-title"] { font-size: 1.125rem; line-height: 1.35; font-weight: 600; }
[data-slot="card-description"] { color: var(--muted-foreground); font-size: 0.875rem; }
[data-slot="card-content"] { min-width: 0; }
[data-slot="card-footer"] { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; }
[data-slot="card-action"] { justify-self: end; }

/* ---------------------------------------------------------------- alert (shadcn Alert) */
[data-slot="alert"] {
  position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 4px 12px; align-items: start;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--card); color: var(--card-foreground);
  font-size: 0.875rem; line-height: 1.5;
}
[data-slot="alert"] > svg { width: 16px; height: 16px; margin-top: 2px; color: var(--muted-foreground); }
[data-slot="alert"] > :not(svg) { grid-column: 2; }
[data-slot="alert"]:not(:has(> svg)) { grid-template-columns: minmax(0, 1fr); }
[data-slot="alert"]:not(:has(> svg)) > * { grid-column: 1; }
[data-slot="alert-title"] { font-weight: 600; font-size: 0.875rem; color: var(--foreground); }
[data-slot="alert-description"] { color: var(--muted-foreground); }
[data-slot="alert"][data-variant="warning"] { background: var(--warning-bg); border-color: var(--warning-border); }
[data-slot="alert"][data-variant="warning"] > svg, [data-slot="alert"][data-variant="warning"] [data-slot="alert-title"] { color: var(--warning); }
[data-slot="alert"][data-variant="destructive"] { border-color: color-mix(in srgb, var(--destructive) 45%, transparent); }
[data-slot="alert"][data-variant="destructive"] > svg, [data-slot="alert"][data-variant="destructive"] [data-slot="alert-title"] { color: var(--destructive); }
[data-slot="alert"][data-variant="info"] { background: var(--info-bg); border-color: var(--info-border); }
[data-slot="alert"][data-variant="info"] > svg { color: var(--info); }

/* ---------------------------------------------------------------- tabs + toggle group */
[data-slot="tabs-list"], .seg {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 2px; border-radius: calc(var(--radius) + 2px);
  background: var(--muted); border: 1px solid var(--border);
}
[data-slot="tabs-trigger"], .seg button, [data-slot="toggle-group-item"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--muted-foreground);
  font-size: 0.875rem; font-weight: 500; white-space: nowrap; cursor: pointer;
}
[data-slot="tabs-trigger"]:hover, .seg button:hover, [data-slot="toggle-group-item"]:hover { color: var(--foreground); }
[data-slot="tabs-trigger"][aria-selected="true"], .seg button[aria-pressed="true"], [data-slot="toggle-group-item"][aria-pressed="true"] {
  background: var(--card); color: var(--foreground); border-color: var(--border); box-shadow: var(--shadow-xs);
}
.seg button .num, [data-slot="toggle-group-item"] .num { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.seg-l { display: inline-flex; align-items: center; padding: 0 8px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
[data-slot="tabs-content"] { margin-top: 12px; }
[data-slot="tabs-content"][hidden] { display: none; }

/* ---------------------------------------------------------------- accordion / collapsible (details) */
[data-slot="accordion"] { border-top: 1px solid var(--border); }
[data-slot="accordion-item"], details.acc { border-bottom: 1px solid var(--border); }
[data-slot="accordion-trigger"], details.acc > summary, details.pf-raw > summary, .aud-rest > summary, .bounty-issue > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 8px 0;
  list-style: none; cursor: pointer; font-size: 0.875rem; font-weight: 500; color: var(--foreground);
}
[data-slot="accordion-trigger"]::-webkit-details-marker, details > summary::-webkit-details-marker { display: none; }
[data-slot="accordion-trigger"]::after, details.acc > summary::after, details.pf-raw > summary::after, .aud-rest > summary::after {
  content: ""; width: 8px; height: 8px; margin-right: 4px; border-right: 1.5px solid var(--muted-foreground); border-bottom: 1.5px solid var(--muted-foreground);
  transform: rotate(45deg); transition: transform .2s; flex: none;
}
details[open] > [data-slot="accordion-trigger"]::after, details.acc[open] > summary::after, details.pf-raw[open] > summary::after, .aud-rest[open] > summary::after { transform: rotate(-135deg); }
[data-slot="accordion-content"] { padding: 0 0 16px; font-size: 0.875rem; }

/* ---------------------------------------------------------------- tooltip */
[data-slot="tooltip-content"], .tip {
  position: absolute; z-index: 40; width: max-content; inline-size: min(16rem, 80vw); padding: 6px 10px; border-radius: var(--radius);
  background: var(--primary); color: var(--primary-foreground); font-size: 0.75rem; line-height: 1.4; font-weight: 500;
  pointer-events: none; box-shadow: var(--shadow-md);
}
.tip { inline-size: max-content; white-space: pre-line; }

/* ---------------------------------------------------------------- dropdown menu (theme switcher) */
.dd { position: relative; }
[data-slot="dropdown-menu-content"] {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 10rem; padding: 4px; border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px); background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-md);
}
[data-slot="dropdown-menu-item"] {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: calc(var(--radius) - 2px);
  background: transparent; color: inherit; font-size: 0.875rem; text-align: left; cursor: pointer;
}
[data-slot="dropdown-menu-item"]:hover, [data-slot="dropdown-menu-item"]:focus-visible { background: var(--accent); color: var(--accent-foreground); outline: none; }
[data-slot="dropdown-menu-item"] .check { width: 16px; height: 16px; margin-left: auto; visibility: hidden; }
[data-slot="dropdown-menu-item"][aria-checked="true"] .check { visibility: visible; }
[data-slot="dropdown-menu-label"] { padding: 6px 8px; font-size: 0.75rem; font-weight: 600; color: var(--muted-foreground); }

/* ---------------------------------------------------------------- top bar: NavigationMenu + Sheet */
.topbar {
  position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--border); background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; color: var(--foreground); font-weight: 700; font-size: 1rem; letter-spacing: 0.06em; white-space: nowrap; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 24px; height: 24px; }
.brand small { font-size: 0.75rem; font-weight: 500; letter-spacing: 0; color: var(--muted-foreground); padding-left: 10px; border-left: 1px solid var(--input); }
[data-slot="navigation-menu"] { display: flex; align-items: center; gap: 2px; margin-left: 8px; margin-right: auto; min-width: 0; }
[data-slot="navigation-menu"] a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 10px; border-radius: var(--radius);
  color: var(--muted-foreground); font-size: 0.875rem; font-weight: 500; white-space: nowrap;
}
[data-slot="navigation-menu"] a:hover, [data-slot="navigation-menu"] a[aria-current="page"] { background: var(--accent); color: var(--accent-foreground); text-decoration: none; }
.tools { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
/* v4.7 W3: global search trigger (Command dialog) and W5: labelled theme button */
.search-btn { color: var(--muted-foreground); font-weight: 500; }
/* the header now carries search + a labelled theme button: the "by Fractal Neurons" tagline stays in the footer, titles and JSON-LD */
.topbar .brand small { display: none; }
.search-btn kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--muted); color: var(--muted-foreground); font-size: 0.75rem; font-weight: 500; }
.theme-btn { gap: 6px; padding: 0 10px; color: var(--muted-foreground); }
.theme-btn .tb-l { font-size: 0.875rem; font-weight: 500; }
.sheet-theme { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding: 12px 0 0; border-top: 1px solid var(--border); }
.sheet-theme [data-slot="button"] { padding: 0 10px; }
.sheet-theme > span { flex: 1 0 100%; font-size: 0.875rem; font-weight: 600; color: var(--muted-foreground); }
.sheet-theme [aria-pressed="true"] { background: var(--accent); color: var(--accent-foreground); border-color: var(--ring); }
.cmdk { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(9, 9, 11, 0.5); }
.cmdk[hidden] { display: none; }
.cmdk-panel { width: 100%; max-width: 600px; max-height: 76vh; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-md); }
.cmdk-head { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--border); }
.cmdk-head svg { flex: none; width: 16px; height: 16px; color: var(--muted-foreground); }
.cmdk-head input { flex: 1; min-width: 0; height: 44px; margin: 4px 0; border: 0; border-radius: var(--radius); background: transparent; box-shadow: none; padding: 0 10px; font-size: 1rem; }
.cmdk-head input:focus { outline: none; box-shadow: none; }
.cmdk-head input:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; box-shadow: none; }   /* v4.7.1 V47-02 */
.cmdk-list { margin: 0; padding: 6px; list-style: none; overflow-y: auto; }
.cmdk-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; min-height: 44px; padding: 8px 10px; border-radius: var(--radius); color: var(--foreground); text-decoration: none; }
.cmdk-list a[aria-selected="true"], .cmdk-list a:hover { background: var(--accent); color: var(--accent-foreground); text-decoration: none; }
.cmdk-list .cmdk-t { font-size: 0.875rem; font-weight: 600; overflow-wrap: anywhere; }
.cmdk-list .cmdk-s { grid-column: 1; font-size: 0.75rem; color: var(--muted-foreground); overflow-wrap: anywhere; }
.cmdk-list [data-slot="badge"] { grid-row: 1 / span 2; grid-column: 2; }
.cmdk-empty, .cmdk-foot { margin: 0; padding: 12px 14px; font-size: 0.75rem; color: var(--muted-foreground); }
.cmdk-foot { border-top: 1px solid var(--border); }
body.cmdk-open { overflow: hidden; }
.tools .gh, .tools .xl { color: var(--muted-foreground); }
.tools .gh svg { width: 18px; height: 18px; }
.tools .xl svg { width: 16px; height: 16px; }
.menu-btn { display: none; }
[data-slot="sheet"] { position: fixed; inset: 0; z-index: 70; }
[data-slot="sheet-overlay"] { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
[data-slot="sheet-content"] {
  position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 4px; width: min(20rem, 86vw);
  padding: 16px; background: var(--background); border-left: 1px solid var(--border); box-shadow: var(--shadow-md); overflow-y: auto;
}
[data-slot="sheet-header"] { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
[data-slot="sheet-title"] { font-size: 1rem; font-weight: 600; }
[data-slot="sheet-content"] nav { display: grid; gap: 2px; }
[data-slot="sheet-content"] nav a { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: var(--radius); color: var(--foreground); font-size: 1rem; font-weight: 500; }
[data-slot="sheet-content"] nav a:hover { background: var(--accent); text-decoration: none; }
[data-slot="sheet-content"] .sheet-cta { margin-top: 12px; }
[data-slot="sheet-content"] .sheet-cta [data-slot="button"] { width: 100%; }
body.sheet-open { overflow: hidden; }

/* ---------------------------------------------------------------- footer (M9: grouped columns) */
.ftr { margin-top: 0; padding: 48px 0 32px; border-top: 1px solid var(--border); background: var(--card); font-size: 0.875rem; color: var(--muted-foreground); }
.ftr-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 32px; }
.ftr-brand { display: flex; flex-direction: column; gap: 12px; }
.ftr-brand .brand { min-height: 32px; }
.ftr-logo { display: block; width: 24px; height: 24px; }
.ftr h2 { margin: 0 0 12px; font-size: 0.875rem; font-weight: 600; letter-spacing: 0; color: var(--foreground); }
.ftr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ftr ul a { display: inline-flex; align-items: center; min-height: 28px; color: var(--muted-foreground); text-decoration: none; }
.ftr ul a:hover { color: var(--foreground); text-decoration: underline; }
.ftr-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 0.75rem; }
.ftr-bottom a { display: inline-flex; align-items: center; min-height: 24px; color: var(--muted-foreground); }

/* ---------------------------------------------------------------- toast (Sonner) + live region */
.toaster { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; pointer-events: none; }
[data-slot="toast"] {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px);
  background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-md); font-size: 0.875rem; font-weight: 500;
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- skeleton */
[data-slot="skeleton"] { display: inline-block; min-width: 72px; height: 22px; border-radius: var(--radius); background: var(--muted); animation: pulse 1.6s ease-in-out infinite; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .45; } }
.js [data-live-pending] [data-opstate] { display: none; }
.js [data-live-pending] [data-skel]::before { content: ""; display: inline-block; min-width: 72px; height: 22px; border-radius: var(--radius); background: var(--muted); animation: pulse 1.6s ease-in-out infinite; vertical-align: middle; }   /* v4.6: the T1 skeleton without a per-row element (page budget) */
.live-status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--muted-foreground); }
.live-status .spinner { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- table (shadcn Table) */
.tbl-wrap { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; }
table.tbl, table.ix, table.sc, [data-slot="table"] { width: 100%; font-size: 0.875rem; font-variant-numeric: tabular-nums; caption-side: top; }
.tbl th, .ix th, .sc th, [data-slot="table"] th {
  height: 40px; padding: 0 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border);
  color: var(--muted-foreground); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
}
.tbl td, .ix td, .sc td, [data-slot="table"] td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tbody tr:hover > td, .ix tbody tr:hover > td { background: color-mix(in srgb, var(--muted) 70%, transparent); }
.tbl .r, .ix .r { text-align: right; }
.nowrap { white-space: nowrap; }
.sub { display: block; margin-top: 4px; font-size: 0.875rem; color: var(--muted-foreground); }
.addr { font-family: var(--font-mono); font-size: 0.875rem; color: var(--foreground); }
tr[hidden] { display: none; }

/* ---------------------------------------------------------------- code block / terminal */
.term { margin-top: 16px; border: 1px solid var(--code-border); border-radius: calc(var(--radius) + 2px); background: var(--code-bg); color: var(--code-foreground); overflow: hidden; min-width: 0; max-width: 100%; }
.term-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 4px 4px 4px 14px; border-bottom: 1px solid var(--code-border); font-family: var(--font-mono); font-size: 0.75rem; color: var(--code-muted); }
.term-h .copy { color: var(--code-foreground); }
.term-h .copy:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.term-h .copy.done { color: #7fd6a8; }
.term pre { margin: 0; padding: 14px 16px 16px; font-size: 0.875rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
pre { max-width: 100%; }
pre.llms { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.875rem; line-height: 1.6; }
.qs-snip { margin-top: 12px; min-width: 0; }
.qs-snip code { display: block; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); font-size: 0.875rem; line-height: 1.5; overflow-wrap: anywhere; }
.qs-snip .copy { margin: 8px 0 0; }
.qs-l { font-size: 0.75rem; font-weight: 600; color: var(--muted-foreground); letter-spacing: 0.04em; text-transform: uppercase; }
p code, li code, dd code, td code { padding: 1px 5px; border-radius: 4px; background: var(--muted); border: 1px solid var(--border); }
.term code, pre code { padding: 0; border: 0; background: none; }
pre code { white-space: inherit; }
code { overflow-wrap: break-word; }
[data-slot="card"] pre, [data-slot="tabs-content"] pre { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; max-width: 100%; }   /* v4.4 P1-2 */

/* ---------------------------------------------------------------- HOMEPAGE */
/* hero: 2 columns (checker left, live receipt proof card right) */
.hero { padding: 64px 0 24px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.hero h1 { margin: 16px 0 20px; font-size: 3rem; line-height: 1.08; letter-spacing: -0.03em; font-weight: 650; }
.hero h1 .l { white-space: nowrap; }
.hero .lede { margin-bottom: 24px; }
.hero-routes { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 16px; font-size: 0.875rem; color: var(--muted-foreground); }
.hero-routes a { display: inline-flex; align-items: center; min-height: 24px; }
.checker { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: 8px; align-items: start; scroll-margin-top: 72px; }
.checker select, .checker input { height: 40px; font-size: 1rem; }
.checker input { font-family: var(--font-mono); }
.checker [data-slot="button"] { height: 40px; }
.checker .form-message { grid-column: 1 / -1; margin-top: 0; }
.checker-cap { margin-top: 12px; font-size: 0.75rem; color: var(--muted-foreground); }
.try { position: relative; margin-top: 16px; }
.try-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.try-l { font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground); }
.receipt { height: 32px; gap: 8px; }
.receipt .badge { height: 20px; }
/* live receipt proof card (V6) */
.proof-card { position: relative; }
.proof-card .pc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.proof-card .pc-name { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.pc-rows { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--border); }
.pc-rows > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.pc-rows dt { color: var(--muted-foreground); font-size: 0.875rem; }
.pc-rows dd { margin: 0; font-size: 1rem; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.pc-rows dd.pc-chain { color: var(--warning); }
.pc-rows .mono { font-size: 0.875rem; }
.pc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.875rem; color: var(--muted-foreground); }
.pc-foot a { display: inline-flex; align-items: center; min-height: 24px; }
/* stats (M4: one source of truth) */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.stat { padding: 20px; }
.stat b { display: block; font-size: 1.875rem; line-height: 1.1; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 8px; font-size: 0.875rem; font-weight: 500; color: var(--foreground); }
.stat small { display: block; margin-top: 4px; color: var(--muted-foreground); }
/* v4.7 W4 + W1: build-pinned freshness pill and the timelock radar strip under the hero numbers */
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; }
.fresh { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; margin: 0; padding: 2px 10px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 3px); background: var(--card); font-size: 0.75rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.fresh .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex: none; }
.sec-head .fresh, h1 + .fresh { margin-top: 8px; }
.tl-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; font-size: 0.875rem; color: var(--muted-foreground); }
.tl-strip b { color: var(--foreground); font-weight: 600; }
.tl-strip a { display: inline-flex; align-items: center; min-height: 24px; }
.agents-card p.s > a { display: inline-flex; align-items: center; min-height: 24px; }
.hiw-cta, .hiw-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hiw-pills { margin: 12px 0; }
.hiw-agents { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.hiw-agents > div { display: grid; gap: 12px; align-content: start; min-width: 0; }
@media (min-width: 1024px) { .hiw-agents { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#how-it-works .legend { margin-top: 16px; }
#how-it-works [data-slot="tabs-content"] > .s { margin-bottom: 12px; }
/* v4.7 W4: the closed Wave 1 archive on /bounties/ */
details.archive-details { margin-top: 40px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--card); }
details.archive-details > summary { display: flex; align-items: center; min-height: 48px; padding: 8px 16px; cursor: pointer; font-weight: 600; list-style: none; }
details.archive-details > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
details.archive-details[open] > summary::after { transform: rotate(-135deg); }
details.archive-details > summary > span { padding-right: 12px; }
details.archive-details > .memo-sec { padding: 0 16px 8px; }
/* v4.7 W3: protocol / token matches under the hero checker */
.pf-matches { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pf-matches li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.pf-matches .pm-n { flex: 1 1 220px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.pf-matches .pm-n small { display: block; font-weight: 400; font-size: 0.75rem; color: var(--muted-foreground); }
.trust { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin-top: 20px; font-size: 0.875rem; color: var(--muted-foreground); }
.trust a { display: inline-flex; align-items: center; min-height: 24px; color: var(--muted-foreground); text-decoration: underline; text-decoration-color: var(--input); }
.trust a:hover { color: var(--foreground); }
/* how it works (M6) */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: step; list-style: none; margin: 0; padding: 0; }   /* N6: flush with the h2 */
.step { padding: 20px; }
.step .step-n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); font-size: 0.875rem; font-weight: 600; }
.step h3 { margin-top: 4px; }
.step p { color: var(--muted-foreground); font-size: 0.875rem; }

/* live check result (U5): verdict-first card + alert + accordion */
.pf-out { margin-top: 16px; }
.pf-out:empty { display: none; }
.pf-card { gap: 12px; }
.pf-verdict-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pf-verdict-title { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.pf-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pf-metrics > div { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); min-width: 0; }
.pf-metrics dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.pf-metrics dd { margin: 4px 0 0; font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.pf-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; border-top: 1px solid var(--border); }
.pf-dl > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; min-width: 0; }
.pf-dl dt { color: var(--muted-foreground); }
.pf-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pf-section { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.pf-assess { font-size: 0.875rem; color: var(--muted-foreground); }
.pf-assess b { color: var(--foreground); }
.pf-match { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.875rem; }
.pf-match p + p { margin-top: 4px; }
.pf-match-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pf-match-foot { color: var(--muted-foreground); }
.teams-card .badge-preview { margin-top: 16px; }   /* v4.5 G-P2-5 */
.delta-line { margin-top: 12px; font-size: 0.875rem; color: var(--muted-foreground); }   /* v4.5.1: "36 of 90 protocols differ…" */
.sec-head + .delta-line { margin: -8px 0 16px; }
.pf-match, .pf-card .s, .pf-scope { overflow-wrap: anywhere; }
.pf-scope { font-size: 0.875rem; color: var(--muted-foreground); }
.pf-json { max-height: 320px; overflow: auto; margin: 0; padding: 12px; border-radius: var(--radius); background: var(--code-bg); color: var(--code-foreground); font-size: 0.75rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.pf-msg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 0.875rem; color: var(--muted-foreground); }
.pf-msg[data-pf-state="timeout"], .pf-msg[data-pf-state="network"], .pf-msg[data-pf-state="ratelimit"], .pf-msg[data-pf-state="http"] { color: var(--warning); }
.live-verify { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; }
.live-verify-out { margin: 0; font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.5; color: var(--muted-foreground); overflow-wrap: anywhere; }
.live-verify-out .lv-line { display: block; }

/* scorecards (M2, M7, U4, R2, V5, A1, A5) */
.sc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 18rem; min-width: 0; }
.search > svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.search input { padding-left: 34px; padding-right: 40px; }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.sc-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 0.75rem; color: var(--muted-foreground); }
.legend b { font-weight: 600; color: var(--foreground); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend svg { width: 16px; height: 16px; }
.aligned-note { margin-bottom: 16px; }
table.sc { table-layout: fixed; }
table.sc th:nth-child(1) { width: 30%; } table.sc th:nth-child(2) { width: 15%; } table.sc th:nth-child(3) { width: 9%; } table.sc th:nth-child(5) { width: 48px; }
table.sc td { vertical-align: middle; overflow-wrap: anywhere; }
tr.sc-row { cursor: pointer; }
tr.sc-row > td { height: 56px; }
tr.sc-row:hover > td { background: var(--accent); }
tr.sc-row.open > td { background: color-mix(in srgb, var(--accent) 70%, transparent); border-bottom-color: transparent; }
/* short protocol names (3F, M0) keep a >= 24 x 24 px link box on /protocols/; long names still wrap */
#proto-table td:first-child a { display: inline-flex; align-items: center; min-inline-size: 24px; min-block-size: 24px; }
.sc-toggle { display: inline-flex; align-items: center; min-height: 32px; min-inline-size: 24px; padding: 0; border: 0; background: none; color: var(--foreground); font-size: 1rem; font-weight: 600; line-height: 20px; text-align: left; cursor: pointer; }
.sc-toggle:hover { text-decoration: underline; }
.sc-chain { display: block; margin-top: 2px; font-size: 0.75rem; color: var(--muted-foreground); }
.sc-find { color: var(--foreground); font-size: 0.875rem; }
.chev { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: var(--muted-foreground); transition: transform .2s; }
.chev svg { width: 16px; height: 16px; }
tr.sc-row.open .chev { transform: rotate(180deg); }
tr.sc-drawer > td { padding: 4px 16px 24px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.sc-dr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 24px; min-width: 0; }
.sc-dr > :not(.sc-ros) { grid-column: 2; }
.sc-ros { grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sc-meta { font-size: 0.875rem; color: var(--muted-foreground); }
.sc-empty { padding: 24px; text-align: center; border: 1px dashed var(--input); border-radius: var(--radius); }
.sc-empty p { margin-bottom: 12px; color: var(--muted-foreground); }
.sc-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; }
.sc-more a { display: inline-flex; align-items: center; min-height: 24px; }
/* rosette: ordered palette (strong green -> moderate yellow -> weak red) + slice length + letter cue */
.rosette { display: inline-block; flex: none; vertical-align: middle; overflow: visible; }
.rosette path { stroke: var(--card); stroke-width: 1; }
.rosette .r-g { fill: var(--rosette-strong); }
.rosette .r-b { fill: var(--rosette-moderate); }
.rosette .r-a { fill: var(--rosette-weak); }
.rosette .r-n, .rosette .r-u { fill: none; stroke: var(--rosette-none); stroke-dasharray: 2 1.5; }
.rosette .r-ring { fill: none; stroke: var(--border); stroke-width: 1; }
.rosette-i { cursor: help; border-radius: 50%; }
.rosette-i:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.fdot { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; font-size: 0.75rem; font-weight: 700; line-height: 1; color: #fff; vertical-align: middle; flex: none; }
.fdot.r-g { background: var(--rosette-strong); color: #fff; }   /* v4.5 R2-02: 5.02:1 in Light */
.fdot.r-b { background: var(--rosette-moderate); color: #422006; }
.fdot.r-a { background: var(--rosette-weak); color: #fff; }
.fdot.r-n, .fdot.r-u { background: transparent; border: 1.5px dashed var(--rosette-none); color: var(--muted-foreground); }
.dark .fdot.r-a { color: #450a0a; }
.dark .fdot.r-g { color: #052e16; }
@media (prefers-color-scheme: dark) { :root:not(.js) .fdot.r-g { color: #052e16; } :root:not(.js) .fdot.r-a { color: #450a0a; } }
.factors { margin: 0; display: grid; border-top: 1px solid var(--border); }
.factors > div { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.factors dt { display: flex; align-items: center; font-weight: 600; }
.factors dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.factors .ev { display: block; margin-top: 4px; color: var(--muted-foreground); font-size: 0.75rem; }
.ros-tip { position: absolute; }

/* audiences + quickstart tabs */
.aud { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }   /* N4: no stretched card */
.aud h3 { font-size: 1.25rem; }
.aud-h { color: var(--muted-foreground); font-size: 0.875rem; }
.aud-links, .links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.875rem; }
.aud-links a, .links a { display: inline-flex; align-items: center; min-height: 24px; }

/* radar (T1, R3, M4) */
.radar-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.radar-counts { font-size: 1rem; font-weight: 600; }
.livebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; font-size: 0.875rem; color: var(--muted-foreground); }
.livebar b { color: var(--foreground); }
.countdown { font-family: var(--font-mono); font-size: 0.875rem; color: var(--foreground); }
.radar td:first-child { width: 11rem; }
.radar .op { font-weight: 600; }
.radar .meta { display: block; margin-top: 8px; font-size: 0.75rem; color: var(--muted-foreground); }
.radar tr.is-executed td { color: var(--muted-foreground); }
.radar-live { margin: 0 0 16px; font-size: 0.875rem; color: var(--muted-foreground); }
.radar-live b { color: var(--foreground); font-weight: 600; }
/* v4.6: multi-chain radar. A subtle chain tag on Base rows; per-operation labels on /radar/ */
.chain-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border: 1px solid var(--input); border-radius: calc(var(--radius) + 4px); font-size: 0.75rem; font-weight: 600; line-height: 1; color: var(--muted-foreground); vertical-align: middle; }
.radar .oplabels { margin: 6px 0 0; padding: 0; list-style: none; font-size: 0.75rem; color: var(--muted-foreground); }
.radar .oplabels li { margin: 2px 0; overflow-wrap: anywhere; }
.memo ol.calls li { overflow-wrap: anywhere; }
.memo .card table + p, .memo .card p + table { margin-top: 12px; }
.memo .card table + table { margin-top: 20px; }
.prov { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; font-size: 0.875rem; color: var(--muted-foreground); }
.snap-fallback { color: var(--warning); font-weight: 600; }
.obs-age { color: var(--muted-foreground); }
.live-line:empty { display: none; }

/* pricing (M4/M5 parity: the same five tiers on / and /request/). N3: the three protocol-team tiers are a 3-column card grid; Free is a
   full-width row above them and the Enterprise API a full-width row below */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan { gap: 12px; padding: 20px; }
.plan .tier { color: var(--muted-foreground); }
.plan .price { font-size: 1.875rem; line-height: 1.1; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan .price small { display: block; margin-top: 6px; font-size: 0.75rem; font-weight: 500; letter-spacing: 0; color: var(--muted-foreground); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.875rem; color: var(--muted-foreground); }
.plan li { position: relative; padding-left: 20px; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 10px; height: 6px; border-left: 2px solid var(--foreground); border-bottom: 2px solid var(--foreground); transform: rotate(-45deg); opacity: 0.6; }
.plan [data-slot="button"] { width: 100%; margin-top: auto; }
.plan.feat { border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring); }
.plan-row { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr) auto; align-items: center; gap: 4px 32px; }
.plan-row > h3 { grid-column: 1; grid-row: 1; align-self: end; }
.plan-row > .price { grid-column: 1; grid-row: 2; align-self: start; }
.plan-row > ul { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.plan-row > [data-slot="button"] { grid-column: 3; grid-row: 1 / span 2; width: auto; margin-top: 0; }
.editorial-note { margin-bottom: 24px; }

/* ---------------------------------------------------------------- /request/ (U6) */
.req { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.req-form { padding: 24px; }
.req-side { display: grid; gap: 16px; }
.req-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.req-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.req-status { min-height: 20px; font-size: 0.875rem; color: var(--muted-foreground); }
.receipt-card dl { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--border); }
.receipt-card dl > div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.receipt-card dt { color: var(--muted-foreground); }
.receipt-card dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
/* combobox (Command + Popover) */
.combo { position: relative; }
.combo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.combo-chips:empty { display: none; }
.chip-x { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--secondary); font-size: 0.875rem; }
.chip-x button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: 4px; background: transparent; color: var(--muted-foreground); }
.chip-x button:hover { background: var(--accent); color: var(--foreground); }
[data-slot="command-list"] {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; max-height: 280px; overflow-y: auto; margin: 0; padding: 4px;
  list-style: none; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--popover); box-shadow: var(--shadow-md);
}
[data-slot="command-item"] { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px; border-radius: calc(var(--radius) - 2px); font-size: 0.875rem; cursor: pointer; }
[data-slot="command-item"][data-active="true"], [data-slot="command-item"]:hover { background: var(--accent); color: var(--accent-foreground); }
[data-slot="command-item"] .ck { width: 16px; height: 16px; flex: none; visibility: hidden; }
[data-slot="command-item"][aria-selected="true"] .ck { visibility: visible; }
[data-slot="command-item"][aria-selected="true"] { font-weight: 600; }
[data-slot="command-empty"] { padding: 12px 8px; font-size: 0.875rem; color: var(--muted-foreground); }
.pay .kv { grid-template-columns: 9rem minmax(0, 1fr); }
.pay .full { overflow-wrap: anywhere; }
.addrline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--muted-foreground); }
.addrline b { font-family: var(--font-mono); font-weight: 500; color: var(--foreground); }

/* ---------------------------------------------------------------- record pages (/protocols/<slug>/, briefs, MCP, legal) */
.memo { min-width: 0; }
.memo > header { padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.memo > header > div:first-child { display: flex; flex-wrap: wrap; gap: 8px; }
.memo > header h1 { margin: 12px 0 12px; font-size: 2.25rem; line-height: 1.15; letter-spacing: -0.025em; }
.memo > header p, .memo .lede { color: var(--muted-foreground); font-size: 1.125rem; }
.memo h2 { margin: 40px 0 12px; font-size: 1.5rem; line-height: 1.3; }
.memo h3 { margin: 24px 0 8px; font-size: 1.125rem; }
.memo p, .memo li { font-size: 1rem; line-height: 1.65; }
.memo p + p { margin-top: 12px; }
.memo ul, .memo ol { padding-left: 20px; margin: 12px 0 0; }
.memo li { margin: 6px 0; }
.memo, .memo p, .memo li, .memo dd, .memo dt, .memo h1, .memo h2, .memo-foot { overflow-wrap: anywhere; }
.memo .card { font-size: 1rem; line-height: 1.65; color: var(--foreground); }
.memo .card p + p, .memo .card p + ul { margin-top: 12px; }
.memo table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.875rem; }
.memo th { padding: 10px 12px 10px 0; text-align: left; border-bottom: 1px solid var(--border); color: var(--muted-foreground); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.memo td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.memo-sec { min-width: 0; max-width: 100%; }
.memo-meta { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); margin: 0 0 12px; border-top: 1px solid var(--border); }
.memo-meta dt, .memo-meta dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.memo-meta dt { color: var(--muted-foreground); }
.memo .meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.memo .kpi { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); min-width: 0; }
.memo .kpi .k { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.memo .kpi .v { margin-top: 6px; font-family: var(--font-mono); font-size: 0.875rem; font-weight: 600; overflow-wrap: anywhere; }
.memo .kpi .s, .memo .kpi .s-ok { margin-top: 4px; font-size: 0.75rem; }
.memo .kpi .s-ok { color: var(--success); }
.memo-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--muted-foreground); }
.memo-foot a { display: inline-flex; align-items: center; min-height: 24px; }
.kv { display: grid; grid-template-columns: 10rem minmax(0, 1fr); margin: 16px 0 0; border-top: 1px solid var(--border); }
.kv dt, .kv dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; min-width: 0; }
.kv dt { color: var(--muted-foreground); padding-right: 16px; }
.deflist { margin: 0; }
.deflist > div { padding: 14px 0; border-bottom: 1px solid var(--border); }
.deflist dt { font-weight: 600; }
.deflist dt a { display: inline-flex; align-items: center; min-height: 24px; }
.deflist dd { margin: 4px 0 0; color: var(--muted-foreground); }
.cmp { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border: 1px solid var(--input); border-radius: var(--radius); font-size: 0.75rem; white-space: nowrap; }
.chip i { font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.chip b { font-family: var(--font-mono); }
.vs { font-size: 0.75rem; color: var(--muted-foreground); }
.obs-text { margin-top: 16px; color: var(--foreground); font-size: 0.875rem; line-height: 1.6; overflow-wrap: anywhere; }
.hx { font-family: var(--font-mono); border-bottom: 1px dotted var(--input); cursor: help; }
/* what differs: amber is reserved for real warnings (deltas); protective-only records use the info palette */
.whatdiffers { margin: 24px 0 0; padding: 16px 20px; border: 1px solid var(--warning-border); border-left-width: 4px; border-radius: var(--radius); background: var(--warning-bg); }
.whatdiffers.protective { border-color: var(--info-border); background: var(--info-bg); }
.whatdiffers .wd-h { margin: 0; font-size: 1.125rem; }
.whatdiffers .wd-l { margin: 12px 0 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.whatdiffers ul { margin: 0; padding-left: 20px; font-size: 0.875rem; line-height: 1.6; }
.whatdiffers li { margin: 6px 0; overflow-wrap: anywhere; }
.whatdiffers .wd-changed .obs { color: var(--warning); font-weight: 600; }
.whatdiffers.protective .wd-changed .obs { color: var(--info); }
.whatdiffers .ev-full { margin-top: 4px; }
.whatdiffers .ev-full > summary { display: inline-flex; align-items: center; min-height: 32px; cursor: pointer; font-size: 0.875rem; font-weight: 500; color: var(--link); list-style: none; }
.whatdiffers .ev-full > summary::-webkit-details-marker { display: none; }
.scorecard .sc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 8px 0 16px; }
.recon { margin: 12px 0 0; padding-left: 20px; font-size: 0.875rem; }
.convert { margin-top: 40px; padding: 24px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--card); }
.convert h2 { margin: 8px 0 8px; font-size: 1.25rem; }
.convert p { color: var(--muted-foreground); }
.convert-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; }
.convert-cta a:not([data-slot="button"]):not(.btn) { display: inline-flex; align-items: center; min-height: 24px; }
.convert.quiet { background: transparent; }
.editorial { margin: 32px 0 0; }
.badge-card .badge-preview { margin: 8px 0 12px; }
.cp-badge { display: block; height: 20px; width: auto; }
.badge-widget label { display: grid; gap: 8px; max-width: 100%; }
.badge-widget select { width: auto; min-width: 16rem; }
.poststatus { margin: 0 0 24px; padding: 16px; border: 1px solid var(--border); border-left: 4px solid var(--warning); border-radius: var(--radius); background: var(--card); }
.poststatus.executed { border-left-color: var(--muted-foreground); }
.poststatus .ps-head { margin: 8px 0 4px; font-size: 1rem; }
.poststatus .s { margin: 0; }
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }   /* v4.5 R2-05 */
.case { padding: 20px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--card); min-width: 0; overflow-wrap: anywhere; }
.case h3 { margin: 0 0 8px; font-size: 1.125rem; }
.case-chain { font-size: 0.75rem; font-weight: 500; color: var(--muted-foreground); }
.case-grade { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.case p + p { margin-top: 8px; }
.fp-faq > div { padding: 14px 0; border-bottom: 1px solid var(--border); }
.fp-faq dt { font-weight: 600; }
.fp-faq dd { margin: 4px 0 0; color: var(--muted-foreground); }
.fp-ctas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fp-ctas > div { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--card); }
.fp-ctas h3 { font-size: 1.125rem; }
.fp-ctas p { color: var(--muted-foreground); font-size: 0.875rem; }
.fp-ctas [data-slot="button"], .fp-ctas .btn { margin-top: auto; align-self: flex-start; }
.ctas { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 24px; }
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.faq div { padding: 16px 0; border-bottom: 1px solid var(--border); }
.faq dt { font-weight: 600; }
.faq dd { margin: 6px 0 0; color: var(--muted-foreground); }
.legal h2 { margin-top: 32px; }
.legal p, .legal li { color: var(--foreground); }
.legend-table td:first-child { width: 12rem; }

/* protocols index (/protocols/) */
.ix-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 0 0 16px; }
.ix-tools input { max-width: none; flex: 1 1 18rem; }
.ix-count { margin-left: auto; font-size: 0.875rem; color: var(--muted-foreground); }
.ix-active { flex-basis: 100%; margin: 0; font-size: 0.875rem; color: var(--muted-foreground); }
.ix-active:empty { display: none; }
.ix-empty { padding: 16px 0; font-size: 0.875rem; color: var(--muted-foreground); }
table.ix td:first-child a { display: inline-flex; align-items: center; min-height: 24px; font-weight: 600; }

/* bounties / leaderboard / onboarding briefs */
.bounty-issue { padding: 4px 0; border-bottom: 1px solid var(--border); }
.bounty-issue .md { margin-top: 8px; font-size: 0.875rem; }
.bounty-issue .md h3 { font-size: 1rem; margin: 14px 0 6px; }
.bounty-issue .md h4 { font-size: 0.875rem; margin: 14px 0 6px; }
.bounty-issue pre.term-pre { margin: 8px 0; padding: 12px; border-radius: var(--radius); background: var(--code-bg); color: var(--code-foreground); font-size: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.w2-counter { margin: 8px 0 16px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.875rem; }
.lb-share { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lb-share .copy { margin-left: 0; }
.status { min-height: 20px; margin-top: 8px; font-size: 0.875rem; color: var(--success); }
.actions { display: grid; gap: 8px; margin-top: 16px; }
.firewall { margin: 0 0 16px; font-size: 0.875rem; color: var(--muted-foreground); }
.ix-more, .sc-more, .note { margin-top: 12px; }
.flow { font-size: 0.875rem; }
.big { font-size: 1.25rem; }

/* A2: stand-alone links (alone in a table cell, list item or definition) are at least 24 px tall */
td > a:only-child, dd > a:only-child, li > a:only-child, .pc-rows a, .radar td a, table.ix td > a, table.tbl td > a { display: inline-flex; align-items: center; min-height: 24px; }

/* ---------------------------------------------------------------- progressive enhancement */
.js [data-slot="tabs-content"][data-inactive] { display: none; }
/* v4.7.1 V47-01: stable tabs (the homepage audience tabs) keep one height: every panel shares one grid cell, the inactive one is
   invisible, inert and aria-hidden (app.js), so switching tabs never moves the content below. Without JavaScript they stack. */
.js [data-tabs-stable] { display: grid; grid-template-columns: minmax(0, 1fr); }
.js [data-tabs-stable] > [data-slot="tabs-list"] { grid-row: 1; justify-self: start; }
.js [data-tabs-stable] > [data-slot="tabs-content"] { grid-row: 2; grid-column: 1; min-width: 0; }
.js [data-tabs-stable] > [data-slot="tabs-content"][data-inactive] { display: block; visibility: hidden; pointer-events: none; }
html:not(.js) [data-slot="tabs-list"] { display: none; }
html:not(.js) [data-slot="tabs-content"] + [data-slot="tabs-content"] { margin-top: 16px; }
.theme-btn .i-moon { display: none; }
.dark .theme-btn .i-sun { display: none; }
.dark .theme-btn .i-moon { display: inline-block; }
html:not(.js) [data-theme-menu], html:not(.js) .menu-btn, html:not(.js) [data-live-status] { display: none; }
.receipt[aria-pressed="true"] { border-color: var(--ring); background: var(--accent); color: var(--accent-foreground); }
.sc-ev { display: grid; gap: 8px; margin-bottom: 12px; font-size: 0.875rem; }
.sc-full { overflow-wrap: anywhere; }
.req-main { min-width: 0; }
.req-side [data-slot="card"] { gap: 12px; }
.req-side .actions [data-slot="button"] { width: 100%; justify-content: flex-start; }
.pay-opt b { font-size: 0.875rem; }
.ftr-brand p { max-width: var(--container-prose); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1279px) {
  .tools .cta { display: none; }   /* v4.7: the header CTA lives in the menu sheet and the hero below 1280 px */
}
/* v4.7: below 1024 px the NavigationMenu, GitHub and X move into the hamburger Sheet (with the Theme row and the CTA) */
@media (max-width: 1023px) {
  html:not(.js) [data-slot="navigation-menu"] { display: flex !important; position: absolute; left: 0; right: 0; top: 64px; padding: 4px 16px; overflow-x: auto; background: var(--background); border-bottom: 1px solid var(--border); }
  [data-slot="navigation-menu"], .tools .gh, .tools .xl { display: none; }
  .menu-btn { display: inline-flex; }
  .search-btn kbd { display: none; }
}
@media (max-width: 1023px) {
  .tools .cta { display: none; }
  .brand small { display: none; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero h1 { font-size: 2.25rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ftr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ftr-brand { grid-column: 1 / -1; }
  .req { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan-row { display: flex; align-items: stretch; gap: 12px; }
  .plan-row > h3, .plan-row > .price { align-self: auto; }
  .plan-row > ul { grid-template-columns: minmax(0, 1fr); }
  .plan-row > [data-slot="button"] { width: 100%; }
  .pf-dl { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  html:not(.js) [data-slot="navigation-menu"] { display: flex !important; position: absolute; left: 0; right: 0; top: 56px; padding: 4px 16px; overflow-x: auto; background: var(--background); border-bottom: 1px solid var(--border); }
  .wrap, .wrap-prose, .memo-wrap { padding-left: 16px; padding-right: 16px; }
  .topbar .wrap { height: 56px; }
  [data-slot="navigation-menu"], .tools .gh, .tools .xl { display: none; }
  .menu-btn { display: inline-flex; }
  .search-btn { width: 36px; padding: 0; justify-content: center; }
  .search-btn .sb-l, .theme-btn .tb-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .search-btn kbd { display: none; }
  .theme-btn { width: 36px; padding: 0; justify-content: center; }
  .sec { padding-top: 48px; }
  .sec-head { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .sec-head .aside, .sec-head p { justify-self: start; text-align: left; }
  .sec-head h1, .sec-head h2 { font-size: 1.5rem; }
  .hero { padding-top: 32px; }
  .hero h1 { font-size: 1.875rem; letter-spacing: -0.03em; }
  .hero .lede { font-size: 1rem; }
  .checker { grid-template-columns: minmax(0, 1fr); }
  .checker input { font-size: 1rem; }
  .checker [data-slot="button"] { width: 100%; }
  /* v4.4 R-V3: example chips wrap onto a second line (no clipped chip; replaces the R6 swipe row) */
  .try-row { flex-wrap: wrap; gap: 6px 8px; }
  .steps, .aud, .cases, .fp-ctas, .faq { grid-template-columns: minmax(0, 1fr); }
  .stats { gap: 12px; }
  .stat { padding: 16px; }
  .stat b { font-size: 1.5rem; }
  .pc-rows > div { grid-template-columns: 7rem minmax(0, 1fr); }
  .pf-metrics { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pf-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 12px; }   /* v4.4: one compact row per metric */
  .pf-metrics dd { margin: 0; text-align: right; }
  .pf-dl > div { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .req-grid { grid-template-columns: minmax(0, 1fr); }
  .opts.scroll { grid-template-columns: minmax(0, 1fr); }
  .memo > header h1 { font-size: 1.875rem; }
  .memo h2 { font-size: 1.25rem; }
  .memo .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv, .memo-meta { grid-template-columns: minmax(0, 1fr); }
  .kv dt, .memo-meta dt { padding-bottom: 0; border-bottom: 0; }
  .factors > div { grid-template-columns: minmax(0, 1fr); }
  .ftr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .ix-count { margin-left: 0; }
  table.ix, .memo table { display: block; max-width: 100%; overflow-x: auto; }
  table.ix th, table.ix td, .memo table td { overflow-wrap: normal; word-break: normal; }
  /* v4.6: the hand-written radar briefs' 3-column verification tables stack (check, evidence, status) instead of scrolling sideways */
  .memo table.stack, .memo table.stack tbody, .memo table.stack tr, .memo table.stack td { display: block; width: 100%; overflow-x: visible; }
  .memo table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .memo table.stack tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .memo table.stack td { padding: 2px 0; border: 0; }
  .memo table.stack td, .memo table.stack td code { overflow-wrap: anywhere; word-break: break-word; }
}
/* /protocols/ below 640 px: Protocol, Chain and Docs vs chain stay in view (no blind sideways scroll) */
@media (max-width: 639px) {
  #proto-table th:nth-child(2), #proto-table td:nth-child(2), #proto-table th:nth-child(4), #proto-table td:nth-child(4),
  #proto-table th:nth-child(6), #proto-table td:nth-child(6) { display: none; }
  #proto-table { display: table; table-layout: fixed; width: 100%; overflow: visible; }
  #proto-table th:nth-child(1) { width: 46%; } #proto-table th:nth-child(3) { width: 24%; } #proto-table th:nth-child(5) { width: 30%; }
  #proto-table td { overflow-wrap: anywhere; padding: 10px 6px; }
  #proto-table th { white-space: normal; padding: 10px 6px; letter-spacing: 0.02em; overflow-wrap: break-word; }   /* v4.5 R2-01 */
}
/* R2 + R3: below 640 px the scorecard and radar tables become stacked cards */
@media (max-width: 639px) {
  .plans { grid-template-columns: minmax(0, 1fr); }
  table.sc, table.sc tbody, table.sc tr, table.sc td, table.radar, table.radar tbody, table.radar tr, table.radar td { display: block; width: 100%; }
  table.sc thead, table.radar thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  #scorecards tbody:not([data-all]) tr.sc-row.sc-m { display: none; }   /* v4.5 G-P2-4: 6 cards first; any interaction shows all */
  table.radar td, table.radar .op, table.radar .sub, table.radar .meta { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }   /* v4.4 R-V2 */
  table.sc tr.sc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; margin-top: 12px; padding: 16px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--card); }
  table.sc tr.sc-row > td { height: auto; padding: 0; border: 0; background: none !important; }
  table.sc tr.sc-row > td:nth-child(1) { grid-column: 1 / -1; }
  table.sc tr.sc-row > td:nth-child(2) { grid-column: 1; grid-row: 2; justify-self: start; }
  table.sc tr.sc-row > td:nth-child(3) { display: none; }
  table.sc tr.sc-row > td:nth-child(4) { grid-column: 1 / -1; }
  table.sc tr.sc-row > td:nth-child(5) { grid-column: 2; grid-row: 2; justify-self: end; display: none; }
  table.sc tr.sc-row.open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; }
  table.sc tr.sc-drawer > td { padding: 0 16px 16px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 calc(var(--radius) + 4px) calc(var(--radius) + 4px); background: var(--card); }
  .sc-dr { grid-template-columns: minmax(0, 1fr); }
  .sc-dr > :not(.sc-ros) { grid-column: 1; }
  .sc-ros { grid-row: auto; flex-direction: row; align-items: center; }
  table.radar tr { margin-top: 12px; padding: 16px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--card); }
  table.radar td { padding: 0; border: 0; }
  table.radar td + td { margin-top: 10px; }
  table.radar td:first-child { width: 100%; }
  table.radar td.r { text-align: left; }
  table.radar td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
  .radar .hide-m { display: none !important; }
  .countdown { white-space: normal; }
}
@media (max-width: 479px) {
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ftr-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .topbar, .copy, .ftr, .toaster, [data-slot="sheet"] { display: none !important; }
  body { background: #fff; color: #000; }
}
