/* Affimarq client dash — the five approved boards (design/*.dc.html) transplanted: tokens, spacing, radii,
   type sizes, layouts. Desktop-native 1180px container; grids stack at <= 900px; at 390px nothing overflows
   (tables scroll inside .table-wrap only). One typeface, self-hosted. No shadows, no gradients, no emoji.
   Contrast-driven token changes vs the boards (ui_checks.py >= 4.5:1 on body text):
     muted-label #8A90A2 -> #646A7E (footer, eyebrows, th, Indonesian sub-labels)
     labels on the deep-blue card #D0D2E7 -> #DDE0F4 */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("assets/PlusJakartaSans-VF.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
:root {
  --blue-tint: #EEF0FC;   /* title bands, the statement's Total column, key rows (2026-09-19) */
  --paper: #FFFFFF; --paper2: #F4F5F8; --card2: #F7F8FB; --line: #ECEEF4;
  --ink: #0F1117; --muted: #5A6072; --muted-label: #646A7E; --dash: #8A90A2;
  --navy: #161C86; --muted-on-navy: #D0D2E7; --lime: #C7F73E;
  --blue: #3243E8; --blue2: #6572EE; --muted-on-blue: #DDE0F4;
  --good: #2E7D55; --good-tint: #E7F3EC; --good-ink: #1E5B3E; --good-line: #CBE5D7;
  --warn-tint: #FBF1DB; --warn-ink: #6B4A00; --warn-line: #EFD9A6; --bad: #B03A2E;
  --chart-sales: #2a78d6; --chart-gpp: #2E7D55; --chart-label: #52514e;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper2); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--blue); text-decoration: none; } a:hover { color: var(--blue2); }
h1, h2, h3, p { margin: 0; font-weight: inherit; font-size: inherit; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.loading { color: var(--muted); padding: 60px 24px; text-align: center; }
.preview { background: var(--bad); color: #FFFFFF; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; padding: 6px 24px; }
.error { max-width: 1180px; margin: 40px auto; padding: 0 24px; color: var(--muted); }
.error b { color: var(--ink); }

/* ---------- header ---------- */
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.topin { max-width: 1180px; margin: 0 auto; padding: 16px 24px 0; }
.toprow { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand { font-size: 24px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; line-height: 1.15; }
.brandcol { min-width: 0; }
.mtabs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }   /* month tabs under the brand: "Aug 26" */
.mtabs::-webkit-scrollbar { display: none; }
.months { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.pill { font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); white-space: nowrap; transition: background .15s ease, color .15s ease; }
.pill:hover { color: var(--ink); background: var(--card2); }
.pill.on { background: var(--navy); color: #FFFFFF; border-color: var(--navy); }
.badge { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.badge.final { background: var(--good-tint); color: var(--good-ink); border: 1px solid var(--good-line); }
.badge.live { background: var(--warn-tint); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); padding: 2px; }
.seg button { font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 10px; border-radius: 999px; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--navy); color: #FFFFFF; }
.signout { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 12px; white-space: nowrap; }
.signout:hover { color: var(--ink); }
.tabs { display: flex; gap: 6px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 8px 14px; border-radius: 8px 8px 0 0; white-space: nowrap; flex-shrink: 0; transition: background .15s ease, color .15s ease; }
.tab:hover { color: var(--ink); background: var(--card2); }
.tab.on { color: var(--navy); background: var(--lime); }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 24px 20px; width: 100%; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.wrap-statement { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); align-items: start; }
.wrap-billing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.g1 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.g6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.g5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }   /* junior: no "Sales via ads" tile */
.gmain { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.gmain.solo { grid-template-columns: minmax(0, 1fr); }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { --px: 20px; --pt: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: var(--pt) var(--px) 16px; min-width: 0; }
.card.tight { --pt: 12px; }
.lbl { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.val { font-size: 34px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.val.off { color: var(--dash); }
.sub { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.sub + .sub { margin-top: 4px; }
.delta { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--good-ink); background: var(--good-tint); border-radius: 999px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; white-space: nowrap; }
.delta.down { color: var(--bad); background: #F7E7E4; }
.delta.flat { background: var(--paper2); color: var(--muted); }
.wait { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--warn-ink); background: var(--warn-tint); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
/* ---------- Sync (local preview only): header pills + the confirm panel ---------- */
.pill.sync { color: var(--navy); background: var(--blue-tint); border-color: transparent; }
.pill.sync:hover { background: #E1E5FA; }
.pill.sync:disabled, .btn:disabled { opacity: .55; cursor: progress; }
.badge.changed { background: var(--blue-tint); color: var(--navy); border: 1px solid #D5DAF5; }
.badge.skip { background: var(--paper2); color: var(--muted); border: 1px solid var(--line); }
.card.sync { margin-bottom: 2px; }
.card.sync .title span { margin-left: auto; }
.sync-client + .sync-client { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sync-client h3 { font-size: 13.5px; font-weight: 800; color: var(--navy); margin-bottom: 6px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sync-client h3 span { font-size: 12px; font-weight: 400; color: var(--muted); }
.sync-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.sync-row .badge { flex: 0 0 auto; }
.sync-name { font-weight: 600; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.sync-meta { color: var(--muted); font-size: 12px; margin-left: auto; text-align: right; overflow-wrap: anywhere; }
.sync-month .sync-meta { margin-left: 0; text-align: left; flex: 1 1 260px; }
.sync-month { background: var(--card2); margin: 6px calc(-1 * var(--px)) 0; padding: 6px var(--px); border-top: 0; }
.sync-empty, .sync-err { color: var(--muted); font-size: 13.5px; padding: 4px 0; }
.sync-err b { color: var(--bad); }
.sync-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.sync-actions .btn { width: auto; flex: 0 0 auto; }
/* Team tab (cloud only): add form, the one-time link, the access table */
select { font: inherit; color: inherit; }
.team .btn { display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 38px; margin-top: 0; padding: 8px 14px; border-radius: 999px; font-size: 13px; }
.team .btn:disabled { opacity: .55; cursor: default; }
.team-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.team-form label { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.team-form label:first-child { flex: 1 1 240px; }
.team-form label:nth-child(2) { flex: 1 1 260px; }
.team input, .team select { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }
.team input:focus, .team select:focus { outline: 2px solid var(--blue2); outline-offset: 1px; }
.team td select { width: auto; padding: 5px 8px; font-size: 13px; }
.team-msg { font-size: 13px; color: var(--good-ink); margin: -2px 0 12px; }
.team-msg.bad { color: var(--bad); }
.team-link { background: var(--good-tint); border: 1px solid var(--good-line); border-radius: 10px; padding: 10px 12px; margin: -2px 0 12px; font-size: 13px; color: var(--good-ink); }
.team-copy { display: flex; gap: 8px; margin-top: 8px; }
.team-copy input { flex: 1; min-width: 0; font-size: 12.5px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.team td.n { white-space: normal; overflow-wrap: anywhere; }
.team-acts { display: flex; gap: 6px; justify-content: flex-end; }
.team-acts .btn { min-height: 32px; padding: 5px 12px; font-size: 12.5px; }
.btn { font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); }
.btn:hover { color: var(--ink); background: var(--card2); }
.btn.primary { background: var(--navy); color: #FFFFFF; border-color: var(--navy); }
.btn.primary:hover { background: var(--blue); border-color: var(--blue); }
.card.fee { background: var(--blue); border-color: var(--blue); }
.card.fee .lbl, .card.fee .sub { color: var(--muted-on-blue); }
.card.fee .val { color: #FFFFFF; }
.card.fee a { color: #FFFFFF; font-weight: 700; }
.card.fee.live { background: var(--card2); border: 1px dashed var(--line); }
.card.fee.live .lbl, .card.fee.live .sub { color: var(--muted); }
.card.fee.live .val { color: var(--dash); }
/* The Band Rule: a card title sits on the blue tint, full card width, navy 700 */
.title, .head, .side .h { background: var(--blue-tint); color: var(--navy); margin: calc(-1 * var(--pt)) calc(-1 * var(--px)) 12px; padding: 10px var(--px); border-radius: 11px 11px 0 0; }
.title { font-size: 14px; font-weight: 700; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.title span { font-size: 12px; font-weight: 400; color: var(--muted); }
.ghost { color: var(--muted); font-size: 13px; line-height: 1.55; }
.ghost .title { margin-bottom: 8px; }
.note { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.note p { max-width: 640px; }
.note .title { margin-bottom: 8px; }

/* month-by-month chart (SVG, measured to the card width) */
.chart { margin-top: 14px; min-height: 190px; }
.chart svg { display: block; width: 100%; height: 190px; }
.leg { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; font-style: normal; }
.leg i.hatch { background: repeating-linear-gradient(45deg, var(--chart-sales) 0 4px, #FFFFFF 4px 7px); }

/* target + year to date */
.prog { height: 10px; border-radius: 5px; background: var(--paper2); margin-top: 10px; overflow: hidden; }
.prog div { height: 10px; border-radius: 5px; background: var(--good); }
.pct { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 1px; line-height: 1.3; white-space: normal; }   /* a share under a figure */
.num.up { color: var(--good-ink); } .num.down { color: var(--bad); }
.ledger table, .perf table { min-width: 0; }
.perf .pct { white-space: nowrap; }                     /* one platform per line under the figure */
.ledger td:first-child, .ledger th:first-child { white-space: normal; }
.ledger td { padding: 8px 6px; font-size: 13.5px; }
.ledger tr.neg td { color: var(--muted); } .ledger tr.neg td:first-child { color: var(--ink); }
.ledger tr.sum td { font-weight: 700; color: var(--navy); }
.ledger tr.fee td:nth-child(2) { color: var(--blue); }
.stmt tr.key td, .ledger tr.key td { background: var(--blue-tint); color: var(--navy); font-weight: 800; }   /* Settled sales · Net Platform Profit */
tr.key .pct { color: var(--muted); font-weight: 400; }

/* ledger + top 5 rows */
.row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.row.first { border-top: none; }
.row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .a { width: 110px; flex-shrink: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.row .p { width: 44px; flex-shrink: 0; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.row.neg .a { color: var(--muted); font-weight: 600; }
.row.sum .n { font-weight: 700; } .row.sum .a { color: var(--navy); }
.row.fee .a { color: var(--blue); }
.rank { width: 18px; flex-shrink: 0; color: var(--muted-label); font-weight: 700; font-size: 12px; }

/* ---------- performance ---------- */
.tile { padding: 14px 16px; }
.tile .lbl { font-size: 11px; }
.tile .val { font-size: 24px; }
.tile .sub { font-size: 11.5px; margin-top: 6px; }
.tile .delta { margin: 8px 6px 0 0; font-size: 11px; padding: 2px 7px; }
.pair { margin-top: 6px; }
.pv { font-size: 20px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.pv .num { white-space: nowrap; }                       /* the rupiah never breaks; the platform tag may drop a line */
.pv i { display: inline-block; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-label); margin-left: 6px; white-space: nowrap; }
.tile .delta { white-space: normal; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: right; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-label); padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.t { font-weight: 700; color: var(--navy); }
td.n { text-align: left; white-space: normal; }
td.dim { color: var(--muted); }
td.rank { color: var(--muted-label); font-weight: 700; font-size: 12px; width: 18px; }
.perf .title { margin-bottom: 6px; }
.skus table { min-width: 640px; }
.skus.simple table { min-width: 0; }

/* ---------- statement ---------- */
.stmt { --pt: 14px; }
.head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.ctl { padding: 0 0 8px; }
.memo { font-size: 12px; color: var(--muted); padding: 10px 0 0; line-height: 1.6; }
.h1 { font-size: 18px; font-weight: 800; color: var(--navy); }
.meta { font-size: 12px; color: var(--muted); }
.stmt table { font-size: 13.5px; min-width: 560px; }
.stmt th { padding: 10px 8px 6px; }
.stmt td { padding: 9px 8px; }
.stmt td:first-child { white-space: normal; }
.stmt th:nth-child(2), .stmt td:nth-child(2) { background: var(--blue-tint); color: var(--navy); font-weight: 700; }   /* Total column first, tinted */
.stmt tr.neg td:nth-child(2) { color: var(--muted); font-weight: 600; }
.id { display: block; font-size: 11.5px; color: var(--muted-label); margin-top: 1px; font-weight: 400; }
.stmt tr.neg td { color: var(--muted); }
.stmt tr.neg td:first-child { color: var(--ink); }
.stmt tr.sum td { font-weight: 700; }
.stmt tr.sum td:nth-child(2) { color: var(--navy); }
.stmt tr.fee td:nth-child(2) { color: var(--blue); font-weight: 700; }
.stmt tr.total td { background: var(--navy); color: #FFFFFF; font-weight: 800; font-size: 15px; border-bottom: none; }
.stmt tr.total td:first-child { border-radius: 8px 0 0 8px; }
.stmt tr.total td:nth-child(2) { color: var(--lime); font-size: 18px; }
.stmt tr.total td:last-child { border-radius: 0 8px 8px 0; }
.stmt tr.total td .id { color: var(--muted-on-navy); }
.stmt td.na { color: var(--muted-label); font-weight: 400; font-size: 12px; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--warn-tint); color: var(--warn-ink); border: 1px solid var(--warn-line); white-space: nowrap; }
.chip.mtd { background: var(--paper2); color: var(--muted); border-color: var(--line); }
.chip.paid { background: var(--good-tint); color: var(--good-ink); border-color: var(--good-line); }
.side { --pt: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.side b { color: var(--ink); }
.side .h { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.side .h.later { margin: 16px calc(-1 * var(--px)) 8px; border-radius: 0; }
.print-head { display: none; }

/* ---------- billing ---------- */
.inv { background: var(--blue); border-color: var(--blue); color: #FFFFFF; }
.inv .lbl { color: var(--muted-on-blue); }
.line { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 10px 0; border-bottom: 1px solid var(--blue2); }
.line span:first-child { min-width: 0; }
.line span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line small { display: block; font-size: 11.5px; color: var(--muted-on-blue); margin-top: 1px; font-weight: 400; }
.tot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-top: 14px; flex-wrap: wrap; }
.tot .k { font-size: 13px; font-weight: 700; }
.tot .k small { display: block; font-size: 11.5px; color: var(--muted-on-blue); font-weight: 400; margin-top: 2px; }
.tot .v { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat { display: inline-block; margin-top: 14px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #FFFFFF; color: var(--blue); }
.sent { font-size: 12px; color: var(--muted-on-blue); margin-top: 12px; line-height: 1.5; }
.bank { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.bank b { color: var(--ink); }
.bill .title { margin-bottom: 6px; }
.bill table { font-size: 13.5px; min-width: 620px; }
.bill th { padding: 10px 8px 6px; }
.bill td { padding: 10px 8px; }
.bill td:first-child { font-weight: 700; }
.bill td.fee { color: var(--blue); font-weight: 700; }
.bill td .chip.mtd { display: block; width: max-content; margin: 3px 0 0 auto; }   /* "as invoiced" sits under the amount, never widens the row */

/* ---------- footer ---------- */
.foot { max-width: 1180px; margin: 0 auto; padding: 0 24px 16px; font-size: 11px; color: var(--muted-label); display: flex; justify-content: space-between; gap: 12px; width: 100%; flex-wrap: wrap; }
.foot b { font-weight: 700; color: var(--muted-label); }

/* ---------- login gate (cloud only) ---------- */
.gate { position: fixed; inset: 0; z-index: 20; background: var(--paper2); display: flex; align-items: center; justify-content: center; padding: 24px; overflow: auto; }
.gate-card { width: min(400px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 26px 26px 20px; }
.gate-logo { display: block; height: 22px; width: auto; }
.gate-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 18px; }
.gate-title { font-size: 22px; font-weight: 800; color: var(--navy); margin-top: 4px; letter-spacing: -0.02em; }
.gate-sub { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.gate label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.gate input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 14px; }
.gate input:focus { outline: 2px solid var(--blue2); outline-offset: 1px; }
.gate input:disabled { background: var(--card2); color: var(--muted); }
.gate input + .btn, .gate input + .btn-primary { margin-top: 18px; }   /* sign-in / set-password: two fields, then the button */
.btn { display: block; width: 100%; margin-top: 12px; padding: 11px 16px; border-radius: 8px; font-size: 14px; font-weight: 700; text-align: center; min-height: 44px; transition: background .15s ease; }
.btn-primary { background: var(--navy); color: #FFFFFF; }
.btn-primary:hover { background: #1F268F; }
.btn-primary:disabled { background: var(--card2); color: var(--muted); cursor: default; }
.btn-outline { background: var(--paper); color: var(--navy); border: 1px solid var(--navy); }
.gate-msg { font-size: 12.5px; color: var(--muted); margin-top: 14px; min-height: 18px; }
[hidden] { display: none !important; }   /* .btn's display:block would otherwise beat the hidden attribute */
.gate-link { display: block; margin: 14px auto 0; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.gate-link:hover { color: var(--navy); }
.gate-link:disabled { color: var(--muted-label); text-decoration: none; }
.gate-msg.bad { color: var(--bad); }
.gate-foot { font-size: 11px; color: var(--muted-label); margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- responsive: stack below 900px; nothing overflows at 390px ---------- */
@media (max-width: 900px) {
  .g3, .g2, .gmain, .wrap-statement, .wrap-billing { grid-template-columns: minmax(0, 1fr); }
  .g6, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toprow { gap: 12px; }
  .months { margin-left: 0; width: 100%; }
  .signout { margin-left: 0; }
  .val { font-size: 30px; }
  .row .a { width: 96px; }
}
@media (max-width: 480px) {
  .g6, .g5 { grid-template-columns: minmax(0, 1fr); }
  .topin, .wrap, .foot { padding-left: 16px; padding-right: 16px; }
  .card { --px: 16px; --pt: 14px; }
  .brand { font-size: 22px; }
  .ledger td, .ledger th, .perf td, .perf th { padding: 7px 3px; font-size: 12px; }
  .perf .pct { display: none; }                       /* phone: the platform split lives in the tiles above; the table keeps totals */
}

/* ---------- print: the Statement tab is the A4 statement ---------- */
@media print {
  body { background: #FFFFFF; }
  .top, .foot span:last-child, .ctl, .preview, .seg, .signout { display: none !important; }
  .title, .head, .side .h { background: none; margin: 0 0 8px; padding: 0; }
  .stmt td:nth-child(2), .stmt th:nth-child(2), .stmt tr.key td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-head { display: block; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
  .print-head b { color: var(--navy); font-size: 16px; font-weight: 800; display: block; }
  .wrap-statement { display: block; padding: 0; }
  .card { border: none; padding: 0; break-inside: avoid; }
  .side { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
  .stmt table { min-width: 0; }
  .stmt tr.total td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .foot { padding: 12px 0 0; }
}

/* phone: the statement keeps the label + Total only (per-platform columns are on the desktop / print view) */
@media (max-width: 480px) {
  .stmt table { min-width: 0; }
  .stmt th:nth-child(n+3), .stmt td:nth-child(n+3) { display: none; }   /* label + Total stay */
  .bill table { min-width: 0; }
  .bill th:nth-child(n+2):nth-child(-n+4), .bill td:nth-child(n+2):nth-child(-n+4) { display: none; }   /* Month · Total payable · Status */
}
