/* Shared look for every page, taken from the Social Security Claim Planner.
 *
 * Load it before a page's own <style> (after fonts.css). It defines:
 *   - the palette as --s-* tokens, light and dark (each page maps its own color names onto these),
 *   - the three typefaces (--s-display, --s-body, --s-data),
 *   - the page header band (.page-head) with its guilloché pattern, kicker, title and summary.
 * Pages keep their own layout, but use these tokens for every color and font.
 */
:root {
  --s-paper: #e9f0f4; --s-surface: #fbfdfe; --s-sunk: #dfe8ee; --s-ink: #13263b; --s-muted: #576a7c;
  --s-line: #c7d4de; --s-line2: #dbe4eb; --s-accent: #1d4e89; --s-accent-ink: #ffffff; --s-tint: #dde8f2;
  --s-stamp: #b3262f; --s-good: #23704f; --s-warn: #9a5b00; --s-warnbg: #f6eedd;
  --s-h1: #12396a; --s-h2: #2f64a3; --s-h3: #6d98c9; --s-h4: #a9c3df; --s-h5: #d9e4ef;
  --s-display: "Libre Caslon Display", "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --s-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --s-data: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --s-r: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --s-paper: #0d1720; --s-surface: #13212d; --s-sunk: #0a131b; --s-ink: #e2eaf1; --s-muted: #93a6b7;
  --s-line: #263848; --s-line2: #1c2d3b; --s-accent: #7fb0e8; --s-accent-ink: #0b1622; --s-tint: #16283a;
  --s-stamp: #f07a82; --s-good: #6fcf9f; --s-warn: #e2a64b; --s-warnbg: #2a2416;
  --s-h1: #9cc6f5; --s-h2: #5f93cf; --s-h3: #3b6797; --s-h4: #284a6e; --s-h5: #1b3148; color-scheme: dark; } }
:root[data-theme="dark"] {
  --s-paper: #0d1720; --s-surface: #13212d; --s-sunk: #0a131b; --s-ink: #e2eaf1; --s-muted: #93a6b7;
  --s-line: #263848; --s-line2: #1c2d3b; --s-accent: #7fb0e8; --s-accent-ink: #0b1622; --s-tint: #16283a;
  --s-stamp: #f07a82; --s-good: #6fcf9f; --s-warn: #e2a64b; --s-warnbg: #2a2416;
  --s-h1: #9cc6f5; --s-h2: #5f93cf; --s-h3: #3b6797; --s-h4: #284a6e; --s-h5: #1b3148; color-scheme: dark; }

/* page header band */
.page-head { position: relative; overflow: hidden; border-bottom: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-ink); }
.page-head canvas.guilloche { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.page-head .head-in { position: relative; max-width: var(--head-max, 1320px); margin: 0 auto; box-sizing: border-box;
  padding: 28px max(16px, env(safe-area-inset-right, 0px)) 22px max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: end; justify-content: space-between; }
.page-head .head-text { min-width: 0; flex: 1 1 420px; }
.page-head .kicker { font: 500 11px/1 var(--s-data); letter-spacing: .14em; text-transform: uppercase; color: var(--s-stamp); margin: 0 0 10px; }
.page-head h1 { font: 400 clamp(30px, 4.4vw, 46px)/1.05 var(--s-display); margin: 0; letter-spacing: .005em; text-wrap: balance; color: var(--s-ink); }
.page-head .sub { color: var(--s-muted); max-width: 60ch; margin: 8px 0 0; font: 15px/1.55 var(--s-body); }
.page-head .head-side { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-head .facts { display: flex; gap: 18px; flex-wrap: wrap; font: 12px/1.4 var(--s-data); color: var(--s-muted); }
.page-head .facts b { display: block; color: var(--s-ink); font-weight: 500; font-size: 13px; }
/* file controls in the header, the same on every tool: Open saved file… / Save inputs to file / Clear all */
.page-head .head-side { flex: 0 1 auto; flex-direction: column; align-items: flex-end; gap: 12px; max-width: 290px; }
/* a 2-by-2 grid of equal buttons: Open / Save on top, Clear all / Load sample data below */
.page-head .filebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.page-head .filebar button { width: 100%; text-align: center; font: 600 13px/1.2 var(--s-body); border: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-ink);
  padding: 9px 12px; border-radius: 4px; cursor: pointer; }
.page-head .filebar button:hover { background: var(--s-paper); }
.page-head .filebar button.primary { background: var(--s-accent); border-color: var(--s-accent); color: var(--s-accent-ink); }
.page-head .filebar button.primary:hover { background: var(--s-accent); filter: brightness(1.08); }
.page-head .filebar button.quiet { color: var(--s-muted); }
.page-head .filebar button:focus-visible { outline: 2px solid var(--s-accent); outline-offset: 1px; }
.page-head .filemsg { grid-column: 1 / -1; font: 0.85rem/1.4 var(--s-body); color: var(--s-muted); min-height: 1.2em; text-align: right; margin: 0; }
@media (max-width: 720px) { .page-head .head-side { align-items: stretch; width: 100%; max-width: none; } .page-head .filebar { max-width: 420px; } .page-head .filemsg { text-align: left; } }
/* every tool's header is the same height: reserve the same number of title and summary lines on each */
.page-head .head-text .sub { min-height: calc(3 * 1.55em); }
@media (max-width: 720px) { .page-head h1 { min-height: 2.1em; } .page-head .head-text .sub { min-height: calc(4 * 1.55em); } }
@media (max-width: 350px) { .page-head .head-text .sub { min-height: calc(5 * 1.55em); } }
@media print { .page-head canvas.guilloche { display: none; } .page-head { background: none; } .page-head .filebar { display: none; } }

/* shared controls, for pages that use these class names */
.s-btn { font: 600 13px/1 var(--s-body); border-radius: 4px; padding: 9px 12px; cursor: pointer; border: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-ink); }
.s-btn.primary { background: var(--s-accent); color: var(--s-accent-ink); border-color: var(--s-accent); }
.s-label { font: 500 11px/1.2 var(--s-data); letter-spacing: .12em; text-transform: uppercase; color: var(--s-muted); }
