/* Instituto Bíblico Manantial de Vida — styles
   Change the brand colors here. */
:root {
  /* Colors taken from the MDV logo: navy, teal (drop) and orange (flame) */
  --navy: #23345a;
  --navy-2: #2f4574;
  --aqua: #3a8a93;
  --aqua-soft: #e4f1f2;
  --gold: #f0932f;
  --gold-2: #9a520b; /* dark orange for text (readable on white) */
  --cream: #f7f5f0;
  --ink: #1e2536;
  --muted: #5d6679;
  --line: #e2e6e9;
  --white: #fff;
  --ok: #1f8a5b;
  --ok-soft: #e2f4ea;
  --warn: #875810;
  --warn-soft: #fbf0dc;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(35, 52, 90, .06), 0 6px 20px rgba(35, 52, 90, .07);
  --aqua-text: #2b6f77; /* darker teal for small text */
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--cream); line-height: 1.55; font-size: 16px; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--navy-text, var(--navy)); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
a { color: var(--navy-2); }
img { max-width: 100%; }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.big { font-size: 1.8rem; font-weight: 700; color: var(--navy-text, var(--navy)); font-family: var(--serif); margin: 0; }
.note { font-size: .82rem; color: var(--warn); background: var(--warn-soft); padding: .4rem .7rem; border-radius: 8px; display: inline-block; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--aqua-text); margin: 0 0 .4rem; display: block; }
.eyebrow.light { color: var(--gold); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 680px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 999px; padding: .7rem 1.3rem;
  font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none; transition: background .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn.small { padding: .4rem .85rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-gold { background: var(--gold); color: var(--navy-text, var(--navy)); }
.btn-gold:hover { background: #f5a650; }
.btn-ghost { background: transparent; color: var(--navy-text, var(--navy)); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--aqua-soft); }
.btn-ghost-light { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .1); }
.btn-meet { background: #188038; color: #fff; }
.btn-meet:hover { background: #137333; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 1.05rem; padding: .3rem .45rem; border-radius: 8px; color: inherit; }
.icon-btn:hover { background: var(--aqua-soft); }
.link { font-size: .85rem; font-weight: 600; text-decoration: none; }

.lang-toggle { display: inline-flex; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); overflow: hidden; }
.lang-toggle button { border: 0; background: none; padding: .35rem .7rem; font: 600 .78rem var(--sans); cursor: pointer; color: var(--muted); }
.lang-toggle button.active { background: var(--navy); color: #fff; }

/* ---------- Layout helpers ---------- */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface, #fff); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid, .card + .grid { margin-top: 18px; }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
.row-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy-text, var(--navy)); font-family: var(--serif); font-weight: 700; line-height: 1.1; }
.brand img { width: 46px; height: 46px; border-radius: 50%; background: var(--surface, #fff); flex-shrink: 0; }
.hero-seal { position: absolute; right: 4%; top: 70px; width: 300px; height: 300px; border-radius: 50%; background: var(--surface, #fff); padding: 6px;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .08), 0 20px 50px rgba(0, 0, 0, .35); z-index: 1; }
.login-logo { display: block; width: 120px; height: 120px; margin: 0 auto 12px; border-radius: 50%; }
@media (max-width: 1100px) { .hero-seal { display: none; } }
.brand small { font-family: var(--sans); font-weight: 500; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Public site ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 70px; }
.site-nav { display: flex; gap: 2px; margin-left: auto; }
.site-nav a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: .9rem; padding: .45rem .6rem; border-radius: 8px; }
.site-nav a:hover { background: var(--aqua-soft); color: var(--navy-text, var(--navy)); }
.site-nav .nav-donate { color: var(--gold-2); font-weight: 700; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.nav-btn { display: none; font-size: 1.4rem; }

.hero { position: relative; background: radial-gradient(1200px 500px at 80% -10%, #2e6b78 0%, transparent 60%), linear-gradient(160deg, var(--navy) 0%, #161f38 100%);
  color: #fff; padding: 90px 0 150px; overflow: hidden; }
.hero-inner { position: relative; z-index: 1; max-width: 860px; }
@media (min-width: 1101px) { .hero-inner { max-width: 1160px; padding-right: 440px; } }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5.5vw, 4rem); margin-bottom: .3em; }
.hero-sub { font-size: 1.15rem; color: #d3dcec; max-width: 640px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 40px; }
.verse { border-left: 3px solid var(--gold); margin: 0; padding: 4px 0 4px 18px; max-width: 620px; color: #dde5f1; font-family: var(--serif); font-style: italic; }
.verse p { margin: 0 0 .3rem; }
.verse cite { font-style: normal; font-family: var(--sans); font-size: .82rem; color: var(--gold); }
.waves { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 120px; }
.wave1 { fill: rgba(58, 138, 147, .35); }
.wave2 { fill: var(--cream); }

.facts { margin-top: -50px; position: relative; z-index: 2; }
.facts .grid { background: var(--surface, #fff); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.facts .grid > div { display: flex; flex-direction: column; text-align: center; }
.facts b { font-family: var(--serif); font-size: 1.4rem; color: var(--navy-text, var(--navy)); }
.facts span { font-size: .85rem; color: var(--muted); }

.section { padding: 80px 0; }
.section.alt { background: #eef3f4; }
.mission h3 { margin-top: .3em; }
.mission .signature { font-weight: 600; color: var(--navy-text, var(--navy)); margin-bottom: 0; }
.info-list, .leaders { list-style: none; padding: 0; margin: 0; }
.info-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.info-list li:last-child, .leaders li:last-child { border-bottom: 0; }
.leaders li { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--line); }
.offer-title { margin: 2em 0 .8em; }
.min-year { margin-top: 18px; }
.dash-courses { list-style: none; padding: 0; margin: 0 0 1em; }
.dash-courses li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.dash-courses li:last-child { border-bottom: 0; }
.min-year p { margin: .5em 0; }
.min-courses { list-style: none; padding: 0; margin: .6em 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 20px; }
.min-courses li { display: flex; flex-direction: column; }
.min-courses span { font-size: .85rem; color: var(--muted, #5b6472); }
.offer h4 { margin: 0 0 .35em; }
.offer p { margin: 0; font-size: .92rem; color: var(--muted, #5b6472); }
.year-card .eyebrow { font-size: .9rem; }
.year-card.ministry { border-top: 4px solid var(--gold); background: linear-gradient(180deg, #fff8ef, #fff 60%); }
.year-card.ministry .eyebrow { color: var(--gold-2); }
.course-list { padding-left: 1.2rem; margin: 0; }
.course-list li { margin-bottom: .7rem; }
.course-list span { display: block; font-size: .82rem; color: var(--muted); }
.faith-list { padding-left: 1.2rem; }
.faith-list li { margin-bottom: .8rem; padding-left: .3rem; }
.faculty { text-align: center; }
.face { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; font: 700 1.4rem var(--serif);
  background: linear-gradient(135deg, var(--aqua), var(--navy)); color: #fff; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .5rem; }
.donate { background: linear-gradient(160deg, var(--navy), #161f38); color: #dde5f1; }
.donate h2 { color: #fff; }
.amounts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.amounts button { border: 1.5px solid rgba(255, 255, 255, .4); background: none; color: #fff; border-radius: 999px; padding: .6rem 1.2rem; font: 600 1rem var(--sans); cursor: pointer; }
.amounts button.active { background: var(--gold); border-color: var(--gold); color: var(--navy-text, var(--navy)); }
.amounts input { width: 150px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .08); color: #fff; padding: .6rem 1rem; font: 1rem var(--sans); }
.amounts input::placeholder { color: #b7c3d9; }
.site-footer { background: #161f38; color: #b7c3d9; padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer .brand { color: #fff; font-size: .95rem; }
.site-footer a { color: #b7c3d9; }

/* Dates list */
.dates { list-style: none; padding: 0; margin: 0; }
.dates li { display: flex; gap: 14px; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.dates li:last-child { border-bottom: 0; }
.dates li span { min-width: 120px; font-weight: 600; color: var(--navy-text, var(--navy)); font-variant-numeric: tabular-nums; }
.dates li.noclass span { color: var(--warn); }
.dates li.past { opacity: .55; }
.big-dates li { font-size: 1rem; padding: .8rem 0; }

/* Announcements */
.announcement { padding: 12px 0; border-bottom: 1px solid var(--line); }
.announcement:last-child { border-bottom: 0; }
.announcement h4 { font-size: 1.05rem; margin: .3rem 0 .2rem; }
.announcement p { margin: 0; }
.ann-meta { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ann-meta .right { margin-left: auto; }
.tag { background: var(--aqua-soft); color: var(--navy-text, var(--navy)); font-weight: 600; padding: .1rem .5rem; border-radius: 999px; }

/* Forms */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
.field input, .field select, .field textarea, .search, .inline-select {
  width: 100%; padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; font: .95rem var(--sans); background: var(--surface, #fff); color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus, .inline-select:focus { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(58, 138, 147, .2); }
.field input:disabled { background: #f2f4f5; }
.search { width: 200px; padding: .5rem .8rem; }
.inline-select { width: auto; min-width: 220px; max-width: 100%; padding: .5rem .8rem; }
@media (max-width: 640px) { .inline-select, .course-select { min-width: 0; width: 100%; } .section-head .row-gap { width: 100%; } }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; }
.form h3 { margin-bottom: 1rem; }
.pastor-box { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 16px 6px; margin: 4px 0 16px; background: #fbfbf9; }
.pastor-box legend { font: 700 1rem var(--serif); color: var(--navy-text, var(--navy)); padding: 0 6px; }
.pastor-box > p { margin: 0 0 10px; }
.pastor-box .check { align-items: flex-start; margin-bottom: 14px; font-size: .88rem; }
.pastor-box .check input { margin-top: 4px; }
.sig-label { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; font-weight: 600; margin-bottom: 5px; }
.link-btn { background: none; border: 0; color: var(--navy-2); font: 600 .82rem var(--sans); cursor: pointer; text-decoration: underline; }
.sig-pad { display: block; width: 100%; height: 150px; background: var(--surface, #fff); border: 1.5px dashed #b9c0cc; border-radius: 10px; touch-action: none; cursor: crosshair; }
.sig-pad.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(192, 57, 43, .15); }
.cap-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cap { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 11px; cursor: pointer; }
.cap:has(input:checked) { border-color: var(--aqua); background: var(--aqua-soft); }
.field .cap input { width: auto; flex-shrink: 0; margin-top: 3px; padding: 0; }
.cap span { display: flex; flex-direction: column; font-size: .88rem; }
.cap small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
@media (max-width: 640px) { .cap-list { grid-template-columns: 1fr; } }
/* Certificate wording editor & preview */
.tpl-grid { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 8px 10px; align-items: start; margin: 8px 0; }
.tpl-head { font: 700 .75rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tpl-label { font-size: .82rem; font-weight: 600; padding-top: 8px; }
.tpl-grid input, .tpl-grid textarea { width: 100%; padding: .45rem .6rem; border: 1.5px solid var(--line); border-radius: 8px; font: .88rem var(--sans); resize: vertical; }
@media (max-width: 640px) { .tpl-grid { grid-template-columns: 1fr; } .tpl-head:first-child { display: none; } }
.cert-preview { border: 1px solid var(--line); border-radius: 12px; background: #fbfbf9; padding: 12px; margin-bottom: 8px; }
.cert-preview .certificate { background: var(--surface, #fff); border: 5px double var(--gold); padding: 26px 20px; text-align: center; font-family: var(--serif); color: #1e2536; }
.cert-preview .cert-logo { width: 64px; }
.cert-preview h1 { font-size: 1.15rem; margin: 6px 0; }
.cert-preview .cert-title { font-size: 1.5rem; color: var(--gold-2); margin: 4px 0 8px; letter-spacing: .02em; }
.cert-preview .cert-name { font-size: 1.6rem; border-bottom: 1px solid #999; display: inline-block; padding: 0 24px 4px; margin: 4px 0 10px; }
.cert-preview .cert-kicker, .cert-preview .cert-footer { font-style: italic; }
.cert-preview .sigs { display: flex; justify-content: space-around; gap: 16px; margin-top: 34px; font-family: var(--sans); font-size: .8rem; }
.cert-preview .sigs div { border-top: 1px solid #333; padding-top: 4px; min-width: 120px; }

.print-jobs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.print-jobs .btn { flex-direction: column; border-radius: 14px; padding: .9rem; }
.print-jobs small { font-weight: 500; opacity: .8; font-size: .78rem; }
@media (max-width: 520px) { .print-jobs { grid-template-columns: 1fr; } }

/* Bulk certificates */
.pick-list { max-height: 42vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; }
.pick-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-row:last-child { border-bottom: 0; }

/* School years & copying */
.year-select { min-width: 190px; font-weight: 600; }
.course-select { min-width: 260px; max-width: 100%; }
.gb-grid.overview th.as-col { min-width: 96px; max-width: 130px; text-align: center; padding-left: 6px; padding-right: 6px; }
.gb-grid.overview td.num { padding-left: 6px; padding-right: 6px; }
.gb-grid.overview th.as-col small { display: block; margin-top: 3px; }
.gb-grid.overview .col-link { text-align: center; font: 700 .8rem var(--sans); text-decoration: none; color: var(--navy-text, var(--navy)); padding: 0; }
.gb-grid.overview tbody td.num, .gb-grid.overview tfoot td.num { text-align: center; }
.gb-grid.overview td.total-col, .gb-grid.overview th:last-child { text-align: center; }
/* Reports → Students: three groups with counts and share bars */
.rs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 28px; }
.rs-group h4 { margin: 4px 0 8px; font: 700 .74rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rs-list { list-style: none; margin: 0; padding: 0; }
.rs-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rs-list li:last-child { border-bottom: 0; }
.rs-list b { font-variant-numeric: tabular-nums; }
.rs-bar { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: var(--line); margin-top: 5px; overflow: hidden; }
.rs-bar i { display: block; height: 100%; background: var(--aqua); border-radius: 999px; }
@media print { .rs-bar i { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.ov-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rep-filters .course-select { min-width: 0; width: 100%; }
.gb-grid.overview .col-link:hover { text-decoration: underline; }
.gb-grid.overview tfoot td { border-top: 2px solid var(--line); background: #f6f9fa; }
.teach-list { display: flex; flex-direction: column; gap: 8px; font-size: .9rem; list-style: none; padding: 0; margin: 0; min-width: 220px; }
.teach-list li .small { margin-top: 1px; }
a.link { overflow-wrap: anywhere; } /* long web addresses wrap on phones */
.course-cell { min-width: 200px; }
@media screen and (max-width: 760px) { .course-cell { min-width: 0; } }
.cat-cell { line-height: 1.5; }
.cat-cell .muted { white-space: nowrap; }
.cat-cell .link-btn { padding: 0; }
.term-auto { background: #f4f7f9; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: -4px 0 12px; line-height: 1.6; }
.t-count { margin: 2px 0 0 38px; }
.only-teaching { white-space: nowrap; }
.term-courses { display: flex; flex-direction: column; gap: 3px; font-size: .86rem; }
.copy-list { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; }
.copy-term { padding: 10px 0; border-bottom: 1px solid var(--line); }
.copy-term:last-child { border-bottom: 0; }
.copy-courses { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 0 26px; }
.copy-courses .check { font-size: .86rem; }
.copy-bulk { margin: 6px 0; font-size: .85rem; }
.sec-mode { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; background: #f6f8f9; border-radius: 10px; padding: 8px 12px; margin-top: 8px; }
.copy-course { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; }
.sec-pick { display: inline-flex; gap: 4px; flex-shrink: 0; }
.sec-pick label { display: inline-flex; align-items: center; gap: 3px; font: 700 .7rem var(--sans); border: 1.5px solid var(--line); border-radius: 6px; padding: 1px 6px; cursor: pointer; }
.sec-pick label:has(input:checked) { border-color: var(--aqua); background: var(--aqua-soft); }
.sec-pick label:has(input:disabled) { opacity: .45; cursor: default; }
.sec-pick input { margin: 0; }

/* Academic history */
.hist-input { width: 90px; }
.hist-input.bad, .grade-input.bad { border-color: var(--danger); background: #fdf0ef; }
.add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.mini-form { background: #f6f8f9; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.import-preview { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.table tr.bad-row td { background: #fdf0ef; }

/* Application & pastor pages */
.flow-page { background: #f1f4f5; }
.flow-main { max-width: 820px; padding-top: 28px; padding-bottom: 60px; }
.flow-title { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 6px 0 6px; }
.flow-card { border-left: 4px solid transparent; }
.flow-card.is-active { border-left-color: var(--gold); }
.flow-card.is-done { border-left-color: var(--ok); }
.flow-card.is-locked { opacity: .6; }
.flow-card h3 { margin-bottom: 10px; }
.narrow-card { max-width: 520px; margin: 30px auto; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.stepper { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.stepper li { flex: 1; min-width: 130px; display: flex; align-items: center; gap: 8px; background: var(--surface, #fff); border-radius: 12px; padding: 10px 12px;
  font-size: .85rem; font-weight: 600; color: var(--muted); box-shadow: var(--shadow); }
.stepper li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e6ebee; color: var(--muted); flex-shrink: 0; }
.stepper li.active { color: var(--navy-text, var(--navy)); box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.stepper li.active span { background: var(--gold); color: var(--navy-text, var(--navy)); }
.stepper li.done span { background: var(--ok); color: #fff; }
.email-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.email-meta { background: #f6f8f9; padding: 10px 14px; font-size: .88rem; border-bottom: 1px solid var(--line); }
.email-body { margin: 0; padding: 14px; font: .88rem/1.55 var(--sans); white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.timeline { list-style: none; padding: 0; margin: 0 0 8px; }
.timeline li { position: relative; padding: 4px 0 14px 30px; display: flex; flex-direction: column; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #d7dde2; }
.timeline li::after { content: ''; position: absolute; left: 12px; top: 22px; bottom: -2px; width: 2px; background: #e3e8eb; }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--ok); }
.timeline li.current::before { background: var(--gold); box-shadow: 0 0 0 4px rgba(240, 147, 47, .2); }
.timeline li.bad::before { background: var(--danger); }
.apply-steps { padding-left: 1.2rem; margin: 0 0 16px; }
.apply-steps li { margin-bottom: 8px; }
.apply-steps b { display: block; color: var(--navy-text, var(--navy)); }
.apply-steps span { font-size: .9rem; color: var(--muted); }
button:disabled.btn-primary { background: #9aa6b8; }

/* Payment options */
.card.attention { border-left: 4px solid var(--gold); }
.pay-howto { background: linear-gradient(120deg, #fff 60%, var(--aqua-soft)); }
.pay-howto p { margin: 0 0 6px; }
.donate-info { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .25); border-radius: 14px; padding: 16px 20px; margin: 20px auto; max-width: 620px; font-size: 1.05rem; }
[hidden] { display: none !important; }

/* Prices */
.price-line { font-weight: 700; color: var(--navy-text, var(--navy)); margin: 0 0 10px; }
.price-input { width: 110px; padding: .4rem .6rem; border: 1.5px solid var(--line); border-radius: 8px; font: .92rem var(--sans); text-align: right; }
.quote tr.total td { border-top: 2px solid var(--line); }

/* Partial payments & plans */
.pay-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.pay-opt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.pay-opt:has(input[type=radio]:checked) { border-color: var(--aqua); background: var(--aqua-soft); }
.pay-opt input[type=radio] { margin-top: 4px; }
.pay-opt > span { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pay-opt small { color: var(--muted); }
.pay-opt .price-input { width: 140px; text-align: left; }
.plan-progress { height: 10px; background: #e6ebee; border-radius: 999px; overflow: hidden; margin: 4px 0 6px; }
.plan-progress div { height: 100%; background: linear-gradient(90deg, var(--aqua), var(--ok)); border-radius: 999px; }
.table tr.next-row td { background: #fffaf0; font-weight: 600; }
.plan-day { margin: 8px 0 0; font-weight: 600; color: var(--navy-text, var(--navy)); }
.owed { color: var(--danger); }

/* Profile pictures */
img.avatar { object-fit: cover; background: var(--surface, #fff); }
.avatar { flex-shrink: 0; line-height: 1; letter-spacing: .02em; }
button.user-chip { background: none; border: 0; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; font: inherit; color: inherit; text-align: left; }
button.user-chip:hover { background: var(--aqua-soft); }
.chip-av { position: relative; display: inline-flex; }
.chip-av .cam { position: absolute; right: -4px; bottom: -4px; font-size: .62rem; background: var(--surface, #fff); border-radius: 50%; width: 17px; height: 17px;
  display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.name-av { display: inline-flex; align-items: center; gap: 10px; }
.name-av .avatar { box-shadow: 0 0 0 2px #fff; }
.profile-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-box h3 { margin: 0 0 2px; }
.avatar-xl { box-shadow: 0 0 0 4px #fff, 0 4px 14px rgba(0, 0, 0, .18); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.faculty .face { margin: 0 auto 12px; display: grid; }
.fac-langs { display: flex; justify-content: center; gap: 6px; margin: -2px 0 10px; }
.sec-pill { font-size: .72rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; }
.sec-pill.sec-es { background: var(--aqua-soft); color: #256b73; }
.sec-pill.sec-en { background: #fdebd6; color: var(--gold-2); }
.fac-courses { list-style: none; padding: 0; margin: 0; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.fac-courses li { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; border-top: 1px solid var(--line); padding-top: 8px; }
.fac-courses li:first-child { border-top: 0; padding-top: 0; }
.fac-courses small { color: var(--muted); font-size: .78rem; }
img.face { display: block; }

/* Language sections */
.sec-tag { display: inline-block; font: 700 .64rem var(--sans); letter-spacing: .06em; padding: .1rem .38rem; border-radius: 5px; vertical-align: middle; }
.sec-es { background: var(--aqua-soft); color: #256b73; }
.sec-en { background: #fdebd6; color: var(--gold-2); }
.section-switch { margin: 6px 0 18px; }

/* Online submissions */
.badge-late { background: #fbe4e1; color: var(--danger); }
.no-scroll { overflow: hidden; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px dashed #b9c0cc; border-radius: 14px; padding: 26px 16px;
  text-align: center; cursor: pointer; background: #fbfbf9; margin-bottom: 12px; position: relative; }
.drop:hover, .drop:focus-within { border-color: var(--aqua); background: var(--aqua-soft); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop-ico { font-size: 1.6rem; color: var(--aqua); }
.drop-name { font-weight: 600; color: var(--navy-text, var(--navy)); margin-top: 4px; }
.gdoc-steps { background: #f6f8f9; border-radius: 12px; padding: 12px 16px; font-size: .9rem; }
.gdoc-steps ol { margin: 4px 0 10px; padding-left: 1.2rem; }
.instructions { background: var(--aqua-soft); border-left: 3px solid var(--aqua); padding: 8px 12px; border-radius: 8px; font-size: .92rem; }
.progress { display: flex; align-items: center; gap: 8px; color: var(--navy-text, var(--navy)); font-weight: 600; }
.progress[hidden] { display: none; }
.spinner { width: 16px; height: 16px; border: 2.5px solid var(--aqua-soft); border-top-color: var(--aqua); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gb-grid .sub-submitted { background: var(--gold); border-radius: 6px; }
.gb-grid .sub-returned { background: var(--warn-soft); border-radius: 6px; }

.viewer-wrap { position: fixed; inset: 0; z-index: 120; background: rgba(22, 31, 56, .7); display: flex; padding: 16px; }
.viewer { background: var(--surface, #fff); border-radius: 16px; flex: 1; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.viewer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.viewer-head h3 { margin: 0 0 2px; }
.viewer-head p { margin: 0; }
.viewer-body { flex: 1; display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
.viewer-pages { overflow: auto; background: #e9edf0; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.vpage { position: relative; background: var(--surface, #fff); box-shadow: 0 2px 10px rgba(0, 0, 0, .15); max-width: 100%; }
.vpage canvas { display: block; }
.vpage.can-comment { cursor: crosshair; }
.page-label { position: absolute; bottom: -18px; right: 0; font-size: .72rem; color: var(--muted); }
.pin { position: absolute; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: var(--gold);
  color: #fff; font: 700 .75rem var(--sans); cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); padding: 0; }
.pin:hover { transform: translate(-50%, -50%) scale(1.15); }
.viewer-side { border-left: 1px solid var(--line); padding: 16px; overflow-y: auto; }
.viewer-side h4 { margin: 12px 0 8px; }
.hint { background: var(--aqua-soft); border-radius: 10px; padding: 8px 12px; font-size: .85rem; margin: 0 0 8px; }
.cm-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.cm-list li { border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; transition: background .3s; }
.cm-list li.flash { background: var(--warn-soft); }
.cm-list li.empty { border-style: dashed; color: var(--muted); text-align: center; }
.cm-list p { margin: 4px 0 0; font-size: .9rem; }
.cm-list textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: .88rem var(--sans); margin-top: 4px; resize: vertical; }
.cm-head { display: flex; align-items: center; gap: 6px; }
.cm-head .icon-btn { margin-left: auto; }
.pin-n { width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #fff; font: 700 .7rem var(--sans); display: inline-grid; place-items: center; }
.viewer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 800px) {
  .viewer-wrap { padding: 0; }
  .viewer { border-radius: 0; }
  .viewer-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .viewer-side { border-left: 0; border-top: 1px solid var(--line); max-height: 45vh; }
}
/* Word documents are laid out with this style before being turned into PDF */
.docx-render { width: 7in; background: var(--surface, #fff); color: #000; font: 12pt/1.5 'Times New Roman', Georgia, serif; }
.docx-render h1, .docx-render h2, .docx-render h3 { color: #000; font-family: inherit; }
.docx-render img { max-width: 100%; }
.docx-render table { border-collapse: collapse; } .docx-render td, .docx-render th { border: 1px solid #999; padding: 4px 6px; }

/* Gradebook */
.gb-status { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.gb-status p { margin: .4rem 0 0; }
.subtabs { display: inline-flex; background: #e6ebee; border-radius: 12px; padding: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.subtabs button { border: 0; background: none; padding: .5rem 1rem; border-radius: 9px; font: 600 .88rem var(--sans); cursor: pointer; color: var(--muted); }
.subtabs button.active { background: var(--surface, #fff); color: var(--navy-text, var(--navy)); box-shadow: var(--shadow); }
.gb-grid th.as-col { min-width: 120px; text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--ink); vertical-align: bottom; }
.gb-grid th.as-col small { display: block; font-weight: 500; color: var(--muted); }
.gb-grid td { vertical-align: middle; }
.gb-grid .sticky-col { position: sticky; left: 0; background: var(--surface, #fff); z-index: 1; box-shadow: 1px 0 0 var(--line); }
.gb-grid td.total-col { background: #f6f9fa; }
.gb-grid input.score { width: 76px; padding: .35rem .5rem; border: 1.5px solid var(--line); border-radius: 8px; font: .92rem var(--sans); text-align: right; }
.gb-grid input.score:focus, .att-sel:focus { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(58, 138, 147, .2); }
.small-ico { font-size: .8rem; padding: .1rem .3rem; }
.att-sel { border: 1.5px solid var(--line); border-radius: 8px; padding: .3rem .4rem; font: .85rem var(--sans); background: transparent; }
.att-cell.att-P { background: var(--ok-soft); } .att-cell.att-L { background: var(--warn-soft); }
.att-cell.att-A { background: #fbe4e1; } .att-cell.att-E { background: #eceff1; }
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.att-chip { font-size: .8rem; padding: .25rem .6rem; border-radius: 999px; background: #eceff1; }
.att-chip.att-P { background: var(--ok-soft); color: var(--ok); } .att-chip.att-L { background: var(--warn-soft); color: var(--warn); }
.att-chip.att-A { background: #fbe4e1; color: var(--danger); }
.setup-table input { width: 100%; padding: .45rem .6rem; border: 1.5px solid var(--line); border-radius: 8px; font: .92rem var(--sans); }
.setup-table input.w-input { width: 80px; }
.ok-text { color: var(--ok); } .bad-text { color: var(--danger); }
.note-input { width: 100%; min-width: 160px; padding: .4rem .6rem; border: 1.5px solid var(--line); border-radius: 8px; font: .85rem var(--sans); }
.chip-btn { border: 0; cursor: pointer; font-family: var(--sans); }
.chip-btn:hover { background: var(--aqua); color: #fff; }
details.manual summary { cursor: pointer; padding: 2px 0 10px; }
.detail-top { align-items: start; margin-bottom: 14px; }
.modal h4 { margin: 16px 0 6px; }
.pastor-review { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 14px; }
.sig-img { max-width: 100%; height: 110px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 90% 0%, #2e6b78, transparent 60%), linear-gradient(160deg, var(--navy), #161f38); }
.login-box { width: 100%; max-width: 440px; min-width: 0; padding: 28px; }
.login-box select { max-width: 100%; }
@media (max-width: 480px) { .login-page { padding: 16px; } .login-box { padding: 22px 18px; } }
.login-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.login-box h1 { font-size: 1.6rem; }
.field-hint { margin: -8px 0 10px; }

/* Switch portal (people with more than one role) */
.switch-btn { white-space: nowrap; }
.portal-choice { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.portal-choice .btn { justify-content: center; font-size: 1rem; padding: .7rem 1rem; }
@media (max-width: 640px) { .switch-label { display: none; } }

/* Continue with Google, "or" divider, security check */
.btn-google { background: var(--surface, #fff); color: #1f1f1f; border: 1px solid #c7cdd4; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.btn-google:hover { background: #f6f8fa; border-color: #9aa4af; }
.btn.block { width: 100%; }
.google-wrap { margin: 4px 0 6px; }
.google-note { margin-top: -4px; }
.or-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.captcha-box { margin: 6px 0 12px; min-height: 65px; }

/* Help panel (❓ in the top bar) */
.help-btn { font-size: 1.05rem; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface, #fff); display: inline-grid; place-items: center; }
.help-btn:hover { box-shadow: 0 0 0 2px var(--aqua); }
.help-scrim { position: fixed; inset: 0; background: rgba(22, 31, 56, .35); z-index: 120; }
.help-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface, #fff); z-index: 121; display: flex; flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, .2); animation: help-in .18s ease-out; }
@keyframes help-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.help-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 8px; }
.help-head h2 { margin: 0; font-size: 1.3rem; }
.help-search { margin: 0 18px 10px; width: auto; }
.help-scroll { overflow-y: auto; padding: 0 18px 24px; flex: 1; }
.help-article { padding: 6px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.help-article:empty { display: none; }
.help-article h3 { margin: 6px 0 8px; font-size: 1.2rem; }
.help-body { line-height: 1.6; font-size: .95rem; }
.help-body h4 { margin: 14px 0 4px; font-size: .95rem; color: var(--navy-text, var(--navy)); }
.help-body ol, .help-body ul { padding-left: 1.2rem; margin: 6px 0; }
.help-body li { margin: 4px 0; }
.help-tip { background: var(--aqua-soft); border-radius: 8px; padding: 8px 10px; font-size: .9rem; }
.help-back { margin-bottom: 4px; }
.help-list h4 { margin: 4px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.help-list h4:empty { display: none; }
.help-topic { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font: 500 .92rem var(--sans); color: var(--ink); cursor: pointer; }
.help-topic span { display: inline-block; width: 26px; }
.help-topic small { display: block; color: var(--muted); font-weight: 400; margin: 2px 0 0 26px; }
.help-topic:hover { background: #f3f6f8; }
.help-topic.active { background: var(--aqua-soft); color: var(--navy-text, var(--navy)); font-weight: 700; }
@media print { .help-drawer, .help-scrim { display: none !important; } }

/* Account statement, receipts */
.credit { color: var(--ok); font-weight: 600; }
.ledger tr.voided td { color: var(--muted); }
.ledger tr.voided td:not(:first-child):not(:last-child) { text-decoration: line-through; }
.ledger tr.voided .void-note { text-decoration: none; display: block; color: #a4262c; }
.ledger tr.led-refund td:nth-child(3) { color: #a4262c; }
.ledger tfoot td { border-top: 2px solid var(--line); }
tr.voided td { color: var(--muted); }
@media print {
  body.printing .print-doc.money-doc { display: block !important; padding: 0 !important; font-family: 'Inter', Arial, sans-serif; font-size: 10pt; color: #1e2536; }
  .money-doc .tr-head { display: flex; gap: 12px; align-items: center; border-bottom: 3px double #23345a; padding-bottom: 8px; margin-bottom: 12px; }
  .money-doc .tr-head img { width: 56px; height: 56px; border-radius: 50%; object-fit: contain; }
  .money-doc .tr-head h1 { font: 700 15pt 'Fraunces', Georgia, serif; margin: 0; color: #23345a; }
  .money-doc .tr-head p { margin: 2px 0 0; }
  .money-doc .tr-head p:last-child { font: 600 12pt 'Fraunces', Georgia, serif; color: #c0621a; }
  .money-doc .table { width: 100%; border-collapse: collapse; }
  .money-doc .table th, .money-doc .table td { border-bottom: 1px solid #e2e6e9; padding: 4px 6px; }
  .money-doc .no-print, .money-doc .icon-btn { display: none !important; }
  .money-doc .receipt { width: 100%; max-width: 520px; border-collapse: collapse; margin: 10px 0 16px; }
  .money-doc .receipt th { text-align: left; width: 40%; color: #5d6679; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #e2e6e9; }
  .money-doc .receipt td { padding: 6px 8px; border-bottom: 1px solid #e2e6e9; }
  .money-doc .void-stamp { border: 2px solid #a4262c; color: #a4262c; font-weight: 700; padding: 6px 10px; display: inline-block; }
}

/* Essay format guide (hand-in window) */
.essay-guide { background: #eef6f7; border: 1px solid #cfe5e8; border-left: 4px solid var(--aqua); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.essay-guide p { margin: 4px 0 8px; }

/* Grades: "current grades are not final" */
.grades-disclaimer { background: #fff8e8; border: 1px solid #f3dca6; border-left: 4px solid var(--gold); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: .92rem; line-height: 1.5; }
.grade-not-final { display: block; color: var(--warn); margin-top: 4px; line-height: 1.4; }
.stat small { font-size: .75rem; }

/* Rejected application: reason and "apply again" */
.reject-box { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #fdf3f2; border-left: 4px solid var(--danger); display: block; }
.reject-box p { margin: 0 0 6px; }

/* Application step 3: email the pastor, or a paper form from a previous year */
.pastor-mode { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; padding: 10px 12px; background: #f6f8fa; border-radius: 10px; }

/* Student course registration: one heading per school year */
.reg-year { margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.reg-pick { max-width: 320px; }
.reg-list { list-style: none; padding: 0; margin: 0 0 12px; }
.reg-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.reg-card .quote { max-width: 460px; margin-bottom: 14px; }
/* Admin: a student's courses */
.sc-top { margin-bottom: 10px; }
.sc-box { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 12px; background: #fafbfc; }
.sc-box .row-gap { margin: 6px 0 2px; }

/* Address: City (wide) · State · ZIP */
.addr-grid { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 640px) { .addr-grid { grid-template-columns: 1fr 1fr; } .addr-grid > :first-child { grid-column: 1 / -1; } }

/* Assignment materials */
.materials { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.mat-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface, #fff); color: var(--navy-text, var(--navy)); border-radius: 999px;
  padding: .2rem .65rem; font: 500 .8rem var(--sans); text-decoration: none; cursor: pointer; max-width: 100%; }
.mat-chip:hover { border-color: var(--aqua); background: var(--aqua-soft); }
.mat-chip small { color: var(--muted); }
.mat-editor { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin: 6px 0 12px; background: #fafbfc; }
.mat-editor-head { display: flex; flex-direction: column; margin-bottom: 6px; }
.mat-list { list-style: none; padding: 0; margin: 0 0 10px; }
.mat-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mat-list li:last-child { border-bottom: 0; }
.mat-list small { display: block; }
.syl-current { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f6f8fb; }
.syl-current small { display: block; }
.syl-btn { margin-top: 4px; }
.syl-pages-help { margin-top: 8px; }
.syl-pages-help p, .syl-pages-help ul { margin: 6px 0; }
.syl-pages-help ul { padding-left: 1.2em; }
.syl-pages-help li { margin: 3px 0; }
.viewer-body.single { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
.viewer-body.single > * { min-height: 0; }
.syl-frame { width: 100%; height: 100%; border: 0; background: #e9edf0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0; }
.mat-link-form { margin-top: 10px; }

/* Assignment schedule & late work */
.sched-chip { display: inline-block; background: #e7eef6; color: var(--navy-text, var(--navy)); border-radius: 999px; padding: 0 .45rem; font-weight: 600; white-space: nowrap; }
.late-text { color: var(--danger); font-weight: 600; }
.note.late-note { background: #fdecea; color: #a4262c; }

/* Reports filters */
.rep-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; align-items: end; padding-bottom: 8px; }
.rep-filters .field { margin-bottom: 10px; }
.rep-filters .inline-select { width: 100%; min-width: 0; }
.rep-filters .field { min-width: 0; }
@media (max-width: 640px) { .rep-filters { grid-template-columns: 1fr 1fr; } .rep-filters .rep-search { grid-column: 1 / -1; } }
.rep-filter-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rep-summary { margin: -6px 0 12px; }
.rep-total td { font-weight: 700; border-top: 2px solid var(--line); }
.rep-dates .inline-select { width: auto; }
@media print { .no-print { display: none !important; } }

/* Organization logo (System Tools → Organization): any shape fits; square option instead of round */
img[data-org-logo] { object-fit: contain; }
.logo-square img[data-org-logo] { border-radius: 12%; }
.pre-line { white-space: pre-line; }
.tr-address { font-size: .8em; margin: 0 0 2px; color: #5d6679; }
.org-logo-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.org-logo-preview { width: 140px; height: 140px; border-radius: 50%; background: var(--surface, #fff); border: 1px solid var(--line); object-fit: contain; }
.logo-square .org-logo-preview, .org-logo-preview.square { border-radius: 12%; }

/* System Tools (system.html) */
.sys-main { padding-top: 24px; padding-bottom: 48px; }
.sys-title { text-align: center; font-size: 1.9rem; margin: 6px 0 18px; }
.sys-title.left { text-align: left; margin-top: 14px; }
.sys-h { font-size: 1.2rem; margin: 26px 0 12px; }
.sys-back { margin-top: 4px; }
.sys-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 118px; text-decoration: none; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.sys-tile:hover, .sys-tile:focus-visible { box-shadow: 0 0 0 2px var(--aqua), var(--shadow); transform: translateY(-1px); }
.sys-ico { font-size: 1.8rem; line-height: 1; }
.sys-tile small { font-size: .8rem; }
.sys-tile.has-items small { color: var(--danger); font-weight: 600; }
.sys-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; align-items: end; }
.sys-filters .field { margin-bottom: 10px; }
.sys-filter-btns { display: flex; gap: 8px; margin-bottom: 10px; }
.sys-hint { grid-column: 1 / -1; margin: 0; }
.sys-results-bar { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 10px; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.pager button, .pager span { border: 1px solid var(--line); background: var(--surface, #fff); color: var(--navy-text, var(--navy)); padding: .4rem .75rem; font: 500 .88rem var(--sans); margin-left: -1px; cursor: pointer; }
.pager button:first-child { border-radius: 8px 0 0 8px; }
.pager button:last-child { border-radius: 0 8px 8px 0; }
.pager button.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager button:disabled { color: var(--muted); background: #f3f5f6; cursor: default; }
.pager span { color: var(--muted); cursor: default; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; text-decoration: underline; }
.sys-log .sys-row { cursor: pointer; }
.sys-log .sys-row:hover td { background: #f7f9fa; }
.sys-log .sys-row.open td { background: #eef4f5; border-bottom: 0; }
.sys-msg { font-weight: 500; word-break: break-word; }
.sys-detail td { background: #f7f9fa; }
.sys-detail pre { white-space: pre-wrap; word-break: break-word; margin: 0; font: .8rem/1.45 ui-monospace, Consolas, monospace; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-height: 360px; overflow: auto; }
.badge-src { background: #e7eef6; color: var(--navy-text, var(--navy)); }
.diag-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--ok); vertical-align: middle; }
.diag-dot.warn { background: var(--gold); } .diag-dot.bad { background: var(--danger); }
.sys-diag td:first-child { font-weight: 600; white-space: nowrap; }
.sys-secret { border-left: 4px solid var(--gold); }
.sys-secret ul, .sys-links { margin: 0; padding-left: 1.2rem; }
.sys-secret li, .sys-links li { margin: .35rem 0; }
code { font: .85rem ui-monospace, Consolas, monospace; background: #f1f4f5; border-radius: 5px; padding: .1rem .35rem; word-break: break-all; }

/* Privacy policy / terms */
.legal { max-width: 780px; background: var(--surface, #fff); border-radius: 16px; box-shadow: var(--shadow); padding: 36px 40px; margin-top: 28px; margin-bottom: 40px; }
.legal h1 { font-size: 2rem; margin-bottom: .2rem; }
.legal h2 { font-size: 1.2rem; margin: 1.8rem 0 .5rem; }
.legal ul { padding-left: 1.3rem; }
.legal li { margin: .35rem 0; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
/* Spam trap on the contact form: invisible to people */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* 404 page */
.not-found .nf-code { font: 700 3.2rem var(--serif, Georgia); color: var(--muted); margin: 0; line-height: 1; }
.not-found h1 { margin-bottom: .2rem; }
.not-found h2 { font-size: 1.15rem; margin: 1rem 0 .2rem; }
.nf-actions { justify-content: center; margin-top: 18px; }
@media (max-width: 640px) { .legal { padding: 24px 18px; border-radius: 12px; } .legal h1 { font-size: 1.6rem; } }
.login-error { background: #fdecea; color: #a4262c; border-radius: 8px; padding: 10px 12px; font-size: .9rem; margin: 0 0 12px; }
/* Full-screen loader while the database answers */
.boot-overlay { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(255,255,255,.92); padding: 16px; }
.boot-box { background: var(--surface, #fff); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 24px 28px; max-width: 420px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.boot-box .spinner { display: inline-block; vertical-align: middle; }
.role-tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: #eef3f4; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.role-tabs button { border: 0; background: none; padding: .55rem; border-radius: 9px; font: 600 .88rem var(--sans); cursor: pointer; color: var(--muted); }
.role-tabs button.active { background: var(--surface, #fff); color: var(--navy-text, var(--navy)); box-shadow: var(--shadow); }
.demo-box { background: var(--aqua-soft); border-radius: 12px; padding: 12px 14px 2px; margin-bottom: 14px; }
.demo-box p { margin: 0 0 10px; }

/* ---------- Portal shell ---------- */
.portal { background: #f1f4f5; }
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #d3dcec; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { color: #fff; padding: 0 6px 16px; }
.sidebar .brand small { color: #aebbd4; }
.portal-name { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 700; padding: 0 10px 10px; }
#nav a { display: flex; align-items: center; gap: 10px; padding: .6rem .75rem; border-radius: 10px; color: #d3dcec; text-decoration: none; font-size: .92rem; font-weight: 500; margin-bottom: 2px; }
#nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
#nav a.active { background: rgba(58, 138, 147, .22); color: #fff; box-shadow: inset 3px 0 0 var(--aqua); }
.nav-ico { width: 22px; text-align: center; }
.nav-badge { margin-left: auto; background: var(--gold); color: var(--navy-text, var(--navy)); font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 0 .45rem; }
.sidebar-foot { margin-top: auto; padding-top: 16px; }
.sidebar-foot .btn { width: 100%; font-size: .78rem; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; background: var(--surface, #fff); border-bottom: 1px solid var(--line); padding: 10px 24px; min-height: 64px; }
.topbar-title { font: 700 1.1rem var(--serif); color: var(--navy-text, var(--navy)); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.menu-btn { display: none; font-size: 1.4rem; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--aqua), var(--navy)); color: #fff; display: grid; place-items: center; font-weight: 700; }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; font-size: .85rem; }
.user-meta small { color: var(--muted); }
.view { padding: 24px; max-width: 1680px; } /* uses wide screens; stops before lines get too long */
.view > h2, .section-head h2 { font-size: 1.6rem; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.scrim { display: none; }
.demo-pill { font-size: .7rem; background: var(--warn-soft); color: var(--warn); padding: .1rem .5rem; border-radius: 999px; font-weight: 600; margin-left: 4px; }

.stat { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
a.stat[href]:hover { box-shadow: 0 0 0 2px var(--aqua), var(--shadow); }
.stat-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat b { font-family: var(--serif); font-size: 1.45rem; color: var(--navy-text, var(--navy)); }
.stat.warn b { color: var(--warn); }
.class-card { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(120deg, #fff 60%, var(--aqua-soft)); border-left: 5px solid var(--aqua); }
.class-card h3 { font-size: 1.4rem; margin: .1rem 0 .3rem; }
.class-card p { margin: .15rem 0; }
.balance-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.course-card h3 { margin: .2rem 0 .4rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
/* Phones: any card holding a wide table scrolls sideways instead of widening the page */
@media (max-width: 640px) { .card:has(> .table), .modal-body:has(> .table) { overflow-x: auto; } }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: .6rem .7rem; border-bottom: 2px solid var(--line); }
.table th.num { text-align: right; } /* number columns: header lines up with the numbers */
.table td { padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f6fafb; }
.table tr.unread td { font-weight: 700; background: #f3fafc; }
.table tr.dim td { opacity: .55; }
.table td.empty, p.empty { color: var(--muted); text-align: center; padding: 1.2rem; font-style: italic; }
.table td.actions { text-align: right; }
/* Several buttons in a row cell: they wrap instead of running off the edge */
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.row-actions .btn.small { padding: .35rem .7rem; }
/* List screens (icon buttons only): keep the icons on one line, column just wide enough */
@media screen and (min-width: 761px) {
  .crud-table td.actions { width: 1%; white-space: nowrap; }
  .crud-table .row-actions { flex-wrap: nowrap; gap: 2px; }
}
.table td.name-cell { white-space: nowrap; }

/* Phones and small tablets: tables show each row as a card (label: value).
   Grids that only make sense as a grid opt out: .no-stack, the gradebook, editors, price quotes. */
/* Screens only: on paper (narrower than 760px) tables must stay tables */
@media screen and (max-width: 760px) {
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) thead { display: none; }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote), .table:not(.no-stack, .gb-grid, .setup-table, .quote) tbody, .table:not(.no-stack, .gb-grid, .setup-table, .quote) tfoot, .table:not(.no-stack, .gb-grid, .setup-table, .quote) tr, .table:not(.no-stack, .gb-grid, .setup-table, .quote) td { display: block; width: 100%; }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; background: var(--surface, #fff); }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) td { border: 0; padding: 4px 0; text-align: left; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; overflow-wrap: anywhere; }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) td > * { max-width: 100%; }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) td.num { text-align: right; }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) td[data-label]::before { content: attr(data-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; flex-shrink: 0; }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) td:first-child { font-size: 1rem; padding-top: 2px; }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) td.actions { display: block; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) td.actions::before { display: none; }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) .row-actions { justify-content: flex-start; }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) td.empty { display: block; text-align: center; }
  .table:not(.no-stack, .gb-grid, .setup-table, .quote) td:empty { display: none; }
  .table-wrap:has(> .table:not(.no-stack, .gb-grid, .setup-table, .quote)), .card:has(> .table:not(.no-stack, .gb-grid, .setup-table, .quote)) { overflow: visible; }
}
.table td.owed { color: var(--danger); font-weight: 600; }
.matrix td:not(:first-child), .matrix th:not(:first-child) { text-align: center; }
.matrix td:not(:first-child) { color: var(--ok); font-weight: 700; }
.grade-input { width: 90px; padding: .4rem .6rem; border: 1.5px solid var(--line); border-radius: 8px; font: .95rem var(--sans); }

.badge { display: inline-block; font-size: .74rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; white-space: nowrap; }
.badge-current { background: var(--aqua-soft); color: #11718a; }
.badge-completed { background: var(--ok-soft); color: var(--ok); }
.badge-upcoming { background: #eceff1; color: var(--muted); }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.grade { font-family: var(--serif); font-size: 1.05rem; }
.grade-A { color: var(--ok); } .grade-B { color: #2a7fa0; } .grade-C { color: var(--warn); } .grade-D, .grade-F { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--aqua-soft); color: var(--navy-text, var(--navy)); font-size: .78rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; }
.dist { display: inline-block; font-size: .8rem; background: #f1f4f5; border-radius: 6px; padding: 0 .35rem; margin: 1px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; }
.dl dt { font-weight: 600; color: var(--muted); font-size: .85rem; }
.dl dd { margin: 0; }
/* Application window: same label width in every section, labels lined up with their values */
.app-detail h4 { margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.app-detail > h4:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
.app-detail .dl { grid-template-columns: 200px 1fr; align-items: baseline; }
.app-detail .pastor-review { border-top: 0; padding-top: 0; }
.app-detail .app-decide { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.app-detail .app-decide p { margin: 8px 0 0; }
.app-contact { margin-top: 2px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .app-detail .dl { grid-template-columns: 1fr; gap: 0 0; } .app-detail .dl dd { margin-bottom: 8px; } }
.msg-body { white-space: pre-wrap; background: #f6f8f9; border-radius: 10px; padding: 14px; margin-bottom: 14px; }

/* Modal & toast */
.modal-wrap { position: fixed; inset: 0; background: rgba(22, 31, 56, .55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface, #fff); border-radius: 16px; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { max-width: 640px; }
.modal.wide.xl { max-width: min(1100px, 100%); } /* statements, a student's courses: room for the table */
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; gap: 12px;
  position: sticky; top: 0; background: var(--surface, #fff); z-index: 2; border-radius: 16px 16px 0 0; }
@media (max-width: 640px) {
  .modal-wrap { padding: 8px; }
  .modal { max-height: 96vh; border-radius: 12px; }
  .modal-head { padding: 14px 14px 6px; }
  .modal-body { padding: 8px 14px 16px; }
}
/* Statement: description gets the room, numbers stay on one line */
.ledger td:nth-child(2) { min-width: 220px; }
.ledger td.num, .ledger th.num { white-space: nowrap; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 10px 20px 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 40px); }
.toast { background: var(--navy); color: #fff; padding: .75rem 1rem; border-radius: 12px; box-shadow: var(--shadow); font-size: .9rem; max-width: 380px; transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translateY(8px); }
.stripe-demo { text-align: center; }
.stripe-logo { font: 800 1.6rem var(--sans); color: #635bff; letter-spacing: -.02em; }
.stripe-amount { font: 700 2rem var(--serif); color: var(--navy-text, var(--navy)); margin: .3rem 0; }

/* Printable documents */
.print-doc { display: none; }
@media print {
  body.printing > *:not(.print-doc) { display: none !important; }
  body.printing .print-doc { display: block; padding: 20px; font-size: 12pt; }
  .portal .sidebar, .portal .topbar, .section-head .btn { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .doc-head { display: flex; gap: 16px; align-items: center; border-bottom: 2px solid var(--navy); margin-bottom: 16px; }
  .doc-head img { width: 64px; }
}

/* Page size and margins for each kind of printout (certificates and transcripts landscape,
   statements portrait…) are set by printDocuments() in common.js for that print job only.
   Named @page rules aren't used: switching page types makes Chrome add a blank sheet at the end. */
@media print {
  body.printing { margin: 0; padding: 0; background: var(--surface, #fff); }
  body.printing .print-doc.last-page { break-after: auto !important; page-break-after: auto !important; margin-bottom: 0 !important; }
  body.printing .print-doc.last-page > :last-child { margin-bottom: 0; }
}
@media print {
  body.printing .print-doc.report-doc { display: block !important; padding: 0 !important; font-family: 'Inter', Arial, sans-serif; font-size: 9pt; color: #1e2536;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report-doc .tr-head { display: flex; gap: 12px; align-items: center; border-bottom: 3px double #23345a; padding-bottom: 6px; margin-bottom: 6px; }
  .report-doc .tr-head img { width: 48px; height: 48px; border-radius: 50%; }
  .report-doc .tr-head h1 { font: 700 15pt 'Fraunces', Georgia, serif; margin: 0; color: #23345a; }
  .report-doc .tr-head p { margin: 2px 0 0; font: 600 10.5pt 'Fraunces', Georgia, serif; color: #c0621a; }
  .report-doc .rp-meta { margin: 0 0 8px; color: #5d6679; }
  .report-doc .rp-table { width: 100%; border-collapse: collapse; }
  .report-doc .rp-table th { font-size: 7.5pt; text-align: center; vertical-align: bottom; border-bottom: 1.5px solid #23345a; padding: 3px 4px; }
  .report-doc .rp-table th:first-child { text-align: left; }
  .report-doc .rp-table th span { font-weight: 400; color: #5d6679; }
  .report-doc .rp-table td { border-bottom: 1px solid #e2e6e9; padding: 3px 4px; text-align: center; }
  .report-doc .rp-table td.rp-name { text-align: left; white-space: nowrap; }
  .report-doc .rp-table tr { break-inside: avoid; }
  .report-doc .rp-table thead { display: table-header-group; }
  .report-doc .rp-table tfoot td { border-top: 1.5px solid #23345a; font-weight: 700; background: #f6f8f9; }
  .report-doc .rp-run { color: #8a93a3; }
  .report-doc .rp-legend { margin-top: 8px; font-size: 7.5pt; color: #5d6679; }
}
.ov-pick { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
@media print {
  body.printing .print-doc.certificate {
    break-after: page; page-break-after: always;
    box-sizing: border-box; width: 100%; height: 7.75in; /* 8.5in − 2 × 0.35in margins, minus a little safety */
    display: flex !important; flex-direction: column; align-items: center; justify-content: space-evenly;
    padding: 0.35in 0.9in !important; text-align: center; font-family: 'Fraunces', Georgia, serif; color: #1e2536;
    border: 10px double #d6a645; outline: 1px solid #d6a645; outline-offset: -22px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; overflow: hidden;
  }
  body.printing .print-doc.transcript-doc { break-after: page; page-break-after: always; display: block !important; padding: 0 !important;
    font-family: 'Inter', Arial, sans-serif; font-size: 10.5pt; color: #1e2536; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing .print-doc.last-page { break-after: auto !important; page-break-after: auto !important; }
  .transcript-doc .tr-head { display: flex; gap: 14px; align-items: center; border-bottom: 3px double #23345a; padding-bottom: 8px; margin-bottom: 12px; }
  .transcript-doc .tr-head img { width: 60px; height: 60px; border-radius: 50%; }
  .transcript-doc .tr-head h1 { font: 700 17pt 'Fraunces', Georgia, serif; margin: 0; color: #23345a; }
  .transcript-doc .tr-head p { margin: 2px 0 0; font: 600 12pt 'Fraunces', Georgia, serif; color: #c0621a; text-transform: uppercase; letter-spacing: .06em; }
  .transcript-doc table { width: 100%; border-collapse: collapse; }
  .transcript-doc .tr-info { margin-bottom: 12px; background: #f6f8f9; }
  .transcript-doc .tr-info th { text-align: left; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .05em; color: #5d6679; padding: 4px 8px; width: 16%; }
  .transcript-doc .tr-info td { padding: 4px 8px; }
  .transcript-doc h3 { font: 700 11pt 'Fraunces', Georgia, serif; color: #23345a; margin: 12px 0 4px; }
  .transcript-doc .tr-table th { text-align: left; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .04em; color: #5d6679; border-bottom: 1.5px solid #23345a; padding: 3px 6px; }
  .transcript-doc .tr-table td { border-bottom: 1px solid #e2e6e9; padding: 3px 6px; }
  .transcript-doc .num { text-align: right; }
  .transcript-doc .tr-subtotal td { border-bottom: 0; font-size: 9pt; color: #5d6679; font-style: italic; }
  .transcript-doc .tr-prior { font-size: 8pt; color: #5d6679; font-style: italic; }
  .transcript-doc .tr-table tr { break-inside: avoid; }
  .transcript-doc .tr-table thead { display: table-header-group; }
  .transcript-doc .tr-info th { width: auto; white-space: nowrap; }
  .transcript-doc .tr-notes { font-size: 8.5pt; color: #5d6679; margin: 8px 0 0; }
  .transcript-doc .tr-head .tr-address { font: 400 9pt 'Inter', Arial, sans-serif; color: #5d6679; margin-top: 2px; }
  .transcript-doc .tr-summary { display: flex; justify-content: space-between; margin-top: 12px; padding: 6px 8px; border-top: 2px solid #23345a; font-weight: 600; }
  .transcript-doc .tr-certs, .transcript-doc .tr-scale { margin: 8px 0 0; font-size: 9pt; }
  .transcript-doc .tr-sign { display: flex; justify-content: space-between; gap: 40px; margin-top: 34px; }
  /* Page frame: header (thead) and footer (tfoot) repeat on every printed page */
  .page-frame { width: 100%; border-collapse: collapse; }
  .page-frame > thead > tr > td, .page-frame > tfoot > tr > td, .page-frame > tbody > tr > td { padding: 0; border: 0; vertical-align: top; }
  .page-frame > thead { display: table-header-group; }
  .page-frame > tfoot { display: table-footer-group; }
  .page-frame > tbody > tr { break-inside: auto; page-break-inside: auto; }
  .page-frame > thead .tr-info { margin-bottom: 10px; }
  .page-frame .tr-foot { padding-top: 10px; border-top: 1px solid #e2e6e9; margin-top: 12px; }
  .page-frame .tr-foot .tr-scale, .page-frame .tr-foot .tr-notes { margin-top: 0; }
  .transcript-doc .tr-sign div { border-top: 1px solid #333; padding-top: 4px; width: 45%; text-align: center; font-size: 9.5pt; }
  .certificate .cert-logo { width: 1.15in; height: 1.15in; border-radius: 50%; }
  .certificate h1 { font-size: 24pt; margin: 0; color: #23345a; }
  .certificate .cert-title { font-size: 30pt; margin: 0; color: #c0621a; letter-spacing: .02em; }
  .certificate .cert-kicker { font-size: 14pt; font-style: italic; margin: 0; }
  .certificate .cert-name { font-size: 38pt; margin: 0; padding: 0 .5in .06in; border-bottom: 1.5px solid #888; color: #23345a; display: inline-block; }
  .certificate .cert-body { font-size: 15pt; line-height: 1.45; max-width: 8.2in; margin: 0; font-family: Georgia, 'Times New Roman', serif; }
  .certificate .cert-date { font-size: 13pt; margin: 0; font-family: Georgia, serif; }
  .certificate .cert-footer { font-size: 12pt; font-style: italic; margin: 0; max-width: 8in; }
  .certificate .sigs { display: flex; justify-content: space-around; width: 100%; gap: .5in; margin: 0; font-family: 'Inter', Arial, sans-serif; font-size: 11pt; }
  .certificate .sigs div { border-top: 1px solid #333; padding-top: 6px; width: 2.6in; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .site-nav { position: fixed; top: 70px; left: 0; right: 0; flex-direction: column; background: var(--surface, #fff); padding: 10px 16px 18px;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .site-nav-open .site-nav { display: flex; }
  .header-actions { margin-left: auto; }
  .nav-btn { display: block; }
}
@media (max-width: 900px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3, .split { grid-template-columns: 1fr; }
  .split { gap: 24px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 40; }
  .menu-btn { display: block; }
  .user-meta { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero { padding: 60px 0 130px; }
  .header-actions .btn { display: none; }
  .view { padding: 16px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar-title { font-size: 1rem; }
  .search { width: 100%; }
  .brand span { font-size: .9rem; }
}

/* ---------- Dark mode (portals) ----------
   <html data-theme="dark"> is set by Theme in common.js (My profile → Appearance: light, dark or system).
   Screen only: printouts stay black on white. */
@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --cream: #10141c; --surface: #1a202b; --white: #1a202b;
    --ink: #e3e7ee; --muted: #9ca6b8; --line: #2d3545;
    --navy-text: #c6d4f0; --navy-2: #93b3ea;
    --aqua-soft: #1b3438; --aqua-text: #7cc8d0;
    --ok: #52c48f; --ok-soft: #173a2a; --warn: #e5b45f; --warn-soft: #3a2f18;
    --gold-2: #f3a95b; --danger: #ef7466;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 6px 20px rgba(0, 0, 0, .35);
  }
  html[data-theme="dark"] body, html[data-theme="dark"] .portal { background: var(--cream); color: var(--ink); }
  /* Inputs */
  html[data-theme="dark"] :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=range]) { background-color: #121720; color: var(--ink); border-color: #3a4457; }
  html[data-theme="dark"] ::placeholder { color: #6f7a8e; }
  /* Pastel boxes, badges and tags */
  html[data-theme="dark"] .badge-current { color: #7cc8d0; }
  html[data-theme="dark"] .badge-upcoming { background: #262e3c; }
  html[data-theme="dark"] .badge-late, html[data-theme="dark"] .note.late-note { background: #3d1f1d; color: #f19a8f; }
  html[data-theme="dark"] .badge-src { background: #23304a; }
  html[data-theme="dark"] :is(.sec-es, .sec-pill.sec-es) { color: #7cc8d0; }
  html[data-theme="dark"] :is(.sec-en, .sec-pill.sec-en) { background: #3b2a16; }
  html[data-theme="dark"] .grade-B { color: #6cb8d8; }
  html[data-theme="dark"] :is(.subtabs, .role-tabs) { background: #121720; }
  html[data-theme="dark"] .sched-chip { background: #23304a; color: var(--navy-text); }
  html[data-theme="dark"] .table tr.clickable:hover td, html[data-theme="dark"] .table tr.unread td { background: #1f2734; }
  html[data-theme="dark"] .table tr.bad-row td { background: #33201f; }
  html[data-theme="dark"] .table tr.next-row td { background: #2c2617; }
  html[data-theme="dark"] :is(.gb-grid td.total-col, .gb-grid.overview tfoot td) { background: #1f2734; }
  html[data-theme="dark"] :is(.grades-disclaimer) { background: #2c2617; border-color: #4a3c1d; }
  html[data-theme="dark"] :is(.essay-guide) { background: #172a2e; border-color: #24464b; }
  html[data-theme="dark"] :is(.term-auto, .syl-current, .rep-filters, .sc-box) { background-color: #161c26; }
  /* Light gradients and pale panels → dark equivalents */
  html[data-theme="dark"] :is(.pay-howto, .class-card) { background: linear-gradient(120deg, var(--surface) 60%, #1b3438); }
  html[data-theme="dark"] .year-card.ministry { background: linear-gradient(180deg, #2c2617, var(--surface) 60%); }
  html[data-theme="dark"] :is(.pastor-box, .cert-preview, .sec-mode, .mini-form, .email-meta, .gdoc-steps, .pastor-mode, .mat-editor,
      .msg-body, .sys-detail td, .help-topic:hover, .sys-log .sys-row:hover td, .sys-log .sys-row.open td, .field input:disabled,
      .pager button:disabled, code, .dist, .portal, .flow-page, .section.alt) { background: #161c26; }
  html[data-theme="dark"] :is(.stepper li span, .plan-progress, .att-chip, .att-cell.att-E, .timeline li::after) { background: #2a3242; }
  html[data-theme="dark"] :is(.att-cell.att-A, .att-chip.att-A, .hist-input.bad, .grade-input.bad, .reject-box, .login-error) { background: #3d1f1d; }
  html[data-theme="dark"] .login-error { color: #f19a8f; }
  html[data-theme="dark"] :is(.viewer-pages, .syl-frame) { background: #0c1017; }
  html[data-theme="dark"] .portal { background: var(--cream); }
  /* System Tools uses the website header: dark bar to match (the public site never gets data-theme) */
  html[data-theme="dark"] .site-header { background: rgba(26, 32, 43, .96); border-bottom-color: var(--line); }
  html[data-theme="dark"] .sys-page { background: var(--cream); }
  html[data-theme="dark"] .modal-wrap { background: rgba(0, 0, 0, .6); }
  html[data-theme="dark"] .btn-primary:not(:disabled) { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
  html[data-theme="dark"] .btn-ghost { box-shadow: inset 0 0 0 1.5px #3a4457; }
  html[data-theme="dark"] hr { border-color: var(--line); }
  /* Things that should stay white: logos, photos, signatures, document and PDF previews */
  html[data-theme="dark"] :is(.brand img, img.avatar, .org-logo-preview, .sig-pad, .sig-img, .vpage, .docx-render, .cert-preview .certificate, .btn-google, .chip-av .cam) { background: #fff; }
  html[data-theme="dark"] :is(.cert-preview .certificate, .docx-render) { color: #1e2536; }
}

/* Appearance choice in "My profile" */
.theme-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.theme-pick label { display: inline-flex; align-items: center; gap: 6px; padding: .45rem .8rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; font-size: .9rem; }
.theme-pick input { accent-color: var(--aqua); }
.theme-pick label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--aqua); background: var(--aqua-soft); font-weight: 600; }
.profile-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- Guides for students and teachers (guide.html) ---------- */
.guide { max-width: 860px; }
.guide-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; }
.guide-tabs a { padding: .45rem .9rem; border-radius: 999px; text-decoration: none; font-weight: 600; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }
.guide-tabs a.active { background: var(--navy); color: #fff; box-shadow: none; }
.guide-tabs .btn { margin-left: auto; }
.guide-head { display: flex; gap: 16px; align-items: center; margin-bottom: 10px; }
.guide-head img { width: 64px; height: 64px; border-radius: 50%; background: #fff; flex-shrink: 0; }
.guide-head h1 { margin: 0; }
.guide-toc { background: var(--aqua-soft); border-radius: 12px; padding: 14px 18px; margin: 18px 0 8px; }
.guide-toc ol { margin: 6px 0 0; padding-left: 1.3rem; columns: 2; column-gap: 28px; }
.guide-toc li { margin: .2rem 0; break-inside: avoid; }
.guide-toc a { text-decoration: none; }
.guide-sec { padding-top: 6px; }
.guide-sec h2 { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 18px; }
.guide-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font: 700 .85rem var(--sans); flex-shrink: 0; }
.guide-sec p.tip { background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; font-size: .92rem; }
.guide-help { margin-top: 10px; }
@media (max-width: 640px) { .guide-toc ol { columns: 1; } .guide-tabs .btn { margin-left: 0; } }
@media print {
  .guide-page { background: #fff; }
  .guide-page .legal { box-shadow: none; padding: 0; margin: 0; max-width: none; }
  .guide-sec { break-inside: avoid-page; }
  .guide-sec h2 { break-after: avoid; }
  .guide-toc, .guide-sec p.tip, .guide-num { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .guide a { color: inherit; text-decoration: none; }
}
/* Help drawer: link to the full guide */
.help-guide { display: flex; gap: 10px; align-items: center; padding: 10px 12px; margin: 6px 0 10px; border-radius: 10px; background: var(--aqua-soft); text-decoration: none; color: var(--ink); font-size: .92rem; }
.help-guide:hover { box-shadow: inset 0 0 0 1.5px var(--aqua); }
.help-guide span { display: flex; flex-direction: column; }
.help-guide small { color: var(--muted); }
.help-guides { margin: 4px 0 12px; }
.help-guides .help-guide { margin: 6px 0; }
/* "New here?" card on the student and teacher home pages */
.guide-card { display: flex; gap: 14px; align-items: flex-start; border-left: 5px solid var(--aqua); }
.guide-card-ico { font-size: 1.8rem; line-height: 1; }
.guide-card > div { flex: 1; }
.guide-card p { margin: 4px 0 10px; }
