/* =============================================================
   BEYOND THE FLOW — editorial / Bloomberg-meets-FT aesthetic
   ============================================================= */

:root {
  --paper:        #f4efe6;
  --paper-dark:   #ebe4d6;
  --ink:          #14110d;
  --ink-soft:     #3a352d;
  --muted:        #847c70;
  --line:         #d8cfbe;
  --line-soft:    #e3dccb;
  --signal:       #c8341f;
  --signal-deep:  #8e2415;
  --gold:         #b58a2e;
  --moss:         #4f6b3a;
  --shadow:       0 1px 0 rgba(20,17,13,.05), 0 12px 32px -16px rgba(20,17,13,.18);

  --serif:  "Fraunces", "Times New Roman", serif;
  --sans:   "Inter Tight", -apple-system, sans-serif;
  --mono:   "JetBrains Mono", "SF Mono", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background-image:
    radial-gradient(circle at 12% 8%, rgba(184,138,46,.04) 0%, transparent 35%),
    radial-gradient(circle at 88% 92%, rgba(200,52,31,.03) 0%, transparent 35%);
  min-height: 100vh;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--signal); }
.hidden { display: none !important; }

/* ---------- TOPBAR ---------- */
.topbar {
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 14px 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}
.brand { display: flex; align-items: baseline; gap: 8px; font-family: var(--serif); }
.brand-mark { color: var(--signal); font-size: 22px; line-height: 1; }
.brand-name { font-size: 22px; font-weight: 900; letter-spacing: .02em; }
.brand-tag {
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em;
  color: var(--muted); padding-left: 8px; border-left: 1px solid var(--line);
  text-transform: uppercase;
}
.topbar-nav { display: flex; gap: 28px; justify-self: center; }
.topbar-nav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 6px 0; border-bottom: 2px solid transparent;
  transition: border-color .15s, color .15s;
}
.topbar-nav a:hover { color: var(--ink); }
.topbar-nav a.active { border-bottom-color: var(--signal); color: var(--ink); }
.topbar-meta { display: flex; gap: 8px; align-items: center; }

.pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  padding: 5px 10px; border: 1px solid var(--ink); background: var(--ink);
  color: var(--paper); text-transform: uppercase; border-radius: 2px;
}
.pill-ghost { background: transparent; color: var(--ink); }
.pill-warn  { background: var(--signal); border-color: var(--signal); color: white; }
.pill-ok    { background: var(--moss); border-color: var(--moss); color: white; }

/* ---------- COMMON ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 16px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; padding: 14px 22px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  cursor: pointer; transition: all .15s; border-radius: 2px; font-weight: 500;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover:not(:disabled) { background: var(--signal); border-color: var(--signal); }
.btn-secondary { background: var(--paper-dark); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.btn-ghost { border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { border-color: var(--signal); color: var(--signal); background: transparent; }
.btn-danger:hover { background: var(--signal); color: white; }
.btn-block { width: 100%; }
.btn-tiny { padding: 8px 14px; font-size: 11px; }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }

.back-link {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  display: inline-block; margin-bottom: 24px;
}
.back-link:hover { color: var(--signal); }

.muted { color: var(--muted); font-size: 14px; }
.muted-out { color: var(--muted); text-decoration: line-through; }

.section-title {
  font-family: var(--serif); font-size: 28px; font-weight: 600;
  margin: 32px 0 20px; border-bottom: 2px solid var(--ink);
  padding-bottom: 12px; display: flex; align-items: baseline; justify-content: space-between;
}
.section-meta {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); font-weight: 400;
}

.block-title {
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 12px;
}
.block-title.with-help { flex-wrap: wrap; }
.block-title .count-pill {
  font-family: var(--mono); font-size: 11px; background: var(--ink);
  color: var(--paper); padding: 2px 8px; border-radius: 10px; font-weight: 400;
}
.block-help {
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  font-weight: 400; font-style: italic;
}

/* ---------- LANDING ---------- */
.landing {
  max-width: 1340px; margin: 0 auto; padding: 48px 32px 80px;
  min-height: 100vh; display: flex; flex-direction: column;
}
.landing-grid {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: 80px; flex: 1; align-items: start;
}
.display {
  font-family: var(--serif); font-size: clamp(56px, 8vw, 104px);
  font-weight: 600; line-height: .95; letter-spacing: -.02em;
  margin: 16px 0 32px;
}
.display em { font-style: italic; color: var(--signal); font-weight: 400; }
.lede {
  font-family: var(--serif); font-size: 22px; line-height: 1.5;
  font-weight: 400; max-width: 540px; color: var(--ink-soft);
  margin-bottom: 40px;
}
.lede strong { color: var(--ink); font-weight: 600; }
.landing-cta { display: flex; gap: 12px; margin-bottom: 64px; }
.landing-meta {
  display: grid; grid-template-columns: repeat(3, auto);
  gap: 48px; padding-top: 32px; border-top: 1px solid var(--line);
}
.landing-meta > div { display: flex; flex-direction: column; }
.landing-meta .num {
  font-family: var(--serif); font-size: 48px; font-weight: 600; line-height: 1;
}
.landing-meta .lbl {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-top: 6px;
}
.landing-right { position: sticky; top: 48px; }
.paper {
  background: white; border: 1px solid var(--ink); padding: 28px;
  box-shadow: var(--shadow); transform: rotate(.4deg); position: relative;
}
.paper::before {
  content: ''; position: absolute; inset: -1px;
  border: 1px solid var(--ink); transform: translate(8px, 8px); z-index: -1;
}
.paper-header {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  padding-bottom: 12px; margin-bottom: 16px; border-bottom: 2px solid var(--ink);
}
.paper-date { color: var(--muted); }
.paper-story { padding: 14px 0; border-bottom: 1px dotted var(--line); }
.paper-story:last-of-type { border: none; }
.paper-cat {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: .16em; color: var(--signal);
}
.paper-story h3 {
  font-family: var(--serif); font-size: 19px; margin: 4px 0 6px;
  font-weight: 600; line-height: 1.2;
}
.paper-story p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.4; }
.paper-footer {
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  color: var(--muted); text-transform: uppercase; text-align: center;
  padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--line);
}
.landing-footer {
  margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--ink);
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase;
  display: flex; justify-content: space-between;
}
.landing-footer a { color: var(--ink); border-bottom: 1px solid var(--line); }
.landing-footer a:hover { color: var(--signal); border-color: var(--signal); }

/* CTA sub-text */
.landing-cta-sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  color: var(--muted); text-transform: uppercase;
  margin-top: -48px; margin-bottom: 8px;
}
.landing-cta-signin {
  font-size: 13px; color: var(--muted);
  margin: 0 0 48px;
}
.landing-cta-signin a {
  color: var(--ink); font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.landing-cta-signin a:hover {
  color: var(--signal); border-bottom-color: var(--signal);
}

/* How it works section */
.landing-how {
  margin-top: 80px; padding-top: 48px; border-top: 1px solid var(--line);
}
.landing-how .eyebrow { margin-bottom: 32px; }
.how-steps {
  display: flex; align-items: flex-start; gap: 0;
}
.how-step {
  flex: 1; padding: 0 32px 0 0;
}
.how-step:last-child { padding-right: 0; }
.how-num {
  font-family: var(--serif); font-size: 48px; font-weight: 600;
  color: var(--line); line-height: 1; display: block; margin-bottom: 12px;
}
.how-step h4 {
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  margin: 0 0 8px;
}
.how-step p {
  font-size: 14px; color: var(--ink-soft); margin: 0; line-height: 1.6;
}
.how-step-arrow {
  font-family: var(--mono); font-size: 24px; color: var(--line);
  padding: 36px 16px 0; flex-shrink: 0;
}

/* Objection handler */
.landing-objection {
  margin-top: 56px; padding: 32px;
  border: 1px solid var(--line); background: var(--paper-dark);
  display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center;
}
.objection-q {
  font-family: var(--serif); font-size: 18px; font-weight: 600;
  font-style: italic; color: var(--ink-soft); max-width: 280px;
  border-right: 1px solid var(--line); padding-right: 32px;
}
.objection-a {
  font-size: 15px; color: var(--ink-soft); line-height: 1.6;
}
.objection-a em { font-style: italic; color: var(--ink); font-weight: 500; }

/* Sample paper footer improvement */
.paper-footer-sample {
  display: flex; align-items: center; gap: 10px;
}
.paper-footer-label {
  font-family: var(--mono); font-size: 9px; background: var(--ink);
  color: var(--paper); padding: 2px 6px; letter-spacing: .12em;
}

/* Auth reassure */
.auth-reassure {
  text-align: center; font-size: 12px; color: var(--muted);
  margin-top: -4px; margin-bottom: 0;
}

/* Step intro example */
.step-intro-example {
  margin-top: 8px; font-size: 13px; color: var(--muted);
}

@media (max-width: 680px) {
  .how-steps { flex-direction: column; }
  .how-step-arrow { padding: 0; transform: rotate(90deg); }
  .landing-objection { grid-template-columns: 1fr; }
  .objection-q { border-right: none; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 16px; max-width: none; }
}

/* ---------- AUTH ---------- */
.auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 48px 24px;
}
.auth-card {
  width: 100%; max-width: 460px; background: white;
  border: 1px solid var(--ink); padding: 40px; box-shadow: var(--shadow);
}
.auth-card h2 {
  font-family: var(--serif); font-size: 36px; font-weight: 600;
  margin: 0 0 8px; letter-spacing: -.01em;
}
.auth-sub { font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.auth-foot a { color: var(--signal); font-weight: 500; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; }
.form label > span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-soft);
}
.form .opt { color: var(--muted); text-transform: none; letter-spacing: 0; font-style: italic; }
.form input, .form select {
  font-family: var(--sans); font-size: 15px; padding: 10px 12px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 2px; outline: none; transition: border-color .15s;
}
.form input:focus, .form select:focus { border-color: var(--ink); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.bank {
  border: 1px dashed var(--line); padding: 16px; margin-top: 8px;
  display: flex; flex-direction: column; gap: 12px; background: var(--paper-dark);
}
.bank legend {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; padding: 0 8px;
  display: flex; gap: 8px; align-items: center;
}
.mock-badge {
  font-size: 9px; background: var(--signal); color: white;
  padding: 3px 6px; letter-spacing: .1em; border-radius: 2px;
}
.bank-note { margin: 0; font-size: 12px; color: var(--muted); }

/* =============================================================
   SETUP WIZARD
============================================================= */
.setup-page {
  max-width: 1100px; margin: 0 auto; padding: 32px;
}
.setup-header {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 24px; gap: 24px;
}
.setup-title {
  font-family: var(--serif); font-size: 44px; font-weight: 600;
  margin: 8px 0 0; letter-spacing: -.01em;
}

/* Progress rail */
.setup-progress {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 40px; padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.progress-step {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
  user-select: none;
}
.progress-step span {
  width: 22px; height: 22px;
  border: 1px solid var(--line); background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 700; color: var(--muted);
  transition: all .15s;
}
.progress-step.done {
  color: var(--ink-soft);
}
.progress-step.done span {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.progress-step.current {
  color: var(--signal);
}
.progress-step.current span {
  background: var(--signal); color: white; border-color: var(--signal);
}
.progress-step.clickable {
  cursor: pointer;
}
.progress-step.clickable:hover {
  color: var(--signal);
}
.progress-step.clickable:hover span {
  border-color: var(--signal);
  transform: scale(1.08);
}
.progress-step.clickable.done:hover span {
  background: var(--signal); border-color: var(--signal);
}
.progress-line {
  flex: 1; height: 1px; background: var(--line);
}

.setup-step {
  background: white; border: 1px solid var(--ink);
  padding: 40px; box-shadow: var(--shadow);
}
.step-intro { margin-bottom: 32px; }
.step-intro h3 {
  font-family: var(--serif); font-size: 28px; font-weight: 600;
  margin: 0 0 8px; letter-spacing: -.01em;
}
.step-intro p { margin: 0; color: var(--ink-soft); max-width: 600px; }

.step-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line);
}
.step-nav-final { flex-wrap: wrap; gap: 16px; }
.step-nav-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- STEP 1 — Roles ---------- */
.role-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.role-card {
  border: 1px solid var(--line); background: var(--paper);
  padding: 24px; cursor: pointer;
  transition: all .15s; border-radius: 2px;
  display: flex; flex-direction: column; gap: 8px;
}
.role-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.role-card.selected {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.role-card.selected .role-card-blurb { color: rgba(255,255,255,.7); }
.role-card-icon {
  font-family: var(--serif); font-size: 32px; line-height: 1;
  color: var(--signal);
}
.role-card.selected .role-card-icon { color: var(--gold); }
.role-card-label {
  font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 0;
}
.role-card-blurb {
  font-size: 13px; color: var(--muted); margin: 0;
}

.self-location-block {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 2px;
}
.self-location-block.hidden { display: none; }
.self-location-title {
  font-family: var(--serif); font-size: 18px; font-weight: 600;
  margin: 0 0 6px;
}
.self-location-help {
  font-size: 13px; color: var(--muted); margin: 0 0 16px; max-width: 600px;
}
.self-location-inputs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.self-location-inputs input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: inherit; font-size: 14px;
  border-radius: 2px;
}
.self-location-inputs input:focus {
  outline: none; border-color: var(--ink);
}
@media (max-width: 600px) {
  .self-location-inputs { grid-template-columns: 1fr; }
}

/* ---------- STEP 2 — Geography ---------- */
.geo-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.geo-side {
  border: 1px solid var(--line); background: var(--paper);
  padding: 24px;
}
.geo-side-header {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 4px;
}
.geo-side-mark {
  font-family: var(--serif); font-size: 28px; color: var(--signal);
}
.geo-side h4 {
  font-family: var(--serif); font-size: 22px; font-weight: 600;
  margin: 0;
}
.geo-help {
  font-size: 13px; color: var(--muted); margin: 0 0 16px;
}
.country-add {
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px; margin-bottom: 16px;
}
.country-add input {
  font-family: var(--sans); font-size: 14px;
  padding: 10px 12px; border: 1px solid var(--line); background: white;
}
.country-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.country-item {
  border: 1px solid var(--line); background: white;
  padding: 12px; border-radius: 2px;
}
.country-item-header {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
}
.country-item-flag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  background: var(--paper-dark); padding: 4px 8px;
  border: 1px solid var(--line);
}
.country-item-name { font-weight: 600; font-size: 15px; }
.country-item-toggle {
  background: none; border: 1px solid transparent;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  cursor: pointer; padding: 4px 8px;
}
.country-item-toggle:hover { color: var(--signal); border-color: var(--signal); }
.country-item-detail {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dotted var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.country-item-detail label { display: flex; flex-direction: column; gap: 4px; }
.country-item-detail label span {
  font-family: var(--mono); font-size: 9px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.country-item-detail input,
.country-item-detail select {
  font-family: var(--sans); font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--line); background: var(--paper);
}
.country-empty {
  font-style: italic; font-size: 13px; color: var(--muted); margin: 0;
}

/* ---------- STEP 3 — Movement ---------- */
.transport-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.transport-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 12px;
  border: 1px solid var(--line); background: var(--paper);
  cursor: pointer; transition: all .12s; border-radius: 2px;
}
.transport-tile:hover { border-color: var(--ink); }
.transport-tile.active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.transport-tile-icon { font-size: 22px; line-height: 1; }
.transport-tile-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase;
}

.chokepoint-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.chokepoint-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line); background: var(--paper);
  cursor: pointer; transition: all .12s; border-radius: 2px;
  font-size: 13px;
}
.chokepoint-tile:hover { border-color: var(--ink); }
.chokepoint-tile.active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.chokepoint-tile-mode {
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  background: var(--paper-dark); color: var(--ink);
  padding: 2px 6px; border-radius: 2px;
}
.chokepoint-tile.active .chokepoint-tile-mode {
  background: var(--gold); color: var(--ink);
}

.port-add {
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px; margin-bottom: 12px;
}
.port-add input {
  font-family: var(--sans); padding: 10px 12px;
  border: 1px solid var(--line); background: var(--paper); font-size: 14px;
}

.watch-list { display: flex; flex-wrap: wrap; gap: 6px; }
.watch-chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  padding: 4px 8px; border: 1px solid var(--ink); background: white;
  display: inline-flex; gap: 6px; align-items: center;
}
.watch-chip button {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 0; font-family: var(--mono);
}
.watch-chip button:hover { color: var(--signal); }

/* ---------- STEP 4 — KPIs + tags ---------- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.kpi-group {
  border: 1px solid var(--line); background: var(--paper); padding: 16px;
}
.kpi-group-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.kpi-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; cursor: pointer;
  border-bottom: 1px dotted var(--line-soft);
}
.kpi-row:last-child { border-bottom: none; }
.kpi-row:hover .kpi-label { color: var(--signal); }
.kpi-check {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 1px solid var(--ink); background: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); color: transparent;
  border-radius: 2px;
}
.kpi-row.active .kpi-check {
  background: var(--ink); color: var(--paper);
}
.kpi-row.active .kpi-check::before { content: '✓'; font-size: 13px; line-height: 1; }
.kpi-body { display: flex; flex-direction: column; gap: 2px; }
.kpi-label {
  font-weight: 600; font-size: 14px;
  transition: color .12s;
}
.kpi-full {
  font-family: var(--mono); font-size: 10px; letter-spacing: .04em;
  color: var(--muted);
}

.tag-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.tag {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--line);
  cursor: pointer; font-size: 13px; background: var(--paper);
  border-radius: 2px; transition: all .12s;
}
.tag:hover { border-color: var(--ink); }
.tag.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tag-mark { font-family: var(--mono); font-size: 14px; width: 14px; }

/* ---------- STEP 5 — Confirm ---------- */
.confirm-grid {
  display: grid; grid-template-columns: 360px 1fr; gap: 24px;
  align-items: start;
}
.confirm-summary {
  background: var(--paper); border: 1px solid var(--line); padding: 24px;
}
.confirm-block-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line);
}
.confirm-block-title:first-child { margin-top: 0; }
#confirm-profile { margin: 0; padding: 0; display: grid; gap: 6px; }
#confirm-profile dt {
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
#confirm-profile dd { margin: 0 0 6px; font-size: 14px; }
.confirm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.confirm-chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  background: white; border: 1px solid var(--line);
  padding: 4px 8px;
}

.confirm-map {
  background: white; border: 1px solid var(--ink);
  display: flex; flex-direction: column;
  min-height: 460px;
}

/* ---------- STEP 6 — Advanced editor ---------- */
.advanced-layout {
  display: grid; grid-template-columns: 360px 1fr; gap: 24px;
  align-items: start;
}
.advanced-side {
  background: var(--paper); border: 1px solid var(--line); padding: 24px;
  max-height: 70vh; overflow-y: auto;
}
.advanced-map {
  background: white; border: 1px solid var(--ink);
  display: flex; flex-direction: column;
  min-height: 540px;
}
.wform { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.wform label { display: flex; flex-direction: column; gap: 4px; }
.wform label > span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-soft);
}
.wform input, .wform select {
  font-family: var(--sans); font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--line); background: white;
}
.opt { color: var(--muted); text-transform: none; letter-spacing: 0; font-style: italic; }
.count-pill {
  font-family: var(--mono); font-size: 11px; background: var(--ink);
  color: var(--paper); padding: 2px 8px; border-radius: 10px;
}
.node-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.node-item {
  border: 1px solid var(--line); background: white;
  padding: 10px; display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: center; border-radius: 2px;
}
.node-item-mark {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink); font-family: var(--mono);
  font-size: 11px; font-weight: 700; background: var(--paper);
}
.node-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.node-item-title { font-weight: 600; font-size: 13px; }
.node-item-meta {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  color: var(--muted); text-transform: uppercase;
}
.node-item-actions { display: flex; gap: 2px; }
.icon-btn {
  background: none; border: 1px solid transparent;
  padding: 4px 6px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border-radius: 2px;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn.danger:hover { border-color: var(--signal); color: var(--signal); }
.node-empty { color: var(--muted); font-size: 13px; font-style: italic; margin: 0; }

/* ---------- MINIMAP (used in confirm + advanced) ---------- */
.minimap-header {
  display: flex; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--ink);
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase;
}
.minimap-stats { color: var(--muted); }
.minimap {
  flex: 1; position: relative;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 40px 40px;
  overflow: hidden;
  min-height: 380px;
}
#confirm-svg, #adv-svg { width: 100%; height: 100%; min-height: 380px; display: block; }
.minimap-legend {
  display: flex; gap: 20px; padding: 12px 20px;
  border-top: 1px solid var(--ink);
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); flex-wrap: wrap;
}
.minimap-legend .dot {
  display: inline-block; width: 10px; height: 10px;
  margin-right: 4px; border: 1px solid var(--ink); vertical-align: middle;
}
.dot-origin       { background: var(--gold); }
.dot-manufacturer { background: var(--signal); }
.dot-port         { background: var(--moss); }
.dot-hub          { background: var(--ink); }
.dot-customer     { background: white; }

.mm-node-rect {
  stroke: var(--ink); stroke-width: 1.5; cursor: pointer;
  transition: filter .15s;
}
.mm-node-rect:hover { filter: brightness(.92); }
.mm-node-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase; pointer-events: none;
}
.mm-node-title {
  font-family: var(--serif); font-size: 14px; font-weight: 600; pointer-events: none;
}
.mm-edge { stroke: var(--ink); stroke-width: 1.2; fill: none; }
.mm-edge-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; fill: var(--muted); pointer-events: none;
}

/* ---------- DASHBOARD ---------- */
.dashboard { max-width: 1340px; margin: 0 auto; padding: 32px; }
.paywall-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 20px; margin-bottom: 24px;
  background: var(--ink); color: var(--paper);
  border-left: 4px solid var(--signal);
}
.paywall-banner strong { color: white; }

.dash-header {
  display: flex; justify-content: space-between; align-items: end;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 24px; margin-bottom: 8px; gap: 24px;
}
.dash-title {
  font-family: var(--serif); font-size: 56px; font-weight: 600;
  margin: 8px 0 8px; letter-spacing: -.02em;
}
.dash-sub { margin: 0; color: var(--ink-soft); max-width: 600px; }
.dash-actions {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  min-width: 200px;
}
.dash-actions .btn:disabled {
  opacity: 0.45; cursor: not-allowed;
}
.recompute-quota {
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.02em;
  text-align: right;
  max-width: 220px; line-height: 1.4;
}
.dash-indices { display: flex; gap: 24px; }
.idx { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.idx-lbl {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--muted);
}
.idx-val { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.idx-d { font-family: var(--mono); font-size: 11px; }
.idx-d.up    { color: var(--moss); }
.idx-d.down  { color: var(--signal); }

.top5-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1px; background: var(--ink); border: 1px solid var(--ink);
}
.top5-item {
  background: white; padding: 20px 24px;
  display: grid; grid-template-columns: 32px 1fr auto;
  gap: 20px; align-items: start;
  cursor: pointer; transition: background .12s;
}
.top5-item:hover { background: var(--paper); }
.top5-num {
  font-family: var(--serif); font-size: 28px; font-weight: 600;
  color: var(--muted); line-height: 1;
}
.top5-body h4 {
  font-family: var(--serif); font-size: 22px; font-weight: 600;
  margin: 0 0 6px; line-height: 1.2;
}
.top5-body p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.top5-source {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}

.category-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
}
.cat-card {
  background: white; border: 1px solid var(--ink);
  padding: 24px; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.cat-card-header {
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.cat-card-name {
  font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 0;
  letter-spacing: -.005em;
}
.cat-points {
  list-style: none; padding: 0; margin: 0 0 16px;
  display: flex; flex-direction: column;
}
.cat-points-eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--signal);
  margin-bottom: 10px;
}
.cat-point {
  font-size: 13px; padding: 10px 0;
  border-bottom: 1px dotted var(--line);
  color: var(--ink-soft);
}
.cat-point:last-child { border-bottom: none; }
.cat-point-head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 4px;
}
.cat-point-title {
  color: var(--ink); font-weight: 500; flex: 1;
  font-family: var(--serif); font-size: 14px; line-height: 1.3;
}
.cat-point-summary {
  font-size: 12.5px; line-height: 1.45; color: var(--ink-soft);
}
.cat-point-source {
  font-size: 9px; color: var(--muted);
  font-family: var(--mono); letter-spacing: .12em;
  text-transform: uppercase; white-space: nowrap;
  flex-shrink: 0;
}
.cat-point-link, .top5-link {
  display: inline-block;
  color: var(--signal); text-decoration: none;
  font-size: 12px; font-weight: bold;
  transition: opacity .15s;
  flex-shrink: 0;
}
.cat-point-link:hover, .top5-link:hover { opacity: 0.7; }

.cat-grid-empty {
  grid-column: 1 / -1;
  padding: 32px 24px;
  background: var(--paper);
  border: 1px dashed var(--line);
  text-align: center;
  color: var(--ink-soft);
}
.cat-grid-empty h3 {
  font-family: var(--serif); font-size: 18px; margin: 0 0 8px;
}
.cat-grid-empty p {
  margin: 0; max-width: 480px; margin-left: auto; margin-right: auto;
  font-size: 13px; color: var(--muted);
}

.mode-banner {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--gold);
  border-left: 4px solid var(--gold);
  font-size: 13px; color: var(--ink-soft);
  border-radius: 2px;
}

.mode-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 12px;
}
.mode-toggle-btn {
  text-align: left;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: inherit;
  display: flex; flex-direction: column; gap: 4px;
  transition: all .15s; border-radius: 2px;
}
.mode-toggle-btn:hover { border-color: var(--ink); }
.mode-toggle-btn.active {
  background: var(--ink); border-color: var(--ink);
}
.mode-toggle-btn.active .mode-toggle-label,
.mode-toggle-btn.active .mode-toggle-hint {
  color: var(--paper);
}
.mode-toggle-btn.active .mode-toggle-hint { color: rgba(255,255,255,.7); }
.mode-toggle-label {
  font-family: var(--serif); font-size: 16px; font-weight: 600;
  color: var(--ink);
}
.mode-toggle-hint {
  font-size: 12px; color: var(--muted);
}

.cat-synthesis {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--paper-dark);
  border-left: 3px solid var(--moss);
  border-radius: 0 2px 2px 0;
}
.cat-synthesis-eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--moss);
  margin-bottom: 8px;
}
.cat-synthesis p {
  margin: 0;
  font-family: var(--serif); font-style: italic;
  font-size: 13.5px; line-height: 1.55; color: var(--ink);
}
.cat-locked .cat-synthesis {
  filter: blur(4px); user-select: none; pointer-events: none;
}
.cat-lock-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  padding: 24px;
  background: linear-gradient(to bottom, transparent 30%, rgba(244,239,230,.95) 70%);
  pointer-events: none;
}
.cat-lock-overlay > * { pointer-events: auto; }
.cat-lock-msg {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink);
  margin-bottom: 10px; text-align: center;
}

/* ---------- ACCOUNT ---------- */
.account { max-width: 1100px; margin: 0 auto; padding: 32px; }
.account h2 {
  font-family: var(--serif); font-size: 48px; font-weight: 600;
  margin: 8px 0 32px; letter-spacing: -.01em;
  border-bottom: 2px solid var(--ink); padding-bottom: 24px;
}
.account-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.account-card {
  background: white; border: 1px solid var(--ink); padding: 24px;
}
.account-card h3 {
  font-family: var(--serif); font-size: 22px; font-weight: 600;
  margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.account-card-danger { border-color: var(--signal); }
.account-card-danger h3 { color: var(--signal); border-color: var(--signal); }
#profile-list { margin: 0; padding: 0; display: grid; gap: 8px; }
#profile-list dt {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
#profile-list dd { margin: 0 0 8px; font-size: 15px; }
#sub-status {
  padding: 16px; background: var(--paper-dark); margin-bottom: 16px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
}
.sub-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- UPGRADE ---------- */
.upgrade { max-width: 1000px; margin: 0 auto; padding: 32px; }
.upgrade h2 {
  font-family: var(--serif); font-size: 56px; font-weight: 600;
  margin: 8px 0 40px; letter-spacing: -.02em;
}
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.plan {
  background: white; border: 1px solid var(--ink); padding: 32px;
  display: flex; flex-direction: column;
}
.plan-featured {
  border-width: 2px; background: var(--ink); color: var(--paper);
  position: relative;
}
.plan-featured::after {
  content: 'RECOMMENDED'; position: absolute; top: -10px; right: 24px;
  background: var(--signal); color: white;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  padding: 4px 10px;
}
.plan-current { background: var(--paper-dark); }
.plan-name {
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; margin-bottom: 8px; color: var(--muted);
}
.plan-featured .plan-name { color: var(--signal); }
.plan-price {
  font-family: var(--serif); font-size: 64px; font-weight: 600;
  line-height: 1; margin-bottom: 24px;
}
.plan-price span { font-size: 16px; color: var(--muted); font-weight: 400; }
.plan ul {
  list-style: none; padding: 0; margin: 0 0 32px; flex: 1;
  display: flex; flex-direction: column; gap: 8px; font-size: 14px;
}
.plan ul li::before { content: '◆ '; color: var(--gold); font-size: 10px; }
.plan-featured .btn-primary {
  background: var(--signal); border-color: var(--signal); color: white;
}
.plan-featured .btn-primary:hover {
  background: var(--signal-deep); border-color: var(--signal-deep);
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink); color: var(--paper);
  padding: 12px 20px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  z-index: 100; border-left: 3px solid var(--signal);
  transition: transform .25s ease; box-shadow: var(--shadow);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .landing-grid { grid-template-columns: 1fr; }
  .landing-right { position: static; }
  .geo-grid { grid-template-columns: 1fr; }
  .confirm-grid { grid-template-columns: 1fr; }
  .advanced-layout { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .topbar-inner { grid-template-columns: 1fr auto; gap: 16px; }
  .topbar-nav { display: none; }
  .dash-header { flex-direction: column; align-items: start; }
  .dash-indices { width: 100%; justify-content: space-between; }
  .display { font-size: 56px; }
  .dash-title { font-size: 40px; }
  .upgrade h2 { font-size: 40px; }
  .setup-progress { overflow-x: auto; padding-bottom: 16px; }
  .progress-step { font-size: 10px; }
  .progress-line { min-width: 16px; }
  .step-nav-final { flex-direction: column; align-items: stretch; }
}

/* =============================================================
   FLOWS — wizard step 1 + reused on confirm
============================================================= */
.flows-layout {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}
.flows-layout-editor {
  /* Step 1 has no graph pane — let the editor breathe across the whole row,
     but cap the width so a wide screen doesn't make it look stretched. */
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
}
@media (max-width: 900px) {
  .flows-layout { grid-template-columns: 1fr; }
}
.flows-pane { min-width: 0; }

.flows-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 13px;
  margin-bottom: 12px;
}
.flows-summary.hidden { display: none; }
.flows-summary b { color: var(--ink); font-weight: 600; }

.flows-empty {
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 2px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}
.flows-empty.hidden { display: none; }

.flows-list {
  list-style: none; padding: 0; margin: 0 0 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.flow-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px 14px;
}
.flow-card-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.flow-dir-pill {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; font-weight: 600;
  border-radius: 2px;
}
.flow-dir-pill.in { background: var(--gold); color: #fff; }
.flow-dir-pill.out { background: var(--moss); color: #fff; }
.flow-dir-pill.self { background: var(--paper-dark); color: var(--ink); }
.flow-route { font-size: 14px; font-weight: 500; flex: 1 1 200px; min-width: 0; }
.flow-route .arrow { color: var(--muted); margin: 0 6px; font-weight: 400; }
.flow-meta {
  font-size: 12px; color: var(--muted);
  margin-top: 6px;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.flow-meta b { color: var(--ink); font-weight: 500; }
.flow-actions { display: flex; gap: 6px; margin-left: auto; }
.flow-actions button {
  font-size: 12px; padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
}
.flow-actions button:hover { border-color: var(--ink); color: var(--ink); }
.flow-actions button.danger:hover { border-color: var(--signal); color: var(--signal); }

.flow-add-btn {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 2px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.flow-add-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* Flow form (inline editor) */
/* ============================================================
   FLOW EDITOR — breathing room + clear selected state
   ============================================================ */
.flow-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px 28px 24px;
  margin-bottom: 24px;
}
.flow-form h4 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}

.flow-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}
.ff-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ff-row-full { grid-column: span 2; }

.ff-row label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.ff-row .ff-help {
  font-size: 12px;
  color: var(--muted);
  margin-top: -4px;
  margin-bottom: 4px;
  line-height: 1.5;
}
.ff-optional {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}

.ff-row input[type="text"],
.ff-row select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  border-radius: 3px;
  transition: border-color .15s;
}
.ff-row input[type="text"]:focus,
.ff-row select:focus {
  outline: none;
  border-color: var(--ink);
}

/* Direction picker — three big tappable cards */
.ff-dir-choice {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.ff-dir-choice button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all .12s;
}
.ff-dir-choice button:hover {
  border-color: var(--ink-soft);
}
.ff-dir-choice button.active {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink);
}
.ff-dir-choice button.active .ff-dir-label,
.ff-dir-choice button.active .ff-dir-hint {
  color: #fff;
}
.ff-dir-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.ff-dir-hint {
  font-size: 12px;
  color: var(--muted);
}
.ff-dir-choice button.active .ff-dir-hint {
  color: rgba(255, 255, 255, .75);
}

/* Mode picker — same treatment, four columns */
.ff-mode-choice {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ff-mode-choice button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: all .12s;
}
.ff-mode-choice button:hover {
  border-color: var(--ink-soft);
}
.ff-mode-choice button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.ff-mode-icon {
  font-size: 14px;
}

.ff-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   FLOW GRAPH — clean three-column layout
   ============================================================ */
.flows-graph-pane {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}
.flows-graph-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.flows-graph-svg {
  width: 100%;
  flex: 1;
  display: block;
}
.flows-graph-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.legend-swatch {
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 6px;
  border: 1px solid var(--line);
  vertical-align: middle;
  border-radius: 1px;
}
.legend-swatch.in { background: var(--gold); border-color: var(--gold); }
.legend-swatch.out { background: #fff; border-color: var(--moss); }
.legend-swatch.self { background: var(--ink); border-color: var(--ink); }

/* Nodes — color encodes role */
.flows-graph-svg .fg-node {
  stroke-width: 1;
}
.flows-graph-svg .fg-node-in       { fill: var(--gold); stroke: #8a6628; }
.flows-graph-svg .fg-node-hub      { fill: var(--ink);  stroke: var(--ink); }
.flows-graph-svg .fg-node-out      { fill: #fff; stroke: var(--moss); stroke-width: 1.5; }
.flows-graph-svg .fg-node-internal { fill: var(--paper-dark); stroke: var(--ink-soft); }

/* Role tag (small UPPERCASE label inside the node) */
.flows-graph-svg .fg-tag {
  font-family: var(--mono, monospace);
  font-size: 9px;
  letter-spacing: 0.12em;
  font-weight: 600;
  pointer-events: none;
}
.flows-graph-svg .fg-tag-in       { fill: rgba(0,0,0,0.55); }
.flows-graph-svg .fg-tag-hub      { fill: rgba(255,255,255,0.65); }
.flows-graph-svg .fg-tag-out      { fill: var(--moss); }
.flows-graph-svg .fg-tag-internal { fill: var(--muted); }

/* Country (main label) */
.flows-graph-svg .fg-label {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  fill: var(--ink);
  pointer-events: none;
}
.flows-graph-svg .fg-label-on-dark { fill: #fff; }

/* City (sub-label) */
.flows-graph-svg .fg-sub {
  font-family: var(--sans);
  font-size: 11px;
  fill: var(--muted);
  pointer-events: none;
}
.flows-graph-svg .fg-sub.fg-label-on-dark { fill: rgba(255,255,255,0.75); }

/* Edges */
.flows-graph-svg .fg-edge {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.flows-graph-svg .fg-edge-inbound  { stroke: #b8893a; }
.flows-graph-svg .fg-edge-outbound { stroke: #5d6d4e; }
.flows-graph-svg .fg-edge-internal { stroke: #5a554d; stroke-dasharray: 4 3; }

/* Edge labels — sit in the gap between columns with their own background */
.flows-graph-svg .fg-edge-label-bg {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 0.5;
}
.flows-graph-svg .fg-edge-label {
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: 0.06em;
  fill: var(--ink-soft);
  text-transform: uppercase;
  pointer-events: none;
}

.flows-graph-svg .fg-empty-text {
  font-family: var(--sans);
  font-size: 13px;
  fill: var(--muted);
}

/* Confirm screen reuses graph + adds profile column */
.confirm-layout {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}
@media (max-width: 900px) {
  .confirm-layout { grid-template-columns: 1fr; }
}
.confirm-profile-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 2px;
}
.confirm-profile-title {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
/* ============================================================
   AUTH SCREEN VARIANTS — confirm-pending, reset-perform, etc.
============================================================ */
/* Wider auth card for screens with longer copy (confirm-pending). */
.auth-card-wide { max-width: 560px; }

.auth-sub.muted { color: var(--muted); font-size: 13px; }

/* Style links inside auth-sub the same as auth-foot links */
.auth-sub a {
  color: var(--signal); font-weight: 500;
  text-decoration: none; border-bottom: 1px dotted currentColor;
}
.auth-sub a:hover { border-bottom-style: solid; }

.hidden { display: none !important; }

/* ============================================================
   PRICING PAGE
============================================================ */
.pricing-page { max-width: 1200px; margin: 0 auto; padding: 48px 32px; }
.pricing-title {
  font-family: var(--serif); font-size: 56px; font-weight: 600;
  margin: 8px 0 16px; letter-spacing: -.02em;
}
.pricing-sub {
  font-size: 17px; color: var(--ink-soft); max-width: 640px;
  margin: 0 0 48px;
}

/* Three-up plan grid for the pricing page (existing .plan-grid is two-up). */
.plan-grid-three {
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .plan-grid-three { grid-template-columns: 1fr; }
}

.plan-cadence {
  font-size: 12px; color: var(--muted);
  font-family: var(--mono); letter-spacing: .04em;
  margin-bottom: 20px;
}

/* "MOST POPULAR" badge that floats on the featured plan card */
.plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--signal); color: white;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; padding: 4px 12px;
  border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.plan-featured { position: relative; }

/* "(Q4)" suffix on coming-soon line items */
.plan-soon { color: var(--muted); }
.plan-soon span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  color: var(--gold);
  margin-left: 4px;
}

/* ============================================================
   PRICING FAQ
============================================================ */
.pricing-faq {
  margin-top: 64px;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px;
  border-top: 2px solid var(--ink); padding-top: 32px;
}
@media (max-width: 700px) {
  .pricing-faq { grid-template-columns: 1fr; gap: 24px; }
}
.faq-item h4 {
  font-family: var(--serif); font-size: 18px; font-weight: 600;
  margin: 0 0 8px;
}
.faq-item p {
  margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55;
}

/* ============================================================
   UPGRADE PAGE — fineprint
============================================================ */
.upgrade-fineprint {
  margin-top: 24px; text-align: center; font-size: 13px;
}
.upgrade-fineprint a { color: var(--signal); font-weight: 500; }