/* ORBIT Teaching Hub — สไตล์หลัก */
:root {
  --bg: #f5f6fb;
  --card: #ffffff;
  --ink: #151a30;
  --muted: #586079;
  --line: #e1e5ef;
  --brand: #1c2150;
  --brand-2: #3b4bd8;
  --ok: #0f7a4a;
  --ok-bg: #e5f6ee;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --warn: #8a5a00;
  --warn-bg: #fff6dc;
  --network: #0e7490;
  --network-bg: #e3f5f9;
  --ai: #6d28d9;
  --ai-bg: #f0eafd;
  --os: #c2410c;
  --os-bg: #fdeee6;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 26, 60, .06), 0 6px 20px rgba(20, 26, 60, .06);
  --fs: 17px;
  font-family: "Noto Sans Thai", "Sarabun", "Leelawadee UI", "Leelawadee", "Tahoma", system-ui, sans-serif;
}
html.big { --fs: 21px; }
* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.7; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand-2); }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: radial-gradient(circle at 30% 30%, #6b7cff, var(--brand) 70%); box-shadow: 0 0 0 4px #e6e9ff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text small { color: var(--muted); font-size: .8rem; }
.mainnav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mainnav a { text-decoration: none; color: var(--ink); padding: 8px 14px; border-radius: 999px; font-weight: 600; }
.mainnav a:hover { background: #eef0f8; }
.mainnav a.active { background: var(--brand); color: #fff; }
.font-toggle { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.font-toggle[aria-pressed="true"] { background: #fff4d6; border-color: #f0c35a; }

/* ---------- Layout ---------- */
.main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 20px 56px; }
.main:focus { outline: none; }
.footer { border-top: 1px solid var(--line); background: #fff; }
.footer-in { max-width: 1120px; margin: 0 auto; padding: 16px 20px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.footer-in p { margin: 0; }

.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 36px 32px; color: #fff;
  background: radial-gradient(800px 300px at 90% -20%, rgba(124,140,255,.55), transparent 60%),
              radial-gradient(500px 260px at -10% 120%, rgba(14,116,144,.55), transparent 60%),
              linear-gradient(135deg, #171b45, #2a2f7a); }
.hero h1 { font-size: 2.1rem; margin-bottom: .3em; }
.hero p { color: #dfe3ff; max-width: 640px; }
.hero .orbit { position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.18); }
.hero .orbit::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #ffd166; left: 30px; top: 60px; box-shadow: 0 0 18px #ffd166; }
.steps { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding: 0; list-style: none; }
.steps li { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 6px 14px; font-size: .9rem; }
.hero-search { display: flex; gap: 8px; margin-top: 22px; max-width: 560px; }
.hero-search input { flex: 1; min-width: 0; }

/* ---------- Inputs & buttons ---------- */
input[type="search"], input[type="text"], select { font: inherit; font-size: .95rem; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); min-height: 46px; }
input:focus, select:focus { border-color: var(--brand-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: .95rem; padding: 10px 18px; min-height: 46px;
  border-radius: 12px; border: 1px solid transparent; background: var(--brand-2); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.07); }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn[disabled], .btn.disabled { background: #eceef4; color: #7b8197; border-color: #dfe2ea; cursor: not-allowed; filter: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Badges & notices ---------- */
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; line-height: 1.6; }
.badge.sample { background: var(--warn-bg); color: var(--warn); border-color: #f2d68a; }
.badge.teacher { background: var(--ok-bg); color: var(--ok); border-color: #a9dfc4; }
.badge.pending { background: #eef0f5; color: #555c72; border-color: #d6dae4; }
.badge.external { background: #e8efff; color: #2346b8; border-color: #c3d2fb; }
.badge.done { background: var(--ok-bg); color: var(--ok); }
.badge.type { background: #f1f2f7; color: var(--ink); }
.notice { border-radius: 12px; padding: 12px 16px; border: 1px solid var(--line); background: #fff; margin: 12px 0; }
.notice.warn { background: var(--warn-bg); border-color: #f2d68a; color: #5e3e00; }
.notice.info { background: #eef3ff; border-color: #c9d6fb; color: #1f3a8a; }
.notice.ok { background: var(--ok-bg); border-color: #a9dfc4; color: #0b5d39; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.card h3 { margin: 0; }
.card .grow { flex: 1; }
.card-link { text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(20,26,60,.12); }
.meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.subject-card { border-top: 6px solid var(--c, var(--brand-2)); }
.subject-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem; background: var(--cbg, #eef); }
.c-network { --c: var(--network); --cbg: var(--network-bg); }
.c-ai { --c: var(--ai); --cbg: var(--ai-bg); }
.c-os { --c: var(--os); --cbg: var(--os-bg); }
.progressbar { height: 8px; background: #edf0f6; border-radius: 999px; overflow: hidden; }
.progressbar span { display: block; height: 100%; background: var(--c, var(--brand-2)); border-radius: 999px; }

.subject-head { border-radius: 20px; padding: 26px; background: var(--cbg); border: 1px solid var(--line); display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.subject-head .subject-icon { background: #fff; width: 64px; height: 64px; font-size: 2rem; }
.subject-head h1 { color: var(--c); margin-bottom: .2em; }
.subject-head .info { flex: 1; min-width: 240px; }

.lesson-list { display: grid; gap: 12px; counter-reset: l; }
.lesson-item { display: flex; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.lesson-item:hover { border-color: var(--c); }
.lesson-num { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--cbg); color: var(--c); font-weight: 800; display: grid; place-items: center; }
.lesson-item .body { flex: 1; min-width: 0; }
.lesson-item .body p { margin: 0; color: var(--muted); font-size: .92rem; }
.lesson-item .go { color: var(--c); font-weight: 700; white-space: nowrap; }

/* ---------- Lesson ---------- */
.lesson-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.lesson-wrap aside { position: sticky; top: 84px; display: grid; gap: 12px; }
.keypoints { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.keypoints li { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 12px; padding: 12px 16px; }
.toc { padding-left: 1.2em; margin: 0; }
.toc li { margin: 4px 0; }

.activity { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 16px 0; box-shadow: var(--shadow); scroll-margin-top: 90px; }
.activity-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.activity-head h3 { margin: 0; }
.kind { font-size: .78rem; font-weight: 700; color: var(--c); text-transform: none; letter-spacing: .02em; }
.q { border-top: 1px dashed var(--line); padding-top: 14px; margin-top: 14px; }
.q:first-of-type { border-top: 0; margin-top: 4px; padding-top: 0; }
.q-title { font-weight: 700; margin-bottom: 8px; }
.options { display: grid; gap: 8px; }
.opt { text-align: left; font: inherit; font-size: .95rem; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fafbfe; cursor: pointer; color: var(--ink); min-height: 46px; }
.opt:hover { border-color: #b9c2dd; }
.opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.feedback { margin-top: 8px; padding: 8px 12px; border-radius: 10px; font-size: .92rem; }
.feedback:empty { display: none; }
.feedback.ok { background: var(--ok-bg); color: #0b5d39; }
.feedback.bad { background: var(--bad-bg); color: #8a1c13; }

.match-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); gap: 10px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--line); }
.match-row:first-child { border-top: 0; }
.match-row select { width: 100%; }
.match-row.correct select { border-color: var(--ok); background: var(--ok-bg); }
.match-row.wrong select { border-color: var(--bad); background: var(--bad-bg); }
.match-row .explain { grid-column: 1 / -1; font-size: .88rem; color: var(--ok); }
.match-row .explain:empty { display: none; }

.order-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.order-list li { display: flex; align-items: center; gap: 10px; background: #fafbfe; border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px 8px 14px; }
.order-list li.correct { border-color: var(--ok); background: var(--ok-bg); }
.order-list li.wrong { border-color: var(--bad); background: var(--bad-bg); }
.order-list .pos { font-weight: 800; color: var(--c); width: 1.6em; }
.order-list .txt { flex: 1; }
.order-list .mv { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; }
.order-list .mv[disabled] { opacity: .35; cursor: default; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.tool-grid div { background: #f6f8fc; border-radius: 10px; padding: 8px 12px; }
.tool-grid dt { font-size: .8rem; color: var(--muted); }
.tool-grid dd { margin: 0; font-weight: 700; font-family: Consolas, "Courier New", monospace; word-break: break-all; }
.tool-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tool-form input { width: 200px; }

/* ---------- Library ---------- */
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.filters .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input[type="search"] { flex: 1; min-width: 220px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: .88rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; min-height: 38px; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; }
.check input { width: 20px; height: 20px; }
.result-count { margin: 14px 0 8px; color: var(--muted); }
.res-card .res-title { font-weight: 700; font-size: 1.02rem; }
.res-card .note { font-size: .88rem; color: var(--muted); }
.empty { text-align: center; padding: 32px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* ---------- Works ---------- */
.profile { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.avatar { width: 96px; height: 96px; border-radius: 50%; background: #eceff7; display: grid; place-items: center; font-size: 2.2rem; color: #8b92aa; border: 2px dashed #c9cfdf; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.placeholder { color: #8b92aa; font-style: italic; }
.work-card.example { border-style: dashed; background: #fcfcfe; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .lesson-wrap { grid-template-columns: 1fr; }
  .lesson-wrap aside { position: static; order: -1; }
}
@media (max-width: 600px) {
  :root { --fs: 16px; }
  html.big { --fs: 19px; }
  .topbar { position: static; }
  .topbar-in { padding: 8px 14px; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; }
  .mainnav { width: 100%; justify-content: space-between; }
  .mainnav a { padding: 6px 10px; }
  .main { padding: 16px 14px 40px; }
  .hero { padding: 26px 20px; border-radius: 18px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-search { flex-direction: column; }
  h1 { font-size: 1.45rem; }
  .match-row { grid-template-columns: 1fr; }
  .activity { padding: 16px; }
  .lesson-item { padding: 12px; gap: 12px; }
  .lesson-item .go { display: none; }
  .tool-form input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- วิชาเพิ่ม ---------- */
:root { --media: #be185d; --media-bg: #fdeaf3; --aig: #2563eb; --aig-bg: #e7eefe; }
.c-media { --c: var(--media); --cbg: var(--media-bg); }
.c-aig { --c: var(--aig); --cbg: var(--aig-bg); }

/* ---------- ข้อมูลวิชา ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 8px 0 0; }
.facts div { background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; }
.facts dt { font-size: .75rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-size: .92rem; }
.unit-actions { display: flex; gap: 6px; flex-wrap: wrap; flex: none; }
.unit-link { color: inherit; text-decoration: none; }
.unit-link:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; margin: 10px 0; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; background: #fff; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--cbg, #f1f3f9); color: var(--ink); }
.calendar summary, .plan-box summary { cursor: pointer; }
.plan-box { margin-top: 14px; }
.plan-box ul { margin: 8px 0 0; padding-left: 1.2em; }
.concept { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 12px 0; box-shadow: var(--shadow); }
.concept h3 { color: var(--c); }
.concept ul { margin: 0; padding-left: 1.3em; }
.concept li { margin: 3px 0; }
.example { border-left: 5px solid var(--c); }
.task { border: 2px dashed var(--c); }
.task ol { margin: 0; padding-left: 1.3em; }
.refs { padding-left: 1.3em; font-size: .9rem; color: var(--muted); }
.media-item .btn { width: 100%; justify-content: flex-start; text-align: left; }

/* ---------- กิจกรรมแบบใหม่ ---------- */
.scenario { background: var(--cbg, #f4f6fb); border-radius: 12px; padding: 12px 16px; margin: 6px 0 12px; }
.multi-list { display: grid; gap: 8px; margin-bottom: 12px; }
.multi-row { display: block; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fafbfe; cursor: pointer; }
.multi-row label, .multi-row > span { cursor: pointer; }
.multi-row input { width: 20px; height: 20px; vertical-align: middle; margin-right: 8px; }
.multi-row.correct { border-color: var(--ok); background: var(--ok-bg); }
.multi-row.wrong { border-color: var(--bad); background: var(--bad-bg); }
.multi-row.missed { border-color: #d97706; background: var(--warn-bg); }
.why { font-size: .88rem; margin-top: 4px; }
.why:empty { display: none; }
.prompt-preview { font-family: Consolas, "Courier New", monospace; background: #111827; color: #e5e7eb; border-radius: 12px; padding: 12px 16px; margin: 12px 0; white-space: pre-wrap; font-size: .9rem; }
.bad-text { color: var(--bad) !important; }

/* ---------- สไลด์ ---------- */
body.deck-open .main { max-width: 1280px; }
.deck { display: flex; flex-direction: column; gap: 10px; }
.deck-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.deck-title { font-weight: 700; flex: 1; min-width: 160px; }
.deck-count { font-weight: 700; color: var(--c); min-width: 4em; text-align: center; }
.deck-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.deck-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; container-type: inline-size; background: #0f1330; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); cursor: pointer; }
.slide { position: absolute; inset: 0; display: none; flex-direction: column; background: #fff; padding: 4.2cqw 5cqw 2.4cqw; font-size: 2.05cqw; line-height: 1.5; color: var(--ink); cursor: default; }
.slide.active { display: flex; }
.slide::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1cqw; background: var(--c); }
.slide-body { flex: 1; min-height: 0; overflow: hidden; }
.slide h2 { font-size: 3.6cqw; color: var(--c); margin: 0 0 1.2cqw; }
.slide h3 { font-size: 2.4cqw; margin: 0 0 .6cqw; }
.slide .lead { font-size: 2.2cqw; margin: 0 0 1.2cqw; color: #333a55; }
.slide-list { margin: 0; padding-left: 1.3em; }
.slide-list li { margin: .5cqw 0; }
.slide-list small { color: var(--muted); }
.slide .small-list { font-size: 1.8cqw; }
.slide table { font-size: 1.7cqw; }
.slide th, .slide td { padding: .55cqw .9cqw; }
.slide .table-wrap { overflow: hidden; }
.slide-foot { display: flex; justify-content: space-between; font-size: 1.4cqw; color: var(--muted); border-top: 1px solid var(--line); padding-top: .8cqw; }
.slide-cover { background: linear-gradient(135deg, #171b45, #2a2f7a); color: #fff; }
.slide-cover::before { width: 100%; height: 1cqw; bottom: auto; }
.slide-cover .slide-foot { color: #c7cdfa; border-color: rgba(255,255,255,.2); }
.slide-title { display: flex; flex-direction: column; justify-content: center; height: 100%; }
.slide-title .eyebrow { font-size: 1.8cqw; color: #c7cdfa; }
.slide-title h2 { color: #fff; font-size: 4.8cqw; line-height: 1.25; margin: 1cqw 0; }
.slide-title p { font-size: 2.2cqw; color: #dfe3ff; max-width: 80%; }
.chips-row { display: flex; gap: 1cqw; flex-wrap: wrap; }
.chips-row span { border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: .2cqw 1.4cqw; font-size: 1.6cqw; }
.big-q { margin-top: 2cqw; font-size: 2.3cqw; background: rgba(255,209,102,.18); border-left: .6cqw solid #ffd166; padding: 1cqw 1.6cqw; border-radius: .8cqw; }
.slide-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4cqw; }
.slide-cards div { background: var(--cbg); border-radius: 1cqw; padding: 1.2cqw 1.6cqw; }
.slide-cards p { margin: .3cqw 0 0; font-size: 1.75cqw; }
.slide-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; }
.slide-cols p { font-size: 1.9cqw; }
.slide-ref { position: absolute; bottom: 4.6cqw; left: 5cqw; right: 5cqw; font-size: 1.4cqw; color: var(--muted); margin: 0; }
.deck-hint { color: var(--muted); }
.deck:fullscreen { background: #0f1330; padding: 0; justify-content: center; }
.deck:fullscreen .deck-bar, .deck:fullscreen .deck-hint { display: none; }
.deck:fullscreen .deck-stage { border-radius: 0; width: min(100vw, calc(100vh * 16 / 9)); margin: auto; }
.deck.deck-max { position: fixed; inset: 0; z-index: 100; background: #0f1330; padding: 6px; gap: 6px; }
.deck.deck-max .deck-hint { display: none; }
.deck.deck-max .deck-bar { color: #fff; }
.deck.deck-max .deck-count { color: #fff; }
.deck.deck-max .deck-stage { border-radius: 0; width: min(100%, calc((100vh - 64px) * 16 / 9)); margin: 0 auto; }

/* ---------- Responsive (เพิ่ม) ---------- */
@media (max-width: 600px) {
  .lesson-item { flex-wrap: wrap; }
  .unit-actions { width: 100%; }
  .unit-actions .btn { flex: 1; }
  .deck-title { order: -1; flex-basis: 100%; }
  .deck-tools { width: 100%; }
  .deck-tools .btn { flex: 1; padding: 6px 8px; }
  /* มือถือ: สไลด์ยืดตามเนื้อหาและใช้ตัวอักษรขนาดอ่านได้ แทนการย่อทั้งหน้า 16:9 */
  .deck-stage { aspect-ratio: auto; min-height: 56vw; }
  .slide { position: relative; inset: auto; font-size: .92rem; padding: 18px 16px 10px 22px; min-height: 56vw; }
  .slide::before { width: 6px; }
  .slide-cover::before { width: 100%; height: 6px; }
  .slide-body { overflow: visible; }
  .slide h2 { font-size: 1.2rem; margin-bottom: 8px; }
  .slide h3, .slide .lead, .slide-title p, .big-q { font-size: .95rem; }
  .slide-title h2 { font-size: 1.45rem; }
  .slide-title .eyebrow, .chips-row span, .slide-foot, .slide-ref { font-size: .75rem; }
  .slide table, .slide-cards p, .slide .small-list, .slide-cols p { font-size: .82rem; }
  .slide th, .slide td { padding: 4px 6px; }
  .slide .table-wrap { overflow-x: auto; }
  .slide-cards, .slide-cols { grid-template-columns: 1fr; gap: 8px; }
  .slide-cards div { padding: 8px 10px; border-radius: 8px; }
  .slide-list li { margin: 4px 0; }
  .slide-ref { position: static; margin-top: 8px; }
  .slide-foot { padding-top: 6px; margin-top: 8px; }
  .big-q { margin-top: 10px; padding: 8px 10px; }
  .chips-row { gap: 6px; }
  .chips-row span { padding: 2px 8px; }
}

/* ---------- พิมพ์ ---------- */
@media print {
  .topbar, .footer, .btn, .filters, .deck-bar, .deck-hint, .crumbs { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .lesson-wrap { grid-template-columns: 1fr; }
  .lesson-wrap aside { display: none; }
  body.deck-open .main { padding: 0; }
  body.deck-open .deck-stage { aspect-ratio: auto; background: none; border-radius: 0; box-shadow: none; overflow: visible; container-type: normal; }
  body.deck-open .slide { display: flex !important; position: relative; width: 100%; height: 100vh; page-break-after: always; break-after: page; font-size: 12.5pt; padding: 1.6cm 2cm 1cm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.deck-open .slide:last-child { page-break-after: auto; break-after: auto; }
  body.deck-open .slide::before { width: 8px; }
  body.deck-open .slide-cover::before { width: 100%; height: 8px; }
  body.deck-open .slide h2 { font-size: 22pt; }
  body.deck-open .slide-title h2 { font-size: 30pt; }
  body.deck-open .slide h3, body.deck-open .slide .lead, body.deck-open .slide-title p, body.deck-open .big-q { font-size: 14pt; }
  body.deck-open .slide table, body.deck-open .slide-cards p, body.deck-open .small-list, body.deck-open .slide-cols p { font-size: 11pt; }
  body.deck-open .slide-foot, body.deck-open .slide-ref, body.deck-open .slide-title .eyebrow, body.deck-open .chips-row span { font-size: 9pt; }
  body.deck-open .slide-ref { position: static; margin-top: 8pt; }
  body.deck-open .slide { page: deckpage; }
}
@page { margin: 1.4cm; }
@page deckpage { size: A4 landscape; margin: 0; }

/* ---------- ชุดสไลด์ PowerPoint / PDF ของหน่วย (เพิ่ม 2 ธ.ค. 69) ---------- */
.deck-panel { flex-direction: row; align-items: center; gap: 20px; margin: 14px 0 6px; border-left: 6px solid var(--c, var(--brand-2)); }
.deck-panel h2 { margin: 0 0 2px; font-size: 1.2rem; }
.deck-cover { flex: none; display: block; line-height: 0; }
.deck-cover img, .deck-card img { width: 100%; max-width: 320px; height: auto; aspect-ratio: 16 / 9; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.deck-cover img { width: 240px; }
.deck-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.deck-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.deck-btn { flex-direction: column; align-items: flex-start; gap: 0; min-height: 56px; padding: 8px 16px; text-align: left; line-height: 1.3; }
.deck-btn small { font-weight: 400; font-size: .8rem; opacity: .9; }
.btn:focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; box-shadow: 0 0 0 5px rgba(245, 158, 11, .25); }
.deck-card img { max-width: none; }
td .unit-actions { min-width: 210px; }
@media (min-width: 701px) { table.stack-sm td[data-label="หน่วย"], table.stack-sm td[data-label="วันที่"] { white-space: nowrap; } table.stack-sm td .unit-actions { flex-wrap: nowrap; } }
@media (max-width: 700px) {
  .deck-panel { flex-direction: column; align-items: stretch; }
  .deck-cover img { width: 100%; }
  .deck-btns { flex-direction: column; }
  .deck-btn { width: 100%; min-height: 58px; }
  .unit-actions .btn.small { min-height: 44px; }
}
.unit-actions .btn.small { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* ตารางคาบของกลุ่ม: จอเล็กแสดงเป็นการ์ดรายสัปดาห์ ปุ่มอยู่ในจอไม่ต้องเลื่อนข้าง */
@media (max-width: 700px) {
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack-sm tr { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  table.stack-sm td { border: 0; padding: 2px 8px; }
  table.stack-sm td[data-label] { display: inline-block; width: auto; font-weight: 600; }
  table.stack-sm td[data-label="สัปดาห์"]::before { content: "สัปดาห์ "; }
  table.stack-sm td[data-label="วันที่"] { font-weight: 400; color: var(--muted, #555); }
  table.stack-sm .td-actions { margin-top: 8px; }
  table.stack-sm td .unit-actions { min-width: 0; }
  table.stack-sm .unit-actions .btn { flex: 1 1 0; }
}

/* ---------- ปรับ UX/UI รอบที่ 2: เป้าหมายกดขั้นต่ำ 44px, เมนูบนมือถือ, โฟกัสชัด ---------- */
.mainnav a { min-height: 44px; display: inline-flex; align-items: center; }
.font-toggle { min-height: 44px; }
.card-link:focus-visible, .deck-btn:focus-visible { outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
.muted, .small { text-wrap: pretty; }
@media (max-width: 600px) {
  .topbar-in { padding: 8px 12px; gap: 8px; }
  .mainnav { width: 100%; justify-content: space-between; gap: 2px; }
  .mainnav a { padding: 8px 10px; font-size: .92rem; }
  .font-toggle { padding: 8px 10px; }
  .main { padding: 16px 12px 40px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
#reset-progress { min-height: 44px; }

/* ---------- ปรับหน้าตารอบที่ 3: การ์ดวิชาเด่นขึ้น เน้นสีตามวิชา ---------- */
body { background: linear-gradient(180deg, #eef1ff 0, var(--bg) 340px); }
.hero { padding: 48px 44px; border-radius: 28px; box-shadow: 0 18px 40px rgba(28, 33, 80, .25); }
.hero h1 { font-size: 2.6rem; letter-spacing: -.01em; }
.hero p { font-size: 1.08rem; }
.grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.subject-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-top: 0; padding: 26px 24px 22px;
  background: linear-gradient(180deg, var(--cbg, #fff) 0, #fff 62%); transition: transform .15s ease, box-shadow .15s ease; }
.subject-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--c, var(--brand-2)); }
.subject-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(20, 26, 60, .14); }
.subject-card .subject-icon { width: 64px; height: 64px; font-size: 2rem; background: #fff; box-shadow: 0 4px 12px rgba(20,26,60,.10); }
.subject-card h3 { font-size: 1.2rem; color: var(--c, var(--ink)); }
.subject-card .small.muted { font-size: .92rem; }
@media (max-width: 600px) { .hero { padding: 26px 20px; } .hero h1 { font-size: 1.7rem; } .subject-card { padding: 20px 18px; } }

/* ---------- ปรับรอบที่ 4: เป้าหมายกดขั้นต่ำ 44px บนมือถือทุกหน้า ---------- */
@media (max-width: 600px) {
  a, button, .chip, .btn, .btn.small, .box, summary { min-height: 44px !important; }
  .box { height: auto; min-height: 44px !important; }
  .skip { min-height: 0; }
  .toc a, .crumbs a, .mainnav a, .lib-filter a, .res-card a { min-height: 44px; }
}
@media (max-width: 600px) { a.unit-link { display: block; min-height: 44px; padding: 10px 0; } }
@media (max-width: 600px) { a[href^="#sec-"], .toc a, .jump a, .unit-jump a { display: inline-flex; align-items: center; min-height: 44px; } }

/* ===== เข้าสู่ระบบด้วยเลขนักศึกษา + ห้องของฉัน (v11) ===== */
.login-wrap{display:grid;place-items:center;min-height:62vh;padding:24px 0}
.login-card{width:min(440px,100%);padding:28px;text-align:left;display:grid;gap:10px}
.login-card h1{margin:0;font-size:1.9rem}
.login-mark{font-size:2.2rem;line-height:1}
#login-form{display:grid;gap:12px;margin-top:6px}
#login-id{font-size:1.4rem;letter-spacing:.06em;padding:12px 14px;min-height:52px;border:2px solid #c9cbe0;border-radius:12px;width:100%;box-sizing:border-box}
#login-id:focus{outline:3px solid #5b63e6;outline-offset:2px;border-color:#5b63e6}
#login-btn{min-height:52px;font-size:1.1rem;width:100%}
.login-msg{min-height:1.4em;margin:0;color:#b42318;font-weight:600}
.login-card .check{display:flex;gap:8px;align-items:center;min-height:44px}
.userbar{display:inline-flex;gap:8px;align-items:center;flex-wrap:wrap}
.user-chip{font-size:.9rem;background:#eef0ff;color:#2b2f7a;border-radius:999px;padding:6px 12px;min-height:32px;display:inline-flex;align-items:center}
#logout-btn{min-height:44px}
.my-room .week-card{display:flex;flex-direction:column;gap:6px;border-top:6px solid var(--c)}
.my-room .week-card h3{margin:4px 0 0}
.my-room .week-card h3 a{color:var(--c);text-decoration:none}
.week-tag{margin:0;font-weight:700}
.week-unit{margin:0;font-size:1.08rem}
.my-room .btn-row .btn{min-height:44px}
@media (max-width:600px){
  .userbar{width:100%;justify-content:space-between}
  .user-chip{flex:1 1 auto}
  .login-card{padding:20px}
}

/* ===== ผู้เยี่ยมชม (v12) ===== */
.login-or{display:flex;align-items:center;gap:10px;color:#6b6f86;font-size:.95rem;margin-top:4px}
.login-or::before,.login-or::after{content:"";flex:1;height:1px;background:#d9dbe8}
#guest-btn{min-height:48px;width:100%}
#login-open-btn{min-height:44px}
.guest-note{margin-top:16px}

/* ===== เมนูโปรไฟล์มุมขวาบน (v13) ===== */
.profile{position:relative;margin-left:auto}
.profile-btn{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:4px 12px 4px 4px;border:1px solid #d9dbe8;border-radius:999px;background:#fff;font:inherit;color:#1d2142;cursor:pointer;max-width:240px}
.profile-btn:hover{border-color:#5b63e6}
.profile-btn:focus-visible{outline:3px solid #5b63e6;outline-offset:2px}
.avatar-sm{width:34px;height:34px;border-radius:50%;background:#5b63e6;color:#fff;display:grid;place-items:center;font-weight:700;flex:none}
.profile-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.profile-panel{position:absolute;right:0;top:calc(100% + 8px);width:320px;max-width:calc(100vw - 24px);z-index:50;padding:16px;display:grid;gap:10px;box-shadow:0 12px 32px rgba(20,24,60,.18);text-align:left}
.profile-panel[hidden]{display:none}
.profile-title{margin:0;font-weight:700;font-size:1.1rem}
.profile-facts{margin:0;display:grid;gap:6px}
.profile-facts div{display:grid;grid-template-columns:96px 1fr;gap:8px}
.profile-facts dt{color:#6b6f86}
.profile-facts dd{margin:0;font-weight:600;word-break:break-all}
.profile-name-form{display:grid;gap:6px}
.profile-name-form .row{display:flex;gap:6px}
.profile-name-form input,#login-name{flex:1;min-height:44px;padding:8px 12px;border:2px solid #c9cbe0;border-radius:10px;font:inherit;box-sizing:border-box;width:100%}
.profile-name-form .btn{min-height:44px}
.profile-stats{display:grid;gap:8px;border-top:1px solid #e6e7f0;padding-top:8px}
.profile-stats p{margin:0}
.profile-stat{display:grid;grid-template-columns:1fr auto;gap:2px 8px;font-size:.92rem}
.profile-stat .progressbar{grid-column:1/-1}
.profile-panel > .btn{min-height:44px;width:100%}
@media (max-width:600px){
  .profile{margin-left:0;width:100%}
  .profile-btn{width:100%;max-width:none}
  .profile-panel{left:0;right:0;width:auto}
}

/* =====================================================================
   รีดีไซน์ v14 "สมุดแล็บ" (ใช้สกิล redesign-skill + frontend-design)
   แนวคิด: กระดาษกราฟจาง หมึกน้ำเงินเข้ม ปากกาเน้นข้อความสีเหลืองใช้เฉพาะจุดสำคัญ
   การ์ดวิชาเป็นแฟ้มมีแถบดัชนีสีตามวิชา · ฟอนต์ Anuphan (OFL) เก็บในเว็บ ไม่โหลดจากภายนอก
   ===================================================================== */
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/anuphan-thai.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/anuphan-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --paper: #f4f6f5; --ink: #18233a; --ink-2: #2b3a5c; --muted: #55607a; --line: #dbe1e8;
  --hl: #ffd43b; --hl-soft: #fff3bf; --brand: #18233a; --brand-2: #2f4fb8;
  --shadow: 0 1px 0 rgba(24,35,58,.05), 0 8px 22px -12px rgba(24,35,58,.28);
  --shadow-lift: 0 2px 0 rgba(24,35,58,.06), 0 18px 34px -14px rgba(24,35,58,.38);
  --radius: 14px;
  font-family: "Anuphan", "Leelawadee UI", "Leelawadee", "Tahoma", system-ui, sans-serif;
  font-feature-settings: "tnum" 0;
}
body {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(43,58,92,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43,58,92,.055) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
}
h1, h2 { letter-spacing: -.012em; font-weight: 700; }
h3 { font-weight: 600; }
.small, .badge, .progressbar, .lesson-num, .deck-count { font-variant-numeric: tabular-nums; }
:focus-visible, .btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--hl); }

/* แถบบน */
.topbar { background: rgba(244,246,245,.94); border-bottom: 2px solid var(--ink); }
.brand-mark { border-radius: 10px; background: var(--ink); box-shadow: 4px 4px 0 var(--hl); font-size: 1.15rem; }
.brand-text strong { font-weight: 700; letter-spacing: -.01em; }
.mainnav a { border-radius: 10px; font-weight: 600; }
.mainnav a:hover { background: #e6eaf0; }
.mainnav a.active { background: var(--ink); color: #fff; box-shadow: inset 0 -4px 0 var(--hl); }
.font-toggle { border-radius: 10px; border-color: var(--line); }

/* hero: แผ่นหมึกน้ำเงินบนกระดาษกราฟ + ตราประทับสัปดาห์ */
.hero { background-color: var(--ink); color: #fff; border-radius: 22px 22px 22px 6px; padding: 44px 44px 40px;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px; box-shadow: 10px 10px 0 -2px var(--hl), var(--shadow-lift);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; margin: 6px 10px 18px 0; }
.hero > * { grid-column: 1; }
.hero .orbit { display: none; }
.hero h1 { font-size: 2.7rem; line-height: 1.2; letter-spacing: -.02em; max-width: 16ch; }
.hero p { color: #d6dcea; max-width: 58ch; font-size: 1.05rem; }
.hero p.small { color: #aeb8cf !important; }
.week-stamp { grid-column: 2; grid-row: 1 / span 4; align-self: start; display: grid; justify-items: center; gap: 2px;
  background: var(--hl); color: var(--ink); border-radius: 16px; padding: 16px 22px 14px; min-width: 150px;
  transform: rotate(2.5deg); box-shadow: 0 10px 0 -4px rgba(0,0,0,.25); }
.week-stamp span { font-weight: 600; font-size: .95rem; }
.week-stamp b { font-size: 4.2rem; line-height: .95; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.week-stamp small { font-size: .8rem; font-weight: 600; opacity: .8; }
.steps li { border-radius: 8px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.hero-search input { border: 0; border-radius: 10px; }
.hero-search .btn { background: var(--hl); color: var(--ink); }

/* ปุ่ม: ตอบสนองการกด */
.btn { border-radius: 10px; transition: background-color .18s ease, transform .12s ease, box-shadow .18s ease; background: var(--brand-2); }
.btn:hover { filter: none; background: #2541a0; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; border: 1.5px solid #c9d1dc; color: var(--ink); }
.btn.secondary:hover { background: #fff; border-color: var(--ink); }
.btn[disabled]:hover, .btn.disabled:hover { background: #eceef4; }

/* การ์ดทั่วไป: เงาสีหมึก มุมต่างกันตามลำดับชั้น */
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); }
.card-link:hover { box-shadow: var(--shadow-lift); }
.badge { border-radius: 6px; }
.notice { border-radius: 10px; }

/* การ์ดวิชา = แฟ้มมีแถบดัชนี */
.grid { gap: 30px 22px; }
.section > .grid, .my-room .grid { padding-top: 14px; }
.subject-card { overflow: visible; margin-top: 14px; border-radius: 4px 14px 14px 14px; background: #fff; border: 1px solid var(--line);
  border-left: 6px solid var(--c, var(--brand-2)); padding: 22px 22px 20px; }
.subject-card::before { content: ""; position: absolute; left: -6px; top: -16px; width: 96px; height: 16px; right: auto;
  background: var(--c, var(--brand-2)); border-radius: 8px 8px 0 0; }
.subject-card:hover { transform: translateY(-3px) rotate(-.3deg); }
.subject-card .subject-icon { width: 56px; height: 56px; border-radius: 12px; background: var(--cbg, #eef); box-shadow: none; }
.subject-card h3 { font-size: 1.22rem; line-height: 1.35; color: var(--ink); }
.subject-card strong[style] { color: var(--c) !important; }
.progressbar { height: 10px; border-radius: 3px; background: #e7ebf0; }
.progressbar span { border-radius: 3px; }

/* ห้องของฉัน: การ์ดสัปดาห์นี้ทำเหมือนกระดาษโน้ตที่แปะไว้ */
.my-room .week-card { border-top: 0; border-left: 6px solid var(--c); border-radius: 4px 14px 14px 14px; }
.week-tag { display: inline-block; justify-self: start; align-self: flex-start; background: var(--hl-soft); box-shadow: inset 0 -.55em 0 var(--hl); padding: 0 4px; border-radius: 2px; }

/* หน้าวิชาและรายการหน่วย */
.subject-head { border-radius: 4px 20px 20px 20px; border: 1px solid var(--line); border-left: 8px solid var(--c); background: #fff; box-shadow: var(--shadow); }
.subject-head .subject-icon { background: var(--cbg); }
.lesson-item { border-radius: 4px 12px 12px 4px; border-left: 4px solid var(--c); box-shadow: var(--shadow); transition: border-color .18s ease, box-shadow .18s ease; }
.lesson-item:hover { box-shadow: var(--shadow-lift); }
.lesson-num { border-radius: 8px; background: var(--ink); color: #fff; }
.keypoints li { border-radius: 4px 10px 10px 4px; }
.activity { border-radius: 4px 16px 16px 16px; border-top: 4px solid var(--c, var(--brand-2)); }
.deck-panel { border-radius: 4px 14px 14px 4px; }

/* แถบโปรไฟล์และหน้าเข้าสู่ระบบให้เข้าธีม */
.profile-btn { border-radius: 12px; border: 1.5px solid #c9d1dc; }
.profile-btn:hover { border-color: var(--ink); }
.avatar-sm { border-radius: 9px; background: var(--ink); box-shadow: 2px 2px 0 var(--hl); }
.profile-panel { border-radius: 4px 14px 14px 14px; border-top: 4px solid var(--ink); }
.login-card { border-radius: 4px 20px 20px 20px; border-top: 6px solid var(--ink); box-shadow: 10px 10px 0 -2px var(--hl), var(--shadow-lift); }
#login-id:focus, #login-name:focus { outline: 3px solid var(--ink); box-shadow: 0 0 0 6px var(--hl); border-color: var(--ink); }

.footer { background: transparent; border-top: 2px solid var(--ink); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 26px 20px 24px; margin-right: 8px; box-shadow: 6px 6px 0 -1px var(--hl), var(--shadow); }
  .hero h1 { font-size: 1.8rem; }
  .week-stamp { grid-column: 1; grid-row: auto; justify-self: start; grid-auto-flow: column; align-items: baseline; gap: 8px; padding: 8px 14px; min-width: 0; transform: rotate(-1deg); margin-bottom: 14px; order: -1; }
  .week-stamp b { font-size: 2rem; }
  .week-stamp small:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .lesson-item, .subject-card, .card-link { transition: none; }
  .subject-card:hover, .card-link:hover { transform: none; }
}
@media print { body { background: #fff; } .hero { box-shadow: none; } }
@media (max-width: 600px) {
  .topbar { position: static; }
  .profile { width: auto; flex: 1 1 170px; }
  .font-toggle { flex: none; }
  .profile-btn { width: 100%; }
}
