/* RCCG Continent 13 — Monthly Reporting Portal */
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/public-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(/static/fonts/public-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/public-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(/static/fonts/public-sans-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 800; font-display: swap; src: url(/static/fonts/public-sans-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/source-serif-4-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 700; font-display: swap; src: url(/static/fonts/source-serif-4-latin-700-normal.woff2) format('woff2'); }
:root {
  --navy: #1f3a5f; --navy-2: #16304f; --navy-ink: #0f2440;
  --gold: #b8862b; --gold-soft: #f3e6c8;
  --bg: #f6f3ec; --card: #ffffff; --line: #e4ded1; --line-2: #efeae0;
  --ink: #1d2433; --muted: #5f6b7a; --faint: #8a94a3;
  --ok: #1d7a4b; --ok-bg: #e5f4ec; --warn: #9a5b00; --warn-bg: #fdf1dc; --err: #b42318; --err-bg: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--sans); color: var(--ink); background: var(--bg); }
a { color: var(--navy); }
h1, h2, h3 { font-family: var(--serif); color: var(--navy-ink); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 26px; font-weight: 600; }
h2 { font-size: 19px; font-weight: 600; }
h3 { font-size: 15px; font-family: var(--sans); font-weight: 700; letter-spacing: .02em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.mt0 { margin-top: 0 } .mt1 { margin-top: 8px } .mt2 { margin-top: 16px } .mt3 { margin-top: 28px } .mb0 { margin-bottom: 0 }

/* ---------- top bar ---------- */
.topbar { background: var(--navy); color: #fff; border-bottom: 3px solid var(--gold); }
.topbar .inner { max-width: 1320px; margin: auto; display: flex; align-items: center; gap: 22px; padding: 0 20px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 8px 0; }
.brand .mark { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: block; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.brand b { font-family: var(--serif); font-size: 16px; font-weight: 600; display: block; line-height: 1.1; }
.brand small { font-size: 11px; opacity: .75; letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a { color: #dbe4ef; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: rgba(255,255,255,.14); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #dbe4ef; }
.who a { color: #fff; }
.who form { margin: 0; }
.linkbtn { background: none; border: 0; color: #dbe4ef; cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

/* ---------- layout ---------- */
main.wrap { max-width: 1320px; margin: 0 auto; padding: 26px 20px 60px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead p { margin: 0; color: var(--muted); }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; letter-spacing: .02em; }
.crumbs a { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card > .cardhead { padding: 14px 20px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.card > .cardhead h2, .card > .cardhead h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .grid[style*='grid-template-columns'] { grid-template-columns: 1fr !important; } .grid > [style*='grid-column'] { grid-column: auto !important; } }
@media (max-width: 700px) { .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; } .who { margin-left: auto; } }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 800px) { .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tile .v { font-family: var(--serif); font-size: 28px; font-weight: 600; color: var(--navy-ink); }
.tile.ok .v { color: var(--ok); } .tile.warn .v { color: var(--warn); } .tile.err .v { color: var(--err); }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd6df; border-radius: 7px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31,58,95,.25); border-color: var(--navy); }
input[readonly] { background: #f8fafc; color: var(--muted); }
textarea { min-height: 90px; resize: vertical; }
.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline .field { margin-bottom: 0; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: auto; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 7px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.gold:hover { background: #a2741f; }
.btn.ghost { background: #fff; color: var(--navy); border-color: #cfd6df; }
.btn.ghost:hover { border-color: var(--navy); background: #f8fafc; }
.btn.danger { background: #fff; color: var(--err); border-color: #f1b8b2; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- alerts & badges ---------- */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.alert.ok { background: var(--ok-bg); border-color: #b7e0c8; color: #14532d; }
.alert.err { background: var(--err-bg); border-color: #f5c2bd; color: #7a1a12; }
.alert.warn { background: var(--warn-bg); border-color: #f2d7a6; color: #6b4000; }
.alert.info { background: #eef3f9; border-color: #cbd8e8; color: var(--navy-ink); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.badge.submitted, .badge.active { background: var(--ok-bg); color: var(--ok); }
.badge.draft, .badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.missing, .badge.disabled, .badge.draft-excluded { background: #f1f2f4; color: #6b7280; }
.badge.admin { background: var(--gold-soft); color: #7a5512; }
.badge.lvl { background: #eef3f9; color: var(--navy); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #faf8f3; font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.group td { background: #f3efe5; font-weight: 700; color: var(--navy-ink); }
tr.region td { background: var(--navy); color: #fff; font-weight: 700; letter-spacing: .02em; }
tr.subtotal td { background: #eef1f5; font-weight: 700; }
tr.total td { background: var(--gold-soft); font-weight: 800; border-top: 2px solid var(--gold); }
tr.dim td { color: var(--faint); font-style: italic; }
table.compact th, table.compact td { padding: 5px 7px; font-size: 12.5px; }

/* ---------- report sheet (template-like) ---------- */
.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; box-shadow: var(--shadow); }
.sheet-title { text-align: center; border-bottom: 2px solid var(--navy); padding: 0 84px 10px; margin-bottom: 14px; position: relative; min-height: 74px; }
.sheet-title .sheet-logo { position: absolute; left: 0; top: 0; width: 72px; height: 72px; }
@media (max-width: 640px) { .sheet-title { padding: 0 0 10px; min-height: 0; } .sheet-title .sheet-logo { position: static; display: block; margin: 0 auto 6px; width: 56px; height: 56px; } }
.sheet-title .org { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--navy-ink); }
.sheet-title .sub { font-weight: 600; }
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 20px; margin-bottom: 14px; font-size: 13px; }
.meta div span { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .05em; margin-right: 6px; }
@media (max-width: 700px) { .meta { grid-template-columns: 1fr; } }
table.sheetgrid th { background: var(--navy); color: #fff; text-align: center; font-size: 10.5px; padding: 6px 5px; border: 1px solid #2c4b74; }
table.sheetgrid td { border: 1px solid var(--line); padding: 5px 6px; font-size: 12.5px; }
table.sheetgrid tr.total td { border-top: 2px solid var(--gold); }
th.remit { background: #7a5512 !important; border-color: #8d6620 !important; }
.sumbox { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.sumbox div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fcfbf8; }
.sumbox span { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.sumbox b { font-family: var(--serif); font-size: 18px; color: var(--navy-ink); }
@media (max-width: 800px) { .sumbox { grid-template-columns: 1fr 1fr; } }

/* ---------- data entry ---------- */
table.entry { width: max-content; min-width: 100%; }
table.entry input { padding: 5px 6px; font-size: 13px; }
table.entry input[type=date] { width: 138px; }
table.entry input.money { width: 96px; text-align: right; }
table.entry input.int { width: 62px; text-align: right; }
table.entry input.wide { width: 150px; }
#exp input.wide { width: 100%; min-width: 180px; }
table.entry td.calc { font-family: var(--sans); min-width: 70px; }
table.entry td { padding: 4px 4px; border-bottom: 1px solid var(--line-2); }
table.entry td.calc { background: #f8fafc; text-align: right; font-variant-numeric: tabular-nums; color: var(--navy-ink); white-space: nowrap; }
table.entry tr.online td { background: #fbf7ee; }
table.entry tfoot td { font-weight: 700; background: var(--gold-soft); text-align: right; }
.rowdel { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; }
.rowdel:hover { color: var(--err); }
.statsgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 900px) { .statsgrid { grid-template-columns: 1fr 1fr; } }
.sticky-actions { position: sticky; bottom: 0; background: rgba(246,243,236,.96); border-top: 1px solid var(--line); padding: 12px 0; margin-top: 10px; z-index: 5; }
.lockbar { background: var(--ok-bg); border: 1px solid #b7e0c8; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- report selector ---------- */
.picker { border: 1px solid var(--line); border-radius: 8px; max-height: 360px; overflow: auto; background: #fff; }
.picker label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; padding: 6px 10px; border-bottom: 1px solid var(--line-2); margin: 0; cursor: pointer; }
.picker label:hover { background: #f8fafc; }
.picker label input { margin-top: 3px; }
.picker .lvl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 4px; }
.picker .sub { display: block; font-size: 11.5px; color: var(--faint); }
.picker [hidden] { display: none; }
.seg { display: inline-flex; border: 1px solid #cfd6df; border-radius: 8px; overflow: hidden; }
.seg label { margin: 0; padding: 7px 14px; font-weight: 600; cursor: pointer; border-right: 1px solid #cfd6df; background: #fff; display: flex; gap: 6px; align-items: center; }
.seg label:last-child { border-right: 0; }
.seg input { width: auto; }

/* ---------- auth ---------- */
body.auth { background: linear-gradient(160deg, var(--navy-ink) 0%, var(--navy) 55%, #2d5281 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.authbox { width: 100%; max-width: 430px; }
.authbox .brandline { color: #fff; text-align: center; margin-bottom: 18px; }
.authbox .brandline .mark { width: 72px; height: 72px; border-radius: 50%; background: #fff; display: inline-block; margin-bottom: 10px; box-shadow: 0 0 0 3px rgba(255,255,255,.3); }
.authbox .brandline b { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.authbox .brandline small { opacity: .8; font-size: 12.5px; }
.authbox .card { padding: 26px; border: 0; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.authbox .btn { width: 100%; justify-content: center; padding: 10px; }
.qr { text-align: center; margin: 10px 0 16px; }
.qr img { border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: #f4f6f9; padding: 8px 10px; border-radius: 6px; text-align: center; letter-spacing: .06em; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; }
.codes div { background: #f4f6f9; padding: 8px; border-radius: 6px; text-align: center; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 14px; }
.steps li { counter-increment: s; position: relative; padding-left: 30px; margin-bottom: 8px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 21px; height: 21px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; display: grid; place-items: center; font-weight: 700; }

/* ---------- admin ---------- */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.subnav a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a.on { color: var(--navy); border-bottom-color: var(--gold); }
.tree ul { list-style: none; margin: 0; padding-left: 22px; border-left: 1px dashed var(--line); }
.tree > ul { padding-left: 0; border-left: 0; }
.tree li { margin: 3px 0; }
.tree .node { display: inline-flex; gap: 8px; align-items: center; padding: 3px 8px; border-radius: 6px; }
.tree .node:hover { background: #f4f1ea; }
.tree .inactive { opacity: .5; text-decoration: line-through; }
.rates input { min-width: 90px; text-align: right; }
.rates td.cur { font-weight: 700; }
.pill { display: inline-block; background: #eef3f9; color: var(--navy); border-radius: 6px; padding: 1px 7px; margin: 1px 2px 1px 0; font-size: 12px; }
.pill.view { background: #f1f2f4; color: #4b5563; }

/* ---------- print ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; font-size: 10.5px; }
  .topbar, .noprint, .subnav, .sticky-actions, footer { display: none !important; }
  main.wrap { padding: 0; max-width: none; }
  .sheet, .card { box-shadow: none; border: 0; padding: 0; margin: 0 0 8mm; }
  .sheet { page-break-after: always; }
  .sheet:last-child { page-break-after: auto; }
  table.sheetgrid th { background: #1f3a5f !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr.total td, tr.subtotal td, tr.group td, tr.region td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tablewrap { overflow: visible; }
  th, td { padding: 3px 4px; }
}
footer.foot { text-align: center; color: var(--faint); font-size: 12px; padding: 20px; }
table.sheetgrid.compact { width: max-content; min-width: 100%; }
table.sheetgrid.compact td:nth-child(2) { min-width: 230px; }
table.sheetgrid.compact th { min-width: 74px; max-width: 110px; }
@media print { table.sheetgrid.compact { width: 100%; font-size: 8px; } table.sheetgrid.compact td:nth-child(2) { min-width: 0; } table.sheetgrid.compact th { min-width: 0; } }
[hidden] { display: none !important; }
tr.due td { background: var(--gold-soft, #f3e6c8); font-style: italic; font-weight: 700; color: #7a5512; }
tr.total-due td { border-bottom: 2px solid #b8862b; }
.neg { color: var(--err); } .pos { color: var(--ok); }
/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi .v { font: 600 26px var(--serif); color: var(--ink-head); font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
.kpi .d { font-size: 12px; line-height: 1.5; }
.delta.up { color: var(--ok); } .delta.down { color: var(--err); } .delta.flat { color: var(--faint); }
.ytd { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 800px) { .ytd { grid-template-columns: 1fr 1fr; } }
.ytd > div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--subtle); }
.ytd span { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.ytd b { font: 600 20px var(--serif); color: var(--ink-head); display: block; font-variant-numeric: tabular-nums; }
.chartbox { position: relative; height: 260px; }
.figs { margin-top: 10px; font-size: 13px; }
.figs summary { cursor: pointer; color: var(--muted); }
table.sheetgrid.compact.matrix td:nth-child(2) { min-width: 0; }
table.sheetgrid.compact.matrix td:first-child { min-width: 150px; }
/* Provinces with parishes in more than one currency */
table.sheetgrid tr.curhead td { background: #f3f5f8; color: var(--muted, #5b6472); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding-top: 6px; }
table.sheetgrid tr.cursub td { background: #eef3f9; font-weight: 600; }
table.sheetgrid tr.cursub.conv td { background: #f7f9fc; font-weight: 400; font-style: italic; color: #4b5563; }

/* ---------- Help centre ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.helphero { display: flex; gap: 16px; align-items: center; margin: 6px 0 14px; }
.helphero h1 { margin: 0 0 4px; } .helphero p { margin: 0; color: var(--muted, #5b6472); }
.helpsearch { display: flex; gap: 8px; margin: 0 0 16px; }
.helpsearch input { flex: 1; min-width: 0; font-size: 15px; padding: 10px 12px; }
.helpcards { display: grid; gap: 10px; }
.helpcard { display: flex; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; }
.helpcard:hover { border-color: var(--navy); box-shadow: 0 2px 8px rgba(31,58,95,.08); }
.helpcard .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.helpcard b { display: block; color: var(--navy-ink); font-family: var(--serif); font-size: 16px; }
.helpcard .aud { display: block; color: var(--gold); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; margin: 1px 0 3px; }
.helpcard .sum { display: block; font-size: 13px; color: #4b5563; }
.faqgroup { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--gold); margin: 12px 0 4px; }
.faqgroup:first-child { margin-top: 0; }
.faqlist { margin: 0 0 6px; padding-left: 18px; } .faqlist li { margin: 3px 0; }
.helplayout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.helpside { position: sticky; top: 12px; font-size: 13.5px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; max-height: calc(100vh - 24px); overflow: auto; }
.helpside h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #5b6472); margin: 10px 0 6px; }
.helpside ol { padding-left: 18px; margin: 0; } .helpside li { margin: 4px 0; }
.helpside ul { list-style: none; padding-left: 8px; margin: 4px 0 8px; border-left: 2px solid var(--line); font-size: 12.5px; }
.helpside a { color: var(--navy-ink); text-decoration: none; } .helpside a:hover { text-decoration: underline; }
.helpside a.on { font-weight: 700; } .helpside .helphome { font-weight: 600; }
.helpdoc { max-width: 860px; line-height: 1.6; font-size: 15px; }
.helpdoc h1 { margin: 4px 0 6px; } .helpdoc .lead { font-size: 16.5px; color: #374151; }
.helpdoc h2 { margin: 30px 0 8px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 21px; scroll-margin-top: 12px; }
.helpdoc h3 { margin: 20px 0 6px; font-size: 16.5px; scroll-margin-top: 12px; }
.helpdoc table { margin: 8px 0 14px; } .helpdoc td, .helpdoc th { vertical-align: top; }
.helpdoc code { background: #f1f2f4; border-radius: 4px; padding: 0 4px; font-size: 92%; }
.helpdoc li { margin: 3px 0; }
.helpdoc .aud { margin: 0 0 6px; }
.helpnext { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 600; }
details.faq { border: 1px solid var(--line); border-radius: 8px; background: #fff; margin: 8px 0; }
details.faq summary { cursor: pointer; padding: 10px 14px; font-weight: 600; color: var(--navy-ink); }
details.faq[open] summary { border-bottom: 1px solid var(--line); }
details.faq .ans { padding: 2px 14px 6px; }
details.faq:target, details.faq[open] { border-color: #c9d3e1; }
ol.results { padding-left: 20px; } ol.results li { margin: 0 0 14px; }
ol.results .snip { margin: 4px 0 0; color: #374151; font-size: 14px; }
mark { background: #fbe7a6; color: inherit; border-radius: 2px; padding: 0 1px; }
.manualbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.manual { margin: 0 auto; }
.manual .cover { text-align: center; padding: 50px 0 40px; }
.manual .cover h1 { font-size: 32px; line-height: 1.25; margin: 18px 0 8px; }
.manual .chapter > h1 { margin-top: 40px; padding-top: 16px; border-top: 3px solid var(--navy); }
.manual .toc ol li { margin: 6px 0; }
@media (max-width: 860px) { .helplayout { grid-template-columns: 1fr; } .helpside { position: static; max-height: none; } }
@media print {
  .helpside, .helpsearch, .helpnext, .manualbar { display: none !important; }
  .helplayout { display: block; }
  .helpdoc { max-width: none; font-size: 11pt; }
  .manual .cover { page-break-after: always; padding-top: 120px; }
  .manual .toc { page-break-after: always; }
  .manual .chapter { page-break-before: always; } .manual .chapter > h1 { border-top: 0; margin-top: 0; }
  .helpdoc h2, .helpdoc h3 { page-break-after: avoid; } .helpdoc table, .helpdoc li { page-break-inside: avoid; }
}

/* ---------- Sign-off levels ---------- */
.lvlbadge { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; border: 1px solid transparent; }
.lvlbadge.lx { background: #f1f2f4; color: #6b7280; border-color: #e3e5e8; }
.lvlbadge.l0 { background: #fff4dc; color: #8a5a00; border-color: #f2d9a0; }
.lvlbadge.l1 { background: #e8f1fb; color: #1d4f8a; border-color: #c4d9f1; }
.lvlbadge.l2 { background: #ece8fa; color: #4b3a99; border-color: #d3cbf1; }
.lvlbadge.l3 { background: #e3f4ea; color: #17633a; border-color: #b7e0c8; }
.signoff .steps { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 4px 0 12px; counter-reset: step; }
.signoff .steps li { border: 1px solid var(--line); border-top: 4px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; background: #fff; font-size: 13.5px; }
.signoff .steps li.done { border-top-color: #2e8b57; background: #f6fbf8; }
.signoff .steps li.current { border-top-color: var(--gold); box-shadow: 0 0 0 2px rgba(184,134,43,.15); }
.signoff .youbox { background: #f7f9fc; border: 1px solid #dfe6ef; border-radius: 8px; padding: 10px 12px; }
@media (max-width: 900px) { .signoff .steps { grid-template-columns: 1fr 1fr; } }
@media print { .signoff details, .signoff .youbox { display: none; } }
.tiles.six { grid-template-columns: repeat(6, minmax(0,1fr)); }
@media (max-width: 1000px) { .tiles.six { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 600px) { .tiles.six { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.stamps { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin: 0 0 14px; font-size: 12.5px; }
.stamps > div { border: 1px dashed #c8cfd9; border-radius: 6px; padding: 6px 9px; color: #6b7280; }
.stamps > div.ok { border-style: solid; border-color: #b7e0c8; background: #f3faf6; color: #17633a; }
.stamps span { display: block; font-weight: 700; color: var(--navy-ink); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
@media print { .lvlbadge, .stamps > div { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.authrow { border-top: 1px solid var(--line); padding: 10px 0 8px; display: grid; gap: 3px; }
.authrow:first-of-type { border-top: 0; }
.signoff ol.steps li { padding-left: 10px; } .signoff ol.steps li::before { position: static; display: inline-grid; width: 20px; height: 20px; font-size: 11px; margin-bottom: 2px; }
.signoff ol.steps li.skipped { background: repeating-linear-gradient(135deg, #fafafa, #fafafa 6px, #f3f4f6 6px, #f3f4f6 12px); border-top-color: #d1d5db; opacity: .85; }
.lvlbadge.l3 { background: #e3f3f5; color: #135e6b; border-color: #b6dde3; }
.lvlbadge.l4 { background: #e3f4ea; color: #17633a; border-color: #b7e0c8; }
.svcnote { padding: 10px 14px 12px; background: #fffaf0; border-top: 1px solid #f0e2c2; font-size: 13.5px; display: grid; gap: 4px; }
table.entry td.na { background: repeating-linear-gradient(135deg, #fafafa, #fafafa 5px, #f2f2f2 5px, #f2f2f2 10px); }
/* Frozen description columns (public/js/freeze.js) */
.frz { position: sticky; z-index: 2; }
thead .frz { z-index: 3; }
.frz-last { box-shadow: 6px 0 6px -4px rgba(15, 36, 64, .18); }
.frz-label { position: sticky; left: 8px; display: inline-block; }
/* Collapsed borders of scrolled cells would paint over the frozen ones: use separate borders on these tables */
table[data-freeze] { border-collapse: separate; border-spacing: 0; }
table.sheetgrid[data-freeze] td, table.sheetgrid[data-freeze] th { border-top-width: 0; border-left-width: 0; }
table.sheetgrid[data-freeze] tr:first-child > th { border-top-width: 1px; }
table.sheetgrid[data-freeze] tr > :first-child { border-left-width: 1px; }
@media print { .frz { position: static; box-shadow: none; } .frz-label { position: static; } }
