:root {
  --ink: #17364a;
  --muted: #5b6f7c;
  --blue: #246488;
  --blue-dark: #194b69;
  --blue-soft: #e8f3f8;
  --teal: #167b78;
  --green: #137c4c;
  --white: #ffffff;
  --surface: #f5f8fa;
  --border: #d9e2e7;
  --control-border: #8094a0;
  --line: var(--border);
  --primary: var(--blue);
  --primary-dark: var(--blue-dark);
  --surface-soft: var(--surface);
  --warning: #fff6da;
  --warning-border: #d9aa2b;
  --danger: #a72c34;
  --shadow: 0 12px 34px rgba(22, 58, 78, 0.10);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }
body { margin: 0; min-width: 320px; max-width: 100%; overflow-x: hidden; background: var(--surface); }
button, input, select, textarea { font: inherit; }
input, select, textarea { font-size: 16px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--blue-dark); }
img { max-width: 100%; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 1000; padding: .8rem 1rem; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.app-shell { min-height: 100vh; }
.desktop-sidebar { display: none; }
.app-column { min-height: 100vh; padding-bottom: 5rem; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; min-height: 64px; padding: .55rem 1rem; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
.topbar-title { display: flex; flex: 1; flex-direction: column; line-height: 1.1; }
.topbar-title strong { font-size: 1.06rem; }
.topbar-title small { margin-top: .2rem; color: var(--muted); font-size: .72rem; }
.brand-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: white; background: linear-gradient(145deg, var(--blue), var(--teal)); font-weight: 800; box-shadow: 0 6px 16px rgba(36,100,136,.25); }
.brand-mark.small { width: 40px; height: 40px; border-radius: 12px; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; color: var(--ink); background: transparent; font-size: 1.4rem; }
.icon-button:hover, .icon-button:focus-visible { background: var(--blue-soft); }
main { width: min(100%, 1180px); margin: 0 auto; padding: 1rem; }
.hero { padding: 2rem 1.15rem; border-radius: 24px; color: white; background: radial-gradient(circle at 85% 10%, rgba(255,255,255,.18), transparent 32%), linear-gradient(145deg, #1c5677, #126e70); box-shadow: var(--shadow); }
.hero h1, .page-header h1, .detail-card h1, .article-card h1 { margin: .35rem 0 .75rem; line-height: 1.08; letter-spacing: -.025em; }
.hero h1 { max-width: 720px; font-size: clamp(2rem, 8vw, 4rem); }
.hero p { max-width: 680px; font-size: 1.05rem; line-height: 1.65; opacity: .94; }
.eyebrow { display: block; color: var(--teal); font-size: .73rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero .eyebrow { color: #c5fff2; }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.15rem; }
.safety-chip { display: inline-flex; margin-top: 1.25rem; padding: .65rem .8rem; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(0,0,0,.12); font-size: .78rem; font-weight: 700; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 46px; padding: .75rem 1rem; border: 1px solid var(--blue); border-radius: 12px; color: white; background: var(--blue); font-weight: 750; text-decoration: none; box-shadow: 0 5px 14px rgba(25,75,105,.15); }
.button:hover, .button:focus-visible { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.secondary { color: var(--ink); background: white; border-color: var(--border); box-shadow: none; }
.hero .button.secondary { border-color: rgba(255,255,255,.55); color: white; background: rgba(255,255,255,.12); }
.button.whatsapp { background: #157a4f; border-color: #157a4f; }
.button.danger { background: var(--danger); border-color: var(--danger); }
.button-stack { display: grid; gap: .65rem; }
.notice { margin: 1rem 0; padding: 1rem; border-left: 4px solid var(--blue); border-radius: 12px; background: var(--blue-soft); }
.notice p { margin: .35rem 0 0; line-height: 1.5; }
.notice.warning { border-color: var(--warning-border); background: var(--warning); }
.section-block { margin: 2rem 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.section-heading h2 { margin: .2rem 0 0; }
.text-link { font-weight: 700; }
.feature-grid, .card-grid, .settings-grid { display: grid; gap: .9rem; }
.feature-card { display: grid; grid-template-columns: 44px 1fr; gap: .2rem .8rem; align-items: center; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); text-align: left; color: var(--ink); background: white; box-shadow: 0 5px 18px rgba(22,58,78,.06); }
.feature-card > span:first-child { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: var(--blue-dark); background: var(--blue-soft); font-size: 1.4rem; }
.feature-card span:last-child { color: var(--muted); font-size: .88rem; line-height: 1.4; }
.resource-card { position: relative; min-height: 190px; border: 1px solid var(--border); border-radius: var(--radius); background: white; box-shadow: 0 6px 22px rgba(22,58,78,.06); overflow: hidden; }
.resource-main { width: 100%; height: 100%; padding: 1.2rem; border: 0; text-align: left; color: var(--ink); background: transparent; }
.resource-main h3 { margin: .5rem 2rem .45rem 0; font-size: 1.12rem; }
.resource-main p { margin: 0; color: var(--muted); line-height: 1.5; }
.resource-type { color: var(--teal); font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.favourite-button, .mini-share { position: absolute; z-index: 2; top: .7rem; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; font-size: 1.15rem; }
.favourite-button { right: .7rem; color: #687c88; }
.favourite-button.selected { color: #d59a00; }
.mini-share { right: .7rem; bottom: .55rem; top: auto; color: var(--blue-dark); }
.card-list { display: grid; gap: .65rem; }
.list-card { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 14px; text-align: left; color: var(--ink); background: white; }
.list-card span { color: var(--teal); font-size: .72rem; text-transform: uppercase; }
.list-card strong { grid-column: 1; }
.list-card small { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--blue); }
.share-panel { display: grid; gap: 1rem; margin: 2rem 0; padding: 1.25rem; border-radius: 20px; color: white; background: linear-gradient(135deg, #194b69, #246488); }
.share-panel h2 { margin: .25rem 0; }
.share-panel p { margin: 0; opacity: .9; }
.share-panel .eyebrow { color: #b9f6e9; }
.ad-slot { display: grid; place-items: center; min-height: 110px; margin: 1rem 0; padding: 1rem; border: 1px dashed #aebcc4; border-radius: 14px; text-align: center; color: var(--muted); background: #fbfcfd; }
.ad-slot strong { color: var(--ink); }
.ad-slot small { max-width: 520px; margin-top: .35rem; line-height: 1.35; }
.ad-label { margin-bottom: .25rem; font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; }
.page-header { padding: 1.2rem 0 1rem; }
.page-header h1 { font-size: clamp(2rem, 7vw, 3.4rem); }
.page-header p, .lead { max-width: 760px; color: var(--muted); font-size: 1.02rem; line-height: 1.65; }
.toolbar { margin-bottom: 1rem; }
.search-field { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .2rem .8rem; border: 1px solid var(--control-border); border-radius: 14px; background: white; }
.search-field input { width: 100%; min-height: 46px; border: 0; outline: none; color: var(--ink); background: transparent; }
.back-button { display: inline-flex; gap: .45rem; align-items: center; margin: .25rem 0 1rem; padding: .6rem .2rem; border: 0; color: var(--blue-dark); background: transparent; font-weight: 750; }
.detail-layout, .reading-layout { display: grid; gap: 1rem; }
.detail-card, .article-card, .formula-card, .share-card, .settings-card { padding: 1.15rem; border: 1px solid var(--border); border-radius: var(--radius); background: white; box-shadow: 0 5px 22px rgba(22,58,78,.05); }
.detail-card h1, .article-card h1 { font-size: clamp(1.8rem, 6vw, 3rem); }
.detail-aside { display: grid; align-content: start; gap: 1rem; }
.formula-card strong { display: block; margin: .5rem 0; font-size: 1.12rem; }
.formula-card p { color: var(--muted); line-height: 1.5; }
.text-button { padding: .4rem 0; border: 0; color: var(--blue-dark); background: transparent; font-weight: 750; }
.input-group { display: grid; gap: .4rem; margin: 1rem 0; font-weight: 700; }
.unit-input { display: grid; grid-template-columns: 1fr auto; align-items: center; border: 1px solid var(--control-border); border-radius: 12px; overflow: hidden; background: white; }
.unit-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,100,136,.14); }
.unit-input input { min-width: 0; min-height: 50px; padding: .75rem; border: 0; outline: none; font-size: 1.05rem; }
.unit-input span { padding: 0 .8rem; color: var(--muted); font-size: .85rem; }
.result-card { margin-top: 1rem; padding: 1.15rem; border: 2px solid var(--teal); border-radius: 16px; background: #e9faf5; }
.result-card > strong { display: block; margin: .3rem 0; color: #0d5e4b; font-size: clamp(1.6rem, 7vw, 2.5rem); }
.result-card p { margin: 0; }
.boundary { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); line-height: 1.5; }
.formula-display { margin: 1.25rem 0; padding: 1.1rem; border-radius: 14px; background: var(--blue-soft); }
.formula-display small { display: block; color: var(--muted); text-transform: uppercase; }
.formula-display strong { display: block; margin-top: .35rem; font-size: 1.25rem; }
.article-card h2 { margin-top: 1.6rem; }
.article-card p, .steps li { line-height: 1.65; }
.steps { padding-left: 1.3rem; }
.steps li { margin: .65rem 0; padding-left: .35rem; }
.share-card h2 { margin: .35rem 0 1rem; }
.quiz-progress { display: grid; gap: .45rem; margin: 1rem 0; color: var(--muted); font-size: .85rem; }
progress { width: 100%; height: 10px; accent-color: var(--teal); }
.question-card h2 { margin: 1.3rem 0; font-size: 1.3rem; line-height: 1.4; }
.quiz-feedback { margin-top: .8rem; padding: .9rem; border-radius: 12px; }
.quiz-feedback:empty { display: none; }
.quiz-feedback.correct { background: #e8f8ef; color: #0b6040; }
.quiz-feedback.incorrect { background: #fff0f1; color: #8c2029; }
.quiz-feedback p { margin: .3rem 0 0; }
.score-card { padding: 1.5rem 0; text-align: center; }
.score-card h2 { margin: .3rem 0; font-size: 2.5rem; }
.settings-card h2 { margin-top: 0; }
.settings-card p { color: var(--muted); line-height: 1.55; }
.system-health-card { border-left: 6px solid #b56a13; }
.system-health-card.healthy { border-left-color: #2f7d63; }
.system-health-summary strong { color: var(--ink); }
.system-check-list { display: grid; gap: .5rem; padding: 0; list-style: none; }
.system-check-list li { display: flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 750; }
.system-check-list li span { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 999px; color: white; background: #a33a3a; font-weight: 900; }
.system-check-list li.passed span { background: #2f7d63; }
.analytics-list { padding: 0; list-style: none; }
.analytics-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.site-footer { padding: 2rem 1rem 6rem; text-align: center; color: var(--muted); font-size: .82rem; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem 1rem; }
.site-footer nav a { display:inline-flex; align-items:center; min-height:44px; padding:.2rem .1rem; }
.mobile-nav { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 66px; padding: .25rem .25rem max(.25rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
.mobile-nav-item { display: grid; place-items: center; min-width: 0; min-height: 48px; gap: .15rem; border: 0; border-radius: 10px; color: #6e7e87; background: transparent; font-size: .69rem; }
.mobile-nav-item > span:first-child { font-size: 1.2rem; }
.mobile-nav-item.active { color: var(--blue-dark); background: var(--blue-soft); font-weight: 750; }
.consent-banner { position: fixed; z-index: 50; left: .75rem; right: .75rem; bottom: 5rem; max-width: 760px; margin: auto; padding: 1rem; border: 1px solid var(--border); border-radius: 18px; background: white; box-shadow: 0 18px 55px rgba(0,0,0,.2); }
.consent-banner p { margin: .35rem 0; color: var(--muted); line-height: 1.4; }
.consent-banner small { display: block; margin-top: .7rem; color: var(--muted); }
.search-overlay { position: fixed; z-index: 60; inset: 0; padding: 1rem; background: rgba(10,30,42,.55); backdrop-filter: blur(4px); }
.search-dialog { width: min(720px, 100%); max-height: 88vh; margin: 4vh auto; padding: .8rem; border-radius: 18px; background: white; box-shadow: var(--shadow); overflow: auto; }
.search-dialog-header { display: flex; gap: .5rem; }
.search-results { display: grid; gap: .45rem; margin-top: .8rem; }
.search-result { display: grid; gap: .15rem; padding: .8rem; border: 0; border-radius: 12px; text-align: left; color: var(--ink); background: var(--surface); }
.search-result span { color: var(--teal); font-size: .7rem; text-transform: uppercase; }
.qr-dialog { width: min(92vw, 420px); padding: 0; border: 0; border-radius: 20px; color: var(--ink); }
.qr-dialog::backdrop { background: rgba(10,30,42,.65); }
#qr-content { position: relative; display: grid; place-items: center; padding: 1.4rem; text-align: center; }
#qr-content h2 { margin: .35rem 0 .8rem; }
#qr-content img { width: min(260px, 75vw); border-radius: 10px; }
.dialog-close { position: absolute; right: .65rem; top: .65rem; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--surface); font-size: 1.4rem; }
.qr-url { max-width: 100%; color: var(--muted); font-size: .75rem; word-break: break-all; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 6rem; transform: translate(-50%, 30px); padding: .7rem 1rem; border-radius: 999px; color: white; background: var(--ink); opacity: 0; transition: .2s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #f2b630; outline-offset: 2px; }

.lifecycle-banner { margin: 0 0 1rem; padding: .9rem 1rem; border: 1px solid var(--warning-border); border-radius: 14px; background: var(--warning); color: var(--ink); }
.lifecycle-banner p { margin: .3rem 0 0; line-height: 1.45; }
.lifecycle-banner.archived { border-color: #b97a7f; background: #fff0f1; }
.text-button, .back-button { min-height: 44px; }
@media (max-width: 420px) {
  .topbar { gap: .4rem; padding-inline: .65rem; }
  .topbar-title { min-width: 0; }
  .topbar-title strong, .topbar-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: .75rem; }
  .hero { padding: 1.35rem .9rem; }
  .button-row > .button, .hero-actions > .button { flex: 1 1 100%; }
  .site-footer { padding-inline:.75rem; }
  .site-footer nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.35rem .6rem; }
  .site-footer nav a { justify-content:center; overflow-wrap:anywhere; }
}
@media (min-width: 620px) {
  main { padding: 1.5rem; }
  .feature-grid, .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-panel { grid-template-columns: 1fr auto; align-items: center; padding: 1.6rem; }
}
@media (min-width: 960px) {
  .app-shell { display: grid; grid-template-columns: 250px 1fr; }
  .desktop-sidebar { position: sticky; top: 0; display: flex; flex-direction: column; gap: .4rem; height: 100vh; padding: 1.2rem; border-right: 1px solid var(--border); background: white; }
  .brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; color: var(--ink); text-decoration: none; }
  .brand > span:last-child { display: flex; flex-direction: column; }
  .brand small { color: var(--muted); }
  .nav-item { display: flex; align-items: center; gap: .75rem; min-height: 48px; padding: .7rem .8rem; border: 0; border-radius: 12px; text-align: left; color: var(--muted); background: transparent; font-weight: 700; }
  .nav-item > span:first-child { width: 24px; font-size: 1.2rem; }
  .nav-item.active { color: var(--blue-dark); background: var(--blue-soft); }
  .sidebar-note { margin-top: auto; padding: .9rem; border-radius: 12px; color: var(--muted); background: var(--surface); font-size: .78rem; line-height: 1.4; }
  .sidebar-note strong, .sidebar-note span { display: block; }
  .topbar { padding-inline: 1.5rem; }
  .topbar-title strong { font-size: 1.2rem; }
  .mobile-only, .mobile-nav { display: none; }
  .app-column { padding-bottom: 0; }
  main { padding: 2rem; }
  .hero { padding: 3rem; }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); }
  .reading-layout { grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); }
  .detail-card, .article-card { padding: 2rem; }
  .consent-banner { bottom: 1rem; }
  .site-footer { padding-bottom: 2rem; }
}
@media (min-width: 1250px) {
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Stage 2 web/PWA additions */
.connection-status { display:inline-flex; align-items:center; gap:.35rem; padding:.3rem .55rem; border-radius:999px; font-size:.72rem; font-weight:800; }
.connection-status::before { content:''; width:.45rem; height:.45rem; border-radius:50%; background:currentColor; }
.connection-status.online { color:#17633a; background:#e7f7ee; }
.connection-status.offline { color:#8a3d12; background:#fff0df; }
.toggle-row { display:flex !important; align-items:center; gap:.7rem; padding:.75rem 0; font-weight:750; }
.toggle-row input { width:1.25rem; height:1.25rem; accent-color:var(--primary); }
.button[disabled] { opacity:.5; cursor:not-allowed; }
.feedback-page, .offline-page { margin:2rem auto; max-width:820px; }
.feedback-form { display:grid; gap:1rem; margin-top:1.25rem; }
.feedback-form label { display:grid; gap:.45rem; font-weight:800; color:var(--ink); }
.feedback-form input, .feedback-form select, .feedback-form textarea { width:100%; border:1px solid var(--line); border-radius:12px; padding:.85rem; font:inherit; color:var(--ink); background:#fff; }
.feedback-form textarea { resize:vertical; min-height:10rem; }
.feedback-form input:focus, .feedback-form select:focus, .feedback-form textarea:focus { outline:3px solid rgba(45,111,185,.24); border-color:var(--primary); }
.form-status { min-height:1.5rem; color:var(--primary-dark); font-weight:750; }
.share-sheet { width:min(100% - 2rem, 980px); margin:2rem auto; background:#fff; border:1px solid var(--line); border-radius:24px; box-shadow:var(--shadow); padding:clamp(1.25rem,4vw,3rem); }
.share-sheet > header { display:flex; gap:1rem; align-items:center; margin-bottom:1.25rem; }
.brand-mark.large { width:72px; height:72px; font-size:1.35rem; flex:0 0 auto; }
.share-sheet-grid { display:grid; gap:1.5rem; align-items:center; margin:2rem 0; }
.qr-panel { display:grid; justify-items:center; text-align:center; background:var(--surface-soft); border:1px solid var(--line); border-radius:18px; padding:1.25rem; }
.qr-panel img { width:min(100%,280px); aspect-ratio:1; border-radius:12px; background:#fff; padding:.5rem; }
.qr-panel p { overflow-wrap:anywhere; color:var(--muted); }
.preview-note { font-size:.8rem; color:var(--muted); }
.offline-page { text-align:center; min-height:60vh; display:grid; place-content:center; justify-items:center; }
.offline-page .brand-mark { margin-bottom:1rem; }
@media (min-width:760px) { .share-sheet-grid { grid-template-columns:minmax(280px,.8fr) minmax(320px,1.2fr); } }
@media (max-width:500px) { .connection-status { display:none; } .share-sheet { width:100%; margin:0; min-height:100vh; border:0; border-radius:0; } }
@media print {
  body { background:#fff !important; }
  .share-sheet { width:100%; margin:0; border:0; box-shadow:none; }
  .no-print, .preview-note { display:none !important; }
  .share-sheet-grid { grid-template-columns:1fr 1.25fr; }
}

/* Stage 3 usability, accessibility and repeat-use additions */
.return-grid { display:grid; gap:1rem; margin:1.25rem 0 2rem; }
.dashboard-card, .continue-card, .onboarding-card, .quick-practice-banner, .report-card, .topic-progress-card, .progress-summary { border:1px solid var(--border); border-radius:var(--radius); background:var(--white); box-shadow:0 5px 22px rgba(22,58,78,.05); }
.dashboard-card { padding:1.2rem; }
.dashboard-card h2, .continue-card h2, .onboarding-card h2, .quick-practice-banner h2 { margin:.3rem 0 .5rem; }
.dashboard-card p, .continue-card p, .onboarding-card p, .quick-practice-banner p, .report-card p, .topic-progress-card p { margin:.35rem 0; color:var(--muted); line-height:1.5; }
.dashboard-card progress { margin:.55rem 0 0; }
.daily-card { background:linear-gradient(145deg,#f2fbf8,#ffffff); }
.progress-card { background:linear-gradient(145deg,#eef6fb,#ffffff); }
.continue-card, .quick-practice-banner { display:grid; gap:1rem; align-items:center; margin:1rem 0; padding:1.2rem; border-left:5px solid var(--teal); }
.onboarding-card { position:relative; margin:1rem 0; padding:1.2rem; color:var(--ink); background:#f1f8fb; }
.onboarding-card .eyebrow { color:#0d6664; }
.onboarding-card p { color:#465e6c; }
.onboarding-steps { display:grid; gap:.6rem; margin:1rem 0; padding:0; list-style:none; }
.onboarding-steps li { display:flex; align-items:center; gap:.65rem; font-weight:750; }
.onboarding-steps strong { display:grid; place-items:center; width:2rem; height:2rem; border-radius:50%; color:#fff; background:var(--blue-dark); }
.status-chip { display:inline-flex; margin-top:.8rem; padding:.3rem .55rem; border-radius:999px; font-size:.72rem; font-weight:800; }
.status-chip.complete { color:#0d5e4b; background:#e5f7ef; }
.resource-card.completed { border-color:#a8d8c7; }
.learning-path { display:grid; grid-template-columns:repeat(3,1fr); gap:.45rem; margin:0 0 1rem; padding:.45rem; border:1px solid var(--border); border-radius:15px; background:var(--white); }
.learning-step { display:flex; align-items:center; justify-content:center; gap:.35rem; min-height:44px; padding:.55rem .35rem; border:0; border-radius:10px; color:var(--muted); background:transparent; font-size:.78rem; font-weight:800; }
.learning-step.done { color:#0d5e4b; background:#e9f8f2; }
.learning-step.active { color:var(--blue-dark); box-shadow:inset 0 0 0 2px var(--blue); background:var(--blue-soft); }
.resume-notice { display:grid; gap:.35rem; margin:1rem 0; padding:.9rem; border-radius:12px; color:var(--ink); background:var(--blue-soft); }
.resume-notice span { color:var(--muted); line-height:1.4; }
.resume-notice .text-button { justify-self:start; }
.result-next { margin-top:.65rem !important; padding-top:.65rem; border-top:1px solid #b8dfd2; color:var(--muted); font-size:.85rem; }
.topic-label { display:inline-flex; padding:.3rem .55rem; border-radius:999px; color:var(--blue-dark); background:var(--blue-soft); font-size:.75rem; font-weight:800; }
.progress-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; margin:1rem 0; overflow:hidden; background:var(--border); }
.progress-summary article { display:grid; gap:.2rem; padding:1.15rem; text-align:center; background:var(--white); }
.progress-summary strong { font-size:1.55rem; color:var(--blue-dark); }
.progress-summary span { color:var(--muted); font-size:.78rem; }
.topic-progress-list { display:grid; gap:.85rem; margin:1rem 0; }
.topic-progress-card { display:grid; gap:1rem; padding:1.15rem; }
.topic-progress-card h2 { margin:.25rem 0; font-size:1.12rem; }
.step-list { display:grid; grid-template-columns:repeat(3,1fr); gap:.45rem; margin:0; padding:0; list-style:none; }
.step-list li { display:grid; justify-items:center; gap:.25rem; padding:.6rem .25rem; border-radius:10px; color:var(--muted); background:var(--surface); font-size:.75rem; font-weight:800; }
.step-list li span { display:grid; place-items:center; width:1.7rem; height:1.7rem; border-radius:50%; color:var(--muted); background:var(--white); }
.step-list li.done { color:#0d5e4b; background:#e9f8f2; }
.step-list li.done span { color:#fff; background:#137c4c; }
.report-card { margin-top:1rem; padding:1rem; }
.report-card strong { display:block; }
.report-card p { font-size:.86rem; }
.accessibility-card label { display:grid; gap:.4rem; margin:1rem 0; color:var(--ink); font-weight:800; }
.accessibility-card select { width:100%; min-height:46px; padding:.65rem .75rem; border:1px solid var(--border); border-radius:10px; color:var(--ink); background:var(--white); font:inherit; }
html[data-text-size="large"] { font-size:112.5%; }
html[data-contrast="high"] {
  --ink:#071c2a;
  --muted:#263f4d;
  --blue:#084f7b;
  --blue-dark:#003b61;
  --teal:#006d66;
  --border:#657986;
  --surface:#ffffff;
  --blue-soft:#dceef8;
}
html[data-contrast="high"] .resource-card,
html[data-contrast="high"] .detail-card,
html[data-contrast="high"] .article-card,
html[data-contrast="high"] .settings-card { box-shadow:none; border-width:2px; }
html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after { scroll-behavior:auto !important; transition:none !important; animation:none !important; }
@media (min-width:620px) {
  .return-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .continue-card { grid-template-columns:1fr auto; }
  .quick-practice-banner { grid-template-columns:minmax(15rem,1fr) minmax(18rem,2fr); }
  .quick-practice-banner .button-row { flex-wrap:wrap; justify-content:flex-end; }
  .onboarding-steps { grid-template-columns:repeat(3,1fr); }
  .progress-summary { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (min-width:620px) and (max-width:900px) {
  .quick-practice-banner { grid-template-columns:1fr; }
  .quick-practice-banner .button-row { justify-content:flex-start; }
}
@media (min-width:800px) {
  .topic-progress-card { grid-template-columns:minmax(220px,1fr) minmax(260px,1fr) auto; align-items:center; }
}
@media print {
  .learning-path, .report-card, .share-card, .ad-slot, .mobile-nav, .desktop-sidebar, .topbar, .site-footer, .back-button, .button-row, .consent-banner { display:none !important; }
  .app-shell, .app-column, main, .reading-layout, .article-card { display:block !important; width:100% !important; max-width:none !important; margin:0 !important; padding:0 !important; border:0 !important; box-shadow:none !important; }
}

/* Stage 4 pre-laptop readiness and repeat-use additions */
.weekly-line { font-size:.86rem; }
.practice-options { align-items:start; }
.practice-options .button-row { justify-content:flex-start; }
.weekly-goal-card,
.learning-data-card { display:grid; gap:1rem; margin:1rem 0; padding:1.2rem; border:1px solid var(--border); border-radius:var(--radius); background:var(--white); box-shadow:0 5px 22px rgba(22,58,78,.05); }
.weekly-goal-card h2,
.learning-data-card h2 { margin:.3rem 0 .45rem; }
.weekly-goal-card p,
.learning-data-card p { margin:.35rem 0; color:var(--muted); line-height:1.5; }
.weekly-goal-card progress { width:100%; min-height:14px; }
.weak-topic-card { border-left-color:#b56a13; background:linear-gradient(145deg,#fff8ee,#ffffff); }
.weak-notice { border-left:5px solid #b56a13; }
.settings-card select { width:100%; min-height:46px; padding:.65rem .75rem; border:1px solid var(--border); border-radius:10px; color:var(--ink); background:var(--white); font:inherit; }
.settings-card label { display:grid; gap:.4rem; margin-top:.8rem; color:var(--ink); font-weight:800; }
@media (min-width:760px) {
  .weekly-goal-card { grid-template-columns:minmax(260px,1fr) minmax(180px,.7fr); align-items:center; }
  .weekly-goal-card .button-row { grid-column:1 / -1; }
}

/* Stage 6 organic discovery and learning-library additions */
.feature-card[href] { text-decoration:none; }
.static-resource-page, .learning-page, .learning-library { margin:2rem auto; max-width:920px; }
.breadcrumbs { display:flex; flex-wrap:wrap; gap:.45rem; align-items:center; margin-bottom:1rem; color:var(--muted); font-size:.86rem; }
.breadcrumbs a { font-weight:750; }
.article-footer { width:min(100% - 2rem,920px); margin:1rem auto 3rem; padding:1rem 0; color:var(--muted); font-size:.86rem; }
.article-footer nav { display:flex; flex-wrap:wrap; gap:.7rem; }
.learning-section { margin:1.8rem 0; }
.learning-section h2 { margin-bottom:.65rem; }
.learning-section p, .learning-section li { line-height:1.7; }
.learning-section li + li { margin-top:.45rem; }
.learning-library-grid { display:grid; gap:1rem; margin-top:1.5rem; }
.learning-library-card { padding:1.15rem; border:1px solid var(--border); border-radius:var(--radius); background:#fff; box-shadow:0 5px 18px rgba(22,58,78,.05); }
.learning-library-card h2 { margin:.35rem 0 .55rem; font-size:1.2rem; }
.learning-library-card p { margin:.2rem 0; color:var(--muted); line-height:1.55; }
.static-question-list { display:grid; gap:1rem; padding-left:1.35rem; }
.static-question-list > li { padding:1rem; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.static-question-list p { margin:.3rem 0; }
.static-question-list details { margin-top:.65rem; }
.static-question-list summary { min-height:44px; display:flex; align-items:center; color:var(--blue-dark); font-weight:800; cursor:pointer; }
.static-question-list .formula-box { margin:.75rem 0; }
.review-status { padding:1rem; border-left:4px solid var(--warning-border); border-radius:12px; background:var(--warning); }
.action-panel { padding:1rem; border-radius:14px; background:var(--blue-soft); }
@media (min-width:760px) { .learning-library-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media print { .article-footer, .breadcrumbs, .review-status, .action-panel { display:none !important; } .learning-page { max-width:none; } .static-question-list details { display:block; } .static-question-list details > * { display:block; } }

/* Stage 7 privacy-first assessment and transparency additions */
.assessment-page { margin:2rem auto; max-width:940px; }
.privacy-promise { display:grid; gap:.8rem; margin:1.2rem 0 1.6rem; }
.privacy-promise article { display:grid; gap:.25rem; padding:1rem; border:1px solid var(--border); border-radius:14px; background:linear-gradient(145deg,#eef9f6,#fff); }
.privacy-promise strong { color:var(--blue-dark); }
.privacy-promise span { color:var(--muted); line-height:1.45; }
.assessment-setup, .assessment-card, .saved-summaries-section { margin:1.2rem 0; padding:1.2rem; border:1px solid var(--border); border-radius:var(--radius); background:#fff; box-shadow:0 5px 22px rgba(22,58,78,.05); }
.assessment-control-grid { display:grid; gap:1rem; margin:1rem 0; }
.assessment-control-grid label, .assessment-answer-form label { display:grid; gap:.45rem; color:var(--ink); font-weight:800; }
.assessment-control-grid select, .assessment-answer-form input { width:100%; min-height:48px; padding:.7rem .8rem; border:1px solid var(--border); border-radius:10px; background:#fff; color:var(--ink); font:inherit; }
.checkbox-row { display:flex; align-items:flex-start; gap:.65rem; margin:1rem 0; font-weight:750; line-height:1.45; }
.checkbox-row input { width:1.15rem; height:1.15rem; margin-top:.15rem; }
.field-help, .privacy-note { color:var(--muted); font-size:.88rem; line-height:1.5; }
.assessment-progress-row { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.7rem; align-items:center; }
.assessment-card progress { width:100%; margin:.65rem 0 1rem; }
.assessment-card h2 { line-height:1.35; }
.assessment-answer-form { display:grid; gap:.8rem; margin-top:1.2rem; }
.assessment-feedback { margin-top:1rem; }
.assessment-feedback .notice { margin:0; }
.assessment-summary-table { width:100%; margin:1rem 0; border-collapse:collapse; }
.assessment-summary-table caption { margin-bottom:.6rem; text-align:left; font-weight:850; }
.assessment-summary-table th, .assessment-summary-table td { padding:.75rem; border-bottom:1px solid var(--border); text-align:left; }
.assessment-summary-table td { width:6rem; font-weight:850; }
.incorrect-review { margin:1rem 0; padding:1rem; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.incorrect-review summary { min-height:44px; display:flex; align-items:center; color:var(--blue-dark); font-weight:850; cursor:pointer; }
.incorrect-review li + li { margin-top:1rem; }
.saved-summary-list { display:grid; gap:.5rem; padding-left:1.3rem; }
.formula-grid { display:grid; gap:1rem; margin:1.2rem 0; }
.formula-grid section { padding:1rem; border:1px solid var(--border); border-radius:14px; background:#fff; }
.formula-grid h2 { margin-top:0; }
.privacy-feature { background:linear-gradient(145deg,#eef9f6,#fff); }
.search-result[href] { text-decoration:none; }
@media (min-width:680px) {
  .privacy-promise { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .assessment-control-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .formula-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media print {
  .assessment-page .breadcrumbs, .assessment-page .assessment-setup, .assessment-page .saved-summaries-section, .article-footer, .no-print { display:none !important; }
  .assessment-card, .formula-sheet { border:0 !important; box-shadow:none !important; max-width:none !important; margin:0 !important; }
}

/* Stage 8 retention, exact-set sharing, worked feedback and printable packs */
.question-meta { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.5rem 1rem; margin:.55rem 0; color:var(--muted); font-size:.86rem; font-weight:750; }
.worked-feedback { display:grid; gap:.8rem; }
.worked-feedback-grid { display:grid; gap:.75rem; margin:0; }
.worked-feedback-grid > div { padding:.75rem; border:1px solid color-mix(in srgb, currentColor 16%, transparent); border-radius:12px; background:rgba(255,255,255,.56); }
.worked-feedback-grid dt { margin-bottom:.3rem; font-weight:850; }
.worked-feedback-grid dd { margin:0; }
.worked-steps { display:grid; gap:.4rem; margin:.1rem 0 .2rem; padding-left:1.35rem; }
.mistake-tip { margin:0; padding:.7rem .8rem; border-left:4px solid currentColor; background:rgba(255,255,255,.48); }
.question-trust { display:flex; flex-wrap:wrap; gap:.4rem .9rem; align-items:center; margin:.9rem 0 0; color:var(--muted); font-size:.78rem; }
.question-trust a { font-weight:800; }
.review-item { margin:1rem 0; padding:1rem; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.review-item h3 { font-size:1rem; line-height:1.4; }
.share-set-card { margin:1rem 0; padding:1rem; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.share-set-card h3 { margin-top:0; }
.set-code { display:inline-block; max-width:100%; padding:.55rem .7rem; overflow-wrap:anywhere; border-radius:9px; background:#fff; border:1px dashed var(--border); font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-weight:850; }
.printable-pack { max-width:920px; margin-inline:auto; }
.pack-header { display:grid; gap:1rem; align-items:center; }
.pack-header img { width:132px; height:132px; object-fit:contain; border:1px solid var(--border); border-radius:12px; }
.pack-link { overflow-wrap:anywhere; font-size:.84rem; }
.print-question-list { display:grid; gap:1rem; padding-left:1.5rem; }
.print-question-list > li { break-inside:avoid; padding:.8rem; border:1px solid var(--border); border-radius:12px; }
.pack-question-id { color:var(--muted); font-size:.75rem; font-weight:800; }
.answer-space { min-height:4.25rem; margin-top:.75rem; border-bottom:1px solid #9baab3; background:repeating-linear-gradient(to bottom, transparent 0, transparent 1.35rem, rgba(100,120,130,.18) 1.4rem); }
.print-answer-key { break-before:page; margin-top:2rem; }
.print-answer-key ol { display:grid; gap:.8rem; padding-left:1.4rem; }
.print-answer-key li { break-inside:avoid; }
.pack-review { margin-top:1.5rem; color:var(--muted); font-size:.78rem; }
@media (min-width:720px) {
  .worked-feedback-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .pack-header { grid-template-columns:1fr auto; }
}
@media print {
  .printable-pack { max-width:none !important; padding:0 !important; border:0 !important; box-shadow:none !important; }
  .printable-pack .notice { border:1px solid #777 !important; background:#fff !important; color:#000 !important; }
  .print-question-list > li { border-color:#777; }
  .answer-space { min-height:5rem; }
  .question-trust a { display:none !important; }
}

/* Stage 8.1 private owner intelligence dashboard */
.owner-body { min-height:100vh; background:linear-gradient(160deg,#eef5f8 0%,#f8fbfc 50%,#eef9f6 100%); }
.owner-shell { width:min(100% - 1.5rem,1180px); margin:0 auto; padding:1.2rem 0 4rem; }
.owner-header { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-start; gap:1rem; margin-bottom:1rem; }
.owner-header h1 { margin:.25rem 0 .45rem; font-size:clamp(2rem,5vw,3.4rem); }
.owner-header p { max-width:760px; margin:0; color:var(--muted); line-height:1.55; }
.owner-header-actions { display:flex; flex-wrap:wrap; gap:.6rem; }
.owner-login-card, .owner-section, .owner-health, .owner-summary-strip { margin:1rem 0; padding:1.15rem; border:1px solid var(--border); border-radius:18px; background:#fff; box-shadow:0 8px 28px rgba(22,58,78,.07); }
.owner-login-card { max-width:620px; }
.owner-login-card form { display:grid; gap:.9rem; }
.owner-login-card label, .owner-settings-grid label { display:grid; gap:.4rem; font-weight:800; }
.owner-login-card input, .owner-settings-grid input { min-height:48px; padding:.7rem .8rem; border:1px solid var(--control-border); border-radius:10px; background:#fff; color:var(--ink); font:inherit; }
.owner-status { margin:1rem 0; color:var(--muted); font-weight:700; }
.owner-summary-strip { display:grid; gap:.8rem; background:var(--blue-dark); color:#fff; }
.owner-summary-strip > div { display:grid; gap:.2rem; }
.owner-summary-strip span { opacity:.78; font-size:.8rem; text-transform:uppercase; letter-spacing:.05em; }
.owner-summary-strip strong { font-size:1rem; }
.owner-health { display:grid; gap:1rem; align-items:center; border-left:8px solid #2f7d63; background:linear-gradient(145deg,#eef9f6,#fff); }
.owner-health.needs-attention { border-left-color:#b56a13; background:linear-gradient(145deg,#fff8ee,#fff); }
.owner-health.critical { border-left-color:#a33a3a; background:linear-gradient(145deg,#fff1f1,#fff); }
.owner-health.collecting { border-left-color:#6f8290; background:linear-gradient(145deg,#f1f5f7,#fff); }
.owner-health-score { display:flex; align-items:baseline; gap:.15rem; }
.owner-health-score strong { font-size:4rem; line-height:.9; }
.owner-health-score span { color:var(--muted); font-weight:800; }
.owner-health h2 { margin:.25rem 0 .45rem; }
.owner-health p { margin:.25rem 0; color:var(--muted); }
.owner-health ul { margin:.7rem 0 0; padding-left:1.2rem; }
.owner-section-heading { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.7rem; align-items:flex-start; margin-bottom:1rem; }
.owner-section-heading h2 { margin:.2rem 0 0; }
.owner-section-heading > span, .owner-section-heading > small { color:var(--muted); font-weight:800; }
.owner-metric-grid { display:grid; gap:.8rem; }
.owner-metric { display:grid; gap:.25rem; min-height:118px; align-content:center; padding:1rem; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.owner-metric > span { color:var(--muted); font-weight:800; font-size:.85rem; }
.owner-metric > strong { font-size:clamp(1.35rem,4vw,2rem); line-height:1.1; overflow-wrap:anywhere; }
.owner-metric small { color:var(--muted); line-height:1.35; }
.owner-metric.positive { border-color:#8cc7b4; background:#eef9f6; }
.owner-metric.warning { border-color:#e0b87e; background:#fff8ee; }
.owner-priority { border-left:6px solid var(--blue); }
.owner-insight-list { display:grid; gap:.75rem; }
.owner-insight { padding:.9rem 1rem; border-radius:12px; background:var(--surface); border-left:4px solid #6f8290; }
.owner-insight p { margin:.3rem 0 0; color:var(--muted); line-height:1.45; }
.owner-insight.good { border-left-color:#2f7d63; background:#eef9f6; }
.owner-insight.warning { border-left-color:#b56a13; background:#fff8ee; }
.owner-insight.critical { border-left-color:#a33a3a; background:#fff1f1; }
.owner-two-column { display:grid; gap:1rem; }
.owner-two-column > article { padding:1rem; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.owner-two-column h3 { margin-top:0; }
.owner-ranked-list { display:grid; gap:.55rem; margin:0; padding:0; list-style:none; }
.owner-ranked-list li { display:flex; justify-content:space-between; gap:1rem; align-items:center; padding:.7rem 0; border-bottom:1px solid var(--border); }
.owner-ranked-list li:last-child { border-bottom:0; }
.owner-ranked-list span { display:grid; gap:.15rem; min-width:0; }
.owner-ranked-list strong { overflow-wrap:anywhere; }
.owner-ranked-list small { color:var(--muted); }
.owner-ranked-list b { white-space:nowrap; }
.empty-state { color:var(--muted); }
.owner-bar-chart { height:190px; display:flex; align-items:flex-end; gap:.35rem; padding:1rem .5rem .2rem; border-left:1px solid var(--border); border-bottom:1px solid var(--border); overflow-x:auto; }
.owner-bar-column { min-width:32px; height:100%; display:grid; grid-template-rows:1fr auto; gap:.3rem; align-items:end; text-align:center; }
.owner-bar { width:100%; min-height:3px; border-radius:7px 7px 2px 2px; background:linear-gradient(180deg,var(--blue),var(--blue-dark)); }
.owner-bar-column small { color:var(--muted); font-size:.66rem; }
.method-note { margin:1rem 0 0; padding:.8rem; border-radius:10px; background:var(--surface); color:var(--muted); line-height:1.5; }
.owner-details { margin-top:1rem; border-top:1px solid var(--border); padding-top:.8rem; }
.owner-details summary { min-height:44px; display:flex; align-items:center; color:var(--blue-dark); font-weight:850; cursor:pointer; }
.owner-settings-grid { display:grid; gap:.8rem; padding-top:.8rem; }
.owner-settings-grid .checkbox-row { align-self:end; }
.owner-achievement-grid { display:grid; gap:.75rem; }
.owner-achievement { display:flex; gap:.75rem; align-items:flex-start; padding:.9rem; border:1px solid var(--border); border-radius:12px; background:var(--surface); opacity:.7; }
.owner-achievement.achieved { opacity:1; border-color:#8cc7b4; background:#eef9f6; }
.owner-achievement > span { display:grid; place-items:center; width:2rem; height:2rem; flex:0 0 auto; border-radius:999px; background:#fff; font-weight:900; }
.owner-achievement div { display:grid; gap:.2rem; }
.owner-achievement small { color:var(--muted); }
.owner-timeline { position:relative; display:grid; gap:1rem; }
.owner-timeline::before { content:''; position:absolute; left:.48rem; top:.5rem; bottom:.5rem; width:2px; background:var(--border); }
.owner-timeline-item { position:relative; display:grid; grid-template-columns:1rem 1fr; gap:.8rem; }
.owner-timeline-marker { z-index:1; width:1rem; height:1rem; margin-top:.2rem; border:3px solid #fff; border-radius:999px; background:var(--blue); box-shadow:0 0 0 2px var(--blue); }
.owner-timeline-title { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.5rem; }
.owner-timeline-title time { color:var(--muted); font-size:.85rem; }
.owner-timeline-item ul { margin:.6rem 0; padding-left:1.2rem; color:var(--muted); line-height:1.5; }
.owner-version-metrics { display:flex; flex-wrap:wrap; gap:.45rem; }
.owner-version-metrics span { padding:.3rem .55rem; border-radius:999px; background:var(--surface); color:var(--muted); font-size:.78rem; font-weight:800; }
.owner-timeline code { display:block; margin-top:.5rem; overflow-wrap:anywhere; font-size:.72rem; }
@media (min-width:620px) {
  .owner-summary-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .owner-metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .owner-achievement-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .owner-settings-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (min-width:860px) {
  .owner-summary-strip { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .owner-health { grid-template-columns:auto 1fr; }
  .owner-metric-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .owner-two-column { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .owner-achievement-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media print { .owner-header-actions, .owner-login-card, #owner-security-note, .owner-details, .owner-status { display:none !important; } .owner-body { background:#fff; } .owner-section, .owner-health { box-shadow:none; break-inside:avoid; } }
.owner-release-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:.6rem;margin:.85rem 0}.owner-release-facts span{display:flex;flex-direction:column;gap:.15rem;padding:.65rem .75rem;border:1px solid var(--border);border-radius:.75rem;background:var(--surface-soft)}.owner-release-facts b{font-size:.76rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.owner-version-status{font-size:.88rem;color:var(--muted);margin:.75rem 0}

/* v0.8.3 exact-set QR: browser-local SVG with visible URL/set-code fallback. */
.exact-set-qr-panel, .exact-set-qr-wrap { display:grid; justify-items:center; gap:.55rem; }
.exact-set-qr { width:min(230px,70vw); height:auto; background:#fff; padding:.4rem; border:1px solid var(--border); border-radius:10px; }
.exact-set-qr-panel p { margin:0; max-width:38rem; color:var(--muted); }
@media print {
  .exact-set-qr { width:34mm; max-width:34mm; padding:1mm; border:1px solid #555; }
}

/* v0.8.3 print attribution and classroom/tutor pack mode */
.pack-online-access, .pack-tutor-grid { display:grid; gap:1rem; align-items:center; margin:0 0 1rem; padding:1rem; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.pack-online-access h3, .pack-page-title h2, .pack-tutor-reference h2 { margin-top:0; }
.pack-print-page { position:relative; padding-bottom:3.4rem; }
.pack-print-page + .pack-print-page { margin-top:1.5rem; }
.pack-page-footer { margin-top:1.2rem; padding-top:.55rem; border-top:1px solid var(--border); color:var(--muted); font-size:.72rem; line-height:1.35; }
.pack-page-footer span { font-size:.68rem; }
.pack-page-title { margin-bottom:.8rem; }
.compact-print-notice { padding:.7rem .8rem; }
.compact-print-notice p { margin:.25rem 0 0; }
.pack-tutor-reference { border:2px dashed var(--control-border); padding:1rem 1rem 3.4rem; border-radius:14px; }
.print-answer-key-inline ol { columns:2; column-gap:2rem; }
.print-answer-key-inline li { break-inside:avoid; margin:.35rem 0; }
@media (min-width:720px) {
  .pack-online-access, .pack-tutor-grid { grid-template-columns:minmax(0,1fr) auto; }
}
@media print {
  .printable-pack { overflow:visible !important; }
  .pack-print-page { break-after:page; page-break-after:always; min-height:245mm; box-sizing:border-box; padding:0 0 18mm !important; margin:0 !important; }
  .pack-print-page:last-of-type { break-after:auto; page-break-after:auto; }
  .pack-page-footer { position:absolute; left:0; right:0; bottom:0; border-top:1px solid #777; color:#333; }
  .pack-online-access, .pack-tutor-grid { border:1px solid #777; background:#fff !important; grid-template-columns:1fr auto; }
  .pack-online-access .exact-set-qr, .pack-tutor-grid .exact-set-qr { width:27mm; height:27mm; }
  .pack-question-page .print-question-list > li { padding:.55rem .65rem; }
  .pack-question-page .answer-space { min-height:36mm; }
  .pack-tutor-reference { border:1px dashed #777 !important; border-radius:0; }
  .print-answer-key-inline ol { columns:2; }
}

.runtime-qr svg, .exact-set-qr { width:min(100%,280px); height:auto; display:block; margin-inline:auto; }
