/* Starter app styles. Rule of the house: this file never names a colour or a font.
   It only uses the eleven tokens from theme.css (plus --ok / --warn / --bad when a theme has them). */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font-body);
}
a { color: var(--accent); text-underline-offset: 3px; }
code { font-family: var(--font-mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--surface-ink, var(--ink));
}
.brand { font: 400 24px/1 var(--font-display); color: inherit; text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 18px; flex: 1 1 auto; }
.top nav a { color: inherit; text-decoration: none; padding: 8px 0; opacity: .75; }
.top nav a[aria-current] { opacity: 1; box-shadow: inset 0 -2px 0 var(--accent); }
.pick { font-size: 13px; display: flex; align-items: center; gap: 8px; }

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.intro, .totals { grid-column: 1 / -1; }
.eyebrow { font: 12px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
h1 { font: 400 clamp(32px, 6vw, 56px)/1.02 var(--font-display); letter-spacing: -.01em; margin: 8px 0 12px; max-width: 16ch; }
h2 { font: 400 24px/1.1 var(--font-display); margin: 0 0 12px; }
.lede { max-width: 58ch; margin: 0 0 16px; }

.btn, input, textarea, select {
  font: inherit;
  color: var(--surface-ink, var(--ink));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.btn { min-height: 44px; padding: 0 18px; font-weight: 600; cursor: pointer; margin: 0 8px 8px 0; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
input, textarea, select { width: 100%; padding: 10px 12px; min-height: 44px; }
.pick select { width: auto; min-height: 36px; padding: 4px 8px; max-width: 46vw; }

.panel {
  background: var(--surface);
  color: var(--surface-ink, var(--ink));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 10px 10px 0; border-top: 1px solid var(--line); font-weight: 400; }
thead th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; border-top: 0; }
tbody th, .num { font-family: var(--font-mono); font-size: 14px; }
.num { text-align: right; padding-right: 0; }
.state { display: inline-block; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.state.ok { border-color: var(--ok, var(--line)); }
.state.warn { border-color: var(--warn, var(--line)); }
.state.bad { border-color: var(--bad, var(--accent)); }

form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 14px; }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: 18px; min-height: 18px; accent-color: var(--accent); }

.totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.totals div { padding: 14px 16px 0 0; border-right: 1px solid var(--line); }
.totals div + div { padding-left: 16px; }
.totals div:last-child { border-right: 0; }
.totals span { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.totals b { font: 400 clamp(22px, 5vw, 34px)/1.2 var(--font-mono); overflow-wrap: anywhere; }
.foot { border-top: 1px solid var(--line); padding: 18px 20px 32px; font-size: 13px; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  table { font-size: 14px; }
}
