/* ============================================================
   SurgX — evolved design language (Fable5 v2)
   Rooted in surgx-pdp-tokens.css; unified, the purple retired.
   Type: Schibsted Grotesk (display) · Hanken Grotesk (UI) · IBM Plex Mono (data)
   ============================================================ */
.sxv3 {
  --bg: #EEF1F4;
  --surface: #FFFFFF;
  --surface-2: #F7F9FB;
  --surface-3: #EFF3F6;
  --ink-900: #0C1722;
  --ink-700: #2B3A47;
  --ink-600: #43525F;
  --ink-500: #647483;
  --ink-400: #8B99A6;
  --ink-300: #AEBAC5;
  --line: #E2E8ED;
  --line-2: #D3DCE3;
  --line-strong: #C2CCD5;
  --accent-700: #093A5A;
  --accent-600: #0B4A72;
  --accent-500: #0E5A8A;
  --accent-300: #6FA6C6;
  --accent-100: #D5E6F0;
  --accent-50: #EAF2F7;
  --on-accent: #FFFFFF;
  --verified: #1E8E6A;
  --verified-bg: #E4F3EC;
  --gap-ink: #8A5A18;
  --gap-bg: #FBF3E4;
  --gap-line: #EAD9B8;
  --danger: #B91C1C;
  --danger-bg: #FEE2E2;
  --role-surg: #9E2B3B;
  --role-cst: #0E5A8A;
  --role-fa: #0E7C7B;
  --role-rn: #5E54C4;
  --role-anes: #A8456E;
  --role-rep: #B0741A;
  --role-spd: #2C8A5B;
  --font-display: "Schibsted Grotesk", system-ui, sans-serif;
  --font-ui: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(12,23,34,.06), 0 1px 3px rgba(12,23,34,.05);
  --shadow-md: 0 6px 20px -8px rgba(12,23,34,.18), 0 2px 6px -2px rgba(12,23,34,.08);
}
.sx { font-family: var(--font-ui); color: var(--ink-900); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11'; line-height: 1.45; font-size: 14px; }
.sx *, .sx *::before, .sx *::after { box-sizing: border-box; }
.sx h1, .sx h2, .sx h3, .sx h4 { font-family: var(--font-display); margin: 0; line-height: 1.15; letter-spacing: -0.015em; }
.sx p { margin: 0; }
.sx button { font-family: inherit; cursor: pointer; }
.sx .mono { font-family: var(--font-mono); font-feature-settings: 'zero'; }

/* ---- cards & shells ---- */
.sx-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.sx-hairline { border-top: 1px solid var(--line); }

/* ---- chips / badges ---- */
.sx-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--ink-600); white-space: nowrap; }
.sx-chip.is-on { background: var(--accent-600); border-color: var(--accent-600); color: var(--on-accent); }
.sx-kicker { font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-400); }
.sx-tier { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px; }
.sx-tier.curated { background: var(--verified-bg); color: var(--verified); }
.sx-tier.generic { background: var(--surface-3); color: var(--ink-500); border: 1px solid var(--line-2); }

/* ---- provenance: citations are typographic objects ---- */
.sx-prov { display: inline-flex; align-items: baseline; gap: 6px; font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-600); }
.sx-prov .pathway { color: var(--accent-600); font-weight: 600; }
.sx-prov-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px;
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface-2);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-700); white-space: nowrap; }
.sx-verified { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--verified); }
.sx-verified::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--verified); }

/* ---- honest empty state (the signature) ---- */
.sx-empty { border: 1px dashed var(--line-strong); border-radius: var(--r-md);
  padding: 12px 14px; background: repeating-linear-gradient(-45deg, transparent 0 7px, rgba(12,23,34,.018) 7px 14px); }
.sx-empty .t { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-400); }
.sx-empty .d { font-size: 12.5px; color: var(--ink-500); margin-top: 3px; text-wrap: pretty; }

/* ---- coverage gap record (content, not failure) ---- */
.sx-gap { border: 1px solid var(--gap-line); background: var(--gap-bg); border-radius: var(--r-md); padding: 11px 13px; }
.sx-gap .k { font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gap-ink); }
.sx-gap .d { font-size: 12.5px; color: var(--ink-700); margin-top: 4px; text-wrap: pretty; }

/* ---- buttons ---- */
.sx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px; font-size: 13px; font-weight: 700; padding: 9px 16px;
  border: 1px solid transparent; transition: 140ms ease; font-family: var(--font-ui); }
.sx-btn.primary { background: var(--accent-600); color: var(--on-accent); }
.sx-btn.primary:hover { background: var(--accent-700); }
.sx-btn.quiet { background: var(--surface); border-color: var(--line-2); color: var(--ink-700); }
.sx-btn.quiet:hover { border-color: var(--line-strong); }
.sx-btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }

/* ---- avatar / initials placeholder (no-photo identity) ---- */
.sx-glyph { display: grid; place-items: center; background:
  linear-gradient(135deg, var(--accent-50), var(--accent-100));
  color: var(--accent-600); font-family: var(--font-display); font-weight: 700;
  border: 1px solid var(--accent-100); }

/* ---- role system ---- */
.sx-role-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---- section heads inside screens ---- */
.sx-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sx-sec .h { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.sx-sec .n { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); }

/* ---- list rows ---- */
.sx-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); background: var(--surface); }
.sx-row:last-child { border-bottom: 0; }

/* ---- spec table ---- */
.sx-spec { display: grid; grid-template-columns: 116px 1fr; gap: 0; font-size: 12.5px; }
.sx-spec > div { padding: 7px 0; border-bottom: 1px solid var(--line); }
.sx-spec > .k { color: var(--ink-500); font-weight: 600; font-size: 11.5px; }
.sx-spec > .v { color: var(--ink-800, var(--ink-700)); }
.sx-spec > div:nth-last-child(-n+2) { border-bottom: 0; }

/* ---- annotation labels on the canvas (designer notes) ---- */
.sx-note { font-family: var(--font-mono); font-size: 11px; color: #7A6A50;
  background: #FFF8E8; border: 1px solid #EFE2C2; border-radius: 8px; padding: 8px 10px; line-height: 1.5; }


/* ============ v3 page shell + additions (Ada build 2026-06-09) ============ */
.sxv3 { font-family: var(--font-ui); background: var(--bg); min-height: 100vh; }
.sxv3 .sx { background: transparent; }
.sxv3-page { max-width: 1180px; margin: 0 auto; padding: 14px 14px 40px; }
@media (min-width: 980px) {
  .sxv3-cols { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
  .sxv3-page { padding: 18px 26px 48px; }
}
.sxv3-cols > div { display: grid; gap: 18px; min-width: 0; }
.sxv3-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 14px; flex-wrap: wrap; }
.sxv3-chiprow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* clearance chip — 3-state vocabulary (v1 transplant) */
.sx-clearance { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; white-space: nowrap; }
.sx-clearance.cited { background: var(--accent-50); border: 1px solid var(--accent-100); color: var(--accent-600); }
.sx-clearance.exempt { background: var(--gap-bg); border: 1px solid var(--gap-line); color: var(--gap-ink); }
.sx-clearance.none { background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--ink-400); font-weight: 500; }

/* advisories banner */
.sx-advisory { border-radius: var(--r-md); padding: 10px 13px; border: 1px solid; display: grid; gap: 2px; }
.sx-advisory.critical { background: var(--danger-bg); border-color: #F3B9B9; }
.sx-advisory.warning  { background: var(--gap-bg); border-color: var(--gap-line); }
.sx-advisory.watch, .sx-advisory.informational { background: var(--surface-2); border-color: var(--line-2); }
.sx-advisory .h { font-size: 12.5px; font-weight: 700; }
.sx-advisory .d { font-size: 11.5px; color: var(--ink-600); }
.sx-advisory .s { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-400); margin-top: 2px; }

/* lineage walker (v1 Atlas transplant) */
.sx-walker { display: grid; gap: 0; justify-items: center; padding: 6px 0; }
.sx-wnode { border-radius: 12px; padding: 9px 13px; min-width: 150px; max-width: 250px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line-2); font: inherit; }
.sx-wnode .wk { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--ink-700); }
.sx-wnode .wn { font-size: 11px; color: var(--ink-600); margin-top: 2px; text-wrap: pretty; }
.sx-wnode .wd { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-400); margin-top: 2px; }
.sx-wnode.center { border-color: var(--accent-600); background: var(--accent-50); box-shadow: var(--shadow-sm); }
.sx-wnode.center .wk { color: var(--accent-600); }
.sx-wnode.dashed { border-style: dashed; background: var(--surface-2); }
.sx-wnode.dashed .wk { color: var(--ink-400); }
.sx-wnode.walk { cursor: pointer; }
.sx-wnode.walk:hover { border-color: var(--accent-300); }
.sx-wrow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sx-wedge { display: grid; justify-items: center; gap: 1px; padding: 2px 0; }
.sx-wedge .l { width: 2px; height: 12px; background: var(--line-strong); }
.sx-wedge .t { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; color: var(--ink-400); text-transform: uppercase; }

/* audio rows */
.sx-audio { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface);
  border-bottom: 1px solid var(--line); }
.sx-audio:last-child { border-bottom: 0; }
.sx-audio .rl { font-size: 12px; font-weight: 700; width: 150px; flex: none; display: inline-flex; gap: 7px; align-items: center; }
.sx-audio audio { height: 30px; width: 100%; min-width: 0; }

/* compat verdict tint */
.sx-compat-no { color: var(--danger); font-weight: 700; }
.sx-compat-yes { color: var(--verified); font-weight: 700; }

/* mobile: clamp grid blowout from nowrap chips/mono strings; chip row scrolls */
.sxv3-page { overflow-x: clip; }
.sxv3 section, .sxv3 .sx-card, .sxv3-cols > div > * { min-width: 0; }
@media (max-width: 979px) {
  .sxv3-chiprow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .sxv3-chiprow::-webkit-scrollbar { display: none; }
}

/* A2 topology */
.sx-topo-cluster { border-radius: var(--r-md); overflow: hidden; }
.sx-topo-chip {
  display: inline-flex; flex-direction: column; gap: 2px;
  padding: 6px 10px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line-2); background: var(--surface-2);
  font-family: var(--font-ui); font-size: 12px; text-align: left;
  cursor: default; transition: opacity 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
button.sx-topo-chip { cursor: pointer; }
button.sx-topo-chip:hover { border-color: var(--accent-300); }
.sx-topo-chip.sx-topo-selected {
  border-color: var(--accent-600); background: var(--accent-50);
  box-shadow: var(--shadow-sm); color: var(--accent-700);
}
.sx-topo-chip.sx-topo-compat {
  border-color: var(--verified); background: var(--verified-bg);
  box-shadow: 0 0 0 1px var(--verified);
}
.sx-topo-chip.sx-topo-incompat {
  border-color: var(--danger); background: var(--danger-bg);
  box-shadow: 0 0 0 1px var(--danger);
}
.sx-topo-chip.sx-topo-dim { opacity: 0.45; }
.sx-topo-tag {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; margin-top: 1px;
}
.sx-topo-tag.compat { color: var(--verified); }
.sx-topo-tag.incompat { color: var(--danger); }

/* size selector */
.sx-size-chips { flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.sx-size-chip { font-size: 11.5px; padding: 4px 10px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line-2); background: var(--surface);
  color: var(--ink-700); font-weight: 600; cursor: pointer;
  transition: border-color 100ms ease, background 100ms ease, color 100ms ease; }
.sx-size-chip:hover { border-color: var(--accent-300); background: var(--accent-50); }
.sx-size-chip.is-on { background: var(--accent-600); border-color: var(--accent-600); color: var(--on-accent); }

/* A3 cta stub */
/* ComponentImageSlot blank state — 40×40 dashed slot, sx-empty visual language */
.sx-img-slot-blank {
  width: 40px; height: 40px; flex: none; border-radius: 8px;
  border: 1.5px dashed var(--line-strong); background: var(--surface-2);
  display: grid; place-items: center; color: var(--ink-300);
}
/* "Submit a photo · earn XP" inline CTA button */
.sx-cta-photo {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--accent-600); background: none; border: none; padding: 0;
  cursor: pointer; white-space: nowrap; letter-spacing: 0.03em;
  text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px;
}
.sx-cta-photo:hover { color: var(--accent-500); }
/* Inline "coming soon" note that toggles per-row */
.sx-cta-note {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-400);
  padding: 5px 12px 8px 62px; /* 62px = slot(40) + row-gap(10) + left-pad(12) */
}
