/* Easy Money -- warm paper, one card, rationed color. */

:root {
  --paper: #FAF8F4;
  --card: #FFFFFF;
  --ink: #1F2421;
  --ink-2: #5C635E;
  --ink-3: #8A8F8A;
  --line: #E7E3DA;
  --accent: #2F6F5E;
  --accent-tint: #EAF2EF;
  --amber: #C88A3A;
  --clay: #B0503F;
  --radius: 12px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  font-feature-settings: "tnum";
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 16px 80px;
}
main.wide { max-width: 1220px; }

/* Result: two panes on desktop, answer stays in view while you play */
.result-grid { display: grid; gap: 8px; }
@media (min-width: 1040px) {
  .result-grid {
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: 0 60px;
    align-items: start;
  }
  .result-grid .answer {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 20px;
  }
  .result-grid .controls { grid-column: 1; grid-row: 1; }
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 44px 48px;
  box-shadow: 0 1px 2px rgba(31, 36, 33, 0.05), 0 12px 40px rgba(31, 36, 33, 0.07);
}

@media (max-width: 560px) {
  main { padding: 16px 10px 60px; }
  .card { padding: 30px 22px; }
}

.serif {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 550;
  line-height: 1.14;
  letter-spacing: -0.01em;
}

h1.serif { font-size: clamp(1.9rem, 5.5vw, 2.7rem); margin: 0 0 14px; }
h2.serif { font-size: clamp(1.35rem, 4vw, 1.7rem); margin: 0 0 10px; }

.sub { color: var(--ink-2); margin: 0 0 26px; }
.quiet { color: var(--ink-3); font-size: 14.5px; margin-top: 18px; }
.small { font-size: 15px; color: var(--ink-2); }

.verdict-ok { color: var(--accent); }
.verdict-close { color: var(--amber); }
.verdict-short { color: var(--clay); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 26px;
  font: 600 17px "Inter", sans-serif;
  cursor: pointer;
}
.btn:hover { background: #285e50; }
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: var(--accent-tint); }

.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Inputs */
label.field { display: block; margin: 20px 0 6px; font-weight: 600; font-size: 16px; }
input[type="number"], input[type="text"], select {
  width: 100%;
  max-width: 320px;
  font: 400 20px "Inter", sans-serif;
  color: var(--ink);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

.money { position: relative; max-width: 320px; }
.money::before {
  content: "$";
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-size: 20px;
}
.money input { padding-left: 32px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  font: 500 15.5px "Inter", sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--accent); }
.chip.on {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: #235446;
  font-weight: 600;
}

/* Big option rows (paychecks step) */
.opt {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 10px 0;
  font: 500 17px "Inter", sans-serif;
  color: var(--ink);
  cursor: pointer;
}
.opt.on { border-color: var(--accent); background: var(--accent-tint); }
.opt .small { display: block; margin-top: 2px; }

/* Progress */
.progress { height: 3px; background: var(--line); border-radius: 2px; margin-bottom: 34px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s ease; }

.nav { display: flex; align-items: center; justify-content: space-between; margin-top: 34px; }

/* Levers */
.lever {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 12px 0;
}
.lever .lv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lever .lv-val { font-weight: 650; font-size: 19px; white-space: nowrap; }
.lever .lv-val input {
  width: 92px;
  font: 650 18px "Inter", sans-serif;
  color: var(--ink);
  text-align: right;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 8px;
}
.lever .lv-val input:focus { outline: none; border-color: var(--accent); }
.lever .lv-hint { font-size: 15px; color: var(--ink-2); margin-top: 8px; }
.lever .lv-hint b { color: var(--accent); font-weight: 600; }

input[type="range"] {
  width: 100%;
  margin: 14px 0 2px;
  accent-color: var(--accent);
  height: 22px;
}

/* Scenario area */
.what-ifs { margin-top: 36px; }
.follow {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 10px 0 4px;
}
.follow .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.follow .row span.lab { font-size: 15px; color: var(--ink-2); min-width: 90px; }
.follow input[type="number"], .follow input[type="text"], .follow select {
  font-size: 15px;
  padding: 8px 10px;
  max-width: 180px;
}
.follow .money { max-width: 180px; }
.follow .money::before { font-size: 15px; left: 10px; }
.follow .money input { padding-left: 26px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink);
}
.stepper b { min-width: 70px; text-align: center; font-weight: 600; font-size: 15.5px; }

.baseline-note {
  font-size: 15px;
  color: var(--ink-2);
  margin: 12px 0 0;
}

/* Chart */
.chart-wrap { margin-top: 38px; }
canvas#chart { width: 100%; height: 260px; display: block; }
.chart-cap { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }

/* Drawers */
details {
  border-top: 1px solid var(--line);
  padding: 4px 0;
  margin-top: 6px;
}
details:first-of-type { margin-top: 40px; }
summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  font-size: 16.5px;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--ink-3); font-size: 20px; font-weight: 400; }
details[open] summary::after { content: "\2212"; }
details .d-body { padding: 2px 0 22px; }
details .d-body p { margin: 8px 0; }

.stat-list { margin: 12px 0; padding: 0; list-style: none; }
.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15.5px;
}
.stat-list li b { font-weight: 600; text-align: right; }

.budget-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.budget-row span { flex: 1; font-size: 15.5px; }
.budget-row .money { max-width: 150px; }
.budget-row .money input { font-size: 16px; padding: 8px 10px 8px 28px; }

.asm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
@media (max-width: 560px) { .asm-grid { grid-template-columns: 1fr; } }
.asm-grid label.field { margin-top: 12px; }
.asm-grid input, .asm-grid select { font-size: 16px; padding: 9px 12px; max-width: 100%; }
.asm-grid .money { max-width: 100%; }
.asm-grid .money input { padding-left: 30px; }

/* Year-by-year table */
.yr-scroll {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.yr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-feature-settings: "tnum";
}
.yr-table th {
  position: sticky;
  top: 0;
  background: #fff;
  color: var(--ink-3);
  font-weight: 600;
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.yr-table td {
  text-align: right;
  padding: 5px 10px;
  border-bottom: 1px solid #F4F1EA;
  color: var(--ink-2);
  white-space: nowrap;
}
.yr-table th:first-child, .yr-table td:first-child { text-align: left; color: var(--ink); font-weight: 500; }
.yr-table td:last-child { color: var(--ink); font-weight: 600; }
.yr-table tr.hl td { background: var(--accent-tint); }

/* Footer */
.foot {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.foot .actions { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.toast { color: var(--accent); font-size: 14.5px; margin-left: 4px; }

/* Quiz */
.quiz-q { margin: 22px 0 6px; font-weight: 600; font-size: 16.5px; }
