/* ====================== Хичээл — загвар ====================== */
:root {
  --bg: #f5f3ef;
  --card: #ffffff;
  --card-2: #faf8f5;
  --ink: #1c2230;
  --muted: #6c7180;
  --line: #e8e3da;
  --primary: #e8553e;
  --primary-2: #f08a3c;
  --primary-ink: #ffffff;
  --soft: #fdeee9;
  --accent: #0f9d8a;
  --zh: #e8553e;
  --en: #3867d6;
  --ok: #15a36b;
  --bad: #e0453a;
  --warn: #d48806;
  --side: #1b2133;
  --side-ink: #c9cfdd;
  --side-hover: #262e46;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(28, 34, 48, 0.04), 0 6px 20px rgba(28, 34, 48, 0.06);
  --shadow-lg: 0 10px 40px rgba(28, 34, 48, 0.14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1220; --card: #161b2b; --card-2: #1a2033; --ink: #e9ebf2; --muted: #98a0b4; --line: #262d43;
    --soft: #2a1d20; --side: #0a0d18; --side-ink: #aab2c6; --side-hover: #171d30; --en: #6d93f0;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1220; --card: #161b2b; --card-2: #1a2033; --ink: #e9ebf2; --muted: #98a0b4; --line: #262d43;
  --soft: #2a1d20; --side: #0a0d18; --side-ink: #aab2c6; --side-hover: #171d30; --en: #6d93f0;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h3 small, h2 small { font-weight: 500; font-size: 0.8rem; }
.zh { font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
kbd { font-family: inherit; font-size: 0.7rem; background: rgba(127, 127, 127, 0.15); border-radius: 5px; padding: 1px 6px; margin-left: 6px; }

/* ---------- Дээд цэс ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
}
.topbar-in { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; flex: none; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-family: "Noto Sans SC", sans-serif; font-size: 1.25rem;
}
.logo-txt { font-size: 1.12rem; display: flex; flex-direction: column; line-height: 1.1; }
.logo-txt small { font-size: 0.68rem; font-weight: 600; color: var(--muted); }
.top-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 11px; white-space: nowrap;
  color: var(--muted); font-weight: 700; font-size: 0.9rem; position: relative;
}
.top-nav a:hover { color: var(--ink); background: var(--card); text-decoration: none; }
.top-nav a.on { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.top-nav a.on .ni { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.ni { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line); font-size: 0.85rem; flex: none; }
.top-nav a.on .ni { border-color: transparent; }
.nbadge { background: var(--primary); color: #fff; font-size: 0.68rem; padding: 0 6px; border-radius: 99px; line-height: 1.5; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.burger { display: none; background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: 10px; font-size: 1.15rem; width: 40px; height: 40px; cursor: pointer; flex: none; }

/* Хэл сонгогч */
.track-sw { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 3px; gap: 2px; }
.track-sw button {
  display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-family: inherit;
  font-weight: 700; font-size: 0.85rem; padding: 6px 10px; border-radius: 10px; cursor: pointer;
}
.track-sw button.on { background: var(--ink); color: var(--bg); }
.flag { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 4px; border-radius: 6px; font-size: 0.68rem; font-weight: 800; color: #fff; line-height: 1; vertical-align: middle; }
.flag.zh { background: var(--zh); font-family: "Noto Sans SC", sans-serif; font-size: 0.8rem; }
.flag.en { background: var(--en); letter-spacing: 0.02em; }
.page-head .flag { height: 30px; min-width: 34px; font-size: 1rem; border-radius: 9px; }
.f-icon .flag, .f-icon { font-weight: 800; }

/* Профайлын цэс */
.pwrap { position: relative; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--accent); color: #fff; font-weight: 800; font-family: inherit; cursor: pointer; font-size: 1rem; }
.avatar-btn:hover { border-color: var(--primary); }
.pmenu { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; padding: 12px; z-index: 50; box-shadow: var(--shadow-lg); }
.pmenu a, .pmenu button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; color: var(--ink); font-weight: 600; font-size: 0.9rem; background: none; border: 0; font-family: inherit; cursor: pointer; }
.pmenu a:hover, .pmenu button:hover { background: var(--card-2); text-decoration: none; }
.pmenu #logout { color: var(--bad); border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; margin-top: 4px; }
.pm-head { display: flex; gap: 10px; align-items: center; padding: 4px 6px 10px; }
.pm-head > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.pm-head b, .pm-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; flex: none; }
.pm-stats { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 4px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.pm-stats span { font-size: 0.75rem; background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px 7px; font-weight: 600; }

@media (max-width: 1560px) { .top-nav .ni { display: none; } .top-nav a { padding: 8px 10px; } .logo-txt small { display: none; } }
@media (max-width: 1180px) { .top-nav .ni { display: grid; } .top-nav a span:not(.ni):not(.nbadge) { display: none; } .top-nav a { padding: 6px; } }
@media (max-width: 760px) {
  .burger { display: block; order: 3; }
  .topbar-in { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .top-actions { order: 2; }
  .logo-txt small { display: none; }
  .track-sw button .tw { display: none; }
  .top-nav { order: 4; flex-basis: 100%; display: none; flex-direction: column; align-items: stretch; overflow: visible; padding-bottom: 6px; }
  body.menu-open .top-nav { display: flex; }
  .top-nav a span:not(.ni):not(.nbadge) { display: inline; }
  .top-nav .ni { display: grid; }
  .top-nav a { padding: 8px 10px; }
}

/* Хоёр баганат (түвшний жагсаалт + агуулга) */
.split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.split.solo { grid-template-columns: minmax(0, 1fr); }
.lvl-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.split-main { min-width: 0; }
.lvl-side .picker { display: block; margin: 0; }
.pk-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.pk-tabs button {
  flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 4px 10px; margin-bottom: -1px;
  color: var(--muted); font-family: inherit; font-weight: 800; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer; white-space: nowrap;
}
.pk-tabs button.on { color: var(--ink); border-bottom-color: var(--primary); }
.lv-pick { display: flex; flex-direction: column; gap: 2px; }
.lv-pick button {
  display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; background: none; border: 0;
  border-left: 3px solid transparent; padding: 9px 12px; border-radius: 0 10px 10px 0; color: var(--muted); font-family: inherit; cursor: pointer;
}
.lv-pick button b { font-size: 1rem; color: var(--ink); font-weight: 700; }
.lv-pick button small { font-size: 0.78rem; }
.lv-pick button:hover { background: var(--card); }
.lv-pick button.on { border-left-color: var(--primary); background: var(--card); box-shadow: var(--shadow); }
.lv-pick button.on b { color: var(--primary); }
.pk-done { margin-left: auto; font-style: normal; font-size: 0.72rem; color: var(--ok); font-weight: 700; }
.side-src { display: flex; flex-direction: column; gap: 4px; }
.side-src button { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; font-family: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.side-src button.on { color: var(--ink); border-color: var(--primary); box-shadow: var(--shadow); }
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .lvl-side { position: static; }
  .lv-pick { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .lv-pick button { flex: none; width: auto; border-left: 0; border: 1px solid var(--line); border-radius: 11px; padding: 7px 12px; background: var(--card); }
  .lv-pick button.on { border-color: var(--primary); }
  .side-src { flex-direction: row; overflow-x: auto; }
  .side-src button { flex: none; }
}

.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 24px 56px; flex: 1; }
@media (max-width: 600px) { .container { padding: 20px 16px 48px; } }
.footer { margin-top: auto; text-align: center; color: var(--muted); font-size: 0.8rem; padding: 18px; border-top: 1px solid var(--line); }

/* ---------- Товч ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink);
  border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 700; font-size: 0.93rem; cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, opacity 0.15s; box-shadow: 0 4px 14px rgba(232, 85, 62, 0.25);
}
.btn:hover { text-decoration: none; box-shadow: 0 6px 20px rgba(232, 85, 62, 0.35); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.light { background: #fff; color: var(--primary); box-shadow: none; }
.btn.success { background: var(--ok); box-shadow: none; }
.btn.danger { background: var(--bad); box-shadow: none; }
.btn.audio { background: var(--soft); color: var(--primary); box-shadow: none; }
.btn.mic { background: var(--accent); box-shadow: none; }
.btn.mic.on { background: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(224, 69, 58, 0.2); } }
.btn.small { padding: 6px 12px; font-size: 0.82rem; border-radius: 10px; }
.btn.big { padding: 14px 26px; font-size: 1.02rem; }
.btn.full { width: 100%; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 0.95rem; padding: 5px 8px; color: var(--muted); font-family: inherit; }
.icon-btn:hover { background: var(--soft); }
.icon-btn.on { color: var(--primary); background: var(--soft); border-color: var(--primary); }
[data-fav].on { color: #e0a100; border-color: #e0a100; background: rgba(224, 161, 0, 0.1); }
.icon-btn.theme { border: 1px solid var(--line); background: var(--card); width: 40px; height: 40px; }

/* ---------- Ерөнхий ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; margin-bottom: 24px; }
.grid.tight { margin-bottom: 0; gap: 12px; }
.cards2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.cards3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.cards4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.row.center, .center { justify-content: center; text-align: center; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.section-title { margin: 32px 0 14px; font-size: 1.2rem; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; }
.page-head p { color: var(--muted); margin: 0; }
.back { display: inline-block; margin-bottom: 10px; font-size: 0.9rem; font-weight: 600; }
.eyebrow { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; }
.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--card-2); color: var(--ink); font-size: 0.97rem; font-family: inherit;
}
.input:focus { outline: 2px solid var(--primary); border-color: transparent; }
.input.big { font-size: 1.1rem; padding: 14px 16px; }
.input.tiny { width: auto; display: inline-block; padding: 5px 8px; }
.input.grow { flex: 1; min-width: 180px; width: auto; }
label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 12px; }
label .input { margin-top: 4px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
label.inline .input { margin: 0; }
.error { color: var(--bad); min-height: 1.2em; font-size: 0.88rem; margin-bottom: 8px; }
.note { font-size: 0.8rem; color: var(--muted); background: var(--card-2); padding: 8px 12px; border-radius: 10px; }
.warn { border-color: var(--warn); color: var(--warn); margin-bottom: 16px; }
.badge { background: var(--soft); color: var(--primary); padding: 3px 10px; border-radius: 99px; font-size: 0.78rem; font-weight: 700; display: inline-block; }
.pill { padding: 2px 10px; border-radius: 99px; font-weight: 700; font-size: 0.8rem; }
.pill.pass { background: rgba(21, 163, 107, 0.14); color: var(--ok); }
.pill.fail { background: rgba(224, 69, 58, 0.12); color: var(--bad); }
.pill.new { background: rgba(56, 103, 214, 0.14); color: var(--en); }
.tag { display: inline-block; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; padding: 2px 8px; border-radius: 7px; margin: 2px 4px 0 0; }
.tag.big { font-size: 0.88rem; padding: 4px 10px; color: var(--ink); }
details summary { cursor: pointer; color: var(--primary); font-weight: 700; margin: 6px 0; }
.help { margin-top: 20px; }
.facts { list-style: none; padding: 0; margin: 10px 0; font-size: 0.9rem; }
.facts li { padding: 2px 0; }
.facts.inline { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }

/* ---------- Нүүр ---------- */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; align-items: center; padding: 24px 0 44px; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; letter-spacing: -0.03em; }
.hero p { font-size: 1.08rem; color: var(--muted); max-width: 560px; }
.grad { background: linear-gradient(90deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-art { position: relative; height: 260px; }
.bubble { position: absolute; padding: 18px 26px; border-radius: 24px; font-size: 2rem; font-weight: 800; color: #fff; box-shadow: var(--shadow-lg); animation: float 5s ease-in-out infinite; }
.bubble.zh { background: var(--zh); top: 10px; left: 10%; font-family: "Noto Sans SC", sans-serif; }
.bubble.en { background: var(--en); top: 96px; right: 4%; animation-delay: 1.2s; }
.bubble.mn { background: var(--accent); bottom: 0; left: 24%; animation-delay: 2.4s; }
@keyframes float { 50% { transform: translateY(-12px) rotate(-2deg); } }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero-art { height: 200px; } }
.feature, .level-card, .mode { color: var(--ink); transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.feature:hover, .level-card:hover, .mode:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-lg); text-decoration: none; }
.feature p, .mode p { color: var(--muted); margin: 0; font-size: 0.9rem; }
.f-icon { font-size: 1.8rem; margin-bottom: 8px; width: 52px; height: 52px; display: grid; place-items: center; background: var(--soft); border-radius: 14px; }

/* ---------- Нэвтрэх ---------- */
.auth { max-width: 420px; margin: 30px auto; padding: 28px; }
.auth h2 { text-align: center; font-weight: 800; }

/* ---------- Самбар ---------- */
.dash-top { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .dash-top { grid-template-columns: 1fr; } }
.hero-card {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #fff; border: 0;
  background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.18), transparent 40%), linear-gradient(135deg, var(--primary), var(--primary-2));
}
.hero-card h2 { font-size: 1.5rem; font-weight: 800; margin: 6px 0; }
.hero-card p { opacity: 0.9; margin: 0 0 14px; }
.wotd .wotd-term { font-size: 2.4rem; font-weight: 700; margin-top: 6px; }
.wotd .wotd-term.zh { font-size: 2.8rem; }
.wotd-mean { font-weight: 700; font-size: 1.05rem; }
.wotd .row { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { padding: 16px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.s-icon { grid-row: span 2; font-size: 1.4rem; width: 46px; height: 46px; display: grid; place-items: center; background: var(--soft); border-radius: 12px; }
.s-val { font-size: 1.3rem; font-weight: 800; white-space: nowrap; }
.s-val small { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.s-lbl { color: var(--muted); font-size: 0.8rem; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted); }
.bar i { width: 100%; max-width: 34px; background: color-mix(in srgb, var(--primary) 35%, var(--line)); border-radius: 8px 8px 4px 4px; min-height: 4px; }
.bar i.met { background: linear-gradient(180deg, var(--primary-2), var(--primary)); }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-grid a { background: var(--card-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 12px; color: var(--ink); font-weight: 600; font-size: 0.9rem; }
.quick-grid a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.lv-chips { display: flex; flex-direction: column; gap: 6px; }
.lv-chip { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 10px; color: var(--ink); font-size: 0.88rem; font-weight: 600; }
.mini-bar { display: block; height: 8px; background: var(--card-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.lv-chip .mini-bar { margin: 0; }
.mini-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 99px; }

/* Зорилгын цагираг */
.goal { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.goal-txt h3 { margin-bottom: 2px; }
.goal-txt p { margin: 0 0 8px; }
.goal-ring { --p: 0; --ring: var(--primary); --track: var(--line); position: relative; flex: none; width: 104px; height: 104px; display: grid; place-items: center; }
.goal-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--p) * 1%), var(--track) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 10px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 10px));
}
.goal-ring span { position: relative; text-align: center; font-weight: 800; font-size: 1.4rem; line-height: 1; }
.goal-ring small { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.goal-ring.light { --ring: #fff; --track: rgba(255, 255, 255, 0.28); }
.goal-ring.light span { color: #fff; }
.goal-ring.light small { color: rgba(255, 255, 255, 0.85); }

/* ---------- Табууд ---------- */
.tabs { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); padding: 4px; border-radius: 14px; margin-bottom: 16px; overflow-x: auto; width: fit-content; max-width: 100%; }
.tab { background: none; border: 0; padding: 8px 16px; font-size: 0.9rem; font-weight: 700; color: var(--muted); cursor: pointer; border-radius: 10px; white-space: nowrap; font-family: inherit; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.on { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); flex-wrap: wrap; }
.seg.wide { display: flex; margin-bottom: 16px; width: fit-content; max-width: 100%; }
.seg button, .seg a { background: none; color: var(--muted); border: 0; padding: 8px 14px; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 0.88rem; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg button.on, .seg a.on { background: var(--ink); color: var(--bg); }
.info-box { margin-bottom: 20px; }
.info-box p:first-child { margin-top: 0; }
.level-card p { color: var(--muted); font-size: 0.9rem; }
.lv-badge { display: inline-block; font-weight: 800; font-size: 1.2rem; color: #fff; padding: 6px 16px; border-radius: 12px; }
.lv-badge.zh { background: var(--zh); font-family: inherit; }
.lv-badge.en { background: var(--en); }
.quick { margin-bottom: 16px; }
.mode { text-align: left; cursor: pointer; font-family: inherit; font-size: inherit; display: block; }
.mode.on { border-color: var(--primary); background: var(--soft); }
.mode.off { opacity: 0.5; }

/* ---------- Хүснэгт ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { background: var(--card-2); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--card-2); }
.w-term { font-size: 1.1rem; font-weight: 700; white-space: nowrap; }
.w-term.zh { font-size: 1.4rem; font-weight: 500; }
.w-read { color: var(--primary); font-weight: 600; font-size: 0.92rem; }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* ---------- Дүрэм / өгүүлбэр ---------- */
.grammar { margin-bottom: 16px; }
.examples { list-style: none; padding: 0; }
.examples li { padding: 4px 0; }
.examples .zh { font-size: 1.15rem; }
.mini-quiz { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 12px; }
.mq { margin-bottom: 12px; }
.mq p { margin: 4px 0 8px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.sent { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; }
.s-text { font-size: 1.08rem; font-weight: 600; }
.s-text.zh { font-size: 1.35rem; font-weight: 500; }
.s-read { color: var(--primary); font-size: 0.93rem; }
.r-text { line-height: 1.8; font-size: 1.02rem; }
.r-text.small { font-size: 0.9rem; max-height: 220px; overflow: auto; background: var(--card-2); padding: 12px; border-radius: 12px; }

/* ---------- Сонгогч ---------- */
.picker { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.picker label { flex: 1; min-width: 180px; margin: 0; }
.rate-ctl { display: flex; align-items: center; gap: 10px; margin: 0; }

/* ---------- Асуулт ---------- */
.quiz { max-width: 720px; margin: 0 auto 20px; }
.quiz-top { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 0.88rem; color: var(--muted); }
.progressbar { height: 6px; background: var(--line); border-radius: 99px; margin: 12px 0 18px; overflow: hidden; }
.progressbar div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width 0.3s; }
.quiz-prompt { text-align: center; margin-bottom: 10px; }
.q-term { font-size: 2.6rem; font-weight: 800; }
.q-term.zh { font-size: 3.2rem; font-weight: 500; }
.q-sub { color: var(--primary); font-weight: 600; }
.big-mean { font-size: 1.2rem; }
.timer { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--card-2); border: 1px solid var(--line); padding: 2px 10px; border-radius: 8px; }
.timer.low { color: var(--bad); border-color: var(--bad); }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.options.small { gap: 8px; }
@media (max-width: 560px) { .options { grid-template-columns: 1fr; } }
.opt {
  background: var(--card); border: 2px solid var(--line); border-radius: 13px; padding: 12px 14px; font-size: 0.98rem;
  color: var(--ink); cursor: pointer; text-align: left; transition: border-color 0.12s, background 0.12s, transform 0.08s; font-family: inherit; font-weight: 600;
}
.opt.zh { font-size: 1.2rem; font-family: "Noto Sans SC", sans-serif; font-weight: 500; }
.options.small .opt { padding: 8px 12px; font-size: 0.93rem; }
.opt:hover:not(:disabled) { border-color: var(--primary); background: var(--soft); }
.opt:active:not(:disabled) { transform: scale(0.98); }
.opt:disabled { cursor: default; }
.opt.correct { border-color: var(--ok); background: rgba(21, 163, 107, 0.12); }
.opt.wrong { border-color: var(--bad); background: rgba(224, 69, 58, 0.1); }
.feedback { margin-top: 16px; text-align: center; min-height: 1em; }
.feedback.ok { color: var(--ok); font-weight: 700; }
.feedback.bad { color: var(--bad); font-weight: 700; }
.feedback .btn { margin-top: 12px; }
.reveal { color: var(--ink); font-weight: 600; margin-top: 6px; font-size: 1.05rem; }
.dict-form { display: flex; gap: 10px; margin-top: 14px; }
.result, .test-intro { text-align: center; max-width: 720px; margin: 0 auto 20px; }
.result-score { font-size: 3.4rem; font-weight: 800; }
.result-score.pass { color: var(--ok); }
.result-score.fail { color: var(--bad); }
.result-mini { margin-top: 16px; }
.review { text-align: left; }
.review ul { list-style: none; padding: 0; }
.review li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.review li.ok .rv-a { color: var(--ok); }
.review li.bad .rv-a { color: var(--bad); }

/* ---------- Давталт (SRS) ---------- */
.srs-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.ss { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.ss b { display: block; font-size: 1.6rem; font-weight: 800; }
.ss span { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.ss.new b { color: var(--en); }
.ss.due b { color: var(--primary); }
.ss.learning b { color: var(--warn); }
.ss.mature b { color: var(--ok); }
@media (max-width: 520px) { .srs-stats { grid-template-columns: repeat(2, 1fr); } }
.review-stage { max-width: 640px; margin: 0 auto; }
.srs-card { position: relative; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 34px 24px; margin: 10px 0 14px; }
.srs-front { font-size: 3rem; font-weight: 800; }
.srs-front.zh { font-size: 4.4rem; font-weight: 500; }
.srs-back { border-top: 1px dashed var(--line); margin-top: 16px; padding-top: 16px; width: 100%; animation: fade 0.25s; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.srs-read { color: var(--primary); font-size: 1.3rem; font-weight: 700; }
.srs-mean { font-size: 1.5rem; font-weight: 800; margin: 4px 0; }
.srs-ex { font-style: italic; color: var(--muted); margin-top: 8px; }
.srs-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; }
.rate-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rate {
  border: 0; border-radius: 13px; padding: 12px 6px; color: #fff; font-weight: 800; font-size: 0.95rem; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform 0.08s, filter 0.15s;
}
.rate:hover { filter: brightness(1.08); }
.rate:active { transform: scale(0.96); }
.rate small { font-weight: 600; opacity: 0.85; font-size: 0.75rem; }
.rate kbd { margin: 4px 0 0; background: rgba(255, 255, 255, 0.22); }
.rate.again { background: #e0453a; }
.rate.hard { background: #e08a1e; }
.rate.good { background: #15a36b; }
.rate.easy { background: #3867d6; }

/* ---------- Тоглоом ---------- */
.flash-wrap { max-width: 520px; margin: 0 auto; }
.flashcard { position: relative; height: 290px; perspective: 1000px; cursor: pointer; margin: 10px 0; outline: none; }
.flashcard .face {
  position: absolute; inset: 0; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  backface-visibility: hidden; transition: transform 0.5s; padding: 20px; text-align: center; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.flashcard .front { background: var(--card); }
.flashcard .back { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; transform: rotateY(180deg); }
.flashcard.flipped .front { transform: rotateY(-180deg); }
.flashcard.flipped .back { transform: rotateY(0); }
.flashcard:focus-visible .face { outline: 3px solid var(--primary); }
.flashcard .back .muted { color: rgba(255, 255, 255, 0.8); }
.fc-term { font-size: 3rem; font-weight: 800; }
.fc-term.zh { font-size: 4rem; font-weight: 500; }
.fc-reading { font-size: 1.4rem; opacity: 0.9; }
.fc-meaning { font-size: 1.6rem; font-weight: 800; margin: 6px 0; }
.fc-ex { font-style: italic; opacity: 0.9; margin-top: 8px; }
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.tile { min-height: 82px; border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 14px; font-size: 0.98rem; cursor: pointer; padding: 8px; transition: all 0.15s; font-family: inherit; font-weight: 600; }
.tile.zh { font-size: 1.5rem; font-weight: 500; }
.tile:hover { border-color: var(--primary); }
.tile.sel { border-color: var(--primary); background: var(--soft); }
.tile.done { border-color: var(--ok); background: rgba(21, 163, 107, 0.12); opacity: 0.55; cursor: default; }
.tile.wrong { border-color: var(--bad); animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.build-answer, .build-pieces { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 56px; padding: 10px; border-radius: 14px; margin: 10px 0; }
.build-answer { border: 2px dashed var(--line); background: var(--card-2); }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 11px; cursor: pointer; font-size: 1rem; font-family: inherit; font-weight: 600; box-shadow: var(--shadow); }
.build-pieces.zh .chip, .build-answer.zh .chip { font-size: 1.3rem; font-family: "Noto Sans SC", sans-serif; }
.letters .chip { min-width: 42px; font-size: 1.2rem; text-transform: lowercase; }
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--soft); border-color: var(--primary); color: var(--primary); }

/* ---------- Толь бичиг ---------- */
.dict-bar { margin-bottom: 16px; }
.dict-bar .row { justify-content: space-between; margin-bottom: 0; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; font-weight: 500; }
.dict-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.entry { padding: 14px 16px; }
.e-head { display: flex; align-items: center; gap: 6px; }
.e-head .fav { margin-left: auto; }
.e-term { font-size: 1.4rem; font-weight: 800; }
.e-term.zh { font-size: 1.7rem; font-weight: 500; }
.e-read { color: var(--primary); font-weight: 600; }
.e-mean { font-weight: 700; margin: 6px 0 2px; }
.e-ex { font-style: italic; font-size: 0.88rem; color: var(--muted); margin-top: 4px; }
.danger-zone { border-color: rgba(224, 69, 58, 0.4); }

/* ---------- IELTS дадлага ---------- */
.writing-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.writing-grid aside { display: flex; flex-direction: column; gap: 12px; }
.writing-grid aside ul { padding-left: 18px; margin: 0; font-size: 0.9rem; }
@media (max-width: 900px) { .writing-grid { grid-template-columns: 1fr; } }
.prompt-card { margin-bottom: 12px; }
.prompt-card h3 { margin-top: 10px; }
.essay { min-height: 360px; resize: vertical; line-height: 1.7; font-size: 1rem; padding: 16px; background: var(--card); }
.wc { font-size: 0.9rem; color: var(--muted); }
.wc.ok b { color: var(--ok); }
.qlist { padding-left: 20px; margin: 0; }
.qlist li { padding: 4px 0; }
.cue { background: linear-gradient(180deg, var(--soft), var(--card) 60%); }
.cue-main { font-size: 1.02rem; }
.timer-big { font-size: 2.6rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; margin-top: 10px; color: var(--muted); }
.timer-big.run { color: var(--primary); }
.recorder { margin-top: 4px; }
.clip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.clip audio { max-width: 100%; }

/* ---------- Модал (зурааны дараалал) ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal-bg { position: absolute; inset: 0; background: rgba(10, 13, 24, 0.55); backdrop-filter: blur(3px); }
.modal-box { position: relative; background: var(--card); border-radius: 20px; padding: 26px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); animation: fade 0.2s; }
.modal-x { position: absolute; top: 12px; right: 12px; background: var(--card-2); border: 1px solid var(--line); color: var(--ink); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.stroke-chars { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 16px 0 6px; }
.stroke-cell {
  width: 140px; height: 140px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-2);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 70px 70px; background-position: -1px -1px;
}

/* ---------- Мэдэгдэл ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); transition: opacity 0.4s, transform 0.4s; font-size: 0.9rem; font-weight: 600; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }
.toast.hide { opacity: 0; transform: translateY(10px); }

/* ---------- Дүрмийн карт (дэлгэгддэг) ---------- */
details.grammar { padding: 0; margin-bottom: 10px; overflow: hidden; }
details.grammar > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin: 0; color: var(--ink); }
details.grammar > summary::-webkit-details-marker { display: none; }
details.grammar > summary::after { content: "⌄"; margin-left: auto; color: var(--muted); font-size: 1.1rem; transition: transform 0.2s; }
details.grammar[open] > summary::after { transform: rotate(180deg); }
details.grammar > summary h3 { margin: 0; font-size: 1rem; }
details.grammar > :not(summary) { margin-left: 18px; margin-right: 18px; }
details.grammar > .mini-quiz { margin-bottom: 16px; }
.g-n { width: 28px; height: 28px; border-radius: 8px; background: var(--soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 0.82rem; flex: none; }
.examples li { display: flex; gap: 8px; align-items: flex-start; }
.examples li > div { display: flex; flex-direction: column; }
.ex-t { font-weight: 600; }
.ex-py { color: var(--primary); font-size: 0.88rem; }
.section-title.first { margin-top: 6px; }
.pk-title { font-weight: 800; padding: 6px 4px 10px; }

@media (max-width: 480px) { .logo-txt { display: none; } .topbar-in { gap: 8px; } }

/* ---------- HSK / IELTS тусдаа өнгө ---------- */
:root[data-track="en"] { --primary: #2f6fe4; --primary-2: #4fb3ff; --soft: #e8f0ff; }
@media (prefers-color-scheme: dark) { :root[data-track="en"]:not([data-theme="light"]) { --soft: #17233f; } }
:root[data-theme="dark"][data-track="en"] { --soft: #17233f; }
:root[data-track="en"] .btn { box-shadow: 0 4px 14px rgba(47, 111, 228, 0.25); }
:root[data-track="en"] .btn.ghost, :root[data-track="en"] .btn.audio, :root[data-track="en"] .btn.light { box-shadow: none; }
:root[data-track="en"] .goal-ring:not(.light) { --ring: var(--primary); }
.top-nav a.primary { background: var(--soft); color: var(--primary); }
.top-nav a.primary .ni { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; }
.top-nav a.primary.on { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.top-nav a.primary.on .ni { background: rgba(255, 255, 255, 0.22); }

/* ---------- Унших ---------- */
.passage { margin-bottom: 16px; }
.passage h2 { font-size: 1.3rem; margin: 0; }
.passage .r-text.zh { font-size: 1.35rem; line-height: 2; font-family: "Noto Sans SC", sans-serif; }
.r-py { color: var(--primary); line-height: 1.8; }
.r-mn { background: var(--card-2); border-left: 3px solid var(--primary); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.toggles { padding: 12px 14px; }

/* ---------- Ханз зурах ---------- */
.hz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.hz-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border-radius: 14px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); font-family: inherit; box-shadow: var(--shadow); transition: transform 0.12s, border-color 0.12s;
}
.hz-tile span { font-size: 2rem; }
.hz-tile small { color: var(--primary); font-weight: 600; font-size: 0.78rem; }
.hz-tile:hover { transform: translateY(-2px); border-color: var(--primary); }

/* ---------- Дээд мөрний товчнууд ---------- */
.icon-bar { display: flex; gap: 4px; }
.ibtn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.05rem;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); cursor: pointer; font-family: inherit;
}
.ibtn:hover { border-color: var(--primary); text-decoration: none; }
.ibadge { position: absolute; top: -4px; right: -4px; background: var(--bad); color: #fff; font-size: 0.66rem; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }
.nwrap { position: relative; }
.nmenu { position: absolute; right: -60px; top: calc(100% + 8px); width: 330px; max-height: 70vh; overflow-y: auto; padding: 10px; z-index: 50; box-shadow: var(--shadow-lg); }
.nm-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 8px; }
.nm-item { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px; color: var(--ink); font-size: 0.88rem; }
.nm-item:hover { background: var(--card-2); text-decoration: none; }
.nm-item.unread { background: var(--soft); }
.avatar-btn { padding: 0; overflow: hidden; display: grid; place-items: center; }
.av { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; vertical-align: middle; background: var(--card-2); }
.av-letter { display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--accent), #2bb3a0); color: #fff; font-weight: 800; }
.avatar-btn .av { width: 100% !important; height: 100% !important; }
@media (max-width: 1100px) { .icon-bar .ibtn[href="#/social"], .icon-bar .ibtn[href="#/leaderboard"] { display: none; } }
@media (max-width: 560px) { .icon-bar .ibtn[href="#/chat"], .icon-bar .ibtn[href="#/friends"] { display: none; } .nmenu { right: -100px; width: min(330px, 92vw); } }
.boot { min-height: 50vh; display: grid; place-items: center; gap: 10px; text-align: center; }
.boot .logo-mark { width: 64px; height: 64px; font-size: 2rem; border-radius: 18px; animation: pulse 1.2s infinite; margin: 0 auto; }

/* ---------- Профайл ---------- */
.profile-hero { display: flex; gap: 26px; align-items: center; margin-bottom: 18px; padding: 26px; background: linear-gradient(135deg, var(--soft), var(--card) 70%); }
.profile-hero h1 { margin: 0 0 4px; font-size: 1.8rem; }
.ph-avatar { position: relative; flex: none; }
.ph-avatar .av { box-shadow: 0 0 0 4px var(--card), 0 0 0 6px var(--primary); }
.ph-upload { position: absolute; right: -2px; bottom: -2px; width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; margin: 0; box-shadow: var(--shadow); }
.ph-stats { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; }
.ph-stats span { color: var(--muted); font-size: 0.9rem; }
.ph-stats b { color: var(--ink); font-size: 1.1rem; }
.note-card { margin-bottom: 16px; font-size: 0.9rem; color: var(--muted); }
@media (max-width: 600px) { .profile-hero { flex-direction: column; text-align: center; } .ph-stats, .profile-hero .row { justify-content: center; } }

/* ---------- Тэргүүлэгчид ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; margin-bottom: 16px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--ink); padding: 18px 10px; }
.pod:hover { text-decoration: none; border-color: var(--primary); }
.pod.p1 { padding-top: 26px; padding-bottom: 30px; background: linear-gradient(180deg, var(--soft), var(--card)); border-color: var(--primary); }
.pod-medal { font-size: 1.8rem; }
.pod-xp { font-weight: 800; color: var(--primary); font-size: 1.1rem; }
.pod.me, .lb-row.me { outline: 2px solid var(--primary); }
.lb-list { padding: 6px; }
.lb-row { display: grid; grid-template-columns: 36px 36px 1fr auto auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; color: var(--ink); }
.lb-row:hover { background: var(--card-2); text-decoration: none; }
.lb-rank { font-weight: 800; color: var(--muted); text-align: center; }
.lb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .lb-row { grid-template-columns: 28px 36px 1fr auto; } .lb-row .muted { display: none; } }

/* ---------- Найзууд ---------- */
.ulist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.urow { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.urow:hover { background: var(--card-2); }
.uname { font-weight: 700; color: var(--ink); flex: 1; }
.uact { display: flex; gap: 6px; align-items: center; }
h3.mt { margin-top: 18px; }
.friend-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.fcard { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.fcard a b { color: var(--ink); }
.empty { padding: 40px 20px; }
.empty .f-icon { margin: 0 auto 10px; }

/* ---------- Чат ---------- */
.chat-shell { display: grid; grid-template-columns: 260px 1fr; gap: 16px; height: calc(100vh - 150px); min-height: 460px; }
.chat-side { overflow-y: auto; padding: 14px; }
.croom { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; color: var(--ink); font-weight: 600; font-size: 0.92rem; }
.croom:hover { background: var(--card-2); text-decoration: none; }
.croom.on { background: var(--soft); color: var(--primary); }
.ci { width: 26px; text-align: center; }
.chat-side .nav-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 800; margin: 14px 4px 6px; }
.chat-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 800; display: flex; align-items: center; gap: 10px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--card-2); }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble-msg { background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 8px 12px; font-size: 0.94rem; word-break: break-word; }
.msg.mine .bubble-msg { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: 0; border-radius: 16px 16px 4px 16px; }
.msg.mine .bubble-msg a { color: #fff; text-decoration: underline; }
.mh { display: flex; gap: 8px; font-size: 0.75rem; margin-bottom: 2px; }
.mh span { opacity: 0.6; }
.chat-form { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
@media (max-width: 800px) { .chat-shell { grid-template-columns: 1fr; height: auto; } .chat-side { max-height: 200px; } .chat-main { height: 70vh; } .msg { max-width: 92%; } }

/* ---------- Сошиал ---------- */
.social-wrap { max-width: 720px; margin: 0 auto; }
.composer .row.top { align-items: flex-start; margin-top: 0; }
.composer textarea { flex: 1; resize: vertical; width: auto; }
.img-prev { position: relative; display: inline-block; margin-top: 10px; }
.img-prev img { max-height: 200px; border-radius: 12px; }
.img-prev .icon-btn { position: absolute; top: 6px; right: 6px; background: var(--card); }
.post { margin-top: 14px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-head a b { color: var(--ink); }
.post-del { margin-left: auto; }
.post-text { margin: 12px 0; line-height: 1.6; word-break: break-word; }
.post-img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 14px; margin: 6px 0; }
.post-foot { display: flex; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.react { background: none; border: 1px solid transparent; border-radius: 99px; padding: 5px 12px; cursor: pointer; font-size: 0.95rem; color: var(--muted); font-family: inherit; font-weight: 700; }
.react:hover { background: var(--card-2); }
.react.on { background: var(--soft); color: var(--primary); border-color: var(--primary); }
.cm-toggle { margin-left: auto; }
.comments { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.cmt { display: flex; gap: 10px; }
.cmt-b { background: var(--card-2); border-radius: 12px; padding: 8px 12px; font-size: 0.9rem; flex: 1; }
.cmt-b a b { color: var(--ink); }
.cmt-form { display: flex; gap: 8px; }

/* Чатын зураг */
.chat-img { display: block; max-width: 260px; max-height: 300px; border-radius: 12px; margin: 4px 0; cursor: zoom-in; object-fit: cover; }
.chat-prev { margin: 8px 12px 0; }
.chat-prev img { max-height: 120px; }
.chat-form .ibtn { flex: none; margin: 0; }
.nm-head span { display: flex; gap: 2px; }
.nm-ask { margin: 2px 0 8px; }

/* =====================================================================
   МОНГОЛ ЗАГВАР — хар, цагаан, өлзий ба алхан хээ (сүүлд ачаалагдаж бусдыг дарна)
   ===================================================================== */
:root, :root[data-track="en"] {
  --bg: #ffffff; --card: #ffffff; --card-2: #f6f6f4; --ink: #0a0a0a; --muted: #6b6b6b; --line: #e4e4e0;
  --primary: #c51811; --primary-2: #c51811; --soft: #f7eceb; --accent: #0a0a0a;
  --zh: #c51811; --en: #0a0a0a; --ok: #1d7a46; --bad: #c51811; --warn: #a86400;
  --radius: 0px; --shadow: none; --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.12);
  --hee: url("../img/alhan.svg"); --ulzii: url("../img/ulzii.svg");
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #000; --card: #0b0b0b; --card-2: #141414; --ink: #f4f4f2; --muted: #9a9a96; --line: #262626; --soft: #2a0d0b; --en: #f4f4f2; --accent: #f4f4f2; --hee: url("../img/alhan-w.svg"); }
}
:root[data-theme="dark"] { --bg: #000; --card: #0b0b0b; --card-2: #141414; --ink: #f4f4f2; --muted: #9a9a96; --line: #262626; --soft: #2a0d0b; --en: #f4f4f2; --accent: #f4f4f2; --hee: url("../img/alhan-w.svg"); }

body { background: var(--bg); }
h1, h2, h3, .page-head h1, .section-title, .logo-txt, .hero h1 { font-family: var(--display); letter-spacing: -0.01em; }
h1, .page-head h1 { font-weight: 800; text-transform: uppercase; }
h2, .section-title { font-weight: 600; }
h3 { font-weight: 600; font-size: 1.02rem; }
.card, .table-wrap, .opt, .tile, .chip, .input, .seg, .tabs, .track-sw, .ss, .flashcard .face, .modal-box, .pmenu, .nmenu, .bubble-msg, .cmt-b, .hz-tile, .quick-grid a, .lv-pick button, .side-src button, .icon-btn, .ibtn, .react, .r-text.small, .note, .badge, .pill, .tag, .stroke-cell, .goal-ring span, .post-img, .chat-img, .img-prev img { border-radius: 0 !important; }
.card { border: 1px solid var(--line); box-shadow: none; }
.card:hover { box-shadow: none; }

/* Өлзий тэмдэг (mask — өнгө нь currentColor) */
.ulzii, .page-head h1::before, .page-head h1::after, .section-title::before, .orn::before, .orn::after {
  content: ""; display: inline-block; width: 0.9em; height: 0.9em; background: currentColor;
  -webkit-mask: var(--ulzii) center / contain no-repeat; mask: var(--ulzii) center / contain no-repeat; vertical-align: -0.08em;
}
.page-head h1 { display: inline-flex; align-items: center; gap: 0.5em; font-size: clamp(1.25rem, 2.6vw, 1.75rem); }
.page-head h1::before, .page-head h1::after { color: var(--primary); width: 0.75em; height: 0.75em; }
.section-title { display: flex; align-items: center; gap: 0.5em; }
.section-title::before { color: var(--primary); width: 0.8em; height: 0.8em; }

/* Алхан хээний зурвас */
.hee { height: 12px; background: var(--hee) repeat-x left center / 24px 12px; opacity: 0.9; }

/* Дээд мөр */
.topbar { background: var(--bg); backdrop-filter: none; border-bottom: 0; }
.topbar::after { content: ""; display: block; height: 12px; background: var(--hee) repeat-x left center / 24px 12px; border-top: 1px solid var(--ink); }
.logo-mark { border-radius: 0; background: var(--ink); color: var(--bg); width: 40px; height: 40px; font-size: 1.15rem; }
.logo-txt { text-transform: uppercase; font-weight: 800; font-size: 1rem; letter-spacing: 0.04em; }
.logo-txt small { font-family: "Manrope", sans-serif; text-transform: none; letter-spacing: 0; }
.top-nav a { font-family: var(--display); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.04em; font-weight: 600; border-radius: 0; color: var(--muted); padding: 10px 11px; }
.top-nav a:hover { background: none; color: var(--ink); }
.top-nav a.on { background: none; box-shadow: inset 0 -3px 0 var(--ink); color: var(--ink); }
.top-nav a.primary { background: var(--ink); color: var(--bg); }
.top-nav a.primary.on { background: var(--primary); color: #fff; box-shadow: none; }
.top-nav .ni { border-radius: 0; }
.nbadge, .ibadge { border-radius: 0; background: var(--primary); }
.track-sw { padding: 0; gap: 0; border: 1.5px solid var(--ink); }
.track-sw button { border-radius: 0; font-family: var(--display); font-size: 0.68rem; text-transform: uppercase; padding: 7px 10px; }
.track-sw button.on { background: var(--ink); color: var(--bg); }
.flag { border-radius: 0; }
.flag.en { background: var(--ink); color: var(--bg); }
.ibtn { border: 1.5px solid var(--ink); background: var(--bg); width: 38px; height: 38px; }
.ibtn:hover { background: var(--ink); color: var(--bg); }
.avatar-btn { border: 1.5px solid var(--ink); border-radius: 0; }
.avatar-btn .av, .pm-head .av { border-radius: 0; }
.av { border-radius: 0; }
.av-letter { background: var(--ink); color: var(--bg); }

/* Товчнууд */
.btn {
  border-radius: 0; background: var(--ink); color: var(--bg); box-shadow: none; border: 1.5px solid var(--ink);
  font-family: var(--display); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; font-weight: 600; padding: 11px 18px;
}
.btn:hover { box-shadow: none; background: var(--primary); border-color: var(--primary); color: #fff; text-decoration: none; }
.btn.big { font-size: 0.8rem; padding: 15px 26px; }
.btn.small { font-size: 0.64rem; padding: 7px 12px; }
.btn.ghost, .btn.audio, .btn.light { background: var(--bg); color: var(--ink); border: 1.5px solid var(--ink); }
.btn.ghost:hover, .btn.audio:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.mic { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { background: var(--primary); border-color: var(--primary); }
.btn.success { background: var(--ok); border-color: var(--ok); }
:root[data-track="en"] .btn { box-shadow: none; }
.icon-btn:hover { background: var(--card-2); }
.icon-btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
[data-fav].on { background: var(--primary); color: #fff; border-color: var(--primary); }
.input { border-radius: 0; background: var(--bg); border: 1.5px solid var(--line); }
.input:focus { outline: 0; border-color: var(--ink); }

/* Таб, сегмент */
.tabs { background: none; border: 0; border-bottom: 1.5px solid var(--ink); padding: 0; gap: 0; width: 100%; }
.tab { border-radius: 0; font-family: var(--display); text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.04em; padding: 11px 16px; }
.tab.on { background: var(--ink); color: var(--bg); }
.seg { border: 1.5px solid var(--ink); }
.seg button, .seg a { font-family: var(--display); text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.04em; }
.seg button.on, .seg a.on { background: var(--ink); color: var(--bg); }
.pk-tabs { border-bottom: 1.5px solid var(--ink); }
.pk-tabs button { font-family: var(--display); font-size: 0.64rem; }
.pk-tabs button.on { background: var(--ink); color: var(--bg); border-bottom-color: var(--ink); }
.lv-pick button { border-left-width: 3px; }
.lv-pick button b { font-family: var(--display); font-weight: 600; font-size: 0.85rem; }
.lv-pick button.on { border-left-color: var(--primary); background: var(--card-2); box-shadow: none; }
.lv-pick button.on b { color: var(--ink); }
.lv-pick button.on::after { content: ""; margin-left: auto; width: 14px; height: 14px; background: var(--primary); -webkit-mask: var(--ulzii) center / contain no-repeat; mask: var(--ulzii) center / contain no-repeat; }
.side-src button { border: 1.5px solid var(--line); }
.side-src button.on { border-color: var(--ink); background: var(--ink); color: var(--bg); box-shadow: none; }

/* Нүүр хуудас */
.hero h1 { text-transform: uppercase; font-size: clamp(1.8rem, 4.4vw, 3.2rem); line-height: 1.12; }
.grad { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--primary); }
.bubble { border-radius: 0; box-shadow: none; font-family: var(--display); }
.bubble.zh { background: var(--primary); }
.bubble.en { background: var(--ink); color: var(--bg); }
.bubble.mn { background: var(--bg); color: var(--ink); border: 2px solid var(--ink); }
.hero-art::before { content: ""; position: absolute; inset: 20px 30px; background: var(--ink); opacity: 0.06; -webkit-mask: var(--ulzii) center / contain no-repeat; mask: var(--ulzii) center / contain no-repeat; }
.feature:hover, .level-card:hover, .mode:hover { transform: none; box-shadow: none; border-color: var(--ink); }
.f-icon { border-radius: 0; background: var(--card-2); border: 1.5px solid var(--ink); }

/* Самбар */
.hero-card {
  background: var(--ink); color: var(--bg); position: relative; overflow: hidden;
}
.hero-card::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 240px; height: 240px; background: var(--bg); opacity: 0.07; -webkit-mask: var(--ulzii) center / contain no-repeat; mask: var(--ulzii) center / contain no-repeat; pointer-events: none; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card .btn.light { background: var(--primary); color: #fff; border-color: var(--primary); }
.goal-ring.light { --ring: var(--primary); --track: rgba(255, 255, 255, 0.18); }
.goal-ring.light span { color: var(--bg); }
.goal-ring.light small { color: var(--muted); }
.s-icon { border-radius: 0; background: var(--card-2); }
.stat { border-top: 3px solid var(--ink); }
.bar i, .bar i.met { border-radius: 0; background: var(--ink); }
.bar i:not(.met) { background: var(--line); }
.mini-bar, .mini-bar i, .progressbar, .progressbar div { border-radius: 0; }
.mini-bar i, .progressbar div { background: var(--primary); }
.eyebrow { font-family: var(--display); }

/* Түвшний карт */
.lv-badge { border-radius: 0; font-family: var(--display); }
.lv-badge.zh { background: var(--primary); }
.lv-badge.en { background: var(--ink); color: var(--bg); }

/* Асуулт, карт */
.opt { border-width: 1.5px; font-weight: 500; }
.opt:hover:not(:disabled) { background: var(--card-2); border-color: var(--ink); }
.opt.correct { border-color: var(--ok); background: rgba(29, 122, 70, 0.1); }
.opt.wrong { border-color: var(--bad); background: rgba(197, 24, 17, 0.08); }
.q-term, .srs-front:not(.zh), .fc-term:not(.zh), .wotd-term:not(.zh) { font-family: var(--display); }
.flashcard .back { background: var(--ink); color: var(--bg); }
.srs-card { border: 1.5px solid var(--ink); }
.srs-card::before { content: ""; position: absolute; left: 16px; top: 16px; width: 20px; height: 20px; background: var(--primary); -webkit-mask: var(--ulzii) center / contain no-repeat; mask: var(--ulzii) center / contain no-repeat; }
.rate { border-radius: 0; font-family: var(--display); font-size: 0.78rem; }
.rate.again { background: #c51811; }
.rate.hard { background: #6b6b6b; }
.rate.good { background: #0a0a0a; }
.rate.easy { background: #1d7a46; }
:root[data-theme="dark"] .rate.good { background: #f4f4f2; color: #000; }
.result-score { font-family: var(--display); }
.timer { border-radius: 0; font-family: var(--display); }
.goal-ring::before { -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px)); mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px)); }
.goal-ring:not(.light) { --ring: var(--primary); }

/* Профайл, сошиал, чат */
.profile-hero { background: var(--card); border: 1.5px solid var(--ink); position: relative; }
.profile-hero::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: var(--hee) repeat-x left center / 24px 12px; }
.ph-avatar .av { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.ph-upload { border-radius: 0; background: var(--ink); }
.pod { border-top: 3px solid var(--ink); }
.pod.p1 { background: var(--card); border: 1.5px solid var(--ink); border-top: 4px solid var(--primary); }
.pod-xp { font-family: var(--display); }
.pod.me, .lb-row.me { outline: 2px solid var(--primary); }
.msg.mine .bubble-msg { background: var(--ink); color: var(--bg); }
.croom.on { background: var(--ink); color: var(--bg); }
.react.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chat-head { font-family: var(--display); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; }
.nm-item.unread { background: var(--card-2); border-left: 3px solid var(--primary); }

/* Хүснэгт, грамматик */
.table th { font-family: var(--display); font-size: 0.64rem; background: var(--ink); color: var(--bg); }
.g-n { border-radius: 0; background: var(--ink); color: var(--bg); font-family: var(--display); }
details.grammar[open] { border-color: var(--ink); }
.r-mn { border-left-color: var(--ink); }

/* Хөл */
.footer { border-top: 0; padding-top: 0; position: relative; }
.footer::before { content: ""; display: block; height: 12px; margin-bottom: 18px; background: var(--hee) repeat-x left center / 24px 12px; border-bottom: 1px solid var(--ink); }
.footer::after { content: ""; display: block; width: 26px; height: 26px; margin: 10px auto 0; background: var(--primary); -webkit-mask: var(--ulzii) center / contain no-repeat; mask: var(--ulzii) center / contain no-repeat; }
.toast { border-radius: 0; font-family: var(--display); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
.boot .logo-mark { border-radius: 0; }
.btn, .btn.small, .btn.big, .btn.full { border-radius: 0; }
.page-head h1::before, .page-head h1::after { width: 1em; height: 1em; }
.section-title::before { width: 1em; height: 1em; }
.top-nav a { font-size: 0.64rem; padding: 10px 9px; letter-spacing: 0.02em; }
@media (max-width: 1640px) {
  .icon-bar .ibtn[href="#/leaderboard"], .icon-bar .ibtn[href="#/social"], .icon-bar .ibtn[href="#/chat"], .icon-bar .ibtn[href="#/friends"] { display: none; }
}
@media (max-width: 1360px) { .track-sw button .tw { display: none; } .logo-txt { display: none; } }

/* ===== Лого (PNG) ===== */
.logo-pic { background: none !important; width: 42px; height: 42px; padding: 0; display: block; }
.logo-pic img { width: 100%; height: 100%; display: block; }
.logo-pic .lg-d { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-pic .lg-l { display: none; } :root:not([data-theme="light"]) .logo-pic .lg-d { display: block; } }
:root[data-theme="dark"] .logo-pic .lg-l { display: none; }
:root[data-theme="dark"] .logo-pic .lg-d { display: block; }
.boot-logo { width: 84px; height: 84px; margin: 0 auto; animation: pulse 1.4s infinite; }

/* ===== Хээний сан ===== */
:root { --ulzii: url("../img/ulzii-solid.svg"); --ulzii-r: url("../img/ulzii.svg"); --hamar: url("../img/hamar.svg"); --corner: url("../img/corner.svg"); }

/* Хамар хээ — гарчгийн доор */
.hamar { display: block; width: 84px; height: 28px; margin-top: 10px; background: var(--primary); -webkit-mask: var(--hamar) left center / contain no-repeat; mask: var(--hamar) left center / contain no-repeat; }
.hamar.big { width: 120px; height: 40px; margin: 0 auto 12px; -webkit-mask-position: center; mask-position: center; }

/* Булангийн хээ: асуулт, үр дүн, унших карт, нэвтрэх хэсэг */
.quiz.card, .result.card, .test-intro, .passage, .auth { position: relative; }
.quiz.card::before, .result.card::before, .test-intro::before, .passage::before, .auth::before,
.quiz.card::after, .result.card::after, .test-intro::after, .passage::after, .auth::after {
  content: ""; position: absolute; width: 26px; height: 26px; background: var(--ink); pointer-events: none;
  -webkit-mask: var(--corner) center / contain no-repeat; mask: var(--corner) center / contain no-repeat;
}
.quiz.card::before, .result.card::before, .test-intro::before, .passage::before, .auth::before { left: 6px; top: 6px; }
.quiz.card::after, .result.card::after, .test-intro::after, .passage::after, .auth::after { right: 6px; bottom: 6px; transform: rotate(180deg); }
.quiz.card, .result.card, .test-intro, .passage, .auth { border: 1.5px solid var(--ink); padding: 28px; }

/* Самбарын хар карт: өлзий тор + том сүлжмэл өлзий */
.hero-card { background-color: var(--ink); background-image: url("../img/tile-w.svg"); background-size: 60px 60px; }
:root[data-theme="dark"] .hero-card { background-image: url("../img/tile.svg"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-card { background-image: url("../img/tile.svg"); } }
.hero-card::after { -webkit-mask-image: var(--ulzii-r); mask-image: var(--ulzii-r); opacity: 0.12; width: 260px; height: 260px; }

/* Нүүр хуудасны том өлзий */
.hero-ulzii { position: absolute; inset: 0; margin: auto; width: 240px; height: 240px; background: var(--ink); opacity: 0.08; -webkit-mask: var(--ulzii-r) center / contain no-repeat; mask: var(--ulzii-r) center / contain no-repeat; }
.hero-art::before { display: none; }

/* Хоосон төлөв, профайл, тэргүүлэгчдийн 1-р байр */
.empty .f-icon { border: 0; background: none; width: 80px; height: 80px; font-size: 0; }
.empty .f-icon::before { content: ""; display: block; width: 80px; height: 80px; background: var(--primary); -webkit-mask: var(--ulzii-r) center / contain no-repeat; mask: var(--ulzii-r) center / contain no-repeat; }
.pod.p1 .pod-medal { position: relative; }
.pod.p1::before { content: ""; position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; background: var(--primary); opacity: 0.85; -webkit-mask: var(--ulzii-r) center / contain no-repeat; mask: var(--ulzii-r) center / contain no-repeat; }
.pod { position: relative; }
.profile-hero::after { content: ""; position: absolute; right: 20px; bottom: 16px; width: 110px; height: 110px; background: var(--ink); opacity: 0.07; -webkit-mask: var(--ulzii-r) center / contain no-repeat; mask: var(--ulzii-r) center / contain no-repeat; pointer-events: none; }

/* Хөл хэсэг: хамар хээ + сүлжмэл өлзий */
.footer::after { width: 38px; height: 38px; -webkit-mask-image: var(--ulzii-r); mask-image: var(--ulzii-r); }

/* Дүрмийн нээлттэй карт: зүүн талд улаан зураас */
details.grammar[open] { border-left: 4px solid var(--primary); }

/* ===================== v14: нэмэлт боломжууд ===================== */
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0 10px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.hamar.big { display: block; margin: 0 auto 6px; width: 54px; height: 54px; }
.icon-bar .ibtn[href="#/duels"] { }
@media (max-width: 1100px) { .icon-bar .ibtn[href="#/duels"] { display: none; } }

/* чатын цэс */
.bubble-msg { position: relative; }
.msg-more { background: none; border: 0; color: inherit; opacity: .45; cursor: pointer; padding: 0 4px; font-size: 1rem; line-height: 1; margin-left: auto; }
.bubble-msg:hover .msg-more, .msg-more:focus { opacity: 1; }
.bubble-msg .mh { display: flex; align-items: center; gap: 6px; }
.msg-menu { position: absolute; top: 26px; right: 0; z-index: 30; padding: 4px; min-width: 190px; display: flex; flex-direction: column; color: var(--ink); }
.msg-menu button { background: none; border: 0; text-align: left; padding: 8px 10px; cursor: pointer; color: var(--ink); font: inherit; font-size: .9rem; }
.msg-menu button:hover { background: var(--soft); }

/* түвшин, даалгавар, тэмдэг */
.lvl-strip { display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin: 0 0 18px; }
.lvl-badge { width: 58px; height: 58px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--ink); color: var(--bg); }
.lvl-badge b { font-family: "Unbounded", sans-serif; font-size: 1.35rem; line-height: 1; }
.lvl-badge span { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; }
.lvl-info { flex: 1; min-width: 0; }
.lvl-info .mini-bar { margin: 6px 0 4px; }
.lvl-q { display: flex; flex-direction: column; align-items: center; padding: 6px 12px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.lvl-q:hover { border-color: var(--primary); text-decoration: none; }
.lvl-q span { font-size: .72rem; color: var(--muted); }
.lvl-strip.big .lvl-badge { width: 76px; height: 76px; }
.quest-list { display: grid; gap: 10px; }
.quest { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.quest .q-ic { font-size: 1.6rem; }
.quest .q-body { flex: 1; min-width: 0; }
.quest .mini-bar { margin: 6px 0 2px; }
.quest.done { border-color: var(--ok); }
.quest.claimed { opacity: .7; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bdg { border: 1px solid var(--line); background: var(--card); padding: 14px 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; filter: grayscale(1); opacity: .45; }
.bdg.got { filter: none; opacity: 1; border-color: var(--ink); }
.bdg-ic { font-size: 2rem; }
.bdg small { color: var(--muted); font-size: .72rem; }

/* жишиг шалгалт */
.mock-plan { line-height: 1.9; }
.mock-secs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.mock-secs .card { padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mock-secs span { font-family: "Unbounded", sans-serif; font-size: 1.4rem; }
.r-text.small { font-size: .95rem; max-height: 260px; overflow: auto; text-align: left; background: var(--card-2); padding: 10px 12px; }
.essay { min-height: 260px; width: 100%; margin: 10px 0; }

/* харилцан яриа */
.dlg-player .row { flex-wrap: wrap; gap: 10px; align-items: center; }
.rate-ctl, .check { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; }
.dlg-lines { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.dlg-line { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); background: var(--card); max-width: 86%; transition: border-color .2s, background .2s; }
.dlg-line.sb { align-self: flex-end; flex-direction: row-reverse; text-align: right; }
.dlg-line.on { border-color: var(--primary); background: var(--soft); }
.dlg-line > div { flex: 1; }
.dlg-sp { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--ink); color: var(--bg); }
.dlg-line.sb .dlg-sp { background: var(--primary); color: #fff; }
.dlg-t { font-size: 1.08rem; }
.dlg-hidden { color: var(--muted); letter-spacing: .2em; }

.corr { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-left: 3px solid var(--primary); background: var(--card-2); margin-top: 6px; }

/* тулаан */
.duel-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 8px; flex-wrap: wrap; }
.duel-row .vs { font-family: "Unbounded", sans-serif; color: var(--primary); font-size: .8rem; }
.duel-row .dr-st { margin-left: auto; display: flex; gap: 6px; }
.duel-q .timer.low { color: var(--bad); }

/* сторй */
.stories-bar { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 14px; margin-bottom: 8px; scrollbar-width: thin; }
.story-add, .story-av { position: relative; flex: none; background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); width: 72px; padding: 0; font: inherit; }
.story-av .av, .story-add .av { border: 3px solid var(--line); border-radius: 50%; padding: 2px; }
.story-av.new .av { border-color: var(--primary); }
.story-add .plus { position: absolute; top: 40px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.story-add small, .story-av small { font-size: .72rem; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-prev { height: 260px; display: flex; align-items: center; justify-content: center; color: #fff; text-align: center; padding: 20px; font-size: 1.2rem; font-weight: 700; margin: 10px 0; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.swatch { width: 30px; height: 30px; border: 2px solid var(--line); cursor: pointer; }
.story-modal .modal-bg { background: rgba(0, 0, 0, .88); }
.story-view { position: relative; z-index: 2; width: min(420px, 100vw); height: min(80vh, 760px); margin: auto; display: flex; align-items: center; justify-content: center; color: #fff; }
.st-bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.st-bars i { flex: 1; height: 3px; background: rgba(255,255,255,.35); position: relative; overflow: hidden; }
.st-bars i.full { background: #fff; }
.st-bars i.run::after { content: ""; position: absolute; inset: 0; background: #fff; transform-origin: left; animation: stbar 5s linear forwards; }
@keyframes stbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.st-head { position: absolute; top: 22px; left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; z-index: 3; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.st-head span { opacity: .75; font-size: .8rem; }
.st-btn { background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; }
.st-head .st-btn:first-of-type { margin-left: auto; }
.st-text { font-size: 1.4rem; font-weight: 700; text-align: center; padding: 30px; text-shadow: 0 1px 6px rgba(0,0,0,.6); white-space: pre-wrap; word-break: break-word; }
.st-nav { position: absolute; top: 70px; bottom: 0; width: 40%; background: none; border: 0; cursor: pointer; z-index: 2; }
.st-nav.prev { left: 0; } .st-nav.next { right: 0; }
.story-modal { display: flex; align-items: center; justify-content: center; }
@media (max-width: 600px) {
  .lvl-strip { flex-wrap: wrap; gap: 12px; padding: 12px; }
  .lvl-info { flex-basis: calc(100% - 74px); }
  .lvl-q { flex-direction: row; gap: 8px; width: 100%; justify-content: center; }
  .quest { flex-wrap: wrap; }
  .quest .q-body { flex-basis: calc(100% - 50px); }
  .quest > .btn, .quest > .pill { margin-left: auto; }
  .dlg-line { max-width: 100%; }
  .duel-row .dr-st { margin-left: 0; width: 100%; }
}

/* ===================== Багц, төлбөр ===================== */
.lv-pick button.locked b { opacity: .75; }
.lock-note { margin-top: 12px; padding: 12px; border: 1px dashed var(--primary); background: var(--soft); display: flex; flex-direction: column; gap: 6px; font-size: .86rem; }
.lock-note b { color: var(--primary); }
.paywall { padding: 36px 20px; }
.paywall .pw-ic { font-size: 2.6rem; }
.prem-status { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; margin-bottom: 8px; }
.ps-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px; }
.plan.best { border: 2px solid var(--ink); }
.plan-flag { position: absolute; top: -12px; right: 14px; background: var(--primary); color: #fff; font-size: .7rem; font-weight: 800; padding: 3px 10px; text-transform: uppercase; letter-spacing: .05em; }
.plan h3 { margin: 6px 0 0; }
.plan-price { font-family: "Unbounded", sans-serif; font-size: 1.7rem; line-height: 1.2; }
.plan-price small { font-family: "Manrope", sans-serif; font-size: .85rem; color: var(--muted); }
.plan-feat { padding-left: 18px; margin: 4px 0 12px; flex: 1; font-size: .9rem; }
.plan-feat li::marker { content: "✔  "; color: var(--ok); }
.pay-box { border: 1px solid var(--line); background: var(--card-2); padding: 6px 14px; margin: 10px 0; }
.pay-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pay-row:last-child { border-bottom: 0; }
.pay-row span { color: var(--muted); }
.pay-row.hl b { color: var(--primary); font-size: 1.1rem; letter-spacing: .06em; }
.copy { cursor: pointer; }
.order-card { border-color: var(--warn); margin-bottom: 12px; }
.how-pay { margin-top: 18px; }
.mono { font-family: ui-monospace, Menlo, monospace; letter-spacing: .05em; }
.input.tiny { width: 70px; display: inline-block; padding: 6px 8px; }
.row.wrap { flex-wrap: wrap; gap: 10px; }
.plan-form { margin-bottom: 12px; }
.pm-prem { font-weight: 700; }

/* ===================== Бүлэглэсэн дээд цэс (A) ===================== */
.top-nav.grouped { overflow: visible; gap: 4px; }
.top-nav.grouped > a.ng-home, .ng-btn {
  font-family: var(--display); text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; color: var(--muted); background: none; border: 0; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.top-nav.grouped > a.ng-home:hover, .ng-btn:hover, .ng:hover .ng-btn, .ng.open .ng-btn { color: var(--ink); }
.top-nav.grouped > a.ng-home.on, .ng.on .ng-btn { background: var(--ink); color: var(--bg); box-shadow: none; }
.ng { position: relative; }
.ng .caret { font-style: normal; font-size: .7em; opacity: .6; transition: transform .15s; }
.ng.open .caret { transform: rotate(180deg); }
.ndrop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 290px; padding: 6px;
  background: var(--card); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  display: none; flex-direction: column;
}
.ndrop::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.ng.open .ndrop { display: flex; }
@media (hover: hover) { .ng:hover .ndrop { display: flex; } }
.top-nav .ndrop a.nd-item {
  display: flex !important; align-items: center; gap: 12px; padding: 9px 10px; color: var(--ink); text-decoration: none;
  font-family: inherit; text-transform: none; letter-spacing: 0; font-size: .92rem; box-shadow: none; background: none;
}
.top-nav .ndrop a.nd-item:hover { background: var(--soft); }
.top-nav .ndrop a.nd-item.on { background: var(--soft); box-shadow: inset 3px 0 0 var(--primary); }
.top-nav .ndrop .nd-ic { font-size: 1.3rem; width: 30px; text-align: center; flex: none; display: inline !important; }
.top-nav .ndrop .nd-tx { display: flex !important; flex-direction: column; flex: 1; line-height: 1.25; }
.top-nav .ndrop .nd-tx b { font-weight: 800; font-size: .92rem; }
.top-nav .ndrop .nd-tx small { color: var(--muted); font-size: .76rem; font-weight: 500; }
.top-nav .ndrop .nbadge { display: inline !important; }
.ng-btn .nbadge { margin-left: 2px; }

/* ===================== Утасны доод таб цэс (D) ===================== */
.tabbar { display: none; }
@media (max-width: 800px) {
  .burger { display: none !important; }
  .top-nav, body.menu-open .top-nav { display: none !important; }
  body.authed { padding-bottom: 74px; }
  .tabbar:not([hidden]) { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: var(--bg); border-top: 2px solid var(--ink); padding-bottom: env(safe-area-inset-bottom); }
  .tb-row { display: flex; }
  .tb-row > a, .tb-row > button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 8px; font: 700 .66rem/1.2 "Manrope", sans-serif;
    color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; position: relative;
  }
  .tb-row > a span, .tb-row > button span { font-size: 1.3rem; line-height: 1.3; }
  .tb-row > .on { color: var(--primary); }
  .tb-row .tb-mid span { width: 46px; height: 46px; display: grid; place-items: center; background: var(--primary); color: #fff; margin-top: -24px; border: 3px solid var(--bg); font-size: 1.1rem; }
  .tb-row .tb-mid { color: var(--ink); }
  .tb-row .nbadge { position: absolute; top: 3px; left: 54%; font-style: normal; font-size: .6rem; }
  .tb-sheet { max-height: 68vh; overflow-y: auto; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
  .tb-sheet h6 { margin: 10px 2px 6px; font: 800 .7rem "Manrope", sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
  .tb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .tb-grid a { position: relative; border: 1.5px solid var(--line); background: var(--card); padding: 10px 4px; text-align: center; font: 700 .72rem "Manrope", sans-serif; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .tb-grid a span { font-size: 1.35rem; }
  .tb-grid a.on { border-color: var(--primary); color: var(--primary); }
  .tb-grid .nbadge { position: absolute; top: 4px; right: 4px; font-style: normal; }
  #toasts { bottom: 90px; }
}

/* ===================== Профайлын цэс ===================== */
.pmenu { width: 300px; padding: 14px; border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); max-height: calc(100vh - 90px); overflow-y: auto; }
.pmenu .pm-head { padding: 0 0 12px; }
.pmenu .pm-head b { font-size: 1rem; }
.pmenu a.pm-level { border-radius: 0; display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); background: var(--card-2); margin-bottom: 8px; }
.pm-lv { width: 38px; height: 38px; flex: none; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-family: var(--display); font-weight: 800; }
.pm-lvtx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pm-lvtx .mini-bar { margin: 4px 0 2px; }
.pm-lvtx small { color: var(--muted); font-size: .72rem; font-weight: 500; }
.pmenu .pm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0; margin: 0 0 8px; border: 0; }
.pmenu .pm-stats span { display: flex; flex-direction: column; align-items: center; border-radius: 0; padding: 6px 2px; font-size: .68rem; color: var(--muted); font-weight: 600; }
.pmenu .pm-stats b { color: var(--ink); font-size: .9rem; }
.pmenu a.pm-plan { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 8px; border: 1.5px dashed var(--primary); background: var(--soft); border-radius: 0; }
.pmenu a.pm-plan.on { border-style: solid; border-color: var(--ok); background: none; }
.pm-plan > span:first-child { font-size: 1.3rem; }
.pm-plan > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.pm-plan small { color: var(--muted); font-size: .72rem; font-weight: 500; }
.pm-plan i { font-style: normal; font-size: 1.3rem; color: var(--muted); }
.pm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.pmenu a.pm-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border: 1px solid var(--line); text-align: center; font-size: .8rem; border-radius: 0; }
.pmenu a.pm-tile span { font-size: 1.3rem; }
.pmenu a.pm-tile:hover { border-color: var(--ink); }
.pm-foot { display: flex; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.pm-foot > * { flex: 1; text-align: center !important; }
.pmenu .pm-foot #logout { border-top: 0; margin: 0; border-radius: 0; }

/* ===================== Ижил/эсрэг үг ===================== */
.rel-btn { font-size: .9rem; }
.rel-box { max-width: 620px; }
.rel-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 6px; }
.rel-term { font-size: 2.2rem; font-weight: 700; }
.rel-h { margin: 14px 0 8px; font-size: .9rem; }
.rel-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rel-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-align: left; font: inherit; min-width: 110px; }
.rel-chip:hover { border-color: var(--ink); }
.rel-chip b { font-size: 1.15rem; }
.rel-chip small { color: var(--primary); font-size: .75rem; }
.rel-chip span { font-size: .8rem; color: var(--muted); }
.rel-h.syn + .rel-row .rel-chip { border-left: 3px solid var(--ok); }
.rel-h.ant + .rel-row .rel-chip { border-left: 3px solid var(--primary); }
.rel-conf { display: flex; flex-direction: column; gap: 8px; }
.rc { display: flex; gap: 12px; align-items: center; padding: 8px; background: var(--card-2); border-left: 3px solid var(--warn); }
.rc p { margin: 0; font-size: .86rem; }

/* ===================== Мэргэжлийн үгс ===================== */
.topic-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.topic-card:hover { border-color: var(--ink); text-decoration: none; }
.tp-ic { font-size: 2.4rem; }
.topic-card h3 { margin: 0; }
.topic-card .badge { align-self: flex-start; }
.tp-card { max-width: 520px; margin: 10px auto; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-align: center; }
.tp-card.flip { border-color: var(--primary); }
.tp-term { font-size: 2.6rem; font-weight: 700; }
.tp-mean { font-size: 1.3rem; font-weight: 700; }

/* ===================== Төлөвлөгөө ===================== */
.plan-layout { grid-template-columns: minmax(260px, 360px) 1fr; gap: 16px; align-items: start; }
.plan-layout form label { display: block; margin-bottom: 12px; }
.plan-layout #plr { display: grid; gap: 14px; }
.plan-big { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.plan-big b { font-family: var(--display); font-size: 3.6rem; line-height: 1; color: var(--primary); }
.plan-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.plan-facts div { border: 1px solid var(--line); padding: 10px 4px; text-align: center; display: flex; flex-direction: column; }
.plan-facts b { font-family: var(--display); font-size: 1.3rem; }
.plan-facts small { color: var(--muted); font-size: .72rem; }
.plan-tl { padding-left: 20px; }
.plan-tl li { padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.plan-tl li.done { color: var(--ok); }
.fail-t { color: var(--bad); }
.plan-cta, .plan-mini { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: -6px 0 18px; text-decoration: none; color: var(--ink); }
.plan-cta:hover, .plan-mini:hover { border-color: var(--ink); text-decoration: none; }
.plan-cta > span { font-size: 1.8rem; }
.plan-cta div, .plan-mini .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.plan-cta small { color: var(--muted); }
.plan-cta i, .plan-mini > i { font-style: normal; font-size: 1.4rem; color: var(--muted); }
.pm-cal { display: flex; flex-direction: column; align-items: center; min-width: 56px; padding: 4px; border: 2px solid var(--ink); line-height: 1.1; }
.pm-cal b { font-family: var(--display); font-size: 1.2rem; }
.pm-cal small { font-size: .65rem; color: var(--muted); }
@media (max-width: 800px) { .plan-layout { grid-template-columns: 1fr; } .plan-facts { grid-template-columns: repeat(2, 1fr); } }

/* ===================== Хэвлэх ===================== */
.print-opts { display: flex; flex-direction: column; gap: 12px; }
.print-area { margin-top: 18px; background: #fff; color: #000; padding: 18px; border: 1px solid var(--line); }
.pr-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
.pr-head b { font-size: 1.2rem; }
.pr-head span { font-size: .8rem; color: #555; }
.pr-table { width: 100%; border-collapse: collapse; }
.pr-table th, .pr-table td { border: 1px solid #999; padding: 5px 8px; text-align: left; vertical-align: top; }
.pr-table th { background: #eee; font-size: .8rem; }
.pr-table td:first-child { width: 34px; color: #777; font-size: .8rem; }
.pr-term { font-weight: 700; }
.sz-s .pr-table td { font-size: .78rem; padding: 3px 6px; } .sz-l .pr-table td { font-size: 1.08rem; padding: 8px 10px; }
.sz-l .pr-term.zh { font-size: 1.5rem; } .sz-m .pr-term.zh { font-size: 1.2rem; }
.pr-ex { font-size: .8rem; color: #444; }
.pr-key { columns: 2; font-size: .82rem; }
.pr-break { height: 24px; }
.pc-page { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 62mm; border-top: 1px dashed #999; border-left: 1px dashed #999; margin-bottom: 18px; }
.pc { border-right: 1px dashed #999; border-bottom: 1px dashed #999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; text-align: center; }
.pc-t { font-size: 1.6rem; font-weight: 700; } .pc-t.zh { font-size: 2.4rem; }
.sz-s .pc-t.zh { font-size: 1.8rem; } .sz-l .pc-t.zh { font-size: 3rem; }
.pc-r { color: #c51811; } .pc-m { font-weight: 700; font-size: 1.1rem; } .pc-e { font-size: .72rem; color: #555; }
@media print {
  @page { size: A4; margin: 12mm; }
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; left: 0; top: 0; width: 100%; border: 0; padding: 0; margin: 0; }
  .topbar, .footer, .tabbar, #toasts, .no-print, .page-head { display: none !important; }
  #view { padding: 0 !important; margin: 0 !important; }
  .pc-page { break-after: page; page-break-after: always; margin: 0; }
  .pr-break { break-after: page; page-break-after: always; }
  .pr-table tr { break-inside: avoid; }
}

/* ===================== Дизайн A: хар цагаан + улаан, илүү их хээ ===================== */
:root { --bg: #fbfaf7; --hee-r: url("../img/alhan-r.svg"); --cloud: url("../img/cloud.svg"); }
:root[data-theme="dark"] { --bg: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #000; } }
.topbar { background: var(--bg); }
/* Толгой ба хөлийн алхан хээний өргөн тууз */
.topbar::after { height: 22px; background: var(--card) var(--hee) repeat-x 0 3px / 36px 18px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.footer::before { height: 22px; background: var(--card) var(--hee) repeat-x 0 3px / 36px 18px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }

/* Гол картууд: улаан булангийн хээ */
.card.wotd, .level-card, .topic-card, .lvl-strip, .prem-status, .plan-res, .dlg-player, .tp-card, .paywall, .plan.card, .how-pay, .profile-hero, .print-opts { position: relative; border: 2px solid var(--ink); }
.card.wotd::before, .level-card::before, .topic-card::before, .lvl-strip::before, .prem-status::before, .plan-res::before, .dlg-player::before, .tp-card::before, .paywall::before, .plan.card::before, .how-pay::before, .print-opts::before,
.card.wotd::after, .level-card::after, .topic-card::after, .lvl-strip::after, .prem-status::after, .plan-res::after, .dlg-player::after, .tp-card::after, .paywall::after, .plan.card::after, .how-pay::after, .print-opts::after {
  content: ""; position: absolute; width: 28px; height: 28px; background: var(--primary); pointer-events: none;
  -webkit-mask: var(--corner) center / contain no-repeat; mask: var(--corner) center / contain no-repeat;
}
.card.wotd::before, .level-card::before, .topic-card::before, .lvl-strip::before, .prem-status::before, .plan-res::before, .dlg-player::before, .tp-card::before, .paywall::before, .plan.card::before, .how-pay::before, .print-opts::before { left: 5px; top: 5px; }
.card.wotd::after, .level-card::after, .topic-card::after, .lvl-strip::after, .prem-status::after, .plan-res::after, .dlg-player::after, .tp-card::after, .paywall::after, .plan.card::after, .how-pay::after, .print-opts::after { right: 5px; bottom: 5px; transform: rotate(180deg); }
.quiz.card::before, .result.card::before, .test-intro::before, .passage::before, .auth::before,
.quiz.card::after, .result.card::after, .test-intro::after, .passage::after, .auth::after { background: var(--primary); width: 28px; height: 28px; }
.quiz.card, .result.card, .test-intro, .passage, .auth { border-width: 2px; }
.plan.card .plan-flag { z-index: 2; }

/* Өдрийн үг: үүлэн хээ */
.wotd-cloud { position: absolute; right: 26px; bottom: 22px; width: 120px; height: 46px; background: var(--ink); opacity: .14; -webkit-mask: var(--cloud) center / contain no-repeat; mask: var(--cloud) center / contain no-repeat; pointer-events: none; }

/* Самбарын хар карт: доод талд улаан алхан хээ */
.hero-card { border: 2px solid var(--ink); background-image: var(--hee-r), url("../img/tile-w.svg"); background-repeat: repeat-x, repeat; background-position: 0 calc(100% - 4px), 0 0; background-size: 36px 18px, 60px 60px; padding-bottom: 46px; }
.hero-card::before { content: ""; position: absolute; left: 0; right: 0; bottom: 24px; height: 2px; background: var(--primary); }
:root[data-theme="dark"] .hero-card { background-image: var(--hee-r), url("../img/tile.svg"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-card { background-image: var(--hee-r), url("../img/tile.svg"); } }

/* Статистик: зузаан хүрээ + улаан дээд зураас */
.stat { border: 2px solid var(--ink); border-top: 6px solid var(--primary); }
.stat .s-icon { border-radius: 0; background: var(--card-2); }

/* Түвшний карт, сонголт */
.level-card { transition: transform .15s, box-shadow .15s; }
.level-card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); border-color: var(--ink); }
.lv-pick button.on { box-shadow: inset 4px 0 0 var(--primary); }
.lv-chip { border: 2px solid var(--ink); padding: 8px 10px; background: var(--card); }
.lv-chip:hover { border-color: var(--primary); text-decoration: none; }

/* Хэсгийн гарчгийн доор жижиг хамар хээ */
.section-title { position: relative; padding-bottom: 14px; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 64px; height: 10px; background: var(--primary); -webkit-mask: var(--hee) repeat-x left center / 20px 10px; mask: var(--hee) repeat-x left center / 20px 10px; }

/* Товч: улаан идэвхтэй сүүдэр */
.btn:not(.ghost):not(.light):hover { box-shadow: 4px 4px 0 var(--primary); transform: translate(-2px, -2px); }
.btn { transition: transform .12s, box-shadow .12s; }

/* Хуудасны гарчгийн доорх хамар хээг томруулах */
.page-head .hamar { width: 110px; height: 36px; }

/* ===================== Хувилбар B: монгол бичиг, тамга, судар ===================== */
:root { --sudar: #fbf6ea; --mnfont: "Noto Sans Mongolian", "Mongolian Baiti", serif; }
:root[data-theme="dark"] { --sudar: #17130c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sudar: #17130c; } }
/* Босоо монгол бичиг */
.mn-card { padding-left: 74px !important; }
.mn-side { position: absolute; left: 18px; top: 28px; bottom: 28px; width: 40px; border-right: 2px solid var(--primary); display: flex; justify-content: center; padding-top: 4px; }
.mn-side span, .mn-foot { font-family: var(--mnfont); writing-mode: vertical-lr; text-orientation: mixed; color: var(--primary); font-size: 1.8rem; line-height: 1; letter-spacing: .02em; }
.mn-motto { margin: -4px 0 12px; font-style: italic; }
.footer { position: relative; }
.mn-foot { display: block; margin: 0 auto 10px; font-size: 1.15rem; height: auto; max-height: 220px; width: fit-content; opacity: .85; }
@media (max-width: 480px) { .mn-card { padding-left: 58px !important; } .mn-side { left: 10px; width: 34px; } .mn-side span { font-size: 1.4rem; } }

/* Тамга: зөв хариулт ба дүн */
.opt { position: relative; }
.opt.correct::after {
  content: "ЗӨВ"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%) rotate(-9deg);
  border: 2px solid var(--primary); color: var(--primary); font: 800 .66rem var(--display); letter-spacing: .08em; padding: 3px 7px;
  box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3px var(--primary); background: transparent; animation: tamga .28s ease-out;
}
.tamga {
  position: absolute; right: 22px; top: 22px; z-index: 2; pointer-events: none;
  min-width: 96px; padding: 14px 10px; text-align: center; border: 3px solid var(--primary); color: var(--primary);
  font: 800 .95rem var(--display); letter-spacing: .06em; transform: rotate(-12deg); opacity: .92;
  box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 5px var(--primary); animation: tamga .45s cubic-bezier(.2, 1.6, .4, 1);
}
.tamga.re { color: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 5px var(--ink); }
@keyframes tamga { from { transform: scale(2.2) rotate(-25deg); opacity: 0; } }
.opt.correct::after { animation-name: tamga-s; }
@keyframes tamga-s { from { transform: translateY(-50%) scale(2) rotate(-25deg); opacity: 0; } }
@media (max-width: 600px) { .tamga { right: 10px; top: 10px; min-width: 76px; padding: 9px 6px; font-size: .75rem; } }

/* Судар маягийн флаш карт */
.srs-card, .flashcard .front, .tp-card { background: var(--sudar) !important; border: 3px double var(--ink) !important; }
.srs-card::before, .tp-card::before, .flashcard .front::before { content: ""; position: absolute; left: 16px; top: 16px; bottom: 16px; width: 8px; height: auto; background: var(--primary); -webkit-mask: none; mask: none; transform: none; }
.srs-card::after, .tp-card::after, .flashcard .front::after { content: ""; position: absolute; right: 16px; top: 16px; bottom: 16px; width: 8px; height: auto; background: var(--primary); -webkit-mask: none; mask: none; transform: none; }
.srs-card, .tp-card { padding-left: 46px !important; padding-right: 46px !important; }
.srs-card .srs-tools { right: 34px !important; }
.mn-side { top: 46px; }

/* ===================== Чат: систем, ❤️, тогтоосон ===================== */
.chat-welcome { margin: 10px 12px 0; padding: 12px 14px; border: 1.5px solid var(--ink); background: var(--soft); font-size: .9rem; }
.chat-pin { margin: 8px 12px 0; padding: 10px 12px; border: 1.5px solid var(--primary); border-left-width: 5px; background: var(--card); display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.chat-pin .pin-ic { flex: none; }
.chat-pin > div { flex: 1; min-width: 0; word-break: break-word; }
.msg { align-items: flex-start; }
.msg .msg-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; }
.msg.mine .msg-col { align-items: flex-end; }
.mheart { background: none; border: 0; cursor: pointer; font-size: 1.05rem; padding: 4px; align-self: center; opacity: .55; transition: transform .15s, opacity .15s; }
.msg:hover .mheart, .mheart.on { opacity: 1; }
.mheart:active { transform: scale(1.3); }
.msg.mine .mheart { order: -1; }
.mreact:empty { display: none; }
.rstack { display: inline-flex; align-items: center; background: none; border: 0; padding: 0 2px; cursor: pointer; }
.rstack .av { border: 2px solid var(--card); margin-left: -7px; border-radius: 50%; }
.rstack .av:first-child { margin-left: 0; }
.rmore { font-size: .72rem; font-weight: 700; margin-left: 4px; background: var(--card-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 99px; color: var(--muted); }
.msg.sys .sys-h { display: flex; gap: 8px; align-items: baseline; font-size: .82rem; }
.msg.sys .sys-h b { color: var(--primary); }
.msg.sys .sys-h span { color: var(--muted); font-size: .75rem; }
.bubble-msg.sys-b { background: var(--card); border: 2px solid #c9952a; box-shadow: 3px 3px 0 #c9952a; font-weight: 700; line-height: 1.6; position: relative; padding-right: 30px; }
.bubble-msg.sys-b .msg-more { position: absolute; top: 6px; right: 6px; }
.av-sys { border-radius: 50%; border: 2px solid var(--ink); background: var(--card); object-fit: contain; padding: 3px; }
.mention { color: var(--primary); font-weight: 800; }
/* Үзсэн хүмүүс */
.pviews { margin-left: auto; color: var(--muted); font-size: .85rem; padding: 6px 8px; }
.seen-row { display: flex; align-items: center; gap: 8px; width: 100%; background: var(--card-2); border: 0; border-top: 1px solid var(--line); padding: 8px 14px; cursor: pointer; font: 600 .85rem "Manrope", sans-serif; color: var(--muted); text-align: left; margin-top: 6px; }
.seen-av { display: inline-flex; flex-wrap: wrap; }
.seen-av .av { border: 2px solid var(--card); border-radius: 50%; margin-left: -6px; }
.seen-av .av:first-child { margin-left: 0; }
.st-seen { position: absolute; left: 10px; right: 10px; bottom: 12px; z-index: 4; display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.55); color: #fff; border: 0; padding: 8px 12px; cursor: pointer; font: 600 .85rem "Manrope", sans-serif; border-radius: 10px; }
.st-seen span { display: inline-flex; }
.st-seen .av { border: 2px solid #000; border-radius: 50%; margin-left: -6px; }
.ulist { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; margin-top: 10px; }
.ulist-row { display: flex; align-items: center; gap: 12px; padding: 8px; color: var(--ink); text-decoration: none; }
.ulist-row:hover { background: var(--card-2); text-decoration: none; }
/* Мэдэгдлийн цэс: зурагтай, хүсэлт шууд зөвшөөрөх */
.nm-item.has-av { display: flex; align-items: center; gap: 10px; }
.nm-item .av { flex: none; border-radius: 50%; }
.nm-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.nm-req { display: flex; gap: 4px; align-items: center; flex: none; }
.chat-promo { margin: 8px 12px 0; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 1.5px solid #c9952a; border-left-width: 5px; background: var(--card); font-size: .9rem; }
.chat-promo .cp-body { flex: 1; min-width: 0; line-height: 1.5; }
.chat-promo .cp-body b { color: var(--primary); margin-right: 4px; }
.chat-promo .btn { flex: none; }
@media (max-width: 600px) { .chat-promo { flex-wrap: wrap; } .chat-promo .btn { width: 100%; } }
/* Бараан горимд өөрийн мессеж уншигдахуйц */
.msg.mine .bubble-msg { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.msg.mine .bubble-msg .mh span, .msg.mine .bubble-msg .msg-more { color: inherit; opacity: .7; }
@media (max-width: 600px) {
  .chat-welcome, .chat-pin, .chat-promo { font-size: .8rem; padding: 8px 10px; margin: 6px 8px 0; }
  .chat-promo .cp-body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
/* Шинэ лого: хээтэй дугуй доторх өлзий */
.logo-pic { width: 48px; height: 48px; }
.logo-pic img { object-fit: contain; }
.boot-logo { width: 96px; height: 96px; object-fit: contain; }

/* ===================== Утас: B · Өнөөдрийн даалгавар ===================== */
.mob-only { display: none; }
@media (max-width: 800px) {
  .mob-only { display: block; }
  /* Самбар: «Өнөөдөр» самбар гол байр эзэлнэ */
  body.pg-dashboard #quest-mount, body.pg-dashboard .hero-card, body.pg-dashboard .stats { display: none !important; }
  body.pg-dashboard .page-head h1 { font-size: 1.15rem; }
  body.pg-dashboard .page-head .hamar, body.pg-dashboard .page-head p { display: none; }
  body.pg-dashboard .dash-top { grid-template-columns: 1fr; }
  body.pg-dashboard { padding-bottom: 140px; }
  .td-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
  .td-stats a { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border: 2px solid var(--ink); border-top: 5px solid var(--primary); background: var(--card); color: var(--ink); text-decoration: none; }
  .td-stats b { font-family: var(--display); font-size: 1rem; }
  .td-stats small { font-size: .68rem; color: var(--muted); }
  .td-h { font-family: var(--display); font-size: 1.2rem; margin: 4px 0 10px; }
  .td-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
  .td-task { display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px solid var(--ink); background: var(--card); }
  .td-task.done { opacity: .6; border-color: var(--line); }
  .td-ic { font-size: 1.5rem; flex: none; }
  .td-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .td-b b { font-size: .92rem; }
  .td-b small { color: var(--muted); font-size: .74rem; }
  .td-b .mini-bar { margin: 5px 0 0; }
  .td-go { flex: none; background: var(--primary); color: #fff; border: 0; padding: 8px 12px; font: 800 .68rem var(--display); text-transform: uppercase; text-decoration: none; cursor: pointer; }
  .td-go:hover { text-decoration: none; }
  .td-ok { flex: none; width: 32px; height: 32px; display: grid; place-items: center; background: var(--ok); color: #fff; font-weight: 800; }
  .td-fab { position: fixed; left: 14px; right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 70; display: block; text-align: center; padding: 15px; background: var(--primary); color: #fff; font: 800 .9rem var(--display); text-transform: uppercase; box-shadow: 0 5px 0 var(--ink); text-decoration: none; }
  .td-fab:hover { text-decoration: none; }
  /* Дээд мөр: зөвхөн хэрэгтэй товчнууд */
  .top-actions #theme { display: none; }
  .tb-grid button { position: relative; border: 1.5px solid var(--line); background: var(--card); padding: 10px 4px; text-align: center; font: 700 .72rem "Manrope", sans-serif; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
  .tb-grid button span { font-size: 1.35rem; }
  /* Үгийн жагсаалт: хүснэгтийн оронд мөр карт */
  table.words thead { display: none; }
  table.words, table.words tbody { display: block; }
  table.words tr { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "t m a" "t r a" "s s s"; align-items: center; column-gap: 12px; background: var(--card); border: 1.5px solid var(--line); padding: 10px 12px; margin-bottom: 6px; }
  table.words td { border: 0 !important; padding: 0 !important; }
  table.words td.w-term { grid-area: t; font-size: 1.5rem; min-width: 52px; }
  table.words td.w-read { grid-area: r; color: var(--primary); font-size: .82rem; }
  table.words td:nth-child(4) { grid-area: m; font-weight: 700; }
  table.words td:first-child { grid-area: s; display: flex; gap: 4px; margin-top: 4px; }
  table.words td:last-child { grid-area: a; }
  table.words .hide-sm { display: none; }
  .table-wrap:has(table.words) { border: 0; background: none; overflow: visible; }
}
@media (max-width: 800px) {
  .page-head .hamar { display: none; }
  .page-head p { font-size: .82rem; margin-top: 2px; }
  .page-head h1 { font-size: 1.15rem; }
  .lvl-side { display: flex; flex-direction: column; gap: 8px; }
  .lvl-side > a.btn { display: inline-flex; width: auto; padding: 9px 10px; font-size: .7rem; }
  .lvl-side:has(> a.btn) { display: grid; grid-template-columns: 1fr 1fr; }
  .lvl-side:has(> a.btn) > .picker, .lvl-side:has(> a.btn) > .card, .lvl-side:has(> a.btn) > .lock-note { grid-column: 1 / -1; }
  .lock-note { padding: 8px 10px; font-size: .78rem; }
}

/* Хэвлэх: брэндтэй толгой (A) */
.pr-brand { display: flex; align-items: center; gap: 12px; }
.pr-brand img { width: 58px; height: 58px; }
.pr-brand.small img { width: 40px; height: 40px; }
.pr-bn { flex: 1; display: flex; flex-direction: column; }
.pr-bn b { font: 800 1.45rem "Unbounded", sans-serif; letter-spacing: .03em; color: #111; }
.pr-bn span { color: #666; font-size: .72rem; }
.pr-meta { text-align: right; display: flex; flex-direction: column; }
.pr-meta b { font: 800 .9rem "Unbounded", sans-serif; color: #111; }
.pr-meta span { color: #666; font-size: .75rem; }
.pr-rule { border-top: 2px solid #111; margin: 10px 0 12px; height: 15px; background: url("../img/alhan-r.svg") repeat-x 0 5px / 24px 12px; }
.pr-foot { display: none; }
.pr-table th { background: #111; color: #fff; font: 800 .62rem "Unbounded", sans-serif; text-transform: uppercase; }
.pr-table td.pr-term + td { color: #c51811; }
@media print {
  .pr-foot { display: flex; position: fixed; left: 0; right: 0; bottom: 0; justify-content: space-between; font-size: 9px; color: #777; border-top: 1px solid #ccc; padding-top: 4px; background: #fff; }
  .pr-foot img { width: 11px; height: 11px; vertical-align: -2px; }
  #print-area { padding-bottom: 24px; }
  .pr-table { margin-bottom: 30px; }
}
/* Хэвлэх: цаасны голд бүдэг лого (хуудас бүрд) */
.print-area { position: relative; }
.pr-wm { position: absolute; left: 50%; top: 260px; width: 62%; max-width: 440px; transform: translateX(-50%); opacity: .07; pointer-events: none; z-index: 0; }
.print-area > *:not(.pr-wm) { position: relative; z-index: 1; }
@media print {
  .pr-wm { position: fixed; top: 50%; transform: translate(-50%, -50%); width: 70%; max-width: none; opacity: .07; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-area > .pr-foot { position: fixed; }
}
/* Монгол → хятад / англи толь */
.mn-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mn-hit { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.mn-hit.exact { background: var(--soft); }
.mn-hit .e-term { font-weight: 700; font-size: 1.2rem; }
.mn-hit .e-term.zh { font-size: 1.4rem; }
.mn-hit .e-read { color: var(--primary); font-size: .82rem; }
.mn-hit .mn-m { flex: 1; color: var(--muted); font-size: .85rem; text-align: right; }
@media (max-width: 700px) { .mn-cols { grid-template-columns: 1fr; } }
/* Диктант */
.dict-form.sent { flex-direction: column; align-items: stretch; }
.dict-form.sent textarea { width: 100%; font-size: 1.1rem; }
.dict-diff { margin: 8px 0; font-size: 1.15rem; line-height: 1.8; }
.dict-diff .d-ok { color: var(--ok); }
.dict-diff .d-miss { color: var(--bad); text-decoration: underline wavy; }
/* @mention */
.chat-form { position: relative; }
.mention-sug { position: absolute; left: 60px; bottom: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 4px; display: flex; flex-direction: column; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.mention-sug button { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 7px 8px; cursor: pointer; color: var(--ink); font: 600 .9rem "Manrope", sans-serif; text-align: left; }
.mention-sug button.on, .mention-sug button:hover { background: var(--soft); }
.mention-sug .av { border-radius: 50%; }
.mention.me { background: var(--primary); color: #fff !important; padding: 0 4px; }
.msg.for-me .bubble-msg { box-shadow: inset 4px 0 0 var(--primary); }
/* Өгүүллэг, соёл: үг дээр дарахад утга */
.story-read, #rd { position: relative; }
.rd-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.rd-text { font-size: 1.15rem; line-height: 2.1; }
.rd-text.zh { font-size: 1.45rem; line-height: 2.4; }
.rd-text ruby rt { font-size: .5em; color: var(--primary); }
.tk { cursor: pointer; border-bottom: 1px dashed transparent; transition: background .12s; }
.tk:hover { border-bottom-color: var(--primary); }
.tk.on { background: var(--soft); border-bottom-color: var(--primary); }
.rd-mn { margin-top: 14px; padding: 12px 14px; background: var(--card-2); border-left: 3px solid var(--primary); line-height: 1.7; }
.tk-pop { position: absolute; z-index: 20; width: 200px; padding: 10px 12px; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--primary); display: flex; flex-direction: column; gap: 2px; }
.tk-pop .tk-w { font-size: 1.4rem; font-weight: 700; }
.tk-pop .tk-m { font-weight: 700; }
.tk-pop [data-say] { position: absolute; right: 6px; top: 6px; }
.culture-card .cu-ic { font-size: 2.2rem; }
.cu-vocab { display: flex; flex-direction: column; }
.cu-v { display: grid; grid-template-columns: auto auto auto 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cu-v b.zh { font-size: 1.2rem; }
.cu-v span:last-child { text-align: right; color: var(--muted); }
.cu-ph { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ---- Алдааны дэвтэр ---- */
.mk-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mk-stat { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.mk-stat b { font-size: 1.8rem; color: var(--accent, #c0392b); line-height: 1.1; }
.mk-act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.mk-list { display: grid; gap: 8px; margin-top: 12px; }
.mk-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.mk-w { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mk-w b { font-size: 1.25rem; }
.mk-w span { overflow-wrap: anywhere; }
.mk-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
@media (max-width: 600px) { .mk-act { margin-left: 0; width: 100%; } .mk-act > * { flex: 1; } }

/* ---- Үгийн тулаан: олон хүн нэгэн зэрэг ---- */
.d-red { --dc: #c51811; } .d-blue { --dc: #2f4fb3; } .d-green { --dc: #1d7a46; } .d-gold { --dc: #b07800; }
.dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.duel-hero { display: flex; align-items: center; gap: 18px; background: var(--ink); color: #fff; border-color: var(--ink); }
.dh-art { display: grid; grid-template-columns: repeat(2, 30px); gap: 5px; flex: none; }
.dh-art span { display: grid; place-items: center; height: 30px; background: var(--dc); color: #fff; font-size: .9rem; }
.dh-txt { display: flex; flex-direction: column; gap: 4px; }
.dh-txt b { font-family: var(--display); font-size: .95rem; letter-spacing: .02em; }
.dh-txt small { opacity: .75; }
.duel-start { grid-template-columns: 1.3fr 1fr; gap: 14px; margin: 14px 0; }
.duel-start .card { display: flex; flex-direction: column; gap: 8px; }
.duel-start .card .btn.block { margin-top: auto; }
.df-list { display: flex; flex-wrap: wrap; gap: 6px; }
.df-list p { width: 100%; margin: 0; }
.df-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1.5px solid var(--line); cursor: pointer; font-size: .85rem; }
.df-item input { display: none; }
.df-item.on { border-color: var(--primary); background: var(--soft); }
.dj-code { text-transform: uppercase; letter-spacing: .3em; font-family: var(--display); text-align: center; }
.duel-row.inv { border-left: 4px solid var(--primary); }
.duel-row .grow { flex: 1; min-width: 0; }
.dr-ppl { display: flex; }
.dr-ppl > span + span { margin-left: -8px; }
.dr-ppl .avatar { box-shadow: 0 0 0 2px var(--card); }

/* лобби */
.dl { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.dl-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.dl-code { display: flex; gap: 6px; margin-top: 4px; }
.dl-code span { width: 44px; height: 54px; display: grid; place-items: center; border: 2px solid var(--ink); font: 800 1.6rem var(--display); background: var(--card-2); }
.dl-info { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dl-seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dl-seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 8px 14px; border: 2px dashed var(--line); text-align: center; min-height: 150px; justify-content: center; }
.dl-seat.on { border: 2px solid var(--dc); background: color-mix(in srgb, var(--dc) 7%, var(--card)); animation: seatIn .4s cubic-bezier(.2, 1.5, .4, 1); }
.dl-seat.on::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--dc); }
.dl-seat b { font-size: .9rem; overflow-wrap: anywhere; }
.dl-seat small { color: var(--muted); font-size: .75rem; }
.dl-q { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--line); color: var(--muted); font: 700 1.4rem var(--display); animation: pulse 1.6s ease-in-out infinite; }
.dl-crown { position: absolute; top: 8px; right: 8px; }
@keyframes seatIn { from { transform: scale(.8); opacity: 0; } }
@keyframes pulse { 50% { opacity: .45; } }
.dl-inv { display: flex; flex-direction: column; gap: 6px; }
.dl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font: inherit; font-size: .85rem; }
.dl-chip:hover { border-color: var(--primary); }
.dl-wait { font-weight: 600; }
.btn.big { padding: 16px; font-size: 1rem; }

/* тоолуур */
.dq-count { max-width: 520px; margin: 30px auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; text-align: center; }
.dq-count b { font: 800 7rem/1 var(--display); color: var(--primary); }
.dq-count b.pop { animation: cnt .9s ease-out; }
.dq-count span { font: 700 1.1rem var(--display); letter-spacing: .1em; text-transform: uppercase; }
@keyframes cnt { from { transform: scale(1.8); opacity: 0; } 30% { opacity: 1; } }

/* асуулт */
.dq-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.dq { display: flex; flex-direction: column; gap: 14px; position: relative; }
.dq-top { display: flex; align-items: center; gap: 12px; }
.dq-timer { flex: 1; height: 10px; background: var(--card-2); border: 1.5px solid var(--ink); overflow: hidden; }
.dq-timer i { display: block; height: 100%; width: 100%; background: var(--ink); }
.dq-timer i.low { background: var(--bad); }
.dq-sec { font: 800 1.3rem var(--display); min-width: 2ch; text-align: right; }
.dq-prompt { text-align: center; padding: 10px 0 4px; }
.dq-prompt .q-term { font-size: 3rem; }
.dq-mean { font: 700 1.5rem var(--display); }
.dq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dq-opt { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; border: 0; background: var(--dc); color: #fff; font: 700 1.05rem var(--body, inherit); text-align: left; cursor: pointer; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .22); transition: transform .12s, opacity .3s, filter .3s; }
.dq-opt.zh { font-size: 1.5rem; }
.dq-opt:hover:not(:disabled) { transform: translateY(-2px); }
.dq-opt:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.dq-opt:disabled { cursor: default; }
.dq-opt:disabled:not(.picked):not(.right) { opacity: .55; }
.dq-opt.picked { outline: 4px solid var(--ink); outline-offset: 2px; }
.dq-opt.dim { opacity: .25; filter: grayscale(.7); }
.dq-opt.right { opacity: 1; filter: none; outline: 4px solid var(--ok); outline-offset: 2px; animation: right .5s; }
.dq-opt.right::after { content: "✔"; margin-left: auto; font-size: 1.3rem; }
@keyframes right { 40% { transform: scale(1.04); } }
.dq-mk { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, .22); font-size: .85rem; }
.dq-note { min-height: 28px; text-align: center; }
.dq-note .tamga { top: auto; bottom: 14px; right: 18px; }

/* онооны самбар */
.dsb h3 { margin: 0 0 8px; }
.dsb-row { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 1px solid var(--line); background: var(--card); position: relative; }
.dsb-row:last-child { border-bottom: 0; }
.dsb-row.me { background: var(--soft); }
.dsb-row.left { opacity: .45; }
.dsb-rk { width: 18px; font: 800 .9rem var(--display); color: var(--muted); }
.dsb-row:first-child .dsb-rk { color: var(--primary); }
.dsb-b { flex: 1; min-width: 0; }
.dsb-b b { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsb-b .mini-bar { margin: 4px 0 0; height: 6px; }
.dsb-b .mini-bar i { transition: width .6s; }
.dsb-sc { font: 800 .95rem var(--display); }
.dsb-row em { font-style: normal; font-weight: 700; font-size: .8rem; min-width: 40px; text-align: right; }
.dsb-row em.ok { color: var(--ok); animation: seatIn .4s; }
.dsb-row em.bad { color: var(--bad); }
.dsb-row em.ans { color: var(--ok); }
.dsb-row em.think { color: var(--muted); animation: pulse 1.2s infinite; }

/* төгсгөл: тавцан */
.dfin { text-align: center; max-width: 760px; margin: 0 auto; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 10px; margin: 20px 0 10px; }
.pd { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: seatIn .6s backwards; }
.pd b { font-size: .95rem; overflow-wrap: anywhere; }
.pd small { color: var(--muted); font-size: .75rem; }
.pd-bar { width: 100%; display: grid; place-items: center; background: var(--ink); color: #fff; font: 800 1.8rem var(--display); margin-top: 6px; }
.pd-1 .pd-bar { height: 130px; background: var(--primary); }
.pd-2 .pd-bar { height: 95px; }
.pd-3 .pd-bar { height: 70px; background: #5b5b5b; }
.pd-1 { animation-delay: .5s; } .pd-2 { animation-delay: .25s; }

@media (max-width: 800px) {
  .duel-start { grid-template-columns: 1fr; }
  .dq-layout { grid-template-columns: 1fr; }
  .dsb { order: -1; padding: 8px 10px; }
  .dsb h3 { display: none; }
  .dsb #dsb { display: flex; gap: 6px; overflow-x: auto; }
  .dsb-row { flex-direction: column; gap: 2px; min-width: 76px; border: 1px solid var(--line); padding: 6px 4px; text-align: center; }
  .dsb-row .mini-bar, .dsb-rk { display: none; }
  .dsb-b b { font-size: .72rem; max-width: 70px; }
  .dsb-row em { min-width: 0; text-align: center; }
  .dl-seats { grid-template-columns: repeat(2, 1fr); }
  .dl-code span { width: 38px; height: 46px; font-size: 1.3rem; }
  .dl-info { align-items: flex-start; }
  .dq-prompt .q-term { font-size: 2.4rem; }
  .dq-opt { min-height: 64px; font-size: .95rem; }
}
.dq-opt.picked.dim { opacity: .6; filter: none; outline: 4px solid var(--bad); }
.dq-opt.picked.dim::after { content: "✗"; margin-left: auto; font-size: 1.3rem; }

/* тулаан: горим ба зураг → бичих */
.dm-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dm-mode { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 2px solid var(--line); cursor: pointer; text-align: center; }
.dm-mode input { display: none; }
.dm-mode .dm-ic { font-size: 1.6rem; }
.dm-mode b { font-size: .85rem; }
.dm-mode small { color: var(--muted); font-size: .72rem; line-height: 1.25; }
.dm-mode.on { border-color: var(--primary); background: var(--soft); }
.dq-pic { font-size: 8rem; line-height: 1.1; text-align: center; padding: 6px 0; animation: seatIn .4s cubic-bezier(.2, 1.5, .4, 1); }
.dq-hint { text-align: center; margin: 0; color: var(--muted); opacity: 0; transform: translateY(6px); transition: .4s; }
.dq-hint.on { opacity: 1; transform: none; }
.dq-show { text-align: center; font-size: 1.1rem; }
.dq-show b { color: var(--ok); font-size: 1.4rem; }
.dq-type { display: flex; gap: 8px; max-width: 520px; width: 100%; margin: 0 auto; }
.dq-type .input { flex: 1; font-size: 1.3rem; padding: 14px 16px; text-align: center; border: 2px solid var(--ink); }
.dq-type.ok .input { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--card)); }
.dq-type.bad .input { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--card)); text-decoration: line-through; }
.dsb-txt { display: block; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsb-txt.ok { color: var(--ok); } .dsb-txt.bad { color: var(--bad); }
@media (max-width: 800px) { .dq-pic { font-size: 5.5rem; } .dm-modes { grid-template-columns: 1fr; } .dm-mode { flex-direction: row; gap: 8px; text-align: left; } .dm-mode small { margin-left: auto; } }
.dm-modes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.dm-mode { position: relative; padding: 16px 10px 14px; background: var(--card); gap: 4px; transition: transform .15s, border-color .15s; }
.dm-mode:hover { transform: translateY(-2px); border-color: var(--ink); }
.dm-mode .dm-ic { font-size: 2.2rem; }
.dm-mode b { font-size: .95rem; }
.dm-mode.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.dm-free { position: absolute; top: 6px; right: 6px; background: var(--ok); color: #fff; font-size: .62rem; font-weight: 800; padding: 2px 6px; text-transform: uppercase; }
.dq-say { width: 110px; height: 110px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-size: 3rem; cursor: pointer; box-shadow: 0 6px 0 #7a0e0a; animation: pulse 1.6s infinite; }
.dq-say:active { transform: translateY(3px); box-shadow: 0 3px 0 #7a0e0a; }
.dq-claim { font: 700 1.5rem var(--display); margin-top: 8px; color: var(--primary); }
.dq-opts.two .dq-opt { justify-content: center; font-size: 1.3rem; min-height: 88px; }
.dq-mean.big { font-size: 2rem; text-align: center; padding: 18px 0 6px; }
@media (max-width: 800px) { .dm-modes { grid-template-columns: 1fr 1fr; } .dm-mode { flex-direction: column; text-align: center; } .dm-mode small { margin-left: 0; } .dq-mean.big { font-size: 1.5rem; } }
.dq-say { animation: sayPulse 1.6s ease-in-out infinite; }
@keyframes sayPulse { 50% { transform: scale(1.07); } }

/* ---- Нийтийн чатын жижиг цонх ---- */
#cdock { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
#cdock > * { pointer-events: auto; }
#cdock[hidden] { display: none; }
.cd-head { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-size: 1.6rem; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transition: transform .15s; }
.cd-head:hover { transform: scale(1.06); }
.cd-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--ink); color: #fff; font: 800 .75rem/22px var(--display, sans-serif); border: 2px solid var(--card); }
.cd-x { position: absolute; top: -6px; left: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); color: var(--muted); font: 700 .65rem/20px sans-serif; font-style: normal; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); display: none; }
.cd-head:hover .cd-x { display: block; }
#cdock.open .cd-x { display: none; }
.cd-pop { display: flex; align-items: center; gap: 10px; max-width: 320px; padding: 12px 12px 12px 14px; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); border-left: 4px solid var(--primary); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); cursor: pointer; }
.cd-pop[hidden] { display: none; }
.cd-pop.in { animation: cdIn .35s cubic-bezier(.2, 1.4, .4, 1); }
.cd-pop > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cd-pop span { font-size: .88rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@keyframes cdIn { from { transform: translateY(16px) scale(.95); opacity: 0; } }
.cd-ic { border: 0; background: none; color: inherit; cursor: pointer; font-size: .95rem; padding: 4px 6px; text-decoration: none; }
.cd-panel { width: 340px; height: 460px; display: flex; flex-direction: column; background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); box-shadow: 0 16px 40px rgba(0, 0, 0, .25); animation: cdIn .3s; }
.cd-panel[hidden] { display: none; }
.cd-panel header { display: flex; align-items: center; gap: 2px; padding: 10px 10px 10px 14px; background: var(--ink); color: #fff; }
.cd-panel header b { flex: 1; }
.cd-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--card-2); }
.cd-m { display: flex; gap: 8px; align-items: flex-end; }
.cd-m.mine { justify-content: flex-end; }
.cd-b { max-width: 78%; display: flex; flex-direction: column; padding: 8px 11px; background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; font-size: .9rem; overflow-wrap: anywhere; }
.cd-m.mine .cd-b { background: var(--primary); color: #fff; border-color: var(--primary); border-radius: 14px 14px 4px 14px; }
.cd-b b { font-size: .75rem; color: var(--primary); }
.cd-b small { font-size: .65rem; opacity: .6; align-self: flex-end; }
.cd-form { display: flex; border-top: 1.5px solid var(--line); }
.cd-form input { flex: 1; border: 0; padding: 13px 14px; font: inherit; background: var(--card); color: var(--ink); outline: none; }
.cd-form button { border: 0; background: var(--primary); color: #fff; width: 52px; font-size: 1.1rem; cursor: pointer; }
@media (max-width: 800px) {
  #cdock { right: 12px; bottom: 84px; }
  .cd-panel { width: calc(100vw - 24px); height: min(70vh, 480px); }
  .cd-pop { max-width: calc(100vw - 24px); }
  .cd-head { width: 52px; height: 52px; }
}
@media print { #cdock { display: none !important; } }

.cd-panel header { background: var(--primary); color: #fff; }
.cd-panel header .cd-ic { color: #fff; opacity: .9; }
.cd-panel header .cd-ic:hover { opacity: 1; }

/* ---- Footer ---- */
#foot-body { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#foot-body p { margin: 0; }
.ft-line b { color: var(--ink); font-size: 1rem; }
.ft-dot { color: var(--muted); margin: 0 6px; }
.ft-copy { color: var(--muted); font-size: .85rem; }
.ft-soc { display: flex; gap: 10px; margin: 4px 0; }
.ft-soc a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); transition: .15s; }
.ft-soc a:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: translateY(-2px); text-decoration: none; }
.ft-dev { color: var(--muted); font-size: .88rem; }
.ft-dev a, .ft-dev span { color: var(--ink); font-weight: 600; }
.ft-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; font-size: .88rem; }
.ft-links a { color: var(--ink); opacity: .8; }
.ft-links a:hover { color: var(--primary); opacity: 1; }
.legal { max-width: 820px; line-height: 1.7; }
.legal h3 { margin: 22px 0 6px; font-size: 1.02rem; }
.legal h3:first-child { margin-top: 0; }
.legal ul { padding-left: 20px; }
.del-box { border: 2px solid var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--card)); padding: 16px; margin: 16px 0; }

/* ---- Lessonly лого: бүтэн нэртэй лого толгойд ---- */
.logo-pic { width: auto !important; height: 34px !important; }
.logo-pic img { width: auto !important; height: 100% !important; }
.logo-txt { display: none !important; }
@media (max-width: 800px) { .logo-pic { height: 28px !important; } }

/* =====================================================================
   Lessonly нүүр, нэвтрэх, бүртгүүлэх (үргэлж цайвар)
   ===================================================================== */
body.pg-home, body.pg-login, body.pg-register { background: #fff !important; color-scheme: light; }
body.pg-home .topbar, body.pg-login .topbar, body.pg-register .topbar,
body.pg-home > .footer, body.pg-login > .footer, body.pg-register > .footer { display: none !important; }
body.pg-home #view, body.pg-login #view, body.pg-register #view { max-width: none; padding: 0; }
.ld { --l-ink: #0b1020; --l-muted: #5d6984; --l-line: #e3e9f5; --l-bg2: #f4f7fd; --l-blue: #0a47ff; --l-blue2: #3d8bff;
  color: var(--l-ink); background: #fff; font-family: "Inter", "Noto Sans SC", sans-serif; line-height: 1.55; }
.ld h1, .ld h2, .ld b { font-family: "Inter", sans-serif; text-transform: none; letter-spacing: -.02em; }
.ld h1::before, .ld h1::after, .ld h2::before { display: none !important; }
.ld em { font-style: normal; background: linear-gradient(90deg, var(--l-blue), var(--l-blue2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ld a { color: inherit; text-decoration: none; }
.ld-logo { height: 34px; width: auto; display: block; }
.ld-eyebrow { color: var(--l-blue2); font-weight: 800; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.ld-muted, .ld small { color: var(--l-muted); }
.ld-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; padding: 14px 22px; font: 700 15px "Inter", sans-serif; border: 1.5px solid transparent; cursor: pointer; white-space: nowrap; transition: transform .12s, box-shadow .12s, background .12s; }
.ld-btn:hover { transform: translateY(-1px); text-decoration: none; }
.ld-btn.pri { background: var(--l-blue); color: #fff !important; box-shadow: 0 8px 20px rgba(10, 71, 255, .28); }
.ld-btn.pri:hover { background: #0a3ce0; }
.ld-btn.sec { background: #fff; border-color: var(--l-line); color: var(--l-ink); }
.ld-btn.sec:hover { border-color: #c5d2ea; }
.ld-btn.wh { background: #fff; color: var(--l-ink) !important; }
.ld-btn.sm { padding: 10px 18px; font-size: 14px; }
.ld-btn.full { width: 100%; }
.ld-card { background: #fff; border: 1px solid var(--l-line); border-radius: 20px; padding: 20px; }
.ld-card b { display: block; margin: 8px 0 4px; font-size: 16px; }
.ld-card small { display: block; font-size: 13.5px; line-height: 1.45; }
/* nav */
.ld-nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 26px; padding: 16px max(24px, calc((100% - 1180px) / 2)); background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--l-line); }
.ld-links { display: flex; gap: 6px; }
.ld-links button { border: 0; background: none; font: 600 15px "Inter", sans-serif; color: var(--l-muted); padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.ld-links button:hover { color: var(--l-ink); background: var(--l-bg2); }
.ld-sp { flex: 1; }
.ld-nav .ld-btn + .ld-btn { margin-left: -14px; }
/* sections */
.ld-sec { padding: 64px max(24px, calc((100% - 1180px) / 2)); }
.ld-top0 { padding-top: 0; }
.ld-alt { background: var(--l-bg2); border-top: 1px solid var(--l-line); border-bottom: 1px solid var(--l-line); }
.ld-h { text-align: center; max-width: 640px; margin: 0 auto 30px; }
.ld h2 { font-size: 34px; font-weight: 900; margin: 8px 0; line-height: 1.15; }
.ld-h p { color: var(--l-muted); margin: 0; }
.ld-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 64px max(24px, calc((100% - 1180px) / 2)) 40px; }
.ld-hero h1 { font-size: 54px; line-height: 1.06; font-weight: 900; letter-spacing: -.035em; margin: 14px 0 16px; }
.ld-lead { font-size: 17.5px; color: var(--l-muted); margin: 0 0 26px; }
.ld-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.ld-small { font-size: 13px; color: var(--l-muted); margin: 14px 0 0; }
.ld-art { position: relative; height: 400px; }
.ld-art .ld-card { position: absolute; box-shadow: 0 24px 50px rgba(5, 20, 60, .14); }
.ld-word { left: 40px; top: 10px; width: 330px; height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-4deg); animation: ldFloat 6s ease-in-out infinite; }
.ld-word .zh { font-size: 110px; font-weight: 900; line-height: 1.1; }
.ld-word span { color: var(--l-blue2); font-size: 22px; }
.ld-word b { margin: 4px 0 0; font-size: 18px; }
.ld-chip1 { right: 0; top: 40px; width: 220px; padding: 14px 16px; animation: ldFloat 7s ease-in-out infinite reverse; }
.ld-chip1 i { display: block; height: 8px; border-radius: 9px; background: var(--l-line); margin-top: 8px; }
.ld-chip1 u { display: block; height: 100%; border-radius: 9px; background: var(--l-blue); }
.ld-chip2 { right: 20px; bottom: 10px; width: 240px; padding: 14px 16px; animation: ldFloat 8s ease-in-out infinite; }
.ld-art .ld-card b { margin: 0 0 2px; font-size: 14px; }
@keyframes ldFloat { 50% { translate: 0 -8px; } }
.ld-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 0; }
.ld-stats div { background: var(--l-bg2); border: 1px solid var(--l-line); border-radius: 18px; padding: 18px 20px; }
.ld-stats b { display: block; font-size: 30px; font-weight: 900; }
.ld-stats span { color: var(--l-muted); font-size: 14px; }
.ld-g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ld-g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ld-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.ld-ic { font-size: 28px; }
.ld-step { display: flex; gap: 14px; }
.ld-step > span { width: 42px; height: 42px; border-radius: 14px; background: var(--l-blue); color: #fff; font-weight: 900; display: grid; place-items: center; flex: none; }
.ld-step b { margin-top: 0; }
.ld-cap { font-weight: 800; letter-spacing: .1em; font-size: 12px !important; }
.ld-lv { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.ld-lv span { border: 1px solid var(--l-line); border-radius: 99px; padding: 8px 14px; font-weight: 700; font-size: 13.5px; background: #fff; }
.ld-lv .fr { background: #16a34a; border-color: #16a34a; color: #fff; }
.ld-vs .ld-row { display: flex; padding: 10px 12px; border-radius: 12px; background: var(--l-bg2); margin-top: 8px; font-weight: 600; }
.ld-vs .ld-row i { font-style: normal; margin-left: auto; font-weight: 800; }
.ld-vs .ld-lv { margin-bottom: 0; margin-top: 14px; }
.ld-vs .ld-lv span { font-size: 12.5px; padding: 6px 11px; }
.ld-2 p.ld-muted { margin: 0 0 18px; }
.ld-prices { max-width: 860px; margin: 0 auto; align-items: stretch; gap: 20px; }
.ld-price { position: relative; display: flex; flex-direction: column; }
.ld-price .ld-big { font-size: 32px; font-weight: 900; }
.ld-price .ld-big small { font-size: 15px; font-weight: 600; }
.ld-price ul { padding-left: 18px; margin: 14px 0 20px; color: var(--l-muted); flex: 1; }
.ld-price li { margin: 6px 0; }
.ld-price.hi { border: 2px solid var(--l-blue); box-shadow: 0 20px 40px rgba(10, 71, 255, .12); }
.ld-badge { position: absolute; top: -12px; right: 18px; background: var(--l-blue); color: #fff; font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 99px; }
.ld-faq { max-width: 760px; margin: 0 auto; }
.ld-faq details { border-bottom: 1px solid var(--l-line); padding: 4px 4px; }
.ld-faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.ld-faq summary::-webkit-details-marker { display: none; }
.ld-faq summary::after { content: "＋"; color: var(--l-muted); }
.ld-faq details[open] summary::after { content: "－"; }
.ld-faq p { margin: 0 0 14px; color: var(--l-muted); }
.ld-final { background: linear-gradient(135deg, var(--l-blue), #5a3bff); color: #fff; border-radius: 26px; padding: 46px; text-align: center; }
.ld-final h2 { color: #fff; margin: 0 0 8px; font-size: 32px; }
.ld-final p { opacity: .85; margin: 0 0 22px; }
.ld-foot { border-top: 1px solid var(--l-line); padding: 34px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 14px; text-align: center; }
.ld-foot .ld-logo { height: 28px; }
.ld-foot p { margin: 0; color: var(--l-muted); }
.ld-foot .ft-soc a { background: #fff; color: var(--l-ink); border-color: var(--l-line); }
.ld-foot .ft-links { display: flex; gap: 6px 20px; flex-wrap: wrap; justify-content: center; }
.ld-foot .ft-dev a, .ld-foot .ft-dev span, .ld-foot .ft-links a { color: var(--l-ink); }
/* auth */
.ld-auth { min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: 48px 18px; background: linear-gradient(#eef3ff, #fff 45%); }
.ld-auth-box { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--l-line); border-radius: 24px; padding: 32px 28px; box-shadow: 0 24px 60px rgba(10, 40, 120, .08); }
.ld-auth-logo { display: flex; justify-content: center; }
.ld-auth-logo .ld-logo { height: 42px; }
.ld-auth-tag { text-align: center; color: var(--l-muted); font-weight: 600; margin: 10px 0 20px; }
.ld-tabs { display: flex; justify-content: center; gap: 30px; border-bottom: 1px solid var(--l-line); margin-bottom: 20px; }
.ld-tabs a { padding: 10px 2px; font-weight: 700; font-size: 17px; color: var(--l-muted); }
.ld-tabs a.on { color: var(--l-ink); box-shadow: inset 0 -3px 0 var(--l-blue); }
.ld-form label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--l-muted); margin: 14px 0 0; text-transform: uppercase; }
.ld-inp { display: block; width: 100%; margin-top: 7px; border: 1.5px solid var(--l-line); background: var(--l-bg2); border-radius: 14px; padding: 14px 16px; font: 500 15px "Inter", sans-serif; color: var(--l-ink); outline: none; text-transform: none; letter-spacing: 0; }
.ld-inp:focus { border-color: var(--l-blue); background: #fff; box-shadow: 0 0 0 4px rgba(10, 71, 255, .1); }
.ld-pw { position: relative; }
.ld-pw .ld-inp { padding-right: 48px; }
.ld-pw button { position: absolute; right: 8px; top: 50%; translate: 0 -50%; margin-top: 3px; border: 0; background: none; font-size: 17px; cursor: pointer; padding: 6px; }
.ld-line { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 16px; font-size: 14px; }
.ld-line a { color: var(--l-blue); font-weight: 600; }
.ld-form .ld-chk { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--l-ink); font-weight: 500; cursor: pointer; }
.ld-chk input { width: 18px; height: 18px; accent-color: var(--l-blue); }
.ld-form .error { min-height: 0; margin: 6px 0 10px; }
.ld-form > .ld-btn.pri { margin-top: 8px; }
.ld-or { display: flex; align-items: center; gap: 12px; color: var(--l-muted); font-size: 13px; margin: 18px 0; }
.ld-or::before, .ld-or::after { content: ""; flex: 1; height: 1px; background: var(--l-line); }
.ld-note { font-size: 12.5px; color: var(--l-muted); text-align: center; margin: 14px 0 0; }
.ld-note a, .ld-auth-foot a { color: var(--l-blue); }
.ld-free { margin-top: 22px; border: 1.5px dashed var(--l-line); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; color: var(--l-muted); display: flex; gap: 10px; align-items: center; }
.ld-free b { color: var(--l-ink); }
.ld-auth-foot { text-align: center; font-size: 13px; color: var(--l-muted); margin: 18px 0 0; }
@media (max-width: 900px) {
  .ld-links, .ld-hide-m { display: none; }
  .ld-nav { gap: 10px; padding: 12px 16px; }
  .ld-logo { height: 28px; }
  .ld-hero { grid-template-columns: 1fr; text-align: center; padding: 36px 18px 20px; gap: 18px; }
  .ld-hero h1 { font-size: 34px; }
  .ld-lead { font-size: 15.5px; }
  .ld-cta { flex-direction: column; }
  .ld-art { height: 290px; }
  .ld-word { left: 50%; margin-left: -120px; width: 240px; height: 240px; }
  .ld-word .zh { font-size: 80px; }
  .ld-chip1 { display: none; }
  .ld-chip2 { right: 0; bottom: 0; width: 200px; }
  .ld-sec { padding: 40px 18px; }
  .ld-stats, .ld-g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ld-stats b { font-size: 22px; }
  .ld-g3, .ld-2 { grid-template-columns: 1fr; gap: 16px; }
  .ld-rev > :first-child { order: 2; }
  .ld h2 { font-size: 25px; }
  .ld-card { padding: 16px; }
  .ld-final { padding: 32px 20px; }
  .ld-auth { padding: 24px 14px; }
  .ld-auth-box { padding: 26px 20px; }
}
.ld-faq summary { color: var(--l-ink) !important; background: none !important; font-family: "Inter", sans-serif; text-transform: none; letter-spacing: 0; }
.ld-price .ld-big small { white-space: nowrap; }
