/* ── Matcha flavor tokens ─────────────────────────────────────────────────────── */
:root {
  --mt-bg:     #e4f5d8;
  --mt-border: #b0d890;
  --mt-text:   #385a20;
  --mt-mid:    #5a9030;
  --mt-dark:   #1e3010;
}

/* ── Hero ────────────────────────────────────────────────────────────────────── */
.app-hero {
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 1.5rem 1.1rem;
}
.app-hero--matcha {
  background: var(--mt-bg);
  border-bottom-color: var(--mt-border);
}
.app-hero__inner { margin: 0 auto; }
.app-hero__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--mt-text);
  letter-spacing: -.02em;
  margin: 0 0 .5rem;
  line-height: 1.2;
}
.app-hero__desc {
  font-size: .9rem;
  color: var(--color-text-secondary);
  max-width: 660px;
  line-height: 1.6;
  margin: 0 0 .85rem;
}
.app-hero__chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.hero-chip {
  display: inline-flex;
  align-items: center;
  padding: .22rem .65rem;
  font-size: .72rem;
  font-weight: 700;
  background: var(--color-surface);
  border: 1.5px solid var(--mt-border);
  border-radius: var(--radius-full);
  color: var(--mt-text);
  white-space: nowrap;
}

/* ── Layout ───────────────────────────────────────────────────────────────────── */
.app-wrap {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem 0 3rem;
}

.pane-in {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pane-out {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Cards ────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--radius-xl);
  padding: 1rem 1.125rem;
}

.card-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mt-text);
  margin: 0 0 .75rem;
}

/* ── Form fields ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: .7rem; }
.field:last-child { margin-bottom: 0; }

label.lbl {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: .28rem;
}

select.sel,
input.num-in {
  width: 100%;
  box-sizing: border-box;
  padding: .4rem .6rem;
  font-size: .85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text-primary);
  transition: border-color .15s;
}
select.sel:focus,
input.num-in:focus { outline: none; border-color: var(--mt-mid); }

.input-row {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.input-row input { flex: 1; }
.input-row span { font-size: .8rem; color: var(--color-text-muted); white-space: nowrap; }

.input-error {
  font-size: .76rem;
  color: var(--color-danger);
  margin-top: .35rem;
  padding: .3rem .5rem;
  background: var(--color-danger-subtle);
  border-radius: var(--radius-md);
}

/* Calc button */
.btn-calc {
  width: 100%;
  padding: .55rem 1rem;
  font-size: .9rem;
  font-weight: 700;
  background: var(--mt-text);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity .15s;
  margin-top: .25rem;
}
.btn-calc:hover { opacity: .85; }

/* IRA note */
.ira-note {
  font-size: .72rem;
  color: var(--mt-text);
  background: var(--mt-bg);
  border: 1px solid var(--mt-border);
  border-radius: var(--radius-md);
  padding: .35rem .6rem;
  margin-top: .4rem;
  line-height: 1.5;
}

/* ── Break-even hero stat ─────────────────────────────────────────────────────── */
.break-even-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: 1.5rem 1rem 1.25rem;
}

.break-even-num {
  font-size: 3rem;
  font-weight: 800;
  color: var(--mt-dark);
  line-height: 1;
}

.break-even-sub {
  font-size: .8rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ── Summary stats grid ───────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
}

.stat-cell {
  background: var(--mt-bg);
  border: 1px solid var(--mt-border);
  border-radius: var(--radius-md);
  padding: .6rem .75rem;
}
.stat-cell.full { grid-column: span 2; }

.stat-lbl {
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  margin-bottom: .2rem;
}

.stat-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--mt-dark);
  line-height: 1;
}

.stat-sub {
  font-size: .65rem;
  color: var(--color-text-muted);
  margin-top: .1rem;
}

/* ── Cost comparison ──────────────────────────────────────────────────────────── */
.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem .1rem;
  border-bottom: 1px dashed var(--color-border);
  font-size: .85rem;
}
.cost-row:last-child { border-bottom: none; }
.cost-row__lbl { color: var(--color-text-secondary); }
.cost-row__val { font-weight: 700; color: var(--mt-dark); }
.cost-row.total { font-weight: 800; border-top: 1.5px solid var(--mt-border); border-bottom: none; color: var(--mt-text); }

/* ── Chart ────────────────────────────────────────────────────────────────────── */
.chart-wrap {
  overflow-x: auto;
}

.chart-wrap svg {
  display: block;
  min-width: 300px;
  width: 100%;
  height: auto;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .5rem;
  font-size: .72rem;
  color: var(--color-text-muted);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: .3rem;
  vertical-align: middle;
}

/* ── Responsive ───────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .app-wrap { flex-direction: column; }
  .pane-in { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
