/* =====================================================================
   LearnHub styles. Sizes and colors come from the design canvas.
   1 Basics  2 Buttons/forms  3 Landing  4 Login  5 Catalog  6 Course
   7 Lesson  8 Quiz  9 Dashboards  10 Builder  11 Certificate  12 Phone
   ===================================================================== */

/* ---------- 1 Basics ---------- */
:root {
  --teal: #0F766E; --teal-dark: #115E59; --mint: #CCFBF1; --mint-light: #F0FDFA;
  --ink: #0B1F1A; --text: #334155; --soft: #475569; --muted: #64748B;
  --line: #E2E8F0; --border: #CBD5E1; --bg: #F8FAFC; --red: #DC2626;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font-family: system-ui, sans-serif; color: var(--ink); background: #fff; }
body.light { background: var(--bg); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #14B8A6; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.logo { font-size: 20px; font-weight: 800; color: var(--teal); }
.muted { color: var(--muted); font-size: 14px; }
.link { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--mint); color: var(--teal); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.avatar.big { width: 60px; height: 60px; font-size: 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar > div { height: 100%; background: var(--teal); border-radius: inherit; }
.bar.thick { height: 12px; border-radius: 6px; }
.notice { padding: 14px 18px; background: #FFF7ED; border: 1px solid #FED7AA; color: #9A3412; border-radius: 10px; font-size: 15px; line-height: 1.5; margin: 16px; }
.empty { padding: 28px; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.6; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 15px; max-width: calc(100vw - 32px); z-index: 50; }
#toast.bad { background: #B91C1C; }

/* ---------- 2 Buttons and forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; border: 1px solid var(--border); background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-dark); }
.btn.outline { border-color: var(--teal); color: var(--teal); }
.btn.outline:hover { background: var(--mint-light); }
.btn.large { padding: 16px 26px; border-radius: 12px; font-size: 16px; font-weight: 700; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
label, .label { font-size: 14px; color: var(--soft); }
.input { width: 100%; padding: 13px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; background: #fff; }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.check input { margin: 2px 0 0; width: 18px; height: 18px; accent-color: var(--teal); flex: none; }

/* ---------- 3 Landing ---------- */
.landing-top { display: flex; justify-content: space-between; align-items: center; padding: 20px 56px; }
.landing-top nav { display: flex; gap: 28px; font-size: 15px; color: var(--text); align-items: center; }
.landing-top nav a:not(.btn):hover { color: var(--teal); }
.landing-top .btn { padding: 10px 18px; font-size: 15px; }
.menu-btn { display: none; }
.hero { display: flex; gap: 56px; padding: 40px 56px; min-height: calc(100vh - 84px); align-items: center; }
.hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero h1 { font-size: 56px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.hero p { font-size: 18px; color: var(--soft); line-height: 1.6; }
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.stats { display: flex; gap: 40px; font-size: 15px; color: var(--soft); }
.stats b { font-size: 24px; color: var(--ink); display: block; }
.hero-card { width: 520px; height: 440px; flex: none; background: var(--mint); border-radius: 24px; display: flex; align-items: center; justify-content: center; color: var(--teal); font-size: 22px; font-weight: 700; padding: 40px; text-align: center; }
.hero-card .card { width: 340px; text-align: left; color: var(--ink); font-weight: 400; }
.band { padding: 56px; }
.band.tint { background: var(--bg); }
.band h2 { font-size: 28px; font-weight: 800; margin-bottom: 18px; }
.band p { font-size: 16px; line-height: 1.6; color: var(--soft); max-width: 680px; margin-bottom: 18px; }

/* ---------- 4 Sign up / Log in ---------- */
.login { display: flex; min-height: 100vh; }
.login-side { flex: 1; background: var(--teal); color: var(--mint); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; font-size: 15px; }
.login-side .logo { color: #fff; }
.login-side h2 { font-size: 40px; font-weight: 800; line-height: 1.2; color: #fff; max-width: 500px; }
.login-form { width: 560px; padding: 64px; display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.login-form form { display: flex; flex-direction: column; gap: 16px; }
.login-form h1 { font-size: 28px; font-weight: 800; }
.login-form .field { gap: 16px; }
.tabs { display: flex; gap: 10px; }
.tabs .btn { flex: 1; padding: 12px; font-size: 15px; }
.login-form form .btn { padding: 14px; font-size: 16px; font-weight: 700; margin-top: 6px; }
.or { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #94A3B8; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#google { padding: 13px; font-size: 15px; }
.message { padding: 12px 14px; border-radius: 10px; background: var(--mint-light); border: 1px solid #99F6E4; font-size: 15px; line-height: 1.5; }
.message.bad { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

/* ---------- 5 Catalog ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 40px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar .search { width: 520px; max-width: 100%; padding: 11px 16px; }
.topbar .right { display: flex; gap: 16px; align-items: center; font-size: 15px; white-space: nowrap; }
.catalog { display: flex; gap: 28px; padding: 28px 40px; align-items: flex-start; }
.filters { width: 220px; flex: none; font-size: 15px; }
.filters summary { display: none; }
.filter-list { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.filter-list h2 { font-size: 15px; font-weight: 700; }
.filter-list h2:not(:first-child) { margin-top: 10px; }
.filter-list button { background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; text-align: left; }
.filter-list button:hover { color: var(--teal); }
.filter-list button[aria-pressed=true] { color: var(--teal); font-weight: 700; }
.results { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.results-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 15px; color: var(--soft); }
.results-top label { font-size: 15px; }
.results-top select { border: 0; background: none; cursor: pointer; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { display: block; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
a.card:hover { border-color: var(--teal); }
.cover { height: 130px; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.card-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.card-price { font-size: 14px; font-weight: 700; color: var(--teal); }
.card-price s { color: #94A3B8; font-weight: 400; }
.cover.external { background: var(--line); display: flex; align-items: center; justify-content: center; color: var(--soft); font-size: 14px; font-weight: 600; padding: 12px; text-align: center; }

/* ---------- 6 Course detail ---------- */
.plainbar { padding: 16px 40px; border-bottom: 1px solid var(--line); background: #fff; }
.course { display: flex; gap: 40px; padding: 40px; align-items: flex-start; }
.course-main { flex: 2; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.course-cat { font-size: 13px; color: var(--teal); font-weight: 700; text-transform: uppercase; }
.course h1 { font-size: 38px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.course-desc { font-size: 16px; color: var(--soft); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.facts { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--soft); }
.course h2 { font-size: 20px; font-weight: 700; margin-top: 10px; }
.learn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.outline { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.outline summary { padding: 12px 16px; background: var(--bg); border-radius: 10px; display: flex; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.outline summary::-webkit-details-marker { display: none; }
.outline summary span:last-child, .outline li span:last-child { color: var(--muted); white-space: nowrap; }
.outline ul { list-style: none; margin: 0; padding: 4px 16px 4px 32px; }
.outline li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; color: var(--text); }
.buy { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.buy .cover { height: 170px; border-radius: 12px; }
.price { font-size: 30px; font-weight: 800; }
.price s { font-size: 18px; color: #94A3B8; font-weight: 400; }
.buy .btn { padding: 15px; border-radius: 12px; font-size: 16px; font-weight: 700; }
.buy .small { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }
.buy .list { font-size: 14px; color: var(--text); display: flex; flex-direction: column; gap: 8px; }
.stars { display: flex; gap: 4px; }
.stars button { background: none; border: 0; font-size: 26px; line-height: 1; padding: 4px; cursor: pointer; color: #94A3B8; }
.stars button.on { color: var(--teal); }

/* ---------- 7 Lesson player ---------- */
.player { display: flex; min-height: 100vh; }
.player-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slimbar { padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.slimbar .where { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.slimbar .info { font-size: 14px; color: var(--soft); white-space: nowrap; }
.video { flex: none; height: calc(100vh - 236px); min-height: 320px; background: #0F172A; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.video.none { height: auto; min-height: 0; padding: 40px 28px; color: #CBD5E1; font-size: 15px; text-align: center; }
.video video, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #0F172A; }
.play { position: relative; width: 84px; height: 84px; border-radius: 50%; background: #fff; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.play svg { width: 30px; height: 30px; fill: var(--teal); }
.controls { position: absolute; left: 24px; right: 24px; bottom: 18px; display: flex; align-items: center; gap: 14px; color: #fff; font-size: 13px; }
.controls input { flex: 1; min-width: 0; height: 5px; accent-color: #14B8A6; cursor: pointer; }
.controls button { background: none; border: 0; color: #fff; font-size: 13px; cursor: pointer; padding: 6px; }
.lesson-info { padding: 22px 28px; display: flex; flex-direction: column; gap: 10px; }
.lesson-info h1 { font-size: 24px; font-weight: 800; overflow-wrap: anywhere; }
.lesson-info .buttons { display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.rich { font-size: 15px; color: var(--soft); line-height: 1.6; overflow-wrap: anywhere; }
.rich p + p, .rich pre, .rich img { margin-top: 10px; }
.rich code { font-family: monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--teal); }
.rich pre { background: #0F172A; color: #E2E8F0; padding: 14px; border-radius: 10px; overflow-x: auto; margin-bottom: 10px; }
.rich img { max-width: 100%; border-radius: 10px; display: block; }
.ask { border-top: 1px solid var(--line); margin: 6px 28px 28px; padding-top: 18px; }
.ask h2 { font-size: 16px; font-weight: 700; }
.ask form { align-items: flex-start; }
.qa { background: var(--bg); border-radius: 10px; padding: 10px; font-size: 14px; color: var(--soft); line-height: 1.5; overflow-wrap: anywhere; }
.qa b { color: var(--ink); }
.lesson-list { width: 340px; flex: none; border-left: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.lesson-list h2 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.lesson-list a { padding: 10px 12px; color: var(--text); display: flex; justify-content: space-between; gap: 10px; border-radius: 10px; border: 1px solid transparent; overflow-wrap: anywhere; }
.lesson-list a:hover { background: var(--bg); }
.lesson-list a.done { color: var(--muted); }
.lesson-list a.now { background: var(--mint-light); border-color: var(--teal); color: var(--ink); font-weight: 600; }
.lesson-list a.now span:last-child { color: var(--teal); }

/* ---------- 8 Quiz ---------- */
.quiz-bar { height: 6px; background: var(--line); }
.quiz-bar > div { height: 6px; background: var(--teal); transition: width .2s; }
.quiz { max-width: 932px; margin: 0 auto; padding: 56px; display: flex; flex-direction: column; gap: 20px; }
.quiz h1 { font-size: 28px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.quiz h1 code { display: block; font-family: monospace; font-size: 22px; color: var(--teal); white-space: pre-wrap; }
.options { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.options label { display: block; padding: 18px; background: #fff; border: 2px solid var(--border); border-radius: 12px; font-size: 17px; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; position: relative; }
.options label:hover { border-color: var(--teal); }
.options label:has(:checked) { background: var(--mint-light); border-color: var(--teal); font-weight: 600; }
.options label:has(:focus-visible) { outline: 3px solid #14B8A6; outline-offset: 2px; }
.quiz-buttons { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.quiz-buttons .btn { padding: 13px 22px; font-size: 16px; }
.score { background: #fff; border-radius: 14px; padding: 40px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.score .number { font-size: 64px; font-weight: 800; color: var(--teal); line-height: 1; }
.score .row { justify-content: center; }

/* ---------- 9 Dashboards ---------- */
.dash { display: flex; min-height: 100vh; }
.side { width: 230px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 24px 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.side .logo { font-size: 19px; margin-bottom: 14px; }
.side nav { display: flex; flex-direction: column; gap: 6px; }
.side nav a { padding: 10px 12px; color: var(--soft); border-radius: 8px; white-space: nowrap; }
.side nav a:hover { background: var(--bg); }
.side nav a.on { background: var(--mint-light); color: var(--teal); font-weight: 600; }
.side.dark { background: var(--ink); border: 0; }
.side.dark .logo { color: #fff; }
.side.dark nav a { color: var(--mint); }
.side.dark nav a:hover { background: #10302A; }
.side.dark nav a.on { background: #134E4A; color: #fff; }
.dash-main { flex: 1; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.dash-head .btn { padding: 12px 18px; }
.dash-main h1 { font-size: 26px; font-weight: 800; overflow-wrap: anywhere; }
.tiles { display: flex; gap: 16px; }
.tile { flex: 1; background: #fff; border-radius: 14px; padding: 20px; }
.tile .label { font-size: 13px; color: var(--muted); }
.tile .value { font-size: 30px; font-weight: 800; }
.panels { display: flex; gap: 16px; flex: 1; }
.panel { background: #fff; border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
.panel.wide { flex: 2; }
.panel h2 { font-size: 17px; font-weight: 700; }
.panel h2:not(:first-child) { margin-top: 10px; }
.panel .small { font-size: 14px; color: var(--soft); line-height: 1.5; overflow-wrap: anywhere; }
.learning { display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--bg); border-radius: 12px; }
.learning .thumb { width: 90px; height: 60px; border-radius: 8px; flex: none; }
.learning .grow { flex: 1; min-width: 0; }
.learning .name { font-weight: 600; overflow-wrap: anywhere; }
.learning .sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.learning .bar { margin-top: 8px; }
.line { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px; background: var(--bg); border-radius: 10px; font-size: 15px; overflow-wrap: anywhere; }
a.line:hover { background: var(--mint-light); }
.green { color: #16A34A; font-weight: 600; }
.orange { color: #EA580C; font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }

/* ---------- 10 Course builder ---------- */
.slimbar h1 { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.builder { display: flex; gap: 24px; padding: 24px 28px; align-items: stretch; min-height: calc(100vh - 68px); }
.build-outline { width: 340px; flex: none; background: #fff; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.build-outline h2 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.build-outline button { text-align: left; border: 0; cursor: pointer; border-radius: 10px; overflow-wrap: anywhere; }
.build-outline .sec { padding: 12px; background: var(--bg); font-weight: 600; }
.build-outline .sec.on { background: var(--mint-light); }
.build-outline .les { padding: 10px 12px 10px 26px; background: none; border-left: 3px solid var(--teal); border-radius: 0; color: var(--text); }
.build-outline .les.on { font-weight: 700; color: var(--teal); }
.build-outline .add { padding: 12px; border: 1px dashed #94A3B8; background: none; color: var(--soft); text-align: center; }
.build-outline .add:hover { border-color: var(--teal); color: var(--teal); }
.build-edit { flex: 1; min-width: 0; background: #fff; border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.build-edit .title-input { padding: 12px 14px; font-size: 18px; font-weight: 700; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tools button { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 14px; color: var(--soft); cursor: pointer; }
.tools button:hover { border-color: var(--teal); color: var(--teal); }
.body-input { flex: 1; min-height: 220px !important; padding: 14px; color: var(--text); }
.meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--soft); }
.meta input { width: 72px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.box h3 { font-size: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.opt { display: flex; gap: 10px; align-items: center; }
.opt input[type=radio] { width: 18px; height: 18px; accent-color: var(--teal); flex: none; }

/* ---------- 11 Certificate and profile ---------- */
.slimlogo { padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.cert-page { display: flex; gap: 28px; padding: 32px; align-items: stretch; min-height: calc(100vh - 56px); }
.cert { flex: 2; min-width: 0; min-height: 520px; background: #fff; border: 10px solid var(--teal); border-radius: 6px; padding: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; overflow-wrap: anywhere; }
.cert .kicker { font-size: 14px; letter-spacing: .2em; color: var(--teal); font-weight: 700; }
.cert .t { font-size: 18px; color: var(--soft); line-height: 1.5; }
.cert .name { font-size: 44px; font-weight: 800; }
.cert .title { font-size: 26px; font-weight: 700; }
.cert .sign { display: flex; gap: 80px; margin-top: 20px; font-size: 14px; color: var(--soft); line-height: 1.4; }
.cert-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.cert-side .box2 { background: #fff; border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--soft); }
.cert-side .box2.settings { gap: 2px; }
.cert-side .box2 .btn { padding: 11px; }
.cert-side h2 { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.cert-side .who { font-size: 18px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.cert-side summary, .logout { cursor: pointer; padding: 3px 0; list-style: none; font-size: 14px; }
.cert-side summary::-webkit-details-marker { display: none; }
.cert-side summary:hover { color: var(--teal); }
.cert-side details form, .cert-side details > div { padding: 10px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.logout { background: none; border: 0; color: var(--red); text-align: left; }
.cert-link { display: block; padding: 4px 0; overflow-wrap: anywhere; }
.cert-link.on { color: var(--teal); font-weight: 600; }

/* ---------- 12 Tablet and phone ---------- */
@media (max-width: 1100px) {
  .hero { gap: 32px; padding: 40px 32px; }
  .landing-top { padding: 20px 32px; }
  .band { padding: 48px 32px; }
  .hero-card { width: 400px; height: 380px; padding: 24px; }
  .hero-card .card { width: 100%; }
  .hero h1 { font-size: 44px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-form { width: 480px; padding: 48px 40px; }
  .builder { gap: 16px; padding: 16px; }
  .build-outline { width: 270px; }
  .lesson-list { width: 280px; }
}
@media (max-width: 800px) {
  .input, textarea, select, .meta input { font-size: 16px !important; } /* stops iPhone zoom */
  .landing-top { padding: 14px 18px; flex-wrap: wrap; }
  .menu-btn { display: inline-flex; }
  .landing-top nav { display: none; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; padding-top: 12px; }
  .landing-top nav.open { display: flex; }
  .landing-top nav a { padding: 12px 4px; }
  .hero { flex-direction: column; align-items: stretch; padding: 24px 18px 40px; min-height: 0; }
  .hero-text { flex: none; }
  .hero h1 { font-size: 38px; }
  .hero-card { width: 100%; height: auto; min-height: 260px; }
  .hero-buttons .btn { flex: 1; white-space: nowrap; padding: 16px 14px; }
  .stats { gap: 28px; }
  .band { padding: 40px 18px; }

  .login { flex-direction: column; }
  .login-side { flex: none; padding: 24px 18px; gap: 14px; }
  .login-side h2 { font-size: 26px; }
  .login-form { width: 100%; padding: 28px 18px 40px; }

  .topbar { padding: 12px 18px; flex-wrap: wrap; gap: 12px; }
  .topbar .search { order: 3; width: 100%; }
  .catalog { flex-direction: column; padding: 18px; gap: 18px; }
  .filters { width: 100%; }
  .filters summary { display: block; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-weight: 600; cursor: pointer; }
  .filter-list { padding: 16px 4px 0; gap: 4px; }
  .filter-list button { padding: 10px 0; width: 100%; }
  .results { width: 100%; }

  .plainbar { padding: 14px 18px; }
  .course { flex-direction: column; padding: 22px 18px; gap: 28px; }
  .course-main, .buy { width: 100%; flex: none; }
  .course h1 { font-size: 30px; }

  .player { flex-direction: column; }
  .player-main { flex: none; width: 100%; }
  .slimbar { padding: 12px 18px; }
  .video { height: auto; min-height: 0; width: 100%; aspect-ratio: 16 / 9; }
  .video.none { aspect-ratio: auto; padding: 24px 18px; }
  .play { width: 64px; height: 64px; }
  .controls { left: 14px; right: 14px; bottom: 8px; gap: 8px; }
  .lesson-info { padding: 18px; }
  .lesson-info .buttons .btn { padding: 13px 14px; }
  .lesson-info .buttons .primary { flex: 1; }
  .lesson-list { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
  .lesson-list a { padding: 12px; }
  .ask { margin: 6px 18px 24px; }

  .quiz { padding: 28px 18px; }
  .quiz h1 { font-size: 23px; }
  .quiz h1 code { font-size: 17px; }
  .score { padding: 28px 18px; }

  .dash { flex-direction: column; }
  .side { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 18px; }
  .side .logo { margin-bottom: 4px; }
  .side nav { flex-direction: row; overflow-x: auto; margin: 0 -18px; padding: 2px 18px; }
  .dash-main { flex: none; width: 100%; padding: 20px 18px; }
  .tiles, .panels { flex-direction: column; }
  .panel, .panel.wide { flex: none; }
  .learning { flex-wrap: wrap; }
  .learning .btn { width: 100%; padding: 13px; }

  .builder { flex-direction: column; min-height: 0; }
  .build-outline { width: 100%; }
  .build-edit { padding: 18px; flex: none; }
  .two { grid-template-columns: 1fr; }

  .cert-page { flex-direction: column; padding: 18px; }
  .cert, .cert-side { flex: none; width: 100%; }
  .cert { min-height: 0; padding: 36px 18px; }
  .cert .name { font-size: 32px; }
  .cert .title { font-size: 21px; }
  .cert .sign { gap: 36px; }
  .cert-side summary, .logout, .cert-link { padding: 10px 0; }
}
@media (max-width: 520px) {
  .cards, .learn { grid-template-columns: 1fr; }
}
