/* Clariveo — "Spatial" design system.
   Depth is probability: the more likely an option, the further forward it sits.
   Frosted surfaces float over a live particle field; one blue accent carries
   the point of clarity. Palette: beam (accent) / clear (committed) / haze (alt). */

:root {
  /* Surfaces — translucent so the field reads through them (see --glass). */
  --bg:        #070a10;
  --bg-2:      #0a1018;   /* upper pole of the ground gradient */
  --surface-1: rgba(16,24,38,0.72);   /* header, timeline, footer */
  --surface-2: rgba(18,27,42,0.66);   /* panels, inputs */
  --card:      rgba(30,45,68,0.55);   /* cards, elevated */
  --card-hi:   rgba(38,56,84,0.72);   /* card hover */
  --line:      rgba(130,170,220,0.18);
  --line-soft: rgba(130,170,220,0.10);

  /* Glass: surfaces are frosted, not opaque. */
  --glass: saturate(140%) blur(14px);

  /* Text */
  --text:   #eef3fb;
  --text-2: #9fb0c4;      /* secondary */
  --muted:  #5d6d82;      /* tertiary / captions */

  /* Semantic — Clariveo: beam / clear / haze */
  --lived:   #46d6a4;     /* "clear" — committed / resolved route */
  --route:   var(--lived);  /* alias used by the brand mark */
  --whatif:  #e9a94f;     /* "haze" — simulated / road not taken */
  --branch:  var(--whatif); /* alias used by the brand mark */
  --accent:  #6ea8ff;     /* "beam" — the point of clarity / primary action */
  --accent-ink: #071019;  /* text on accent */
  --glow:    rgba(110,168,255,0.5);   /* forward-most elevation */
  --danger:  #f2708a;

  /* Type scale */
  --fs-h1: 20px;
  --fs-h2: 19px;
  --fs-body: 14px;
  --fs-sm: 13px;
  --fs-xs: 11.5px;

  /* Rhythm */
  --sp: 8px;
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 18px 50px -18px rgba(0,0,0,0.7);
  --focus: 0 0 0 3px rgba(110,168,255,0.38);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: radial-gradient(120% 80% at 50% -10%, var(--bg-2), var(--bg)) fixed;
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* The living field — drifts behind every surface. Painted by app.js. */
#field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
/* Everything else rides above the field. */
body > header,
body > section,
body > footer,
body > #mode-overlay { position: relative; z-index: 1; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
button {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--r-sm);
  padding: 9px 16px;
  font-size: var(--fs-body);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s, border-color 0.15s, transform 0.08s;
}
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: var(--focus); }
button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
button.secondary:hover { background: rgba(255,255,255,0.04); filter: none; border-color: var(--text-2); }
button:disabled { opacity: 0.45; cursor: default; filter: none; transform: none; }

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  padding: 18px 32px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 16px;
  background: var(--surface-1);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--line);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-mark { flex: 0 0 auto; }
.brand h1 {
  margin: 0;
  font-size: var(--fs-h1);
  font-weight: 800;
  letter-spacing: -0.2px;
}
.brand h1 .brand-veo { color: var(--accent); }
.tagline { margin: 4px 0 0; color: var(--text-2); font-size: var(--fs-sm); }

#toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
button.tool { padding: 7px 12px; font-size: var(--fs-xs); border-radius: var(--r-sm); }
button.tool.secondary { background: transparent; color: var(--text-2); border: 1px solid var(--line); }
button.tool.secondary:hover { color: var(--text); }

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(180deg, rgba(110,168,255,0.16), rgba(110,168,255,0.09));
  color: var(--accent);
  border: 1px solid rgba(110,168,255,0.4);
  border-radius: var(--r-pill);
  padding: 7px 14px;
  font-size: var(--fs-sm);
  font-weight: 700;
}
.mode-chip:hover { filter: brightness(1.12); }
.mode-chip .chevron { font-size: 9px; opacity: 0.75; }

@media (max-width: 620px) {
  header { grid-template-columns: 1fr; row-gap: 12px; }
  #toolbar { justify-content: flex-start; }
}

/* ── Timeline (numbered stages) ──────────────────────────────────────────── */
#timeline-wrap {
  padding: 16px 32px 18px;
  background: var(--surface-1);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--line);
}
#timeline { display: flex; flex-direction: column; gap: 12px; }

.rail {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
}
.rail .connector {
  flex: 0 0 auto;
  width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--lived), rgba(70,214,164,0.35));
  border-radius: 2px;
}
.dot {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  background: rgba(70,214,164,0.14);
  color: var(--lived);
  border: 1.5px solid var(--lived);
  transition: transform 0.1s, box-shadow 0.15s;
}
.dot:hover { transform: scale(1.08); }
.dot.current {
  background: var(--lived);
  color: var(--accent-ink);
  box-shadow: 0 0 0 4px rgba(70,214,164,0.18);
}
.dot.viewing:not(.current) {
  box-shadow: 0 0 0 3px rgba(110,168,255,0.4);
  border-color: var(--accent);
  color: var(--accent);
}

.rail-current {
  font-size: var(--fs-body);
  color: var(--text);
  line-height: 1.45;
  max-width: 900px;
}
.rail-current .rail-kicker {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--lived);
  background: rgba(70,214,164,0.12);
  border-radius: var(--r-sm);
  padding: 2px 8px;
  margin-right: 10px;
  vertical-align: 1px;
}

/* ── Panel ───────────────────────────────────────────────────────────────── */
#panel { flex: 1; padding: 26px 32px 56px; max-width: 1240px; width: 100%; }
.moment-header { margin-bottom: 18px; }
.moment-header .kicker {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 700;
}
.moment-header.whatif-mode .kicker { color: var(--whatif); }
.moment-header h2 {
  margin: 6px 0 0;
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.35;
  max-width: 900px;
}

/* Inputs */
.situation-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 68px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.situation-input::placeholder { color: var(--muted); }
.situation-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.situation-input.small { min-height: 46px; font-size: var(--fs-body); }
.row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* Starting scaffold */
.examples { margin-bottom: 18px; }
.examples-label { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 9px; }
.example-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: rgba(110,168,255,0.1);
  color: var(--accent);
  border: 1px solid rgba(110,168,255,0.3);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.chip:hover { background: rgba(110,168,255,0.2); filter: none; }

.guided { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: var(--fs-xs); color: var(--text-2); font-weight: 700; letter-spacing: 0.3px; }

.input-tip {
  margin-top: 14px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.55;
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 12px;
}

/* ── Outcome cards ───────────────────────────────────────────────────────── */
.paths {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.path-card {
  position: relative;
  background: var(--card);
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Elevation falls away with depth — the main carrier of the Z-axis. */
  box-shadow:
    0 calc(22px - 16px * var(--depth)) calc(60px - 40px * var(--depth))
      calc(-20px + 6px * var(--depth)) rgba(0,0,0,calc(0.55 - 0.3 * var(--depth)));
  /* Depth is probability. --depth (0 = most likely, 1 = least) is set per card
     by app.js; less likely options sit further back — but every option stays
     fully readable. Depth is carried by elevation and border, not by fading
     text into the background: the point of the app is seeing options clearly. */
  --depth: 0;
  transform: scale(calc(1 - 0.022 * var(--depth)));
  opacity: calc(1 - 0.12 * var(--depth));
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s,
              background 0.18s, opacity 0.18s;
}
/* The forward-most option carries the glow — it's the one to look at first. */
.path-card.foremost {
  box-shadow: 0 30px 80px -20px var(--glow), 0 0 0 1px var(--line);
  border-color: rgba(110,168,255,0.34);
}
.path-card:hover {
  border-color: rgba(110,168,255,0.55);
  background: var(--card-hi);
  /* Hovering brings a card fully forward, whatever its depth. */
  transform: scale(1) translateY(-3px);
  opacity: 1;
  box-shadow: var(--shadow-2);
}

/* Probability meter across the top of each card — width encodes likelihood. */
.prob-meter {
  position: absolute;
  top: 0; left: 0;
  height: 4px;
  border-radius: 0 4px 4px 0;
}
.prob-meter.high { background: var(--lived); }
.prob-meter.mid  { background: var(--accent); }
.prob-meter.low  { background: var(--whatif); }

.path-card .title { font-weight: 700; font-size: 15.5px; margin: 4px 0 8px; line-height: 1.3; }
.path-card .summary { font-size: var(--fs-body); color: var(--text-2); margin-bottom: 12px; line-height: 1.5; }
.path-card .rationale {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
  padding-left: 10px;
  border-left: 2px solid var(--line);
  margin-top: auto;
}

.prob {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  align-self: flex-start;
}
.prob.high { background: rgba(70,214,164,0.16); color: var(--lived); }
.prob.mid  { background: rgba(110,168,255,0.16); color: var(--accent); }
.prob.low  { background: rgba(233,169,79,0.16); color: var(--whatif); }

#panel.whatif .path-card { border-style: dashed; }

.whatif-banner {
  background: linear-gradient(180deg, rgba(233,169,79,0.12), rgba(233,169,79,0.06));
  border: 1px solid rgba(233,169,79,0.4);
  color: var(--whatif);
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.5;
  margin-bottom: 18px;
}
.risk-banner {
  background: linear-gradient(180deg, rgba(233,169,79,0.12), rgba(233,169,79,0.05));
  border: 1px solid rgba(233,169,79,0.45);
  color: var(--whatif);
  padding: 11px 15px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.55;
  margin-bottom: 18px;
}

.empty { color: var(--muted); font-size: var(--fs-body); margin-top: 20px; }
.spinner { color: var(--accent); font-size: var(--fs-body); margin-top: 20px; display: flex; align-items: center; gap: 10px; }
.spinner::before {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(110,168,255,0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
button.mini { padding: 8px 10px; font-size: var(--fs-sm); border-radius: var(--r-sm); flex: 1; }
button.mini.secondary { background: transparent; color: var(--text-2); border: 1px solid var(--line); }
button.mini.secondary:hover { color: var(--text); }

/* ── Compare view ────────────────────────────────────────────────────────── */
.compare-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.compare-title { font-size: var(--fs-h2); font-weight: 800; color: var(--whatif); }
.diverge-note { color: var(--text-2); font-size: var(--fs-body); margin-bottom: 22px; }

.tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .tracks { grid-template-columns: 1fr; } }

.track {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  background: var(--surface-2);
  box-shadow: var(--shadow-1);
}
.track.lived  { border-top: 3px solid var(--lived); }
.track.whatif { border-top: 3px solid var(--whatif); border-left: 1px dashed var(--line); border-right: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.track.lived.projected { border-style: solid; border-top-style: dashed; }
.track.lived.projected .track-head::after {
  content: ' · projected';
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.track-head { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; font-weight: 800; }
.track.lived  .track-head { color: var(--lived); }
.track.whatif .track-head { color: var(--whatif); }

.track-step { display: flex; gap: 13px; padding: 9px 0; position: relative; }
.track-step:not(:last-child) .track-dot::after {
  content: '';
  position: absolute;
  left: 5px; top: 16px; bottom: -9px;
  width: 2px; background: var(--line);
}
.track-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; margin-top: 4px; position: relative; }
.track.lived  .track-dot { background: var(--lived); }
.track.whatif .track-dot { background: var(--whatif); }
.track-body { font-size: var(--fs-body); }
.track-label { line-height: 1.45; }
.track-body .prob { margin-top: 7px; }

.epilogue {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: var(--fs-sm);
  font-style: italic;
  color: var(--text-2);
  line-height: 1.55;
}
.epilogue .cum { font-style: normal; font-weight: 800; color: var(--whatif); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  padding: 10px 32px;
  background: var(--surface-1);
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--text-2);
  min-height: 34px;
  display: flex;
  align-items: center;
}

/* ── Mode-picker overlay ─────────────────────────────────────────────────── */
#mode-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,6,10,0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
#mode-overlay.hidden { display: none; }
#mode-modal {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px;
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2);
}
#mode-modal h2 { margin: 0 0 5px; font-size: 23px; font-weight: 800; }
.mode-sub { margin: 0 0 22px; color: var(--text-2); font-size: var(--fs-body); }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  color: var(--text);
  transition: border-color 0.15s, transform 0.1s, background 0.15s, box-shadow 0.15s;
}
.mode-card:hover { border-color: rgba(110,168,255,0.5); transform: translateY(-3px); background: var(--card-hi); box-shadow: var(--shadow-2); filter: none; }
.mode-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mode-icon { font-size: 30px; line-height: 1; }
.mode-name { font-size: 16px; font-weight: 700; }
.mode-tagline { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.45; }
.risk-badge {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--whatif);
  background: rgba(233,169,79,0.14);
  border: 1px solid rgba(233,169,79,0.4);
  border-radius: var(--r-sm);
  padding: 3px 8px;
}

/* ── Per-stage context refinement ───────────────────────────────────────── */
.context-panel { margin-bottom: 16px; }
.context-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.context-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-2);
}
.context-item.data { border-left-color: var(--whatif); }
.context-text { flex: 1; word-break: break-word; }
.context-del {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 0 2px;
  font-size: 13px;
  flex: 0 0 auto;
  line-height: 1;
}
.context-del:hover { color: var(--danger); filter: none; }

.context-actions { display: flex; gap: 8px; flex-wrap: wrap; }
button.chip-btn {
  padding: 7px 13px;
  font-size: var(--fs-sm);
  border-radius: var(--r-pill);
  font-weight: 600;
}

/* Attachments — transient image/PDF evidence thumbnails. */
.attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 10px 6px 6px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  max-width: 100%;
}
.attach-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--r-sm);
  flex: 0 0 auto;
  background: var(--surface);
}
.attach-doc { font-size: 24px; width: 40px; text-align: center; flex: 0 0 auto; }
.attach-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.attach-note {
  margin-top: 8px;
  font-size: var(--fs-xs, 12px);
  color: var(--muted);
  line-height: 1.4;
}

.context-input-box {
  margin: 8px 0 16px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

/* ── Mobile & PWA (phone-first polish) ──────────────────────────────────── */
/* Safe-area insets for notched phones in standalone (installed) mode. */
@media (display-mode: standalone) {
  header { padding-top: calc(18px + env(safe-area-inset-top)); }
  footer { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  /* Tighter gutters so content isn't crushed. */
  header, #timeline-wrap, footer { padding-left: 16px; padding-right: 16px; }
  #panel { padding: 20px 16px 48px; }

  /* Header stacks; toolbar wraps and scrolls if needed. */
  header { grid-template-columns: 1fr; row-gap: 12px; }
  #toolbar { justify-content: flex-start; }

  /* One column of cards on a phone. */
  .paths { grid-template-columns: 1fr; gap: 12px; }
  .tracks { grid-template-columns: 1fr; }

  /* Headlines calmer on small screens. */
  .moment-header h2 { font-size: 17px; }
  h1, .brand h1 { font-size: 19px; }

  /* Mode grid: single column on phones so cards never overflow the modal. */
  .mode-grid { grid-template-columns: 1fr; }
  #mode-overlay { padding: 12px; align-items: flex-start; }
  #mode-modal { padding: 20px 16px; border-radius: 16px; max-height: calc(100vh - 24px); }

  /* Buttons: full-width primary actions read better and are easier to tap. */
  .row { gap: 8px; }
  .card-actions { flex-wrap: wrap; }
}

/* Let grid/flex children shrink below their content width instead of overflowing. */
.mode-card, .path-card, .track { min-width: 0; }
.mode-name, .path-card .title { overflow-wrap: anywhere; }

/* Touch targets: guarantee a comfortable minimum on coarse pointers. */
@media (pointer: coarse) {
  button, .chip, .mode-chip, .context-del { min-height: 40px; }
  button.mini { min-height: 40px; }
  .dot { width: 32px; height: 32px; }   /* easier to tap on the rail */
  .context-del { min-width: 40px; }
}

/* Never let the page scroll sideways on a phone. */
html, body { max-width: 100%; overflow-x: hidden; }

/* ── Reasoning tier (History / Foresight) — analytical, calm blue ────────── */
.reasoning-banner {
  background: linear-gradient(180deg, rgba(110,168,255,0.12), rgba(110,168,255,0.05));
  border: 1px solid rgba(110,168,255,0.4);
  color: var(--accent);
  padding: 11px 15px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.55;
  margin-bottom: 18px;
}
.reasoning-badge {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  background: rgba(110,168,255,0.14);
  border: 1px solid rgba(110,168,255,0.4);
  border-radius: var(--r-sm);
  padding: 3px 8px;
}

/* ── Closed-loop: outcome recorder + track record ───────────────────────── */
.outcome-recorder {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.outcome-q { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.outcome-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.outcome-btn { background: transparent; border: 1px solid var(--line); color: var(--text); font-size: var(--fs-sm); }
.outcome-btn.well:hover   { border-color: var(--lived);  color: var(--lived);  background: rgba(70,214,164,0.08); filter: none; }
.outcome-btn.mixed:hover  { border-color: var(--accent); color: var(--accent); background: rgba(110,168,255,0.08); filter: none; }
.outcome-btn.poorly:hover { border-color: var(--danger); color: var(--danger); background: rgba(242,112,138,0.08); filter: none; }

.outcome-result { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.outcome-tag { font-weight: 700; font-size: var(--fs-body); }
.outcome-result.well   .outcome-tag { color: var(--lived); }
.outcome-result.mixed  .outcome-tag { color: var(--accent); }
.outcome-result.poorly .outcome-tag { color: var(--danger); }
.outcome-vs { font-family: ui-monospace, monospace; font-size: var(--fs-xs); color: var(--muted); }
.outcome-note { font-size: var(--fs-sm); color: var(--text-2); font-style: italic; margin: 4px 0 10px; }

/* Timeline dot outcome tint */
.dot.resolved-well   { border-color: var(--lived); }
.dot.resolved-mixed  { border-color: var(--accent); }
.dot.resolved-poorly { border-color: var(--danger); }
.dot.resolved-poorly:not(.current) { color: var(--danger); background: rgba(242,112,138,0.12); }

/* Track record modal */
.tr-headline { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.tr-stat { display: flex; flex-direction: column; }
.tr-num { font-size: 26px; font-weight: 800; line-height: 1; }
.tr-lbl { font-size: var(--fs-xs); color: var(--muted); margin-top: 3px; }
.tr-verdict { margin-left: auto; font-weight: 700; font-size: var(--fs-sm); padding: 6px 12px; border-radius: var(--r-pill); }
.tr-verdict.good  { color: var(--lived);  background: rgba(70,214,164,0.14); }
.tr-verdict.over  { color: var(--whatif); background: rgba(233,169,79,0.14); }
.tr-verdict.under { color: var(--accent); background: rgba(110,168,255,0.14); }
.tr-verdict.none  { color: var(--muted);  background: rgba(255,255,255,0.04); }

.tr-modes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.tr-mode-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.tr-mode-name { font-weight: 600; font-size: var(--fs-sm); }
.tr-mode-n { font-family: ui-monospace, monospace; font-size: var(--fs-xs); color: var(--muted); }
.tr-mode-verdict { margin-left: auto; font-size: var(--fs-xs); font-weight: 700; }
.tr-mode-verdict.good { color: var(--lived); } .tr-mode-verdict.over { color: var(--whatif); }
.tr-mode-verdict.under { color: var(--accent); } .tr-mode-verdict.none { color: var(--muted); }

.tr-items { display: flex; flex-direction: column; gap: 6px; }
.tr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); font-size: var(--fs-sm); }
.tr-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.tr-item.well   .tr-dot { background: var(--lived); }
.tr-item.mixed  .tr-dot { background: var(--accent); }
.tr-item.poorly .tr-dot { background: var(--danger); }
.tr-text { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-pred { font-family: ui-monospace, monospace; font-size: var(--fs-xs); color: var(--muted); }
.tr-res { font-size: var(--fs-xs); font-weight: 700; }
.tr-item.well .tr-res { color: var(--lived); } .tr-item.mixed .tr-res { color: var(--accent); } .tr-item.poorly .tr-res { color: var(--danger); }
