/* Official documents (fee structure, learner fees, ledger) — screen + A4 print. */
.doc { --d-ink: #16241d; --d-muted: #66736c; --d-line: #dfe6e1; --d-forest: #0e4a33; --d-gold: #d98f12;
  background: #fff; color: var(--d-ink); max-width: 900px; margin: 0 auto 24px; padding: clamp(18px, 3vw, 40px); border-radius: 16px; border: 1px solid var(--d-line);
  box-shadow: 0 2px 4px rgba(16, 40, 28, .04), 0 12px 32px -12px rgba(16, 40, 28, .16); font-size: 14px; line-height: 1.45; position: relative; overflow: hidden; }
.doc::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, #0e4a33, #1f7a50 60%, #f4b73e); }
.doc-head { display: flex; gap: 18px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--d-line); }
.doc-crest { width: 84px; height: 84px; flex: none; }
.doc-school h1 { font-family: Fraunces, Georgia, serif; font-weight: 600; color: var(--d-forest); font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 0; letter-spacing: -.01em; }
.doc-school p { margin: 2px 0 0; color: var(--d-muted); font-size: .86rem; }
.doc-motto { font-family: Fraunces, Georgia, serif; font-style: italic; }
.doc-title { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin: 16px 0 10px; }
.doc-title h2 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: var(--d-forest); }
.doc-title p { margin: 0; color: var(--d-muted); font-size: .86rem; }
.doc-terms { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .82rem; color: var(--d-muted); margin: 0 0 14px; }
.doc-table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.doc-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--d-muted); background: #f5f8f6; padding: 9px 10px; border-bottom: 1px solid var(--d-line); }
.doc-table td { padding: 8px 10px; border-bottom: 1px solid #eef2ef; vertical-align: top; }
.doc-table th small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.doc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-table.slim td { padding: 5px 8px; font-size: .88rem; }
.doc-table .neg { color: #b3261e; }
.doc-total td { font-weight: 800; border-top: 2px solid var(--d-line); background: #fafcfb; }
.doc-open td, .doc-close td { background: #f5f8f6; font-weight: 700; }
.doc-ref { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; white-space: nowrap; }
.doc-lines { color: var(--d-muted); font-size: .76rem; margin-top: 2px; }
.doc-grid, .doc-terms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; margin: 8px 0; }
.doc h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--d-gold); margin: 6px 0 6px; }
.doc-term { border: 1px solid var(--d-line); border-radius: 12px; padding: 10px 12px; }
.doc-term h3 { display: flex; justify-content: space-between; align-items: center; }
.doc-badge { font-size: .66rem; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; background: #fff4dc; color: #9a6406; text-transform: none; }
.doc-badge.ok { background: #e8f4ee; color: #15603f; } .doc-badge.muted { background: #eef2ef; color: var(--d-muted); }
.doc-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.doc-summary div { border-radius: 12px; background: #f5f8f6; padding: 10px 12px; }
.doc-summary span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--d-muted); }
.doc-summary b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.doc-summary .due { background: #fdecea; } .doc-summary .due b { color: #b3261e; }
.doc-summary .clear { background: #e8f4ee; } .doc-summary .clear b { color: #15603f; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; background: #f5f8f6; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: .9rem; }
.doc-pay, .doc-notes { margin-top: 14px; }
.doc-pay ul, .doc-notes ol { margin: 0; padding-left: 20px; font-size: .88rem; }
.doc-pay li, .doc-notes li { margin: 3px 0; }
.doc-muted { color: var(--d-muted); } .doc-small { font-size: .8rem; }
.doc-foot { margin-top: 18px; padding-top: 10px; border-top: 1px dashed var(--d-line); font-size: .76rem; color: var(--d-muted); text-align: center; }
@media (max-width: 640px) {
  .doc { padding: 16px 12px; border-radius: 12px; font-size: 13px; }
  .doc-head { gap: 12px; } .doc-crest { width: 60px; height: 60px; }
  .doc-table:not(.slim) { display: block; overflow-x: auto; white-space: nowrap; }
  .doc-summary { grid-template-columns: 1fr; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  .doc { box-shadow: none; border: none; max-width: none; padding: 0; margin: 0; font-size: 11.5px; }
  .doc::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-table th, .doc-total td, .doc-open td, .doc-close td, .doc-summary div, .doc-badge, .doc-meta { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-table:not(.slim) { display: table; white-space: normal; }
  .doc-table tr { break-inside: avoid; }
}
.doc-table.ledger td:first-child, .doc-table.ledger td:nth-child(2) { white-space: nowrap; }
.doc-policy { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: #fdecea; color: #7a1b14; font-size: .86rem; border-left: 4px solid #b3261e; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-acct { font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; }

/* ---------- Fee structure (schedule of fees) ---------- */
.doc .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fs { --b-pre: #d98f12; --b-lower: #1f7a50; --b-upper: #0e4a33; --b-junior: #2b3f8c; --paper: #f6f8f6; }
.fs-head { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; align-items: center; padding-bottom: 14px; border-bottom: 2px solid var(--d-forest); position: relative; }
.fs-head::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 88px; height: 2px; background: var(--d-gold); }
.fs-letter { display: flex; gap: 16px; align-items: center; min-width: 0; }
.fs-id { border-left: 1px solid var(--d-line); padding-left: 20px; }
.fs-kicker { margin: 0; font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--d-gold); }
.fs-id h2 { margin: 2px 0 6px; font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 1.55rem; line-height: 1.05; color: var(--d-forest); letter-spacing: -.01em; white-space: nowrap; }
.fs-id h2 span { color: var(--d-ink); }
.fs-id dl { display: grid; grid-template-columns: auto auto; gap: 1px 10px; margin: 0; font-size: .76rem; }
.fs-id dt { color: var(--d-muted); } .fs-id dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.fs-scope { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 12px 0 14px; font-size: .8rem; color: var(--d-muted); }
.fs-scope span:not(:last-child)::after { content: "·"; margin: 0 10px; color: var(--d-line); }
.fs-scope span:first-child { color: var(--d-ink); font-weight: 700; }

/* The matrix: class groups across, charges down. */
.fs-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--d-line); border-radius: 14px; }
.fs-matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; min-width: calc(170px + var(--cols) * 76px); }
.fs-matrix th, .fs-matrix td { padding: 6px 12px; border-bottom: 1px solid #edf1ee; text-align: left; font-weight: 500; }
.fs-matrix th[scope="row"] { font-weight: 600; background: #fff; position: sticky; left: 0; z-index: 1; }
.fs-matrix th[scope="row"] small { display: block; font-weight: 500; color: var(--d-muted); font-size: .72rem; margin-top: 1px; }
.fs-matrix .num { text-align: right; white-space: nowrap; }
.fs-matrix .fs-na { color: #b8c2bc; }
.fs-bands th { font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; text-align: center; padding: 8px 6px 4px; border-bottom: 0; background: var(--paper); }
.fs-bands td { background: var(--paper); border-bottom: 0; position: sticky; left: 0; }
.fs-bands .b-pre { color: #9a6406; } .fs-bands .b-lower { color: var(--b-lower); } .fs-bands .b-upper { color: var(--b-upper); } .fs-bands .b-junior { color: var(--b-junior); }
.fs-classes th { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 1rem; color: var(--d-forest); text-align: right; padding: 2px 12px 8px; background: var(--paper); border-bottom: 1px solid var(--d-line); box-shadow: inset 0 -3px 0 var(--bc, var(--d-forest)); white-space: nowrap; }
.fs-classes .b-pre { --bc: var(--b-pre); } .fs-classes .b-lower { --bc: var(--b-lower); } .fs-classes .b-upper { --bc: var(--b-upper); } .fs-classes .b-junior { --bc: var(--b-junior); }
.fs-classes .fs-corner { font-family: inherit; font-size: .66rem; font-weight: 800; letter-spacing: .12em; color: var(--d-muted); text-align: left; vertical-align: bottom; box-shadow: none; position: sticky; left: 0; z-index: 2; }
.fs-sec th { font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--d-gold); padding: 12px 12px 4px; border-bottom: 0; }
.fs-sec th small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--d-muted); font-size: .72rem; margin-left: 6px; }
.fs-sub th, .fs-sub td { font-weight: 800; background: var(--paper) !important; border-top: 1px solid var(--d-line); }
.fs-schedule td { font-weight: 700; font-size: 1.02em; }
.fs-schedule tr:not(.fs-sec) th, .fs-schedule tr:not(.fs-sec) td { padding-top: 7px; padding-bottom: 7px; }
.fs-matrix tfoot th, .fs-matrix tfoot td { background: var(--d-forest) !important; color: #fff; font-weight: 800; border: 0; padding-top: 10px; padding-bottom: 10px; }
.fs-matrix tfoot td { font-size: 1.12em; }
.fs-matrix tfoot th { text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; }

/* New learners / optional / changes ahead */
.fs-boxes { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.fs-boxes.n1 { --n: 1; } .fs-boxes.n2 { --n: 2; }
.fs-box { border: 1px solid var(--d-line); border-radius: 12px; padding: 10px 12px; break-inside: avoid; }
.fs-box h3 { margin-top: 0; }
.fs-list { list-style: none; padding: 0; margin: 0; }
.fs-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: baseline; font-size: .86rem; padding: 3px 0; }
.fs-list li + li { border-top: 1px dashed var(--d-line); padding-top: 6px; }
.fs-list li > b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fs-list li > small { grid-column: 1 / -1; color: var(--d-muted); font-size: .74rem; }
.fs-list li > span small { color: var(--d-muted); }
.fs-soon { background: #fff8e8; border-color: #f1dca8; }
.fs-soon li > small b { color: #9a6406; }

/* How to pay */
.fs-section { margin-top: 16px; break-inside: avoid; }
.fs-pays { display: grid; gap: 12px; }
.fs-pays.two { grid-template-columns: 1.7fr 1fr; }
.fs-pay { border-radius: 14px; padding: 10px 14px 12px; font-size: .86rem; }
.fs-pay.mpesa { background: #eef8f1; border: 1px solid #cfe8d8; }
.fs-pay.bank { background: #f3f6fb; border: 1px solid #dbe3f0; }
.fs-pay-tag { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; background: var(--d-forest); color: #fff; border-radius: 99px; padding: 2px 10px; margin-bottom: 8px; }
.fs-pay.bank .fs-pay-tag { background: #2f4f7a; }
.fs-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fs-steps li { position: relative; padding-left: 30px; display: flex; flex-direction: column; min-width: 0; }
.fs-steps i { position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1.5px solid var(--d-forest); color: var(--d-forest); font-style: normal; font-weight: 800; font-size: .74rem; display: grid; place-items: center; }
.fs-steps span { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--d-muted); }
.fs-steps b { font-size: .92rem; line-height: 1.25; overflow-wrap: anywhere; }
.fs-steps b .doc-acct { font-size: 1.02rem; }
.fs-steps small { color: var(--d-muted); font-size: .72rem; line-height: 1.3; margin-top: 1px; }
.fs-pay dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.fs-pay dt { color: var(--d-muted); font-size: .8rem; } .fs-pay dd { margin: 0; font-weight: 600; }
.fs .doc-policy, .fs-howto .doc-policy { margin-top: 10px; }

/* Terms + verification */
.fs-foot-grid { display: grid; grid-template-columns: 1fr 290px; gap: 16px; align-items: start; }
.fs-terms-cond ol { margin: 0; padding-left: 18px; font-size: .8rem; color: #34423a; }
.fs-terms-cond li { margin: 2px 0; }
.fs-verify { margin-top: 16px; display: flex; gap: 12px; align-items: flex-start; border: 1.5px dashed #b9cfc2; border-radius: 14px; padding: 12px; background: #fbfdfc; break-inside: avoid; }
.fs-verify h3 { margin: 0 0 4px; }
.fs-verify p { margin: 0 0 4px; font-size: .78rem; }
.fs-qr { flex: none; width: 92px; height: 92px; }
.fs-qr svg { width: 100%; height: 100%; display: block; }
.fs-ref { font-size: .95rem !important; font-weight: 800; color: var(--d-forest); letter-spacing: .06em; }

/* Signatures + stamp */
.fs-sign { display: grid; grid-template-columns: 1fr 1fr 110px; gap: 24px; align-items: end; margin-top: 22px; break-inside: avoid; }
.fs-sign > div:not(.fs-stamp) { display: flex; flex-direction: column; font-size: .8rem; }
.fs-line { display: block; border-bottom: 1px solid var(--d-ink); height: 30px; margin-bottom: 4px; }
.fs-sign small { color: var(--d-muted); font-size: .72rem; }
.fs-stamp { width: 96px; height: 96px; border-radius: 50%; border: 1.5px dashed #b8c2bc; display: grid; place-items: center; text-align: center; justify-self: end; }
.fs-stamp span { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: #9aa59f; line-height: 1.4; }

@media (max-width: 720px) {
  .fs-head { grid-template-columns: 1fr; }
  .fs-id { border-left: 0; padding-left: 0; border-top: 1px solid var(--d-line); padding-top: 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
  .fs-id .fs-kicker { width: 100%; } .fs-id h2 { font-size: 1.3rem; margin: 0; }
  .fs-id dl { display: flex; flex-wrap: wrap; gap: 2px 6px; } .fs-id dd { margin-right: 10px; white-space: nowrap; }
  .fs-boxes, .fs-pays.two, .fs-foot-grid { grid-template-columns: 1fr; }
  .fs-steps { grid-template-columns: 1fr 1fr; gap: 10px 8px; }
  .fs-matrix { min-width: calc(118px + var(--cols) * 60px); font-size: .8rem; }
  .fs-matrix th, .fs-matrix td { padding-left: 7px; padding-right: 7px; }
  .fs-matrix th[scope="row"] { width: 118px; box-shadow: 1px 0 0 var(--d-line); }
  .fs-classes th { font-size: .88rem; }
  .fs-runs { display: none; }
  .fs-sign { grid-template-columns: 1fr 1fr; } .fs-stamp { grid-column: 1 / -1; justify-self: start; }
}
@media print {
  /* Sizes are rem-based, so scale the whole document to fit one A4 page. */
  .fs { zoom: .74; padding-top: 18px !important; }
  .fs .doc-crest { width: 64px; height: 64px; }
  .fs-head { padding-bottom: 10px; }
  .fs-scope { margin: 8px 0 10px; }
  .fs-scroll { overflow: visible; }
  .fs-matrix { min-width: 0; }
  .fs-matrix th[scope="row"] { width: 54%; }
  .fs-matrix th, .fs-matrix td { padding: 3px 12px; }
  .fs-matrix th[scope="row"] small { display: inline; margin-left: 8px; }
  .fs-schedule tr:not(.fs-sec) th, .fs-schedule tr:not(.fs-sec) td { padding-top: 4px; padding-bottom: 4px; }
  .fs-sec th { padding: 7px 12px 2px; }
  .fs-bands th { padding-top: 6px; } .fs-classes th { padding-bottom: 6px; }
  .fs-matrix tfoot th, .fs-matrix tfoot td { padding-top: 6px; padding-bottom: 6px; }
  .fs-boxes { margin-top: 10px; gap: 10px; } .fs-box { padding: 7px 12px; }
  .fs-section { margin-top: 10px; } .fs-pay { padding: 8px 14px 10px; }
  .fs-foot-grid { grid-template-columns: 1fr 300px; }
  .fs-verify { margin-top: 10px; padding: 10px; } .fs-qr { width: 84px; height: 84px; }
  .fs-sign { margin-top: 12px; } .fs-line { height: 26px; } .fs-stamp { width: 84px; height: 84px; }
  .fs .doc-foot { margin-top: 10px; }
  .fs-bands th, .fs-bands td, .fs-classes th, .fs-sub th, .fs-sub td, .fs-matrix tfoot th, .fs-matrix tfoot td, .fs-soon, .fs-pay, .fs-pay-tag, .fs-verify,
  .fs-head, .fs-head::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- A learner's fee structure (same look as the school's) ---------- */
.lf-who { display: grid; grid-template-columns: minmax(180px, auto) 1fr; gap: 10px 24px; align-items: center; margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; background: var(--paper); }
.lf-name span, .lf-who dt { display: block; font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--d-muted); }
.lf-name b { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 1.35rem; color: var(--d-forest); line-height: 1.15; }
.lf-who dl { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.lf-who dd { margin: 1px 0 0; font-weight: 600; font-size: .88rem; }
.lf-matrix { min-width: calc(200px + var(--cols) * 88px); }
.lf-matrix .fs-classes th { font-family: inherit; vertical-align: bottom; }
.lf-matrix .fs-classes th small { display: block; font-size: .7rem; font-weight: 500; color: var(--d-muted); margin-top: 2px; }
.lf-term { display: block; font-family: Fraunces, Georgia, serif; font-size: 1rem; font-weight: 600; color: var(--d-forest); }
.lf-matrix td.lf-yearcol { background: #f9fbfa; font-weight: 700; }
.lf-matrix .fs-classes th.lf-yearcol { box-shadow: inset 0 -3px 0 var(--d-gold); }
.lf-matrix .neg { color: #b3261e; }
.lf-chip { display: inline-block; margin: 2px 0 1px; font-family: "Plus Jakarta Sans", system-ui, sans-serif; font-size: .6rem; font-weight: 800; letter-spacing: .04em; padding: 1px 7px; border-radius: 99px; background: #fff4dc; color: #9a6406; }
@media (max-width: 720px) {
  .lf-who { grid-template-columns: 1fr; }
  .lf-matrix { min-width: calc(140px + var(--cols) * 70px); }
  .lf-matrix th[scope="row"] { min-width: 140px; } .lf-matrix th[scope="row"] small { display: none; }
}
@media print {
  .lf-who, .lf-chip, .lf-matrix td.lf-yearcol { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lf-who { margin-bottom: 10px; padding: 8px 14px; }
  .lf-matrix th[scope="row"] { width: 40%; }
}
.fs-pay.bank.sample { background: repeating-linear-gradient(135deg, #f3f6fb 0 12px, #eef1f6 12px 24px); border-style: dashed; }
.fs-pay.bank.sample dd.doc-acct { color: #7d8983; text-decoration: line-through; }
.fs-sample-note { margin: 8px 0 0; font-size: .76rem; color: #7a4d05; background: #fff4dc; border-radius: 8px; padding: 6px 10px; }
@media print { .fs-pay.bank.sample, .fs-sample-note { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- Signature, stamp and verification (public/js/docauth.js) ---------- */
.da-seal { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-items: center; margin-top: 22px; break-inside: avoid; page-break-inside: avoid; }
.da-lines { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px 28px; }
.da-line { flex: 1 1 190px; max-width: 340px; display: flex; flex-direction: column; position: relative; padding-top: 58px; justify-content: flex-end; font-size: .8rem; }
.da-rule { display: block; border-bottom: 1px solid #16241d; margin-bottom: 4px; }
.da-line b { font-weight: 700; } .da-line small { color: #66736c; font-size: .72rem; }
.da-sig { position: absolute; left: 2px; top: 2px; height: 62px; max-width: 78%; object-fit: contain; object-position: left bottom; }
.da-stamp { width: 104px; height: 104px; border-radius: 50%; border: 1.5px dashed #b8c2bc; display: grid; place-items: center; text-align: center; justify-self: start; margin: -30px 0 0 40px; }
.da-stamp span { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: #9aa59f; line-height: 1.4; }
.da-stamp.has { border: 0; transform: rotate(-8deg); }
.da-stamp.has img { width: 112px; height: 112px; object-fit: contain; opacity: .9; mix-blend-mode: multiply; }
.da-verify { display: flex; gap: 10px; align-items: center; border: 1.5px dashed #b9cfc2; border-radius: 12px; padding: 8px 10px; background: #fbfdfc; max-width: 300px; justify-self: end; }
.da-verify b { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #d98f12; }
.da-code { display: block; font-family: ui-monospace, Consolas, monospace; font-weight: 800; color: #0e4a33; letter-spacing: .04em; font-size: .86rem; margin: 2px 0; }
.da-verify small { display: block; color: #66736c; font-size: .68rem; line-height: 1.3; }
.da-qr { flex: none; } .da-qr svg { width: 100%; height: 100%; display: block; }
@media (max-width: 640px) {
  .da-seal { grid-template-columns: 1fr; } .da-stamp { margin: -20px 0 0 20px; } .da-verify { max-width: none; justify-self: stretch; }
}
@media print {
  .da-sig, .da-stamp.has img, .da-verify { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.da-revoked { margin-top: 18px; padding: 12px 14px; border: 2px solid #b3261e; border-radius: 10px; color: #b3261e; background: #fdecea; font-size: .86rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.da-stamp-on { position: absolute; right: -6px; top: -4px; width: 92px; height: 92px; transform: rotate(-8deg); opacity: .9; pointer-events: none; container-type: inline-size; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.da-stamp-on img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.da-stamp.has { position: relative; container-type: inline-size; }
/* The document's date printed in a generated stamp's band, in the stamp's ink. */
.da-sdate { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font: 800 7.4cqw/1 "Plus Jakarta Sans", Arial, sans-serif; letter-spacing: 0; white-space: nowrap; mix-blend-mode: multiply; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.da-line:has(.da-stamp-on) { padding-right: 70px; min-height: 84px; }

/* How to pay: numbered options (Lipa Karo, direct bank deposit) */
.fs-pays { grid-template-columns: 1fr !important; }
.fs-opt { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.fs-opt > i { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--d-forest); color: #fff; font-style: normal; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.fs-pay.bank .fs-opt > i { background: #2f4f7a; }
.fs-opt b { display: block; font-size: .95rem; } .fs-opt small { color: var(--d-muted); font-size: .76rem; }
.fs-opt .fs-pay-tag { margin: 0 0 0 auto; background: #9a6406; }
.fs-pay dl.fs-bankrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.fs-bankrow dt { font-size: .68rem !important; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fs-bankrow dd { margin: 2px 0 0; font-weight: 700; }
.fs-pending { display: inline-block; font-family: "Plus Jakarta Sans", system-ui, sans-serif; font-size: .78rem; font-weight: 700; letter-spacing: 0; color: #9a6406; background: #fff4dc; border: 1px dashed #e0b35a; border-radius: 6px; padding: 0 6px; }
.fs-pay.pending { background-image: repeating-linear-gradient(135deg, transparent 0 12px, rgba(0,0,0,.018) 12px 24px); border-style: dashed; }
@media (max-width: 720px) { .fs-pay dl.fs-bankrow { grid-template-columns: 1fr 1fr; } }
@media print { .fs-opt > i, .fs-pending, .fs-opt .fs-pay-tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.fs-sign .da-stamp { margin: 0; justify-self: end; }
.fs-sign .da-line { max-width: none; }
.da-mark { font-family: ui-monospace, Consolas, monospace; font-size: .64rem; color: #0e4a33; letter-spacing: .03em; white-space: nowrap; }

/* Print: keep fee structures (school and personal) on one A4 page now that
   they carry signatures, a stamp and two payment options. */
@media print {
  .fs { zoom: .69; }
  .fs .fs-sign { margin-top: 6px; gap: 16px; }
  .fs .da-line { padding-top: 48px; }
  .fs .da-sig { height: 52px; }
  .fs .da-stamp { width: 82px; height: 82px; }
  .fs .da-stamp.has img { width: 88px; height: 88px; }
  .fs .fs-pay { padding: 6px 12px 8px; } .fs .fs-opt { margin-bottom: 6px; }
  .fs .fs-howto .doc-policy { padding: 6px 12px; margin-top: 6px; }
  .fs .fs-sample-note { margin-top: 4px; padding: 3px 8px; }
  .fs .fs-verify { margin-top: 8px; padding: 8px; } .fs .fs-qr { width: 72px; height: 72px; }
  .fs .fs-boxes { margin-top: 8px; } .fs .fs-section { margin-top: 8px; }
  .fs .doc-foot { margin-top: 6px; padding-top: 6px; }
  .fs .lf-who { margin-bottom: 8px; padding: 6px 12px; }
}

/* ============ PP2 (ECDE) leaving certificate — public/js/ecde.js ============ */
/* Self-hosted certificate type (SIL Open Font Licence): engraved capitals,
   book text and a formal script for the learner's name. */
@font-face { font-family: 'Cinzel'; src: url('/fonts/cinzel.woff2') format('woff2'); font-weight: 400 900; font-display: block; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorantgaramond.woff2') format('woff2'); font-weight: 300 700; font-display: block; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorantgaramond-italic.woff2') format('woff2'); font-style: italic; font-weight: 300 700; font-display: block; }
@font-face { font-family: 'Pinyon Script'; src: url('/fonts/pinyonscript.woff2') format('woff2'); font-display: block; }
.ec-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ec-stack { display: grid; gap: 28px; justify-items: center; }
.ec-sheet { position: relative; width: min(100%, 210mm); aspect-ratio: 210 / 297; container-type: inline-size; background: #fbf6e8; box-shadow: 0 10px 30px rgba(40, 30, 10, .22), 0 1px 3px rgba(40, 30, 10, .2); overflow: hidden; color: #2b2b2b; }
.ec-sheet > * { --u: calc(100cqw / 210); }
.ec-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Centred via each class: rules like `.ec-defs text` don't reach the copies <use> draws. */
.ec-gov1, .ec-gov2, .ec-school, .ec-sub, .ec-title, .ec-sub2, .ec-ph, .ec-ph2, .ec-nol, .ec-no, .ec-issued, .ec-code, .ec-ver, .ec-certify, .ec-rmh, .ec-rm, .ec-sl, .ec-sn, .ec-sealc, .ec-sealy, .ec-foot, .ec-nos { text-anchor: middle; }
.ec-micro { font: 500 1.05px 'Cinzel', serif; fill: #14295c; letter-spacing: .05px; text-anchor: start !important; }
.ec-gov1 { font: 700 3.5px 'Cinzel', serif; fill: #14295c; letter-spacing: .9px; }
.ec-gov2 { font: 600 2.75px 'Cinzel', serif; fill: #14295c; letter-spacing: 1.1px; }
.ec-school { font: 700 8.4px 'Cinzel', serif; fill: #8a1424; letter-spacing: .3px; }
.ec-sub { font: italic 500 3.45px 'Cormorant Garamond', serif; fill: #14295c; }
.ec-title { font: 700 12.6px 'Cinzel', serif; stroke: #6b4a0e; stroke-width: .12; paint-order: stroke; letter-spacing: .4px; }
.ec-sub2 { font: 600 3px 'Cinzel', serif; fill: #14295c; letter-spacing: 1.35px; }
.ec-ph { font: italic 500 3px 'Cormorant Garamond', serif; fill: #8d8064; }
.ec-ph2 { font: 600 2px 'Cinzel', serif; fill: #a39573; letter-spacing: .4px; }
.ec-nol { font: 700 2.2px 'Cinzel', serif; fill: #8a6216; letter-spacing: .9px; }
.ec-no { font: 700 4.8px 'Cormorant Garamond', serif; fill: #14295c; }
.ec-issued { font: italic 500 2.75px 'Cormorant Garamond', serif; fill: #4a4a4a; }
.ec-code { font: 600 2.05px 'Cinzel', serif; fill: #14295c; letter-spacing: .35px; }
.ec-ver { font: italic 500 2.3px 'Cormorant Garamond', serif; fill: #5a5a5a; }
.ec-certify { font: italic 500 5.6px 'Cormorant Garamond', serif; fill: #14295c; }
.ec-rmh { font: 700 2.4px 'Cinzel', serif; fill: #8a6216; letter-spacing: 1.5px; }
.ec-rm { font: 600 3.9px 'Cormorant Garamond', serif; fill: #14295c; }
.ec-rml { font: 700 2.3px 'Cinzel', serif; fill: #8a6216; letter-spacing: .8px; }
.ec-sl { font: 700 2.6px 'Cinzel', serif; fill: #14295c; letter-spacing: 1px; }
.ec-sn { font: italic 500 2.75px 'Cormorant Garamond', serif; fill: #3d3d3d; }
.ec-sealt { font: 700 1.75px 'Cinzel', serif; fill: #5e400a; letter-spacing: .15px; }
.ec-sealc { font: 700 3.3px 'Cinzel', serif; fill: #5e400a; letter-spacing: .3px; }
.ec-sealy { font: 700 2.6px 'Cinzel', serif; fill: #5e400a; letter-spacing: .3px; }
.ec-foot { font: italic 600 2.95px 'Cormorant Garamond', serif; fill: #8a1424; letter-spacing: .1px; }
.ec-photo { position: absolute; left: calc(var(--u) * 87.5); top: calc(var(--u) * 111); width: calc(var(--u) * 35); height: calc(var(--u) * 45); object-fit: cover; }
.ec-body { position: absolute; left: calc(var(--u) * 24); right: calc(var(--u) * 24); top: calc(var(--u) * 169.5); height: calc(var(--u) * 58); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; font-size: calc(var(--u) * 4.4); line-height: 1.36; color: #2b2b2b; }
.ec-body b { font-weight: 700; color: #14295c; }
.ec-body p { margin: calc(var(--u) * 1.5) 0 0; }
.ec-name { font-family: 'Pinyon Script', 'Cormorant Garamond', cursive; font-size: calc(var(--u) * 11.5); line-height: 1.12; color: #14295c; padding: 0 calc(var(--u) * 4); }
.ec-rule { position: relative; width: calc(var(--u) * 118); height: calc(var(--u) * .3); margin: calc(var(--u) * .6) 0 calc(var(--u) * 1.6); background: linear-gradient(90deg, transparent, #b8892c 18%, #f0d98c 50%, #b8892c 82%, transparent); }
.ec-rule::after { content: ''; position: absolute; left: 50%; top: 50%; width: calc(var(--u) * 1.8); height: calc(var(--u) * 1.8); background: #8a1424; transform: translate(-50%, -50%) rotate(45deg); outline: calc(var(--u) * .35) solid #fbf6e8; }
.ec-ids { font: 600 calc(var(--u) * 2.5) 'Cinzel', serif; letter-spacing: .14em; color: #4a5470; text-transform: uppercase; }
.ec-ids i { font-style: normal; color: #b8892c; margin: 0 .7em; }
.ec-is { font-style: italic; color: #4a4a4a; margin-top: calc(var(--u) * 2.4) !important; }
.ec-award { font: 700 calc(var(--u) * 7.2) 'Cinzel', serif; letter-spacing: .04em; line-height: 1.2; margin: calc(var(--u) * 1.2) 0 calc(var(--u) * .6); background: linear-gradient(180deg, #8a6216, #d9b65c 40%, #8a6216 75%, #b8892c); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ec-sig { position: absolute; top: calc(var(--u) * 248); width: calc(var(--u) * 52); height: calc(var(--u) * 13); object-fit: contain; object-position: center bottom; }
.ec-stamp { position: absolute; left: calc(var(--u) * 66); top: calc(var(--u) * 239.5); width: calc(var(--u) * 22); height: calc(var(--u) * 22); object-fit: contain; transform: rotate(-9deg); opacity: .88; mix-blend-mode: multiply; }
/* Award certificates: A4 landscape (public/js/ecde.js awardHtml). */
.ec-sheet.land { width: min(100%, 297mm); aspect-ratio: 297 / 210; }
.ec-sheet.land > * { --u: calc(100cqw / 297); }
.ec-nos { font: 700 2.9px 'Cormorant Garamond', serif; fill: #14295c; }
.land .ec-body { left: calc(var(--u) * 44); right: calc(var(--u) * 44); top: calc(var(--u) * 100.5); height: calc(var(--u) * 56); }
.land .ec-name { font-size: calc(var(--u) * 13); }
.land .ec-rule { width: calc(var(--u) * 150); margin-bottom: calc(var(--u) * 1.2); }
.land .ec-is { margin-top: calc(var(--u) * 1.6) !important; font-size: calc(var(--u) * 4.2); }
.land .ec-award { font-size: calc(var(--u) * 8); margin: calc(var(--u) * .4) 0 calc(var(--u) * .2); }
.ec-cite { font-style: italic; font-size: calc(var(--u) * 4.3); color: #333; margin-top: calc(var(--u) * .6) !important; max-width: calc(var(--u) * 190); }
.ec-given { font: 600 calc(var(--u) * 2.45) 'Cinzel', serif; letter-spacing: .12em; text-transform: uppercase; color: #4a5470; margin-top: calc(var(--u) * 2.6); }
.ec-given i { font-style: normal; color: #b8892c; margin: 0 .7em; }
.land .ec-sig { top: calc(var(--u) * 166); }
.ec-code-s { font-size: 1.75px; letter-spacing: .2px; }
.land .ec-stamp { left: calc(var(--u) * 101); top: calc(var(--u) * 160); width: calc(var(--u) * 21); height: calc(var(--u) * 21); }
/* The three certificate families: a title on a ribbon banner (leaving, award), green awards, royal-navy merit. */
.ec-title-b { font-size: 9.6px; stroke: #3d2a05; stroke-width: .1; letter-spacing: .5px; }
.ec-school-g { fill: #0e4a33; } .ec-sub-g, .ec-certify-g, .ec-sl-g { fill: #0e4a33; }
.ec-school-r { fill: #8a1424; font-size: 7.6px; } .ec-sub-r, .ec-sl-r { fill: #123a7a; }
.ec-of { font: 700 4.6px 'Cinzel', serif; fill: #123a7a; letter-spacing: 3.2px; text-anchor: middle; }
.ec-rz { font: 700 9.4px 'Cinzel', serif; fill: #123a7a; text-anchor: middle; }
.ec-rzs { font-size: 10px; fill: #b8892c; }
.ec-rz2 { font: 700 1.9px 'Cinzel', serif; fill: #8a6216; letter-spacing: .7px; text-anchor: middle; }
.ec-dv { font: 700 7.4px 'Cinzel', serif; fill: #123a7a; text-anchor: middle; }
.ec-dp { font-size: 3.6px; }
.ec-dl { font: 700 1.75px 'Cinzel', serif; fill: #8a6216; letter-spacing: .5px; text-anchor: middle; }
.ec-pno { font: 700 2.7px 'Cormorant Garamond', serif; fill: #f3df9c; text-anchor: middle; }
.ec-pcode { font: 600 1.6px 'Cinzel', serif; fill: #d9b65c; letter-spacing: .2px; text-anchor: middle; }
.ec-award-c .ec-body { top: calc(var(--u) * 101.5); height: calc(var(--u) * 50); }
.ec-award-c .ec-name, .ec-award-c .ec-ids { color: #0e4a33; }
.ec-award-c .ec-rule::after { background: #0e4a33; }
.ec-merit .ec-body { left: calc(var(--u) * 95); right: calc(var(--u) * 24); top: calc(var(--u) * 80); height: calc(var(--u) * 70); }
.ec-merit .ec-name { color: #123a7a; font-size: calc(var(--u) * 12.5); }
.ec-merit .ec-rule { width: calc(var(--u) * 130); }
.ec-merit .ec-cite { max-width: calc(var(--u) * 170); font-style: normal; }
.ec-merit .ec-cite b { color: #123a7a; }
.ec-pres { font-style: italic; font-size: calc(var(--u) * 4.6); color: #123a7a; margin: 0 0 calc(var(--u) * .4) !important; }
.ec-merit .ec-stamp { left: calc(var(--u) * 238); top: calc(var(--u) * 160); width: calc(var(--u) * 20); height: calc(var(--u) * 20); }
.ec-award-c .ec-stamp { left: calc(var(--u) * 240); top: calc(var(--u) * 160); width: calc(var(--u) * 20); height: calc(var(--u) * 20); }
.ec-revoked { position: absolute; left: 10%; right: 10%; top: 46%; padding: 2% 0; text-align: center; font: 700 calc(var(--u) * 6) 'Cinzel', serif; color: #c8102e; border: calc(var(--u) * .8) solid #c8102e; background: rgba(255, 255, 255, .85); transform: rotate(-12deg); }
@media print {
  /* Wide-screen scaling (public/js/scale.js) zooms the page; paper is always true size. */
  html { zoom: 1 !important; }
  .ec-stack { display: block; }
  .ec-sheet { width: 210mm; height: 297mm; aspect-ratio: auto; box-shadow: none; margin: 0; break-after: page; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ec-sheet:last-child { break-after: auto; page-break-after: auto; }
  .ec-sheet.land { width: 297mm; height: 210mm; page: eclan; }
  .ec-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Transfer letter (public/js/transfers.js) */
.tl-page { max-width: 180mm; margin: 0 auto 30px; background: #fff; color: #1d2621; font: 11pt/1.55 Georgia, 'Times New Roman', serif; padding: 10mm 12mm; box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.tl-head { display: flex; gap: 12px; align-items: center; border-bottom: 2px solid #0e4a33; padding-bottom: 8px; }
.tl-head > img:first-child { width: 64px; height: 64px; }
.tl-head > div { flex: 1; } .tl-head b { display: block; color: #0e4a33; font-size: 15pt; letter-spacing: .04em; } .tl-head span { display: block; font-size: 9pt; color: #555; } .tl-head i { font-size: 9pt; color: #8a6114; }
.tl-photo { width: 26mm; height: 33mm; object-fit: cover; border: 1px solid #ccc; padding: 1px; }
.tl-ref { display: flex; justify-content: space-between; margin: 12px 0; font-size: 10pt; }
.tl-page h2 { font-size: 11pt; text-decoration: underline; margin: 14px 0 8px; }
.tl-t { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 10.5pt; } .tl-t td { padding: 4px 6px; border-bottom: 1px solid #e3e3e3; } .tl-t td:first-child { width: 40%; color: #555; }
@media print { .tl-page { box-shadow: none; padding: 0; margin: 0; max-width: none; } }
.tl-page p { margin: 0 0 9px; }

/* personalised security microtext (number · name · admission No.) */
.ec-pmicro { font: 600 .9px 'Cinzel', serif; fill: #6b5418; letter-spacing: .02em; opacity: .85; }
