/* Clearflow "Try the planning model" demo — matches styles.css tokens. */

.demo-hero-grid { max-width: 860px; }

.demo-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 12px;
}

.demo-presets button {
  font: inherit;
  font-weight: 680;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.demo-presets button:hover { border-color: var(--teal); }

.demo-presets button.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.demo-preset-note {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 60ch;
  margin: 0;
}

/* ---------- layout ---------- */

.demo-grid {
  display: grid;
  grid-template-columns: minmax(330px, 5fr) 7fr;
  gap: 22px;
  align-items: start;
}

.demo-results {
  display: grid;
  gap: 22px;
}

.demo-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 18px 50px rgba(11, 24, 20, 0.08);
}

.demo-panel h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.demo-panel-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.demo-panel-dark .demo-note { color: rgba(255, 255, 255, 0.66); }

.demo-eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}

.demo-panel-dark .demo-eyebrow { color: var(--teal-bright); }

.demo-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 16px;
  max-width: 62ch;
}

/* ---------- inputs ---------- */

.demo-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.demo-field-label {
  font-size: 0.82rem;
  font-weight: 700;
}

.demo-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.demo-panel input[type="number"],
.demo-panel input[type="text"],
.demo-panel input[type="date"] {
  font: inherit;
  font-size: 0.95rem;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  min-width: 0;
}

.demo-panel input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}

.demo-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 8px;
}

.demo-subhead h3 {
  margin: 0;
  font-size: 1rem;
}

.demo-add {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  white-space: nowrap;
}

.demo-add:hover { border-color: var(--teal); }

.demo-list { display: grid; gap: 8px; }

.demo-row {
  display: grid;
  grid-template-columns: 1fr 104px 58px 30px;
  gap: 8px;
  align-items: center;
}

.demo-row-debt { grid-template-columns: 1fr 92px 64px 64px 52px 30px; }

.demo-row-head {
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.demo-row-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.demo-remove {
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.demo-remove:hover {
  color: var(--coral);
  border-color: var(--line);
}

/* ---------- safe to spend ---------- */

.demo-big {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 780;
  letter-spacing: -0.03em;
  color: var(--teal-bright);
}

.demo-big.is-negative { color: var(--coral); }

.demo-bars { display: grid; gap: 10px; margin: 18px 0 14px; }

.demo-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 76px;
  gap: 12px;
  align-items: center;
  font-size: 0.86rem;
}

.demo-bar-label { color: rgba(255, 255, 255, 0.78); }
.demo-bar-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.demo-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.demo-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 240ms ease;
}

.bar-bills { background: var(--sky); }
.bar-debt { background: var(--coral); }
.bar-savings { background: var(--yellow); }
.bar-buffer { background: rgba(255, 255, 255, 0.45); }
.bar-safe { background: var(--teal-bright); }

/* ---------- timeline ---------- */

.demo-timeline {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 0;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.demo-event {
  display: grid;
  grid-template-columns: 74px 1fr auto auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--line);
}

.demo-event:last-child { border-bottom: 0; }

.demo-event-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-event-label { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-event-amount { font-variant-numeric: tabular-nums; font-weight: 700; }
.demo-event-amount.is-in { color: var(--teal); }
.demo-event-amount.is-out { color: var(--ink); }
.demo-event-running { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 76px; text-align: right; }

.demo-event.flag-tight { background: rgba(255, 204, 102, 0.12); }
.demo-event.flag-shortfall { background: rgba(255, 112, 88, 0.1); }

.demo-flag {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--coral);
}

.demo-event.flag-tight .demo-flag { color: #a86e00; }

/* ---------- debt what-if ---------- */

.demo-debt-controls { margin-bottom: 18px; max-width: 340px; }

.demo-strategy-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.demo-strategy {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: var(--paper);
  position: relative;
}

.demo-strategy.is-best {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}

.demo-strategy-name { margin: 0; font-size: 1.02rem; font-weight: 760; }
.demo-strategy-hint { margin: 2px 0 12px; font-size: 0.82rem; color: var(--muted); }
.demo-strategy-date { margin: 0; font-size: 1.15rem; font-weight: 760; letter-spacing: -0.01em; }
.demo-strategy-interest { margin: 4px 0; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-strategy-saved { margin: 8px 0 0; font-size: 0.86rem; font-weight: 700; color: var(--teal); }
.demo-strategy-stuck { margin: 0; font-size: 0.88rem; color: var(--coral); font-weight: 620; }

.demo-best-tag {
  position: absolute;
  top: -11px;
  right: 12px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--teal);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------- math section ---------- */

.demo-math-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 26px 0;
}

.demo-math-grid article {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.demo-math-grid h3 { margin: 0 0 8px; font-size: 1rem; }
.demo-math-grid p { margin: 0; font-size: 0.9rem; color: rgba(255, 255, 255, 0.72); }

.demo-fineprint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  max-width: 72ch;
  margin: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .demo-grid { grid-template-columns: 1fr; }
  .demo-strategy-cards { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .demo-panel { padding: 18px; }
  .demo-row { grid-template-columns: 1fr 88px 52px 30px; }
  .demo-row-debt { grid-template-columns: 1fr 1fr; }
  .demo-row-debt .demo-remove { grid-column: 2; justify-self: end; }
  .demo-row-head.demo-row-debt { display: none; }
  .demo-event { grid-template-columns: 64px 1fr auto; }
  .demo-event-running { display: none; }
  .demo-bar-row { grid-template-columns: 92px 1fr 68px; }
}
