/* © 2026 Radha Prabhakaran. All rights reserved. See LICENSE. */
/* IBM Plex, bundled in fonts/ under the SIL Open Font License (fonts/OFL-IBMPlex.txt). */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/IBMPlexSans-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexMono-400-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/IBMPlexMono-500-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/IBMPlexMono-600-latin.woff2") format("woff2"); }

/* ============================================================
   DESIGN TOKENS: two themes
   Ink (dark, default): deep aubergine-black, never pure black.
   Paper (light): warm off-white stock with aubergine ink.
   One signature accent (raspberry) is reserved for the attack
   path. One counter-colour (teal) is reserved for defences and
   broken chains. Never colour alone: shape, label and pattern
   always carry the same meaning.
   ============================================================ */

:root {
  color-scheme: dark;

  /* Ink: deep aubergine-black, never a void */
  --bg: #16100d;
  --bg-elevated: #1d1511;
  --bg-card: #221914;
  --bg-card-hover: #2b201a;
  --border: #7d685b;
  --border-soft: #3c2c24;
  --border-strong: #8b7568;
  --text: #f3e9e2;
  --text-dim: #bba89c;
  --text-faint: #9a877b;

  /* Signature accent: the attack path, and nothing else */
  --accent: #d56951;
  --accent-2: #b54a35;
  --accent-soft: rgba(212, 100, 76, 0.15);
  --accent-glow: rgba(212, 100, 76, 0.32);
  --accent-deep: #c0533d;
  --on-accent: #1a0d08;

  /* Counter-colour: defences and the broken chain */
  --sage: #86bfa7;
  --success: #86bfa7;
  --success-soft: rgba(134, 191, 167, 0.14);
  --on-success: #0d1a14;

  --gold: #c58a5c;
  --danger: #e07a64;

  /* Counter-band: an inset light editorial section */
  --paper: #efe4d3;
  --paper-text: #2a1c14;
  --paper-dim: #5c4a3e;
  --paper-faint: #6d5a4c;
  --paper-border: #dccdb8;
  --paper-accent: #8f2f22;

  --shadow-strong: rgba(0, 0, 0, 0.62);
  --shadow-soft: rgba(0, 0, 0, 0.45);
  --grid-line: rgba(255, 240, 230, 0.028);
  --grid-fade: 1;
  --chrome-veil: rgba(22, 16, 13, 0.88);

  --stage-initial_access: #a99a6b;
  --stage-credential: #d4644c;
  --stage-exposure: #c58a5c;
  --stage-iot: #8fa9be;
  --stage-behavior: #86bfa7;
  --term-bg: #110c0a;
  --term-fg: #e9dcd2;
  --bg-recess: #1d1511;
  --skin: #f3e9e2;
  --hood: #0a0706;
  --hood-edge: #4a3a31;
  --cork: #3a2a1f;
  --cork-dot: rgba(0, 0, 0, 0.18);
  --cork-rim: #2c1f17;
  --note-paper: #efe4d3;
  --note-ink: #2a1c14;
  --note-dim: #6a594c;
  --string: #d4644c;
}

/* Paper is the default when the system asks for light and the
   reader has not chosen otherwise. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="ink"]) {
    color-scheme: light;
  /* Paper: warm off-white stock, aubergine ink */
  --bg: #f4ede4;
  --bg-elevated: #fffaf3;
  --bg-card: #fffaf3;
  --bg-card-hover: #ece2d5;
  --border: #8b7666;
  --border-soft: #ddd0bf;
  --border-strong: #6e5b4e;
  --text: #2a1c14;
  --text-dim: #6a594c;
  --text-faint: #746256;

  --accent: #8f2f22;
  --accent-2: #722519;
  --accent-soft: rgba(143, 47, 34, 0.10);
  --accent-glow: rgba(143, 47, 34, 0.22);
  --accent-deep: #722519;
  --on-accent: #fff6f0;
  --gold: #8a5330;
  --sage: #2e6b52;

  --danger: #8f2f22;
  --success: #2e6b52;
  --success-soft: rgba(46, 107, 82, 0.12);
  --on-success: #ffffff;

  /* Counter-band: the editorial section flips to ink on paper */
  --paper: #221914;
  --paper-text: #f3e9e2;
  --paper-dim: #c9b6a8;
  --paper-faint: #b09d90;
  --paper-border: #3c2c24;
  --paper-accent: #d4644c;

  --shadow-strong: rgba(42, 28, 20, 0.18);
  --shadow-soft: rgba(42, 28, 20, 0.12);
  --grid-line: rgba(42, 28, 20, 0.05);
  --grid-fade: 0.55;
  --chrome-veil: rgba(244, 237, 228, 0.9);

  --stage-initial_access: #6e6236;
  --stage-credential: #8f2f22;
  --stage-exposure: #8a5330;
  --stage-iot: #3d5f78;
  --stage-behavior: #2e6b52;
  --term-bg: #fffaf3;
  --term-fg: #2a1c14;
  --bg-recess: #ece2d5;
  --skin: #2a1c14;
  --hood: #2a1c14;
  --hood-edge: #2a1c14;
  --cork: #c9a982;
  --cork-dot: rgba(60, 40, 20, 0.16);
  --cork-rim: #b0906b;
  --note-paper: #fffaf3;
  --note-ink: #2a1c14;
  --note-dim: #6a594c;
  --string: #8f2f22;
}
}

/* An explicit choice from the header toggle always wins. */
:root[data-theme="paper"] {
  color-scheme: light;
  /* Paper: warm off-white stock, aubergine ink */
  --bg: #f4ede4;
  --bg-elevated: #fffaf3;
  --bg-card: #fffaf3;
  --bg-card-hover: #ece2d5;
  --border: #8b7666;
  --border-soft: #ddd0bf;
  --border-strong: #6e5b4e;
  --text: #2a1c14;
  --text-dim: #6a594c;
  --text-faint: #746256;

  --accent: #8f2f22;
  --accent-2: #722519;
  --accent-soft: rgba(143, 47, 34, 0.10);
  --accent-glow: rgba(143, 47, 34, 0.22);
  --accent-deep: #722519;
  --on-accent: #fff6f0;
  --gold: #8a5330;
  --sage: #2e6b52;

  --danger: #8f2f22;
  --success: #2e6b52;
  --success-soft: rgba(46, 107, 82, 0.12);
  --on-success: #ffffff;

  /* Counter-band: the editorial section flips to ink on paper */
  --paper: #221914;
  --paper-text: #f3e9e2;
  --paper-dim: #c9b6a8;
  --paper-faint: #b09d90;
  --paper-border: #3c2c24;
  --paper-accent: #d4644c;

  --shadow-strong: rgba(42, 28, 20, 0.18);
  --shadow-soft: rgba(42, 28, 20, 0.12);
  --grid-line: rgba(42, 28, 20, 0.05);
  --grid-fade: 0.55;
  --chrome-veil: rgba(244, 237, 228, 0.9);

  --stage-initial_access: #6e6236;
  --stage-credential: #8f2f22;
  --stage-exposure: #8a5330;
  --stage-iot: #3d5f78;
  --stage-behavior: #2e6b52;
  --term-bg: #fffaf3;
  --term-fg: #2a1c14;
  --bg-recess: #ece2d5;
  --skin: #2a1c14;
  --hood: #2a1c14;
  --hood-edge: #2a1c14;
  --cork: #c9a982;
  --cork-dot: rgba(60, 40, 20, 0.16);
  --cork-rim: #b0906b;
  --note-paper: #fffaf3;
  --note-ink: #2a1c14;
  --note-dim: #6a594c;
  --string: #8f2f22;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

/* System stacks only. No CDN, no webfont request: the
   "no network calls" privacy claim has to stay literally true. */
:root {
  --font-display: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", "Segoe UI Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  position: relative;
  min-height: 100vh;
}

.selection-count,
.surface-node-count,
.surface-center-count,
.severity-number,
.severity-max,
.severity-row-weight {
  font-family: var(--font-mono);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 0%, transparent 75%);
}

/* --- Shell: calm, full-width, tabbed views --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--chrome-veil);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 44px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.025em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  border-radius: 8px;
  display: block;
  border: 1.5px solid var(--border-strong);
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
}

.accent-text {
  color: var(--accent);
  font-style: italic;
}

.steps {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.step {
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: none;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-faint);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  transition: color 0.18s ease, background 0.18s ease;
}

.step:hover {
  color: var(--text-dim);
}

.step.active {
  color: var(--text);
  background: var(--bg-card);
}

.step-num {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-card-hover);
  color: var(--text-faint);
  transition: background 0.18s ease, color 0.18s ease;
}

.step.active .step-num {
  background: var(--accent);
  color: var(--on-accent);
}

.step-sep {
  width: 18px;
  height: 1px;
  background: var(--border);
  flex: 0 0 auto;
}

.topbar-actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

/* --- Views --- */

.canvas {
  position: relative;
}

.view {
  display: none;
  animation: viewIn 0.28s ease;
}

.view.active {
  display: block;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 56px 44px 120px;
}

/* --- Profile view --- */

.profile-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}

.profile-visual {
  position: sticky;
  top: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}

.select-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.select-head h1 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 31px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  max-width: 22ch;
}

.select-sub {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--text-dim);
  max-width: 54ch;
  line-height: 1.6;
}

.run-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--border-soft);
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: var(--text-faint);
  margin: 0;
  text-align: left;
}

.privacy-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
  animation: pulseDot 2.4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px var(--success-soft); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

/* --- Modals --- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 3, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 30px 70px -20px var(--shadow-strong);
  overflow: hidden;
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.015em;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
}

.modal-close:hover {
  color: var(--text);
  background: var(--bg-card);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 24px 22px 30px;
  overflow-y: auto;
  overflow-x: hidden;
}

.picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.picker-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.015em;
}

.results h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.picker-sub {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--text-dim);
}

.persona-picker {
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
}

.persona-picker-label {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.persona-card {
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.persona-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.persona-card-label {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
}

.persona-card-blurb {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.4;
}

.stage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px 5px 8px;
  font-size: 11.5px;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.legend-item:hover {
  border-color: var(--accent);
  color: var(--text);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.habit-grid {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.habit-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.habit-group-label .stage-icon-wrap {
  width: 17px;
  height: 17px;
}

.habit-group-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.habit-group-rule {
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.habit-group-count {
  font-size: 12px;
  color: var(--stage-color, var(--text-faint));
  font-weight: 600;
  white-space: nowrap;
}

.habit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.habit-card {
  --stage-color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 18px 11px 14px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.habit-card:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.habit-card[aria-pressed="true"] {
  background: color-mix(in srgb, var(--stage-color) 17%, transparent);
  border-color: color-mix(in srgb, var(--stage-color) 55%, transparent);
  color: var(--text);
}

.chip-check {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.habit-card[aria-pressed="true"] .chip-check {
  background: var(--stage-color);
  border-color: var(--stage-color);
}

.chip-check svg {
  width: 10px;
  height: 10px;
  opacity: 0;
  color: var(--on-accent);
  transition: opacity 0.12s ease;
}

.habit-card[aria-pressed="true"] .chip-check svg {
  opacity: 1;
}

.selection-count {
  font-size: 13px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.btn {
  border: none;
  border-radius: 9px;
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--on-accent);
  box-shadow: 0 8px 24px -10px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 10px 28px -8px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-faint);
}

.btn-fix {
  background: var(--success);
  color: var(--on-success);
}

.results-empty,
.results-nochain {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 26px;
  font-size: 14px;
}

.empty-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.chain-badge {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 12px;
}

.chain-complete-flash {
  animation: completeFlash 0.5s ease;
}

@keyframes completeFlash {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  30% { box-shadow: 0 0 40px 6px var(--accent-glow); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.chain-meta h2 {
  font-size: 25px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.chain-extra {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0;
}

.chain-steps {
  list-style: none;
  margin: 28px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chain-steps li {
  position: relative;
  padding: 0 0 30px 34px;
  opacity: 0;
  transform: translateY(8px);
}

.chain-steps li.revealed {
  animation: stepIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.chain-steps li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 14px 0 var(--accent-glow);
}

.chain-steps li::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 17px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--border), var(--border-soft));
}

.chain-steps li:last-child::after {
  display: none;
}

.chain-steps li:last-child::before {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.16), 0 0 16px 0 rgba(251, 113, 133, 0.4);
}

.chain-steps li.broken::before {
  background: var(--text-faint);
  box-shadow: none;
}

.chain-steps li.broken::after {
  background: var(--border-soft);
  opacity: 0.4;
}

.chain-steps li.broken .step-text {
  color: var(--text-faint);
  text-decoration: line-through;
}

.step-index {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
}

.step-text {
  font-size: 15.5px;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-summary {
  font-size: 13px;
  color: var(--text-faint);
  margin: 0 0 14px;
  line-height: 1.6;
}

.profile-summary strong {
  color: var(--text-dim);
  font-weight: 600;
}

.severity-card {
  display: flex;
  gap: 20px;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 4px 0 20px;
}

.severity-score-block {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 2px;
  min-width: 70px;
}

.severity-number {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  color: var(--severity-color, var(--accent));
  line-height: 1;
}

.severity-max {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}

.severity-detail {
  flex: 1;
  min-width: 0;
}

.severity-band {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--severity-color, var(--accent));
  background: var(--severity-soft, var(--accent-soft));
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
}

.severity-breakdown {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.severity-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.severity-row-weight {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.real-world-note {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 4px 0 20px;
}

.real-world-kicker {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.real-world-note p {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

.weakest-link-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-top: 10px;
}

.weakest-link-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.weakest-link-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  display: inline-flex;
}

.weakest-link-icon svg {
  width: 100%;
  height: 100%;
}

.weakest-link-label {
  margin: 0;
  font-size: 14px;
}

.weakest-link-label strong {
  color: var(--accent);
}

.fix-result {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 9px;
  background: var(--success-soft);
  border: 1px solid var(--success);
  font-size: 14px;
}

.fix-result-headline {
  margin: 0 0 10px;
  color: var(--success);
  font-weight: 600;
  line-height: 1.5;
}

.fix-result-advice {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--success);
  color: var(--text-dim);
  line-height: 1.6;
}

.fix-result-advice strong {
  color: var(--text);
}

.btn-download {
  margin-top: 20px;
  width: 100%;
}

.print-only-header {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }

  #resultsChain, #resultsChain * {
    visibility: visible;
  }

  #resultsChain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px;
    background: #fff;
    color: #111;
  }

  .print-only-header {
    display: block;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #111;
  }

  .print-brand {
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 4px;
  }

  .print-date {
    font-size: 12px;
    color: #555;
    margin: 0;
  }

  #resultsChain .chain-badge,
  #resultsChain .flow-node-rail,
  #resultsChain #fixBtn,
  #resultsChain #downloadBtn {
    display: none !important;
  }

  #resultsChain .chain-flow {
    flex-direction: column !important;
    overflow: visible !important;
  }

  #resultsChain .flow-node-card {
    margin: 0 0 10px !important;
    width: 100% !important;
  }

  #resultsChain h2, #resultsChain .flow-node-kicker {
    color: #111 !important;
  }

  #resultsChain .flow-node-text,
  #resultsChain .real-world-note p,
  #resultsChain .fix-result-headline,
  #resultsChain .fix-result-advice,
  #resultsChain .chain-extra {
    color: #222 !important;
  }

  #resultsChain .flow-node {
    opacity: 1 !important;
    transform: none !important;
  }

  #resultsChain .flow-node-card,
  #resultsChain .real-world-note,
  #resultsChain .weakest-link-panel,
  #resultsChain .fix-result,
  #resultsChain .severity-card {
    background: #f4f4f4 !important;
    border-color: #ccc !important;
    break-inside: avoid;
  }

  #resultsChain .severity-number,
  #resultsChain .severity-band {
    color: #111 !important;
    background: transparent !important;
  }

  #resultsChain .severity-row-weight {
    color: #111 !important;
  }

  #fixResult {
    visibility: visible !important;
    display: block !important;
    height: auto !important;
  }
}

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 28px 20px 56px;
  text-align: center;
}

.site-footer p {
  max-width: 640px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--text-faint);
}

/* --- Nav --- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--chrome-veil);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.site-nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 22px;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
}

@media (max-width: 560px) {
  .nav-links {
    gap: 14px;
  }
  .nav-links a {
    font-size: 12px;
  }
}

/* --- Shared section chrome --- */

.section-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 38px 20px;
}

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 12px;
}

.how-it-works h2,
.chain-library h2 {
  font-size: clamp(24px, 4vw, 32px);
  margin: 0 0 16px;
  letter-spacing: -0.015em;
}

.section-lead {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 68ch;
  margin: 0 0 26px;
}

/* --- How it works --- */

.about-mission {
  border-bottom: 1px solid var(--border-soft);
}

.about-mission h2 {
  font-size: clamp(20px, 3.4vw, 27px);
  max-width: 28ch;
  margin: 0 0 22px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.about-grid p {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.65;
}

.about-grid em {
  color: var(--text);
  font-style: italic;
}

.how-it-works {
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent);
}

.carousel {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding-inline: 48px;
}

.carousel-wide {
  max-width: 100%;
}

.library-track .library-card {
  flex: 0 0 100%;
  min-width: 0;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: 14px;
  min-width: 0;
}

.carousel-track {
  display: flex;
  min-width: 0;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.step-card {
  flex: 0 0 100%;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 26px 30px;
  min-height: 140px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.carousel-arrow svg {
  width: 16px;
  height: 16px;
}

.carousel-arrow:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.carousel-arrow-prev {
  left: 0;
}

.carousel-arrow-next {
  right: 0;
}

@media (max-width: 640px) {
  .carousel { padding-inline: 38px; }
  .carousel-arrow { width: 32px; height: 32px; }
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.step-card-num {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.step-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.55;
}

/* --- Stage: centered live map + stats --- */

main#simulator {
  padding-top: 34px;
}

.stage {
  text-align: center;
  padding: 8px 0 44px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 44px;
}

.stage-title {
  font-size: clamp(24px, 4vw, 34px);
  margin: 0 0 24px;
  letter-spacing: -0.02em;
}

.stage-visual {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.stage-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-bottom: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 6px;
  min-width: 0;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.25;
  text-align: center;
}

.stage-visual {
  display: flex;
  justify-content: center;
}

.live-preview {
  width: 100%;
  min-height: 132px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-preview-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
}

.live-preview-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.live-preview-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-preview-summary {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.live-preview-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11.5px;
}

.live-preview-node {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--text-dim);
  white-space: nowrap;
}

.live-preview-arrow {
  color: var(--text-faint);
}

.live-preview-weakest {
  margin: 0;
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 600;
}

.stage-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* --- Sticky run bar (scoped to the picker zone) --- */

.picker-zone {
  display: flex;
  flex-direction: column;
}

.run-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 36px -20px 0;
  padding: 14px 20px;
  background: var(--chrome-veil);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}

.run-bar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.run-bar .btn-primary {
  padding: 13px 30px;
  font-size: 15px;
}

/* --- Chain library --- */

.chain-library {
  border-top: 1px solid var(--border-soft);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.015));
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.library-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.library-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px -14px var(--shadow-strong);
}

.library-card-clickable {
  cursor: pointer;
}

.library-card-try {
  margin-top: 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.library-card-clickable:hover .library-card-try {
  opacity: 1;
  transform: translateX(0);
}

.stage-section {
  border-radius: 14px;
  transition: background 0.3s ease;
}

.stage-flash {
  animation: stageFlash 0.9s ease;
}

@keyframes stageFlash {
  0% { background: var(--accent-soft); }
  100% { background: transparent; }
}

.library-card-kicker {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.library-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.library-card p {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.55;
}

.library-card-steps {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
}

/* --- Live attack surface map --- */

.surface-map-wrap {
  display: flex;
  justify-content: center;
  padding: 20px 0 44px;
}

.surface-map {
  --map-scale: 1.5;
  position: relative;
  width: calc(276px * var(--map-scale));
  height: calc(276px * var(--map-scale));
  flex: 0 0 auto;
  margin: 0 auto;
}

.surface-line {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 2px;
  background: var(--border);
  opacity: 0.18;
  transform-origin: 0 50%;
  transition: opacity 0.4s ease, background 0.4s ease;
  z-index: 0;
}

.surface-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(66px * var(--map-scale, 1));
  height: calc(66px * var(--map-scale, 1));
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  box-shadow: 0 2px 10px -3px var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  z-index: 2;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.surface-center.active {
  border-color: var(--accent);
  box-shadow: 0 0 24px 4px var(--accent-glow);
}

.surface-center .stage-icon-wrap {
  width: calc(18px * var(--map-scale, 1));
  height: calc(18px * var(--map-scale, 1));
  color: var(--text-dim);
}

.surface-center.active .stage-icon-wrap {
  color: var(--accent);
}

.surface-center-label {
  font-size: calc(10px * var(--map-scale, 1));
  color: var(--text-faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

.surface-center-count {
  font-size: calc(13px * var(--map-scale, 1));
  font-weight: 800;
  color: var(--text);
}

.surface-center:focus-visible,
.surface-node:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.surface-node {
  --node-scale: 1;
  position: absolute;
  width: calc(54px * var(--map-scale, 1));
  height: calc(54px * var(--map-scale, 1));
  transform: translate(-50%, -50%) scale(var(--node-scale));
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  box-shadow: 0 2px 10px -3px var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  z-index: 1;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  padding: 4px;
}

.surface-node .stage-icon-wrap {
  width: calc(16px * var(--map-scale, 1));
  height: calc(16px * var(--map-scale, 1));
}

.surface-node-label {
  font-size: calc(8.5px * var(--map-scale, 1));
  font-weight: 700;
  color: var(--text-faint);
  line-height: 1.2;
  max-width: calc(58px * var(--map-scale, 1));
}

.surface-node-count {
  font-size: calc(11px * var(--map-scale, 1));
  font-weight: 800;
  color: var(--text);
  min-height: 12px;
}

.surface-node.hover-preview {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  filter: brightness(1.3);
}

.surface-node-pulse {
  animation: stageNodePulse 0.7s ease;
}

@keyframes stageNodePulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  60% { box-shadow: 0 0 0 14px transparent; }
  100% { box-shadow: 0 2px 10px -3px var(--shadow-soft); }
}

.stage-popover {
  position: absolute;
  z-index: 5;
  min-width: 160px;
  max-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 10px;
  box-shadow: 0 8px 24px -6px var(--shadow-strong);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  text-align: left;
}

.stage-popover-title {
  font-size: 12.5px;
  color: var(--text);
}

.stage-popover-blurb {
  color: var(--text-dim);
}

.stage-popover-count {
  color: var(--accent);
  font-weight: 700;
  font-size: 11.5px;
}

.habit-card.chip-highlight {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .surface-map {
    --map-scale: 1.15;
  }
}

.surface-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-top: 8px;
}

.surface-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 13.5px;
}

.surface-summary-row + .surface-summary-row {
  border-top: 1px solid var(--border-soft);
}

.surface-summary-label {
  color: var(--text-dim);
}

.surface-summary-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.surface-summary-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 12px 0;
}

.surface-summary-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.55;
}

/* --- Stage icons --- */

.stage-icon-wrap {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stage-color, var(--text-dim));
}

.stage-icon-wrap svg {
  width: 100%;
  height: 100%;
}

.stage-heading .stage-icon-wrap {
  width: 15px;
  height: 15px;
}

/* --- Result tabs --- */

.result-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 11px;
  margin-bottom: 24px;
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--border);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* --- Analyzing loader --- */

.analyzing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 40px 26px;
  font-size: 13.5px;
}

.scene-svg {
  width: 100%;
  max-width: 420px;
  height: auto;
  overflow: visible;
}

.scene-tick {
  fill: var(--border);
  animation: tickLight 0.2s ease forwards;
  animation-delay: var(--d, 0s);
}

@keyframes tickLight {
  to {
    fill: var(--accent);
  }
}

.scene-attacker {
  transform: translateX(60px);
  animation: attackerAdvance 1.2s cubic-bezier(0.3, 0, 0.4, 1) forwards;
}

@keyframes attackerAdvance {
  from {
    transform: translateX(60px);
  }
  to {
    transform: translateX(300px);
  }
}

.scene-you-ring {
  animation: ringPulse 1.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes ringPulse {
  0%, 100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.15;
    transform: scale(1.12);
  }
}

.analyzing-log {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-start;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  width: 100%;
  max-width: 420px;
}

.log-line {
  margin: 0;
  opacity: 0;
  transform: translateX(-8px);
  animation: logIn 0.3s ease forwards;
  animation-delay: var(--d, 0s);
}

@keyframes logIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.log-line-final {
  color: var(--accent);
  font-weight: 600;
}

/* --- Chain flow diagram --- */

.chain-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 28px 0;
}

.flow-node {
  --node-color: var(--accent);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(10px);
}

.flow-node.revealed {
  animation: nodeIn 0.35s ease forwards;
}

@keyframes nodeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flow-node.revealed .flow-node-dot {
  animation: dotPop 0.3s ease;
}

@keyframes dotPop {
  0% { transform: scale(0.6); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

.flow-node-rail {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 34px;
}

/* --- Horizontal flow on wider screens; stays vertical below this so
   nobody is stuck reading cramped horizontal cards on a phone --- */
.flow-node-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--node-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--node-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--node-color) 14%, transparent);
  flex-shrink: 0;
}

.flow-node-dot svg {
  width: 16px;
  height: 16px;
}

.flow-node-line {
  width: 2px;
  flex: 1;
  min-height: 26px;
  background: linear-gradient(var(--node-color), var(--border));
  opacity: 0;
  transition: opacity 0.35s ease 0.2s;
}

.flow-node.revealed .flow-node-line {
  opacity: 0.5;
}

.flow-node-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--node-color);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.flow-node-card:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 20px -12px var(--shadow-strong);
  border-color: var(--node-color);
}

.flow-node-kicker {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--node-color);
  margin-bottom: 5px;
}

.flow-node-text {
  font-size: 15px;
}

.flow-node.broken .flow-node-dot {
  border-color: var(--text-faint);
  color: var(--text-faint);
  box-shadow: none;
}

.flow-node.broken .flow-node-line {
  background: var(--border-soft);
  opacity: 0.4;
}

.flow-node.broken .flow-node-card {
  border-left-color: var(--text-faint);
  opacity: 0.55;
}

.flow-node.broken .flow-node-text {
  color: var(--text-faint);
  text-decoration: line-through;
}

/* --- Threat model --- */

.threat-model h2 {
  font-size: 22px;
  margin: 0 0 8px;
}

.threat-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.threat-bar-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.threat-bar-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -16px var(--shadow-strong);
}

.threat-bar-row.top-match {
  border-color: var(--tbar-color, var(--accent));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tbar-color, var(--accent)) 30%, transparent);
}

.threat-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}

.threat-bar-name {
  font-weight: 700;
  font-size: 15px;
}

.threat-bar-badge {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--tbar-color, var(--accent));
  background: color-mix(in srgb, var(--tbar-color, var(--accent)) 15%, transparent);
  border-radius: 999px;
  padding: 3px 9px;
}

.threat-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
  margin-bottom: 12px;
}

.threat-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--tbar-color, var(--accent));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.glossary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.glossary-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.glossary-card h3 {
  margin: 0 0 8px;
  font-size: 14.5px;
  color: var(--accent);
}

.glossary-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
}

.threat-bar-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.55;
}

/* --- Cipher chat widget --- */

.cipher-widget {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.cipher-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border: none;
  color: var(--on-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px -8px var(--accent-glow);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cipher-toggle:hover {
  transform: scale(1.08) rotate(-4deg);
}

.cipher-toggle svg {
  width: 24px;
  height: 24px;
}

.cipher-panel {
  width: min(340px, calc(100vw - 44px));
  height: min(460px, calc(100vh - 120px));
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px -12px var(--shadow-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cipherOpen 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes cipherOpen {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cipher-panel.cipher-compact {
  height: auto;
  width: min(220px, calc(100vw - 44px));
}

.cipher-panel.cipher-compact .cipher-messages,
.cipher-panel.cipher-compact .cipher-form {
  display: none;
}

.cipher-panel.cipher-compact .cipher-header {
  cursor: pointer;
  border-bottom: none;
}

.cipher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-card);
}

.cipher-header-text {
  display: flex;
  flex-direction: column;
}

.cipher-name {
  font-weight: 700;
  font-size: 14.5px;
}

.cipher-subtitle {
  font-size: 10.5px;
  color: var(--text-faint);
}

.cipher-close {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.cipher-close:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.cipher-close svg {
  width: 15px;
  height: 15px;
}

.cipher-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cipher-msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  animation: msgIn 0.25s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cipher-msg-bot {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}

.cipher-msg-user {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--text);
  border-bottom-right-radius: 3px;
}

.cipher-options {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
}

.cipher-options .cipher-msg-action {
  width: 100%;
  text-align: center;
  margin-top: 6px;
}

.cipher-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 3px 0;
}

.cipher-option-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.cipher-option-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cipher-msg-action {
  margin-top: 8px;
  padding: 7px 11px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
}

.cipher-msg-action:hover {
  opacity: 0.9;
}

.cipher-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-card);
}

.cipher-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
}

.cipher-input:focus {
  outline: none;
  border-color: var(--accent);
}

.cipher-send {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--accent);
  border: none;
  color: var(--on-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cipher-send svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 480px) {
  .stage-cards {
    grid-template-columns: 1fr;
  }
  .run-row {
    flex-direction: column;
    align-items: stretch;
  }
  .section-inner {
    padding: 52px 20px;
  }
  .result-tabs {
    width: 100%;
  }
  .tab-btn {
    flex: 1;
  }
}

/* --- Tabbed-view additions --- */

.btn-quiet {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, background 0.15s ease;
}

.btn-quiet:hover {
  color: var(--text);
  background: var(--bg-card);
}

.btn-lg {
  padding: 15px 34px;
  font-size: 15px;
  border-radius: 10px;
}

.results-empty,
.results-nochain {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  max-width: 620px;
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 40px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
}

.results-empty p,
.results-nochain p {
  margin: 0;
}

.results-empty-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px !important;
}

.empty-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  border: none;
}

.chain-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: start;
  margin-bottom: 46px;
}

.chain-meta h1 {
  margin: 12px 0 10px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.chain-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 40px;
}

.chain-actions {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--border-soft);
}

.threat-model h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.threat-lead {
  margin: 0 0 40px;
  font-size: 16px;
  color: var(--text-dim);
  max-width: 62ch;
  line-height: 1.6;
}

@media (max-width: 1080px) {
  .profile-layout,
  .chain-top,
  .chain-bottom {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .profile-visual {
    position: static;
  }

  .view-inner,
  .topbar-inner {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .steps {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .step-name {
    display: none;
  }

  .step {
    padding: 8px 10px;
  }

  .view-inner {
    padding-top: 36px;
  }
}

.chip-label {
  white-space: normal;
}

/* ============ SITE CHROME ============ */

.brand {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.sitenav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.navlink {
  background: transparent;
  border: none;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-faint);
  transition: color 0.18s ease, background 0.18s ease;
}

.navlink:hover { color: var(--text-dim); }

.navlink.active {
  color: var(--text);
  background: var(--bg-card);
}

.page { display: none; }
.page.active { display: block; animation: viewIn 0.3s ease; }

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 40px 0 56px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
}

.footer-inner p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-faint);
  max-width: 76ch;
  line-height: 1.65;
}

/* ============ HOME ============ */

.hero {
  border-bottom: 1px solid var(--border-soft);
  background: radial-gradient(1000px 420px at 22% -10%, rgba(217, 122, 61, 0.13), transparent);
}

.hero-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 84px 44px 92px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 72px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 22px;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;

  margin: 0 0 24px;
  font-size: clamp(40px, 5.6vw, 68px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-lead {
  margin: 0 0 34px;
  font-size: 17px;
  line-height: 1.68;
  color: var(--text-dim);
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  padding: 13px 26px;
  font-size: 14px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-map {
  position: relative;
  width: 300px;
  height: 300px;
}

.hero-node {
  animation: heroPulse 3.5s ease-in-out infinite;
}

.hero-line {
  opacity: 0.25;
  animation: heroLine 3.5s ease-in-out infinite;
}

@keyframes heroPulse {
  0%, 70%, 100% { transform: translate(-50%, -50%) scale(1); }
  35% { transform: translate(-50%, -50%) scale(1.22); }
}

@keyframes heroLine {
  0%, 70%, 100% { opacity: 0.18; }
  35% { opacity: 0.75; }
}

.hero-visual-cap {
  margin: 0;
  font-size: 12px;
  color: var(--text-faint);
}

.home-band {
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-elevated);
}

.band-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 34px 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.figure {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 16px 18px;
}

.figure-num {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.figure-label {
  font-size: 13px;
  color: var(--text-dim);
}

.home-section { padding: 88px 0; }

.home-section-alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.home-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 44px;
}

.home-h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 18px;
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.18;
  max-width: 20ch;
}

.home-lead {
  margin: 0 0 52px;
  font-size: 16px;
  color: var(--text-dim);
  max-width: 66ch;
  line-height: 1.68;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 44px 40px;
}

.pillar h3 {
  margin: 0 0 9px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pillar p {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

.pillar-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.scenario-card {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.scenario-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.scenario-score {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.scenario-score-max {
  font-size: 12px;
  color: var(--text-faint);
}

.scenario-card h3 {
  margin: 12px 0 8px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.scenario-card p {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.55;
}

.scenario-cta {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}

.home-cta { padding: 92px 0 104px; }

.home-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.home-cta-inner .home-h2 { max-width: 24ch; }

/* ============ QUICK CHECK ============ */

.quick-wrap { max-width: 860px; }

.page-title {
  font-family: var(--font-display);
  font-weight: 600;

  margin: 0 0 16px;
  font-size: clamp(30px, 3.8vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.page-lead {
  margin: 0 0 48px;
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.68;
  max-width: 62ch;
}

.quick-questions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 22px 26px;
  background: var(--bg-card);
  border: 1px solid transparent;
  border-left: 3px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s ease;
}

.quick-q.answered { border-left-color: var(--stage-color); }

.quick-q-copy {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.quick-q-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  padding-top: 3px;
}

.quick-q-text {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.quick-q-hint {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--text-faint);
}

.quick-q-answers {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.quick-opt {
  min-width: 66px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.quick-opt:hover { color: var(--text); border-color: var(--text-faint); }

.quick-opt.selected {
  background: var(--stage-color, var(--accent));
  border-color: var(--stage-color, var(--accent));
  color: var(--on-accent);
}

.quick-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 40px;
}

.quick-result-top {
  display: flex;
  gap: 32px;
  align-items: center;
  margin: 18px 0 30px;
}

.quick-score {
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--severity-soft, var(--accent-soft));
  border: 2px solid var(--severity-color, var(--accent));
}

.quick-score-num {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--severity-color, var(--accent));
}

.quick-score-band {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--severity-color, var(--accent));
}

.quick-result-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.quick-result-copy p {
  margin: 0;
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.62;
}

.quick-weakest {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 22px 24px;
}

.quick-weakest-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 9px;
}

.quick-weakest-name {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
}

.quick-weakest-advice {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.62;
}

.quick-foot {
  margin: 26px 0 0;
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.6;
}

/* ============ FULL ASSESSMENT SUBNAV ============ */

.subnav {
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-elevated);
}

.subnav-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 44px;
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 980px) {
  .hero-inner,
  .band-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }
  .band-inner { gap: 26px; }
  .hero-inner { padding: 56px 24px 64px; }
  .home-inner,
  .footer-inner,
  .subnav-inner { padding-left: 24px; padding-right: 24px; }
  .home-section { padding: 60px 0; }
  .quick-q { flex-direction: column; align-items: flex-start; gap: 16px; }
  .quick-result-top { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  .sitenav { order: 3; width: 100%; overflow-x: auto; }
  .topbar-actions { margin-left: auto; }
}

/* ============ EDITORIAL LIGHT SECTION ============ */

.home-section-light {
  background: var(--paper);
  color: var(--paper-text);
  border-top: none;
  border-bottom: none;
}

.home-section-light .home-h2 { color: var(--paper-text); }
.home-section-light .home-lead { color: var(--paper-dim); }
.home-section-light .section-eyebrow { color: var(--paper-accent); }

.home-section-light .pillar h3 { color: var(--paper-text); }
.home-section-light .pillar p { color: var(--paper-dim); }
.home-section-light .pillar-num { color: var(--paper-accent); }

.home-section-light .pillar {
  padding-top: 20px;
  border-top: 2px solid var(--paper-border);
  transition: border-color 0.3s ease;
}

.home-section-light .pillar:hover { border-top-color: var(--paper-accent); }

/* ============ SCROLL REVEAL ============ */

.reveal {
  opacity: 0;
  transform: translateY(22px);
}

.reveal.shown {
  animation: revealUp 0.62s cubic-bezier(0.22, 0.75, 0.3, 1) forwards;
}

@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

.reveal-d1.shown { animation-delay: 0.08s; }
.reveal-d2.shown { animation-delay: 0.16s; }
.reveal-d3.shown { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .reveal.shown { animation: none; }
}

/* ============ INTERACTION POLISH ============ */

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.22), transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}

.btn-primary:hover::after { transform: translateX(120%); }

.habit-card {
  position: relative;
}

.habit-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 var(--stage-color);
  opacity: 0;
  transition: opacity 0.3s ease, box-shadow 0.3s ease;
  pointer-events: none;
}

.habit-card[aria-pressed="true"]::before {
  opacity: 0.25;
  box-shadow: 0 0 16px 1px var(--stage-color);
}

.quick-q:hover { border-color: var(--border); }

.quick-opt.selected {
  animation: optPop 0.26s ease;
}

@keyframes optPop {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.stat {
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.figure-num {
  display: inline-block;
  transition: transform 0.3s ease;
}

.figure:hover .figure-num { transform: scale(1.06); }

.navlink,
.step {
  position: relative;
}

.navlink.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateX(-50%);
}

.scenario-card {
  position: relative;
  overflow: hidden;
}

.scenario-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.scenario-card:hover::after { transform: scaleX(1); }

.hero-title .ink {
  position: relative;
  display: inline-block;
  color: var(--accent);
}

.hero-title .ink::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 0.09em;
  background: var(--accent);
  opacity: 0.32;
  transform: scaleX(0);
  transform-origin: left;
  animation: underlineIn 0.85s cubic-bezier(0.22, 0.75, 0.3, 1) 0.5s forwards;
}

@keyframes underlineIn {
  to { transform: scaleX(1); }
}

/* ============ FINDINGS / METRICS ============ */

.findings { margin-bottom: 48px; }

#findingsTitle {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.findings-sub {
  margin: 0 0 22px;
  font-size: 16px;
  color: var(--text-dim);
  max-width: 60ch;
  line-height: 1.6;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.metric {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.metric-num {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.metric-label { font-size: 12.5px; color: var(--text-dim); }

.metric-bump { animation: metricBump 0.42s ease; }

@keyframes metricBump {
  0% { transform: translateY(5px); opacity: 0.45; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ============ PATH LIST + DETAIL ============ */

.path-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  margin-bottom: 56px;
}

.path-list-head {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

#pathList { display: flex; flex-direction: column; gap: 8px; }

.path-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 11px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--sev-color, var(--border));
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, opacity 0.3s ease;
}

.path-card:hover { background: var(--bg-card-hover); }

.path-card.active {
  border-color: var(--sev-color, var(--accent));
  background: var(--bg-card-hover);
  box-shadow: inset 2px 0 0 var(--sev-color, var(--accent));
}

.path-card-id {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.path-card-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.path-card-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--sev-color, var(--text-faint)); }
.path-card-obj { font-size: 12px; color: var(--text-dim); }

.path-card.path-removed {
  opacity: 0.32;
  text-decoration: line-through;
  text-decoration-color: var(--text-faint);
}

.path-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 8px;
}

.path-detail-head h2 {
  margin: 10px 0 8px;
  font-size: clamp(21px, 2.4vw, 28px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.path-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.view-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.view-opt {
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.view-opt:hover { color: var(--text-dim); }

.view-opt.active {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-sm { padding: 7px 13px; font-size: 12.5px; }

.view-note {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--text-faint);
  font-style: italic;
}

.flow-node {
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.flow-node-more {
  display: block;
  margin-top: 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.flow-node:hover .flow-node-more,
.flow-node:focus-visible .flow-node-more { opacity: 1; }

.flow-node.node-selected .flow-node-card {
  border-color: var(--node-color);
  background: var(--bg-card-hover);
}

.flow-node.attacker-mode .flow-node-card {
  border-left-color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 8%, var(--bg-card));
}

.text-swap { animation: textSwap 0.26s ease; }

@keyframes textSwap {
  0% { opacity: 0; transform: translateY(-3px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============ NODE DETAIL ============ */

.node-detail {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin: 4px 0 24px;
  animation: viewIn 0.24s ease;
}

.node-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.node-detail-head h3 { margin: 6px 0 0; font-size: 18px; letter-spacing: -0.01em; }

.node-detail-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.node-detail-close {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
}

.node-detail-close:hover { color: var(--text); background: var(--bg-card); }

.node-detail-body { margin: 0; display: grid; gap: 4px; }

.node-detail-body dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 14px;
}

.node-detail-body dt:first-child { margin-top: 0; }

.node-detail-body dd {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

.node-detail-body dd strong { color: var(--text); font-family: var(--font-mono); font-size: 13px; }

/* ============ GUIDED WALKTHROUGH (job-seeker demo tour) ============ */

.node-detail.tour-mode { border-color: var(--border-strong); }

.tour-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tour-step-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.tour-skip {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-faint);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.tour-skip:hover { color: var(--text); }

.tour-title { margin: 0 0 14px; font-size: 17px; letter-spacing: -0.01em; }

.tour-section { margin-bottom: 14px; }
.tour-section:last-of-type { margin-bottom: 0; }

.tour-section-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.tour-section p { margin: 0; font-size: 14px; color: var(--text-dim); line-height: 1.6; }

.tour-section-attacker .tour-section-label { color: var(--accent); }

.tour-section-attacker.tour-emphasis {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 -12px 14px;
}

.tour-section-fix .tour-section-label { color: var(--sage); }

.tour-fix-prompt {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.tour-fix-headline { margin: 0 0 10px; font-weight: 600; color: var(--sage); }

.tour-fix-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.tour-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.tour-nav-group { display: flex; gap: 8px; }

.tour-conclusion-headline { margin: 0 0 10px; font-weight: 600; color: var(--sage); font-size: 16px; }
.tour-conclusion-detail { margin: 0 0 16px; font-size: 14px; color: var(--text-dim); line-height: 1.6; }

.mfa-preview-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.mfa-preview-badge[hidden] { display: none; }

.flow-node.mfa-preview .flow-node-card { border-style: dashed; opacity: 0.6; }
.flow-node.mfa-preview .flow-node-line { opacity: 0.25; }

.flow-node.tour-dim { opacity: 0.25; transition: opacity 0.35s ease; }

.flow-node.tour-active .flow-node-card {
  box-shadow: 0 0 0 2px var(--accent), 0 8px 20px -12px var(--shadow-strong);
}

.node-tooltip {
  position: fixed;
  z-index: 80;
  max-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 10px 24px -10px var(--shadow-strong);
  font-size: 12px;
  color: var(--text-dim);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.node-tooltip.visible { opacity: 1; transform: translateY(0); }

.node-tooltip strong { display: block; color: var(--text); font-size: 12.5px; margin-bottom: 2px; }

/* ============ INTERVENTIONS ============ */

.interventions {
  border-top: 1px solid var(--border-soft);
  padding-top: 46px;
  margin-bottom: 40px;
}

.interventions-title {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -0.025em;
}

.interventions-sub {
  margin: 0 0 30px;
  font-size: 15px;
  color: var(--text-dim);
  max-width: 64ch;
  line-height: 1.6;
}

.intervention-list { display: flex; flex-direction: column; gap: 9px; }

.intervention {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  text-align: left;
  padding: 17px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.intervention:hover { border-color: var(--accent); transform: translateX(2px); }

.intervention-top { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

.intervention-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--accent-soft);
  pointer-events: none;
}

.intervention-body { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.intervention-label { font-size: 15px; font-weight: 700; }
.intervention-detail { font-size: 12.5px; color: var(--text-dim); }

.intervention-impact {
  position: relative;
  flex: 0 0 auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.intervention-impact strong {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}

.intervention-impact span { font-size: 11px; color: var(--text-faint); }

.intervention-empty { margin: 0; font-size: 14px; color: var(--text-dim); }

.min-effort {
  margin-top: 18px;
  padding: 22px 24px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--bg-elevated);
}

.min-effort-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.min-effort-body { margin: 0 0 10px; font-size: 14.5px; color: var(--text-dim); line-height: 1.62; }
.min-effort-body strong { color: var(--text); }
.min-effort-math { margin: 0; font-size: 12.5px; color: var(--text-faint); }

/* ============ SIMULATION RESULT ============ */

.sim-result {
  margin-top: 22px;
  padding: 24px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  animation: viewIn 0.26s ease;
}

.sim-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.sim-head h3 { margin: 0 0 20px; font-size: 19px; letter-spacing: -0.015em; }

.sim-compare {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 18px;
}

.sim-side { display: flex; flex-direction: column; gap: 3px; }

.sim-num {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-faint);
}

.sim-side-after .sim-num { color: var(--success); }
.sim-cap { font-size: 11.5px; color: var(--text-faint); }
.sim-arrow { font-size: 22px; color: var(--text-faint); }

.sim-note { margin: 0 0 16px; font-size: 13.5px; color: var(--text-dim); line-height: 1.6; }

.removed-list { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }

.removed-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  opacity: 0.75;
}

.removed-name { font-size: 13.5px; text-decoration: line-through; color: var(--text-dim); }
.removed-obj { font-size: 11.5px; color: var(--text-faint); flex: 0 0 auto; }

/* ============ SITUATIONS + DEMO ============ */

.situation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.situation {
  text-align: left;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.situation:hover { border-color: var(--accent); transform: translateY(-2px); }

.situation.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.situation-label { font-size: 14.5px; font-weight: 700; }
.situation-blurb { font-size: 12px; color: var(--text-dim); line-height: 1.45; }

.habit-card.habit-relevant {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stage-color) 45%, transparent);
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 20px;
  margin-bottom: 26px;
  border-radius: 12px;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
}

.demo-banner p { margin: 0; font-size: 13.5px; color: var(--text-dim); }
.demo-banner strong { color: var(--text); }

@media (max-width: 1080px) {
  .path-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  #pathList { flex-direction: row; overflow-x: auto; padding-bottom: 6px; }
  .path-card { flex: 0 0 240px; }
  .path-detail-head { flex-direction: column; gap: 14px; }
  .path-controls { align-items: flex-start; flex-direction: row; }
}

.hero-emphasis {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;

  margin: -8px 0 22px;
  font-size: clamp(19px, 2.2vw, 25px);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.home-cta-sub {
  margin: 0 0 26px;
  max-width: 58ch;
  font-size: 15.5px;
  color: var(--text-dim);
  line-height: 1.66;
}

.situation-block { margin-bottom: 26px; }

.persona-picker .btn-outline { margin-top: 12px; }

/* Focus visibility for every interactive control */
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .flow-node,
  .flow-node.revealed,
  .metric-bump,
  .text-swap,
  .sim-result,
  .node-detail,
  .view {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .flow-node.tour-dim { opacity: 0.25 !important; }
  .flow-node.tour-active,
  .flow-node.mfa-preview,
  .node-tooltip {
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}

/* ============ THEME TOGGLE ============ */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-faint);
  background: var(--bg-card-hover);
}

.theme-toggle-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
  /* Half-filled disc: the swatch itself says which stock you're on. */
  background: linear-gradient(90deg, var(--text) 0 50%, transparent 50% 100%);
  border: 1.5px solid var(--text-faint);
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
}

:root[data-theme="paper"] .theme-toggle-dot { transform: rotate(180deg); }

.theme-toggle-label { line-height: 1; }

@media (max-width: 720px) {
  .theme-toggle-label { display: none; }
  .theme-toggle { padding: 7px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle-dot { transition: none; }
}

/* Footer: one centred column. */
.footer-inner { flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.footer-inner p { max-width: 72ch; }
.safety-design { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.safety-design h3 { margin: 0 0 6px; font-size: 16px; }
.safety-design p { margin: 0 0 8px; color: var(--text-dim); font-size: 14px; }
.safety-design ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--text-dim); }
.safety-design b { color: var(--text); }
.footer-copy { font-size: 12.5px; color: var(--text-dim); }
.footer-brand { font-size: 18px; font-weight: 800; letter-spacing: -0.025em; white-space: nowrap; }

/* The standing disclaimer. Shown on every page: the footer is shared. */
.footer-disclaimer {
  align-self: stretch;
  max-width: none !important;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}


/* --- Cipher mascot: an original geometric fox, drawn from theme tokens only --- */
.fox {
  width: 100%;
  height: 100%;
  display: block;
}

.fox-head { fill: var(--accent); }
.fox-ear { fill: var(--bg); }
.fox-muzzle { fill: var(--paper); }
.fox-mark { fill: var(--sage); }
.fox-eye { fill: var(--bg); }
.fox-nose { fill: var(--accent-2); }

.fox-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: foxBlink 6.5s ease-in-out infinite;
}

@keyframes foxBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%, 96.5% { transform: scaleY(0.12); }
}

/* On the accent-filled floating button the palette inverts so the fox stays legible. */
.cipher-toggle .fox-head { fill: var(--bg); }
.cipher-toggle .fox-ear { fill: var(--accent); }
.cipher-toggle .fox-eye { fill: var(--accent); }
.cipher-toggle .fox-nose { fill: var(--bg); }

.cipher-toggle .fox {
  width: 30px;
  height: 30px;
}

.cipher-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: block;
}

/* --- Cipher speech-bubble tips --- */
.cipher-tip {
  position: relative;
  width: min(250px, calc(100vw - 60px));
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 12px 13px 10px;
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.7);
  animation: cipherTipIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cipher-tip::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: -7px;
  width: 11px;
  height: 11px;
  background: var(--bg-card);
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  transform: rotate(45deg);
}

@keyframes cipherTipIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.cipher-tip-text {
  margin: 0 0 9px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text);
}

.cipher-tip-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.cipher-tip-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.cipher-tip-btn:hover,
.cipher-tip-btn:focus-visible {
  color: var(--text);
  border-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .fox-eyes { animation: none; }
  .cipher-tip { animation: none; }
}
