/* I Will Pass NCLEX — theme (on top of Bootstrap 5.3) */

@font-face { font-family: "Mona Sans"; src: url("../vendor/fonts/MonaSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Mona Sans"; src: url("../vendor/fonts/MonaSans-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Mona Sans"; src: url("../vendor/fonts/MonaSans-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Mona Sans"; src: url("../vendor/fonts/MonaSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Mona Sans"; src: url("../vendor/fonts/MonaSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Mona Sans Expanded"; src: url("../vendor/fonts/MonaSansExpanded-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Mona Sans Expanded"; src: url("../vendor/fonts/MonaSansExpanded-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../vendor/fonts/SourceSerif4-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../vendor/fonts/SourceSerif4-It.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../vendor/fonts/SourceSerif4-Semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../vendor/fonts/SourceSerif4-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --ink: #14213D;
  --ink-2: #1D2F55;
  --teal: #0E7C86;
  --teal-dark: #0A5F67;
  --mist: #E4F0F3;
  --paper: #F6F9FA;
  --marker: #FFD23F;
  --marker-soft: #FFF3C4;
  --ok: #18875B;
  --ok-soft: #E3F5EC;
  --bad: #C93838;
  --bad-soft: #FBE9E9;
  --line: #D3DFE5;
  --muted: #55667A;
  --font-ui: "Mona Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Mona Sans Expanded", "Mona Sans", system-ui, sans-serif;
  --font-read: "Source Serif 4", Georgia, "Times New Roman", serif;

  --bs-body-font-family: var(--font-ui);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-primary: #0E7C86;
  --bs-primary-rgb: 14, 124, 134;
  --bs-link-color: #0A6A73;
  --bs-link-color-rgb: 10, 106, 115;
  --bs-link-hover-color: #07474D;
  --bs-link-hover-color-rgb: 7, 71, 77;
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-border-radius: 8px;
  --bs-border-radius-lg: 12px;
  --bs-success: #18875B;
  --bs-success-rgb: 24, 135, 91;
  --bs-danger: #C93838;
  --bs-danger-rgb: 201, 56, 56;
}

body { font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { font-weight: 700; letter-spacing: -0.012em; line-height: 1.18; color: var(--ink); }
h1, .h1 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.35rem); }
h2, .h2 { font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.75rem); }
h3, .h3 { font-size: 1.2rem; }
.display-type { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; }
.text-secondary { color: var(--muted) !important; }
a { text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(20, 33, 61, 0.55) !important; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--marker); color: var(--ink); padding: 10px 16px; border-radius: 8px; font-weight: 700; z-index: 2000; }
.skip-link:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn { font-weight: 600; border-radius: 8px; padding: 0.6rem 1.05rem; }
.btn-sm { padding: 0.32rem 0.65rem; border-radius: 6px; }
.btn-lg { padding: 0.85rem 1.4rem; font-size: 1.05rem; border-radius: 10px; }
.btn-primary { --bs-btn-bg: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal-dark); --bs-btn-hover-border-color: var(--teal-dark); --bs-btn-active-bg: #074B52; --bs-btn-active-border-color: #074B52; --bs-btn-disabled-bg: #7FB5BA; --bs-btn-disabled-border-color: #7FB5BA; }
.btn-outline-primary { --bs-btn-color: var(--teal-dark); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal); --bs-btn-hover-border-color: var(--teal); --bs-btn-active-bg: var(--teal-dark); --bs-btn-active-border-color: var(--teal-dark); }
.btn-marker { --bs-btn-bg: var(--marker); --bs-btn-border-color: var(--marker); --bs-btn-color: var(--ink); --bs-btn-hover-bg: #F5C21B; --bs-btn-hover-border-color: #F5C21B; --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: #E5B30F; --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: #E5B30F; }
.btn-ink { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--ink-2); --bs-btn-hover-border-color: var(--ink-2); --bs-btn-hover-color: #fff; --bs-btn-active-bg: #0C152B; --bs-btn-active-color: #fff; }
.btn-ghost { --bs-btn-color: var(--ink); --bs-btn-hover-bg: var(--mist); --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: var(--mist); border: 0; }

/* ---------- forms ---------- */
.form-control, .form-select { border-color: #B9C9D1; padding: 0.6rem 0.8rem; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.22); }
.form-label { font-weight: 600; margin-bottom: 0.3rem; }
.form-text { color: var(--muted); }
.form-check-input { border-color: #8FA3AF; width: 1.15em; height: 1.15em; }
.form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }
.form-switch .form-check-input { width: 2.2em; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.4rem 1.2rem; }
.access-box { border: 1px solid var(--line); border-left: 5px solid var(--marker); border-radius: 8px; padding: 0.9rem 1.1rem 1rem; background: #fff; }
.access-box legend { float: none; width: auto; font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; padding: 0; }
.field-error { color: var(--bad); font-size: 0.875rem; font-weight: 600; margin-top: 0.25rem; }

/* ---------- surfaces ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.75rem; }
.next-step { background: var(--marker-soft); border: 1px solid #F1D56C; border-left: 6px solid var(--marker); border-radius: 12px; padding: 1.15rem 1.25rem; }
.badge { font-weight: 600; letter-spacing: 0; }
.badge-sample { background: var(--marker-soft); color: #6B5200; border: 1px solid #EBCF62; }
.badge-plan { background: var(--mist); color: var(--teal-dark); border: 1px solid #BFDCE2; }
.alert { border-radius: 10px; border-width: 1px; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th { font-size: 0.8125rem; font-weight: 600; color: var(--muted); border-bottom-width: 1px; white-space: nowrap; background: #F1F6F8; }
.table > :not(caption) > * > * { padding: 0.7rem 0.85rem; vertical-align: middle; }
.table-responsive { border-radius: 12px; position: relative; }
.progress { height: 10px; background: var(--mist); border-radius: 99px; }
.progress-bar { background: var(--teal); border-radius: 99px; }
.progress-bar.is-low { background: var(--bad); }
.progress-bar.is-mid { background: #D9930A; }
.progress-bar.is-high { background: var(--ok); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; height: 100%; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: 0.875rem; margin-top: 0.2rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty i { font-size: 2rem; display: block; margin-bottom: 0.5rem; color: #8FA3AF; }

/* ---------- brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; font-size: 1.05rem; line-height: 1.1; }
.brand svg { flex: none; }
.brand img { max-height: 40px; width: auto; }
.brand-on-dark { color: #fff; }

/* ---------- public site ---------- */
.site-nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; }
.site-nav .nav-link { color: var(--ink); font-weight: 500; padding: 0.5rem 0.75rem; border-radius: 6px; }
.site-nav .nav-link:hover { background: var(--mist); }
.site-nav .nav-link.active { box-shadow: inset 0 -3px 0 var(--marker); border-radius: 0; }
.hero { background: var(--ink); color: #fff; padding: clamp(2.5rem, 6vw, 5rem) 0; position: relative; overflow: hidden; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 0.5rem + 3.3vw, 3rem); margin: 0 0 1.25rem; }
@media (min-width: 992px) { .hero h1 span { white-space: nowrap; } }
.hero h1 span { display: block; }
.hero h1 .l1 { color: var(--marker); }
.hero-lead { font-size: 1.15rem; color: #C9D6E5; max-width: 34rem; }
.hero-note { color: #A9BACD; font-size: 0.9rem; }
.sample-q { background: #fff; color: var(--ink); border-radius: 16px; padding: 1.35rem; box-shadow: 0 24px 60px rgba(4, 10, 25, 0.45); }
.sample-q-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; font-size: 0.875rem; color: var(--muted); margin-bottom: 0.75rem; }
.section { padding: clamp(2.5rem, 5vw, 4.5rem) 0; }
.section-tint { background: var(--mist); }
.section-ink { background: var(--ink); color: #fff; }
.section-ink h2 { color: #fff; }
.lead-in { font-size: 1.1rem; color: var(--muted); max-width: 44rem; }
.path { list-style: none; margin: 0; padding: 0; counter-reset: step -1; display: grid; gap: 1rem; }
@media (min-width: 992px) { .path { grid-template-columns: repeat(4, 1fr); gap: 0; } }
.path li { counter-increment: step; position: relative; padding: 1.25rem 1.25rem 1.25rem 4.25rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.path li::before { content: counter(step, decimal); position: absolute; left: 1.1rem; top: 1.1rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; display: grid; place-items: center; }
.path li:first-child::before { background: var(--marker); color: var(--ink); }
@media (min-width: 992px) {
  .path li { border-radius: 0; border-right-width: 0; padding: 4.4rem 1.25rem 1.4rem; }
  .path li:first-child { border-radius: 12px 0 0 12px; }
  .path li:last-child { border-radius: 0 12px 12px 0; border-right-width: 1px; }
  .path li::before { left: 1.25rem; top: 1.25rem; }
  .path li::after { content: ""; position: absolute; top: 2.4rem; left: 4.1rem; right: -1.25rem; height: 2px; background: var(--line); z-index: 1; }
  .path li:last-child::after { display: none; }
}
.path h3 { font-size: 1.05rem; margin: 0 0 0.3rem; }
.path p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.course-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; height: 100%; color: inherit; text-decoration: none; }
a.course-card:hover { border-color: var(--teal); }
.course-thumb { aspect-ratio: 16 / 7; background: var(--mist); display: grid; place-items: center; color: var(--teal-dark); font-size: 2rem; overflow: hidden; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.course-body h3 { font-size: 1.05rem; margin: 0; }
.plan-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; height: 100%; display: flex; flex-direction: column; position: relative; }
.plan-card.is-featured { border: 2px solid var(--ink); }
.plan-flag { position: absolute; top: -0.8rem; left: 1.25rem; background: var(--marker); color: var(--ink); font-weight: 700; font-size: 0.8125rem; padding: 0.2rem 0.65rem; border-radius: 6px; }
.plan-price { font-size: 2.3rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.plan-period { color: var(--muted); }
.plan-features { list-style: none; padding: 0; margin: 1rem 0 1.25rem; display: grid; gap: 0.5rem; flex: 1; align-content: start; }
.plan-features li { padding-left: 1.6rem; position: relative; }
.plan-features li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: 0.05rem; color: var(--ok); font-weight: 700; }
.site-footer { background: var(--ink); color: #B8C6D8; padding: 3rem 0 2rem; font-size: 0.95rem; }
.site-footer a { color: #E3EBF4; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer h2 { font-size: 0.95rem; color: #fff; margin-bottom: 0.75rem; }
.footer-legal { border-top: 1px solid #2B3D63; margin-top: 2rem; padding-top: 1.25rem; font-size: 0.85rem; color: #9FB0C6; }
.auth-wrap { max-width: 480px; margin: 0 auto; }
.auth-wrap.wide { max-width: 720px; }
.accordion-button { font-weight: 600; }
.accordion-button:not(.collapsed) { background: var(--mist); color: var(--ink); box-shadow: none; }

/* ---------- reading content (lessons, pages, rationales) ---------- */
.prose { font-family: var(--font-read); font-size: 1.125rem; line-height: 1.7; max-width: 42rem; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--font-ui); margin: 1.8em 0 0.5em; }
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.15rem; }
.prose > :first-child { margin-top: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: 0.95rem; margin: 1rem 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: left; }
.prose th { background: var(--mist); }
.prose blockquote { border-left: 5px solid var(--marker); background: var(--marker-soft); margin: 1.25rem 0; padding: 0.8rem 1rem; border-radius: 0 8px 8px 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose li { margin-bottom: 0.3em; }
.prose .ql-align-center { text-align: center; }
.sample-note, .prose p.note { font-family: var(--font-ui); font-size: 0.875rem; background: var(--marker-soft); border: 1px dashed #D9B93A; color: #5C4700; border-radius: 8px; padding: 0.5rem 0.8rem; margin-bottom: 1rem; }

/* ---------- app shell (student + admin) ---------- */
.shell { display: flex; min-height: 100vh; }
.shell-side { width: 252px; flex: none; background: var(--ink); color: #C9D6E5; display: none; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
@media (min-width: 992px) { .shell-side { display: flex; } }
.shell-side .brand { padding: 1.15rem 1.1rem; }
.side-nav { list-style: none; margin: 0; padding: 0.25rem 0.65rem 1rem; }
.side-group { font-size: 0.78rem; font-weight: 600; color: #8EA2BD; padding: 1rem 0.7rem 0.35rem; }
.side-link { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border-radius: 8px; color: #D7E1EE; text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.side-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; color: #9FB3CE; }
.side-link:hover { background: #1F3158; color: #fff; }
.side-link.active { background: var(--marker); color: var(--ink); font-weight: 700; }
.side-link.active i { color: var(--ink); }
.side-foot { margin-top: auto; padding: 0.9rem 1.1rem; border-top: 1px solid #263A62; font-size: 0.85rem; }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 0.6rem 1rem; display: flex; align-items: center; gap: 0.75rem; position: sticky; top: 0; z-index: 1010; min-height: 60px; }
.topbar-title { font-weight: 700; font-size: 1.05rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-content { padding: 1.25rem 1rem 6.5rem; max-width: 1240px; width: 100%; margin: 0 auto; }
@media (min-width: 992px) { .shell-content { padding: 1.75rem 2rem 3rem; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1rem; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
.page-head p { margin: 0.3rem 0 0; color: var(--muted); max-width: 48rem; }
.offcanvas.side-canvas { background: var(--ink); color: #C9D6E5; width: 280px; }
.offcanvas.side-canvas .btn-close { filter: invert(1); }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 1015; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 992px) { .tabbar { display: none; } }
.tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.5rem 0.25rem 0.45rem; font-size: 0.72rem; font-weight: 600; color: var(--muted); text-decoration: none; background: none; border: 0; min-height: 58px; }
.tabbar i { font-size: 1.3rem; line-height: 1.1; }
.tabbar .active { color: var(--ink); box-shadow: inset 0 3px 0 var(--marker); }

/* ---------- lessons ---------- */
.outline { list-style: none; margin: 0; padding: 0; }
.outline-module { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 0.85rem; overflow: hidden; }
.outline-module > h3 { font-size: 1rem; margin: 0; padding: 0.85rem 1.1rem; background: #F1F6F8; border-bottom: 1px solid var(--line); }
.outline-lesson { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1.1rem; border-bottom: 1px solid #E7EEF2; color: inherit; text-decoration: none; min-height: 56px; }
.outline-lesson:last-child { border-bottom: 0; }
a.outline-lesson:hover { background: var(--paper); }
.outline-lesson .state { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid #A9BBC6; flex: none; display: grid; place-items: center; font-size: 0.9rem; color: transparent; }
.outline-lesson.is-done .state { background: var(--ok); border-color: var(--ok); color: #fff; }
.outline-lesson.is-current { background: var(--marker-soft); }
.outline-lesson.is-locked { color: var(--muted); }
.outline-lesson.is-locked .state { border-style: dashed; color: var(--muted); border-color: #B9C9D1; }
.video-frame { aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 1.25rem; }
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; display: block; }
.locked-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 2rem 1.5rem; text-align: center; max-width: 560px; margin: 1rem auto; }
.locked-box .bi-lock-fill { font-size: 2.2rem; color: var(--ink); }

/* ---------- questions ---------- */
.q-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; }
@media (min-width: 768px) { .q-card { padding: 1.6rem 1.75rem; } }
.q-text { font-family: var(--font-read); font-size: 1.2rem; line-height: 1.55; margin-bottom: 1.1rem; }
.q-hint { font-size: 0.9rem; color: var(--muted); font-weight: 600; margin-bottom: 0.6rem; }
.q-options { display: grid; gap: 0.6rem; margin: 0; padding: 0; border: 0; }
.q-option { display: flex; align-items: flex-start; gap: 0.8rem; border: 2px solid var(--line); border-radius: 12px; padding: 0.85rem 0.95rem; cursor: pointer; background: #fff; min-height: 56px; position: relative; }
.q-option:hover { border-color: #9DB6C1; }
.q-option input { position: absolute; opacity: 0; pointer-events: none; }
.q-option .mark { flex: none; width: 1.6rem; height: 1.6rem; padding: 0; background: var(--marker-soft); border: 2px solid #8FA3AF; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-top: 0.05rem; }
.q-option.is-multi .mark { border-radius: 6px; }
.q-option .text { flex: 1; font-size: 1.02rem; }
.q-option:has(input:checked) { border-color: var(--teal); background: #EEF8F9; }
.q-option:has(input:checked) .mark { background: var(--teal); border-color: var(--teal); color: #fff; }
.q-option:has(input:focus-visible) { outline: 3px solid var(--marker); outline-offset: 2px; }
.q-option.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.q-option.is-correct .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.q-option.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.q-option.is-wrong .mark { background: var(--bad); border-color: var(--bad); color: #fff; }
.q-option.is-static { cursor: default; }
.q-option .tag { font-size: 0.78rem; font-weight: 700; white-space: nowrap; align-self: center; }
.q-option.is-correct .tag { color: var(--ok); }
.q-option.is-wrong .tag { color: var(--bad); }
.rationale { border-left: 5px solid var(--teal); background: #F1F8F9; border-radius: 0 10px 10px 0; padding: 0.9rem 1.1rem; margin-top: 1rem; }
.rationale h4 { font-size: 0.95rem; margin: 0 0 0.3rem; }
.rationale p { font-family: var(--font-read); font-size: 1.05rem; margin: 0 0 0.6rem; }
.rationale p:last-child { margin-bottom: 0; }
.q-tools { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid #E7EEF2; }
.q-tool { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 99px; padding: 0.4rem 0.85rem; font-size: 0.875rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 40px; }
.q-tool:hover { border-color: #9DB6C1; }
.q-tool[aria-pressed="true"] { background: var(--marker-soft); border-color: #E0BE3C; }
.q-bar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.q-count { font-weight: 700; white-space: nowrap; }
.q-dots { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.q-dot { width: 2.3rem; height: 2.3rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 0.875rem; color: var(--ink); display: grid; place-items: center; padding: 0; }
.q-dot.is-answered { background: var(--mist); border-color: #A9CCD4; }
.q-dot.is-current { border: 2px solid var(--ink); }
.q-dot.is-review { box-shadow: inset 0 -4px 0 var(--marker); }
.q-footer { position: sticky; bottom: 58px; background: rgba(246, 249, 250, 0.96); backdrop-filter: blur(6px); padding: 0.75rem 0; margin-top: 1rem; display: flex; gap: 0.6rem; z-index: 5; }
@media (min-width: 992px) { .q-footer { bottom: 0; } }
.q-footer .btn { flex: 1; min-height: 50px; }
@media (min-width: 768px) { .q-footer .btn { flex: none; min-width: 150px; } .q-footer .spacer { flex: 1; } }
.score-ring { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: conic-gradient(var(--ring-color, var(--teal)) calc(var(--pct) * 1%), var(--mist) 0); }
.score-ring > div { width: 118px; height: 118px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.score-ring strong { font-size: 2rem; line-height: 1; letter-spacing: -0.03em; display: block; }
.score-ring span { font-size: 0.8rem; color: var(--muted); }
.mode-card { display: block; width: 100%; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 1.15rem; height: 100%; color: inherit; }
.mode-card:hover { border-color: var(--teal); }
.mode-card h3 { font-size: 1.1rem; margin: 0.4rem 0 0.2rem; }
.mode-card .n { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }

/* ---------- admin ---------- */
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; background: #fff; }
.matrix th, .matrix td { border-bottom: 1px solid #E7EEF2; padding: 0.55rem 0.7rem; text-align: center; white-space: nowrap; }
.matrix thead th { position: sticky; top: 0; background: #F1F6F8; z-index: 3; font-size: 0.85rem; border-bottom: 1px solid var(--line); }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 2; white-space: normal; min-width: 240px; max-width: 420px; border-right: 1px solid var(--line); }
.matrix thead th:first-child { background: #F1F6F8; z-index: 4; }
.matrix tr.row-group td { background: var(--ink); color: #fff; font-weight: 700; text-align: left; position: static; }
.matrix tr.row-course td:first-child { font-weight: 700; }
.matrix tr.row-lesson td:first-child { padding-left: 1.8rem; font-size: 0.93rem; }
.matrix tr.row-lesson.is-inherit td:not(:first-child) { background: #F7FAFB; }
.matrix input[type="checkbox"] { width: 1.3rem; height: 1.3rem; accent-color: var(--teal); }
.matrix-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: 12px; }
.opt-row { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.55rem; }
.opt-row .opt-correct { flex: none; padding-top: 0.55rem; min-width: 5.6rem; }
.opt-row textarea { flex: 1; }
.rich-editor { background: #fff; border-radius: 0 0 8px 8px; min-height: 240px; font-family: var(--font-read); font-size: 1.05rem; }
.ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; border-color: #B9C9D1; background: #F1F6F8; font-family: var(--font-ui); }
.ql-container.ql-snow { border-color: #B9C9D1; }
.ql-editor { min-height: 240px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.filter-bar .form-control, .filter-bar .form-select { width: auto; min-width: 150px; padding: 0.45rem 0.7rem; }
.filter-bar .search { flex: 1; min-width: 200px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 1.3rem; }
.bars .bar { flex: 1; background: var(--teal); border-radius: 5px 5px 0 0; min-height: 2px; position: relative; }
.bars .bar span { position: absolute; top: -1.25rem; left: 50%; transform: translateX(-50%); font-size: 0.72rem; font-weight: 600; white-space: nowrap; color: var(--ink); }
.bars-x { display: flex; gap: 6px; font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }
.bars-x span { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; }
.steps { display: flex; gap: 0.4rem; list-style: none; margin: 0 0 1.5rem; padding: 0; flex-wrap: wrap; }
.steps li { flex: 1; min-width: 90px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); border-top: 4px solid var(--line); padding-top: 0.4rem; }
.steps li.done { border-color: var(--ok); color: var(--ink); }
.steps li.current { border-color: var(--marker); color: var(--ink); }
.settings-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.settings-tabs a { padding: 0.6rem 0.9rem; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.settings-tabs a.active { color: var(--ink); border-color: var(--marker); }
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 0.35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
code.copy { background: var(--mist); color: var(--ink); padding: 0.25rem 0.5rem; border-radius: 6px; word-break: break-all; font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .shell-side, .topbar, .tabbar, .site-nav, .site-footer, .q-footer, .q-tools { display: none !important; } .shell-content { padding: 0; } }
