:root {
  --navy-950: #031126;
  --navy-900: #071b3b;
  --navy-800: #0b2b58;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ef;
  --paper: #ffffff;
  --soft: #f5f8fc;
  --gold: #d5a62e;
  --gold-soft: #fff8df;
  --success: #166534;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(3,17,38,.12);
  --radius: 22px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--paper);line-height:1.55}
a{color:inherit;text-decoration:none}
button,input,select{font:inherit}
.container{width:min(1160px,calc(100% - 32px));margin-inline:auto}
.hidden{display:none!important}
.noscript{padding:12px;background:#fee2e2;color:#7f1d1d;text-align:center;font-weight:700}
.site-header{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid rgba(219,227,239,.9)}
.header-inner{min-height:74px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.brand{display:flex;align-items:center;gap:12px;color:var(--navy-900)}
.brand-mark{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:var(--navy-900);color:white;font-weight:900;font-size:22px;box-shadow:0 8px 20px rgba(7,27,59,.2)}
.brand strong{display:block;letter-spacing:.04em}
.brand small{display:block;color:var(--muted);font-size:12px}
.top-nav{display:flex;align-items:center;gap:22px;font-weight:700;font-size:14px;color:#334155}
.top-nav a:hover{color:var(--navy-900)}
.hero{background:radial-gradient(circle at 90% 10%,rgba(213,166,46,.18),transparent 35%),linear-gradient(135deg,var(--navy-950),var(--navy-800));color:white;padding:90px 0}
.hero-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:54px;align-items:center}
.eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:12px;letter-spacing:.16em;font-weight:900;color:var(--gold);text-transform:uppercase}
.hero h1{font-size:clamp(42px,6vw,72px);line-height:1.03;letter-spacing:-.045em;margin:14px 0 20px;max-width:760px}
.hero-copy{font-size:19px;color:#dbe7f7;max-width:700px;margin:0 0 28px}
.hero-actions{display:flex;gap:14px;flex-wrap:wrap}
.btn{border:0;border-radius:13px;padding:13px 20px;font-weight:850;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:transform .15s ease,box-shadow .15s ease,background .15s ease}
.btn:hover{transform:translateY(-1px)}
.btn-primary{background:var(--gold);color:var(--navy-950);box-shadow:0 10px 24px rgba(213,166,46,.25)}
.btn-secondary{background:white;color:var(--navy-900);border:1px solid var(--line)}
.btn-danger{background:#fff1f0;color:var(--danger);border:1px solid #fecdca}
.btn-block{width:100%}
.trust-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:28px}.trust-row span{font-size:12px;font-weight:800;padding:8px 11px;border:1px solid rgba(255,255,255,.16);border-radius:999px;color:#e5edf8;background:rgba(255,255,255,.05)}
.hero-card{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);border-radius:28px;padding:24px;box-shadow:0 24px 70px rgba(0,0,0,.22)}
.hero-card-head{display:flex;align-items:center;gap:9px;color:#dce8f6;font-size:13px;font-weight:800;margin-bottom:18px}.status-dot{width:10px;height:10px;border-radius:50%;background:var(--gold);box-shadow:0 0 0 5px rgba(213,166,46,.15)}
.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.metric-grid div{padding:18px;border-radius:16px;background:rgba(255,255,255,.07)}.metric-grid strong,.metric-grid span{display:block}.metric-grid strong{font-size:20px}.metric-grid span{font-size:12px;color:#c7d5e8;margin-top:4px}
.backend-badge{margin-top:16px;padding:12px 14px;border-radius:13px;font-size:12px;font-weight:800}.backend-badge.pending{background:#fff8df;color:#6f5200}.backend-badge.ok{background:#dcfce7;color:#14532d}.backend-badge.error{background:#fee2e2;color:#7f1d1d}
.section{padding:82px 0}.section-alt{background:var(--soft)}.section-heading{max-width:760px;margin-bottom:34px}.section-heading h2,.auth-copy h2,.dashboard-header h2{font-size:clamp(30px,4vw,46px);line-height:1.1;letter-spacing:-.03em;margin:10px 0 14px;color:var(--navy-900)}.section-heading p,.auth-copy>p{color:var(--muted);font-size:17px}
.feature-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.feature-card{border:1px solid var(--line);border-radius:var(--radius);padding:24px;background:white;box-shadow:0 10px 28px rgba(15,23,42,.04)}.feature-card>span{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:12px;background:var(--gold-soft);color:#785a00;font-weight:900}.feature-card h3{margin:16px 0 8px;color:var(--navy-900)}.feature-card p{margin:0;color:var(--muted)}
.plan-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px;max-width:900px}.plan-card{border:1px solid var(--line);background:white;border-radius:26px;padding:28px;box-shadow:var(--shadow)}.plan-card.featured{border:2px solid rgba(213,166,46,.55)}.plan-kicker{font-size:12px;font-weight:900;color:#8a6700;letter-spacing:.14em}.plan-card h3{font-size:26px;margin:8px 0;color:var(--navy-900)}.plan-price{font-size:42px;font-weight:900;color:var(--navy-900)}.plan-card ul{padding-left:20px;color:#475569;min-height:120px}.plan-live-text{padding:18px;border-radius:14px;background:var(--soft);color:#475569;margin:16px 0 28px;min-height:120px}
.auth-wrap{display:grid;grid-template-columns:.85fr 1.15fr;gap:44px;align-items:start}.security-note{margin-top:24px;padding:18px;border-left:4px solid var(--gold);background:var(--gold-soft);border-radius:0 14px 14px 0}.security-note p{margin:5px 0 0;color:#5f4b12}.auth-card{border:1px solid var(--line);border-radius:26px;background:white;padding:26px;box-shadow:var(--shadow)}.tabs{display:grid;grid-template-columns:1fr 1fr;background:var(--soft);padding:5px;border-radius:14px;margin-bottom:22px}.tab{border:0;background:transparent;border-radius:10px;padding:10px;font-weight:850;cursor:pointer;color:#64748b}.tab.active{background:white;color:var(--navy-900);box-shadow:0 4px 14px rgba(15,23,42,.08)}
.auth-form{display:grid;gap:16px}.auth-form label{display:grid;gap:7px;font-size:13px;font-weight:800;color:#334155}.auth-form input,.auth-form select{width:100%;border:1px solid #cbd5e1;border-radius:11px;padding:12px 13px;outline:none;background:white}.auth-form input:focus,.auth-form select:focus{border-color:#7c9cc8;box-shadow:0 0 0 4px rgba(11,43,88,.08)}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.span-2{grid-column:span 2}.form-help{font-size:12px;color:var(--muted);margin:0}.message{padding:13px 14px;border-radius:12px;margin:0 0 18px;font-size:13px;font-weight:750;background:#eef6ff;color:#1e3a5f;border:1px solid #cfe3f7}.message.error{background:#fff1f0;color:#7a271a;border-color:#fecdca}.message.success{background:#ecfdf3;color:#05603a;border-color:#abefc6}
.auth-text-button{border:0;background:transparent;color:var(--navy-700);font:inherit;font-size:13px;font-weight:850;padding:2px 0;justify-self:start;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.auth-text-button:hover{color:var(--navy-900)}.auth-panel-heading{display:grid;gap:5px;padding:14px 15px;background:var(--soft);border:1px solid var(--line);border-radius:14px}.auth-panel-heading strong{font-size:16px;color:var(--navy-900)}.auth-panel-heading span{font-size:12px;line-height:1.55;color:var(--muted)}
.dashboard-wrap{min-height:620px}.dashboard-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:28px}.dashboard-header h2{margin-bottom:6px}.dashboard-header p{margin:0;color:var(--muted)}.dashboard-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}.dash-card{border:1px solid var(--line);border-radius:18px;padding:21px;background:white}.dash-card.highlight{background:var(--navy-900);color:white;border-color:var(--navy-900)}.dash-card span,.dash-card strong,.dash-card small{display:block}.dash-card span{font-size:12px;font-weight:850;color:#64748b}.dash-card.highlight span,.dash-card.highlight small{color:#c9d7ea}.dash-card strong{font-size:24px;margin:8px 0}.dash-card small{color:var(--muted)}.account-panel{margin-top:22px;border:1px solid var(--line);border-radius:20px;padding:24px}.account-panel h3{margin-top:0;color:var(--navy-900)}.account-panel dl{display:grid;grid-template-columns:1fr 1fr;gap:0 28px}.account-panel dl div{padding:12px 0;border-bottom:1px solid #edf1f7;display:grid;grid-template-columns:120px 1fr;gap:12px}.account-panel dt{color:var(--muted);font-size:13px}.account-panel dd{margin:0;font-weight:750;overflow-wrap:anywhere}
.site-footer{background:var(--navy-950);color:#dbe7f7;padding:44px 0 20px}.footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:30px}.footer-grid div{display:grid;gap:8px;align-content:start}.footer-grid strong{color:white}.footer-grid p{margin:0;color:#aebed2}.footer-grid a{font-size:13px;color:#c4d2e3}.footer-bottom{border-top:1px solid rgba(255,255,255,.1);margin-top:30px;padding-top:18px;font-size:12px;color:#9db0c8}
@media (max-width:900px){.top-nav{display:none}.hero-grid,.auth-wrap{grid-template-columns:1fr}.feature-grid{grid-template-columns:1fr 1fr}.dashboard-grid{grid-template-columns:1fr 1fr}.hero{padding:70px 0}.hero-card{max-width:620px}}
@media (max-width:620px){.container{width:min(100% - 22px,1160px)}.hero{padding:54px 0}.hero h1{font-size:42px}.feature-grid,.plan-grid,.dashboard-grid,.form-grid,.footer-grid{grid-template-columns:1fr}.span-2{grid-column:auto}.section{padding:58px 0}.auth-card{padding:18px}.dashboard-header{display:grid}.account-panel dl{grid-template-columns:1fr}.account-panel dl div{grid-template-columns:95px 1fr}.metric-grid{grid-template-columns:1fr 1fr}}

/* Phase 2 — live plan catalogue */
.plan-status-line{margin:-8px 0 22px;padding:12px 14px;border:1px solid var(--line);border-radius:13px;background:white;color:#475569;font-size:13px;font-weight:750}
.plan-grid-four{grid-template-columns:repeat(4,minmax(0,1fr));max-width:none;align-items:stretch}
.plan-grid-four .plan-card{display:flex;flex-direction:column;min-width:0;padding:24px}
.plan-topline{display:flex;justify-content:space-between;align-items:center;gap:10px}
.plan-status{font-size:10px;font-weight:900;letter-spacing:.05em;text-transform:uppercase;padding:6px 8px;border-radius:999px;white-space:nowrap}
.plan-status.active{background:#dcfce7;color:#166534}
.plan-status.coming{background:#eef2f7;color:#475569}
.plan-price-note{min-height:22px;font-size:12px;color:var(--muted);text-transform:capitalize}
.plan-validity{margin-top:12px;padding:9px 11px;border-radius:11px;background:var(--soft);font-size:12px;font-weight:850;color:#334155}
.plan-benefits{min-height:0!important;flex:1;margin:16px 0 20px;padding-left:19px;font-size:13px}
.plan-benefits li{margin:7px 0}
.btn-disabled{background:#e2e8f0;color:#64748b;cursor:not-allowed;box-shadow:none}
.btn-disabled:hover{transform:none}
.plan-empty{grid-column:1/-1;padding:24px;border:1px dashed #cbd5e1;border-radius:18px;background:white;color:var(--muted)}
@media (max-width:1100px){.plan-grid-four{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:620px){.plan-grid-four{grid-template-columns:1fr}}

.field-help {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted, #667085);
}


/* Phase 2.7 — authenticated live Study Campus catalogue */
.feature-card-action{display:flex;flex-direction:column;align-items:flex-start}
.feature-card-action .feature-cta{margin-top:18px}
.study-heading code{font-size:.88em;background:white;border:1px solid var(--line);border-radius:8px;padding:2px 6px}
.study-catalogue{display:grid;gap:18px}
.study-empty{padding:24px;border:1px dashed #cbd5e1;border-radius:18px;background:white;color:var(--muted)}
.study-unit{border:1px solid var(--line);border-radius:22px;background:white;box-shadow:0 10px 28px rgba(15,23,42,.04);overflow:hidden}
.study-unit>summary{list-style:none;cursor:pointer;padding:22px 24px;display:flex;align-items:center;justify-content:space-between;gap:18px}
.study-unit>summary::-webkit-details-marker{display:none}
.study-unit>summary h3{margin:0;color:var(--navy-900);font-size:21px}
.study-unit-meta{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.study-pill{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;background:var(--soft);color:#475569;font-size:11px;font-weight:800}
.study-chapters{border-top:1px solid var(--line);padding:8px 24px 24px;display:grid;gap:14px}
.study-chapter{border:1px solid #edf1f7;border-radius:16px;padding:17px;background:#fff}
.study-chapter h4{margin:0 0 5px;color:var(--navy-900);font-size:16px}
.study-code{font-size:11px;color:var(--muted);font-weight:800;letter-spacing:.04em}
.study-assets{display:grid;gap:9px;margin-top:13px}
.study-asset{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px;padding:12px 13px;border-radius:12px;background:var(--soft)}
.study-asset-main{min-width:0}
.study-asset-name{display:block;color:var(--navy-900);font-weight:800;overflow-wrap:anywhere}
.study-asset-meta{display:flex;gap:7px;flex-wrap:wrap;margin-top:5px}
.study-asset-badge{font-size:10px;font-weight:850;color:#475569;text-transform:uppercase;letter-spacing:.04em}
.reader-next{font-size:11px;color:var(--muted);white-space:nowrap}
.dash-link{display:inline-block;margin-top:10px;font-size:12px;font-weight:850;color:var(--navy-900);text-decoration:underline;text-underline-offset:3px}
@media (max-width:620px){.study-unit>summary{align-items:flex-start;flex-direction:column}.study-unit-meta{justify-content:flex-start}.study-chapters{padding:8px 14px 18px}.study-asset{grid-template-columns:1fr}.reader-next{white-space:normal}}


/* Phase 2.8 — secure in-app reader */
.reader-open{white-space:nowrap}
.reader-section{background:#eef3f9}
.reader-shell{border:1px solid var(--line);border-radius:24px;background:white;box-shadow:var(--shadow);padding:24px}
.reader-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:20px}
.reader-header h2{margin:7px 0 7px;color:var(--navy-900);font-size:clamp(26px,3vw,38px);line-height:1.12}
.reader-header p{margin:0;color:var(--muted);max-width:760px}
.reader-status-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:18px 0}
.reader-status-grid>div{padding:15px 17px;border:1px solid var(--line);border-radius:14px;background:var(--soft)}
.reader-status-grid span,.reader-status-grid strong{display:block}
.reader-status-grid span{font-size:11px;color:var(--muted);font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.reader-status-grid strong{margin-top:5px;color:var(--navy-900);font-size:17px;overflow-wrap:anywhere}
.reader-toolbar{position:sticky;top:74px;z-index:3;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;padding:12px;margin:18px 0;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.96);backdrop-filter:blur(8px)}
.reader-page-count{text-align:center;color:#475569;font-size:13px}
.reader-canvas-wrap{min-height:420px;border:1px solid #dfe7f1;border-radius:16px;background:#e8edf3;padding:15px;display:flex;justify-content:center;align-items:flex-start;overflow:auto}
.reader-canvas{display:block;background:white;box-shadow:0 8px 24px rgba(15,23,42,.16);max-width:none}
.reader-unsupported{margin:auto;max-width:620px;padding:24px;border:1px dashed #cbd5e1;border-radius:14px;background:white;color:var(--muted);text-align:center}
.reader-security-note{margin:16px 0 0;color:var(--muted);font-size:12px;line-height:1.5}
@media (max-width:720px){.reader-shell{padding:16px}.reader-header{display:grid}.reader-status-grid{grid-template-columns:1fr}.reader-toolbar{top:66px;grid-template-columns:1fr 1fr}.reader-page-count{grid-column:1/-1;grid-row:1}.reader-canvas-wrap{padding:8px;min-height:320px}}

.reader-native-pdf{display:block;width:100%;height:76vh;min-height:620px;border:0;border-radius:10px;background:white;box-shadow:0 8px 24px rgba(15,23,42,.14)}
.reader-native-pdf.hidden{display:none}
@media (max-width:720px){.reader-native-pdf{height:70vh;min-height:480px}}


/* Phase 3.0 — mobile-first full-page study reader */
.reader-header-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.reader-view-controls{position:sticky;top:72px;z-index:4;display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0 12px;padding:8px 10px;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.97);backdrop-filter:blur(8px)}
.reader-view-button{appearance:none;border:1px solid #cbd5e1;background:white;color:var(--navy-900);border-radius:10px;padding:8px 12px;font:inherit;font-size:12px;font-weight:850;cursor:pointer}
.reader-view-button.active{background:var(--navy-900);border-color:var(--navy-900);color:white}
.reader-view-hint{font-size:11px;color:var(--muted);margin-left:auto}
.reader-canvas-wrap{overscroll-behavior:contain}
.reader-native-pdf{height:78vh;min-height:560px}

body.reader-focus-open{overflow:hidden}
.reader-section.reader-focus{position:fixed;inset:0;z-index:9999;padding:0;background:#edf2f8;overflow:auto}
.reader-section.reader-focus .container{max-width:none;width:100%;padding:0}
.reader-section.reader-focus .reader-shell{min-height:100vh;border:0;border-radius:0;box-shadow:none;padding:10px 12px}
.reader-section.reader-focus .reader-header{align-items:center;margin:0 0 6px;gap:12px}
.reader-section.reader-focus .reader-header .eyebrow,
.reader-section.reader-focus #readerSubTitle,
.reader-section.reader-focus .reader-security-note{display:none}
.reader-section.reader-focus .reader-header h2{font-size:16px;line-height:1.2;margin:0;max-width:72vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reader-section.reader-focus #readerMessage{margin:6px 0;padding:8px 10px;font-size:11px}
.reader-section.reader-focus .reader-status-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:6px 0}
.reader-section.reader-focus .reader-status-grid>div{padding:7px 9px;border-radius:10px}
.reader-section.reader-focus .reader-status-grid span{font-size:9px}
.reader-section.reader-focus .reader-status-grid strong{font-size:12px;margin-top:2px}
.reader-section.reader-focus .reader-view-controls{top:0;margin:5px 0 7px;padding:6px 8px}
.reader-section.reader-focus .reader-toolbar{top:45px;margin:6px 0;padding:7px}
.reader-section.reader-focus .reader-canvas-wrap{min-height:calc(100vh - 165px);padding:6px;border-radius:10px}
.reader-section.reader-focus .reader-native-pdf{height:calc(100vh - 165px);min-height:0;border-radius:8px}

@media (max-width:720px){
  .reader-shell{padding:10px}
  .reader-header{gap:10px;margin-bottom:10px}
  .reader-header h2{font-size:22px}
  .reader-header-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}
  .reader-header-actions .btn{width:100%;padding:10px 8px}
  .reader-status-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:10px 0}
  .reader-status-grid>div{padding:8px 7px}
  .reader-status-grid span{font-size:8.5px}
  .reader-status-grid strong{font-size:11px;margin-top:3px}
  .reader-view-controls{top:64px;margin:7px 0;padding:6px;gap:6px}
  .reader-view-button{flex:1;padding:8px 7px;font-size:11px}
  .reader-view-hint{display:none}
  .reader-toolbar{top:108px;margin:7px 0;padding:7px;gap:7px}
  .reader-toolbar .btn{padding:9px 8px;font-size:11px}
  .reader-page-count{font-size:11px}
  .reader-canvas-wrap{padding:4px;min-height:58vh;border-radius:10px}
  .reader-native-pdf{height:68vh;min-height:420px;border-radius:8px}
  .reader-security-note{font-size:10px;margin-top:8px}
  .reader-section.reader-focus .reader-header-actions{width:auto;display:flex;flex-wrap:nowrap}
  .reader-section.reader-focus .reader-header-actions .btn{width:auto;padding:7px 9px;font-size:10px}
  .reader-section.reader-focus .reader-header h2{font-size:14px;max-width:48vw}
  .reader-section.reader-focus .reader-status-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .reader-section.reader-focus .reader-canvas-wrap{min-height:calc(100vh - 155px)}
  .reader-section.reader-focus .reader-native-pdf{height:calc(100vh - 155px)}
}


/* Phase 3.1 — true full-page local fallback refinement */
.reader-native-pdf{
  background:#dfe5ec;
}
@media (min-width:721px){
  .reader-native-pdf{height:80vh;min-height:600px}
}
@media (max-width:720px){
  .reader-native-pdf{height:72vh;min-height:460px}
}


/* Phase 3.2 — controlled PDF.js view modes + visible zoom percentage */
.reader-zoom-controls{display:inline-flex;align-items:center;border:1px solid #cbd5e1;border-radius:10px;background:#fff;overflow:hidden}
.reader-zoom-button{appearance:none;border:0;background:#fff;color:var(--navy-900);width:34px;height:34px;font:inherit;font-size:19px;font-weight:900;line-height:1;cursor:pointer}
.reader-zoom-button:hover{background:#f1f5f9}
.reader-zoom-button:disabled{opacity:.35;cursor:not-allowed}
.reader-zoom-percent{min-width:58px;padding:0 8px;text-align:center;font-size:12px;font-weight:900;color:var(--navy-900);font-variant-numeric:tabular-nums;border-left:1px solid #e2e8f0;border-right:1px solid #e2e8f0}
.reader-canvas-wrap{scrollbar-gutter:stable both-edges}
.reader-canvas{margin:0 auto}
@media (max-width:720px){
  .reader-view-controls{display:grid;grid-template-columns:1fr 1fr auto}
  .reader-zoom-controls{grid-column:1/-1;justify-self:center}
  .reader-view-hint{display:none}
}

/* Phase 3.3 — persistent in-reader scroll viewport */
.reader-canvas-wrap{
  height:72vh;
  min-height:440px;
  max-height:760px;
  overflow-x:scroll;
  overflow-y:scroll;
  scrollbar-gutter:stable both-edges;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.reader-canvas-wrap::-webkit-scrollbar{width:12px;height:12px}
.reader-canvas-wrap::-webkit-scrollbar-track{background:#dbe3ec;border-radius:10px}
.reader-canvas-wrap::-webkit-scrollbar-thumb{background:#8796aa;border:3px solid #dbe3ec;border-radius:10px}
.reader-canvas-wrap::-webkit-scrollbar-thumb:hover{background:#65758b}
.reader-canvas-wrap{scrollbar-width:auto;scrollbar-color:#8796aa #dbe3ec}
.reader-section.reader-focus .reader-canvas-wrap{
  height:calc(100vh - 165px);
  max-height:none;
  min-height:0;
}
@media (max-width:720px){
  .reader-canvas-wrap{
    height:66vh;
    min-height:360px;
    max-height:none;
    overflow:auto;
  }
  .reader-section.reader-focus .reader-canvas-wrap{
    height:calc(100vh - 155px);
    min-height:0;
  }
}
\n\n/* Phase 3.4 — persistent visible zoom percentage + reader scrollbar */\n.reader-view-controls{\n  position:sticky;\n  top:72px;\n  z-index:20;\n  overflow:visible;\n}\n.reader-zoom-controls{\n  display:inline-flex !important;\n  visibility:visible !important;\n  opacity:1 !important;\n  flex:0 0 auto;\n  box-shadow:0 1px 2px rgba(15,23,42,.08);\n}\n.reader-zoom-percent{\n  display:inline-flex !important;\n  align-items:center;\n  justify-content:center;\n  min-width:92px;\n  height:34px;\n  padding:0 10px;\n  white-space:nowrap;\n  background:#f8fafc;\n  color:#071a33;\n  font-size:12px;\n  font-weight:900;\n}\n.reader-canvas-wrap{\n  overflow:auto;\n  scrollbar-gutter:stable both-edges;\n  overscroll-behavior:contain;\n  -webkit-overflow-scrolling:touch;\n}\n.reader-canvas-wrap::-webkit-scrollbar{width:12px;height:12px}\n.reader-canvas-wrap::-webkit-scrollbar-track{background:#dbe3ec;border-radius:10px}\n.reader-canvas-wrap::-webkit-scrollbar-thumb{background:#8796aa;border:3px solid #dbe3ec;border-radius:10px}\n.reader-canvas-wrap::-webkit-scrollbar-thumb:hover{background:#65758b}\n@media (max-width:720px){\n  .reader-view-controls{top:64px}\n  .reader-zoom-controls{grid-column:1/-1;justify-self:center}\n  .reader-zoom-percent{min-width:90px}\n}\n

/* Phase 3.7 — live online-test dashboard and scopes */
.test-heading{margin-bottom:18px}
.test-level-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:18px}
.test-level-card,.test-scope-card{border:1px solid var(--line);border-radius:18px;background:#fff;padding:18px;box-shadow:0 6px 20px rgba(15,23,42,.05)}
.test-level-card.ready,.test-scope-card.ready{border-color:#b7e4c7}
.test-level-card.blocked,.test-scope-card.blocked{background:#fbfcfe}
.test-level-topline,.test-scope-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.test-level-name{font-size:18px;font-weight:900;color:var(--navy-900)}
.test-level-state{display:inline-flex;align-items:center;white-space:nowrap;border-radius:999px;padding:5px 9px;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.03em}
.test-level-state.ready{background:#dcfce7;color:#166534}
.test-level-state.limited{background:#fef3c7;color:#92400e}
.test-level-state.blocked{background:#f1f5f9;color:#64748b}
.test-level-questions{display:flex;align-items:baseline;gap:7px;margin:18px 0 14px}
.test-level-questions strong{font-size:34px;line-height:1;color:var(--navy-900)}
.test-level-questions span{font-size:12px;color:var(--muted);font-weight:700}
.test-level-stats,.test-scope-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0 0 14px}
.test-level-stats div,.test-scope-stats div{padding:10px;border-radius:12px;background:var(--soft);min-width:0}
.test-level-stats dt,.test-scope-stats dt{font-size:9px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:850}
.test-level-stats dd,.test-scope-stats dd{margin:4px 0 0;color:var(--navy-900);font-size:13px;font-weight:900;overflow-wrap:anywhere}
.test-blocked-reason,.test-progress-note{margin:10px 0;font-size:11px;line-height:1.45;color:#64748b}
.test-progress-note{color:#1d4ed8;font-weight:750}
.test-scopes-panel{margin-top:26px;padding:20px;border:1px solid var(--line);border-radius:20px;background:#fff}
.test-scopes-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.test-scopes-header h3{margin:5px 0 0;color:var(--navy-900);font-size:24px}
.test-scopes-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:14px}
.test-scope-heading h4{margin:5px 0 0;color:var(--navy-900);font-size:16px;line-height:1.3}
.test-scope-code{font-size:10px;color:var(--muted);font-weight:850;text-transform:uppercase;letter-spacing:.04em}
.test-bank-meter{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0;padding:10px 12px;border-radius:12px;background:#f8fafc;font-size:11px;color:var(--muted)}
.test-bank-meter strong{color:var(--navy-900);font-size:12px;text-align:right}
.test-empty{grid-column:1/-1;padding:24px;border:1px dashed #cbd5e1;border-radius:16px;text-align:center;color:var(--muted);background:#fff}
@media (max-width:900px){.test-level-grid{grid-template-columns:1fr}.test-scopes-grid{grid-template-columns:1fr}}
@media (max-width:560px){.test-level-card,.test-scope-card{padding:14px}.test-level-stats,.test-scope-stats{grid-template-columns:1fr 1fr}.test-level-stats div:last-child,.test-scope-stats div:last-child{grid-column:1/-1}.test-scopes-panel{padding:14px}.test-scopes-header{align-items:center}.test-level-name{font-size:16px}.test-level-questions strong{font-size:30px}}


/* Phase 3.8 — live online-test runner */
.test-runner-panel{margin-top:26px;padding:20px;border:1px solid var(--line);border-radius:20px;background:#fff;box-shadow:0 12px 32px rgba(15,23,42,.06)}
.test-runner-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.test-runner-header h3{margin:5px 0 0;color:var(--navy-900);font-size:24px}
.test-runner-meta{margin:5px 0 0;color:var(--muted);font-size:12px;font-weight:750}
.test-runner-progress-row{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}
.test-runner-progress-row>div{min-width:108px;padding:10px 12px;border-radius:12px;background:var(--soft)}
.test-runner-progress-row strong,.test-runner-progress-row span{display:block}
.test-runner-progress-row strong{color:var(--navy-900);font-size:15px}
.test-runner-progress-row span{margin-top:2px;color:var(--muted);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.03em}
.test-question-palette{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0 18px;padding:12px;border:1px solid var(--line);border-radius:14px;background:#f8fafc}
.test-question-jump{width:34px;height:34px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#475569;font-weight:850;cursor:pointer}
.test-question-jump.answered{background:#dcfce7;border-color:#86efac;color:#166534}
.test-question-jump.current{outline:3px solid rgba(213,166,46,.28);border-color:var(--gold);color:var(--navy-900)}
.test-question-card{border:1px solid var(--line);border-radius:18px;padding:20px;background:#fff}
.test-question-number{font-size:11px;font-weight:900;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.test-question-copy{margin:12px 0 18px;color:var(--navy-900)}
.test-question-text{display:block;font-size:18px;font-weight:800;line-height:1.55}
.test-text-ta{margin-top:7px}
.test-options{display:grid;gap:10px}
.test-option{width:100%;display:grid;grid-template-columns:42px 1fr;align-items:flex-start;gap:12px;text-align:left;border:1px solid #dbe3ef;border-radius:14px;background:#fff;padding:13px 14px;color:var(--ink);cursor:pointer;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}
.test-option:hover{border-color:#94a3b8;background:#fbfdff}
.test-option.selected{border-color:var(--gold);background:var(--gold-soft);box-shadow:0 0 0 2px rgba(213,166,46,.12)}
.test-option:disabled{cursor:wait;opacity:.75}
.test-option-letter{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:var(--navy-900);color:#fff;font-weight:900}
.test-option.selected .test-option-letter{background:var(--gold);color:var(--navy-950)}
.test-option-copy{min-width:0}
.test-option-text{display:block;font-size:14px;line-height:1.5}
.test-runner-actions{display:flex;align-items:center;gap:10px;margin-top:16px}
.test-runner-actions .test-submit-button{margin-left:auto}
.test-runner-actions button:disabled{opacity:.55;cursor:not-allowed;transform:none}
.test-result-card{border:1px solid #b7e4c7;border-radius:18px;padding:22px;background:#fbfffc}
.test-result-card h3{margin:6px 0 18px;color:var(--navy-900)}
.test-result-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:18px}
.test-result-grid>div{padding:13px;border-radius:12px;background:#fff;border:1px solid var(--line);min-width:0}
.test-result-grid span,.test-result-grid strong{display:block}
.test-result-grid span{font-size:10px;color:var(--muted);font-weight:850;text-transform:uppercase;letter-spacing:.03em}
.test-result-grid strong{margin-top:4px;color:var(--navy-900);font-size:16px;overflow-wrap:anywhere}
@media (max-width:760px){.test-runner-panel{padding:14px}.test-runner-header{display:grid}.test-question-card{padding:15px}.test-question-text{font-size:16px}.test-result-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.test-runner-actions{display:grid;grid-template-columns:1fr 1fr}.test-runner-actions .test-submit-button{grid-column:1/-1;margin-left:0}.test-option{grid-template-columns:38px 1fr;padding:11px}.test-option-letter{width:32px;height:32px}}


/* Password visibility toggle */
.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 3.25rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  border-radius: 0.45rem;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(15, 38, 71, 0.08);
  outline: none;
}



/* P1 membership request */
.purchase-panel {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid rgba(15, 38, 71, 0.14);
  border-radius: 1.25rem;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 38, 71, 0.08);
}

.purchase-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.purchase-panel-head h3 {
  margin: 0.35rem 0 0;
}

.purchase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.purchase-instructions {
  padding: 1.1rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1px solid rgba(15, 38, 71, 0.08);
}

.purchase-instructions h4 {
  margin-top: 0;
}

.purchase-payment-box {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.75rem 0;
  padding: 0.85rem 0.95rem;
  border-radius: 0.8rem;
  background: #fff7df;
  border: 1px solid rgba(218, 165, 32, 0.35);
}

.purchase-payment-box span {
  color: var(--muted);
}

.purchase-payment-box strong {
  color: var(--navy-900);
  text-align: right;
}

.optional-label {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85em;
}

@media (max-width: 820px) {
  .purchase-grid {
    grid-template-columns: 1fr;
  }
  .purchase-panel-head {
    flex-direction: column;
  }
}



/* Official Velixra payment QR */
.purchase-qr-card {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  margin: 0.9rem 0 1rem;
  padding: 1rem;
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid rgba(15, 38, 71, 0.12);
  text-align: center;
}

.purchase-option-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--navy-900);
}

.purchase-qr-image {
  display: block;
  width: min(240px, 100%);
  height: auto;
  padding: 0.45rem;
  background: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 38, 71, 0.08);
  image-rendering: pixelated;
}



/* Secure admin payment verification queue */
.admin-queue-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(15, 38, 71, 0.10);
  border-radius: 1rem;
  background: #ffffff;
}

.admin-queue-toolbar label {
  min-width: 180px;
  flex: 1 1 180px;
}

.admin-queue-toolbar select {
  width: 100%;
  margin-top: 0.4rem;
}

.admin-purchase-grid {
  display: grid;
  gap: 1rem;
}

.admin-purchase-card {
  padding: 1.2rem;
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid rgba(15, 38, 71, 0.12);
  box-shadow: 0 12px 28px rgba(15, 38, 71, 0.06);
}

.admin-purchase-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.admin-purchase-head h3 {
  margin: 0.35rem 0 0;
}

.admin-purchase-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.admin-purchase-meta > div {
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.admin-purchase-meta dt {
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.admin-purchase-meta dd {
  margin: 0;
  font-weight: 700;
  word-break: break-word;
}

.admin-utr {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.admin-review-note {
  padding: 0.8rem;
  margin: 0.75rem 0;
  border-radius: 0.75rem;
  background: #fff7df;
}

.admin-purchase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 820px) {
  .admin-purchase-meta {
    grid-template-columns: 1fr;
  }
  .admin-purchase-head {
    flex-direction: column;
  }
}



/* Super Admin MFA setup — isolated from learner flows */
.admin-mfa-panel {
  margin: 1rem 0 1.25rem;
  padding: 1.1rem;
  border: 1px solid rgba(15, 38, 71, 0.12);
  border-radius: 1rem;
  background: #ffffff;
}

.admin-mfa-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.admin-mfa-head h3 {
  margin: 0.3rem 0 0.25rem;
}

.admin-mfa-head p {
  margin: 0;
  color: var(--muted);
}

.admin-mfa-setup,
.admin-mfa-session {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 38, 71, 0.10);
}

.admin-mfa-qr-card {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.admin-mfa-qr {
  display: block;
  width: 100%;
  max-width: 220px;
  background: #fff;
  border: 1px solid rgba(15, 38, 71, 0.10);
  border-radius: 0.8rem;
  padding: 0.5rem;
}

.admin-mfa-qr-card code {
  display: block;
  margin: 0.5rem 0;
  padding: 0.6rem;
  border-radius: 0.6rem;
  background: #f8fafc;
  overflow-wrap: anywhere;
}

.admin-mfa-setup label {
  display: grid;
  gap: 0.4rem;
  max-width: 320px;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.admin-mfa-session-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.admin-mfa-session-row input {
  max-width: 220px;
}

@media (max-width: 700px) {
  .admin-mfa-head,
  .admin-mfa-qr-card {
    display: grid;
    grid-template-columns: 1fr;
  }
}


/* Phase 3.8 — Aspirant Reader Mode + complex-script font-safe rendering */
.reader-section{background:linear-gradient(180deg,#eef3f8 0%,#e6edf5 100%)}
.reader-shell{overflow:visible}
.reader-header h2{font-size:clamp(22px,2.25vw,31px)}
.reader-view-controls{justify-content:center}
.reader-view-hint{max-width:540px}

.reader-stage{
  display:grid;
  grid-template-columns:minmax(54px,78px) minmax(0,1fr) minmax(54px,78px);
  align-items:center;
  gap:12px;
  margin:10px 0 0;
}
.reader-stage.hidden{display:none}
.reader-page-column{min-width:0;display:flex;flex-direction:column;align-items:center;gap:8px}
.reader-canvas-wrap{
  width:100%;
  height:72vh;
  min-height:440px;
  max-height:780px;
  padding:14px;
  border:1px solid #d6dee9;
  border-radius:20px;
  background:
    radial-gradient(circle at 50% 0%,rgba(255,255,255,.96),rgba(232,238,245,.92) 58%,rgba(219,228,238,.96));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 14px 34px rgba(15,23,42,.08);
  overflow:auto;
  scrollbar-gutter:stable both-edges;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.reader-canvas{
  display:block;
  margin:0 auto;
  background:#fff;
  border:1px solid rgba(15,23,42,.09);
  border-radius:2px;
  box-shadow:
    0 3px 0 rgba(255,255,255,.95),
    0 7px 0 -2px rgba(203,213,225,.9),
    0 22px 42px rgba(15,23,42,.24);
  max-width:none;
}
.reader-page-footer{width:min(100%,760px);display:flex;align-items:center;justify-content:center;gap:14px;min-height:30px;color:#475569}
.reader-page-count{font-size:13px;font-weight:750;font-variant-numeric:tabular-nums}
.reader-page-tip{font-size:11px;color:#64748b}

.reader-edge-nav{
  appearance:none;
  width:68px;
  min-height:112px;
  border:1px solid rgba(15,23,42,.13);
  border-radius:18px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  cursor:pointer;
  box-shadow:0 13px 26px rgba(15,23,42,.14);
  transition:transform .16s ease,box-shadow .16s ease,opacity .16s ease;
}
.reader-edge-nav:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 17px 30px rgba(15,23,42,.18)}
.reader-edge-nav:disabled{opacity:.28;cursor:not-allowed;box-shadow:none}
.reader-edge-nav-prev{background:#fff;color:var(--navy-900)}
.reader-edge-nav-next{background:var(--navy-900);color:#fff;border-color:var(--navy-900)}
.reader-edge-icon{font-size:44px;line-height:.9;font-weight:500}
.reader-edge-label{font-size:10px;font-weight:900;letter-spacing:.035em;text-transform:uppercase}

.reader-section.reader-focus{background:linear-gradient(180deg,#dfe7f0 0%,#edf2f7 55%,#dce5ef 100%)}
.reader-section.reader-focus .reader-shell{padding:8px 12px;background:transparent}
.reader-section.reader-focus .reader-status-grid{display:none}
.reader-section.reader-focus #readerMessage.success{display:none}
.reader-section.reader-focus .reader-header{min-height:42px;margin:0 0 4px;padding:0 4px}
.reader-section.reader-focus .reader-header h2{font-size:14px;max-width:64vw}
.reader-section.reader-focus .reader-header-actions .btn{padding:7px 10px;font-size:10px}
.reader-section.reader-focus .reader-view-controls{
  position:sticky;
  top:0;
  z-index:30;
  width:max-content;
  max-width:calc(100vw - 24px);
  margin:3px auto 7px;
  padding:5px 7px;
  border-radius:999px;
  box-shadow:0 7px 20px rgba(15,23,42,.10);
}
.reader-section.reader-focus .reader-view-hint{display:none}
.reader-section.reader-focus .reader-stage{
  grid-template-columns:64px minmax(0,1fr) 64px;
  gap:10px;
  margin:0;
}
.reader-section.reader-focus .reader-canvas-wrap{
  height:calc(100vh - 128px);
  min-height:0;
  max-height:none;
  padding:9px;
  border-radius:18px;
}
.reader-section.reader-focus .reader-native-pdf{height:calc(100vh - 150px);min-height:0}
.reader-section.reader-focus .reader-page-footer{min-height:25px}
.reader-section.reader-focus .reader-security-note{display:none}

@media (max-width:720px){
  .reader-shell{padding:10px 8px}
  .reader-header h2{font-size:19px}
  .reader-view-controls{grid-template-columns:1fr 1fr;gap:5px}
  .reader-view-button{font-size:10px;padding:7px 6px}
  .reader-zoom-controls{grid-column:1/-1}
  .reader-stage{grid-template-columns:42px minmax(0,1fr) 42px;gap:4px}
  .reader-edge-nav{width:40px;min-height:76px;border-radius:14px;box-shadow:0 8px 18px rgba(15,23,42,.14)}
  .reader-edge-icon{font-size:34px}
  .reader-edge-label{display:none}
  .reader-canvas-wrap{height:67vh;min-height:360px;padding:5px;border-radius:14px}
  .reader-page-tip{display:none}
  .reader-page-footer{min-height:24px}
  .reader-section.reader-focus .reader-header{min-height:36px}
  .reader-section.reader-focus .reader-header h2{font-size:12px;max-width:46vw}
  .reader-section.reader-focus .reader-stage{grid-template-columns:40px minmax(0,1fr) 40px;gap:3px}
  .reader-section.reader-focus .reader-canvas-wrap{height:calc(100vh - 119px);padding:4px;border-radius:12px}
  .reader-section.reader-focus .reader-view-controls{max-width:calc(100vw - 12px);padding:4px 6px}
  .reader-section.reader-focus .reader-page-footer{min-height:20px}
}
