@import url("fonts.css");
/* ==========================================================================
   ТАЛБАЙ — спортын тэмцээний систем
   Фонт: Inter (variable, optical size) + JetBrains Mono — өөрийн серверээс
   Өнгө: бэх #15171C · улбар шар #C2410C · ногоон-цэнхэр #0F5E5A · цаас #F3F2EE
   ========================================================================== */
:root {
    --ink: #15171C;
    --ink-2: #2A2D35;
    --paper: #F3F2EE;
    --card: #FFFFFF;
    --line: #E2E0D8;
    --line-2: #D3D0C5;
    --muted: #6B6A63;
    --accent: #C2410C;
    --accent-2: #9A3412;
    --accent-soft: #FDEBDD;
    --teal: #0F5E5A;
    --teal-soft: #DCEDEA;
    --bad: #B42318;
    --bad-soft: #FDE7E4;
    --ok: #0F5E5A;
    --ok-soft: #DCEDEA;
    --live: #C2410C;
    --live-soft: #FDEBDD;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(21,23,28,.06), 0 4px 16px rgba(21,23,28,.05);
    --font: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: var(--font);
    --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --topbar-h: 60px;
    --bottomnav-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-optical-sizing: auto;
    letter-spacing: -0.006em;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 2.2rem); letter-spacing: -0.028em; }
h2 { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.015em; }
.h3, h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
code { font-family: var(--font-mono); font-size: .85em; background: var(--paper); padding: 1px 6px; border-radius: 6px; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1:focus, h1:focus-visible, [tabindex="-1"]:focus { outline: none; }

/* ---------- Туслах ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.light-muted { color: rgba(255,255,255,.6); }
.small { font-size: .85rem; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; font-size: .94em; }
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.display.big { font-size: 1.6rem; line-height: 1.15; margin: 6px 0 12px; }
.strong, strong { font-weight: 600; }
.accent { color: var(--accent); }
.teal { color: var(--teal); }
.bad-text { color: var(--bad) !important; }
.center { text-align: center; display: block; }
.c { text-align: center; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.pad { padding: 18px; }
.pad-top { padding-top: 12px; }
.mt { margin-top: 16px; }
.w-auto { width: auto !important; }
.pre { white-space: pre-wrap; }
.row { display: flex; align-items: center; }
.row.gap, .gap { gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.link-strong { color: var(--accent); font-weight: 600; }
.link-strong:hover { text-decoration: underline; }
.eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.eyebrow.light { color: #F6B48A; }
.lead { color: var(--muted); margin-top: 6px; max-width: 62ch; }
.hide-xs { }
.show-touch { display: none !important; }
@media (hover: none) and (pointer: coarse) { .show-touch { display: inline-flex !important; } }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container.narrow, .narrow-page { max-width: 760px; }
.page { padding-top: 26px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 20px; }
.section { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Үндсэн бүтэц ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.app-main { flex: 1; }
.topbar { position: sticky; top: 0; z-index: 40; background: var(--ink); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.topbar-inner { height: var(--topbar-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; letter-spacing: .02em; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.topnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { padding: 8px 12px; border-radius: 8px; color: rgba(255,255,255,.72); font-weight: 500; white-space: nowrap; }
.topnav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.topnav a.active { color: #fff; background: rgba(255,255,255,.1); }
.topbar-user { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: #fff; padding: 4px 10px 4px 4px; border-radius: 999px; }
.user-chip:hover { background: rgba(255,255,255,.08); color: #fff; }
.user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.inline-form { display: inline; margin: 0; }
.icon-btn { background: none; border: 0; color: rgba(255,255,255,.75); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: .8rem; background: var(--accent); color: #fff; flex: none; }
.avatar.light { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.avatar.big { width: 56px; height: 56px; font-size: 1.1rem; }

.footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: .85rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.footer a { color: var(--accent); }

.bottomnav { display: none; }

/* ---------- Товч ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid transparent;
    font-weight: 600; font-size: .92rem; line-height: 1.2; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, transform .05s;
    text-decoration: none; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: .84rem; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: #0B4744; color: #fff; }
.btn-outline { background: var(--card); border-color: var(--line-2); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(21,23,28,.06); color: var(--ink); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.btn-ghost-light:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ---------- Пилл, таг, чип ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.live { background: var(--live-soft); color: var(--live); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.dark { background: var(--ink); color: #fff; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .74rem; font-weight: 600; background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); }
.tag.teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.tag.accent { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
.tags { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border: 1px solid var(--line-2); background: var(--card); padding: 6px 13px; border-radius: 999px; font-size: .85rem; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.off { opacity: .45; text-decoration: line-through; }
.chip-static { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--paper); border: 1px solid var(--line); }
.chip-dark { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: rgba(255,255,255,.12); color: #fff; }
.person-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.person-chip span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.person-chip small { color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Карт ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.card.dark .kv li { border-color: rgba(255,255,255,.1); }
.card.dark .kv li span:first-child { color: rgba(255,255,255,.6); }
.card.muted { color: var(--muted); }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.sticky { position: sticky; top: calc(var(--topbar-h) + 16px); }
.section-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.form-card { max-width: 460px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 16px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head.compact h1 { font-size: clamp(1.25rem, 3vw, 1.7rem); }
.page-head h1 { margin-top: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; font-weight: 500; }
.back-link:hover { color: var(--ink); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.split-main, .split-side { min-width: 0; }
.split-side { display: flex; flex-direction: column; gap: 16px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
a.kpi:hover { border-color: var(--ink); color: inherit; }
.kpi span { color: var(--muted); font-size: .84rem; }
.kpi strong { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: .78rem; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.summary-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.summary-card:hover { border-color: var(--ink); color: inherit; }
.summary-card .num { font-family: var(--font-display); font-weight: 700; font-size: 1.85rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat3 > div { display: flex; flex-direction: column; }
.stat3 strong { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat3 span { font-size: .78rem; opacity: .7; }

/* ---------- Таб ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: none; border: 0; padding: 11px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--paper); border-radius: 10px; padding: 4px; gap: 4px; }
.segmented a { text-align: center; padding: 8px 6px; border-radius: 8px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.segmented a.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.anchor-tabs { display: flex; gap: 18px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; }
.anchor-tabs a { font-weight: 600; color: rgba(255,255,255,.7); white-space: nowrap; }
.anchor-tabs a:hover { color: #fff; }

/* ---------- Форм ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: .78rem; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.narrow, .narrow-field { max-width: 220px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea {
    width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background: #fff; transition: border-color .15s, box-shadow .15s; font-size: 16px; /* iOS zoom хориглох */
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(194,65,12,.15); }
input:disabled, select:disabled { background: var(--paper); color: var(--muted); }
input[type=color] { width: 100%; height: 42px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 4px; background: #fff; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
input.switch { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; vertical-align: middle; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
input.switch:checked { background: var(--teal); }
input.switch:checked::after { transform: translateX(18px); }
input.switch:disabled { opacity: .4; cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.sticky-bottom { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 8px; z-index: 5; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.fieldset legend { font-weight: 600; font-size: .88rem; padding: 0 6px; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0 12px; min-width: 220px; }
.search input { border: 0 !important; box-shadow: none !important; padding-left: 0 !important; background: transparent !important; }
.search svg { color: var(--muted); flex: none; }
.toolbar { display: flex; flex-direction: column; gap: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters select { width: auto; }
.filters-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; }
.filters-bar select { width: auto; min-width: 140px; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.option-grid.three { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.option { text-align: left; background: #fff; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.option span { color: var(--muted); font-size: .82rem; }
.option:hover { border-color: var(--ink); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
details.more summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); }

/* ---------- Мэдэгдэл ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .92rem; border: 1px solid transparent; }
.alert svg { flex: none; margin-top: 2px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: #EEF1F6; color: #2C3E5A; }
.alert .btn { margin-left: auto; }
.note { background: var(--accent-soft); color: var(--accent-2); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .9rem; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 0; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
.empty p { color: var(--muted); max-width: 44ch; }
.toasts { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toast-in .2s ease-out; font-size: .92rem; }
.toast.ok svg:first-child { color: #6FD3C6; }
.toast.bad { background: var(--bad); }
.toast.info svg:first-child { color: #F6B48A; }
.toast span { flex: 1; }
.toast-x { background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; padding: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; background: var(--bad); color: #fff; padding: 12px 20px; }
#blazor-error-ui a { color: #fff; text-decoration: underline; margin-left: 8px; }
#blazor-error-ui .dismiss { position: absolute; right: 16px; top: 10px; background: none; border: 0; color: #fff; cursor: pointer; }

/* ---------- Жагсаалт, хүснэгт ---------- */
.list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: #FAF9F6; color: inherit; }
.list-row.static { cursor: default; }
.card .list-row { padding: 12px 18px; }
.card.form-stack .list-row { padding: 10px 0; }
.time-col { display: flex; flex-direction: column; min-width: 60px; font-weight: 600; }
.score { font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; background: #FAF9F6; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th.c, .table td.c { text-align: center; }
.table th.r, .table td.r { text-align: right; }
.table.compact td, .table.compact th { padding: 8px 10px; }
.table tbody tr:hover { background: #FBFAF7; }
.row-selected { background: var(--accent-soft) !important; }
.row-live { background: var(--live-soft); }
.row-muted { opacity: .55; }
.cell-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pos { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--paper); font-size: .75rem; font-weight: 700; margin-right: 4px; }
.pos.q { background: var(--teal); color: #fff; }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.kv li:last-child { border-bottom: 0; }
.kv.light li span:first-child { color: var(--muted); }
.kv li span:last-child { font-weight: 600; text-align: right; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.player-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.player-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.player-list li:last-child { border-bottom: 0; }
.team-avatar { border-radius: 10px; background: var(--paper); border: 1px solid var(--line); display: inline-grid; place-items: center; overflow: hidden; flex: none; font-weight: 700; font-size: .75rem; color: var(--ink-2); }
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Нүүр, тэмцээний карт ---------- */
.comp-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.comp-cover { aspect-ratio: 12 / 5; background: var(--sport, var(--ink)); display: grid; place-items: center; color: rgba(255,255,255,.9); position: relative; overflow: hidden; }
.comp-cover > img:not(.cover-icon) { width: 100%; height: 100%; object-fit: cover; }
.comp-cover .cover-icon { width: 72px; height: 72px; object-fit: contain; }
.comp-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 60%, rgba(0,0,0,.15)); }
.comp-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.comp-title { font-size: 1.1rem; }
.comp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 18px 18px; }
.progress-row { display: flex; justify-content: space-between; font-size: .85rem; }
.bar { height: 6px; border-radius: 999px; background: var(--paper); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

.hero { background: var(--ink); color: #fff; position: relative; }
.hero.has-cover { background: linear-gradient(90deg, rgba(21,23,28,.95) 30%, rgba(21,23,28,.6)), var(--cover) center / cover no-repeat, var(--ink); }
.hero-inner { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 28px; padding-top: 28px; padding-bottom: 28px; }
.hero-main { display: flex; flex-direction: column; gap: 14px; }
.hero .back-link { color: rgba(255,255,255,.65); }
.hero .back-link:hover { color: #fff; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 18px; color: rgba(255,255,255,.8); font-size: .92rem; }
.hero-facts > * { display: inline-flex; align-items: center; gap: 6px; }
.hero-side .card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #fff; box-shadow: none; display: flex; flex-direction: column; gap: 10px; }
.hero-side .muted { color: rgba(255,255,255,.6); }

.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.fact-grid > div { background: var(--paper); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; font-size: .88rem; }
.prose h2 { margin-bottom: 10px; }
.prose p { margin-bottom: 10px; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; display: flex; flex-direction: column; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-2); }
.timeline li.done::before { background: var(--teal); border-color: var(--teal); }
.timeline li.accent::before { background: var(--accent); border-color: var(--accent); }
.timeline li span { color: var(--muted); font-size: .82rem; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.team-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; align-items: center; gap: 12px; }
.team-card .grow { display: flex; flex-direction: column; }
.team-card.add { border-style: dashed; justify-content: center; flex-direction: column; text-align: center; color: var(--accent); }
.podium-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.podium-list li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--paper); }
.place { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; background: var(--card); border: 1px solid var(--line); }
.place-1 .place { background: #E8B931; border-color: #E8B931; color: var(--ink); }
.place-2 .place { background: #C7CCD3; border-color: #C7CCD3; }
.place-3 .place { background: #C98B5A; border-color: #C98B5A; color: #fff; }

/* Үр дүн */
.result-card { display: flex; flex-direction: column; gap: 16px; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; align-items: end; }
.podium-step { border-radius: var(--radius-sm) var(--radius-sm) 0 0; padding: 14px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--paper); }
.podium-step.p1 { background: var(--ink); color: #fff; min-height: 170px; }
.podium-step.p2 { min-height: 140px; }
.podium-step.p3 { min-height: 118px; }
.podium-icon { color: #E8B931; }
.podium-num { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; letter-spacing: -0.03em; }
.rest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rest-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--paper); }

/* ---------- Сүлжээ (нугалаа, зөрлөг, финал) ---------- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.bracket-scroll { overflow-x: auto; padding: 18px; }
.bracket { display: grid; grid-template-columns: repeat(var(--rounds, 3), minmax(210px, 1fr)); gap: 24px; min-width: calc(var(--rounds, 3) * 234px); }
.round { display: flex; flex-direction: column; }
.round-name { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.round-matches { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; flex: 1; }
.match-box { background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; font-size: .88rem; position: relative; }
.match-box.live { border-color: var(--live); box-shadow: 0 0 0 2px var(--live-soft); }
.match-box.final { border-color: var(--ink); border-width: 2px; }
.match-head { display: flex; justify-content: space-between; padding: 5px 10px; font-size: .72rem; color: var(--muted); background: #FAF9F6; border-bottom: 1px solid var(--line); }
.match-head a { color: var(--accent); font-weight: 600; }
.match-row { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; }
.match-row + .match-row { border-top: 1px solid var(--line); }
.match-row.win { font-weight: 700; }
.match-row.win span:last-child { color: var(--teal); }
.match-row.lose { color: var(--muted); }

/* ---------- Онооны самбар ---------- */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; padding: 24px 16px; }
.sb-team { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sb-name { font-weight: 600; overflow-wrap: anywhere; }
.sb-score { font-family: var(--font-display); font-size: clamp(2.4rem, 9vw, 3.6rem); line-height: 1; }
.sb-sep { font-family: var(--font-display); font-size: 2rem; opacity: .5; }
.score-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big-input { font-family: var(--font-display) !important; font-size: 2rem !important; text-align: center; min-height: 64px !important; }
.periods input.score-cell { width: 84px; text-align: center; font-family: var(--font-mono); font-weight: 600; margin: 0 auto; display: block; }
.status-panel { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pay-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 14px; }
.pay-box > div { display: flex; flex-direction: column; }

/* ---------- Мэдүүлгийн засвар ---------- */
.player-editor { display: flex; flex-direction: column; gap: 10px; }
.player-row { display: grid; grid-template-columns: 28px 64px minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #FCFBF9; }
.player-no { font-weight: 700; padding-top: 34px; text-align: center; color: var(--muted); }
.player-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.player-actions { display: flex; flex-direction: column; gap: 4px; padding-top: 26px; }

/* ---------- Зураг оруулах ---------- */
.upload { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.upload-box { position: relative; display: grid; place-items: center; border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); background: #FCFBF9; cursor: pointer; overflow: hidden; color: var(--muted); transition: border-color .15s; }
.upload-box:hover { border-color: var(--accent); color: var(--accent); }
.upload-box img { width: 100%; height: 100%; object-fit: cover; }
.upload-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .8rem; text-align: center; padding: 6px; }
.upload-busy { position: absolute; inset: 0; background: rgba(255,255,255,.75); display: grid; place-items: center; color: var(--accent); }
.upload-cover { width: 100%; }
.upload-cover .upload-box { width: 100%; aspect-ratio: 16 / 6; }
.upload-logo .upload-box { width: 120px; height: 120px; }
.upload-avatar .upload-box { width: 64px; height: 80px; border-radius: 10px; }
.upload-icon .upload-box { width: 88px; height: 88px; border-radius: 18px; }
.upload-icon .upload-box img { object-fit: contain; padding: 8px; }

/* ---------- Админ ---------- */
.admin-shell { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 24px; padding-top: 24px; padding-bottom: 40px; align-items: start; }
.admin-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sidenav { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.sidenav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); padding: 6px 10px 8px; }
.sidenav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-weight: 500; color: var(--ink-2); }
.sidenav a:hover { background: var(--paper); color: var(--ink); }
.sidenav a.active { background: var(--ink); color: #fff; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 180px; align-items: end; margin-top: 14px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar-col .bar { width: 100%; max-width: 34px; background: var(--ink); border-radius: 6px 6px 2px 2px; min-height: 2px; height: auto; }
.bar-col.active .bar { background: var(--accent); }
.bar-val { font-size: .7rem; font-family: var(--font-mono); color: var(--muted); }
.bar-lbl { font-size: .72rem; color: var(--muted); }
.sport-stat { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sport-stat:last-child { border-bottom: 0; }
.sport-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.sport-card { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; align-items: flex-start; }
.sport-card:hover { border-color: var(--ink); }
.sport-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sport-card.inactive { opacity: .6; }
.sport-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; overflow: hidden; margin-bottom: 4px; }
.sport-icon img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.order-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.order-list li { padding: 4px 0; }
.order-list li > * { vertical-align: middle; }
.order-list li { display: list-item; }
.order-list li .grow { display: inline-block; min-width: 60%; }
.item-list { display: flex; flex-direction: column; gap: 6px; }
.item-row { display: flex; align-items: center; gap: 6px; }
.item-row input { min-height: 36px !important; padding: 6px 10px !important; }

/* ---------- Нэвтрэх ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-hero { background: var(--ink); color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%; border: 48px solid var(--accent); opacity: .9; }
.auth-copy { max-width: 440px; position: relative; z-index: 1; }
.auth-copy h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.auth-copy p { color: rgba(255,255,255,.7); margin-top: 14px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; color: rgba(255,255,255,.85); position: relative; z-index: 1; }
.auth-points li::before { content: "✓"; color: #F6B48A; margin-right: 10px; font-weight: 700; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card-wrap { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 16px; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.stepper li { flex: 1; font-size: .8rem; font-weight: 600; color: var(--muted); border-top: 3px solid var(--line); padding-top: 8px; }
.stepper li.active, .stepper li.done { color: var(--ink); border-top-color: var(--accent); }
.verify-box { display: flex; flex-direction: column; gap: 12px; background: var(--paper); border-radius: var(--radius-sm); padding: 16px; }
.code-display { font-family: var(--font-display); font-size: 2.4rem; letter-spacing: .3em; text-align: center; padding: 12px; background: #fff; border: 1.5px dashed var(--accent); border-radius: var(--radius-sm); user-select: all; }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; }

/* ---------- Хэвлэх ---------- */
.print-shell { background: #D9D7D0; min-height: 100dvh; padding-bottom: 40px; }
.print-toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--ink); color: #fff; }
.print-toolbar .btn-ghost { color: #fff; }
.print-toolbar .check { color: #fff; }
.print-page {
    width: 210mm; min-height: 297mm; margin: 20px auto; background: #fff; padding: 14mm 14mm 12mm;
    box-shadow: 0 4px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 12px;
    font-size: 10.5pt; color: #000; page-break-after: always; break-after: page;
}
.pp-head { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center; border-bottom: 2.5px solid #000; padding-bottom: 10px; }
.pp-logo { width: 60px; height: 60px; border: 1px solid #999; border-radius: 8px; display: grid; place-items: center; overflow: hidden; font-weight: 700; }
.pp-logo img { width: 100%; height: 100%; object-fit: contain; }
.pp-eyebrow { font-size: 8.5pt; text-transform: uppercase; letter-spacing: .06em; color: #444; }
.pp-title h1 { font-family: var(--font-display); font-size: 15pt; margin: 2px 0; }
.pp-sub { font-size: 9pt; color: #333; }
.pp-no { text-align: right; display: flex; flex-direction: column; font-size: 8.5pt; }
.pp-no strong { font-family: var(--font-mono); font-size: 13pt; }
.pp-status { border: 1px solid #000; padding: 1px 6px; border-radius: 4px; margin-top: 3px; align-self: flex-end; }
.pp-team { font-family: var(--font-display); font-size: 17pt; margin: 4px 0 0; }
.pp-facts { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.pp-facts th { text-align: left; color: #444; font-weight: 500; padding: 3px 8px 3px 0; width: 16%; white-space: nowrap; }
.pp-facts td { border-bottom: 1px dotted #999; padding: 3px 12px 3px 0; width: 34%; font-weight: 600; }
.pp-players { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.pp-players th, .pp-players td { border: 1px solid #333; padding: 4px 6px; }
.pp-players th { background: #EEE; font-size: 8.5pt; text-align: left; }
.pp-players th.c, .pp-players td.c { text-align: center; }
.pp-players tbody tr { height: 46px; }
.pp-photo { width: 34px; height: 42px; object-fit: cover; margin: 0 auto; }
.pp-foot { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 30px; font-size: 9.5pt; padding-top: 18px; }
.pp-sign { display: flex; align-items: flex-end; gap: 8px; }
.pp-sign .line { flex: 1; border-bottom: 1px solid #000; height: 18px; }
.pp-meta { grid-column: 1 / -1; font-size: 8pt; color: #555; text-align: right; }

@page { size: A4; margin: 0; }
@media print {
    body { background: #fff; }
    .no-print, .topbar, .bottomnav, .footer, .toasts, #blazor-error-ui, #components-reconnect-modal { display: none !important; }
    .print-shell { background: #fff; padding: 0; }
    .print-page { margin: 0; box-shadow: none; width: auto; min-height: 297mm; }
    .print-page:last-of-type { page-break-after: auto; break-after: auto; }
    img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .pp-players th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- PWA суулгах ---------- */
.install-banner { position: fixed; left: 16px; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 90; max-width: 440px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.3); font-size: .9rem; }
.install-banner img { width: 40px; height: 40px; border-radius: 10px; }
.install-banner .grow { line-height: 1.3; }
.install-banner button { flex: none; }

/* ---------- Гарын авлага ---------- */
.help-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line-2); color: var(--ink-2); border-radius: 999px; padding: 6px 12px 6px 9px; font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.help-btn:hover { border-color: var(--accent); color: var(--accent); }
.help-btn svg { color: var(--accent); }
.help-btn.compact { padding: 0; width: 38px; height: 38px; justify-content: center; border-radius: 10px; }
.topbar .help-btn.compact { background: transparent; border-color: transparent; color: rgba(255,255,255,.75); }
.topbar .help-btn.compact svg { color: inherit; }
.topbar .help-btn.compact:hover { background: rgba(255,255,255,.08); color: #fff; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(21,23,28,.45); z-index: 120; animation: fade-in .15s ease-out; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--paper); z-index: 121; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,0,0,.2); animation: slide-in .2s ease-out; outline: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 20px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); background: var(--ink); color: #fff; }
.drawer-head svg { color: #F6B48A; }
.icon-btn.dark { color: rgba(255,255,255,.8); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 22px; -webkit-overflow-scrolling: touch; }
.drawer-body .help-topic { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.help-topic { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: calc(var(--topbar-h) + 16px); border-radius: var(--radius); transition: box-shadow .4s; }
.help-topic h3 { font-size: 1.05rem; }
.drawer-body .help-topic.flash, .card:has(> .help-topic.flash) { box-shadow: 0 0 0 3px var(--accent); }
.help-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.help-steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; gap: 10px; line-height: 1.5; }
.help-steps li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .78rem; font-weight: 700; display: grid; place-items: center; margin-top: -1px; }
.help-tips { display: flex; gap: 10px; background: var(--accent-soft); color: var(--accent-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .88rem; }
.help-tips svg { flex: none; margin-top: 3px; }
.help-tips ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.help-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.help-group-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.help-group-card:hover { border-color: var(--ink); color: inherit; }
.help-group-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--ink); color: #fff; display: grid; place-items: center; margin-bottom: 6px; flex: none; }
.help-group-icon.sm { width: 32px; height: 32px; border-radius: 9px; margin: 0; }
.help-layout { display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 28px; align-items: start; }
.help-toc { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 1px; max-height: calc(100dvh - var(--topbar-h) - 32px); overflow-y: auto; font-size: .88rem; }
.help-toc-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); padding: 12px 10px 4px; }
.help-toc a { padding: 5px 10px; border-radius: 7px; color: var(--ink-2); }
.help-toc a:hover { background: var(--card); color: var(--accent); }
.help-content { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.help-section { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: calc(var(--topbar-h) + 16px); }

/* ==========================================================================
   Хариуцлагатай дизайн
   ========================================================================== */
@media (max-width: 1024px) {
    .split { grid-template-columns: minmax(0,1fr); }
    .split-side .sticky, .sticky { position: static; }
    .hero-inner { grid-template-columns: minmax(0,1fr); }
    .admin-shell { grid-template-columns: minmax(0,1fr); }
    .sidenav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 6px; }
    .sidenav::-webkit-scrollbar { display: none; }
    .sidenav-title { display: none; }
    .sidenav a { white-space: nowrap; }
}

@media (max-width: 760px) {
    body { font-size: 15px; }
    .container { padding: 0 16px; }
    .page { padding-top: 18px; gap: 16px; padding-bottom: calc(var(--bottomnav-h) + 28px + var(--safe-b)); }
    .admin-shell { padding-bottom: calc(var(--bottomnav-h) + 28px + var(--safe-b)); }
    .topnav, .user-name, .hide-xs { display: none; }
    .topbar-inner { gap: 12px; }
    .footer { padding-bottom: calc(var(--bottomnav-h) + 20px + var(--safe-b)); }
    .bottomnav {
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
        height: calc(var(--bottomnav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
        background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    }
    .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .7rem; font-weight: 600; color: var(--muted); }
    .bottomnav a.active { color: var(--accent); }
    .toasts { bottom: calc(var(--bottomnav-h) + 12px + var(--safe-b)); left: 16px; right: 16px; max-width: none; }
    .install-banner { bottom: calc(var(--bottomnav-h) + 12px + var(--safe-b)); }
    .sticky-bottom { bottom: calc(var(--bottomnav-h) + var(--safe-b)); }

    .page-head { align-items: stretch; flex-direction: column; }
    .page-head .actions .btn, .page-head > .btn { flex: 1 1 auto; }
    .card { padding: 16px; }
    .card-grid { grid-template-columns: minmax(0,1fr); }
    .summary-grid { grid-template-columns: minmax(0,1fr); }
    .summary-card { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
    .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .kpi strong { font-size: 1.4rem; }
    .form-grid, .form-grid.two { grid-template-columns: minmax(0,1fr); }
    .fact-grid { grid-template-columns: minmax(0,1fr); }
    .group-grid { grid-template-columns: minmax(0,1fr); }
    .filters-bar > * { flex: 1 1 140px; }
    .search { min-width: 0; width: 100%; }
    .wrap-mobile { flex-wrap: wrap; }
    .player-row { grid-template-columns: 64px minmax(0,1fr); }
    .player-no { display: none; }
    .player-fields { grid-column: 1 / -1; grid-row: 2; }
    .player-actions { flex-direction: row; padding-top: 0; grid-column: 2; grid-row: 1; justify-content: flex-end; align-self: start; }
    .player-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .status-panel > .btn { flex: 1 1 auto; }
    .podium-step.p1 { min-height: 140px; }
    .podium-step.p2 { min-height: 116px; }
    .podium-step.p3 { min-height: 100px; }
    .auth { grid-template-columns: minmax(0,1fr); grid-template-rows: auto 1fr; }
    .auth-hero { padding: 20px; gap: 12px; }
    .auth-hero::after, .auth-points, .auth-copy p { display: none; }
    .auth-copy h1 { font-size: 1.2rem; }
    .auth-main { place-items: start center; padding: 20px 16px; }
    .print-page { width: 100%; min-height: 0; margin: 12px 0; padding: 14px; }
    .pp-head { grid-template-columns: 44px 1fr; }
    .pp-no { grid-column: 1 / -1; flex-direction: row; gap: 8px; align-items: center; text-align: left; }
    .pp-foot { grid-template-columns: minmax(0,1fr); }
    .bars { height: 140px; gap: 3px; }
    .help-layout { grid-template-columns: minmax(0,1fr); }
    .help-toc { display: none; }
    .drawer { width: 100vw; }
}

@media (display-mode: standalone) {
    .topbar { padding-top: env(safe-area-inset-top, 0px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
