/* Vaakam Class. Builds on the Vaakam tokens (assets/brand/vaakam-tokens.css), same language as Vaakam Clinic.
   The institute's colour arrives as --accent / --on-accent from class.config.json (theme), set by src/ui/app.js.
   The accent has one job: what a parent or the desk should press or read first (primary button, selected choice,
   the fee total, focus ring). Everything else is ink, paper and hairlines. Numbers are set in the mono face. */
:root {
  --accent: var(--signal);
  --on-accent: var(--on-signal);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
  --font-ui: 'Anek Latin', 'Noto Sans Devanagari', 'Nirmala UI', 'Anek Devanagari', system-ui, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Noto Sans Devanagari', 'Nirmala UI', system-ui, sans-serif;
  --surface: var(--surface-raised);
  --tint: color-mix(in srgb, var(--accent) 8%, var(--surface));
  --ok: #2F6B3F; --warn: #8A5A00; --bad: #A3341C;
  --page-max: 1160px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--p-ink-900); --fg: var(--p-paper-100); --muted: var(--p-stone-400); --line: var(--p-ink-700);
    --card: var(--p-ink-800); --surface: var(--p-ink-800); --surface-raised: var(--p-ink-800);
    --accent: var(--accent-dark, var(--accent)); --on-accent: var(--on-accent-dark, var(--on-accent));
    --ok: #8FC79B; --warn: #E2B45C; --bad: #F0937C;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 var(--fs-sm)/var(--lh-body) var(--font-ui); -webkit-font-smoothing: antialiased; }
:lang(hi) body, body:lang(hi) { line-height: 1.7; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.1; margin: 0; font-weight: 650; }
:lang(hi) h1, :lang(hi) h2, :lang(hi) h3 { letter-spacing: 0; line-height: 1.3; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.bad { color: var(--bad); }
.skip { position: absolute; left: var(--s-4); top: -60px; background: var(--fg); color: var(--bg); padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); z-index: 100; }
.skip:focus { top: var(--s-2); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.demo-bar { background: var(--fg); color: var(--bg); font-size: var(--fs-xs); line-height: 1.4; padding: 8px var(--s-4); text-align: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 48px; padding: 0 var(--s-5);
  border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), transform 120ms var(--ease); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-ghost { border-color: var(--fg); }
.btn-ghost:hover, .btn-quiet:hover, .btn:not(.btn-primary):hover { background: var(--card); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 var(--s-3); font-size: var(--fs-xs); gap: 6px; }
.btn-sm svg.i { width: 16px; height: 16px; }
.link { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; display: inline-flex; align-items: center; gap: 4px; }
.lang { min-height: 40px; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; font-size: var(--fs-xs); font-weight: 500; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: inline-grid; place-items: center; flex: none; color: inherit; }
.icon-btn:hover { background: var(--card); }
.icon-btn.sm { width: 36px; height: 36px; border: var(--hairline); }
.icon-btn.sm svg.i { width: 16px; height: 16px; }

.tag { border: var(--hairline); border-radius: var(--r-pill); padding: 0 8px; font-size: 12px; line-height: 20px; white-space: nowrap; color: var(--muted); }
.monogram { width: 40px; height: 40px; border-radius: 12px; background: var(--fg); color: var(--bg); display: grid; place-items: center; font: 700 18px/1 var(--font-display); flex: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.empty { padding: var(--s-5); border: 1px dashed var(--line); border-radius: var(--r-md); color: var(--muted); font-size: var(--fs-xs); }
.help { font-size: var(--fs-xs); color: var(--muted); }
.err { font-size: var(--fs-xs); color: var(--bad); font-weight: 500; }
.alert { padding: var(--s-3) var(--s-4); border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); margin-bottom: var(--s-4); font-size: var(--fs-xs); font-weight: 500; }

/* Chips and choices */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { min-height: 44px; padding: 0 var(--s-4); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); font-weight: 500; display: inline-flex; align-items: center; gap: var(--s-2); }
.chip-sm { min-height: 38px; padding: 0 var(--s-3); font-size: var(--fs-xs); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip:disabled { opacity: .5; cursor: not-allowed; text-decoration: line-through; }
.chip .cnt { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .7; }
.choices { display: grid; gap: var(--s-2); }
.choice { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: grid; gap: 2px; min-height: 60px; }
.choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice .t { font-weight: 600; }
.choice .s { color: var(--muted); font-size: var(--fs-xs); }

/* Fields */
.field { display: grid; gap: 6px; margin-bottom: var(--s-4); }
.field > label, .field > legend { font-weight: 500; font-size: var(--fs-xs); margin-bottom: 6px; }
fieldset.field > legend + * { margin-top: 0; }
.input { min-height: 52px; width: 100%; padding: 0 var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: 18px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.prefix { display: flex; align-items: stretch; }
.prefix span { display: grid; place-items: center; padding: 0 var(--s-3); border: 1px solid var(--line); border-right: 0; border-radius: var(--r-md) 0 0 var(--r-md); color: var(--muted); background: var(--card); }
.prefix .input { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* ---------- Public page ---------- */
.p-wrap { max-width: 640px; margin: 0 auto; padding: 0 var(--s-4); }
.p-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) 0; }
.hero { padding: var(--s-5) 0 var(--s-7); }
.session { display: inline-flex; align-items: center; gap: var(--s-3); font-size: var(--fs-xs); font-weight: 500; margin-bottom: var(--s-5); }
.hero h1 { font-size: clamp(40px, 12vw, 60px); line-height: .98; letter-spacing: var(--tracking-display); font-weight: 700; }
:lang(hi) .hero h1 { line-height: 1.2; letter-spacing: -0.01em; }
.hero .tagline { margin-top: var(--s-4); color: var(--muted); font-size: var(--fs-md); line-height: 1.35; max-width: 30ch; }
.cta-row { margin-top: var(--s-6); display: flex; gap: var(--s-2); flex-wrap: wrap; }
.cta-row .btn { flex: 1 1 180px; min-height: 56px; font-size: var(--fs-md); }
.quick { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.quick .btn { flex: 1; }

.sec { padding: var(--s-6) 0; border-top: var(--hairline); scroll-margin-top: var(--s-4); }
.sec > h2 { font-size: var(--fs-lg); margin-bottom: var(--s-5); }
.sec > .sec-note { margin: calc(-1 * var(--s-4)) 0 var(--s-5); font-size: var(--fs-xs); }

.course { padding: 0 0 var(--s-6); }
.course:last-child { padding-bottom: 0; }
.course-head h3 { font-size: var(--fs-md); }
.course-head p { font-size: var(--fs-xs); margin-top: 2px; }
.batches { list-style: none; margin: var(--s-3) 0 0; padding: 0; border-top: 2px solid var(--fg); }
.batch { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: var(--hairline); align-items: start; }
.b-l { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-2); }
.b-name { font-weight: 600; }
.b-time { flex-basis: 100%; font-size: var(--fs-xs); color: var(--muted); }
.b-r { display: grid; justify-items: end; gap: 2px; text-align: right; }
.b-fee { font-size: var(--fs-md); font-weight: 500; line-height: 1.2; }
.b-per { font-size: 12px; color: var(--muted); }
.seats { display: grid; justify-items: end; gap: 4px; font-size: 13px; margin-top: 4px; white-space: nowrap; }
.seat-bar { width: 96px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; display: block; }
.seat-bar i { display: block; height: 100%; background: var(--fg); }
.seats.is-low { color: var(--warn); } .seats.is-low .seat-bar i { background: var(--warn); }
.seats.is-full { color: var(--bad); } .seats.is-full .seat-bar i { background: var(--bad); }

/* Fees kitni hai: a printed fee card */
.chips-sub { margin-top: var(--s-2); }
.fees .chips:first-of-type { margin-bottom: 0; }
.sheet-card, .fees .sheet { margin-top: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--fg); border-radius: 4px var(--r-sm) var(--r-md) var(--r-md); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); padding: var(--s-4); border-bottom: var(--hairline); flex-wrap: wrap; }
.sheet-t { font-weight: 600; }
.sheet-head .muted { font-size: var(--fs-xs); }
.sheet-fee .num { font-size: var(--fs-md); font-weight: 500; }
.plan { padding: var(--s-4); border-bottom: 1px dashed var(--line); }
.plan:last-child { border-bottom: 0; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.plan-name { font-weight: 600; }
.plan-total { font-size: 26px; font-weight: 600; color: var(--accent); letter-spacing: -0.03em; }
.save { font-size: var(--fs-xs); color: var(--ok); font-weight: 500; }
.parts { list-style: none; margin: var(--s-3) 0 0; padding: 0; font-size: var(--fs-xs); }
.parts li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 6px 0; border-top: var(--hairline); }
.parts li span:first-child { color: var(--muted); }
.parts-total { display: flex; justify-content: space-between; padding: var(--s-2) 0 0; border-top: 2px solid var(--fg); font-weight: 600; font-size: var(--fs-xs); }
.incl { margin-top: var(--s-5); }
.incl-t { font-weight: 600; font-size: var(--fs-xs); margin-bottom: var(--s-2); }
.incl ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-xs); }
.incl li { display: flex; gap: var(--s-2); align-items: flex-start; }
.incl svg.i { width: 18px; height: 18px; color: var(--ok); margin-top: 2px; }
.fee-note { font-size: var(--fs-xs); margin: var(--s-4) 0; }

.faculty, .results { list-style: none; margin: 0; padding: 0; }
.faculty li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; border-bottom: var(--hairline); }
.faculty li:last-child { border-bottom: 0; }
.f-av { width: 44px; height: 44px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font: 600 15px/1 var(--font-display); }
.f-name { font-weight: 600; }
.faculty .muted { font-size: var(--fs-xs); }
.f-yrs { font-size: 13px; color: var(--muted); text-align: right; }
.results li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; border-bottom: var(--hairline); }
.r-year { color: var(--muted); font-size: var(--fs-xs); }
.r-name { font-weight: 600; }
.results .muted { font-size: var(--fs-xs); }
.r-score { font-weight: 600; text-align: right; }
.addr { font-size: var(--fs-md); line-height: 1.4; max-width: 32ch; }
.foot { padding: var(--s-6) 0 calc(var(--s-9) + env(safe-area-inset-bottom)); color: var(--muted); font-size: var(--fs-xs); display: flex; align-items: center; gap: var(--s-2); }
.foot img { height: 14px; width: auto; display: block; }
.dark-only { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dark-only { display: block; } :root:not([data-theme="light"]) .light-only { display: none; } }

.sticky { position: fixed; left: 0; right: 0; bottom: 0; padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 94%, transparent); border-top: var(--hairline); transform: translateY(110%); transition: transform var(--t-base) var(--ease); z-index: 20; }
.sticky.show { transform: none; }
.sticky .btn { width: 100%; max-width: 608px; margin: 0 auto; display: flex; min-height: 52px; }

/* Enquiry form */
.flow { min-height: 100dvh; display: flex; flex-direction: column; }
.flow-top { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) 0; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.flow-top .icon-btn { margin-left: -10px; }
.flow-top .step { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); }
.flow h2 { font-size: var(--fs-lg); margin: var(--s-2) 0 var(--s-2); }
.flow-body { flex: 1; padding-bottom: var(--s-6); }
.flow-cta { position: sticky; bottom: 0; padding: var(--s-3) 0 calc(var(--s-3) + env(safe-area-inset-bottom)); background: var(--bg); }
.flow-cta .btn { width: 100%; min-height: 56px; font-size: var(--fs-md); }
.booked-title { display: flex; align-items: center; gap: var(--s-2); color: var(--ok); font-weight: 600; margin-top: var(--s-4); }
.slip { margin: var(--s-5) 0; background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; }
.slip-top { padding: var(--s-5); }
.slip .k { color: var(--muted); font-size: var(--fs-xs); }
.slip-name { font: 650 clamp(32px, 9vw, 44px)/1.1 var(--font-display); letter-spacing: -0.03em; margin: var(--s-1) 0 var(--s-2); }
.slip-cut { height: 0; border-top: 2px dashed var(--line); margin: 0 var(--s-4); position: relative; }
.slip-cut::before, .slip-cut::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.slip-cut::before { left: -27px; } .slip-cut::after { right: -27px; }
.slip-foot { padding: var(--s-4) var(--s-5) var(--s-5); font-weight: 500; }
.note { font-size: var(--fs-xs); color: var(--muted); margin-top: var(--s-1); }
.after { display: grid; gap: var(--s-2); margin-top: var(--s-5); }

@media (min-width: 720px) {
  .sticky { display: none; }
  .choices { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1000px) {
  .p-wrap { max-width: var(--page-max); padding: 0 var(--s-6); }
  .p-wrap.flow { max-width: 720px; }
  .p-grid { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s-9); align-items: start; }
  .p-lead { position: sticky; top: var(--s-6); }
  .hero { padding-top: var(--s-8); }
  .hero h1 { font-size: 80px; }
  .p-info { padding-top: var(--s-8); }
  .p-info > .sec:first-child { border-top: 0; padding-top: 0; }
  .batch { grid-template-columns: minmax(0, 1fr) 140px 130px; align-items: center; }
  .b-r { display: contents; }
  .b-fee, .b-per { grid-column: 2; text-align: right; }
  .b-r .b-fee { align-self: end; } .b-r .b-per { display: none; }
  .seats { grid-column: 3; margin: 0; }
}

/* ---------- Desk ---------- */
.b-wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--s-4) var(--s-8); }
.b-top { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; }
.b-id { display: flex; align-items: center; gap: var(--s-3); margin-right: auto; min-width: 0; }
.b-name { font: 600 var(--fs-sm)/1.2 var(--font-display); }
.b-sub { font-size: var(--fs-xs); color: var(--muted); line-height: 1.3; }
.b-tools { display: flex; gap: var(--s-2); align-items: center; }
.b-tools .btn-sm { min-height: 40px; }
.tabs { display: flex; gap: var(--s-1); border-bottom: var(--hairline); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s-4)); padding: 0 var(--s-4); }
.tab { position: relative; min-height: 48px; padding: 0 var(--s-3); border: 0; background: none; color: var(--muted); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab[aria-current="page"] { color: var(--fg); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: var(--s-3); right: var(--s-3); bottom: -1px; height: 2px; background: var(--fg); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--fg); color: var(--bg); font-size: 12px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.b-main { padding-top: var(--s-5); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-content: start; }

.sum { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; border-top: var(--hairline); border-left: var(--hairline); }
.sum > div { padding: var(--s-3) var(--s-4); border-right: var(--hairline); border-bottom: var(--hairline); min-width: 0; }
.sum dt { font-size: 13px; color: var(--muted); }
.sum dd { margin: 0; font: 500 28px/1.15 var(--font-mono); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.sum .sum-money { grid-column: 1 / -1; background: var(--tint); }
.sum .sum-money dd { font-size: 34px; color: var(--accent); }
.sum .sum-money p { font-size: 13px; }
.sum-2 > div, .sum-3 > div { grid-column: auto; }
.sum-3 { grid-template-columns: repeat(3, 1fr); }
.sum-3 dd { font-size: 20px; }

.two { display: grid; gap: var(--s-6); }
.panel-head { display: flex; align-items: baseline; gap: var(--s-2); margin-bottom: var(--s-3); }
.panel-head h2, .panel > h2 { font-size: var(--fs-md); }
.panel-head .cnt { color: var(--muted); font-variant-numeric: tabular-nums; }
.card { padding: var(--s-5); border: var(--hairline); border-radius: var(--r-lg); background: var(--surface); align-self: start; }
.card h2 { margin-bottom: var(--s-2); }
.see-all { margin-top: var(--s-3); font-size: var(--fs-xs); min-height: 40px; }
.see-all svg.i { width: 16px; height: 16px; }
.bar { display: flex; gap: var(--s-3); align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.bar .chips { flex: 1 1 320px; }
.seat-line { font-size: var(--fs-xs); margin-top: calc(-1 * var(--s-2)); }

.enqs, .dues, .studs, .insts, .pays { list-style: none; margin: 0; padding: 0; }
.enq { display: grid; gap: var(--s-2); padding: var(--s-4) 0; border-bottom: var(--hairline); }
.enqs .enq:first-child { padding-top: var(--s-2); }
.enq-top { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.enq .nm, .stud .nm, .due .nm { font-weight: 600; }
.enq-sub { font-size: var(--fs-xs); }
.enq-meta { display: flex; gap: 4px var(--s-3); flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.enq-meta a { text-decoration: none; }
.enq-note { font-size: var(--fs-xs); color: var(--muted); font-style: italic; }
.enq-acts { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.enq-acts .icon-btn:first-of-type { margin-left: auto; }
.late { font-size: 12px; font-weight: 600; color: var(--bad); }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.st i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.st-new { color: var(--accent); } .st-new i { background: currentColor; }
.st-called, .st-visited { color: var(--fg); }
.st-visited i { background: currentColor; }
.st-admitted { color: var(--ok); } .st-admitted i { background: currentColor; }
.st-lost { color: var(--muted); } .st-lost i { border-style: dashed; }
.enq.stage-lost .nm { color: var(--muted); font-weight: 500; }

.ft { font-size: 12px; font-weight: 600; padding: 0 8px; line-height: 22px; border-radius: var(--r-pill); white-space: nowrap; border: 1px solid currentColor; }
.ft-paid { color: var(--ok); }
.ft-upcoming { color: var(--muted); border-color: var(--line); }
.ft-due { color: var(--warn); }
.ft-overdue { color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent); }

.due { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2); align-items: center; border-bottom: var(--hairline); }
.due a { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px 20px; gap: var(--s-3); align-items: center; min-height: 64px; padding: var(--s-2) var(--s-1); text-decoration: none; }
.due a:hover { background: var(--card); }
.due .who, .stud .who { display: grid; min-width: 0; }
.due .meta, .stud .meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due .meta { white-space: normal; overflow: visible; } /* the due date and batch are what staff act on: never cut them */
.due .amt { font-weight: 500; justify-self: end; }
.due .ft { justify-self: start; }
.due svg.i { color: var(--muted); }
.stud { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto 20px; gap: var(--s-3); align-items: center; min-height: 64px; padding: var(--s-2) var(--s-1);
  background: none; border: 0; border-bottom: var(--hairline); text-align: left; }
.stud:hover { background: var(--card); }
.stud.is-left .nm { color: var(--muted); font-weight: 500; }
.stud .bal { font-size: var(--fs-xs); min-width: 72px; text-align: right; }
.stud svg.i { color: var(--muted); width: 18px; height: 18px; }

/* Sheets: bottom sheet on a phone, side drawer on a laptop */
body.has-sheet { overflow: hidden; }
.sheet-wrap { position: fixed; inset: 0; background: color-mix(in srgb, var(--p-ink-950) 45%, transparent); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap > .sheet { width: 100%; max-height: 92dvh; overflow: auto; background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 0 var(--s-4) calc(var(--s-5) + env(safe-area-inset-bottom)); }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); position: sticky; top: 0; background: var(--bg); padding: var(--s-4) 0 var(--s-3); z-index: 2; }
.sheet-top h2 { font-size: var(--fs-md); }
.sheet-body > .muted { font-size: var(--fs-xs); }
.sheet-body .sum { margin: var(--s-4) 0; }
.sheet-body h3 { font-size: var(--fs-sm); margin-bottom: var(--s-3); }
.sheet-cta { display: flex; gap: var(--s-2); justify-content: flex-end; position: sticky; bottom: calc(-1 * var(--s-5)); background: var(--bg); padding: var(--s-3) 0; margin-top: var(--s-4); border-top: var(--hairline); }
.sheet-cta .btn-primary { flex: 1; max-width: 320px; }
.preview { padding: var(--s-4); background: var(--card); border-radius: var(--r-md); }
.preview .k { font-size: var(--fs-xs); font-weight: 600; }
.insts li { display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "n amt ft" "due bal ft"; gap: 0 var(--s-3); align-items: center; padding: var(--s-2) 0; border-bottom: var(--hairline); font-size: var(--fs-xs); }
.insts li > :nth-child(1) { grid-area: n; font-weight: 500; } .insts li > :nth-child(2) { grid-area: due; }
.insts li > :nth-child(3) { grid-area: amt; text-align: right; } .insts li > :nth-child(4) { grid-area: bal; text-align: right; font-size: 12px; } .insts li > :nth-child(5) { grid-area: ft; }
.pay { margin-top: var(--s-5); padding: var(--s-4); border: 1px solid var(--accent); border-radius: var(--r-md); }
.pay-row { display: grid; gap: 0 var(--s-4); }
.pays li { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "d no amt" "m m btn"; gap: 2px var(--s-3); align-items: center; padding: var(--s-2) 0; border-bottom: var(--hairline); font-size: var(--fs-xs); }
.pays li > :nth-child(1) { grid-area: d; } .pays li > :nth-child(2) { grid-area: no; } .pays li > :nth-child(3) { grid-area: m; color: var(--muted); }
.pays li > :nth-child(4) { grid-area: amt; font-weight: 500; text-align: right; } .pays li > :nth-child(5) { grid-area: btn; justify-self: end; }
.b-leave { color: var(--muted); font-size: var(--fs-xs); min-height: 44px; margin-top: var(--s-4); }

/* Receipt */
.receipt-wrap { align-items: flex-start; overflow: auto; padding: var(--s-4); flex-direction: column; align-items: center; gap: var(--s-3); }
.receipt-actions { display: flex; gap: var(--s-2); width: 100%; max-width: 640px; justify-content: flex-end; flex-wrap: wrap; }
.receipt-actions .btn:not(.btn-primary) { background: var(--bg); }
.receipt { width: 100%; max-width: 640px; background: #FFFFFF; color: #16130F; border-radius: var(--r-md); padding: 28px 24px; font-size: 15px; }
.r-demo { font-size: 12px; background: #16130F; color: #F4EFE6; padding: 6px 10px; border-radius: 4px; margin-bottom: 16px; }
.rc-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid #16130F; flex-wrap: wrap; }
.rc-name { font: 700 24px/1.1 var(--font-display); letter-spacing: -0.02em; }
.rc-addr { font-size: 13px; color: #6B645A; margin-top: 4px; max-width: 34ch; }
.rc-title { text-align: right; }
.rc-title p:first-child { font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: #6B645A; }
.rc-title .num { font-size: 17px; font-weight: 600; }
.rc-grid { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 20px 0; }
.rc-grid dt { color: #6B645A; font-size: 13px; padding-top: 2px; }
.rc-grid dd { margin: 0; font-weight: 500; }
.rc-amount { border: 1px solid #D9D0C1; border-radius: 8px; padding: 16px; }
.rc-amount .num { font-size: 36px; font-weight: 600; letter-spacing: -0.03em; }
.rc-amount p:last-child { font-size: 14px; margin-top: 4px; }
.rc-bal { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #D9D0C1; font-size: 14px; }
.rc-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 44px; font-size: 12px; flex-wrap: wrap; }
.rc-foot .muted { color: #6B645A; }
.rc-sign { border-top: 1px solid #16130F; padding-top: 6px; min-width: 180px; text-align: center; font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--s-5) + env(safe-area-inset-bottom)); transform: translate(-50%, 200%); background: var(--fg); color: var(--bg);
  padding: var(--s-3) var(--s-5); border-radius: var(--r-md); max-width: calc(100vw - 32px); font-size: var(--fs-xs); font-weight: 500;
  transition: transform var(--t-base) var(--ease), visibility 0s linear var(--t-base); z-index: 60; visibility: hidden; }
.toast.show { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }

@media (min-width: 720px) {
  .sum { grid-template-columns: repeat(5, 1fr); }
  .sum .sum-money { grid-column: auto; }
  .sum-2 { grid-template-columns: repeat(2, minmax(0, 260px)); }
  .sum-3 { grid-template-columns: repeat(3, 1fr); }
  .enq { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-5); }
  .enq-acts { justify-content: flex-end; }
  .enq-acts .icon-btn:first-of-type { margin-left: var(--s-2); }
  .pay-row { grid-template-columns: 200px 1fr; }
  .insts li { grid-template-columns: 1fr 120px 110px 140px 96px; grid-template-areas: "n due amt bal ft"; }
  .insts li > :nth-child(5) { justify-self: end; }
  .pays li { grid-template-columns: 70px 150px 1fr 110px auto; grid-template-areas: "d no m amt btn"; }
  .sheet-wrap { align-items: stretch; justify-content: flex-end; }
  .sheet-wrap > .sheet { max-width: 520px; max-height: none; height: 100%; border-radius: 0; padding: 0 var(--s-6) var(--s-6); }
  .sheet-wrap > .sheet-wide { max-width: 680px; }
  .receipt-wrap { justify-content: flex-start; padding: var(--s-6); }
  .receipt { padding: 40px 44px; }
}
@media (min-width: 1100px) {
  .b-wrap { padding: 0 var(--s-6) var(--s-8); }
  .tabs { margin: 0; padding: 0; }
  .two { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-8); align-items: start; }
}
@media (max-width: 719px) {
  .hide-sm { display: none; }
  /* fee row on a phone: name on its own line, then the due line and batch in full, then amount + status + actions */
  .due { display: block; position: relative; }
  .due a { grid-template-columns: auto auto 20px 1fr; column-gap: var(--s-2); row-gap: 6px; padding: var(--s-3) 0; }
  .due .who { grid-column: 1 / -1; }
  .due .ft { justify-self: start; }
  .due > .btn { position: absolute; right: 0; bottom: var(--s-2); }
  .rc-head { flex-direction: column; }
  .rc-title { text-align: left; }
  .tabs { gap: 0; }
  /* when the tabs do not fit (narrow phones, long labels) they scroll, and the cut edge fades so it reads as "more" */
  .tabs.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
  .tabs.more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
  .tabs.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
  /* filter chips: one swipeable row, so the list starts above the fold */
  .bar > .chips { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s-4)); padding: 2px var(--s-4); }
  .bar > .chips::-webkit-scrollbar { display: none; }
  .bar > .chips > .chip { flex: none; }
  .tab { padding: 0 7px; font-size: 15px; flex: 1 0 auto; justify-content: center; }
  .tab[aria-current="page"]::after { left: 7px; right: 7px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Print: only the receipt, on plain paper */
@media print {
  @page { size: A5; margin: 10mm; }
  body.printing-receipt > *:not(#app), body.printing-receipt #app > *:not(.receipt-wrap), .receipt-actions, .skip { display: none !important; }
  body.printing-receipt { background: #FFFFFF; }
  .receipt-wrap { position: static; background: none; padding: 0; display: block; }
  .receipt { max-width: none; padding: 0; border-radius: 0; }
}
