/* Mobile first: everything below is the phone layout; wider screens only get more room. */
:root {
  --bg: #0a0204;
  --surface: #160608;
  --line: #3a1214;
  --text: #faf2d7;
  --muted: #c9a882;
  --faint: #8a6150;
  --red: #f87171;
  --green: #4ade80;
  --brand: #b22028;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--text); }

.wrap {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

/* Header */
header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand svg { flex: none; }
nav { display: flex; gap: 4px; }
nav a {
  color: var(--muted); text-decoration: none; font-size: 15px;
  padding: 10px 8px; /* comfortable tap target */
}
nav a:hover, nav a[aria-current="page"] { color: var(--text); }

/* Text */
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 16px; }
h2 { font-size: 21px; line-height: 1.3; margin: 40px 0 12px; }
p { margin: 0 0 14px; }
main { padding-top: 32px; padding-bottom: 48px; }

.eyebrow { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.intro p:not(.eyebrow) { color: var(--muted); }
.intro p:last-child { color: var(--text); }
.note { color: var(--faint); font-size: 15px; }

/* Worked example */
.sum { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-variant-numeric: tabular-nums; }
.sum .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.sum .row:first-child { border-top: none; }
.sum small { display: block; color: var(--faint); font-size: 13px; }
.sum .num { white-space: nowrap; }
.sum .neg { color: var(--muted); }
.sum .total { font-weight: 700; }
.sum .total .num { color: var(--green); }
.sum .per-day { background: #0f2a17; border-radius: 0 0 11px 11px; }
.sum .per-day .num { color: var(--green); font-weight: 700; }

/* Lists */
ul { padding-left: 20px; margin: 0 0 14px; }
li { margin: 6px 0; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { margin: 0; padding: 12px 0; border-top: 1px solid var(--line); }
ul.plain li:first-child { border-top: none; padding-top: 0; }

.maker { border-top: 1px solid var(--line); margin-top: 32px; }
.maker h2 { margin-top: 24px; }

/* Policy and support pages */
.doc h1 { margin-bottom: 4px; }
.doc .meta { color: var(--faint); font-size: 15px; margin-bottom: 24px; }
.doc h2 { font-size: 19px; margin-top: 32px; }
dl.pairs { margin: 0 0 14px; }
dl.pairs dt { font-weight: 700; margin-top: 14px; }
dl.pairs dd { margin: 2px 0 0; color: var(--muted); }

/* Footer */
footer.site { border-top: 1px solid var(--line); color: var(--faint); font-size: 14px; padding-top: 20px; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
footer.site p { margin: 0 0 8px; }
footer.site a { color: var(--muted); }

/* Wider screens: same layout, more room */
@media (min-width: 640px) {
  body { font-size: 18px; }
  h1 { font-size: 42px; }
  h2 { font-size: 24px; }
  main { padding-top: 56px; padding-bottom: 72px; }
  header.site .wrap { min-height: 64px; }
}
