/* frontend/css/bsr/ledger.css - CB498C (R-LEDGER-SITE): the ONE shared Navy Ledger v2 sheet for every BSR
 * page. Tokens are declared here and nowhere else (fl-ledger.js term d): a page's own <style> holds only
 * page-specific rules. Moved out of frontend/index.html (CB493C) with no value changed; the design-spec
 * section 1 names are added below the home's names, as aliases where the home already holds the same
 * value. Hex values first; oklch() overrides them where supported. Pages link this sheet before their own
 * <style>. The Google Fonts <link> stays in each page head. ASCII only, no @import. */

:root {
  --ink: #0f1b2d;
  --paper: #f7f8fa;
  --paper-2: #eef1f5;
  --rule: #dde1e8;
  --muted: #5a6475;
  --body: #465062;
  --faint: #8a93a3;
  --acc: #f2a635;
  --acc-hover: #a25f12;
  --eyebrow: #965719;
  --gold: #f2af48;
  --grn: #139948;
  --blu: #3280dd;
  --band-rule: #26375a;
  --band-muted: #b4bccb;
  --band-faint: #8a94a8;
  --map-lo: #e3e7ee;
  --map-hi: #c97a06;
  --map-none: #e6e9ef;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --pad-x: clamp(20px, 4vw, 48px);

  /* Design spec section 1 names. An alias where the home token holds the same value; otherwise the
     spec's own value (--ink-body, --field, --on-navy-3, --error, --error-ink have no home token). An alias
     resolves where it is declared (:root): to re-tint a subtree, override the name its components read. */
  --ink-body: #1e2a3d;
  --ink-2: var(--body);
  --ink-3: var(--muted);
  --ink-4: var(--faint);
  --band: var(--paper-2);
  --field: #ffffff;
  --amber: var(--acc);
  --amber-ink: var(--eyebrow);
  --amber-em: var(--acc-hover);
  --amber-dark: var(--gold);
  --navy-rule: var(--band-rule);
  --on-navy-2: var(--band-muted);
  --on-navy-3: #a8b1c2;
  --live: var(--grn);
  --license: var(--blu);
  --closure: var(--ink);
  --buysell: var(--amber);
  --error: #c5372f;
  --error-ink: #b3241f;

  /* CB507B: the colours the subscriber dashboard (Navy Ledger v2 dashboard handoff) adds. Declared here, the
     only place a token may be declared (fl-ledger.js term d); its components live in /css/bsr/dashboard.css.
     Event badges: text, tint and border per event type (every text/tint pair 6:1 or better). */
  --ev-bs-fg: #26375a;
  --ev-bs-bg: #e4e9f2;
  --ev-bs-bd: #c5cfe0;
  --ev-cl-fg: #a3200f;
  --ev-cl-bg: #fbd9d3;
  --ev-cl-bd: #eea497;
  --ev-op-fg: #146b36;
  --ev-op-bg: #d3f0dc;
  --ev-op-bd: #92d3a8;
  --ev-lc-fg: #8a4f00;
  --ev-lc-bg: #fbe4b8;
  --ev-lc-bd: #eab765;
  /* confidence badges (pips on / off, borders) and the four-step confidence strip */
  --conf-off: #dde1e8;
  --conf-off-tint: #c5cfe0;
  --conf-off-navy: #5d6d8c;
  --conf-bd-dash: #9aa3b2;
  --conf-bd: #8b97ad;
  --conf-1: #c5cbd6;
  --conf-2: #8b97ad;
  --conf-3: #4a5b7d;
  --conf-4: #26375a;
  /* NEW tag, plan tag and the monthly plan band */
  --new-fg: #8a4f00;
  --new-bg: #fce7bf;
  --new-bd: #eab765;
  --plan-band: #fbf3e4;
  --plan-band-rule: #ecd6ad;
  --amber-lite: #e3a13a;
  /* table rows, filter controls, scrims */
  --row-hover: #f4f6f9;
  --row-sel: #f1f4f9;
  --ctl-bd: #b9c0cc;
  --scrim: rgba(15, 27, 45, .22);
  --scrim-strong: rgba(15, 27, 45, .4);
}
@supports (color: oklch(0.5 0.1 60)) {
  :root {
    --acc: oklch(0.78 0.15 72);
    --acc-hover: oklch(0.55 0.12 62);
    --eyebrow: oklch(0.52 0.11 60);
    --gold: oklch(0.8 0.14 75);
    --grn: oklch(0.6 0.16 150);
    --blu: oklch(0.6 0.16 255);
    --error: oklch(0.55 0.18 28);
    --error-ink: oklch(0.5 0.18 28);
  }
}

/* base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--acc-hover); }
[hidden] { display: none !important; }
.wrap { max-width: 1280px; margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }

/* type utilities */
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--eyebrow); }
.h2 { font: 400 clamp(40px, 5vw, 64px)/1 var(--serif); letter-spacing: -.02em; margin-top: 14px; text-wrap: balance; }

/* event-type dots */
.c-bs { background: var(--acc); }
.c-op { background: var(--grn); }
.c-lc { background: var(--blu); }
.c-ink { background: var(--ink); }
/* CB507F: a coming-soon opening - the openings green as a ring, not a fill (it is not counted as opened) */
.c-soon { background: transparent; box-shadow: inset 0 0 0 2px var(--grn); }
.mix-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* dateline */
.dateline { border-bottom: 1px solid var(--rule); }
.dateline-in { padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font: 500 12px/1.4 var(--mono); color: var(--muted); letter-spacing: .02em; }
.dl-left { display: flex; align-items: center; gap: 8px; }
.dl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grn); }

/* masthead */
.mast { position: sticky; top: 0; z-index: 20; background: rgba(247, 248, 250, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ink); }
.mast-in { padding-top: 14px; padding-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.seal { width: 46px; height: 46px; flex: none; background: var(--ink); border-radius: 3px; position: relative; display: flex; align-items: center; justify-content: center; }
.seal-t { font: 500 18px/1 var(--serif); color: var(--paper); letter-spacing: .04em; margin-top: -5px; }
.seal-bar { position: absolute; left: 9px; right: 9px; bottom: 9px; height: 3px; background: var(--acc); }
.brand-words { display: flex; flex-direction: column; gap: 5px; }
.brand-name { font: 500 25px/1 var(--serif); letter-spacing: -.015em; white-space: nowrap; }
.brand-tag { font: 500 10px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.mast-nav { display: flex; align-items: center; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; font-size: 14px; font-weight: 500; }
.mast-nav a { padding: 10px 12px; white-space: nowrap; }
.mast-nav .pill { margin-left: 6px; height: 40px; padding: 0 18px; display: flex; align-items: center; background: var(--ink); color: var(--paper); border-radius: 999px; flex: none; }
.mast-nav .pill:hover { background: var(--acc-hover); color: var(--ink); }
/* Signed in: the Account chip (ledger-mast.js sets .acct and the initials once GET /api/auth/me answers). */
.mast-nav .acct { margin-left: 8px; height: 40px; padding: 0 14px 0 5px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--ink); border-radius: 999px; flex: none; }
.mast-nav .acct:hover { background: var(--ink); color: var(--paper); }
.mast-nav .acct:hover .acct-ini { background: var(--paper); color: var(--ink); }
.acct-ini { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font: 600 12px/1 var(--sans); flex: none; }
/* Mobile Menu: every mobile masthead rule applies only once ledger-mast.js has wired it (.has-menu), so
   without script the masthead is unchanged and the nav keeps scrolling sideways instead of hiding behind
   a dead button. This max-width is the ONLY copy of the breakpoint: the script reads the pill's display. */
.mast-menu { display: none; }
@media (max-width: 719.98px) {
  .mast.has-menu .brand-tag { display: none; }
  .mast.has-menu .brand-name { font-size: clamp(20px, 5.4vw, 25px); }
  .mast.has-menu .mast-menu { display: flex; order: 1; flex: none; margin-left: auto; height: 44px; padding: 0 16px; align-items: center; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer; }
  .mast.has-menu .mast-menu:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  .mast.has-menu .mast-nav { display: none; order: 2; flex-basis: 100%; flex-direction: column; align-items: stretch; overflow: visible; font-size: 17px; border-top: 1px solid var(--rule); padding-top: 8px; padding-bottom: 20px; }
  /* its max-height is measured by ledger-mast.js (the room below the panel top), never a constant here */
  .mast.has-menu.is-open .mast-nav { display: flex; overflow-y: auto; }
  .mast.has-menu .mast-nav a { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .mast.has-menu .mast-nav .pill { margin: 16px 0 0; height: 52px; padding: 0 26px; justify-content: center; border-bottom: 0; background: var(--acc); color: var(--ink); font-weight: 600; }
  .mast.has-menu .mast-nav .pill:hover { background: var(--ink); color: var(--paper); }
  .mast.has-menu .mast-nav .acct { margin: 0; height: auto; padding: 14px 0; gap: 10px; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; }
  .mast.has-menu .mast-nav .acct:hover { background: transparent; color: var(--acc-hover); }
  .mast.has-menu .mast-nav .acct:hover .acct-ini { background: var(--ink); color: var(--paper); }
}

/* buttons (all pills) */
.btn { height: 52px; padding: 0 26px; display: flex; align-items: center; border-radius: 999px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.btn-acc { background: var(--acc); color: var(--ink); }
.btn-acc:hover { background: var(--ink); color: var(--paper); }
.btn-line { padding: 0 24px; border: 1px solid var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }

/* stat group */
.fig-pair { display: grid; grid-template-columns: 1fr 1fr; margin-top: 22px; border-top: 1px solid var(--rule); }
.fig-cell { padding: 14px 16px 0 0; }
.fig-cell + .fig-cell { padding: 14px 0 0 16px; border-left: 1px solid var(--rule); }
.fig-lab { font: 500 12px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.fig-num { font: 44px/1.1 var(--serif); margin-top: 4px; }
.fig-sub { font-size: 13px; color: var(--muted); }

/* segmented control: a 4px-padded outline pill holding 36px pills, the active one in ink */
.toggle { display: flex; padding: 4px; border: 1px solid var(--ink); border-radius: 999px; }
.toggle button { border: 0; cursor: pointer; height: 36px; padding: 0 16px; border-radius: 999px; font: 600 13px var(--sans); white-space: nowrap; background: transparent; color: var(--ink); }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
/* filter chip (spec section 4): a 36px outline pill, active in ink fill */
.chip { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 600 13px var(--sans); white-space: nowrap; cursor: pointer; }
.chip[aria-pressed="true"], .chip.is-on { background: var(--ink); color: var(--paper); }

/* navy data card */
.readout { background: var(--ink); color: var(--paper); border-radius: 4px; padding: 20px 22px; }
.read-lab { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--on-navy-3); }
.read-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; }
.read-name { font: 30px/1.1 var(--serif); }
.read-val { font: 44px/1 var(--serif); color: var(--gold); }
.read-sub { font-size: 13px; color: var(--on-navy-3); margin-top: 6px; }

/* ruled list header: a 3px ink rule, serif H2, mono meta on the right */
.rule-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; border-top: 3px solid var(--ink); padding-top: 14px; }
.rule-head h2 { font: 400 36px/1 var(--serif); }
.rule-note { font: 500 12px var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

/* forms (spec section 4; the home has none). Prefixed lf- ("ledger form"): the auth pages already use .field
   as a WRAPPER div around label + input, so an unprefixed .field here would break them when they link the sheet. */
.lf-label { display: block; font: 600 14px/1.3 var(--sans); color: var(--ink); }
.lf-input { display: block; width: 100%; height: 48px; margin-top: 8px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 4px; background: var(--field); color: var(--ink); font: 400 16px var(--sans); }
textarea.lf-input { height: auto; min-height: 144px; padding-top: 12px; padding-bottom: 12px; line-height: 1.5; resize: vertical; }
.lf-input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.lf-help { margin-top: 6px; font-size: 13px; color: var(--muted); }
.lf-input.is-error, .lf-input[aria-invalid="true"] { border-color: var(--error); }
.lf-error { margin-top: 6px; font-size: 13px; color: var(--error-ink); }
.form-panel { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 4px; padding: clamp(20px, 3vw, 32px); }
.auth-card { max-width: 480px; margin: 0 auto; background: var(--paper); border: 1px solid var(--ink); border-radius: 4px; padding: clamp(24px, 4vw, 40px); }
/* auth template (spec section 5, template 4; CB498E): login, forgot-password and reset-password. A --band section
   holding the centred .auth-card; the footer sits at the bottom of a short page. Error and success notices keep
   their page ids and the page's own show/hide rule (the page scripts toggle .show); these classes only skin them. */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; }
.auth-sec { flex: 1 0 auto; background: var(--band); border-bottom: 1px solid var(--rule); padding-top: clamp(32px, 6vw, 72px); padding-bottom: clamp(56px, 9vw, 112px); }
.auth-title { font: 400 clamp(34px, 6vw, 44px)/1.05 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.auth-lede { margin-top: 12px; font-size: 15px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.auth-form { display: grid; gap: 18px; margin-top: 24px; }
.lf-submit { width: 100%; justify-content: center; border: 0; font-family: var(--sans); font-size: 16px; cursor: pointer; }
.lf-submit:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.lf-submit:disabled, .lf-submit:disabled:hover { background: var(--acc); color: var(--ink); opacity: .55; cursor: not-allowed; }
.lf-alert { margin-top: 20px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 4px; background: var(--field); font-size: 14px; line-height: 1.5; }
.lf-alert-error { border-color: var(--error); color: var(--error-ink); }
.lf-alert-ok { border-color: var(--live); color: var(--ink-body); }
.auth-foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.auth-foot p + p { margin-top: 8px; }
.auth-foot a, .auth-link { font-weight: 600; color: var(--amber-ink); }
.auth-foot a:hover, .auth-link:hover { color: var(--ink); text-decoration: underline; }
.auth-link { display: inline-block; margin-top: 16px; font-size: 14px; }

/* footer */
.foot { border-top: 1px solid var(--ink); }
.foot-in { padding-top: 32px; padding-bottom: 48px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: baseline; }
.foot-brand { display: flex; align-items: center; gap: 12px; }
.seal-sm { width: 32px; height: 32px; background: var(--ink); border-radius: 2px; position: relative; display: flex; align-items: center; justify-content: center; }
.seal-sm .seal-t { font-size: 12px; margin-top: -3px; }
.seal-sm .seal-bar { left: 6px; right: 6px; bottom: 6px; height: 2px; }
.foot-name { font: 500 22px var(--serif); }
.foot-nav { display: flex; gap: 20px; font-size: 14px; flex-wrap: wrap; }
.footer-disclaimer { flex-basis: 100%; font-size: 12px; color: var(--muted); max-width: 640px; line-height: 1.5; }
