:root {
  --bg: #f4f5f7; --card: #fff; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --brand: #0f172a; --accent: #2563eb; --good: #16a34a; --bad: #dc2626; --warn: #d97706;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.35rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 22px 0 10px; }
h3 { font-size: .95rem; margin: 14px 0 8px; }
.muted { color: var(--muted); font-size: .85rem; }
.small { font-size: .8rem; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--brand); color: #fff; }
.brand { color: #fff; font-weight: 800; letter-spacing: .5px; }
.brand span { color: #60a5fa; }
.nav { display: flex; gap: 4px; overflow-x: auto; }
.nav a { color: #cbd5e1; padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: .92rem; }
.nav a.active, .nav a:hover { color: #fff; background: rgba(255,255,255,.12); }

.view { max-width: 1100px; margin: 0 auto; padding: 16px 16px 80px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.stat b { display: block; font-size: 1.5rem; }
.item { display: flex; align-items: center; gap: 10px; color: inherit; }
.item:hover { border-color: #94a3b8; }
.item .meta { min-width: 0; }
.item .meta div:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #e2e8f0; object-fit: cover; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #475569; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; font: inherit; font-size: .9rem; cursor: pointer; }
.btn:hover { border-color: #94a3b8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: var(--accent); }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.form-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: .9rem; vertical-align: middle; }
th { font-size: .78rem; color: var(--muted); font-weight: 600; background: #f8fafc; position: sticky; top: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: .85rem; white-space: nowrap; cursor: pointer; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-left: 6px; vertical-align: middle; }
.tag { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: #eef2ff; color: #3730a3; }
.tag.off { background: #f1f5f9; color: #64748b; }
.tag.warn { background: #fef3c7; color: #92400e; }

/* Үр дүн оруулах хүснэгт */
.entry td { padding: 6px 8px; }
.entry td:first-child, .entry th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 110px; }
.entry th:first-child { background: #f8fafc; z-index: 2; }
.cell { display: flex; align-items: center; gap: 2px; }
.cell input { width: 74px; text-align: right; padding: 7px 6px; font-variant-numeric: tabular-nums; }
.cell input.saving { background: #fefce8; }
.cell input.saved { background: #f0fdf4; }
.cell input.err { background: #fef2f2; border-color: var(--bad); }
.cell.invalid input { text-decoration: line-through; color: var(--muted); }
.cell.dnf input { background: #f1f5f9; }
.st { width: 26px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font-size: .8rem; color: var(--muted); padding: 0; }
.cell.invalid .st { color: var(--bad); border-color: #fecaca; }
.cell.dnf .st { color: var(--warn); border-color: #fde68a; }
.best { font-weight: 700; font-variant-numeric: tabular-nums; }
.up { color: var(--good); } .down { color: var(--bad); }
.side-h { text-align: center; background: #f1f5f9; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 92vw; }
.toast.show { opacity: 1; }
.toast.error { background: var(--bad); }

.cat-block { margin-bottom: 14px; }
.test-pick { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.test-pick label { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: .88rem; cursor: pointer; }
.test-pick label.disabled { opacity: .5; cursor: not-allowed; }
.spark { vertical-align: middle; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.notice { padding: 10px 12px; border-radius: 8px; background: #fef3c7; color: #78350f; font-size: .85rem; margin: 10px 0; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 12px; }
  .view { padding: 12px 10px 80px; }
  .cell input { width: 64px; }
}

/* v0.2 — сан, багц, хуваарь, үнэлгээ */
textarea { width: 100%; resize: vertical; }
.field.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.card + .card { margin-top: 10px; }
.grid .card + .card, .stats .card + .card, .flow .card + .card { margin-top: 0; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 6px; }
.section-head h2 { margin: 0; }
.flow { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.step { color: inherit; display: flex; flex-direction: column; gap: 2px; }
.step b { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .85rem; }
.step span { font-weight: 600; margin-top: 6px; }
.step small { color: var(--muted); }
.step:hover { border-color: var(--accent); }

.battery-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.sticky { position: sticky; top: 64px; }
.sel-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.sel-row:last-child { border-bottom: 0; }
.icon { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; color: var(--muted); padding: 0; }
.icon:disabled { opacity: .35; cursor: default; }
.test-pick label.device { background: #fffbeb; }
.btn.small { padding: 4px 10px; font-size: .8rem; }

.tag.st-planned { background: #eff6ff; color: #1d4ed8; }
.tag.st-open { background: #dcfce7; color: #166534; }
.tag.st-closed { background: #f1f5f9; color: #475569; }
h1 .tag { vertical-align: middle; font-size: .75rem; }

.lv { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.lv1 { background: #fee2e2; color: #991b1b; }
.lv2 { background: #ffedd5; color: #9a3412; }
.lv3 { background: #fef9c3; color: #854d0e; }
.lv4 { background: #dcfce7; color: #166534; }
.lv5 { background: #15803d; color: #fff; }
.summary td { white-space: nowrap; }

.spec { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.spec .card + .card { margin-top: 0; }
.spec p { margin: 4px 0 10px; }
.spec h3, .card > h3:first-child { margin-top: 0; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
ol.rules { margin: 6px 0; padding-left: 20px; }
ol.rules li { margin: 3px 0; }
.test-card { color: inherit; display: block; }
.test-card:hover { border-color: #94a3b8; }
.test-card.inactive { opacity: .55; }
.test-card .tag { margin: 2px 2px 0 0; }
label.btn input[type=file] { display: none; }

@media (max-width: 800px) {
  .battery-layout, .spec { grid-template-columns: 1fr; }
  .sticky { position: static; }
}

/* v0.3 — спорт, ОУ нэр, хэмжих төрөл, хосолсон сорил */
.en { font-size: .78rem; color: #475569; font-style: italic; }
.en.big { font-size: .95rem; margin-top: 2px; }
.tag.sport { background: #ecfeff; color: #0e7490; }
.tag.meas { background: #f5f3ff; color: #5b21b6; }
.tag.comp { background: #fff7ed; color: #9a3412; }
.filters select, .filters input { max-width: 220px; }
.chip-check { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: .85rem; background: #fff; color: var(--ink); cursor: pointer; }
code, .formula { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
.comp-table input, .comp-table select { padding: 5px 6px; font-size: .85rem; }
.cell .fields { display: flex; flex-direction: column; gap: 3px; }
.cell select { padding: 6px 4px; font-size: .85rem; max-width: 130px; }
.cell.multi { align-items: flex-start; }
.cell .sub { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: .72rem; color: var(--muted); }
.cell .sub span { max-width: 90px; line-height: 1.1; }
.cell .sub i { font-style: normal; opacity: .7; }
.cell.multi input { width: 64px; padding: 4px 6px; }
.cell .res { font-size: .78rem; color: var(--muted); text-align: right; }
.cell select.saving { background: #fefce8; } .cell select.saved { background: #f0fdf4; } .cell select.err { background: #fef2f2; }

/* v0.4 — SaaS: нэвтрэлт, аккаунт, шалгагч, хэвлэх */
.topbar .acc { margin-left: auto; position: relative; }
.acc-menu summary { list-style: none; cursor: pointer; color: #e2e8f0; font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.acc-menu summary::-webkit-details-marker { display: none; }
.acc-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-pop { position: absolute; right: 0; top: 30px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-width: 260px; box-shadow: 0 10px 30px rgba(15,23,42,.18); z-index: 20; display: flex; flex-direction: column; gap: 2px; }
.acc-item { display: block; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }
.acc-item:hover, .acc-item.active { background: #f1f5f9; }
.acc-item.danger { color: var(--bad); }
.plan { font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .3px; }
.plan-free { background: #e2e8f0; color: #334155; }
.plan-basic { background: #dbeafe; color: #1e40af; }
.plan-pro { background: #fde68a; color: #78350f; }
.plan-ro { background: #fee2e2; color: #991b1b; }
.tag.free { background: #dcfce7; color: #166534; }
.login { max-width: 380px; margin: 40px auto; }
.acc-card { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.acc-card:hover { border-color: var(--accent); }
.usage { display: block; position: relative; font-size: .78rem; margin-top: 4px; }
.usage em { font-style: normal; font-weight: 700; color: var(--ink); }
.usage i { display: block; height: 4px; background: var(--accent); border-radius: 2px; margin-top: 4px; max-width: 100%; }
.export-row { margin: -4px 0 10px; }

/* Шалгагчийн хуудас — утас */
.run-list { display: grid; gap: 10px; }
.run-item { color: inherit; display: block; }
.run-head { position: sticky; top: 50px; z-index: 5; background: var(--bg); padding: 6px 0 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 8px 0; }
.seg button { border: 0; background: #fff; padding: 8px 16px; font: inherit; cursor: pointer; }
.seg button.on { background: var(--ink); color: #fff; }
.q-badge { font-size: .78rem; color: var(--good); }
.q-badge.warn { color: var(--warn); font-weight: 600; }
.run-athletes { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ath-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font: inherit; text-align: left; cursor: pointer; }
.ath-row .num { width: 32px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ath-row .nm { flex: 1; font-weight: 600; }
.ath-row .pg { color: var(--muted); font-size: .85rem; }
.ath-row.done { background: #f0fdf4; border-color: #bbf7d0; }
.ath-row.done .pg { color: var(--good); font-weight: 700; }
.ath-row.sel { outline: 2px solid var(--accent); }
.panel { border-color: var(--accent); box-shadow: 0 6px 20px rgba(37,99,235,.12); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.big-name { font-size: 1.25rem; font-weight: 700; }
.big-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.big-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.big-fields input, .att input, .att select { font-size: 1.25rem; padding: 12px; text-align: center; width: 100%; }
.side-title { font-weight: 700; margin: 10px 0 4px; }
.attempts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 8px 0; }
.att { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.att[data-st="invalid"] { background: #fef2f2; } .att[data-st="dnf"] { background: #f8fafc; }
.att-h { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 700; }
.st-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 8px; font-size: .78rem; cursor: pointer; }
.att .sub { font-size: .72rem; color: var(--muted); }
.panel-nav { display: flex; gap: 8px; margin-top: 12px; }
.panel-nav .big { flex: 1; padding: 14px; font-size: 1rem; justify-content: center; }

/* Хэвлэх / PDF */
.print-sheet { background: #fff; padding: 24px; border: 1px solid var(--line); border-radius: 8px; }
.print-head { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 12px; }
.print-table { margin-top: 14px; font-size: .8rem; }
.print-table th, .print-table td { border: 1px solid #cbd5e1; padding: 4px 6px; text-align: center; }
.print-table td:nth-child(2) { text-align: left; white-space: nowrap; }
.print-foot { margin-top: 12px; font-size: .75rem; color: var(--muted); }
@media print {
  .topbar, .no-print, .toast { display: none !important; }
  body, .view { background: #fff; padding: 0; max-width: none; }
  .print-sheet { border: 0; padding: 0; }
  @page { size: A4 landscape; margin: 12mm; }
}
@media (max-width: 640px) {
  .topbar .acc { margin-left: 0; }
  .run-head { top: 86px; }
}

/* v0.6 — эрх, төлбөр */
.plans-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 12px 0; }
.plan-card { cursor: pointer; border: 2px solid transparent; }
.plan-card.sel { border-color: #2563eb; box-shadow: 0 0 0 3px #dbeafe; }
.plan-card ul { margin: 10px 0 0; padding-left: 18px; line-height: 1.6; }
.months-row { gap: 8px; flex-wrap: wrap; }
.pay-live { border-left: 4px solid #2563eb; }

/* v0.7 — тайлан, dashboard */
.filters { gap: 10px; flex-wrap: wrap; align-items: flex-end; margin: 4px 0 12px; }
.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart .grid { stroke: #eef0f3; stroke-width: 1; }
.chart .base { stroke: #cbd5e1; stroke-width: 1; }
.chart .ax { font-size: 11px; fill: #64748b; }
.chart .dl { font-size: 12px; font-weight: 600; fill: #0f172a; }
.chart .ln { fill: none; stroke: #2a78d6; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .band { fill: #2a78d6; opacity: .12; }
.chart .dot { fill: #2a78d6; stroke: #fff; stroke-width: 2; }
.chart .xhair { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .thr { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 2 3; }
.chart .zone { font-size: 11px; fill: #475569; }
.chart .sdot { stroke: #fff; stroke-width: 2; cursor: pointer; }
.chart .sdot:hover { stroke: #0f172a; }
.lvbar rect { cursor: default; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0; color: #475569; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.viz-tip { position: absolute; z-index: 50; display: none; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px #0f172a1f; padding: 8px 10px; font-size: .82rem; max-width: 260px; line-height: 1.45; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f8fafc; }
.pb { font-size: .72rem; font-weight: 600; color: #1c5cab; white-space: nowrap; }
table.rank td, table.overview td { vertical-align: middle; }
@media print { .viz-tip { display: none !important; } .chart { break-inside: avoid; } h2 { break-after: avoid; } }
.plan-demo { background: #ede9fe; color: #5b21b6; }

/* v0.9 — утасны цэс, шалгагчийн горим */
html, body { overflow-x: clip; }   /* hidden нь sticky-г эвддэг (body scroll container болдог) */
#nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1 1 auto; }
#nav::-webkit-scrollbar { display: none; }
#nav a { white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 640px) { .topbar { flex-wrap: wrap; gap: 6px 10px; } #nav { order: 3; flex-basis: 100%; } }

.ring .ring-bg { fill: none; stroke: #e2e8f0; stroke-width: 3; }
.ring .ring-fg { fill: none; stroke: #2a78d6; stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray .3s; }
.ring .ring-fg.full { stroke: #16a34a; }
.ring text { font-size: 9px; font-weight: 700; fill: #0f172a; }
.t-card { display: flex; align-items: center; gap: 12px; color: inherit; }
.t-card .t-body { flex: 1; min-width: 0; }
.t-card .t-ring .ring text { font-size: 11px; }
.t-go { color: var(--accent); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.net { font-size: .78rem; padding: 3px 9px; border-radius: 999px; background: #dcfce7; color: #166534; white-space: nowrap; }
.net.off { background: #fee2e2; color: #991b1b; } .net.warn { background: #fef3c7; color: #92400e; }
.run-title { display: flex; flex-direction: column; margin: 4px 0 6px; }
.run-title b { font-size: 1.05rem; }
.progress { height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: #2a78d6; border-radius: 999px; transition: width .3s; }
.st-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: thin; }
.st-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px 4px 5px; font: inherit; font-size: .84rem; white-space: nowrap; cursor: pointer; }
.st-chip.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.st-card { margin-top: 4px; }
.st-title { font-size: 1.15rem; font-weight: 700; }
.st-rules { margin-top: 6px; }
.podium { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pod { font-size: .8rem; background: #f1f5f9; border-radius: 999px; padding: 3px 10px 3px 4px; }
.pod i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #cbd5e1; color: #0f172a; font-style: normal; font-weight: 700; font-size: .7rem; margin-right: 5px; }
.pod.p1 i { background: #fbbf24; } .pod.p2 i { background: #cbd5e1; } .pod.p3 i { background: #d6a77a; }
.ath-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 10px; }
.ath-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; border-radius: 12px; font: inherit; text-align: left; cursor: pointer; min-height: 58px; }
.ath-card:active { transform: scale(.98); }
.ath-card.done { background: #f0fdf4; border-color: #bbf7d0; }
.ath-card.part { border-color: #bfdbfe; }
.ac-badge { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; color: var(--muted); font-weight: 700; font-size: .85rem; flex: 0 0 auto; }
.ath-card.done .ac-badge { background: #16a34a; color: #fff; }
.ac-txt { display: flex; flex-direction: column; min-width: 0; }
.ac-nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-num { font-size: .75rem; color: var(--muted); }
/* доороос гарах цонх */
body.sheet-open { overflow: hidden; }
.sheet-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 40; animation: fadein .15s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #fff; border-radius: 18px 18px 0 0; max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 -10px 40px rgba(15,23,42,.25); animation: slideup .2s ease-out; max-width: 720px; margin: 0 auto; }
@keyframes slideup { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } }
.sh-head { display: flex; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.sh-name { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.sh-num { color: var(--accent); margin-right: 6px; }
.sh-prev { margin-top: 2px; }
.sh-x { font-size: 1.2rem; }
.dots { display: flex; gap: 4px; padding: 0 16px 6px; flex-wrap: wrap; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #e2e8f0; }
.dots i.ok { background: #16a34a; } .dots i.cur { background: #2a78d6; transform: scale(1.3); }
.sh-body { overflow-y: auto; padding: 4px 16px 10px; -webkit-overflow-scrolling: touch; }
.sh-nav { display: flex; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sh-nav .big { flex: 1; padding: 15px; font-size: 1.05rem; justify-content: center; }
.sh-atts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 6px 0; }
.att2 { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.att2[data-st="invalid"] { background: #fef2f2; border-color: #fecaca; } .att2[data-st="dnf"] { background: #f8fafc; }
.att2-h { display: flex; justify-content: space-between; align-items: center; }
.att2-n { font-weight: 800; color: var(--muted); }
.tri { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tri button { border: 0; background: #fff; padding: 4px 9px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--muted); }
.tri button.on[data-s="valid"] { background: #16a34a; color: #fff; } .tri button.on[data-s="invalid"] { background: #dc2626; color: #fff; } .tri button.on[data-s="dnf"] { background: #64748b; color: #fff; }
.fld { font-size: 1.45rem; padding: 12px 8px; text-align: center; width: 100%; font-variant-numeric: tabular-nums; border-radius: 10px; }
.fld.act { outline: 3px solid #93c5fd; }
.fld.flash { background: #dbeafe; transition: background .4s; }
.opts { display: flex; flex-wrap: wrap; gap: 5px; }
.opt { flex: 1 1 auto; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 8px; font: inherit; font-size: .82rem; cursor: pointer; }
.opt.on { background: #1c5cab; color: #fff; border-color: #1c5cab; }
.tool { border: 1px dashed #cbd5e1; border-radius: 14px; padding: 10px; margin: 4px 0 8px; text-align: center; }
.sw-time { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.tool .row { justify-content: center; gap: 8px; margin: 6px 0; }
.sw-go { min-width: 170px; padding: 14px; font-size: 1.1rem; justify-content: center; background: #16a34a; color: #fff; border-color: #16a34a; }
.sw-go.run { background: #dc2626; border-color: #dc2626; }
.ct { display: flex; align-items: center; gap: 8px; justify-content: center; }
.ct-plus { width: 120px; height: 120px; border-radius: 50%; border: 0; background: #2a78d6; color: #fff; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(42,120,214,.35); }
.ct-plus:active { transform: scale(.95); }
.ct-plus span { font-size: 2.6rem; font-weight: 800; line-height: 1; } .ct-plus small { font-size: .7rem; opacity: .85; }
@media (min-width: 900px) { .sheet { bottom: 24px; border-radius: 18px; } }
@media (max-width: 640px) {
  .run-head { position: static; }
  .t-card { align-items: flex-start; }
  .t-go { display: none; }
  .t-card::after { content: "›"; font-size: 1.6rem; color: var(--muted); align-self: center; }
}

/* v0.9 — dashboard графикууд */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.grid2 .card + .card { margin-top: 0; }
.grid2 h3, .card h3 { margin: 0 0 2px; font-size: 1rem; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.chart .lbl { font-size: 12px; fill: #0f172a; }
.chart .zero { stroke: #64748b; stroke-width: 1; }
.chart .seg-l { font-size: 11px; font-weight: 600; }
.hbar rect { cursor: default; }
.mx-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.mx { border-collapse: separate; border-spacing: 2px; font-size: .74rem; }
.mx th, .mx td { padding: 0; }
.mx .mx-name { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; padding: 3px 8px; white-space: nowrap; font-size: .8rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.mx .mx-avg { text-align: center; padding: 3px 6px; font-size: .8rem; }
.mx .mx-cat { font-size: .68rem; color: #64748b; font-weight: 600; text-align: left; padding: 2px 4px; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.mx .mx-h { height: 120px; vertical-align: bottom; cursor: pointer; }
.mx .mx-h span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: 500; color: #334155; padding: 4px 0; max-height: 116px; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.mx .mx-h:hover span { color: var(--accent); }
.mx td.mx-c { width: 40px; min-width: 40px; height: 24px; text-align: center; border-radius: 4px; font-variant-numeric: tabular-nums; }
.mx td.mx-c.empty { background: #f8fafc; }

/* v1.0 — оролдлогын ээлж, амралт, баталгаажуулалт, тохиргоо */
.gear { font-size: 1.15rem; }
.round-tag { display: inline-block; margin-top: 4px; background: #eff6ff; color: #1c5cab; border-radius: 999px; padding: 2px 10px; font-weight: 600; }
.adots { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 4px; }
.adots i { width: 7px; height: 7px; border-radius: 50%; background: #e2e8f0; display: inline-block; }
.adots i.ok { background: #2a78d6; } .adots i.bad { background: #e34948; }
.ath-card { position: relative; }
.ath-card.resting { background: #fffbeb; border-color: #fde68a; }
.rest-tag { font-size: .78rem; font-weight: 700; color: #92400e; font-variant-numeric: tabular-nums; }
.rest-tag.ready { color: #166534; }
.sh-rest { margin: 0 16px 6px; padding: 8px 12px; border-radius: 10px; background: #fef3c7; color: #92400e; font-size: .9rem; font-variant-numeric: tabular-nums; }
.sh-rest.ready { background: #dcfce7; color: #166534; }
.att2.cur { border-color: #2a78d6; box-shadow: 0 0 0 2px #bfdbfe; }
.att2.saved { background: #f8fafc; }
.att2-n small { font-weight: 600; color: #2a78d6; font-size: .68rem; }
.att2.saved .att2-n small { color: #16a34a; }
.confirm { text-align: center; padding: 18px 8px 8px; }
.cf-ok { width: 54px; height: 54px; border-radius: 50%; background: #16a34a; color: #fff; display: grid; place-items: center; font-size: 1.6rem; margin: 0 auto 10px; animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.cf-title { font-weight: 600; color: #334155; }
.cf-next { font-size: 1.2rem; margin: 14px 0 6px; }
.set-group { margin: 6px 0 14px; display: flex; flex-direction: column; gap: 8px; }
.set-opt, .set-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.set-row { justify-content: space-between; align-items: center; }
.set-opt span, .set-row span { display: flex; flex-direction: column; }
.set-opt small, .set-row small { color: var(--muted); font-size: .78rem; }
.set-row input[type=checkbox] { width: 22px; height: 22px; flex: 0 0 auto; }
.set-opt input { margin-top: 3px; }
.rest-seg { flex-wrap: wrap; }
.rest-seg button { padding: 8px 12px; }
#set-root .sheet { z-index: 61; } #set-root .sheet-bg { z-index: 60; }

/* v1.1 — шууд хяналт */
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #16a34a; margin-left: 6px; vertical-align: middle; box-shadow: 0 0 0 0 rgba(22,163,74,.5); animation: livepulse 2s infinite; }
.live-dot.off { background: #94a3b8; animation: none; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); } 70% { box-shadow: 0 0 0 9px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.mon-head { align-items: flex-end; }
.mon-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.big-ring .br-v { font-size: 26px; font-weight: 800; fill: #0f172a; } .big-ring .br-l { font-size: 11px; fill: #64748b; }
.mon-meta { flex: 1; min-width: 260px; }
.mon-title { font-size: 1.15rem; font-weight: 700; }
.mon-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin-top: 10px; }
.mon-kpis div { display: flex; flex-direction: column; }
.mon-kpis b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.mon-kpis span { font-size: .76rem; color: var(--muted); }
.pbv { color: #1c5cab; font-weight: 700; }
.alerts { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.alerts li { display: flex; gap: 8px; font-size: .84rem; padding: 7px 9px; border-radius: 8px; background: #fffbeb; }
.alerts li.al-invalid { background: #fef2f2; } .alerts li.al-absent { background: #f1f5f9; }
.al-ic { font-weight: 800; }
.ok-note { color: #166534; font-weight: 600; margin: 10px 0 4px; }
.pbar { display: flex; gap: 2px; height: 14px; width: 100%; }
.pbar i { display: block; height: 100%; border-radius: 4px; min-width: 3px; transition: width .5s; }
table.mon-st td { vertical-align: middle; }
tr.st-done td { background: #f0fdf4; }
.nowrap { white-space: nowrap; }
.mon-low { align-items: start; }
.feed { max-height: 560px; overflow-y: auto; padding: 6px 10px; }
.fd { display: grid; grid-template-columns: 62px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid #f1f5f9; font-size: .85rem; }
.fd:last-child { border-bottom: 0; }
.fd-t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .78rem; }
.fd-v { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fd.new { animation: fdnew 2.5s ease-out; }
@keyframes fdnew { 0% { background: #dbeafe; } 100% { background: transparent; } }
.chip-bad { font-size: .7rem; background: #fee2e2; color: #991b1b; border-radius: 999px; padding: 1px 7px; }
table.mini { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.mini th { text-align: left; font-size: .72rem; color: var(--muted); font-weight: 600; padding: 4px 6px; }
table.mini td { padding: 6px; border-top: 1px solid #f1f5f9; vertical-align: middle; }
.t-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; margin-right: 6px; }
.t-dot.on { background: #16a34a; }
.mon-grid-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; margin-top: 4px; }
table.mon-grid { border-collapse: separate; border-spacing: 2px; font-size: .72rem; }
table.mon-grid th { color: var(--muted); font-weight: 600; text-align: center; }
table.mon-grid th.mg-n { text-align: left; white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; position: sticky; left: 0; background: #fff; }
table.mon-grid td { padding: 0; text-align: center; }
table.mon-grid td i { display: block; width: 14px; height: 14px; border-radius: 3px; }
.grid2 > * { min-width: 0; }
.fd-m { min-width: 0; overflow-wrap: anywhere; }

/* v1.2 — амралтын дохио */
.alarm-bar { position: fixed; left: 50%; transform: translateX(-50%); top: 10px; z-index: 70; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  width: min(680px, 94vw); background: #92400e; color: #fff; padding: 8px 10px 8px 14px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: alarmpulse 1.2s ease-in-out infinite alternate; }
@keyframes alarmpulse { from { background: #92400e; } to { background: #b45309; } }
.al-txt { flex: 1; font-size: .88rem; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.al-ath { border: 0; background: rgba(255,255,255,.18); color: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .82rem; cursor: pointer; }
.al-ath small { opacity: .8; }
.al-stop { background: #fff; color: #92400e; border-color: #fff; font-weight: 700; white-space: nowrap; }

/* v1.3 — заавар, амралтын товч, тайлбар, видео */
.sh-info { margin: 0 16px 6px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: #f8fafc; }
.sh-info summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: #1c5cab; }
.sh-info .rules { margin: 6px 0 2px; padding-left: 18px; }
.sh-note { margin: 0 16px 6px; padding: 6px 10px; border-radius: 10px; background: #f1f5f9; font-size: .82rem; }
.note-tag { font-size: .72rem; color: #475569; }
.rest-row { display: flex; gap: 6px; align-items: center; padding: 8px 16px 0; flex-wrap: wrap; border-top: 1px solid var(--line); }
.rr { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.rr.on { background: #92400e; color: #fff; border-color: #92400e; }
.rest-btn { background: #fef3c7; border-color: #fde68a; color: #92400e; font-weight: 700; }
.rest-row + .sh-nav { border-top: 0; }
.note-step { padding: 6px 0; }
.ns-title { font-size: 1.05rem; margin-bottom: 4px; }
.ns-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.ns-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.ns-chip.on { background: #1c5cab; color: #fff; border-color: #1c5cab; }
.note-step textarea { width: 100%; font: inherit; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }
.alerts li.al-note { background: #eff6ff; }
.vbtn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 2px 7px; font: inherit; font-size: .8rem; cursor: pointer; }
.vbtn.has { background: #1c5cab; color: #fff; border-color: #1c5cab; }
.att2 { position: relative; }
.vprog { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 22px; background: #e2e8f0; border-radius: 8px; overflow: hidden; }
.vprog i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #86b6ef; transition: width .2s; }
.vprog span { position: relative; font-size: .7rem; padding-left: 6px; line-height: 22px; color: #0f172a; }
/* тоглуулагч */
#vp-root .vp-bg { position: fixed; inset: 0; background: rgba(2,6,23,.75); z-index: 80; }
.vp { position: fixed; z-index: 81; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(860px, 96vw); max-height: 96vh; overflow-y: auto; background: #0f172a; color: #e2e8f0; border-radius: 16px; padding: 12px; }
.vp .muted { color: #94a3b8; }
.vp-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.vp-x { color: #e2e8f0; font-size: 1.2rem; }
.vp-stage { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.vp-stage video { width: 100%; max-height: 62vh; display: block; }
.vp-time { position: absolute; right: 8px; top: 8px; background: rgba(0,0,0,.65); color: #fff; padding: 2px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; font-size: .9rem; }
.vp-seek { width: 100%; margin: 10px 0 6px; }
.vp-ctrl, .vp-marks, .vp-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.vp .btn { background: #1e293b; color: #e2e8f0; border-color: #334155; }
.vp .btn.primary { background: #2a78d6; border-color: #2a78d6; color: #fff; }
.vp .btn.danger { color: #fca5a5; }
.vp select { background: #1e293b; color: #e2e8f0; border: 1px solid #334155; border-radius: 8px; padding: 6px; }
.vp-play { min-width: 70px; justify-content: center; }
.vp-mv { font-variant-numeric: tabular-nums; color: #93c5fd; min-width: 64px; font-size: .85rem; }
.vp-delta { margin-left: auto; font-size: 1rem; }
.vp-list { display: flex; gap: 4px; margin-bottom: 6px; }
.vp-pick { border: 1px solid #334155; background: #1e293b; color: #e2e8f0; border-radius: 6px; padding: 2px 9px; cursor: pointer; }
.vp-pick.on { background: #2a78d6; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 8px; }
.vcard { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 0; overflow: hidden; cursor: pointer; text-align: left; font: inherit; display: flex; flex-direction: column; }
.vthumb { position: relative; aspect-ratio: 16/9; background: #0f172a; display: grid; place-items: center; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vthumb i { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.7); color: #fff; font-style: normal; font-size: .72rem; padding: 1px 6px; border-radius: 4px; }
.vmark { position: absolute; left: 6px; bottom: 6px; background: #1c5cab; color: #fff; font-size: .72rem; padding: 1px 6px; border-radius: 4px; }
.vnothumb { font-size: 2rem; }
.vmeta { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.att2-n { white-space: nowrap; }
.att2-f { display: flex; justify-content: flex-end; }
.att2-f .vbtn { font-size: .74rem; padding: 3px 8px; color: #475569; }
.att2-f .vbtn.has { color: #fff; }

/* v1.4 — хүчинтэй байх шалгуур */
.must { color: #92400e; font-weight: 600; font-size: .68rem; }
.viol { font-size: .74rem; color: #991b1b; background: #fef2f2; border-radius: 6px; padding: 3px 6px; }

/* v1.5 — Зөв/Буруу товшилт (конус) */
.tap { margin: 8px 0 4px; padding: 8px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); }
.tap.on { background: #fff; border-color: #2a78d6; box-shadow: 0 0 0 2px #bfdbfe; }
.tap-h { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.tap-h #tap-n { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.tap-dots { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.tap-dots i { width: 14px; height: 14px; border-radius: 50%; background: #e2e8f0; display: inline-block; }
.tap-dots i.ok { background: #16a34a; } .tap-dots i.bad { background: #dc2626; }
.tap-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tap-btns button { border: 0; border-radius: 14px; padding: 18px 8px; font: inherit; font-size: 1.25rem; font-weight: 800; color: #fff; cursor: pointer; touch-action: manipulation; }
.tap-ok { background: #16a34a; } .tap-bad { background: #dc2626; }
.tap-btns button:disabled { opacity: .35; }
.tap-btns button:active:not(:disabled) { transform: scale(.97); }

/* ---------- v1.6 Бие бялдар: самбар, камер, шинжилгээ ---------- */
#bs-root .sheet { z-index: 51; } #bs-root .sheet-bg { z-index: 50; }
.bp { display: flex; flex-direction: column; gap: 14px; }
.bp-hw { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.bp-hw label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted, #64748b); gap: 4px; }
.bp-hw .fld { width: 110px; font-size: 18px; padding: 8px 10px; }
.bp-bmi { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding-bottom: 6px; }
.bp-hw-note { flex-basis: 100%; }
.bp-kind { border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px; }
.bp-kh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bp-kh .btn { margin-left: auto; }
.bp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 560px; }
.bt { position: relative; aspect-ratio: 3 / 4; border: 1.5px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; overflow: hidden; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bt.has { border-style: solid; border-color: #cbd5e1; background: #0f172a; }
.bt img { width: 100%; height: 100%; object-fit: cover; }
.bt.dim { opacity: .4; }
.bt-ph { font-size: 22px; opacity: .55; }
.bt-v { position: absolute; left: 0; right: 0; bottom: 0; font-size: 12px; font-weight: 600; padding: 3px 4px; background: rgba(15,23,42,.72); color: #fff; text-align: center; }
.bt:not(.has) .bt-v { background: none; color: #475569; }
.bt-st { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: center; }
.bt-st.ok { background: var(--good); } .bt-st.warn { background: var(--warn); } .bt-st.bad { background: var(--bad); }
.bt-n { position: absolute; top: 4px; left: 4px; background: rgba(255,255,255,.9); border-radius: 6px; font-size: 11px; padding: 0 4px; }
.bt-chk { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; }
.bp-arch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #f1f5f9; border-radius: 10px; padding: 8px 10px; }
.bp-arch .small { flex: 1 1 200px; }
.bp-hist h3 { margin: 6px 0; font-size: 15px; }
.bh-g { border-top: 1px solid #e2e8f0; padding: 8px 0; }
.bh-d { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.bh-items { display: flex; flex-wrap: wrap; gap: 8px; }
.bh-it { width: 84px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; padding: 0; overflow: hidden; cursor: pointer; font-size: 11px; }
.bh-it img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: #0f172a; }
.bh-it span { display: block; padding: 2px 4px; }
@media (max-width: 520px) { .bp-grid { gap: 5px; } .bt-v { font-size: 11px; } }

/* камер */
#bc-root .bc { position: fixed; inset: 0; z-index: 90; background: #000; color: #fff; display: flex; flex-direction: column; }
.bc-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: rgba(15,23,42,.9); }
.bc-head .small { color: #cbd5e1; }
.bc-x, .bv-x { background: rgba(255,255,255,.12); color: #fff; border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 18px; }
.bc-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.bc-stage video, .bc-stage img { width: 100%; height: 100%; object-fit: contain; }
.bc-stage canvas { position: absolute; pointer-events: none; }
.bc-hint { font-size: 13px; color: #cbd5e1; padding: 6px 14px; text-align: center; }
.bc-ctrl { display: flex; align-items: center; justify-content: space-around; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: rgba(15,23,42,.9); gap: 10px; }
.bc-ctrl .btn { min-width: 52px; }
.bc-shut { width: 70px; height: 70px; border-radius: 50%; border: 5px solid #fff; background: #fff; box-shadow: inset 0 0 0 3px #000; }
.bc-shut.rec { background: #ef4444; }
.bc-shut:disabled { opacity: .5; }
.bc-cue { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(15,23,42,.82); border-radius: 14px; padding: 10px 18px; text-align: center; min-width: 200px; }
.bc-cue b { display: block; font-size: 30px; } .bc-cue small { color: #cbd5e1; }
.bc-prog { height: 6px; background: rgba(255,255,255,.2); border-radius: 3px; margin-top: 6px; overflow: hidden; } .bc-prog i { display: block; height: 100%; background: #facc15; }
.bc-level { position: absolute; left: 12px; bottom: 12px; background: rgba(15,23,42,.78); border-radius: 12px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; border: 2px solid #f59e0b; }
.bc-level.ok { border-color: #22c55e; }
.bc-level i { display: block; width: 16px; height: 16px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 30px rgba(255,255,255,.06); }
.bc-level.ok i { background: #22c55e; }
.bc-level span { font-size: 13px; font-weight: 600; }
.bc-up { height: 6px; background: rgba(255,255,255,.15); } .bc-up i { display: block; height: 100%; width: 0; background: #22c55e; transition: width .2s; }

/* харах / шинжлэх */
#bv-root .bv-bg { position: fixed; inset: 0; background: rgba(2,6,23,.8); z-index: 84; }
.bv { position: fixed; z-index: 85; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(980px, 100vw); max-height: 100vh; overflow-y: auto; background: #0f172a; color: #e2e8f0; border-radius: 16px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 700px) { .bv { border-radius: 0; height: 100vh; top: 0; transform: translateX(-50%); } }
.bv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bv .muted { color: #94a3b8; }
.bv-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bv .seg { display: inline-flex; background: #1e293b; border-radius: 10px; padding: 3px; border: 0; }
.bv .seg button { border: 0; background: none; color: #cbd5e1; padding: 6px 12px; border-radius: 8px; font-weight: 600; }
.bv .seg button.on { background: #fff; color: #0f172a; }
.bv .btn { background: #1e293b; color: #e2e8f0; border-color: #334155; }
.bv .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.bv .btn.danger { color: #fca5a5; }
.bv-stage { position: relative; display: flex; justify-content: center; background: #020617; border-radius: 10px; min-height: 200px; }
.bv-stage canvas { touch-action: none; display: block; }
.bv-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(2,6,23,.6); font-weight: 600; }
.bv-vctl { display: flex; align-items: center; gap: 6px; } .bv-vctl input[type=range] { flex: 1; }
.bv-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; } .bv-tools.hide { display: none; } .bv-tools.dim { opacity: .4; pointer-events: none; }
.tl { min-width: 38px; height: 38px; border-radius: 9px; border: 1px solid #334155; background: #1e293b; color: #e2e8f0; font-size: 16px; }
.tl.on { background: #fff; color: #0f172a; }
.tl-c { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #334155; } .tl-c.on { outline: 3px solid #fff; outline-offset: 1px; }
.tl-sep { width: 1px; height: 26px; background: #334155; margin: 0 4px; }
.bv-info { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 760px) { .bv-info { grid-template-columns: 1fr 1fr; } .bv-note { grid-column: 1 / -1; } }
.bm-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; margin: 4px 0; }
.bm-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid #1e293b; font-size: 14px; }
.bm-ic { width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; background: #334155; color: #fff; }
.bm-row.ok .bm-ic { background: #16a34a; } .bm-row.warn .bm-ic { background: #d97706; } .bm-row.bad .bm-ic { background: #dc2626; }
.bm-v { font-weight: 700; font-variant-numeric: tabular-nums; }
.bm-t { grid-column: 2 / -1; font-size: 12px; color: #94a3b8; }
.bm-t:empty { display: none; }
.bv-note { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #94a3b8; }
.bv-note textarea { background: #020617; color: #e2e8f0; border: 1px solid #334155; border-radius: 8px; padding: 8px; font: inherit; }
.bv-foot { display: flex; gap: 8px; align-items: center; } .bv-foot .sp { flex: 1; }
.bcharts { display: flex; flex-direction: column; gap: 6px; }
.bchart { width: 100%; max-width: 420px; background: #f8fafc; border-radius: 8px; --bc-band: #e0f2fe; }
.bchart .bc-t { font-size: 10px; fill: #334155; font-weight: 600; } .bchart .bc-l { font-size: 9px; fill: #64748b; } .bchart .bc-ax { stroke: #cbd5e1; }
.bp-mini { margin-top: 12px; }
.bt-dot { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; align-items: center; justify-content: center; vertical-align: -2px; }
.bt-dot.ok { background: var(--good); } .bt-dot.warn { background: var(--warn); } .bt-dot.bad { background: var(--bad); }
[hidden] { display: none !important; }
.bc-insec { flex: 1; overflow-y: auto; padding: 24px 20px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.bc-insec-ic { font-size: 44px; } .bc-insec h3 { margin: 0; font-size: 19px; } .bc-insec p { color: #cbd5e1; margin: 0; line-height: 1.5; }
.bc-insec .btn { background: #1e293b; color: #e2e8f0; border-color: #334155; padding: 12px; } .bc-insec .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 17px; }

/* ================================================================
   v2.0 — Шинэ дизайн (Figma: өнгө, үсэг, карт, цэс, хүснэгт)
   Primary #FF6175 · Action #1E33F2 · Secondary #FFAA2B · Green #09BD3C · Red #FD5353
   Text #171B1E / #717579 / #A5A5A5 · Background #FBFBFB · Card #FFF r16 · Nunito Sans
   ================================================================ */
:root {
  --primary: #ff6175; --primary-soft: #ffe7ea; --primary-hi: #fff5f6;
  --action: #1e33f2; --action-soft: #f4f5ff; --secondary: #ffaa2b;
  --good: #09bd3c; --bad: #fd5353; --warn: #ffaa2b;
  --ink: #171b1e; --ink2: #202020; --muted: #717579; --muted2: #a5a5a5; --line: #eeeeee; --line2: #f4f4f4;
  --bg: #fbfbfb; --card: #ffffff; --brand: #171b1e; --accent: var(--action);
  --radius: 16px; --sh-card: 0 4px 6px rgba(62, 73, 84, .04); --sh-hover: 0 9px 38px rgba(62, 73, 84, .10); --sh-side: 7px 0 80px rgba(0, 0, 0, .05);
  --side-w: 280px; --top-h: 84px;
  font-family: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--action); }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 700; color: var(--ink); margin: 28px 0 12px; }
h3 { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); }

/* --- sidebar --- */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); background: var(--bg); border-right: 1px solid var(--line); box-shadow: var(--sh-side);
  display: flex; flex-direction: column; z-index: 30; overflow-y: auto; scrollbar-width: thin; }
.logo { display: flex; align-items: center; gap: 12px; padding: 26px 28px 18px; color: var(--ink); }
.logo-mark { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 22px; display: grid; place-items: center; flex: none; box-shadow: 0 6px 16px rgba(255, 97, 117, .35); }
.logo-txt b { display: block; font-size: 21px; font-weight: 800; line-height: 1.1; }
.logo-txt small { color: var(--muted); font-size: 12px; }
.side-acc { position: relative; padding: 6px 22px 10px; }
.side-acc .acc-menu summary { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); font-size: 14px; }
.acc-av { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 18px; display: grid; place-items: center; flex: none; }
.acc-who { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.acc-who .acc-name { font-weight: 700; font-size: 15px; max-width: 100%; }
.acc-sub { font-size: 12px; color: var(--muted); display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.acc-car { color: var(--muted2); font-size: 12px; }
.side-acc .acc-pop { left: 22px; right: 22px; top: calc(100% - 4px); min-width: 0; border-radius: 16px; border-color: var(--line); box-shadow: var(--sh-hover); }
.acc-item { border-radius: 10px; }
.acc-item:hover, .acc-item.active { background: var(--primary-hi); }
.side-nav { display: flex; flex-direction: column; padding-bottom: 12px; }
.nav-h { font-weight: 700; font-size: 15px; color: var(--ink); padding: 18px 28px 6px; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 16px; height: 50px; padding: 0 28px; color: var(--muted); font-weight: 600; font-size: 15.5px; transition: color .15s, background .15s; }
.side-nav a svg { flex: none; }
.side-nav a:hover { color: var(--ink); background: #fff; }
.side-nav a.active { color: var(--primary); font-weight: 700; background: linear-gradient(90deg, var(--primary-hi), rgba(255, 245, 246, 0)); }
.side-nav a.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--primary); border-radius: 0 6px 6px 0; }
.side-foot { margin-top: auto; padding: 20px 28px 24px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.side-foot b { color: var(--ink); font-size: 13px; }
.scrim { display: none; }

/* --- topbar / view --- */
.topbar { position: sticky; top: 0; z-index: 20; margin-left: var(--side-w); height: var(--top-h); display: flex; flex-direction: row; align-items: center; gap: 14px;
  padding: 0 40px; background: rgba(251, 251, 251, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--ink); }
.hamb { display: none; border: 0; background: none; color: var(--ink); padding: 6px; border-radius: 10px; cursor: pointer; }
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.view { margin-left: var(--side-w); max-width: none; padding: 6px 40px 80px; }
.view > * { max-width: 1480px; }
.crumbs { font-size: 14px; color: var(--muted2); margin-bottom: 6px; }
.crumbs a { color: var(--muted); font-weight: 600; }
.head { margin-bottom: 18px; align-items: center; }
.head h1 { margin: 0 0 2px; }
body.no-auth .sidebar, body.no-auth .hamb { display: none; }
body.no-auth .topbar, body.no-auth .view { margin-left: 0; }
@media (max-width: 1023px) {
  :root { --top-h: 64px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  body.side-open .sidebar { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .18); }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(23, 27, 30, .35); z-index: 25; }
  body.side-open { overflow: hidden; }
  .topbar, .view { margin-left: 0; }
  .topbar { padding: 0 12px; gap: 6px; flex-wrap: nowrap; }
  .hamb { display: inline-flex; }
  .page-title { font-size: 21px; }
  .view { padding: 4px 14px 80px; }
  h1 { font-size: 21px; }
}

/* --- cards, stats --- */
.card { border: 0; border-radius: var(--radius); background: var(--card); box-shadow: var(--sh-card); padding: 20px; }
a.card, .item, .test-card, .acc-card, .step, .t-card { transition: box-shadow .18s, transform .18s; }
a.card:hover, .item:hover, .test-card:hover, .acc-card:hover, .step:hover { box-shadow: var(--sh-hover); border-color: transparent; }
.card + .card { margin-top: 14px; }
.grid, .stats, .flow { gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--ink); }
.empty { color: var(--muted); }
.avatar { border-radius: 12px; background: var(--primary-soft); color: var(--primary); }

/* --- buttons, inputs --- */
.btn { min-height: 42px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink2); font-weight: 700; font-size: 14.5px; box-shadow: 0 4px 4px rgba(0, 0, 0, .04); justify-content: center; transition: background .15s, box-shadow .15s, border-color .15s; }
.btn:hover { border-color: #dcdcdc; box-shadow: 0 6px 14px rgba(0, 0, 0, .06); }
.btn.primary { background: var(--action); border-color: var(--action); color: #fff; }
.btn.primary:hover { background: #1528d6; }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; box-shadow: none; }
.btn.big { min-height: 52px; font-size: 16px; }
input, select, textarea { border-radius: 12px; border: 1px solid var(--line); padding: 10px 14px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(30, 51, 242, .12); border-color: var(--action); }
label.field { color: var(--muted); font-weight: 600; font-size: 13px; }
.icon { border-radius: 10px; border-color: var(--line); }

/* --- tables --- */
.table-wrap { border: 0; border-radius: var(--radius); background: #fff; box-shadow: var(--sh-card); }
table { background: #fff; }
th { background: #fff; color: var(--ink); font-weight: 700; font-size: 13.5px; text-transform: none; border-bottom: 2px solid var(--line2); padding: 14px 12px; }
td { border-bottom: 1px solid var(--line2); padding: 12px; font-size: 14.5px; }
tbody tr:hover td { background: #fcfcff; }
tbody tr:last-child td { border-bottom: 0; }
.entry th:first-child { background: #fff; }

/* --- chips, tags, pills --- */
.chip { border-radius: 12px; border-color: var(--line); padding: 8px 14px; font-weight: 600; color: var(--muted); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-check { border-radius: 12px; }
.tag { border-radius: 8px; padding: 3px 9px; font-weight: 700; font-size: 12px; background: var(--action-soft); color: var(--action); }
.tag.off { background: #f3f3f3; color: var(--muted); }
.tag.warn { background: #fff4e3; color: #a35f00; }
.tag.st-planned { background: var(--action-soft); color: var(--action); }
.tag.st-open { background: #e6f9ec; color: #078a2c; }
.tag.st-closed { background: #f3f3f3; color: var(--muted); }
.tag.sport { background: #fff4e3; color: #a35f00; }
.tag.meas { background: #f6eeff; color: #6b2fc0; }
.tag.comp { background: var(--primary-soft); color: #d63a50; }
.plan { border-radius: 8px; }
.plan-free { background: #f3f3f3; color: var(--muted); }
.plan-basic { background: var(--action-soft); color: var(--action); }
.plan-pro { background: #fff1d6; color: #a35f00; }
.plan-ro { background: var(--primary-soft); color: #d63a50; }
.plan-demo { background: #f6eeff; color: #6b2fc0; }
.notice { border-radius: 14px; background: #fff6e8; color: #7a4a00; border-left: 4px solid var(--secondary); padding: 12px 14px; }
.toast { border-radius: 14px; background: var(--ink); padding: 12px 18px; box-shadow: var(--sh-hover); }
.toast.error { background: var(--bad); }
code, .formula { background: var(--line2); }
.up { color: var(--good); } .down { color: var(--bad); }

/* --- шалгагч, хуудасны бусад --- */
.sticky { top: calc(var(--top-h) + 12px); }
.run-head { top: var(--top-h); background: var(--bg); }
@media (max-width: 640px) { .run-head { top: var(--top-h); } }
.sheet { border-radius: 24px 24px 0 0; }
@media (min-width: 900px) { .sheet { border-radius: 24px; } }
.step b { background: var(--primary); border-radius: 10px; }
.usage i { background: var(--action); }
.login { margin-top: 60px; }
.login .card { padding: 28px; }
@media print { .sidebar, .scrim, .topbar { display: none !important; } .view { margin-left: 0 !important; padding: 0 !important; } }
.head h1.dup { display: none; }
.sidebar #nav { order: 0; flex: none; overflow: visible; flex-direction: column; gap: 0; flex-basis: auto; }

/* v2.1 — шалгагчийн бичлэг, клубын тохиргоо */
.sh-head { position: relative; }
.rec-box { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 8px; padding: 4px 10px 4px 4px; border-radius: 12px; background: var(--line2); cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); user-select: none; }
.rec-box .rec-pv { width: 0; height: 40px; border-radius: 8px; overflow: hidden; background: #111; transition: width .2s; }
.rec-box .rec-pv video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-box.on { background: #fff0f2; color: #e11d48; }
.rec-box.on .rec-pv { width: 64px; }
.rec-box.on .rec-st::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ff3049; margin-right: 6px; animation: recblink 1s infinite; vertical-align: 0; }
@keyframes recblink { 50% { opacity: .25; } }
.rec-up { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 95; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 13px; font-weight: 600; box-shadow: var(--sh-hover); max-width: 92vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; color: #cbd5e1; }
.vp-ev { border: 1px solid #334155; background: #1e293b; color: #e2e8f0; border-radius: 8px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.vp-ev i { color: #94a3b8; font-style: normal; }
.set-card h2 { margin-top: 0; display: flex; align-items: center; gap: 10px; }
.set-card .ok-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 8px; background: #e6f9ec; color: #078a2c; }
.set-card .no-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 8px; background: var(--primary-soft); color: #d63a50; }
.set-card ol { margin: 8px 0 14px; padding-left: 20px; color: var(--muted); line-height: 1.6; }
.set-card .url-row { display: flex; gap: 10px; flex-wrap: wrap; }
.set-card .url-row input { flex: 1 1 360px; }
.share-mail { display: inline-flex; align-items: center; gap: 6px; background: var(--action-soft); color: var(--action); padding: 3px 10px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.set-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-items: start; }
@media (max-width: 520px) { .set-grid { grid-template-columns: 1fr; } }
.chk-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.chk-row:last-child { border-bottom: 0; }
.chk-row input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); }
.chk-row small { display: block; color: var(--muted); }

/* ================================================================
   v2.2 — Спорт, хурд, амжилт: Oswald (оноо, гарчиг), налуу хэлбэр, харанхуй горим
   ================================================================ */
:root { --font-display: "Oswald", "Nunito Sans", system-ui, sans-serif; --surface2: #f6f6f6; --gold: #ffb020; --gold-2: #ff6175; --skew: -12deg; }
.br-track { stroke: var(--line); }
/* гарчиг: оноон самбар шиг өндөр, нарийн; хуудасны гарчгийн өмнө налуу коралл тэмдэг */
.page-title { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; gap: 14px; }
.page-title::before { content: ""; flex: none; width: 9px; height: .9em; background: var(--primary); transform: skewX(var(--skew)); border-radius: 2px; box-shadow: 6px 0 0 -2px rgba(255, 97, 117, .35); }
h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; }
h2 { font-family: var(--font-display); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; font-size: 19px; }
.card > h2:first-child, .set-card h2 { text-transform: none; letter-spacing: .01em; }
/* тоо: тэгш өргөнтэй, оноон самбар */
.stat b, .mon-kpis b, .sw-time, .best, .big-ring .br-v, .cf-title, .ct-plus span, .t-ring text, .ring text, .bp-bmi b, .usage em {
  font-family: var(--font-display); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: .01em; }
.stat b { font-size: 34px; font-weight: 600; }
.mon-kpis b { font-size: 1.6rem; font-weight: 600; }
.sw-time { font-size: 3.6rem; font-weight: 600; line-height: 1; letter-spacing: .02em; }
.best { font-weight: 600; font-size: 1.05em; }
.big-ring .br-v { font-weight: 600; font-size: 30px; }
/* лого: налуу тэмдэг + хурдны зураас */
.logo-mark { border-radius: 12px; transform: skewX(var(--skew)); font-family: var(--font-display); font-weight: 700; font-size: 26px; position: relative; overflow: visible; }
.logo-mark > * , .logo-mark { text-shadow: none; }
.logo-mark::before, .logo-mark::after { content: ""; position: absolute; left: -16px; height: 3px; border-radius: 2px; background: var(--primary); opacity: .55; }
.logo-mark::before { top: 15px; width: 10px; } .logo-mark::after { top: 26px; width: 7px; opacity: .35; }
.logo-txt b { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; font-size: 23px; }
/* идэвхтэй цэс: налуу коралл тэмдэг */
.side-nav a.active::before { width: 7px; border-radius: 0 3px 3px 0; }
.nav-h { font-family: var(--font-display); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--muted); }
/* товч: үндсэн товчинд хурдны налуу гялбаа */
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent); transform: skewX(var(--skew)); transition: left .5s ease; pointer-events: none; }
.btn.primary:hover::after { left: 120%; }
/* алхмын тоо, амжилтын тэмдэг налуу */
.step b { transform: skewX(var(--skew)); border-radius: 6px; font-family: var(--font-display); }
.ac-badge { font-family: var(--font-display); }
/* хоосон төлөв, нэвтрэх хуудас — гүйлтийн замын хээ */
.login .card, .empty.card { background-image: repeating-linear-gradient(105deg, transparent 0 42px, rgba(255, 97, 117, .045) 42px 44px); }
.sh-name { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; }
.sh-num { font-family: var(--font-display); }
/* тоолж өсөх, дүүрэх хөдөлгөөн — хөдөлгөөн багасгах тохиргоонд унтарна */
@media (prefers-reduced-motion: no-preference) {
  .card, .table-wrap { animation: rise .32s ease both; }
  .grid > .card:nth-child(2), .stats > *:nth-child(2), .flow > *:nth-child(2) { animation-delay: .04s; }
  .grid > .card:nth-child(3), .stats > *:nth-child(3), .flow > *:nth-child(3) { animation-delay: .08s; }
  .grid > .card:nth-child(4), .stats > *:nth-child(4), .flow > *:nth-child(4) { animation-delay: .12s; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
/* сэдэв сэлгэх товч */
.theme-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.theme-btn:hover { box-shadow: var(--sh-hover); }

/* ---- хувийн рекордын агшин ---- */
.pb-burst { position: fixed; inset: 0; z-index: 120; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.pb-card { pointer-events: auto; position: relative; min-width: min(360px, 88vw); padding: 26px 30px 22px; border-radius: 22px; text-align: center; color: #fff;
  background: linear-gradient(135deg, #ff6175 0%, #ff8a4c 55%, #ffb020 100%); box-shadow: 0 24px 60px rgba(255, 97, 117, .45); overflow: hidden; }
.pb-card::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(105deg, transparent 0 26px, rgba(255, 255, 255, .09) 26px 30px); }
.pb-card > * { position: relative; }
.pb-star { font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .2)); }
.pb-k { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; font-weight: 600; font-size: 15px; opacity: .95; margin-top: 6px; }
.pb-v { font-family: var(--font-display); font-weight: 700; font-size: 58px; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.pb-who { font-weight: 700; font-size: 16px; }
.pb-was { font-size: 13px; opacity: .9; margin-top: 2px; }
.pb-gain { display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-weight: 800; font-family: var(--font-display); letter-spacing: .03em; }
.pb-conf { position: absolute; width: 8px; height: 14px; border-radius: 2px; top: 50%; left: 50%; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .pb-card { animation: pbIn .5s cubic-bezier(.2, 1.4, .4, 1) both; }
  .pb-star { animation: pbStar .9s ease .1s both; }
  .pb-burst.out .pb-card { animation: pbOut .35s ease both; }
  .pb-conf { animation: pbConf 1.3s cubic-bezier(.15, .7, .3, 1) forwards; }
  @keyframes pbIn { from { transform: scale(.6) skewX(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes pbOut { to { transform: translateY(-20px) scale(.96); opacity: 0; } }
  @keyframes pbStar { 0% { transform: scale(0) rotate(-40deg); } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: none; } }
  @keyframes pbConf { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); } }
}
.pb-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; font-weight: 800; font-size: 12px; color: #fff; background: linear-gradient(90deg, #ff6175, #ffb020); font-family: var(--font-display); letter-spacing: .04em; }
.att2.pb { box-shadow: 0 0 0 2px #ffb020, 0 8px 24px rgba(255, 176, 32, .25); }
.feed-pb { background: linear-gradient(90deg, rgba(255, 176, 32, .16), transparent); }

/* ---- v2.3 Тоглогчийн карт, профайлын толгой ---- */
.hero { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; margin-bottom: 24px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero-card { justify-self: center; } }
.hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-head h1 { font-size: 32px; margin: 0 0 4px; }
.hero-ovr { display: flex; align-items: baseline; gap: 10px; }
.hero-ovr b { font-family: var(--font-display); font-size: 56px; font-weight: 700; line-height: 1; color: var(--primary); }
.hero-ovr span { color: var(--muted); font-size: 13px; max-width: 160px; }
.hero-ovr i { font-style: normal; font-weight: 700; } .hero-ovr i.up { color: var(--good); } .hero-ovr i.down { color: var(--bad); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-grid .card + .card { margin-top: 0; }
.hero-grid h3 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; font-size: 15px; }
/* карт */
.pcard { position: relative; width: 300px; aspect-ratio: 3 / 4.75; border-radius: 24px; padding: 18px 20px 14px; overflow: hidden; color: #fff; display: flex; flex-direction: column;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18); isolation: isolate; }
.pcard::before { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(105deg, transparent 0 22px, rgba(255, 255, 255, .1) 22px 26px); }
.pcard.t-elite { background: linear-gradient(150deg, #ff6175 0%, #ff8a4c 55%, #ffb020 100%); }
.pcard.t-gold { background: linear-gradient(150deg, #f7d77a, #e9b23f 55%, #b9831c); color: #1f1606; }
.pcard.t-silver { background: linear-gradient(150deg, #f2f4f6, #c5ccd4 55%, #98a2ad); color: #1f2328; }
.pcard.t-bronze { background: linear-gradient(150deg, #e6b48c, #c98a5a 55%, #8f5a35); }
.pc-top { flex: none; display: flex; justify-content: space-between; align-items: flex-start; }
.pc-rate { display: flex; flex-direction: column; line-height: 1; }
.pc-rate b { font-family: var(--font-display); font-size: 64px; font-weight: 700; letter-spacing: -.01em; }
.pc-rate span { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; font-size: 13px; margin-top: 2px; }
.pc-rate i { font-style: normal; font-family: var(--font-display); font-weight: 600; font-size: 13px; margin-top: 4px; }
.pc-meta { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em; font-size: 12px; font-weight: 500; gap: 2px; max-width: 140px; }
.pc-meta b { font-size: 30px; font-weight: 700; line-height: 1; }
.pc-photo { flex: none; width: 116px; height: 116px; border-radius: 50%; margin: 6px auto 8px; overflow: hidden; background: rgba(255, 255, 255, .24); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 4px rgba(255, 255, 255, .35); }
.pc-photo img { width: 100%; height: 100%; object-fit: cover; }
.pc-ini { font-family: var(--font-display); font-weight: 700; font-size: 48px; }
.pc-name { flex: none; font-family: var(--font-display); font-weight: 700; font-size: 26px; text-transform: uppercase; text-align: center; letter-spacing: .02em; line-height: 1.05;
  padding-bottom: 8px; border-bottom: 2px solid currentColor; border-bottom-color: color-mix(in srgb, currentColor 35%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-attrs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin: 10px 4px 0; flex: 1; align-content: start; }
.pc-attrs div { display: flex; align-items: baseline; gap: 8px; font-family: var(--font-display); }
.pc-attrs b { font-size: 24px; font-weight: 700; min-width: 34px; text-align: right; }
.pc-attrs span { font-size: 15px; font-weight: 500; letter-spacing: .06em; opacity: .9; }
.pc-attrs .pc-none { grid-column: 1 / -1; font-family: inherit; font-size: 12px; opacity: .85; }
.pc-foot { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 12px; letter-spacing: .1em; opacity: .8; margin-top: 6px; }
@media (prefers-reduced-motion: no-preference) { .pcard { animation: pcIn .55s cubic-bezier(.2, 1.2, .4, 1) both; } @keyframes pcIn { from { opacity: 0; transform: translateY(12px) rotate(-2deg) scale(.96); } to { opacity: 1; transform: none; } } }
/* тор диаграм */
.radar { width: 100%; max-width: 460px; display: block; margin: 0 auto; overflow: visible; }
.radar .rd-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.radar .rd-cur { fill: rgba(255, 97, 117, .18); stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; }
.radar .rd-prev { fill: none; stroke: var(--muted2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.radar .rd-dot { fill: var(--primary); stroke: var(--card); stroke-width: 2; }
.radar .rd-l { font-size: 14px; fill: var(--muted); }
.radar .rd-v { font-family: var(--font-display); font-weight: 600; fill: var(--ink); font-size: 16px; }
.legend .lg-cur, .legend .lg-prev { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--primary); margin-right: 6px; vertical-align: middle; }
.legend .lg-prev { border-top: 2px dashed var(--muted2); }
.hero-radar .legend { display: flex; gap: 14px; justify-content: center; margin-top: 4px; }
.hbar-row { display: grid; grid-template-columns: 120px 1fr 32px; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0; }
.hbar-row i { display: block; height: 8px; border-radius: 4px; background: var(--primary); }
.hbar-row b { font-family: var(--font-display); text-align: right; }
/* хувийн рекорд */
.pb-list { display: flex; flex-direction: column; }
.pb-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.pb-row:last-child { border-bottom: 0; }
.pb-row .pb-n { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.pb-row .pb-n a { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-row .pb-n small { color: var(--muted); font-size: 12px; }
.pb-row > b { font-family: var(--font-display); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; }
.pb-row > b small { font-family: "Nunito Sans", sans-serif; font-size: 12px; font-weight: 600; color: var(--muted); }
.pb-row.fresh > b { color: var(--primary); }
.hero-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line2); text-align: center; }
.hero-body b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.hero-body span { font-size: 12px; color: var(--muted); }
.hero-radar .legend span { color: var(--muted); }

/* ================================================================ v2.4 — Зорилго */
.g-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.g-seg { margin: 0; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.goal { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--sh-card); overflow: hidden; }
.goal::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--action); }
.goal.g-achieved::before { background: var(--good); }
.goal.g-overdue::before { background: var(--bad); }
.goal.g-cancelled { opacity: .62; } .goal.g-cancelled::before { background: var(--muted2); }
.g-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.g-ath { display: block; font-size: 12.5px; font-weight: 700; text-decoration: none; margin-bottom: 2px; }
.g-test { font-size: 15.5px; font-weight: 800; }
.g-chip { flex: none; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--action-soft); color: var(--action); white-space: nowrap; }
.g-chip.ok { background: rgba(9, 189, 60, .12); color: var(--good); }
.g-chip.bad { background: rgba(253, 83, 83, .12); color: var(--bad); }
.g-chip.off { background: var(--line2); color: var(--muted); }
.g-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 12px; }
.g-nums { display: flex; gap: 16px; }
.g-nums small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.g-nums b { font-family: var(--font-display, inherit); font-size: 20px; font-weight: 600; }
.g-target b { color: var(--primary); }
.g-target em { font-style: normal; font-size: 11.5px; color: var(--muted); margin-left: 3px; }
.g-spark { width: 132px; height: 40px; flex: none; }
.g-spark .g-tl { stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 4 3; }
.g-spark .g-ln { fill: none; stroke: var(--action); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.g-spark .g-pt { fill: var(--action); stroke: var(--card); stroke-width: 1.5; }
.goal.g-achieved .g-spark .g-ln, .goal.g-achieved .g-spark .g-pt { stroke: var(--good); } .goal.g-achieved .g-spark .g-pt { fill: var(--good); stroke: var(--card); }
.g-bar { position: relative; height: 10px; border-radius: 99px; background: var(--line2); margin-top: 12px; }
.g-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--action), var(--primary)); transform: skewX(-12deg); transform-origin: left; min-width: 4px; }
.goal.g-achieved .g-bar i { background: var(--good); }
.g-bar span { position: absolute; right: 0; top: -19px; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.g-note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.g-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.g-form { display: grid; gap: 12px; }
.g-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-aths { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin-top: 6px; }
.goal-tag { display: inline-block; font-size: 12px; font-weight: 800; color: var(--good); background: rgba(9, 189, 60, .12); padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
@media (max-width: 560px) { .g-form-row { grid-template-columns: 1fr; } .g-spark { width: 96px; } }

/* ================================================================ v2.4 — Харьцуулалт */
.cmp-ctl { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.cmp-ctl .field { min-width: 200px; flex: 1; }
.cmp-ctl .field:first-child { flex: 2; }
.cmp-cards { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; margin: 18px 0; }
.cmp-side { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cmp-lbl { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cmp-lbl i, .cmp-dot, .cmp-leg i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; transform: skewX(-12deg); }
.cmp-side.a .cmp-lbl i, .cmp-dot.a, .cmp-leg i.la { background: var(--primary); }
.cmp-side.b .cmp-lbl i, .cmp-dot.b, .cmp-leg i.lb { background: #2a78d6; }
.cmp-dot { margin-right: 6px; vertical-align: -1px; }
.cmp-vs { text-align: center; }
.cmp-vs b { font-family: var(--font-display, inherit); font-size: 44px; font-weight: 700; font-style: italic; letter-spacing: .02em; color: var(--muted2); }
.cmp-score { font-family: var(--font-display, inherit); font-size: 30px; font-weight: 700; }
.cmp-score .sa { color: var(--primary); } .cmp-score .sb { color: #2a78d6; }
.cmp-vs small { color: var(--muted); font-size: 12px; }
.cmp-leg { display: flex; gap: 16px; justify-content: center; margin-top: 4px; }
.cmp-leg span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.radar .rd-b { fill: rgba(42, 120, 214, .16); stroke: #2a78d6; stroke-width: 2; stroke-linejoin: round; }
.radar .rd-dot-b { fill: #2a78d6; stroke: var(--card); stroke-width: 2; }
.cmp-table td.cmp-win { background: rgba(9, 189, 60, .09); font-weight: 800; }
.cmp-body { width: 100%; }
.cmp-body td { padding: 8px 6px; }
.cmp-ph-h { font-weight: 700; margin: 16px 0 8px; font-size: 14px; }
.cmp-ph { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cmp-pair-l { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.cmp-pair-i { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.cmp-pair-i button { position: relative; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--line2); cursor: pointer; aspect-ratio: 3 / 4; }
.cmp-pair-i button:first-child { box-shadow: inset 0 -4px 0 var(--primary); } .cmp-pair-i button:last-child { box-shadow: inset 0 -4px 0 #2a78d6; }
.cmp-pair-i img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-pair-i span { position: absolute; left: 4px; bottom: 7px; font-size: 10.5px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); padding: 1px 5px; border-radius: 5px; }
@media (max-width: 900px) { .cmp-cards { grid-template-columns: 1fr; } .cmp-vs { order: 0; } .cmp-side .pcard { width: min(300px, 100%); } }

/* ================================================================ v2.5 — Бүрэлдэхүүн дэд цэс */
.nav-grp { display: flex; flex-direction: column; }
.nav-par { position: relative; display: flex; align-items: center; gap: 16px; height: 50px; padding: 0 28px; border: 0; background: none; font: inherit; color: var(--muted); font-weight: 600; font-size: 15.5px; cursor: pointer; text-align: left; width: 100%; }
.nav-par:hover { color: var(--ink); }
.nav-par svg { flex: none; }
.nav-car { margin-left: auto; font-style: normal; font-size: 12px; transition: transform .2s; }
.nav-grp:not(.open) .nav-car { transform: rotate(-90deg); }
.nav-grp.has-active > .nav-par { color: var(--primary); }
.nav-kids { display: none; flex-direction: column; }
.nav-grp.open .nav-kids { display: flex; }
.side-nav a.nav-sub { height: 40px; padding-left: 68px; font-size: 14.5px; gap: 12px; }
.nav-dot { width: 7px; height: 7px; border-radius: 2px; background: currentColor; opacity: .45; transform: skewX(-12deg); flex: none; }
.side-nav a.nav-sub.active .nav-dot { opacity: 1; }

/* нэвтрэх: SMS / нууц үг */
.login-seg { display: flex; margin: 16px 0 6px; }
.login-seg button { flex: 1; }
.linkbtn { border: 0; background: none; color: var(--action); padding: 8px 0 0; cursor: pointer; font: inherit; text-align: left; }
.linkbtn:hover { text-decoration: underline; }

/* бүрэлдэхүүн */
.ro-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 6px 0 18px; }
.ro-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; color: var(--ink); text-decoration: none; box-shadow: var(--sh-card); }
.ro-stat b { display: block; font-family: var(--font-display, inherit); font-size: 30px; font-weight: 600; line-height: 1.1; }
.ro-stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.ro-stat:hover { box-shadow: var(--sh-hover); }
.ro-team { display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-decoration: none; }
.ro-team-n { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.ro-team-n b { color: var(--ink); font-size: 15px; }
.ro-filter { gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.ro-filter input[type=search] { flex: 1; min-width: 200px; }
.ro-ph { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ro-in { color: var(--good); font-size: 11px; vertical-align: 1px; }
.ro-table td { vertical-align: middle; }
.ro-note { margin-top: 10px; }
.ath-ph { margin: 10px 0 0; }
.st-card { display: flex; flex-direction: column; gap: 8px; }
.st-ph a { font-weight: 700; text-decoration: none; }
.team-staff { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 6px; }
.ts-p { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; }
.my-kid { display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-decoration: none; }
.my-kid .btn { align-self: flex-start; }
.my-c2 { margin-top: 10px; }
.tf-pick { grid-column: 1 / -1; }
@media (max-width: 700px) { .ro-stats { grid-template-columns: repeat(2, 1fr); } }

/* ================================================================ v2.5 — Хуваарийн календар */
.cal-bar { gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.cal-seg { margin: 0; }
.cal-seg a { display: inline-block; padding: 8px 16px; color: var(--ink); text-decoration: none; font-weight: 600; }
.cal-seg a.on { background: var(--ink); color: var(--card); }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-title { font-family: var(--font-display, inherit); font-size: 20px; font-weight: 600; min-width: 150px; text-align: center; }
#cal-team { margin-left: auto; min-width: 170px; }
.cal-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.cal-leg span { display: inline-flex; align-items: center; gap: 6px; }
.cal-leg i { width: 12px; height: 12px; border-radius: 3px; transform: skewX(-12deg); display: inline-block; }
.cal-st i { border: 2px solid var(--muted); background: transparent !important; }
.cal-st i.st-planned { border-style: dashed; }
.cal-st i.st-open { background: var(--muted) !important; }
.cal-st i.st-closed { background: var(--line) !important; border-color: var(--line); }
.cal-month { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-wd div { padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.cal-wd .we { color: var(--primary); }
.cal-d { min-height: 112px; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.we { background: color-mix(in srgb, var(--line2) 45%, transparent); }
.cal-d.out { opacity: .45; }
.cal-n { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.cal-d.today .cal-n { color: var(--primary); }
.cal-d.today .cal-n::before { content: "Өнөөдөр"; font-size: 10.5px; background: var(--primary); color: #fff; padding: 1px 6px; border-radius: 5px; margin-right: auto; margin-left: 0; order: 2; }
.cal-add { opacity: 0; text-decoration: none; font-weight: 800; color: var(--action); padding: 0 4px; }
.cal-d:hover .cal-add { opacity: 1; }
.cal-ev { display: block; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--ink); text-decoration: none; border-radius: 6px; padding: 3px 6px; font-size: 12px; font-weight: 700; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-ev small { display: block; font-weight: 600; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.st-planned { background: transparent; border: 1.5px dashed var(--c); border-left: 4px solid var(--c); }
.cal-ev.st-open { background: color-mix(in srgb, var(--c) 26%, var(--card)); }
.cal-ev.st-closed { opacity: .72; }
.cal-ev:hover { filter: brightness(1.04); box-shadow: var(--sh-card); }
.cal-more { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.cal-plan th, .cal-plan td { padding: 8px 6px; }
.cal-plan th a { color: var(--ink); text-decoration: none; }
.cal-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; transform: skewX(-12deg); margin-right: 8px; vertical-align: -1px; }
.cal-c { text-align: center; }
.cal-c span { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 34px; height: 34px; border-radius: 8px; font-weight: 800; color: var(--ink);
  background: color-mix(in srgb, var(--c) calc(var(--a) * 55%), var(--card)); border: 1.5px solid var(--c); line-height: 1; }
.cal-c small { font-size: 9.5px; font-weight: 700; color: var(--muted); }
.cal-tot td { font-weight: 700; color: var(--muted); }
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.cal-mini { color: var(--ink); text-decoration: none; padding: 12px 14px; }
.cal-mini-h { display: flex; justify-content: space-between; margin-bottom: 6px; }
.cal-mini-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-mini-g i { font-style: normal; font-size: 11px; text-align: center; height: 24px; line-height: 24px; border-radius: 5px; color: var(--muted); }
.cal-mini-g i.wd { font-weight: 700; color: var(--muted2); height: 18px; line-height: 18px; }
.cal-mini-g i.on { background: var(--dbg); color: #fff; font-weight: 800; }
.cal-mini-g i.on.pl { opacity: .55; }
.cal-mini-g i.today { outline: 2px solid var(--primary); outline-offset: -2px; color: var(--primary); font-weight: 800; }
@media (max-width: 760px) {
  .cal-d { min-height: 78px; padding: 3px; }
  .cal-ev { font-size: 10.5px; padding: 2px 4px; }
  .cal-ev small { display: none; }
  #cal-team { margin-left: 0; width: 100%; }
}
.cal-seg { background: var(--card); border-color: var(--line); }
.cal-seg a { color: var(--ink) !important; background: transparent; }
.cal-seg a.on { background: var(--ink) !important; color: var(--card) !important; }
.cal-plan { table-layout: fixed; }
.cal-plan th:first-child, .cal-plan td:first-child { width: 230px; }
.cal-plan th.num, .cal-plan td.cal-c, .cal-plan td.num { text-align: center; }
.cal-plan th:last-child, .cal-plan td:last-child { width: 64px; }
.cal-mini.card { margin: 0; }

/* цайвар сегмент (зорилго, нэвтрэх, календар) */
.seg:not(.bv .seg) { background: var(--card); padding: 3px; gap: 2px; border-radius: 12px; }
.seg:not(.bv .seg) button, .seg:not(.bv .seg) a { border-radius: 9px; background: transparent; color: var(--ink); font-weight: 600; }
.seg:not(.bv .seg) button.on, .seg:not(.bv .seg) a.on { background: var(--ink); color: var(--card); }

/* ================================================================ v2.6 — хуудаслалт */
.paged > .pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 12px 0 4px; }
.pg-b { min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; }
.pg-b:hover:not(:disabled) { border-color: var(--ink); }
.pg-b.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.pg-b:disabled { opacity: .35; cursor: default; }
.pg-gap { padding: 0 4px; color: var(--muted); }
.pg-info { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* табууд (тамирчны профайл, админ) */
.tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin: 22px 0 16px; }
.tabs > a, .tabs > button { position: relative; padding: 12px 16px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--muted); text-decoration: none; cursor: pointer; }
.tabs > a.active, .tabs > button.on { color: var(--ink); }
.tabs > a.active::after, .tabs > button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 3px; border-radius: 3px; background: var(--primary); transform: skewX(-12deg); }
.tabs .at-n:not(:empty) { margin-left: 6px; font-size: 11.5px; background: var(--line2); color: var(--muted); padding: 1px 7px; border-radius: 99px; }
.tabs .at-cmp { margin-left: auto; }
.at-cats { gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.at-cats .chip { cursor: pointer; font: inherit; }
.at-cats .chip.active { background: var(--ink); color: var(--card); border-color: var(--ink); }

/* тоглогч: карт / хүснэгт */
.pl-view { margin: 0; }
.pl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pl-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--sh-card); min-width: 0; }
.pl-card:hover { box-shadow: var(--sh-hover); }
.pl-photo { position: relative; width: 100%; aspect-ratio: 5 / 4; border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: linear-gradient(150deg, var(--primary-soft), var(--line2)); cursor: pointer; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.pl-photo:disabled { cursor: default; }
.pl-photo img { width: 100%; height: 100%; object-fit: cover; }
.pl-photo > span { font-family: var(--font-display, inherit); font-size: 64px; font-weight: 700; color: var(--primary); }
.pl-num { position: absolute; top: 22px; left: 22px; background: var(--ink); color: var(--card); font-family: var(--font-display, inherit); font-size: 15px; padding: 2px 9px; border-radius: 8px; transform: skewX(-10deg); }
.pl-name { font-weight: 800; color: var(--ink); text-decoration: none; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-name:hover { color: var(--primary); }
.pl-meta, .pl-team { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-foot { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line2); }
.pl-ph { position: absolute; top: 22px; right: 22px; opacity: 0; transition: opacity .15s; }
.pl-card:hover .pl-ph, .pl-ph:focus { opacity: 1; }
.pc-cam { position: absolute; right: 8px; bottom: 8px; font-style: normal; font-size: 15px; background: rgba(15, 17, 20, .65); border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.pl-photo:hover .pc-cam, .pc-edit:hover .pc-cam { opacity: 1; }
.pl-av { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.pc-photo.pc-edit { position: relative; cursor: pointer; overflow: visible; }
.pc-photo.pc-edit img { border-radius: 50%; }
.pc-photo.pc-edit .pc-cam { right: -4px; bottom: -4px; opacity: .9; }
.pp-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.pp-prev { width: 180px; height: 180px; border-radius: 16px; overflow: hidden; background: var(--line2); display: flex; align-items: center; justify-content: center; flex: none; }
.pp-prev img { width: 100%; height: 100%; object-fit: cover; }
.pp-prev span { font-size: 72px; font-weight: 800; color: var(--muted2); }
.pp-act { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
@media (max-width: 1100px) { .pl-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .pl-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .pl-photo > span { font-size: 44px; } }

/* төлбөр: эрх, купон */
.plan-card { position: relative; }
.plan-card.sel { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.plan-badge { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; background: var(--primary); padding: 2px 9px; border-radius: 6px; transform: skewX(-10deg); margin-bottom: 6px; }
.coupon-row { gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.coupon-row input { width: 230px; }
.cp-code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; background: var(--line2); padding: 1px 6px; border-radius: 5px; }
.sl-tabs { margin-top: 6px; }
.sl-chart { width: 100%; height: auto; }
.sl-chart .sl-axis { stroke: var(--line); }
.sl-bar rect:first-child { fill: var(--primary); }
.sl-bar .sl-hit { fill: transparent; }
.sl-bar:hover rect:first-child { fill: #e94d63; }
.sl-chart .sl-v { font-size: 11px; font-weight: 700; fill: var(--ink); }
.sl-chart .sl-x { font-size: 11.5px; fill: var(--muted); }
.sl-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.sl-row > :first-child { flex: 1; }
.sl-plan { display: flex; flex-direction: column; gap: 8px; }
.sl-price { font-family: var(--font-display, inherit); font-size: 26px; font-weight: 600; }
.sl-lim { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed var(--line2); }
.sl-new { border: 2px dashed var(--line); background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; min-height: 160px; }
.sl-new:hover { border-color: var(--primary); color: var(--primary); }
.mo-row { gap: 10px; align-items: flex-end; margin-bottom: 6px; }
.mo-row .field { flex: 1; }
textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); resize: vertical; }

/* нэвтрэх: SMS код */
.sms-code { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 10px; align-items: baseline; margin: 10px 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; }
.sms-code span { font-size: 12px; color: var(--muted); }
.sms-code b { font-family: var(--font-display, inherit); font-size: 22px; letter-spacing: .06em; }
.mock-note { background: #fef3c7; color: #92400e; border-color: #fde68a; }

/* ================================================================ v2.7 — шалгагч: оролдлогын товч, удирдах цонх, тоон товчлуур */
.abtns { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.abtns.one { grid-template-columns: 1fr; }
.abtn { position: relative; display: flex; align-items: center; gap: 12px; min-height: 92px; padding: 12px 14px; border: 2px dashed var(--line); border-radius: 16px; background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform .1s, box-shadow .15s; }
.abtn:active { transform: scale(.98); }
.abtn .ab-no { flex: none; width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display, inherit); font-size: 28px; font-weight: 700; background: var(--line2); color: var(--muted); transform: skewX(-8deg); }
.abtn .ab-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.abtn .ab-empty { color: var(--muted2); font-weight: 700; font-size: 15px; }
.abtn .ab-v { font-family: var(--font-display, inherit); font-size: 28px; font-weight: 600; line-height: 1.1; }
.abtn .ab-v small { font-size: 13px; font-weight: 600; color: var(--muted); font-family: "Nunito Sans", sans-serif; }
.abtn .ab-sub { font-size: 12.5px; color: var(--muted); }
.abtn .ab-st { font-size: 16px; color: var(--muted); }
.abtn .ab-bad { font-size: 12px; font-weight: 700; color: var(--bad); }
.abtn .ab-vid { position: absolute; right: 10px; bottom: 8px; font-size: 12px; }
.abtn .pb-tag { position: absolute; right: 8px; top: 8px; }
.abtn.next { border: 2px solid var(--action); box-shadow: 0 0 0 4px var(--action-soft); }
.abtn.next .ab-no { background: var(--action); color: #fff; }
.abtn.next .ab-empty { color: var(--action); }
.abtn.done { border-style: solid; border-color: var(--line); }
.abtn.done .ab-no { background: var(--good); color: #fff; }
.abtn.bad .ab-no { background: var(--bad); }
.abtn.pb { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ab-best { font-size: 14px; margin: 2px 0 6px; }
.sh-nav #sh-save.ready { background: var(--good); border-color: var(--good); animation: pulse-go 1.6s ease-in-out infinite; }
@keyframes pulse-go { 0%, 100% { box-shadow: 0 0 0 0 rgba(9, 189, 60, .45); } 50% { box-shadow: 0 0 0 8px rgba(9, 189, 60, 0); } }

.att-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 70; animation: fadein .15s; }
.att-modal { position: fixed; z-index: 71; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 100vw); max-height: 100vh; display: flex; flex-direction: column;
  background: var(--card); color: var(--ink); border-radius: 20px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); overflow: hidden; }
.am-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line2); }
.am-head > div:first-child { flex: 1; min-width: 0; }
.am-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-display, inherit); font-size: 20px; font-weight: 600; }
.am-no { width: 34px; height: 34px; border-radius: 9px; background: var(--action); color: #fff; display: inline-flex; align-items: center; justify-content: center; transform: skewX(-8deg); }
.am-body { overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.am-body .tool { margin: 0; }
.sw-row { gap: 8px; }
.sw-row .sw-go { flex: 1; }
.am-att { border: 0; padding: 0; }
.am-fields { display: grid; gap: 8px; }
.am-fields.multi { grid-template-columns: 1fr 1fr; }
.am-fields .fld { font-size: 2rem; padding: 14px 8px; font-family: var(--font-display, inherit); font-weight: 600; }
.am-nav { display: flex; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line2); }
.am-nav .big { flex: 1; justify-content: center; font-size: 1.05rem; }
.am-nav .vbtn { font-size: .85rem; }
@media (max-width: 600px) { .att-modal { top: auto; bottom: 0; transform: translateX(-50%); border-radius: 20px 20px 0 0; max-height: 96vh; } }

.np-fld { caret-color: transparent; cursor: pointer; user-select: none; -webkit-user-select: none; }
.fld.act { outline: 3px solid var(--action); outline-offset: 0; background: var(--action-soft); }
.numpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.np-k { height: 54px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-size: 22px; font-weight: 700; cursor: pointer; }
.np-k:active { background: var(--line2); transform: scale(.97); }
.np-d { font-family: var(--font-display, inherit); font-size: 26px; font-weight: 600; }
.np-f { background: var(--line2); color: var(--muted); font-size: 19px; }
.np-next { grid-column: span 2; background: var(--action); border-color: var(--action); color: #fff; font-size: 17px; }
#np-body { margin-top: 10px; }
.float-pad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0, 0, 0, .12); }
.float-pad .numpad { max-width: 520px; margin: 0 auto; }
.float-pad .np-next { grid-column: span 1; }
body.fp-open { padding-bottom: 280px; }
@media (min-width: 900px) { .float-pad { left: auto; right: 24px; bottom: 24px; width: 340px; border-radius: 18px; border: 1px solid var(--line); } body.fp-open { padding-bottom: 0; } }

.np-next { grid-column: span 1; }
#np-att[hidden], #np-body[hidden] { display: none !important; }
.np-show { animation: np-up .16s ease-out; }
@keyframes np-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.np-fld:not(.act) { background: var(--card); }
.sh-nav button:disabled { opacity: .45; pointer-events: none; }

/* ================================================================ v2.8 — эхлэх товч, амралтын хөвөгч товч, tooltip */
.tool.sw { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 12px; }
.tool.sw .sw-time { font-family: var(--font-display, inherit); font-size: 3.4rem; line-height: 1; }
.sw-go { width: 100%; height: 76px; border: 0; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 14px; cursor: pointer;
  background: linear-gradient(135deg, #12c94a, #079a33); color: #fff; font: inherit; box-shadow: 0 10px 24px rgba(9, 189, 60, .35), inset 0 -3px 0 rgba(0, 0, 0, .15);
  transition: transform .08s, box-shadow .15s; animation: go-glow 1.8s ease-in-out infinite; position: relative; overflow: hidden; }
.sw-go::after { content: ""; position: absolute; top: 0; bottom: 0; left: -30%; width: 22%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg); animation: go-shine 2.4s ease-in-out infinite; }
.sw-go:active { transform: scale(.98); }
.sw-go .sw-ico { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.sw-go .sw-lbl { font-family: var(--font-display, inherit); font-size: 30px; font-weight: 700; letter-spacing: .08em; }
.sw-go.run { background: linear-gradient(135deg, #ff4b5c, #d61f33); box-shadow: 0 10px 24px rgba(253, 83, 83, .4), inset 0 -3px 0 rgba(0, 0, 0, .15); animation: run-pulse 1s ease-in-out infinite; }
.sw-go.run::after { display: none; }
.sw-go.again { background: linear-gradient(135deg, #3d4f6b, #1f2937); box-shadow: 0 6px 16px rgba(0, 0, 0, .2); animation: none; }
.sw-go.again::after { display: none; }
.sw-reset { align-self: center; }
@keyframes go-glow { 0%, 100% { box-shadow: 0 10px 24px rgba(9, 189, 60, .35), 0 0 0 0 rgba(9, 189, 60, .45); } 50% { box-shadow: 0 10px 24px rgba(9, 189, 60, .35), 0 0 0 10px rgba(9, 189, 60, 0); } }
@keyframes go-shine { 0% { left: -30%; } 60%, 100% { left: 120%; } }
@keyframes run-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
.tap-btns button { height: 64px; font-size: 20px; }

.am-lbl { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; color: var(--ink); }
.tip-btn { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--muted2); background: var(--card); color: var(--muted); font: italic 700 12px/1 Georgia, serif; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tip-btn:hover { border-color: var(--action); color: var(--action); }
.tip-pop { position: fixed; z-index: 200; background: #111827; color: #f9fafb; font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 10px; white-space: pre-line; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); animation: fadein .12s; }
.tap-h { justify-content: space-between; }

.sh-prof { font-size: 12px; font-weight: 700; text-decoration: none; margin-left: 6px; padding: 2px 8px; border-radius: 99px; background: var(--action-soft); color: var(--action); white-space: nowrap; vertical-align: 3px; }

.rest-fab { position: fixed; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 35; display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 18px 0 14px;
  border: 0; border-radius: 99px; background: linear-gradient(135deg, #ffb340, #ff8a1f); color: #fff; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 10px 28px rgba(255, 138, 31, .45); }
.rest-fab b { font-family: var(--font-display, inherit); font-size: 26px; line-height: 1; }
.rest-fab span { font-size: 12px; opacity: .9; }
.rest-fab .hg { animation: hg-flip 3s ease-in-out infinite; }
.rest-fab.on { background: linear-gradient(135deg, #3d4f6b, #1f2937); box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
@keyframes hg-flip { 0%, 80% { transform: rotate(0); } 90%, 100% { transform: rotate(180deg); } }
body.sheet-open .rest-fab { display: none; }
.alarm-bar ~ .rest-fab, body:has(.alarm-bar) .rest-fab { bottom: calc(86px + env(safe-area-inset-bottom)); }
.rest-filter { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 10px 14px; border-radius: 12px; background: #fff4e5; color: #9a4d00; font-weight: 700; }
.rest-filter .btn { margin-left: auto; }
html[data-theme="dark"] .rest-filter { background: rgba(255, 170, 43, .14); color: #ffc46b; }

/* ================================================================ v2.9 — Pro API заавар, бичлэгийн товч */
.api-steps { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 14px; counter-reset: none; }
.api-steps > li { display: flex; gap: 16px; align-items: flex-start; }
.as-n { flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display, inherit); font-size: 22px; font-weight: 700; transform: skewX(-8deg); }
.as-b { flex: 1; min-width: 0; }
.as-b h3 { margin: 6px 0 6px; }
.as-b p { margin: 4px 0 8px; }
.api-code { position: relative; margin: 6px 0; }
.api-code pre { margin: 0; background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 10px; font: 12.5px/1.55 ui-monospace, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; }
.api-cp { position: absolute; right: 8px; top: 8px; background: rgba(255, 255, 255, .12); color: #e2e8f0; border-color: rgba(255, 255, 255, .2); }
.api-eps td { vertical-align: top; }
.api-f { white-space: normal; word-break: break-word; }
.api-tabs { margin: 6px 0 8px; }
.api-tabs > button.on { color: var(--ink); }
.api-try { gap: 8px; flex-wrap: wrap; }
.api-try input { flex: 1; min-width: 220px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.api-newkey { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(9, 189, 60, .1); }
.api-notes { margin: 0; padding-left: 18px; line-height: 1.7; }
.api-key-row { gap: 10px; align-items: center; flex-wrap: wrap; }
.rec-box.off { opacity: .45; cursor: not-allowed; display: flex; flex-direction: column; align-items: center; }
.rec-box.off small { font-size: 10px; }
.vcams { display: flex; flex-direction: column; margin-top: 4px; }
@media (max-width: 600px) { .api-steps > li { flex-direction: column; gap: 8px; } }

/* ================================================================ v3.0 */
/* тоон товчлуур: хаах мөр */
.np-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.np-for { font-size: 13px; font-weight: 700; color: var(--muted); }
.np-close { border: 0; background: var(--line2); color: var(--ink); font: inherit; font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 99px; cursor: pointer; }
.float-pad .np-bar { max-width: 520px; margin: 0 auto 6px; }

/* хуваарь: олон баг */
.multi-tg { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--action); font-weight: 700; cursor: pointer; }
.team-multi { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin-top: 6px; }
.tp-team { grid-column: 1 / -1; margin: 10px 0 2px; padding-bottom: 4px; border-bottom: 2px solid var(--line2); display: flex; gap: 8px; align-items: center; }

/* тэмдэг */
.badges { margin: 14px 0 4px; }
.bd-h { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.bd-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bd { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; border-radius: 14px; border: 1px dashed var(--line); background: var(--card); filter: grayscale(1); opacity: .5; }
.bd.on { filter: none; opacity: 1; border: 1px solid transparent; background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(135deg, var(--primary), #ffaa2b) border-box; box-shadow: var(--sh-card); }
.bd-i { font-size: 30px; line-height: 1.1; }
.bd-n { font-weight: 800; font-size: 13.5px; }
.bd small { font-size: 11.5px; color: var(--muted); }

/* тэргүүлэгчид */
.lb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lb-col h3 { margin: 0 0 10px; }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-list li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line2); }
.lb-list li.podium { background: linear-gradient(90deg, rgba(255, 170, 43, .12), transparent); border-radius: 10px; }
.lb-rk { width: 28px; text-align: center; font-family: var(--font-display, inherit); font-size: 18px; font-weight: 700; color: var(--muted); flex: none; }
.lb-who { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; text-decoration: none; color: var(--ink); }
.lb-who .avatar { width: 34px; height: 34px; flex: none; }
.lb-who span { display: flex; flex-direction: column; min-width: 0; }
.lb-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.lb-who small { color: var(--muted); font-size: 12px; }
.lb-v { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.lb-v b { font-family: var(--font-display, inherit); font-size: 20px; font-weight: 600; }
.lb-v small { color: var(--muted); font-size: 11.5px; }
.lb-lv { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--action); }
@media (max-width: 1000px) { .lb-grid { grid-template-columns: 1fr; } }

/* амьд самбар (проектор) */
body.board-mode .sidebar, body.board-mode .topbar, body.board-mode #hamb, body.board-mode .top { display: none !important; }
body.board-mode main, body.board-mode .main, body.board-mode #view { margin: 0 !important; padding: 0 !important; max-width: none !important; }
body.board-mode { background: #0b0d12; overflow: hidden; }
.board { position: fixed; inset: 0; z-index: 100; background: radial-gradient(1200px 600px at 10% -10%, rgba(255, 97, 117, .18), transparent), #0b0d12; color: #f3f4f6; display: flex; flex-direction: column; padding: 2vh 2vw; font-size: clamp(14px, 1.2vw, 26px); }
.bd-load, .bd-empty { color: #6b7280; padding: 1em; }
.bd-head { display: flex; align-items: center; gap: 1.5vw; padding-bottom: 1.5vh; border-bottom: 2px solid rgba(255, 255, 255, .08); }
.bd-brand { display: flex; align-items: center; gap: .8em; flex: 1; min-width: 0; }
.bd-brand .logo-mark { width: 2.4em; height: 2.4em; display: flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; border-radius: .5em; }
.bd-brand b { display: block; font-family: var(--font-display, inherit); font-size: 1.9em; font-weight: 600; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-brand small { color: #9ca3af; font-size: .8em; }
.bd-live { display: flex; align-items: center; gap: .4em; font-weight: 800; color: #ff4b5c; letter-spacing: .1em; }
.bd-live i { width: .7em; height: .7em; border-radius: 50%; background: #ff4b5c; animation: live-blink 1.2s infinite; }
@keyframes live-blink { 50% { opacity: .2; } }
.bd-prog { display: flex; align-items: center; gap: .5em; width: 14vw; }
.bd-prog span { font-family: var(--font-display, inherit); font-size: 1.5em; }
.bd-prog div { flex: 1; height: .5em; border-radius: 1em; background: rgba(255, 255, 255, .1); overflow: hidden; }
.bd-prog i { display: block; height: 100%; background: linear-gradient(90deg, #12c94a, #ffaa2b); }
.bd-clock { font-family: var(--font-display, inherit); font-size: 2.4em; font-weight: 600; }
.bd-ctl button { background: rgba(255, 255, 255, .08); border: 0; color: #fff; width: 2.2em; height: 2.2em; border-radius: .5em; font-size: 1em; cursor: pointer; margin-left: .3em; }
.bd-main { flex: 1; display: grid; grid-template-columns: 1fr 22vw; gap: 1.5vw; min-height: 0; padding-top: 1.5vh; }
.bd-tests { display: grid; grid-template-columns: repeat(auto-fill, minmax(22vw, 1fr)); gap: 1.2vw; align-content: start; overflow: hidden; }
.bd-t { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); border-radius: 1em; padding: .8em 1em; }
.bd-t h3 { margin: 0 0 .4em; font-family: var(--font-display, inherit); font-size: 1.25em; font-weight: 600; letter-spacing: .02em; color: #fff; }
.bd-t h3 small { color: #6b7280; font-size: .65em; font-family: "Nunito Sans", sans-serif; }
.bd-t ol { list-style: none; margin: 0; padding: 0; }
.bd-t li { display: flex; align-items: center; gap: .6em; padding: .25em 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.bd-t li .rk { width: 1.6em; text-align: center; }
.bd-t li .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-t li .nm i { font-style: normal; color: #9ca3af; margin-right: .4em; }
.bd-t li b { font-family: var(--font-display, inherit); font-size: 1.35em; font-weight: 600; }
.bd-t li.r1 b { color: #ffd166; } .bd-t li.r1 { font-size: 1.12em; }
.bd-feed { background: rgba(255, 255, 255, .03); border-radius: 1em; padding: .8em; overflow: hidden; }
.bd-feed h3 { margin: 0 0 .5em; font-family: var(--font-display, inherit); font-weight: 600; color: #9ca3af; letter-spacing: .06em; text-transform: uppercase; font-size: 1em; }
.bd-f { display: grid; grid-template-columns: 1fr auto; gap: 0 .5em; padding: .45em .5em; border-radius: .5em; margin-bottom: .3em; background: rgba(255, 255, 255, .03); }
.bd-f .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-f .ts { grid-column: 1; font-size: .75em; color: #9ca3af; }
.bd-f b { grid-row: 1 / 3; grid-column: 2; align-self: center; font-family: var(--font-display, inherit); font-size: 1.5em; }
.bd-f em { grid-column: 2; font-style: normal; font-size: .7em; color: #ff6175; font-weight: 800; text-align: right; }
.bd-f.bad b { color: #fd5353; }
.bd-f.new { animation: bd-new 2.5s ease-out; }
@keyframes bd-new { 0% { background: rgba(18, 201, 74, .45); transform: translateX(-6px); } 100% { background: rgba(255, 255, 255, .03); transform: none; } }
.bd-foot { color: #4b5563; font-size: .7em; padding-top: .6vh; text-align: right; }

/* ================================================================ тоглолтын горим (шалгагч) */
.gear.on { background: var(--primary); color: #fff; }
.lane { display: none; }
.am-next { background: #1f2937; color: #fff; border-color: #1f2937; }
body.game-mode .att-bg { background: #05070b; }
body.game-mode .att-modal { inset: 0; left: 0; top: 0; transform: none; width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; background: #0b0d12; color: #f3f4f6; }
body.game-mode .am-head { border-color: rgba(255, 255, 255, .08); padding: 10px 14px; }
body.game-mode .am-h-main { display: none; }
body.game-mode .lane { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
body.game-mode .lane-no { flex: none; min-width: 74px; height: 74px; padding: 0 10px; border-radius: 14px; background: #fff; color: #0b0d12; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display, inherit); font-size: 46px; font-weight: 700; transform: skewX(-8deg); box-shadow: inset 0 -6px 0 var(--primary); }
body.game-mode .lane-txt b { display: block; font-family: var(--font-display, inherit); font-size: 26px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.game-mode .lane-txt small { color: #9ca3af; font-size: 14px; }
body.game-mode .am-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; }
body.game-mode .am-body .tool { display: contents; }
body.game-mode .sw-time { order: 0; flex: 1; display: flex; align-items: center; justify-content: center; font-size: min(30vw, 26vh) !important; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
body.game-mode .am-att { order: 1; background: transparent; }
body.game-mode .am-att .att2-h, body.game-mode .am-lbl { color: #9ca3af; }
body.game-mode .am-fields .fld { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .12); }
body.game-mode .tap { order: 2; background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .08); color: #e5e7eb; }
body.game-mode .tap-btns button { height: 84px; font-size: 24px; }
body.game-mode .sw-reset { order: 3; background: transparent; color: #9ca3af; border-color: rgba(255, 255, 255, .15); }
body.game-mode .sw-go { order: 4; height: 110px; border-radius: 22px; }
body.game-mode .sw-go .sw-lbl { font-size: 40px; }
body.game-mode #np-att { order: 5; }
body.game-mode .am-nav { border-color: rgba(255, 255, 255, .08); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
body.game-mode .am-nav .btn { height: 60px; font-size: 1.05rem; }
body.game-mode .am-nav #am-cancel, body.game-mode .am-nav .vbtn { background: rgba(255, 255, 255, .06); color: #e5e7eb; border-color: rgba(255, 255, 255, .1); }
body.game-mode .am-next { background: var(--primary); border-color: var(--primary); flex: 1; }
body.game-mode .np-k { background: rgba(255, 255, 255, .07); color: #fff; border-color: rgba(255, 255, 255, .1); }
body.game-mode .np-f { background: rgba(255, 255, 255, .03); color: #9ca3af; }
body.game-mode .np-close { background: rgba(255, 255, 255, .1); color: #fff; }
body.game-mode .rec-box { background: rgba(255, 255, 255, .08); color: #fff; }
/* оролдлогын доод товчнууд: нарийн дэлгэцэнд багтаана */
.am-nav { display: grid; grid-template-columns: auto auto 1fr auto; align-items: stretch; }
.am-nav:not(:has(#am-next)) { grid-template-columns: auto auto 1fr; }
.am-nav .big { min-width: 0; }
@media (max-width: 600px) {
  .am-nav { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .am-nav .vbtn { font-size: 0 !important; padding: 0 12px; } .am-nav .vbtn::before { content: "🎥"; font-size: 20px; }
  .am-nav #am-cancel { padding: 0 12px; }
}
body.game-mode .am-nav { grid-template-columns: auto auto 1fr 1.3fr; }
body.game-mode .am-body { justify-content: flex-start; overflow-y: auto; }
body.game-mode .am-body > *, body.game-mode .am-body .tool > * { flex-shrink: 0; }
body.game-mode .sw-time { flex: 1 0 auto; min-height: 22vh; }
body.game-mode .am-body:has(#np-att:not([hidden])) .sw-time { min-height: 0; flex: 0 0 auto; font-size: 13vh !important; }
body.game-mode .am-body:has(#np-att:not([hidden])) .tap, body.game-mode .am-body:has(#np-att:not([hidden])) .sw-reset { display: none; }

.bd-wait { grid-column: 1 / -1; color: #6b7280; font-size: .85em; display: flex; flex-wrap: wrap; gap: .4em .6em; align-items: center; }
.bd-wait span { background: rgba(255, 255, 255, .05); padding: .2em .6em; border-radius: .4em; }
.form-grid .field:has(#multi:checked) { grid-column: span 2; }

/* ================================================================ v3.1 — сорил авах: дээд хэсэг түгжигдэнэ (scroll-гүй), доод нь scroll */
.run-head { position: sticky !important; top: var(--top-h); z-index: 15; background: var(--bg); padding-bottom: 8px; box-shadow: 0 10px 14px -12px rgba(0, 0, 0, .25); }
html[data-theme="dark"] .run-head { box-shadow: 0 10px 14px -12px rgba(0, 0, 0, .7); }
.cf-next { line-height: 1.25; }
.cf-next .cf-l1 { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.cf-next .cf-l2 { display: block; font-family: var(--font-display, inherit); font-size: 30px; font-weight: 600; color: var(--ink); margin: 4px 0; }
.cf-next .cf-l3 { display: inline-block; font-size: 15px; font-weight: 800; color: var(--action); background: var(--action-soft); padding: 3px 12px; border-radius: 99px; }
/* самбар: хажуугийн хэсэг (амарч буй, шалгагчид, сүүлийн үр дүн), цаг */
.bd-main { grid-template-columns: 1fr 24vw; }
.bd-side { display: flex; flex-direction: column; gap: 1vh; min-height: 0; overflow: hidden; }
.bd-side section { background: rgba(255, 255, 255, .03); border-radius: 1em; padding: .7em .8em; }
.bd-side .bd-feed { flex: 1; min-height: 0; overflow: hidden; }
.bd-side h3 { margin: 0 0 .5em; font-family: var(--font-display, inherit); font-weight: 600; color: #9ca3af; letter-spacing: .06em; text-transform: uppercase; font-size: .95em; display: flex; align-items: center; gap: .4em; }
.bd-side h3 b { margin-left: auto; color: #fff; font-size: 1.2em; }
.bd-rest { border: 1px solid rgba(255, 170, 43, .35); background: rgba(255, 170, 43, .08) !important; }
.bd-rest h3 { color: #ffc46b; }
.bd-r { display: flex; align-items: center; gap: .5em; padding: .3em 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.bd-r .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.bd-r .nm small { display: block; font-weight: 500; color: #9ca3af; font-size: .72em; }
.bd-r b { font-family: var(--font-display, inherit); font-size: 1.4em; color: #ffc46b; font-variant-numeric: tabular-nums; }
.bd-r b.ready { color: #12c94a; font-size: 1em; }
.bd-u { display: flex; align-items: center; gap: .5em; padding: .3em 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.bd-u i { width: .6em; height: .6em; border-radius: 50%; background: #4b5563; flex: none; }
.bd-u.act i { background: #12c94a; box-shadow: 0 0 0 .25em rgba(18, 201, 74, .2); }
.bd-u .nm { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-u .nm small { display: block; font-weight: 500; color: #9ca3af; font-size: .72em; }
.bd-u .bd-cnt { text-align: right; white-space: nowrap; font-family: var(--font-display, inherit); font-size: 1.3em; }
.bd-u .bd-cnt small { display: block; font-family: "Nunito Sans", sans-serif; font-size: .55em; color: #9ca3af; }
.bd-time { text-align: right; line-height: 1.1; }
.bd-time small { display: block; color: #9ca3af; font-size: .75em; }
.bd-time b { font-family: var(--font-display, inherit); font-size: 1.6em; font-weight: 600; color: #12c94a; font-variant-numeric: tabular-nums; }
.bd-fs-ask { position: fixed; inset: 0; z-index: 300; background: rgba(5, 7, 11, .85); color: #fff; border: 0; font: inherit; font-size: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; cursor: pointer; }
.bd-fs-ask span { font-size: 22px; font-weight: 700; }
.bd-menu { position: relative; display: inline-block; }
.bd-menu > summary { list-style: none; cursor: pointer; }
.bd-menu > summary::-webkit-details-marker { display: none; }
.bd-menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-hover); padding: 6px; min-width: 240px; display: flex; flex-direction: column; }
.bd-menu-pop button { border: 0; background: none; font: inherit; text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); font-weight: 600; }
.bd-menu-pop button:hover { background: var(--line2); }

/* ================================================================ v3.2 — амьд самбар: дэлгэцийг бүтэн дүүргэнэ (responsive) */
.board { font-size: clamp(13px, min(1.05vw, 1.9vh), 44px); padding: 1.6vh 1.6vw; }
.bd-main { grid-template-columns: minmax(0, 1fr) clamp(260px, 23vw, 40vw); }
.bd-tests { display: flex; flex-direction: column; gap: 1vh; min-height: 0; min-width: 0; overflow: hidden; }
.bd-grid { flex: 1; min-height: 0; display: grid; gap: 1.2vmin; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.bd-grid > .bd-empty { grid-column: 1 / -1; align-self: center; text-align: center; font-size: 2em; }
.bd-wait { flex: none; }
.bd-t { container-type: size; min-height: 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; padding: 0; }
.bd-t > h3, .bd-t > ol { font-size: clamp(12px, min(7.2cqh, 5cqw), 96px); }
.bd-t > h3 { padding: .7em .9em 0; margin: 0 0 .25em; font-size: clamp(12px, min(8cqh, 5.6cqw), 110px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-t > ol { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-evenly; padding: 0 .9em .5em; }
.bd-t li { flex: 1 1 0; max-height: 3.2em; padding: 0; }
.bd-t li:last-child { border-bottom: 0; }
.bd-t li b { font-variant-numeric: tabular-nums; }
.bd-side .bd-feed { -webkit-mask-image: linear-gradient(#000 85%, transparent); mask-image: linear-gradient(#000 85%, transparent); }
.bd-side .bd-rest, .bd-side .bd-testers { flex: none; max-height: 34vh; overflow: hidden; }
/* босоо / нарийн дэлгэц: хажуугийн хэсэг доор */
@media (max-aspect-ratio: 1/1) {
  .board { font-size: clamp(12px, min(2.2vw, 1.5vh), 40px); }
  .bd-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .bd-side { flex-direction: row; max-height: 32vh; }
  .bd-side > section { flex: 1 1 0; min-width: 0; max-height: none; }
}
@media (max-width: 700px) { .bd-prog { display: none; } .bd-head { flex-wrap: wrap; } }
.view > .board, .board { max-width: none !important; width: auto; }
.bd-head { min-width: 0; }
.bd-head > * { flex: none; }
.bd-brand { flex: 1 1 0 !important; min-width: 0; }
.bd-brand > div { min-width: 0; }
.bd-brand small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-wait { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.bd-wait b { flex: none; }
.bd-t > ol { justify-content: flex-start; }
.bd-t li { flex: 0 0 20%; max-height: none; }
/* v3.5 — видео ачаалах төлөв */
.vp-stage { position: relative; }
.vp-load { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: #cbd5e1; background: rgba(2, 6, 23, .55); font-weight: 600; padding: 16px; }
.vp-load small { color: #94a3b8; font-weight: 500; }

/* ================================================================ v3.6 — брэнд: Core Scores лого (light: өнгөт, dark: цагаан), footer */
.cs-logo { display: inline-flex; flex: none; height: 46px; line-height: 0; }
.cs-logo img { height: 100%; width: auto; display: block; }
.cs-logo .cs-d { display: none; }
[data-theme="dark"] .cs-logo .cs-l { display: none; }
[data-theme="dark"] .cs-logo .cs-d { display: block; }
.cs-logo.cs-sm { height: 20px; vertical-align: middle; margin: 0 2px; }
.cs-logo.cs-lg { height: 64px; }
.logo { gap: 14px; }
.logo-txt b sup, .site-foot sup, .login h1 sup { font-size: .5em; font-weight: 700; vertical-align: super; margin-left: 1px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.login-brand h1 { margin: 0; }
.site-foot { margin-left: var(--side-w); padding: 18px 40px 26px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; font-size: 12.5px; color: var(--muted); }
.site-foot b { color: var(--ink); font-weight: 700; }
.site-foot .sf-r { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.site-foot .sf-r:hover b { text-decoration: underline; }
body.no-auth .site-foot { margin-left: 0; justify-content: center; text-align: center; }
@media (max-width: 1024px) { .site-foot { margin-left: 0; padding: 16px 14px 90px; justify-content: center; text-align: center; } }
body.board-mode .site-foot { display: none; }
@media print { .site-foot { margin-left: 0; padding: 10px 0; border-top: 1px solid #ccc; } }
@media (min-width: 1024px) { .view { padding-bottom: 40px; } }
.bd-foot .cs-logo { height: 1.3em; vertical-align: middle; margin: 0 .2em; }
.logo { padding: 24px 20px 16px 24px; gap: 12px; }
.logo .cs-logo { height: 42px; }
.logo-txt { min-width: 0; }
.logo-txt b { font-size: 19px; white-space: nowrap; }
.logo-txt small { display: block; white-space: nowrap; font-size: 11.5px; }
.cs-logo.cs-sm { height: 26px; }
