/* Shared base for every bonus app. A theme (apps/<slug>/theme.css) sets the variables in
   :root and may override layout details. Layouts: body.layout-split | -stacked | -card. */
:root {
  --bg: #f6f5f1;          --surface: #ffffff;      --ink: #1b1d22;       --muted: #5d6270;
  --line: #e2e0d8;        --accent: #2f5bea;       --accent-ink: #ffffff;
  --ok: #1f7a4d;          --ok-bg: #e6f4ec;        --warn: #8a5a00;      --warn-bg: #fdf1d8;
  --bad: #b3261e;         --bad-bg: #fbe6e4;
  --radius: 14px;         --radius-sm: 8px;        --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font);
  --measure: 1100px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121317; --surface: #1b1d23; --ink: #eceef3; --muted: #a2a7b3; --line: #2b2e36;
    --ok: #6fd3a0; --ok-bg: #16281f; --warn: #f0c46b; --warn-bg: #2a2413; --bad: #f28b82; --bad-bg: #2c1716;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); min-height: 100vh;
       display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 48px; }

.masthead { border-bottom: 1px solid var(--line); background: var(--surface); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { font: 700 1.05rem/1 var(--font-display); letter-spacing: -.01em; }
.usage { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.foot { color: var(--muted); font-size: .85rem; padding: 20px 0; border-top: 1px solid var(--line); }

h1, h2 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: 1.25rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--accent); font-weight: 700; margin: 0 0 .75rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34ch; }
.hint { color: var(--muted); margin: 0 0 1rem; }
.opt { color: var(--muted); font-weight: 400; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel.narrow { max-width: 560px; margin: 8vh auto 0; }
.center { text-align: center; }

label { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 6px; }
input, textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
button, .button { display: inline-block; margin-top: 20px; font: 700 1rem/1 var(--font); background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: var(--radius-sm); padding: 13px 20px; cursor: pointer; text-decoration: none; width: 100%; text-align: center; }
button:hover, .button:hover { filter: brightness(1.08); }
button:focus-visible, .button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.alert { background: var(--bad-bg); color: var(--bad); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 8px; font-weight: 600; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: .85rem; margin: 6px 0 0; }

/* signup */
.consent { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; margin-top: 18px; }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.consent label { margin: 0; font-weight: 400; font-size: .92rem; }
.fine { color: var(--muted); font-size: .8rem; margin: 6px 0 0 30px; }
.hero { display: grid; gap: 28px; align-items: center; }
/* tool — fields sit on a 2-column grid; numbers pair up, everything else spans the row */
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; }
.fields .field { min-width: 0; }
.fields .field { grid-column: 1 / -1; }
.fields .field.type-number { grid-column: auto; }
.fields .field.type-number { display: flex; flex-direction: column; justify-content: flex-end; }
.fields .field.type-number label .opt { display: block; }
.workspace { display: grid; gap: 24px; align-items: start; }
.tool-title { font-size: 1.4rem; }
.results .empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 32px; color: var(--muted); text-align: center; }
.raw { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow-x: auto; }

.verdict { border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }
.verdict-line { font: 800 1.35rem/1.2 var(--font-display); margin: 0; }
.verdict-sub { margin: 4px 0 0; font-size: .9rem; opacity: .85; font-variant-numeric: tabular-nums; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: start; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.check p { margin: 0; }
.check-label { font-weight: 600; }
.check-detail { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.pill { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; text-align: center; border-radius: 999px; padding: 4px 0; }
.check.pass .pill { background: var(--ok-bg); color: var(--ok); }
.check.warn .pill { background: var(--warn-bg); color: var(--warn); }
.check.fail .pill { background: var(--bad-bg); color: var(--bad); }
.check.skip .pill { background: var(--line); color: var(--muted); }
.check.skip .check-label { color: var(--muted); }

/* layouts — wide screens only; everything stacks on a phone */
@media (min-width: 860px) {
  body.layout-split .hero { grid-template-columns: 1.1fr .9fr; }
  body.layout-split .workspace { grid-template-columns: 380px 1fr; }
  body.layout-stacked .hero { max-width: 640px; margin: 0 auto; text-align: center; }
  body.layout-stacked .lede { margin-inline: auto; }
  body.layout-stacked .workspace { max-width: 760px; margin: 0 auto; }
  body.layout-card .hero, body.layout-card .workspace { max-width: 560px; margin: 0 auto; }
  body.layout-card .hero-copy { text-align: center; }
}
