/* /cost ("What did it cost?"). Colors come from app.css's light/dark tokens. */
.h2 { font-size: 1.1rem; margin: 0 0 12px; }

.year-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.year-form .field { margin: 0; flex: 0 1 160px; }
.year-form .error { flex-basis: 100%; }

.result-title { font-size: clamp(1.4rem, 5vw, 1.8rem); letter-spacing: -.02em; margin: 8px 0 6px; }
.dollar { margin: 0 0 14px; color: var(--muted); }
.dollar b { color: var(--ink); }

.prices { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.prices th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 0 8px 8px 0; border-bottom: 1px solid var(--line); }
.prices td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prices tr:last-child td { border-bottom: 0; }
.prices th:nth-child(n+2), .prices td:nth-child(n+2) { text-align: right; white-space: nowrap; }
.prices td:first-child { width: 100%; }
.prices .what { font: inherit; font-weight: 600; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.prices .what:hover, .prices tr[data-item]:hover .what, .prices tr[data-rate]:hover .what { color: var(--accent); }
.prices .chart-hint::after { content: "▸"; display: inline-block; margin-left: 6px; font-size: .75em; color: var(--muted); transition: transform .15s; }
.prices .what[aria-expanded="true"] .chart-hint::after { transform: rotate(90deg); color: var(--accent); }
.prices tr[data-item], .prices tr[data-rate] { cursor: pointer; }
.table-hint { margin: 0 0 8px; }

/* the price-over-time chart under a row */
.prices .chart-row td { padding: 4px 0 16px; white-space: normal; text-align: left; }
.chart-title { font-weight: 600; margin: 0 0 6px; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart-wrap .grid line { stroke: var(--line); stroke-width: 1; }
.chart-wrap text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-wrap .ylab text { text-anchor: end; }
.chart-wrap .xlab text { text-anchor: middle; }
.chart-wrap .series path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-wrap .mark { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart-wrap .cross { stroke: var(--muted); stroke-width: 1; }
.chart-wrap .hover-dot { fill: var(--ink); stroke: var(--card); stroke-width: 2; }
.chart-wrap .hit { fill: transparent; cursor: crosshair; }
.chart-wrap .tip {
  position: absolute; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; white-space: nowrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: .85rem;
  box-shadow: 0 6px 16px -8px rgb(0 0 0 / .4); font-variant-numeric: tabular-nums;
}
.chart-wrap .tip span { display: block; color: var(--muted); font-size: .75rem; }
.chart-key { list-style: none; margin: 8px 0 0; padding: 0; font-size: .82rem; color: var(--muted); }
.chart-key li { margin: 0 0 3px; }
.chart-key svg { vertical-align: middle; margin-right: 6px; }
.chart-key line { stroke: var(--accent); stroke-width: 2; }
.chart-gaps { margin: 6px 0 0; font-size: .82rem; color: var(--muted); }
.chart-numbers { margin: 8px 0 0; font-size: .82rem; }
.chart-numbers summary { cursor: pointer; color: var(--muted); }
.chart-numbers p { margin: 6px 0 0; line-height: 1.6; font-variant-numeric: tabular-nums; }
.prices .unit { display: block; color: var(--muted); font-size: .85rem; }
.prices .then { font-weight: 700; font-size: 1.1rem; }
.prices .near, .prices .change { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.prices .now { color: var(--muted); }
.prices .worth { display: block; }
.prices .actual { display: block; font-size: .8rem; margin: 2px 0 0 auto; white-space: normal; max-width: 8.5em; }

.buys { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); border-radius: 0 8px 8px 0; }
#r-missing { margin: 12px 0 0; }

.cv-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.cv-row .field { margin: 0; }
.cv-answer { font-size: 1.15rem; margin: 14px 0 0; min-height: 1.5em; }
.cv-answer b { font-size: 1.4rem; }

.actions { margin: 0 0 24px; }
.about p:last-child { margin: 0; }

@media (max-width: 560px) {
  .prices th:nth-child(3), .prices td:nth-child(3) { padding-right: 0; }
  .prices .then { font-size: 1rem; }
}
