:root {
  --bg: #ffffff;
  --paper: #f4f6fb;
  --paper-2: #eaeef7;
  --card: #ffffff;
  --ink: #0f1733;
  --text: #2a3350;
  --muted: #5b6480;
  --line: #e3e7f1;
  --primary: #2f5bea;
  --primary-deep: #1f44c4;
  --primary-tint: #e8eeff;
  --primary-soft: #f3f6ff;
  --danger: #c0262d;
  --danger-tint: #fdecec;
  --shadow: 0 1px 2px rgba(15, 23, 51, 0.04), 0 12px 28px -18px rgba(15, 23, 51, 0.22);
  --shadow-primary: 0 10px 20px -10px rgba(47, 91, 234, 0.55);
  --radius: 14px;
  --font: "Manrope", "Noto Sans Devanagari", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font); font-weight: 800; color: var(--ink); margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
[hidden] { display: none !important; }

.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.muted { color: var(--muted); }
.hi { font-family: "Noto Sans Devanagari", var(--font); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; cursor: pointer; text-align: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.btn-primary:hover { background: var(--primary-deep); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); color: var(--primary-deep); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f1c4c6; }
.btn-danger:hover { background: var(--danger-tint); }
.btn-sm { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; color: var(--text); }
.pill svg { flex-shrink: 0; color: var(--primary); }
.chip { display: inline-block; font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--text); font-weight: 600; }
.chip-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-soft { background: var(--primary-tint); border-color: var(--primary-tint); color: var(--primary-deep); }
.icon-badge { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--primary-soft); border: 1px solid var(--primary-tint); color: var(--text); font-size: 14px; }
.error-box { padding: 12px 16px; border-radius: 10px; background: var(--danger-tint); color: var(--danger); font-size: 14px; font-weight: 600; }

/* ---------- Landing ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: 1140px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #021130; object-fit: cover; flex-shrink: 0; display: block; }
.brand b { font-size: 18px; font-weight: 800; }
.brand span span { font-size: 12px; color: var(--muted); display: block; line-height: 1.1; }
.site-nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.site-nav a:not(.btn) { color: var(--text); font-weight: 600; }
.site-nav a:not(.btn):hover { color: var(--primary); }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.section { padding: 76px 0; }
.section-alt { background: var(--paper); }
.section-head { max-width: 640px; margin-bottom: 30px; }
.section-head h2 { font-size: 34px; margin: 10px 0 10px; }
.section-head p { color: var(--muted); font-size: 16px; }

.hero { padding: 72px 0 48px; background: linear-gradient(180deg, var(--primary-soft), #fff); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { font-size: 54px; line-height: 1.05; margin: 14px 0 18px; letter-spacing: -0.02em; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p.lead { font-size: 17px; color: var(--text); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-card { padding: 26px; }
.langs { display: grid; gap: 12px; margin-top: 16px; }
.lang-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.lang-row:last-child { border-bottom: 0; padding-bottom: 0; }
.lang-row b { font-size: 24px; font-weight: 800; }
.lang-row span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.stats div { background: var(--primary-soft); border: 1px solid var(--primary-tint); border-radius: 10px; padding: 12px 8px; text-align: center; }
.stats b { display: block; font-size: 24px; font-weight: 800; color: var(--primary); }
.stats span { font-size: 12px; color: var(--muted); font-weight: 600; }

.steps-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step-link { display: flex; gap: 14px; align-items: center; padding: 18px; color: var(--ink); transition: border-color 0.15s ease; }
.step-link:hover { color: var(--ink); border-color: var(--primary); }
.step-num { width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0; background: var(--primary); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.step-link b { display: block; font-size: 15px; }
.step-link span { font-size: 13px; color: var(--muted); }

.accordion { display: grid; gap: 12px; }
.acc-item { overflow: hidden; }
.acc-head { width: 100%; display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: none; border: 0; cursor: pointer; text-align: left; }
.acc-head .titles { flex: 1; min-width: 0; }
.acc-head .titles b { display: block; font-size: 16px; }
.acc-head .titles .hi { font-size: 1.1em; }
.acc-head .titles span { font-size: 13px; color: var(--muted); }
.acc-head .count { font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.chev { transition: transform 0.18s ease; color: var(--muted); flex-shrink: 0; }
.acc-item.open .chev { transform: rotate(180deg); }
.acc-body { display: none; padding: 0 20px 18px 80px; }
.acc-item.open .acc-body { display: block; }
.acc-body ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text); }
.acc-body li::marker { color: var(--primary); font-weight: 800; }

.video-card { overflow: hidden; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #0f1733; display: flex; align-items: center; justify-content: center; }
.video-frame video, .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.video-empty { text-align: center; color: rgba(255, 255, 255, 0.8); padding: 24px; }
.video-empty .play { width: 64px; height: 64px; border-radius: 999px; margin: 0 auto 14px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }
.video-empty small { display: block; font-size: 13px; color: rgba(255, 255, 255, 0.55); margin-top: 4px; }
.video-caption { padding: 14px 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--text); }

.buy-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.buy-single { max-width: 560px; }
.reason { padding: 36px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 36px; align-items: center; }
.reason-text { display: grid; gap: 14px; align-content: start; }
.reason-text h2 { font-size: 30px; }
.reason-text h3 { font-size: 20px; margin-top: 10px; }
.reason-text p { font-size: 17px; color: var(--text); line-height: 1.6; }
.reason-photo { width: 192px; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
.price-card { padding: 30px; display: grid; gap: 20px; border: 2px solid var(--primary); }
.price { font-size: 44px; font-weight: 800; line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.price-note { font-size: 14px; color: var(--muted); margin-top: 8px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; color: var(--text); }
.checklist li svg { color: var(--primary); flex-shrink: 0; margin-top: 3px; }
.methods { display: flex; flex-wrap: wrap; gap: 8px; }

.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tier { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.tier h3 { font-size: 21px; }
.tier p { color: var(--text); }
.tier.featured { border: 2px solid var(--primary); }
.tier .tag { align-self: flex-start; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.feature { padding: 28px; display: grid; gap: 12px; align-content: start; }
.feature h3 { font-size: 23px; }
.feature p { color: var(--text); }

.site-footer { border-top: 1px solid var(--line); padding: 30px 0 90px; font-size: 13px; color: var(--muted); }
.site-footer .inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 51, 0.6); display: flex; align-items: center; justify-content: center; padding: 24px; }
.overlay .card { max-width: 440px; padding: 32px; text-align: center; display: grid; gap: 14px; }

/* ---------- Auth ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px 96px; background: linear-gradient(180deg, var(--primary-soft), var(--paper)); }
.auth-card { width: 100%; max-width: 420px; padding: 32px; display: grid; gap: 18px; }
.auth-card h1 { font-size: 26px; }
.auth-card .brand { justify-content: center; margin-bottom: 4px; }
.auth-foot { text-align: center; font-size: 14px; color: var(--muted); }
.code-input { font-size: 28px !important; letter-spacing: 12px; text-align: center; font-weight: 800; }

/* ---------- App ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; background: var(--paper); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .brand { padding: 4px 8px 18px; }
.nav-item, .nav-group > button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 9px 12px;
  border-radius: 10px; border: 0; background: none; color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; text-align: left;
}
.nav-item:hover, .nav-group > button:hover { background: var(--paper); color: var(--ink); }
.nav-item.active { background: var(--primary-tint); color: var(--primary-deep); }
.nav-item svg, .nav-group > button svg { flex-shrink: 0; }
.nav-group > button .chev { margin-left: auto; }
.nav-group.open > button .chev { transform: rotate(180deg); }
.nav-sub { display: none; padding: 2px 0 6px 36px; }
.nav-group.open .nav-sub { display: grid; gap: 2px; }
.nav-sub .nav-item { min-height: 36px; font-weight: 500; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.sidebar-foot { margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 13px; }
.sidebar-foot b { font-size: 14px; }
.sidebar-foot span { color: var(--muted); font-size: 12px; }
.topbar { display: none; }
.scrim { display: none; }
.main { padding: 36px 44px 110px; min-width: 0; }
.main-inner { max-width: 900px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 32px; margin-top: 6px; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.access-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 20px; margin-bottom: 22px; }
.access-bar.locked { background: var(--primary-soft); border-color: var(--primary-tint); }

.module-list, .lesson-list { display: grid; gap: 12px; }
.module-card { display: flex; gap: 18px; align-items: center; padding: 18px 20px; color: var(--ink); transition: border-color 0.15s ease; }
.module-card:hover { color: var(--ink); border-color: var(--primary); }
.module-card .titles { flex: 1; min-width: 0; }
.module-card .titles b { display: block; font-size: 17px; }
.module-card .titles .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.progress { height: 6px; background: var(--paper-2); border-radius: 999px; overflow: hidden; margin-top: 10px; max-width: 280px; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.module-card .meta { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 600; }

.lesson-row { display: flex; gap: 16px; align-items: center; padding: 15px 20px; color: var(--ink); }
a.lesson-row:hover { color: var(--ink); border-color: var(--primary); }
.lesson-row.locked { background: var(--paper); box-shadow: none; }
.lesson-row.locked b, .lesson-row.locked .sub { color: var(--muted); }
.lesson-row .num { width: 34px; height: 34px; border-radius: 999px; flex-shrink: 0; background: var(--primary-tint); color: var(--primary-deep); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.lesson-row.done .num { background: var(--primary); color: #fff; }
.lesson-row .titles { flex: 1; min-width: 0; }
.lesson-row .titles b { display: block; font-size: 15px; }
.lesson-row .titles .sub { font-size: 13px; color: var(--muted); }
.lesson-row .state { font-size: 12px; font-weight: 800; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.lesson-row .state.free { color: var(--primary); }

.step-text { flex: 1; min-width: 0; font-size: 15px; color: var(--text); }
.step-text b { color: var(--ink); }
.lesson-counter { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.lesson-counter::before, .lesson-counter::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lesson-block { margin-top: 20px; }
.phrase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.phrase { padding: 16px 18px; display: grid; gap: 4px; }
.phrase .ru { font-size: 22px; font-weight: 800; }
.phrase .hi { font-size: 18px; }
.phrase .tr { font-size: 13px; color: var(--muted); font-style: italic; }
.phrase .en { font-size: 14px; color: var(--primary); font-weight: 700; }
.file-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; color: var(--ink); }
.file-row:hover { color: var(--ink); border-color: var(--primary); }
.file-row .grow { flex: 1; min-width: 0; }
.file-row small { display: block; color: var(--muted); font-size: 12px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.upsell { padding: 26px; display: grid; gap: 12px; background: var(--primary-soft); border-color: var(--primary-tint); }
.upsell h3 { font-size: 22px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.locked-screen, .empty { padding: 40px 28px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.empty { color: var(--muted); }
.empty h3 { font-size: 20px; }

.form { display: grid; gap: 16px; }
.form.narrow { max-width: 460px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--text); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus, .search-box input:focus, .chat-compose textarea:focus { outline: 3px solid var(--primary-tint); border-color: var(--primary); }
.pw-wrap { position: relative; }
.field .pw-wrap input { padding-right: 50px; }
.pw-toggle { position: absolute; top: 0; right: 0; width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 10px; }
.pw-toggle:hover { color: var(--text); }
.pw-toggle:focus-visible { outline: 3px solid var(--primary-tint); }
.field .hint { font-size: 12px; color: var(--muted); }
.search-box { position: relative; margin-bottom: 20px; }
.search-box input { width: 100%; min-height: 50px; padding: 12px 16px 12px 46px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.search-box svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.panel { padding: 24px; display: grid; gap: 16px; }
.panel h2 { font-size: 20px; }

.option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.option:hover { border-color: var(--primary); }
.option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.option input { accent-color: var(--primary); width: 18px; height: 18px; }


.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Modal / toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 51, 0.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: 100%; max-width: 460px; padding: 28px; display: grid; gap: 18px; max-height: calc(100vh - 40px); overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); flex-shrink: 0; }
.icon-btn:hover { background: var(--paper); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.5); max-width: calc(100vw - 32px); }

/* ---------- Support chat widget ---------- */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; height: 56px; padding: 0 20px 0 16px; border-radius: 999px; border: 0;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 10px; cursor: pointer; box-shadow: 0 14px 30px -10px rgba(47, 91, 234, 0.6);
}
.chat-fab:hover { background: var(--primary-deep); }
.chat-fab .dot { position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.chat-panel {
  position: fixed; right: 20px; bottom: 88px; z-index: 61; width: 370px; max-width: calc(100vw - 24px); height: 540px; max-height: calc(100vh - 110px);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px -20px rgba(15, 23, 51, 0.45);
}
.chat-top { padding: 16px 18px; background: var(--primary); color: #fff; display: flex; align-items: center; gap: 12px; }
.chat-top b { display: block; font-size: 15px; }
.chat-top span { font-size: 12px; opacity: 0.85; }
.chat-top .icon-btn { margin-left: auto; background: rgba(255, 255, 255, 0.14); border-color: transparent; color: #fff; }
.chat-top .icon-btn:hover { background: rgba(255, 255, 255, 0.24); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.chat-page .chat-body { min-height: 420px; max-height: 60vh; border-radius: var(--radius) var(--radius) 0 0; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg small { display: block; font-size: 11px; opacity: 0.7; margin-top: 4px; }
.msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: var(--primary-tint); color: var(--primary-deep); font-size: 13px; text-align: center; max-width: 92%; }
.chat-hello { text-align: center; color: var(--muted); font-size: 14px; padding: 12px; }
.chat-closed { padding: 10px 14px; background: #fff7e6; border-top: 1px solid #f5dfb3; color: #6b4a00; font-size: 13px; font-weight: 600; text-align: center; }
.chat-compose { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; background: #fff; }
.chat-compose .row { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.chat-compose input { min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); width: 100%; }
.chat-compose .send { width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.chat-compose .send:hover { background: var(--primary-deep); }
.chat-compose .send[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-tabs button { min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.admin-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.admin-tabs button .nav-badge { margin-left: 0; background: var(--danger); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 16px; }
.stat b { display: block; font-size: 26px; font-weight: 800; color: var(--primary); }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; min-height: 560px; }
.thread-list { overflow-y: auto; max-height: 70vh; padding: 6px; }
.thread-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 12px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.thread-item:hover { background: var(--paper); }
.thread-item.active { background: var(--primary-tint); }
.thread-item .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.thread-item b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-item small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.thread-item p { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.conv { display: flex; flex-direction: column; overflow: hidden; }
.conv-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.conv .chat-body { max-height: 56vh; min-height: 360px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .buy-grid, .split, .inbox { grid-template-columns: minmax(0, 1fr); }
  .tiers, .steps-nav { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 40px; }
  .site-nav a:not(.btn) { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 284px; z-index: 40; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, 0.2); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 51, 0.4); }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .main { padding: 22px 16px 110px; }
  .page-head h1 { font-size: 25px; }
  .module-card { flex-wrap: wrap; }
  .module-card .meta { text-align: left; }
  .acc-body { padding-left: 20px; }
  .reason { grid-template-columns: minmax(0, 1fr); padding: 24px; }
  .reason-photo { justify-self: center; }
  .reason-text h2 { font-size: 24px; }
  .chat-fab .label { display: none; }
  .chat-fab { padding: 0; width: 56px; justify-content: center; }
}
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .section { padding: 52px 0; }
  .hero { padding-top: 40px; }
  .hero h1 { font-size: 34px; }
  .section-head h2 { font-size: 26px; }
  .lesson-row .state span { display: none; }
  .chat-panel { right: 12px; left: 12px; width: auto; bottom: 84px; }
  .auth-card { padding: 24px 20px; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .chat-fab, .chat-panel { display: none !important; }
  .app { display: block; background: #fff; }
  .main { padding: 0; }
}
