/* Fonts are stored in static/fonts so the site works without internet (offline-first). */
@font-face { font-family: "Kantumruy Pro"; font-weight: 400; font-display: swap; src: url("../fonts/kantumruy-pro-khmer-400-normal.woff2") format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 600; font-display: swap; src: url("../fonts/kantumruy-pro-khmer-600-normal.woff2") format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 700 800; font-display: swap; src: url("../fonts/kantumruy-pro-khmer-700-normal.woff2") format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("../fonts/nunito-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 600 700; font-display: swap; src: url("../fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("../fonts/nunito-latin-800-normal.woff2") format("woff2"); }

:root {
  --ink: #1d2433; --muted: #5d6677; --line: #e4e7ef; --bg: #ffffff; --tint: #f4f7fc;
  --brand: #6c4ee3; --brand-dark: #5539c7; --sun: #ffc93c;
  --radius: 16px;
}
* { box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: 17px/1.6 "Nunito", "Kantumruy Pro", "Noto Sans Khmer", "Khmer OS", system-ui, sans-serif;
}
body.lang-km { line-height: 1.8; }
.hero-inner > *, .subject-grid > *, .audience-grid > *, .steps > * { min-width: 0; }
h1, h2, h3, p, li { overflow-wrap: anywhere; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h2 { font-size: 1.9rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 560px; } .center { text-align: center; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.2rem; font-family: "Nunito", sans-serif; }
.brand b { color: var(--brand); }
.logo { width: 38px; height: 38px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }
.menu { display: flex; gap: 22px; margin-left: 12px; }
.menu a { color: var(--muted); font-weight: 600; }
.menu a:hover { color: var(--ink); }
.actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: 4px 12px; color: var(--muted); font-size: .9rem; }
.lang-switch a.on { background: var(--ink); color: #fff; }

/* Buttons */
.btn { display: inline-block; background: var(--brand); color: #fff; border-radius: 999px; padding: 10px 22px; font-weight: 700; border: 2px solid var(--brand); transition: transform .1s, background .2s; }
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-small { padding: 6px 16px; font-size: .95rem; }
.btn-big { padding: 14px 28px; font-size: 1.1rem; }
.btn-outline { background: #fff; color: var(--brand); }
.btn-outline:hover { background: #f1edff; }

/* Hero */
.hero { background: linear-gradient(160deg, #f1edff 0%, #fff7e0 100%); padding: 72px 0 80px; }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.8rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 560px; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; margin: 28px 0; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; gap: 28px; flex-wrap: wrap; color: var(--muted); }
.facts strong { color: var(--ink); font-size: 1.3rem; margin-right: 4px; }
.hero-art { position: relative; height: 320px; }
.bubble { position: absolute; background: #fff; border-radius: 22px; padding: 18px 26px; font-size: 1.7rem; font-weight: 700; box-shadow: 0 10px 30px rgba(60,40,140,.12); }
.b1 { top: 10px; left: 10%; color: #e8590c; }
.b2 { top: 120px; right: 4%; color: #1971c2; }
.b3 { bottom: 20px; left: 18%; }
.stars { position: absolute; top: 40px; right: 12%; font-size: 1.6rem; }

/* Sections */
.section { padding: 72px 0; }
.section-tint { background: var(--tint); }
.section-lead { color: var(--muted); margin-top: -8px; margin-bottom: 32px; }

.subject-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.subject-card { border: 1px solid var(--line); border-top: 6px solid var(--accent); border-radius: var(--radius); padding: 26px; background: #fff; display: flex; flex-direction: column; }
.subject-icon { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: #fff; background: var(--accent); margin-bottom: 14px; }
.subject-card p { color: var(--muted); margin: 0 0 14px; }
.small-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.skill-list { padding-left: 20px; margin: 0 0 18px; }
.card-link { margin-top: auto; font-weight: 700; color: var(--accent); }

.grade-row { display: flex; flex-wrap: wrap; gap: 14px; }
.grade-chip { display: flex; flex-direction: column; min-width: 140px; padding: 14px 18px; border-radius: 14px; background: #fff; border: 2px solid var(--line); color: var(--ink); }
.grade-chip.ready { border-color: var(--brand); }
.grade-name { font-weight: 700; font-size: 1.05rem; }
.grade-status { font-size: .85rem; color: var(--muted); }
.grade-chip.ready .grade-status { color: var(--brand); font-weight: 700; }
.grade-chip.soon { opacity: .75; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step-num { position: absolute; top: 14px; right: 16px; color: var(--line); font-size: 2rem; font-weight: 800; }
.step-icon { font-size: 2rem; margin-bottom: 8px; }
.step p { color: var(--muted); margin: 0; }

.audience-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.audience-card { background: #fff; border-radius: var(--radius); padding: 26px; border: 1px solid var(--line); }
.audience-icon { font-size: 2.2rem; }
.audience-card p { color: var(--muted); margin: 0; }
.safe-box { margin-top: 28px; padding: 18px 22px; border-radius: 14px; background: #ebfbee; border: 1px solid #b2f2bb; display: flex; gap: 12px; flex-wrap: wrap; }

/* Subject page */
.subject-head { display: flex; gap: 20px; align-items: center; margin: 20px 0 30px; }
.skill-table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.skill-table th, .skill-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.skill-table th { background: var(--tint); }
.big-icon { font-size: 3.5rem; }

/* Accounts */
form.inline { display: inline; }
.user-chip { font-weight: 700; color: var(--ink); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-login { font-weight: 700; color: var(--ink); }
.flashes { padding-top: 18px; }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 8px; background: #eef2ff; border: 1px solid #d0d7ff; }
.flash.success { background: #ebfbee; border-color: #b2f2bb; }
.flash.error { background: #fff5f5; border-color: #ffc9c9; }
.muted { color: var(--muted); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; margin: 10px 0 28px; }
.role-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 28px; color: var(--ink); text-align: center; transition: border-color .2s, transform .1s; }
.role-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.role-card p { color: var(--muted); margin: 0; }
.role-icon { font-size: 2.6rem; }
.form-wrap { max-width: 520px; }
.form-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; background: #fff; box-shadow: 0 8px 30px rgba(30,20,90,.06); }
.form { display: flex; flex-direction: column; gap: 16px; margin: 18px 0; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.form input, .form select, .inline-form select { font: inherit; padding: 11px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.form input:focus, .form select:focus { outline: none; border-color: var(--brand); }
.form button { align-self: flex-start; }
.form .check-row { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
.form .check-row input { width: 20px; height: 20px; margin-top: 4px; flex: none; }
.hint { font-weight: 400; color: var(--muted); font-size: .9rem; }
.note { background: #fff9db; border: 1px solid #ffe066; padding: 10px 14px; border-radius: 12px; }
.code-input { text-transform: uppercase; letter-spacing: .2em; font-weight: 800; font-family: "Nunito", sans-serif; }
.form-row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form-row label { flex: 1 1 200px; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 18px 0; background: #fff; }
.panel h2 { font-size: 1.3rem; }
.panel.empty { background: var(--tint); color: var(--muted); text-align: center; }
.code-box { background: linear-gradient(160deg, #f1edff, #fff7e0); border-radius: var(--radius); padding: 24px; text-align: center; margin: 18px 0; }
.big-code { font: 800 2.6rem/1.2 "Nunito", sans-serif; letter-spacing: .15em; color: var(--brand); }
.mid-code { font: 800 1.5rem/1.2 "Nunito", sans-serif; letter-spacing: .12em; color: var(--brand); }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.class-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; color: var(--ink); }
.class-card:hover { border-color: var(--brand); }
.class-card p { margin: 0 0 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.sep { width: 12px; }
.table-scroll { overflow-x: auto; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form select { padding: 6px 10px; border-radius: 10px; }
.badge-role { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #f1edff; color: var(--brand); font-weight: 700; font-size: .9rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.reset { margin-top: 8px; }
.reset summary { cursor: pointer; color: var(--brand); font-size: .9rem; }
.reset .inline-form { margin-top: 6px; }
.inline-form input { font: inherit; padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; }
/* Draw drop-downs ourselves so Khmer text uses the page font on every system */
select { -webkit-appearance: none; appearance: none; padding-right: 36px !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235d6677' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; }
.row-pending { background: #fff9db; }
.btn-green { background: #2f9e44; border-color: #2f9e44; }
.btn-green:hover { background: #237a35; }

/* Admin console */
.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; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.admin h1 { font-size: 1.8rem; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.admin-nav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; min-height: 24px; }
.admin-nav a.on, .admin-nav a:hover { background: #f1edff; color: var(--brand); }
.count { font-size: 1rem; font-weight: 400; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 16px; }
.toolbar input, .toolbar select { font: inherit; padding: 9px 12px; border: 2px solid var(--line); border-radius: 12px; background-color: #fff; }
.toolbar .search { flex: 1 1 260px; }
.notice { display: block; padding: 10px 16px; border-radius: 12px; background: #fff9db; border: 1px solid #ffe066; color: var(--ink); margin-bottom: 14px; font-weight: 600; }
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.btn-danger { background: #e03131; border-color: #e03131; }
.btn-danger:hover { background: #c92a2a; }
.users-table td { vertical-align: middle; }
.user-link { font-weight: 700; color: var(--ink); }
.user-link:hover { color: var(--brand); text-decoration: underline; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: #eef0f6; color: var(--muted); white-space: nowrap; }
.role-superadmin, .role-admin { background: #f1edff; color: var(--brand); }
.role-teacher { background: #e7f5ff; color: #1971c2; }
.role-student { background: #fff4e6; color: #d9480f; }
.role-parent { background: #ebfbee; color: #2b8a3e; }
.status-active { background: #ebfbee; color: #2b8a3e; }
.status-pending { background: #fff9db; color: #946200; }
.status-disabled { background: #fff5f5; color: #c92a2a; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a { min-width: 36px; text-align: center; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); }
.pager a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.profile-head { display: flex; gap: 18px; align-items: center; margin: 8px 0 18px; }
.profile-head h1 { margin: 0 0 6px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; flex: none; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.detail-grid .panel { margin: 0; }
.facts-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; overflow-wrap: anywhere; }
.events td { font-size: .95rem; }

/* Learning pages */
.learn-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.learn-head h1 { margin: 0; }
.learn-stats { display: flex; gap: 12px; }
.learn-stats div { background: var(--tint); border-radius: 14px; padding: 10px 18px; text-align: center; }
.learn-stats strong { display: block; font-size: 1.3rem; }
.learn-stats span { color: var(--muted); font-size: .85rem; }
.next-up { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 24px; border-radius: var(--radius);
  background: linear-gradient(120deg, #f1edff, #fff7e0); color: var(--ink); margin: 0 0 28px; }
.next-up strong { flex: 1 1 200px; font-size: 1.25rem; }
.next-up .small-label { width: 100%; margin: 0; color: var(--brand); }
.subject-title { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; margin: 26px 0 12px; }
.subject-dot { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1rem; font-weight: 800; }
.skill-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.skill-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius); border: 2px solid var(--line);
  border-left: 6px solid var(--accent); color: var(--ink); background: #fff; transition: transform .1s, border-color .2s; }
.skill-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.skill-card strong { font-size: 1.1rem; }
.skill-card .small-label { margin: 0; }
.stars { color: #f59f00; letter-spacing: 2px; font-size: 1.1rem; }
.state-new { background: #eef0f6; color: var(--muted); }
.state-almost { background: #fff4e6; color: #d9480f; }
.state-practising { background: #e7f5ff; color: #1971c2; }
.state-needs_help { background: #fff5f5; color: #c92a2a; }
.state-mastered { background: #ebfbee; color: #2b8a3e; }
.skill-card .pill { align-self: flex-start; }
.lesson-wrap, .practice-wrap { max-width: 760px; }
.objective { font-size: 1.1rem; background: var(--tint); padding: 12px 16px; border-radius: 12px; }
.lesson-step { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 18px 70px; margin: 18px 0; background: #fff; }
.lesson-step h2 { font-size: 1.25rem; margin-bottom: 8px; }
.step-badge { position: absolute; left: 18px; top: 20px; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 800; }
.passage { background: #fffdf5; }
.example-q { font-size: 1.1rem; }
.example-steps li { margin-bottom: 6px; }
.example-a { font-weight: 700; color: #2b8a3e; }
.start-box { text-align: left; }
.practice-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.practice-top > a { font-size: 1.4rem; color: var(--muted); }
.progress { flex: 1; height: 14px; background: #eef0f6; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.passage-mini { background: #fffdf5; border: 1px solid #ffe8a3; border-radius: 12px; padding: 10px 16px; margin-bottom: 14px; }
.passage-mini summary { cursor: pointer; font-weight: 700; }
.question-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: #fff; }
.q-prompt { font-size: 1.6rem; line-height: 1.6; }
.choices { display: grid; gap: 12px; margin: 18px 0 8px; }
.choice { display: flex; align-items: center; gap: 14px; text-align: left; font: inherit; font-size: 1.15rem; padding: 14px 18px; min-height: 56px;
  border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; color: var(--ink); }
.choice:hover:not([disabled]) { border-color: var(--accent); background: #fafaff; }
.choice-key { width: 32px; height: 32px; border-radius: 10px; background: var(--tint); display: grid; place-items: center; font-weight: 800; flex: none; }
.choice[disabled] { cursor: default; opacity: .7; }
.choice.right { border-color: #2f9e44; background: #ebfbee; opacity: 1; }
.choice.wrong { border-color: #e03131; background: #fff5f5; opacity: 1; }
.number-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 18px 0 6px; }
.number-input { font: inherit; font-size: 1.6rem; font-weight: 700; width: 180px; padding: 10px 16px; border: 3px solid var(--line); border-radius: 14px; text-align: center; }
.number-input:focus { outline: none; border-color: var(--accent); }
.number-input.right { border-color: #2f9e44; background: #ebfbee; }
.number-input.wrong { border-color: #e03131; background: #fff5f5; }
.unit { font-size: 1.3rem; font-weight: 700; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 0; }
.hint-box { background: #fff9db; border: 1px solid #ffe066; border-radius: 12px; padding: 12px 16px; margin-top: 10px; }
.feedback { border-radius: var(--radius); padding: 22px 26px; margin-top: 16px; }
.feedback h2 { font-size: 1.35rem; }
.feedback.good { background: #ebfbee; border: 2px solid #8ce99a; }
.feedback.bad { background: #fff5f5; border: 2px solid #ffa8a8; }
.result .big-stars { font-size: 4rem; letter-spacing: 8px; color: #dee2e6; }
.result .big-stars .on { color: #f59f00; }
.result .score { font-size: 1.4rem; font-weight: 800; }
.result-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 24px; }
.center-row { justify-content: center; }

/* Content editor */
.wide-form { max-width: none; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.bi { border: 0; padding: 0; margin: 0; }
.bi legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.bi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bi-col { position: relative; }
.bi-col textarea, .bi-col input { width: 100%; font: inherit; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; resize: vertical; }
.bi-col textarea:focus, .bi-col input:focus { outline: none; border-color: var(--brand); }
.lang-tag { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.req { color: #e03131; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.short { max-width: 200px; }
.nowrap { white-space: nowrap; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cstatus-draft { background: #fff9db; color: #946200; }
.cstatus-published { background: #ebfbee; color: #2b8a3e; }
.sticky-save { position: sticky; bottom: 0; background: rgba(255,255,255,.95); padding: 12px 0; display: flex; gap: 10px; border-top: 1px solid var(--line); z-index: 5; }
.q-list { padding-left: 22px; margin: 10px 0 0; }
.q-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.q-main { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.q-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; font-size: .95rem; }
.icon-btn { background: #fff; border: 1px solid var(--line); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font: inherit; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.danger-text { color: #c92a2a; }
.danger-zone { border-color: #ffc9c9; }
@media (max-width: 700px) { .bi-row { grid-template-columns: 1fr; } }

.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .95rem; }

/* Phones and small tablets */
@media (max-width: 900px) {
  .hero-inner, .subject-grid, .audience-grid, .role-grid { grid-template-columns: 1fr; }
  .link-login, .user-chip { display: none; }
  .steps { grid-template-columns: 1fr 1fr; }
  .hero-art { display: none; }
  .menu { display: none; }
  .hero h1 { font-size: 2.1rem; }
  .hero { padding: 40px 0 48px; }
  .topbar-inner { gap: 10px; }
  .brand { font-size: 1rem; white-space: nowrap; }
  .actions { gap: 8px; }
  .btn-small { padding: 5px 12px; font-size: .85rem; white-space: nowrap; }
  .lang-switch a { padding: 3px 9px; }
}
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.label-text { display: block; }

/* ---------- Explanation video ---------- */
.video-box { border: 2px dashed #d9d2ff; border-radius: 14px; padding: 12px 16px 16px; margin: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.video-box legend { font-weight: 700; padding: 0 6px; }
.video-box input[type=file] { padding: 8px; background: #faf9ff; }
.video-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: #f1edff; border-radius: 14px; padding: 12px 16px; margin: 6px 0 14px; }
.video-offer p { margin: 0; flex-basis: 100%; }
.video-modal { width: min(920px, 94vw); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.video-modal::backdrop { background: rgba(20, 16, 40, .7); }
.video-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-modal-foot { text-align: right; padding: 10px 16px; margin: 0; }
