/* ===========================================================================
   DataPortal — үндсэн загвар
   Өнгө, үсэг, хэмжээ нь canvas дээрх "Өнгө, үсэг, компонент" хуудастай ижил.
   Mobile-first: эхлээд утасны, дараа нь @media (min-width) доор компьютерийн хэв.
=========================================================================== */

:root {
    /* ---- Брэнд (дизайн систем: Primary #0B63F6, Primary Dark #0747BF, Secondary #10B981, Accent #F59E0B) ----
       Хуучин нэрс (--orkhon, --khangai ...) бүх CSS-д ашиглагдаж байгаа тул нэрийг нь хадгалж утгыг сольсон. */
    --orkhon: #0B63F6;        /* primary: линк, идэвхтэй төлөв, icon */
    --primary-solid: #0B63F6; /* товчны дэвсгэр (цагаан бичигтэй) */
    --khangai: #0747BF;       /* primary dark: hover */
    --khangai-mid: #3B82F6;
    --secondary: #10B981;
    --erdene-zuu: #F59E0B;    /* accent: онцлох тэмдэг */
    --tal: #F4F7FB;           /* хуудасны дэвсгэр */
    --ink: #0F172A;           /* текст */
    --muted: #5B6B82;         /* туслах текст */
    --border: #E2E8F0;
    --line: #EEF2F7;
    --surface: #FFFFFF;
    --surface-2: #F8FAFC;     /* картын доторх хэсэг, input-ийн дэвсгэр */
    --mint: #DBEAFE;

    /* Модуль бүрийн өнгө (дэвсгэр / тод) — нүүрний хурдан цэсний icon-той ижил */
    --directory-bg: #E6F7EF;  --directory: #0E9F6E;
    --ads-bg: #FFF1E3;        --ads: #C2410C;
    --events-bg: #F1EAFE;     --events: #7C3AED;
    --news-bg: #E7F0FF;       --news: #0B63F6;
    --soums-bg: #FDECEC;      --soums: #E0464E;
    --help-bg: #E3F6FA;       --help: #0891B2;

    /* Төлөв */
    --success: #15803D;
    --danger: #DC2626;
    --danger-bg: #FEE2E2;
    --warning: #B45309;
    --info: #3B82F6;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 8px rgba(15, 23, 42, .04);
    --shadow: 0 2px 6px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .08);
    --header-bg: rgba(255, 255, 255, .86);
    --footer-bg: #0F1E3D;

    /* Hero-ийн тэнгэр, уул (Home.razor-ын SVG) */
    --sky-1: #1D4E9E; --sky-2: #4C86D6; --sky-3: #A8CDF2;
    --hill-far: #8FB3D9; --rock-1: #B9774A; --rock-2: #8E5333; --hill-1: #5E9E4B; --hill-2: #3F7F35; --hill-3: #2E6A2A;
    --sun: #FFE7A3; --ger: #F8FAFC; --ger-roof: #E2E8F0;

    --radius: 12px;
    --radius-lg: 18px;
    --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: var(--font-body);
    color-scheme: light;
}

/* ---- Харанхуй горим ----
   Хэрэглэгч сонгосон бол <html data-theme="dark|light"> (wwwroot/js/theme.js), сонгоогүй бол системийн тохиргоо. */
:root[data-theme="dark"] {
    --orkhon: #6EA8FF; --primary-solid: #2563EB; --khangai: #1D4ED8; --khangai-mid: #3B82F6; --secondary: #34D399; --erdene-zuu: #FBBF24;
    --tal: #0A1222; --ink: #E6EDF7; --muted: #9AA9BF; --border: #22314D; --line: #1A2741; --surface: #111C31; --surface-2: #0E182B; --mint: #1E3A6E;
    --directory-bg: rgba(16, 185, 129, .15); --directory: #34D399;
    --ads-bg: rgba(249, 115, 22, .15);       --ads: #FDBA74;
    --events-bg: rgba(139, 92, 246, .18);    --events: #C4B5FD;
    --news-bg: rgba(59, 130, 246, .18);      --news: #93C5FD;
    --soums-bg: rgba(239, 68, 68, .16);      --soums: #FCA5A5;
    --help-bg: rgba(6, 182, 212, .15);       --help: #67E8F9;
    --success: #4ADE80; --danger: #F87171; --danger-bg: rgba(239, 68, 68, .14); --warning: #FBBF24; --info: #93C5FD;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 12px 32px rgba(0, 0, 0, .35);
    --header-bg: rgba(10, 18, 34, .82); --footer-bg: #070D1A;
    --sky-1: #050B1C; --sky-2: #13254A; --sky-3: #2B4677;
    --hill-far: #2A3F66; --rock-1: #5B4434; --rock-2: #3F2E24; --hill-1: #1F4030; --hill-2: #183326; --hill-3: #10271C;
    --sun: #F1F5F9; --ger: #CBD5E1; --ger-roof: #94A3B8;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --orkhon: #6EA8FF; --primary-solid: #2563EB; --khangai: #1D4ED8; --khangai-mid: #3B82F6; --secondary: #34D399; --erdene-zuu: #FBBF24;
        --tal: #0A1222; --ink: #E6EDF7; --muted: #9AA9BF; --border: #22314D; --line: #1A2741; --surface: #111C31; --surface-2: #0E182B; --mint: #1E3A6E;
        --directory-bg: rgba(16, 185, 129, .15); --directory: #34D399;
        --ads-bg: rgba(249, 115, 22, .15);       --ads: #FDBA74;
        --events-bg: rgba(139, 92, 246, .18);    --events: #C4B5FD;
        --news-bg: rgba(59, 130, 246, .18);      --news: #93C5FD;
        --soums-bg: rgba(239, 68, 68, .16);      --soums: #FCA5A5;
        --help-bg: rgba(6, 182, 212, .15);       --help: #67E8F9;
        --success: #4ADE80; --danger: #F87171; --danger-bg: rgba(239, 68, 68, .14); --warning: #FBBF24; --info: #93C5FD;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 12px 32px rgba(0, 0, 0, .35);
        --header-bg: rgba(10, 18, 34, .82); --footer-bg: #070D1A;
        --sky-1: #050B1C; --sky-2: #13254A; --sky-3: #2B4677;
        --hill-far: #2A3F66; --rock-1: #5B4434; --rock-2: #3F2E24; --hill-1: #1F4030; --hill-2: #183326; --hill-3: #10271C;
        --sun: #F1F5F9; --ger: #CBD5E1; --ger-roof: #94A3B8;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; }

body {
    margin: 0;
    background: var(--tal);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    padding-bottom: 76px; /* утасны доод цэсний зай */
}

a { color: var(--orkhon); }
a:hover { color: var(--khangai); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 800; }
p { margin: 0; }
code { font-size: .9em; background: var(--directory-bg); padding: 1px 6px; border-radius: 6px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 24px; padding-bottom: 48px; }
.muted { color: var(--muted); font-size: 14px; }
.nowrap { white-space: nowrap; }
.icon { flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Модулийн өнгөний туслах класс --------------------------------------- */
.tone-directory { background: var(--directory-bg); color: var(--directory); }
.tone-ads       { background: var(--ads-bg);       color: var(--ads); }
.tone-events    { background: var(--events-bg);    color: var(--events); }
.tone-news      { background: var(--news-bg);      color: var(--news); }

/* --- Товч ---------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px; border-radius: var(--radius);
    font-family: var(--font-body); font-weight: 800; font-size: 15px;
    text-decoration: none; cursor: pointer; border: 2px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--primary-solid); color: #fff; }
.btn-primary:hover { background: var(--khangai); color: #fff; }
.btn-accent { background: var(--erdene-zuu); color: var(--ink); }
.btn-accent:hover { background: #C88A1F; color: var(--ink); }
.btn-outline { background: var(--surface); color: var(--orkhon); border-color: var(--orkhon); }
.btn-ghost { background: transparent; color: var(--orkhon); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.is-soon { opacity: .55; cursor: not-allowed; }

/* --- Нүүр хуудасны хэсгүүд ----------------------------------------------- */
.home { display: flex; flex-direction: column; gap: 40px; padding-top: 28px; padding-bottom: 56px; }


.split { display: flex; flex-wrap: wrap; gap: 40px 32px; }
.block { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.block-wide { flex: 999 1 560px; }
.block-narrow { flex: 1 1 320px; }
.block-head { display: flex; justify-content: space-between; align-items: center; }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.card-media { height: 140px; position: relative; display: flex; align-items: center; justify-content: center; }
/* Утсан дээр зар 2 баганаар (загвар: "Нүүр — утас") */
.ads-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ads-grid .card-media { height: 110px; }
.ads-grid .card-body { padding: 10px 12px 12px; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.card h3 { line-height: 1.35; }
.meta { color: var(--muted); font-size: 13px; font-weight: 600; }
.price { color: var(--ads); font-size: 17px; font-weight: 800; }

.date-badge {
    position: absolute; left: 12px; top: 12px; width: 58px; padding: 6px 0; border-radius: 10px;
    background: var(--surface); color: var(--events); display: flex; flex-direction: column; align-items: center;
}
.date-badge span { font-size: 10px; font-weight: 800; }
.date-badge strong { font-family: var(--font-display); font-size: 22px; line-height: 1.1; }

.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.list-item { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.list-item:first-child { border-top: 0; }
.list-item h3 { font-size: 15px; font-weight: 700; line-height: 1.4; }
.list-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; }

.org-card { padding: 16px; gap: 14px; justify-content: space-between; }
.org-head { display: flex; gap: 12px; align-items: center; }
.org-initials {
    width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--directory-bg); color: var(--orkhon);
    font-family: var(--font-display); font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.org-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.verified {
    width: 18px; height: 18px; border-radius: 9px; background: var(--primary-solid); color: #fff; margin-left: 4px;
    display: inline-flex; align-items: center; justify-content: center; vertical-align: -3px; /* нэрийн сүүлийн үгийн хажууд */
}
.org-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.opening { font-size: 13px; font-weight: 800; }
.opening::before { content: "● "; }
.opening:empty::before { content: ""; }
.status-open { color: var(--success); }
.status-closed { color: var(--danger); }

.soum-band { background: var(--directory-bg); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.soum-band h2 { color: var(--khangai); }
.soum-band p { color: var(--muted); font-weight: 600; font-size: 15px; margin-top: 4px; }
.soum-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.soum-chip {
    height: 40px; padding: 0 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
    color: var(--khangai); text-decoration: none; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center;
}
.soum-chip.active { background: var(--primary-solid); border-color: var(--primary-solid); color: #fff; }

/* --- Form --------------------------------------------------------------- */
.auth-card { max-width: 420px; margin: 24px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.field input {
    height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius);
    font-family: var(--font-body); font-size: 16px; color: var(--ink); background: var(--surface);
}
/* Routes.razor дахь FocusOnNavigate хуудас солигдох бүрт h1-д focus өгдөг (дэлгэц уншигчид шинэ хуудсыг
   зарлахад хэрэгтэй). Хөтөч үүнийг хүрээгээр тодруулдаг тул зөвхөн тэр хүрээг нууна.
   Гарын Tab-аар орж ирсэн товч, холбоосын focus хэвээр харагдана. */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus { outline: none; }

.field input:focus { outline: 2px solid var(--orkhon); outline-offset: 1px; }
.validation-message { color: var(--danger); font-size: 13px; font-weight: 600; }
.field .hint { font-weight: 500; font-size: 13px; color: var(--muted); }
.center { text-align: center; }
.alert { padding: 12px 14px; border-radius: var(--radius); background: var(--danger-bg); color: var(--danger); font-weight: 700; font-size: 14px; }

/* --- Утас баталгаажуулах (/verify) ------------------------------------- */
.verify { display: flex; flex-direction: column; gap: 14px; }
.verify-box {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    background: var(--directory-bg); border-radius: var(--radius); padding: 16px;
}
.verify-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.verify-code { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--orkhon); letter-spacing: 2px; }
.verify-status { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; color: var(--muted); }
.verify-countdown { margin-left: auto; font-variant-numeric: tabular-nums; }
.spinner {
    width: 16px; height: 16px; border-radius: 50%; flex: none;
    border: 2px solid var(--border); border-top-color: var(--orkhon); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* --- Зар: жагсаалт, дэлгэрэнгүй, нийтлэх, хяналт ------------------------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.see-all { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 14px; text-decoration: none; }
.back-link { display: inline-block; margin-bottom: 12px; font-weight: 700; font-size: 14px; text-decoration: none; }
.notice { padding: 12px 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); font-weight: 700; font-size: 14px; }

.card-link { text-decoration: none; color: var(--ink); transition: border-color .15s; }
.card-link:hover { color: var(--ink); border-color: var(--orkhon); }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.search-field-sm { height: 48px; border: 1px solid var(--border); border-radius: var(--radius); flex: 1 1 220px; }
.select-field { flex: 1 1 160px; display: flex; }
.select-field select, .field select, .field textarea {
    width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    font-family: var(--font-body); font-size: 16px; color: var(--ink);
}
.select-field select, .field select { height: 48px; padding: 0 12px; }
.field textarea { padding: 12px 14px; resize: vertical; min-height: 150px; line-height: 1.5; }
.field select:focus, .field textarea:focus { outline: 2px solid var(--orkhon); outline-offset: 1px; }

/* Хэвтээ гүйдэг ангиллын товчнууд */
.chip-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex: none; height: 38px; padding: 0 14px; border-radius: 19px; background: var(--surface); border: 1px solid var(--border);
    color: var(--ink); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; text-decoration: none;
}
.chip:hover { border-color: var(--orkhon); color: var(--ink); }
.chip.active { background: var(--primary-solid); border-color: var(--primary-solid); color: #fff; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; }

.tag-success { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-muted { background: var(--line); color: var(--muted); }

.ad-detail { display: grid; gap: 20px; grid-template-areas: "media" "main" "side"; }
.ad-media { grid-area: media; height: 260px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; }
.ad-main { grid-area: main; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ad-side { grid-area: side; display: flex; flex-direction: column; gap: 12px; }
.price-lg { font-size: 24px; }
.ad-body { white-space: pre-line; overflow-wrap: anywhere; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 8px; }

.form-card { max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.field-row { display: grid; gap: 16px; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
.radio-row { display: flex; gap: 8px 18px; flex-wrap: wrap; font-weight: 600; font-size: 15px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-row input { width: 18px; height: 18px; accent-color: var(--orkhon); }
.input-suffix { position: relative; display: flex; }
.input-suffix input { width: 100%; padding-right: 40px; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 800; }

/* Устгах: <details> дээр дарахад баталгаажуулах хэсэг нээгдэнэ */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8E1D17; color: #fff; }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--surface)); }
.confirm summary { list-style: none; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm-body {
    display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding: 12px; min-width: 240px; text-align: left;
    border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--surface)); border-radius: var(--radius); background: var(--danger-bg);
}

.own-ad { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.own-ad-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 240px; }
.own-ad h3 a { color: var(--ink); text-decoration: none; }
.own-ad h3 a:hover { color: var(--orkhon); }
.account-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.account-links form { margin: 0; }

.table .actions { text-align: right; white-space: nowrap; }

/* Утсан дээр хүснэгтийн мөр бүр карт болно (хажуу тийш гүйлгэхгүй) */
@media (max-width: 759px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; }
    .table-stack tr { padding: 12px 14px; border-top: 1px solid var(--border); }
    .table-stack tr:first-child { border-top: 0; }
    .table.table-stack td { padding: 3px 0; border-top: 0; }
    .table.table-stack td.actions { text-align: left; padding-top: 8px; }
    .table-stack td.nowrap { color: var(--muted); font-size: 13px; }
}
.table .actions .confirm { display: inline-block; }

/* Утсан дээр header-т зай хэмнэнэ: "+" дүрс, аватар; Гарах ба Админ нь "Миний зарууд" хуудсанд */
/* "Нийтлэх" — зөвхөн + дүрстэй дөрвөлжин товч, дүрс яг голдоо (бүх дэлгэцэнд) */
.header-actions .btn-post { width: 44px; height: 44px; min-height: 0; padding: 0; gap: 0; flex: none; }
@media (max-width: 759px) { .header-actions .btn-post { width: 40px; height: 40px; } }
.header-actions .btn-post svg { display: block; margin: 0; }
.header-actions .logout-form, .header-actions .admin-link { display: none; }
a.avatar { text-decoration: none; }

/* --- Админ самбар (Layout/AdminLayout.razor) ----------------------------- */
body:has(.admin-shell) { padding-bottom: 0; }   /* админд утасны доод цэс байхгүй */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.admin-side { background: var(--khangai); color: #C9D5E8; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 10px; }
.admin-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.admin-brand:hover { color: #fff; }
.admin-brand strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1.2; }
.admin-brand small { display: block; color: #C9D5E8; font-weight: 700; font-size: 13px; }
/* Утсан дээр хэвтээ гүйдэг цэс, зөвхөн ажилладаг цэсүүд */
.admin-menu { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.admin-menu::-webkit-scrollbar { display: none; }
.admin-menu-item {
    flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 14px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 15px; text-decoration: none;
}
.admin-menu-item:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.admin-menu-item.active { background: var(--khangai-mid); }
.admin-menu-item.is-soon { display: none; color: rgba(207, 229, 226, .45); cursor: default; }
.admin-menu-item.is-soon small { font-size: 11px; font-weight: 700; }
.admin-side-foot { display: flex; align-items: center; gap: 18px; font-size: 13px; font-weight: 700; }
.admin-side-foot a { color: #C9D5E8; text-decoration: none; }
.admin-side-foot a:hover { color: #fff; }
.admin-side-foot form { margin: 0; }
.admin-user { display: none; color: #fff; }
.admin-logout { background: none; border: 0; padding: 0; color: #C9D5E8; font: inherit; cursor: pointer; }
.admin-logout:hover { color: #fff; }
.admin-main { flex: 1; min-width: 0; padding: 24px 16px 48px; }
.admin-main h1 { font-family: var(--font-display); font-size: 26px; }
.admin-sub { color: var(--muted); font-weight: 500; margin-top: 4px; }

@media (min-width: 900px) {
    .admin-shell { flex-direction: row; }
    .admin-side { width: 240px; flex: none; position: sticky; top: 0; height: 100vh; padding: 24px 16px; gap: 28px; overflow-y: auto; }
    .admin-menu { flex-direction: column; overflow: visible; margin: 0; padding: 0; gap: 4px; }
    .admin-menu-item.is-soon { display: flex; }
    .admin-side-foot { flex-direction: column; align-items: flex-start; gap: 10px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--khangai-mid); font-size: 14px; }
    .admin-user { display: block; }
    .admin-main { padding: 36px 32px 56px; }
    .admin-main h1 { font-size: 30px; }
}

/* --- Зарын зураг ----------------------------------------------------------- */
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.gallery { position: relative; overflow: hidden; background: #0d1f1d; }
.gallery-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.gallery-nav {
    display: none; position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 22px;
    border: 0; background: rgba(255, 255, 255, .9); color: var(--ink); font-size: 28px; line-height: 1; cursor: pointer;
}
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.gallery.has-js .gallery-nav { display: block; }
.gallery-count { position: absolute; right: 12px; bottom: 12px; padding: 3px 10px; border-radius: 12px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; font-weight: 700; }

.photo-drop {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px;
    border: 2px dashed var(--border); border-radius: var(--radius); color: var(--orkhon); font-weight: 800; cursor: pointer; background: var(--tal);
}
.photo-drop:hover { border-color: var(--orkhon); }
/* Жинхэнэ input-ийг бүх талбайг хамруулан ил тод болгоно: дарахад файл сонгогч нээгдэнэ */
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop:focus-within { outline: 2px solid var(--orkhon); outline-offset: 1px; }
.photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.photo-previews:empty { display: none; }
.photo-previews figure { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line); }
.photo-previews img { width: 100%; height: 100%; object-fit: cover; }
.photo-previews figcaption { position: absolute; left: 6px; top: 6px; padding: 1px 6px; border-radius: 6px; background: var(--primary-solid); color: #fff; font-size: 11px; }
.photo-note { grid-column: 1 / -1; color: var(--ads); font-size: 13px; }

.ad-thumb { width: 64px; height: 48px; flex: none; border-radius: 8px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cell-with-thumb { display: flex; gap: 12px; align-items: flex-start; }

/* --- Лавлах ---------------------------------------------------------------- */
/* Нэр дээрх холбоос картыг бүхэлд нь дарагддаг болгоно, "Залгах" товч дээр нь гарна */
.org-card { position: relative; }
.stretched { color: var(--ink); text-decoration: none; }
.stretched::after { content: ""; position: absolute; inset: 0; }
.stretched:hover { color: var(--orkhon); }
.org-foot a, .org-foot button { position: relative; z-index: 1; }
.org-photo { width: 52px; height: 52px; flex: none; border-radius: 14px; object-fit: cover; }
.org-address { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-grid { grid-template-columns: 1fr; }
.chip-sm { height: 32px; font-size: 13px; padding: 0 12px; }
.chip-row-sub { margin-top: -6px; }
.verified-lg { width: 24px; height: 24px; border-radius: 12px; vertical-align: 2px; }
.org-media-empty { background: var(--directory-bg); }
.org-initials-lg { width: 96px; height: 96px; border-radius: 24px; font-size: 32px; background: var(--surface); }
.org-line { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-weight: 600; }
.org-line svg { flex: none; margin-top: 2px; }

.hours h2 { font-size: 17px; margin-bottom: 8px; }
.hours-table { border-collapse: collapse; width: 100%; max-width: 360px; font-size: 15px; }
.hours-table th, .hours-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.hours-table th { font-weight: 600; color: var(--muted); width: 45%; }
.hours-table tr.today th, .hours-table tr.today td { color: var(--ink); font-weight: 800; background: var(--directory-bg); }

.contact-link {
    display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
    text-decoration: none; color: var(--ink); font-weight: 700; overflow-wrap: anywhere;
}
.contact-link:hover { border-color: var(--orkhon); color: var(--orkhon); }
.contact-kind { font-size: 12px; color: var(--muted); font-weight: 700; }

/* Google Maps байршил */
.gmap-input { display: flex; gap: 8px; flex-wrap: wrap; }
.gmap-input input { flex: 1 1 260px; }
.gmap-status { font-size: 14px; font-weight: 700; color: var(--muted); min-height: 0; }
.gmap-status:empty { display: none; }
.gmap-status.ok { color: var(--success); }
.gmap-status.error { color: var(--danger); }
.gmap-frame { display: block; width: 100%; height: 260px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--directory-bg); }
.org-map h2 { font-size: 17px; margin-bottom: 8px; }
.map-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Бүртгэх форм: ажлын цаг */
.hours-form { display: flex; flex-direction: column; gap: 8px; }
.hours-row {
    display: grid; gap: 4px 6px; align-items: center;
    grid-template-columns: 64px minmax(0, 1fr) 12px minmax(0, 1fr);
    grid-template-areas: "day open dash close" ". closed closed closed";
}
.hours-day { grid-area: day; font-weight: 700; font-size: 14px; }
.hours-row [data-open] { grid-area: open; }
.hours-row [data-close] { grid-area: close; }
.hours-dash { grid-area: dash; text-align: center; color: var(--muted); }
.hours-closed { grid-area: closed; display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; }
.hours-closed input { width: 18px; height: 18px; accent-color: var(--orkhon); }
.hours-row input[type="time"] {
    height: 42px; padding: 0 4px 0 8px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 14px; width: 100%; min-width: 0;
}
.hours-row.is-closed input[type="time"] { opacity: .35; }
.hours-copy { margin-top: 10px; height: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; white-space: normal; text-align: center; }

.my-tabs { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.my-tabs .chip-row { flex: 1 1 auto; }
.post-choices .module-card.is-soon { opacity: .5; }

/* Админ: ангилал */
.category-new { gap: 10px; }
.category-new-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.category-new-row .field { flex: 1 1 200px; }
.category-new-row .field-narrow { flex: 0 0 110px; }
.inline-input { height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 15px; width: 100%; min-width: 160px; }
.inline-number { width: 84px; min-width: 0; }
.category-group td { background: var(--tal); }
.category-group .inline-input { font-weight: 800; }
.category-child td:first-child { padding-left: 34px; }
.is-inactive td { opacity: .55; }
.is-inactive td.actions { opacity: 1; }
.action-row { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: flex-start; }
.action-row form { margin: 0; }

/* --- Эвент ------------------------------------------------------------------ */
.event-poster img { width: 100%; height: 100%; object-fit: contain; }
.event-date-hero { flex-direction: column; color: var(--events); }
.event-date-hero span { font-weight: 800; font-size: 16px; letter-spacing: .5px; }
.event-date-hero strong { font-family: var(--font-display); font-size: 72px; line-height: 1; }
.event-facts { display: flex; flex-direction: column; gap: 6px; }
.event-facts .org-line { color: var(--ink); font-weight: 700; }
.card.is-past { opacity: .7; }

/* Сарын туузан цэс: ‹ [Ойрын] [10-р сар] [11-р сар] … › — утсан дээр хуруугаар гүйлгэнэ */
.month-bar { display: flex; align-items: stretch; gap: 8px; }
.month-arrow {
    flex: none; width: 40px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    color: var(--orkhon); font-size: 26px; text-decoration: none;
}
.month-arrow:hover { border-color: var(--orkhon); color: var(--orkhon); }
.month-strip {
    position: relative; flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
    scrollbar-width: none; padding: 2px;
}
.month-strip::-webkit-scrollbar { display: none; }
.month-chip {
    flex: none; scroll-snap-align: center; min-width: 96px; padding: 8px 12px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface); color: var(--ink); text-decoration: none;
    display: flex; flex-direction: column; gap: 1px; line-height: 1.2;
}
.month-chip small { font-size: 11px; font-weight: 700; color: var(--muted); }
.month-chip strong { font-family: var(--font-display); font-size: 16px; }
.month-count { font-size: 12px; font-weight: 700; color: var(--events); }
.month-chip:hover { border-color: var(--events); color: var(--ink); }
.month-chip.is-empty .month-count { color: var(--muted); }
.month-chip.is-past:not(.active) { background: var(--tal); }
.month-chip.active { background: var(--events); border-color: var(--events); color: #fff; }
.month-chip.active small, .month-chip.active .month-count { color: rgba(255, 255, 255, .85); }
.month-chip-now { justify-content: center; min-width: 76px; }
.month-chip[data-current-month]:not(.active) { border-color: var(--events); }
@media (max-width: 759px) {
    .month-arrow { width: 32px; }
    .month-chip { min-width: 84px; padding: 7px 10px; }
}

/* Доод талын өмнөх / дараах сар */
.month-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.month-pager-link {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg);
    border: 1px solid var(--border); background: var(--surface); color: var(--ink); text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.month-pager-link:hover { border-color: var(--events); color: var(--ink); transform: translateY(-1px); }
.month-pager-link.next { justify-content: flex-end; text-align: right; }
.month-pager-link small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.month-pager-link strong { font-family: var(--font-display); font-size: 15px; }
.month-pager-arrow {
    flex: none; width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
    background: var(--events-bg); color: var(--events); font-weight: 800; font-size: 18px;
}
.datetime-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.datetime-row input { width: 100%; min-width: 0; }

/* --- Сумд ------------------------------------------------------------------- */
.soum-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.soum-card {
    display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden; text-decoration: none;
    background: var(--surface); border: 1px solid var(--border); color: var(--ink); transition: border-color .15s, transform .15s;
}
.soum-card:hover { border-color: var(--orkhon); color: var(--ink); transform: translateY(-2px); }
.soum-card-media { position: relative; aspect-ratio: 16 / 9; background: var(--primary-solid); }
.soum-card-media img, .soum-card-media .soum-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.soum-card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0, 0, 0, .55)); }
.soum-card-name {
    position: absolute; left: 12px; bottom: 10px; z-index: 1; color: #fff;
    font-family: var(--font-display); font-weight: 800; font-size: 18px; text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.soum-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.soum-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.soum-stats strong { color: var(--ink); }

.soum-hero { position: relative; min-height: 260px; display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: var(--primary-solid); }
.soum-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.soum-hero-row { position: relative; z-index: 1; width: 100%; }
.soum-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .05), rgba(0, 0, 0, .6)); }
.soum-hero-text { padding-top: 28px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* Зураггүй сум: зурмал дүрслэл хүрээтэй (утсан дээр дээр нь, компьютер дээр баруун талд) */
.soum-hero-split { align-items: stretch; }
.soum-hero-split::after { display: none; }
.soum-hero-split .soum-hero-row { display: flex; flex-direction: column; padding-top: 20px; }
.soum-hero-split .soum-hero-text { padding-top: 16px; }
.soum-hero-figure { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
.soum-hero-figure .soum-art { display: block; width: 100%; height: 100%; }
.soum-hero-split .soum-hero-figure { order: -1; }
.soum-hero h1 { font-family: var(--font-display); font-size: 34px; color: #fff; }
.soum-hero-sub { color: #C9D5E8; font-weight: 600; }
.soum-crumb { color: #C9D5E8; font-weight: 700; font-size: 14px; text-decoration: none; }
.soum-crumb:hover { color: #fff; }
.soum-hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.soum-hero-stats a {
    padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25);
    color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; backdrop-filter: blur(4px);
}
.soum-hero-stats a:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.soum-hero-stats strong { font-weight: 800; }
.soum-about { display: grid; gap: 16px; }
.soum-about-text { display: flex; flex-direction: column; gap: 12px; }
.soum-about-text h2 { font-size: 20px; }
.soum-facts div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.soum-facts div strong { font-family: var(--font-display); }
.soum-band-link { color: var(--orkhon); font-weight: 700; }
.completeness { display: flex; flex-wrap: wrap; gap: 4px; }
.form-card-wide { max-width: 860px; margin: 0; }
.field-row-3 { display: grid; gap: 16px; }
.cover-current { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.cover-current img { width: 160px; height: 90px; object-fit: cover; border-radius: 10px; }

/* --- Хүснэгт ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-top: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 16px; background: var(--tal); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.table td { padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: top; }

/* --- Мэдээ ---------------------------------------------------------------- */
/* Мэдээ бүр тусдаа карт, хооронд нь зайтай */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-row {
    display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.news-row:hover { border-color: var(--khangai-mid); box-shadow: 0 4px 16px rgba(15, 23, 42, .07); }
.news-row:hover .news-title { color: var(--orkhon); text-decoration: underline; }
.news-media { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.news-media img { width: 100%; height: 100%; object-fit: cover; }
.news-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.news-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; line-height: 1.35; }
.news-summary { color: var(--muted); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Эхний (онцлох) мэдээ: зураг дээр, том гарчиг */
.news-lead { grid-template-columns: 1fr; padding: 0 0 18px; }
.news-lead .news-media { aspect-ratio: 16 / 9; border-radius: 0; }
.news-lead .news-text { padding: 0 16px; }
.news-lead .news-title { font-size: 22px; }
.news-lead .news-summary { -webkit-line-clamp: 3; font-size: 15px; }

.news-page { display: grid; gap: 20px; }
.news-article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.news-article h1 { font-size: 26px; line-height: 1.25; }
.news-lede { font-size: 17px; line-height: 1.55; color: var(--muted); font-weight: 500; }
.news-cover { margin: 0 -18px; }
.news-cover img { width: 100%; height: auto; max-height: 620px; object-fit: cover; display: block; background: var(--line); }
.news-body { font-size: 16.5px; line-height: 1.75; overflow-wrap: anywhere; }
.news-body p + p { margin-top: 1em; }
.news-body a { word-break: break-all; }
.news-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.news-photos a { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--line); }
.news-photos img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.news-photos a:hover img { transform: scale(1.03); }
.news-byline { border-top: 1px solid var(--line); padding-top: 12px; }
.news-side { display: flex; flex-direction: column; gap: 12px; }
.side-title { font-size: 16px; }
.news-related { display: flex; flex-direction: column; }
.news-related a { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.news-related a:first-child { border-top: 0; padding-top: 0; }
.news-related a:hover strong { color: var(--orkhon); text-decoration: underline; }
.news-related strong { font-size: 14.5px; line-height: 1.4; }
/* Нүүр, сумын хуудасны жижиг жагсаалт: мэдээ бүр тусдаа карт */
.news-mini-list { display: flex; flex-direction: column; gap: 10px; }
.news-mini-list .news-mini { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); border-top: 1px solid var(--border); }
.news-mini-list .news-mini:hover { border-color: var(--khangai-mid); box-shadow: 0 4px 16px rgba(15, 23, 42, .07); }
.news-mini { flex-direction: row; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.news-mini-text { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.news-mini strong { font-size: 15px; line-height: 1.4; }
.news-mini:hover strong { color: var(--orkhon); text-decoration: underline; }

/* Админ: хэрэглэгчид */
.avatar-sm { width: 36px; height: 36px; font-size: 13px; flex: none; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* --- Апп суулгах (PWA, js/pwa.js) ------------------------------------------- */
[hidden] { display: none !important; }
.footer-install {
    display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer;
    color: var(--erdene-zuu); font: inherit; font-weight: 800;
}
.footer-install:hover { text-decoration: underline; }
/* Утсан дээр доод цэсний дээр, компьютер дээр баруун доод буланд */
.install-bar {
    position: fixed; z-index: 40; left: 12px; right: 12px; bottom: 84px;
    display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px;
    padding: 12px 10px 12px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
}
.install-bar img { border-radius: 10px; }
.install-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.install-text strong { font-size: 15px; }
.install-text small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.install-close {
    width: 32px; height: 32px; border: 0; border-radius: 16px; background: none; cursor: pointer;
    color: var(--muted); font-size: 22px; line-height: 1;
}
.install-close:hover { background: var(--line); color: var(--ink); }
/* iPhone/iPad заавар (js/pwa.js үүсгэнэ): бараан дэвсгэр, алхмууд, хөтчийн товч руу заасан сум */
html.guide-open { overflow: hidden; }
.install-guide {
    position: fixed; inset: 0; z-index: 100; background: rgba(10, 30, 28, .62);
    display: flex; align-items: center; justify-content: center; padding: 16px;
    animation: guide-fade .18s ease-out;
}
.guide-sheet {
    position: relative; width: 100%; max-width: 400px; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow-y: auto;
    background: var(--surface); border-radius: 20px; padding: 18px 16px 16px;
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
/* Сум доод талд бол картыг дээш, дээд талд бол доош шахна (сум дарагдахгүй) */
.guide-bottom-center, .guide-bottom-right { margin-bottom: 60px; }
.guide-top-right { margin-top: 60px; }
.guide-sheet img { border-radius: 14px; }
.guide-sheet h2 { font-size: 20px; margin: 2px 0 0; }
.guide-lead { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.guide-close { position: absolute; top: 10px; right: 10px; }
.guide-steps { list-style: none; margin: 4px 0 2px; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.guide-steps li {
    display: grid; grid-template-columns: 24px 40px minmax(0, 1fr); align-items: center; gap: 10px;
    padding: 8px 10px; background: var(--tal); border-radius: 12px; font-size: 14.5px; line-height: 1.35;
}
.guide-num {
    width: 24px; height: 24px; border-radius: 12px; background: var(--primary-solid); color: #fff;
    font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.guide-icon {
    width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
    color: #007AFF;   /* iOS-ийн цэнхэр: хөтчийн товчтой адилхан харагдуулна */
    display: inline-flex; align-items: center; justify-content: center;
}
.guide-where { color: var(--muted); font-size: 13px; }
.guide-arrow {
    position: fixed; z-index: 101; color: #fff; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .4));
    animation: guide-bounce 1s ease-in-out infinite;
}
.guide-arrow-bottom-center { bottom: 10px; left: 50%; margin-left: -22px; }
.guide-arrow-bottom-right { bottom: 10px; right: 18px; }
.guide-arrow-top-right { top: 10px; right: 14px; transform: rotate(180deg); animation-name: guide-bounce-up; }
@keyframes guide-fade { from { opacity: 0; } }
@keyframes guide-bounce { 50% { transform: translateY(10px); } }
@keyframes guide-bounce-up { 0%, 100% { transform: rotate(180deg); } 50% { transform: rotate(180deg) translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
    .install-guide, .guide-arrow { animation: none; }
}
/* Апп дотроос (суулгасан) нээхэд хөтчийн биш, апп шиг харагдуулна */
@media (display-mode: standalone) {
    .footer-install, .install-bar { display: none !important; }
}

/* ===========================================================================
   Компьютер (760px-ээс өргөн)
=========================================================================== */
@media (min-width: 760px) {
    body { padding-bottom: 0; }
    h2 { font-size: 24px; }
    .card-grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .ads-grid { gap: 14px; }
    .ads-grid .card-media { height: 140px; }
    .ads-grid .card-body { padding: 14px; }
    .soum-band { padding: 28px; }

    .ads-grid-wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .org-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .soum-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
    .soum-hero { min-height: 340px; }
    .soum-hero-split .soum-hero-row { flex-direction: row; align-items: center; gap: 40px; padding-top: 32px; padding-bottom: 32px; }
    .soum-hero-split .soum-hero-text { flex: 1 1 auto; padding: 0; }
    .soum-hero-split .soum-hero-figure { order: 0; flex: 0 0 min(48%, 560px); }
    .soum-hero h1 { font-size: 46px; }
    .soum-about { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
    .field-row.field-row-3 { grid-template-columns: repeat(3, 1fr); }
    .hours-row { grid-template-columns: 90px 130px 14px 130px auto; grid-template-areas: "day open dash close closed"; }
    .hours-closed { margin-left: 8px; }
    .gmap-frame { height: 340px; }
    .chip-row { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
    .field-row { grid-template-columns: 1fr 1fr; }
    .form-card { padding: 28px; }
    .ad-detail { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto 1fr; grid-template-areas: "media side" "main side"; align-items: start; }
    .ad-media { height: 320px; }
    .ad-main h1 { font-size: 32px; }
    .news-list { gap: 16px; }
    .news-row { grid-template-columns: 200px minmax(0, 1fr); gap: 18px; padding: 18px; }
    .news-title { font-size: 18px; }
    .news-lead { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); padding: 0; gap: 0; }
    .news-lead .news-media { aspect-ratio: auto; min-height: 300px; }
    .news-lead .news-text { padding: 28px; justify-content: center; gap: 10px; }
    .news-lead .news-title { font-size: 28px; }
    .news-page { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
    .news-article { padding: 32px 40px; gap: 18px; }
    .news-article h1 { font-size: 36px; }
    .news-cover { margin: 0 -40px; }
    .news-body { max-width: 68ch; }
    .news-photos { grid-template-columns: repeat(3, 1fr); }
    .news-side { position: sticky; top: 90px; }
}
a.tag { text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

@media (min-width: 760px) {
    .install-bar { left: auto; right: 20px; bottom: 20px; width: 400px; }
}

/* Админ: сумын зурмал дүрслэл сонгох (Pages/Admin/SoumEdit.razor) */
.art-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 6px; }
.art-option { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.art-option input { position: absolute; opacity: 0; pointer-events: none; }
.art-thumb { display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 3px solid transparent; outline: 1px solid var(--border); }
.art-thumb .soum-art { display: block; width: 100%; height: 100%; }
.art-label { font-size: 13px; font-weight: 600; line-height: 1.3; }
.art-option:hover .art-thumb { outline-color: var(--orkhon); }
.art-option input:checked + .art-thumb { border-color: var(--orkhon); outline-color: var(--orkhon); }
.art-option input:checked ~ .art-label { color: var(--orkhon); font-weight: 800; }
.art-option input:focus-visible + .art-thumb { outline: 3px solid var(--erdene-zuu); }
.ad-thumb .soum-art { width: 100%; height: 100%; display: block; }

/* --- Админ: үнийн тохиргоо (Pages/Admin/Pricing.razor) ------------------------ */
.pricing h2 { font-size: 19px; }
.side-card.pay-switch { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; text-align: left; }
.pay-switch-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-switch-title strong { font-family: var(--font-display); font-size: 18px; }
.pay-switch-text { display: flex; flex-direction: column; gap: 6px; }
/* Унтраалга: form-ийн submit товч (JavaScript-гүй) */
.switch {
    flex: none; position: relative; width: 60px; height: 34px; border: 0; border-radius: 17px; cursor: pointer;
    background: var(--border); transition: background .2s;
}
.switch-knob {
    position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 13px; background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch.is-on { background: var(--primary-solid); }
.switch.is-on .switch-knob { transform: translateX(26px); }
.switch:focus-visible { outline: 3px solid var(--erdene-zuu); outline-offset: 2px; }

.pricing-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pricing-table .code, .pricing .code { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.pricing-table tr.is-muted td { color: var(--muted); }
.planned { color: #B26B00; font-weight: 700; }
.pricing-panels { display: grid; gap: 16px; align-items: start; }
.pricing-panels .side-card { display: flex; flex-direction: column; gap: 14px; }
.field-date input { max-width: 220px; }
.info-note {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
    background: var(--surface-2); color: var(--ink); font-size: 14px; line-height: 1.5;
}
.info-note svg { flex: none; margin-top: 2px; color: var(--orkhon); }
.pricing-panels .side-card > .btn { align-self: flex-start; }
.limit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.limit-row label, .limit-row > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.limit-row strong { font-size: 15px; }
.limit-input, .quiet-hours input {
    height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius);
    font-family: var(--font-body); color: var(--ink); background: var(--surface);
}
.limit-input:focus, .quiet-hours input:focus { outline: 2px solid var(--orkhon); outline-offset: 1px; }
.limit-input { width: 72px; text-align: center; font-weight: 800; font-size: 16px; flex: none; }
.quiet-hours { display: flex; align-items: center; gap: 6px; }
.quiet-hours input { width: 76px; text-align: center; font-weight: 800; font-size: 16px; }
.current-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.current-price strong { font-family: var(--font-display); font-size: 28px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--orkhon); }

@media (min-width: 1100px) {
    .pricing-panels { grid-template-columns: 1.15fr 1fr; }
}

/* --- Админ: системийн тохиргоо (Pages/Admin/Settings.razor) ------------------- */
.settings-group h2 { font-size: 18px; margin-bottom: 4px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting-row:first-of-type { border-top: 0; }
.setting-row.is-unused { opacity: .6; }
.setting-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.setting-text strong { font-size: 15px; }
.setting-key { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 11.5px; color: var(--muted); }
.setting-input { display: flex; align-items: center; gap: 8px; flex: none; }
.time-input { width: 80px; }
/* Checkbox-ийг унтраалга хэлбэрээр (JavaScript-гүй) */
.toggle { position: relative; display: inline-flex; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { position: relative; width: 52px; height: 30px; border-radius: 15px; background: var(--border); transition: background .2s; }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.toggle input:checked + .toggle-track { background: var(--primary-solid); }
.toggle input:checked + .toggle-track .toggle-knob { transform: translateX(22px); }
.toggle input:focus-visible + .toggle-track { outline: 3px solid var(--erdene-zuu); outline-offset: 2px; }
/* Хадгалах товч доор наалттай: урт хуудсанд доош гүйлгэх шаардлагагүй */
.settings-save {
    position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, .08);
}
@media (max-width: 600px) {
    .setting-row { flex-direction: column; align-items: flex-start; }
}
.validation-summary { margin: 0; padding-left: 18px; color: var(--danger); font-size: 14px; font-weight: 600; }
.validation-summary:empty { display: none; }

/* ------------------------------------------------------------------ Мэдэгдэл (push) */
.tag-warn { background: var(--ads-bg); color: var(--ads); }
.tag-info { background: var(--news-bg); color: var(--news); }
.text-danger { color: var(--danger); }
.table .num { text-align: right; white-space: nowrap; }

/* Толгойн хонх */
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); flex: none; }
.icon-btn:hover { background: var(--line); color: var(--orkhon); }
.bell-dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--events); box-shadow: 0 0 0 2px var(--surface); }

/* /notifications: захиалах хэсэг */
.push-panel { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; padding: 16px; border-radius: var(--radius-lg); background: var(--directory-bg); border: 1px solid var(--mint); }
.push-panel.is-on { background: var(--surface); border-color: var(--border); }
.push-panel-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-solid); color: #fff; flex: none; }
.push-panel-main { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; min-width: 0; }
.push-panel-main [data-push-status].is-error { color: var(--danger); font-weight: 600; }
.push-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.push-soum { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.push-soum select { min-height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; max-width: 100%; }

.notify-item { flex-direction: row; align-items: flex-start; gap: 12px; color: inherit; text-decoration: none; }
.notify-item:hover strong { color: var(--orkhon); }
.notify-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }
.notify-thumb-icon { display: grid; place-items: center; background: var(--tal); color: var(--muted); }
.notify-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.notify-main strong { font-size: 15px; line-height: 1.35; }
.notify-stats { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 4px; }
.notify-stats strong { color: var(--ink); }
.own-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.own-actions form { margin: 0; }

/* /notify/...: урьдчилан харах (утасны мэдэгдэл шиг), хамрах хүрээ сонгох */
.push-preview { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--tal); border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.push-preview-icon { border-radius: 9px; flex: none; }
.push-preview-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-size: 14px; }
.push-preview-text small { color: var(--muted); font-size: 12px; }
.push-preview-text span { color: var(--muted); overflow-wrap: anywhere; }
.push-preview-img { border-radius: 10px; object-fit: cover; flex: none; }
.audience-list { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.audience-list legend { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.audience-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.audience-option:has(input:checked) { border-color: var(--orkhon); background: var(--directory-bg); }
.audience-option input { width: 20px; height: 20px; accent-color: var(--orkhon); flex: none; }
.audience-option.is-disabled { opacity: .6; cursor: not-allowed; }
.audience-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.audience-main small { color: var(--muted); font-size: 13px; }
.audience-main .audience-warn { color: var(--danger); font-weight: 600; }
.audience-price { font-weight: 800; font-family: var(--font-display); white-space: nowrap; }
.btn-notify { gap: 8px; }

/* Шууд ирсэн мэдэгдэл (wwwroot/js/realtime.js, SignalR): утасны мэдэгдэл шиг дээрээс гулсаж буух баннер */
.toast-stack { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60;
    display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 20px)); pointer-events: none; }
.toast { pointer-events: auto; position: relative; display: flex; gap: 11px; align-items: center; padding: 11px 38px 11px 11px;
    background: rgba(250, 250, 248, .86); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
    color: #111; text-decoration: none; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .6);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .08);
    opacity: 0; transform: translateY(-120%); transition: opacity .3s ease, transform .4s cubic-bezier(.2, .9, .3, 1.15); }
.toast.is-in { opacity: 1; transform: none; }
.toast-icon { width: 38px; height: 38px; border-radius: 9px; flex: none; align-self: flex-start; }
.toast-img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }
.toast-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; font-size: 14px; line-height: 1.3; }
.toast-text small { color: #6b6b6b; font-size: 12px; font-weight: 600; }
.toast-text strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-text span { color: #333; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.toast-close { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #777; font-size: 20px; line-height: 1; cursor: pointer; }
.toast-close:hover { background: rgba(0, 0, 0, .06); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .toast { background: rgba(38, 38, 40, .86); color: #f2f2f2; border-color: rgba(255, 255, 255, .08); }
    :root:not([data-theme="light"]) .toast-text small { color: #a8a8a8; }
    :root:not([data-theme="light"]) .toast-text span { color: #d6d6d6; }
}
:root[data-theme="dark"] .toast { background: rgba(38, 38, 40, .86); color: #f2f2f2; border-color: rgba(255, 255, 255, .08); }
:root[data-theme="dark"] .toast-text small { color: #a8a8a8; }
:root[data-theme="dark"] .toast-text span { color: #d6d6d6; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ------------------------------------------------------------------ Хянах самбар (/admin) */
.tag-directory { background: var(--directory-bg); color: var(--directory); }
.tag-ads { background: var(--ads-bg); color: var(--ads); }
.tag-events { background: var(--events-bg); color: var(--events); }
.tag-news { background: var(--news-bg); color: var(--news); }

.dash-attention { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-ok { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius); background: var(--directory-bg); color: var(--directory); font-weight: 600; }
.dash-alert { display: inline-flex; align-items: baseline; gap: 6px; padding: 9px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--ink); text-decoration: none; font-size: 14px; }
.dash-alert strong { font-family: var(--font-display); font-size: 17px; }
.dash-alert:hover { border-color: var(--orkhon); }
.dash-alert.is-urgent { background: var(--events-bg); border-color: transparent; color: var(--events); }

.dash-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dash-kpis > :last-child { grid-column: span 2; }   /* орлого: 7 карт → мөр бүр дүүрэн */
@media (min-width: 760px) { .dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 759px) { .dash-kpi { padding: 12px; } .dash-kpi-value { font-size: 24px; } .dash-kpi-foot { font-size: 12px; } }
.dash-kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
    color: var(--ink); text-decoration: none; border-top: 4px solid var(--orkhon); min-width: 0; }
.dash-kpi:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.dash-kpi.kpi-directory { border-top-color: var(--directory); }
.dash-kpi.kpi-ads { border-top-color: var(--ads); }
.dash-kpi.kpi-events { border-top-color: var(--events); }
.dash-kpi.kpi-news { border-top-color: var(--news); }
.dash-kpi-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.dash-kpi-value { font-family: var(--font-display); font-size: 30px; line-height: 1.15; overflow-wrap: anywhere; }
.dash-kpi-sub { font-size: 13px; color: var(--muted); }
.dash-kpi-foot { font-size: 13px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); }

.dash-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dash-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.dash-panel-head h2 { font-family: var(--font-display); font-size: 18px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1099px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

.dash-chart { margin: 0; overflow-x: auto; direction: rtl; }   /* rtl: утсан дээр сүүлийн өдрүүд эхэлж харагдана */
.dash-chart svg { width: 100%; min-width: 560px; height: auto; display: block; direction: ltr; }   /* утсан дээр хэвтээ гүйлгэнэ, бичиг жижгэрэхгүй */
.dash-chart .grid { stroke: var(--line); stroke-width: 1; }
.dash-chart .axis { stroke: var(--border); stroke-width: 1; }
.dash-chart .tick { font-size: 11px; fill: var(--muted); font-family: inherit; }
.dash-chart .hit { fill: transparent; }
.dash-chart .fill { fill: var(--orkhon); }
.dash-chart .bar:hover .hit { fill: var(--line); }
.dash-chart .bar:hover .fill { fill: var(--directory); }
.dash-table summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--orkhon); }
.dash-table .table-wrap { max-height: 320px; overflow: auto; margin-top: 8px; }

.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav strong { min-width: 130px; text-align: center; font-size: 14px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day { min-height: 84px; border-radius: 10px; background: var(--tal); padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.is-outside { background: transparent; opacity: .45; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--orkhon); }
.cal-day.has-events { background: var(--events-bg); }
.cal-num { font-size: 12px; font-weight: 700; }
.cal-event { display: block; font-size: 11.5px; line-height: 1.25; padding: 2px 5px; border-radius: 6px; background: var(--surface); color: var(--events);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; font-weight: 600; }
.cal-event:hover { background: var(--events); color: #fff; }
.cal-more { font-size: 11px; color: var(--events); font-weight: 700; padding-left: 4px; }
@media (max-width: 599px) {
    .cal-day { min-height: 46px; padding: 4px 2px; align-items: center; }
    .cal-event { width: 7px; height: 7px; padding: 0; border-radius: 50%; background: var(--events); font-size: 0; }
    .cal-day { flex-direction: column; }
    .cal-more { font-size: 10px; padding: 0; }
}

.dash-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dash-recent li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.dash-recent li:first-child { border-top: 0; padding-top: 0; }
.dash-recent li.is-deleted a { text-decoration: line-through; color: var(--muted); }
.dash-recent .tag { flex: none; min-width: 88px; text-align: center; }
.dash-recent-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-recent-main a { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.dash-recent-main a:hover { color: var(--orkhon); }

/* ------------------------------------------------------------------ Хуваалцах (ShareButton, js/share.js) */
.share-open { gap: 8px; }
.share-sheet { padding: 0; border: 0; margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(460px, 100vw); max-width: 100vw;
    background: var(--surface); color: var(--ink); box-shadow: -12px 0 40px rgba(0, 0, 0, .25); }
.share-sheet::backdrop { background: rgba(10, 20, 19, .55); }
.share-sheet[open] { animation: share-in .25s ease-out; }
@keyframes share-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.share-inner { display: flex; flex-direction: column; height: 100%; }
.share-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.share-head h2 { font-family: var(--font-display); font-size: 20px; }
.share-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.share-close:hover { background: var(--line); color: var(--ink); }
.share-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.share-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--tal); }
.share-card h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.share-card-head { display: flex; align-items: center; justify-content: space-between; }
.share-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.45; }
.share-text { width: 100%; min-height: 200px; resize: vertical; padding: 12px; border: 1px solid var(--border); border-radius: 12px; font: inherit; font-size: 14px; line-height: 1.5; background: var(--surface); color: var(--ink); }
.share-copy { border: 0; background: transparent; color: var(--orkhon); font-weight: 700; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.share-copy:hover { background: var(--line); }
.btn-fb { background: #1877F2; color: #fff; border-color: #1877F2; gap: 8px; }
.btn-fb:hover { background: #0F65D8; color: #fff; }
.share-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.share-apps button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: center; }
.share-apps button:hover { border-color: var(--orkhon); }
.share-ico { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; flex: none; }
.share-card h3 .share-ico { width: 30px; height: 30px; font-size: 15px; }
.share-fb { background: #1877F2; font-family: Arial, sans-serif; }
.share-ms { background: linear-gradient(135deg, #0695FF, #A334FA 60%, #FF6968); }
.share-vb { background: #7360F2; }
.share-tg { background: #26A5E4; }
.share-ln { background: var(--ink); }
.share-more { background: #8A9592; }
.share-url { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; background: transparent; padding: 0; }
.share-toast { position: sticky; bottom: 0; margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px;
    opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; }
.share-toast.is-on { opacity: 1; transform: none; }
@media (max-width: 599px) {
    /* Утсан дээр доороос гарах */
    .share-sheet { margin: auto 0 0; width: 100vw; height: auto; max-height: 92dvh; border-radius: 20px 20px 0 0; }
    .share-sheet[open] { animation-name: share-up; }
    @keyframes share-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
    .share-inner { max-height: 92dvh; }
    .share-text { min-height: 160px; }
}

/* ------------------------------------------------------------------ Тусламж (/help), HelpLink */
.title-row { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.title-row h1 { margin: 0; }
.auth-card .title-row { justify-content: space-between; }
.help-link { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
    color: var(--orkhon); background: var(--directory-bg); text-decoration: none; white-space: nowrap; }
.help-link:hover { background: var(--primary-solid); color: #fff; }
.share-body > .help-link { align-self: flex-start; }

.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.help-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius-lg); background: var(--surface);
    border: 1px solid var(--border); color: var(--ink); text-decoration: none; }
.help-card:hover { border-color: var(--orkhon); box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.help-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.help-card-text strong { font-size: 16px; }
.help-card-text small { color: var(--muted); font-size: 14px; line-height: 1.4; }
.help-quick { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; }
.help-quick h2 { font-family: var(--font-display); font-size: 18px; margin-bottom: 8px; }
.help-quick ul { margin: 0; padding-left: 20px; columns: 2 260px; column-gap: 32px; }
.help-quick li { padding: 4px 0; break-inside: avoid; }

.help-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; }
.help-toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.help-toc a { padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.help-toc a:hover { background: var(--line); color: var(--orkhon); }
.help-toc .help-toc-other { color: var(--muted); }
.help-toc-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 12px 10px 4px; }
.help-toc-title:first-child { padding-top: 0; }
.help-article { max-width: 760px; min-width: 0; }
.help-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.help-head h1 { margin: 0; }
.help-section { scroll-margin-top: 84px; padding: 20px 0; border-top: 1px solid var(--line); line-height: 1.65; }
.help-section:first-of-type { border-top: 0; }
.help-section h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 10px; position: relative; }
.help-anchor { position: absolute; left: -22px; color: var(--border); text-decoration: none; opacity: 0; }
.help-section h2:hover .help-anchor { opacity: 1; }
.help-section:target h2 { color: var(--orkhon); }
.help-section p { margin: 0 0 10px; }
.help-section ul, .help-section ol { margin: 0 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.help-note { padding: 10px 14px; border-radius: 12px; background: var(--ads-bg); font-size: 14px; }
.help-pages { padding: 20px 0; border-top: 1px solid var(--line); }
.help-pages h2 { font-family: var(--font-display); font-size: 18px; margin-bottom: 10px; }
.help-page-links { display: flex; flex-wrap: wrap; gap: 8px; }
.help-page-links .btn { gap: 6px; }
.help-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.help-nav a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.help-nav a:hover { border-color: var(--orkhon); }
.help-nav small { color: var(--muted); font-size: 12px; }
.help-nav-next { grid-column: 2; text-align: right; }
@media (max-width: 899px) {
    .help-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .help-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .help-toc a { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
    .help-toc-title, .help-toc .help-toc-other { display: none; }
    .help-anchor { display: none; }
}
/* Гарын авлагын дэлгэцийн зураг (wwwroot/help/*.jpg, утасны дэлгэц) */
.help-shot { margin: 14px 0 18px; display: inline-flex; flex-direction: column; gap: 6px; max-width: 340px; vertical-align: top; margin-right: 16px; }
.help-shot img { width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(15, 23, 42, .1); background: var(--surface); }
.help-shot figcaption { font-size: 13px; color: var(--muted); line-height: 1.45; }
@media (max-width: 599px) { .help-shot { max-width: 100%; margin-right: 0; } }


/* ------------------------------------------------------------------ Байгууллагын үнэлгээ (ReviewSection, ReviewCard) */
.score-badge { display: inline-flex; align-items: baseline; gap: 1px; padding: 3px 8px; border-radius: 8px; font-weight: 800; font-size: 14px; color: #fff; line-height: 1.2; white-space: nowrap; }
.score-badge small { font-size: 11px; font-weight: 700; opacity: .85; }
.score-badge.score-high { background: var(--primary-solid); }
.score-badge.score-mid { background: #B7791F; }
.score-badge.score-low { background: #C53030; }
.rating-chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
.rating-chip strong { font-size: 14px; color: var(--orkhon); }
.rating-chip-sm .score-badge { font-size: 12.5px; padding: 2px 6px; }
.rating-chip-lg .score-badge { font-size: 18px; padding: 5px 10px; }
.org-status-row { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.org-foot { gap: 8px; flex-wrap: wrap; }

.reviews { padding-top: 24px; border-top: 1px solid var(--line); margin-top: 8px; display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 84px; }
.reviews h2 { font-family: var(--font-display); font-size: 22px; }
.review-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 28px; align-items: center; }
.review-total { display: flex; flex-direction: column; gap: 2px; }
.review-total-score { font-family: var(--font-display); font-size: 48px; line-height: 1; font-weight: 800; }
.review-total-score small { font-size: 18px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.review-total strong { color: var(--orkhon); font-size: 16px; }
.review-bars { display: flex; flex-direction: column; gap: 5px; max-width: 360px; }
.review-bar { display: grid; grid-template-columns: 36px minmax(0, 1fr) 30px; align-items: center; gap: 8px; font-size: 13px; }
.review-bar-label { color: var(--muted); font-weight: 600; }
.review-bar-track { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.review-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--primary-solid); }
.review-bar-n { text-align: right; color: var(--muted); }
@media (max-width: 480px) { .review-summary { grid-template-columns: minmax(0, 1fr); } }

.review-list { display: flex; flex-direction: column; }
.review-card { padding: 16px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 84px; }
.review-list > .review-card:first-child, .review-list > :first-child .review-card { border-top: 0; }
.review-card.is-deleted { opacity: .6; }
.review-head { display: flex; align-items: center; gap: 10px; }
.review-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--directory-bg); color: var(--directory); font-weight: 800; flex: none; }
.review-who { display: flex; flex-direction: column; min-width: 0; }
.review-who small { color: var(--muted); font-size: 13px; }
.review-score { display: flex; align-items: center; gap: 8px; margin: 0; }
.review-score strong { color: var(--orkhon); }
.review-body { margin: 0; white-space: pre-line; line-height: 1.55; overflow-wrap: anywhere; }
.review-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-width: 520px; border-radius: 12px; overflow: hidden; }
.review-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.review-admin { display: flex; gap: 8px; align-items: flex-start; }
.review-admin form { margin: 0; }

.review-mine { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 4px 16px 14px; background: var(--tal); }
.review-mine-title { display: block; padding-top: 12px; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.review-mine .review-card { border-top: 0; }
.review-mine-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.review-mine-actions form { margin: 0; }
.review-edit { flex: 1 1 100%; }
.review-edit[open] > summary { margin-bottom: 12px; }
.review-form { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; background: var(--surface); scroll-margin-top: 84px; }
.score-picker { border: 0; padding: 0; margin: 0; }
.score-picker legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.score-options { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.score-option { position: relative; cursor: pointer; }
.score-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.score-option span { display: grid; place-items: center; height: 42px; border-radius: 10px; border: 1.5px solid var(--border); font-weight: 800; background: var(--surface); color: var(--ink); }
.score-option:hover span { border-color: var(--orkhon); }
.score-option input:focus-visible + span { outline: 3px solid rgba(31, 111, 235, .35); outline-offset: 1px; }
.score-option.score-high input:checked + span { background: var(--primary-solid); border-color: var(--orkhon); color: #fff; }
.score-option.score-mid input:checked + span { background: #B7791F; border-color: #B7791F; color: #fff; }
.score-option.score-low input:checked + span { background: #C53030; border-color: #C53030; color: #fff; }
@media (max-width: 420px) { .score-options { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; }

.review-admin-row { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.review-admin-row .review-card { border-top: 0; padding-top: 4px; }
.review-admin-org { font-weight: 700; font-size: 14px; color: var(--orkhon); }
.admin-filter { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.admin-filter input[type=search] { min-height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; min-width: 240px; flex: 1; max-width: 420px; }

/* Үнэлгээний зураг: "Нүүр" тэмдэг хэрэггүй (зар шиг нүүр зураг байхгүй) */
.review-form .photo-previews figcaption { display: none; }
.review-score .review-date { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; }
.review-card .review-score { flex-wrap: wrap; }

/* ===========================================================================
   ДИЗАЙН СИСТЕМ v2 — "Өвөрхангай аймгийн мэдээллийн портал"
   Primary #0B63F6, Manrope, 8px сүлжээ, булан 12–24px, зөөлөн сүүдэр.
   Гэрэл/харанхуй горим: :root дахь хувьсагч (дээр), сонголт wwwroot/js/theme.js.
=========================================================================== */
.container { max-width: 1280px; padding: 0 16px; }
body { background: var(--tal); color: var(--ink); -webkit-font-smoothing: antialiased; transition: background-color .2s; }
h1, h2, h3 { letter-spacing: -.01em; }
.btn { font-weight: 700; border-radius: 12px; transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s; }
.btn-primary { box-shadow: 0 6px 16px rgba(11, 99, 246, .22); }
.btn-primary:hover { background: var(--khangai); }
.btn-accent { background: var(--primary-solid); color: #fff; }
.btn-accent:hover { background: var(--khangai); color: #fff; }
.btn-outline { border-width: 1.5px; border-color: var(--border); color: var(--ink); }
.btn-outline:hover { border-color: var(--orkhon); color: var(--orkhon); }
.btn-ghost:hover { background: var(--news-bg); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--orkhon) 55%, transparent); outline-offset: 2px; }
.tone-soums { background: var(--soums-bg); color: var(--soums); }
.tone-help  { background: var(--help-bg);  color: var(--help); }
.tone-post  { background: var(--news-bg);  color: var(--orkhon); }
.tone-bell  { background: var(--ads-bg);   color: var(--ads); }

/* --- Header: тунгалаг, бүдэг (blur), дээр наалддаг --- */
.site-header {
    position: sticky; top: 0; z-index: 40; background: var(--header-bg);
    -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 8px 16px; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; min-width: 0; }
.brand .logo { flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 800; font-size: 16px; color: var(--ink); white-space: nowrap; }
.brand-sub { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }

.main-nav { display: none; align-items: center; gap: 2px; flex: 1 1 auto; justify-content: center; min-width: 0; }
.main-nav a {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 10px;
    font-weight: 700; font-size: 14.5px; text-decoration: none; color: var(--ink); white-space: nowrap;
}
.main-nav a:hover { background: var(--line); color: var(--ink); }
.main-nav a.active { background: var(--news-bg); color: var(--orkhon); }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.header-actions form { margin: 0; }
.header-actions .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.header-actions .logout-form, .header-actions .admin-link { display: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; color: var(--ink); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--line); color: var(--orkhon); }
.bell-dot { background: #EF4444; box-shadow: 0 0 0 2px var(--surface); }
.btn-login span { display: none; }
.btn-login { width: 40px; padding: 0 !important; }

/* Сар/нар: аль горимд байгаагаас хамаарч нэг нь харагдана */
.theme-ico-sun, .theme-label-light { display: none; }
.theme-ico-moon { display: inline-flex; }
:root[data-theme="dark"] .theme-ico-moon, :root[data-theme="dark"] .theme-label-dark { display: none; }
:root[data-theme="dark"] .theme-ico-sun { display: inline-flex; }
:root[data-theme="dark"] .theme-label-light { display: inline; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-ico-moon, :root:not([data-theme="light"]) .theme-label-dark { display: none; }
    :root:not([data-theme="light"]) .theme-ico-sun { display: inline-flex; }
    :root:not([data-theme="light"]) .theme-label-light { display: inline; }
}
.theme-toggle:hover { color: var(--erdene-zuu); }

.location-picker { position: relative; min-width: 0; }
.location-picker summary {
    list-style: none; display: flex; align-items: center; gap: 5px; cursor: pointer; height: 40px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-weight: 700; font-size: 13.5px; color: var(--ink);
}
.location-picker summary::-webkit-details-marker { display: none; }
.location-picker summary:hover { border-color: var(--orkhon); }
.location-picker summary .icon:first-child { color: var(--orkhon); }
.location-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22vw; }
.location-menu {
    position: absolute; top: 48px; right: 0; z-index: 50; width: 240px; max-height: 380px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 6px;
}
.location-menu a { display: block; padding: 9px 12px; border-radius: 9px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.location-menu a:hover { background: var(--line); }
.location-menu a.active { background: var(--news-bg); color: var(--orkhon); font-weight: 800; }
.avatar {
    width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--news-bg); text-decoration: none;
    color: var(--orkhon); font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}

/* Утас: зөвхөн лого (нэргүй), байршил нь дүрс + богино нэр */
@media (max-width: 759px) {
    .brand-text { display: none; }
    .header-row { min-height: 60px; gap: 6px; }
    .header-actions { gap: 2px; }
    .icon-btn { width: 38px; height: 38px; }
    .bell-dot { top: 7px; right: 8px; }
    .location-label { max-width: 26vw; }
}
@media (min-width: 760px) {
    .main-nav { display: flex; }
    .main-nav .nav-home, .main-nav .nav-help { display: none; }
    .header-actions .admin-link { display: inline-flex; }
    .header-actions .logout-form { display: block; }
    .brand-text { display: none; }
}
@media (min-width: 1100px) {
    .brand-text { display: flex; }
    .header-search { display: inline-flex; }
    .btn-login span { display: inline; }
    .btn-login { width: auto; padding: 0 16px !important; }
}
@media (min-width: 1240px) {
    .main-nav .nav-home, .main-nav .nav-help { display: inline-flex; }
}

/* --- Hero: тэнгэрийн градиент + SVG байгаль (Home.razor) --- */
.hero {
    position: relative; overflow: hidden; color: #fff; isolation: isolate;
    background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 52%, var(--sky-3) 100%);
}
.hero::before { /* текст уншигдахуйц: зүүн талыг бага зэрэг бараан */
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(90deg, rgba(4, 16, 40, .45) 0%, rgba(4, 16, 40, .18) 45%, transparent 70%);
}
.hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.hero-sun { fill: var(--sun); filter: drop-shadow(0 0 24px rgba(255, 220, 140, .6)); }
.hero-stars { fill: #fff; opacity: 0; transition: opacity .3s; }
.hero-far { fill: var(--hill-far); opacity: .75; }
.hero-rock-1 { fill: var(--rock-1); }
.hero-rock-2 { fill: var(--rock-2); }
.hero-hill-1 { fill: var(--hill-1); }
.hero-hill-2 { fill: var(--hill-2); }
.hero-hill-3 { fill: var(--hill-3); }
.hero-ger { fill: var(--ger); }
.hero-ger-roof { fill: var(--ger-roof); }
.hero-ger-door { fill: #C2410C; }
:root[data-theme="dark"] .hero-stars { opacity: .85; }
:root[data-theme="dark"] .hero-sun { filter: drop-shadow(0 0 18px rgba(226, 232, 240, .35)); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .hero-stars { opacity: .85; }
    :root:not([data-theme="light"]) .hero-sun { filter: drop-shadow(0 0 18px rgba(226, 232, 240, .35)); }
}

.hero-inner { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 14px; padding-top: 36px; padding-bottom: 96px; }
.hero h1 { font-weight: 800; font-size: clamp(30px, 6vw, 56px); line-height: 1.08; letter-spacing: -.02em; text-shadow: 0 2px 18px rgba(0, 20, 60, .35); }
.hero-sub { font-size: clamp(15px, 2vw, 19px); font-weight: 600; color: rgba(255, 255, 255, .92); max-width: 560px; text-shadow: 0 1px 10px rgba(0, 20, 60, .35); }
.hero-search {
    display: flex; align-items: center; gap: 6px; width: 100%; max-width: 620px; margin-top: 6px; padding: 6px;
    background: var(--surface); border-radius: 999px; box-shadow: 0 14px 34px rgba(4, 16, 40, .28);
}
.search-field { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 8px 0 14px; color: var(--muted); background: transparent; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-family: var(--font-body); font-size: 15.5px; color: var(--ink); }
.search-field input::placeholder { color: var(--muted); }
.hero-search .btn { min-height: 46px; border-radius: 999px; padding: 0 26px; }
.hero-chips { display: flex; gap: 8px; overflow-x: auto; margin: 4px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.hero-chips::-webkit-scrollbar { display: none; }
.hero-chip {
    flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); color: #fff;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); text-decoration: none; font-weight: 600; font-size: 13.5px;
}
.hero-chip:hover { background: rgba(255, 255, 255, .28); color: #fff; }
@media (min-width: 760px) {
    .hero-inner { padding-top: 64px; padding-bottom: 128px; gap: 16px; }
    .hero-chips { flex-wrap: wrap; overflow: visible; margin: 4px 0 0; padding: 0; }
}

/* --- Нүүр: хурдан цэс (hero дээр давхарласан цагаан самбар) --- */
.home { gap: 28px; padding-top: 0; }
.quick-tiles {
    position: relative; z-index: 3; margin-top: -64px;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
    padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow);
}
.quick-tile {
    display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 4px; border-radius: 14px;
    text-decoration: none; color: var(--ink); font-weight: 700; font-size: 12.5px; text-align: center; line-height: 1.25;
    transition: background-color .15s, transform .15s;
}
.quick-tile:hover { background: var(--line); color: var(--ink); transform: translateY(-2px); }
.quick-ico { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
@media (min-width: 760px) {
    .quick-tiles { margin-top: -84px; grid-template-columns: repeat(8, minmax(0, 1fr)); padding: 14px; gap: 6px; }
    .quick-tile { font-size: 14px; padding: 14px 6px; }
    .quick-ico { width: 60px; height: 60px; border-radius: 18px; }
}

/* Нүүрний хэсгүүд: цагаан самбар (загвар: "Онцлох мэдээ", "Сүүлийн мэдээ"...) */
.home .block {
    background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 18px; box-shadow: var(--shadow-sm);
}
.block-head h2 { font-size: 19px; font-weight: 800; }
.see-all { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; text-decoration: none; color: var(--orkhon); white-space: nowrap; }
.see-all:hover { color: var(--khangai); }
.home .card, .home .news-mini-list .news-mini { box-shadow: none; }
.home .empty { background: var(--surface-2); }
@media (min-width: 760px) {
    .home .block { padding: 22px 24px; }
    .block-head h2 { font-size: 21px; }
}

/* --- Карт, жагсаалт: зөөлөн булан, hover үед бага зэрэг өргөгдөнө --- */
.card, .list-card, .news-row, .news-article, .table-wrap, .soum-card, .auth-card, .form-card { border-radius: var(--radius-lg); border-color: var(--border); box-shadow: var(--shadow-sm); }
.card-link, .soum-card, .news-row { transition: transform .15s, box-shadow .15s, border-color .15s; }
.card-link:hover, .soum-card:hover, .news-row:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border); }
.card-link { color: var(--ink); text-decoration: none; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.tag { border-radius: 999px; padding: 3px 10px; font-weight: 700; }
.date-badge { box-shadow: var(--shadow-sm); border-radius: 12px; }
.org-initials { border-radius: 14px; background: var(--news-bg); color: var(--orkhon); }
.field input, .field select, .field textarea, select, textarea { background: var(--surface); color: var(--ink); border-color: var(--border); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid color-mix(in srgb, var(--orkhon) 35%, transparent); outline-offset: 0; border-color: var(--orkhon); }

/* Сумдаар үзэх */
.soum-band { background: linear-gradient(135deg, var(--news-bg), var(--directory-bg)); border: 1px solid var(--border); border-radius: 22px; }
.soum-band h2 { color: var(--ink); }
.soum-chip { border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--ink); height: 38px; font-weight: 600; }
.soum-chip:hover { border-color: var(--orkhon); color: var(--orkhon); }
.soum-chip.active { background: var(--primary-solid); border-color: var(--primary-solid); color: #fff; }

/* Жагсаалт хуудасны гарчиг */
.page { padding-top: 28px; }
.page-head h1, .title-row h1 { font-weight: 800; letter-spacing: -.02em; }

/* /post: юу нийтлэх вэ (Post.razor), тусламжийн icon */
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.module-card {
    display: flex; align-items: center; gap: 12px; padding: 16px; text-decoration: none; color: var(--ink);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s;
}
.module-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.module-card strong { display: block; font-size: 16px; }
.module-card small { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.module-icon { width: 50px; height: 50px; flex: none; border-radius: 15px; display: flex; align-items: center; justify-content: center; }
@media (min-width: 760px) { .module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }

/* --- Footer: бараан цэнхэр, дээд ирмэгт уулын дүрс --- */
.site-footer { position: relative; margin-top: 56px; background: var(--footer-bg); color: #A9B8D0; font-size: 14px; padding: 0 0 18px; }
.footer-ridge { position: absolute; left: 0; right: 0; top: -40px; width: 100%; height: 41px; display: block; }
.footer-ridge path { fill: var(--footer-bg); }
.footer-grid { display: grid; gap: 28px; padding-top: 28px; padding-bottom: 24px; grid-template-columns: 1fr 1fr; }
.footer-about { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 12px; }
.footer-about p { max-width: 340px; line-height: 1.55; }
.footer-brand-link .brand-text { display: flex; }
.footer-brand-link .brand-name { color: #fff; }
.footer-brand-link .brand-sub { color: #A9B8D0; }
.footer-col { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }
.footer-col h2 { font-size: 15px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.footer-col a { color: #C9D5E8; text-decoration: none; font-weight: 600; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-col p { line-height: 1.5; }
.footer-install { color: var(--erdene-zuu); }
.footer-bottom {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px;
}
.footer-theme {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); color: #E2E8F0; font: inherit; font-weight: 700;
}
.footer-theme:hover { background: rgba(255, 255, 255, .12); }
@media (min-width: 760px) {
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; padding-top: 36px; }
    .footer-about { grid-column: auto; }
}

/* --- Утасны доод цэс --- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: 66px; padding-bottom: env(safe-area-inset-bottom);
    background: var(--header-bg); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
    border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700;
}
.bottom-nav a:hover, .bottom-nav a.active { color: var(--orkhon); }
.bottom-nav a.active .icon { background: var(--news-bg); border-radius: 10px; padding: 3px; width: 34px; height: 28px; }
@media (min-width: 760px) { .bottom-nav { display: none; } }

/* --- Админ: харанхуй горимд ч уншигдахуйц --- */
.admin-side { background: var(--footer-bg); color: #C9D5E8; }
.admin-theme { display: inline-flex; align-items: center; gap: 6px; }
.home .split { align-items: flex-start; }
/* Цагаан бичигтэй тод дэвсгэр: харанхуй горимд ч тогтмол өнгө (--events/--danger нь тэнд цайвар болдог) */
.month-chip.active, .cal-event:hover { background: #7C3AED; border-color: #7C3AED; }
.btn-danger { background: #DC2626; }
/* Богино хуудсанд footer дэлгэцийн доод ирмэгт */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
/* Утсан дээр сумын цэс дэлгэцийн өргөнөөр (баруун талд байрлах товчноос зүүн тийш гарахгүй) */
@media (max-width: 759px) {
    .location-picker { position: static; }
    .location-menu { position: absolute; top: calc(100% + 4px); left: 12px; right: 12px; width: auto; }
}

/* --- Байгууллага: ажлын цаг + үнэлгээний нэгтгэл нэг мөрөнд (OrgView.razor, ReviewSection Part=Summary) --- */
.org-info-row { display: grid; gap: 20px; align-items: start; }
.review-overview {
    display: flex; flex-direction: column; gap: 14px; padding: 18px; scroll-margin-top: 84px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.review-overview h2 { font-size: 19px; }
.review-overview .review-bars { max-width: none; }
.review-cta { align-self: flex-start; }
.reviews-sub { font-size: 19px !important; }
.reviews:not(:has(*)) { display: none; }
@media (min-width: 900px) {
    .org-info-row.is-split { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 28px; }
    .org-info-row.is-split .review-overview { margin-top: 2px; }
}

/* --- Hero: админы тохируулсан зураг (Home.razor, /admin/appearance) --- */
.hero-photo { position: absolute; inset: 0; z-index: 0; display: block; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero.has-photo { background: #0B1B36; }
.hero.has-photo::before { /* зураг ямар ч байсан гарчиг, хайлт уншигдахуйц */
    background:
        linear-gradient(90deg, rgba(4, 14, 34, .62) 0%, rgba(4, 14, 34, .32) 50%, rgba(4, 14, 34, .08) 80%),
        linear-gradient(180deg, rgba(4, 14, 34, .25) 0%, transparent 35%, rgba(4, 14, 34, .25) 100%);
}
:root[data-theme="dark"] .hero.has-photo .hero-photo img { filter: brightness(.72) saturate(.9); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .hero.has-photo .hero-photo img { filter: brightness(.72) saturate(.9); }
}
@media (max-width: 759px) {
    .hero.has-photo::before { background: linear-gradient(180deg, rgba(4, 14, 34, .55) 0%, rgba(4, 14, 34, .35) 60%, rgba(4, 14, 34, .2) 100%); }
}

/* Админ: нүүрний зургийн урьдчилсан харагдац (Pages/Admin/HeroSettings.razor) */
.hero-previews { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.hero-previews figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.hero-preview {
    position: relative; overflow: hidden; border-radius: 14px; background: linear-gradient(180deg, var(--sky-1), var(--sky-2) 55%, var(--hill-1) 56%, var(--hill-3));
    border: 1px solid var(--border);
}
.hero-previews figure:first-child { flex: 1 1 320px; max-width: 560px; }
.hero-preview.is-wide { width: 100%; aspect-ratio: 1920 / 760; }
.hero-preview.is-tall { width: 150px; aspect-ratio: 800 / 900; }
.hero-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-preview::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4, 14, 34, .6), rgba(4, 14, 34, .1) 75%); }
.hero-preview-text { position: absolute; z-index: 1; left: 14px; top: 14px; display: flex; flex-direction: column; color: #fff; }
.hero-preview-text strong { font-size: 18px; font-weight: 800; }
.hero-preview.is-tall .hero-preview-text strong { font-size: 13px; }
.hero-preview-text small { font-size: 11px; opacity: .85; }
.hint-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.hero-remove { margin-top: 14px; }

/* --- Бүх сайтаас хайх (/search, Pages/Search.razor) --- */
.search-page { display: flex; flex-direction: column; gap: 22px; }
.search-hero {
    display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 22px; color: #fff;
    background: linear-gradient(135deg, var(--sky-1), var(--sky-2)); box-shadow: var(--shadow-sm);
}
.search-hero h1 { font-size: 26px; font-weight: 800; }
.search-row { display: flex; flex-wrap: wrap; gap: 8px; }
.search-big { flex: 1 1 320px; height: 52px; border-radius: 14px; background: var(--surface); padding: 0 14px; }
.search-big input { font-size: 16px; }
.search-row .select-field { flex: 0 1 200px; }
.search-row .select-field select { height: 52px; border-radius: 14px; border: 0; }
.search-row .btn { min-height: 52px; padding: 0 26px; border-radius: 14px; }
.search-tabs .chip { gap: 6px; }
.chip-count { display: inline-flex; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; align-items: center; justify-content: center;
    background: var(--line); color: var(--muted); font-size: 12px; font-weight: 800; }
.chip.active .chip-count { background: rgba(255, 255, 255, .22); color: #fff; }
.search-summary { margin-top: -8px; }
.search-group { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-sm); }
.search-group-head h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.search-group-ico { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.search-count { color: var(--muted); font-weight: 700; font-size: 15px; }
.search-none { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; }
.search-empty { display: flex; flex-direction: column; gap: 12px; }
.search-modules { margin-top: 8px; }
@media (min-width: 760px) {
    .search-hero { padding: 32px 36px; }
    .search-hero h1 { font-size: 32px; }
    .search-group { padding: 22px 24px; }
}

/* Утсан дээр: хайлтын товч толгойд үргэлж; горим солих нь footer-т (зай хэмнэнэ) */
.header-search { display: inline-flex; }
/* Утсан дээр 7 товч багтаахын тулд: товчнууд 36px, байршлын нэр зөвхөн 440px-ээс өргөн дэлгэцэнд (сонгосон сум цэсэнд тодорно) */
@media (max-width: 759px) {
    .site-header .icon-btn { width: 36px; height: 36px; }
    .header-actions .btn-post, .header-actions .btn-login, .header-actions .avatar { width: 38px; height: 38px; min-height: 0; }
}
@media (max-width: 439px) {
    .location-label { display: none; }
    .location-picker summary { padding: 0 8px; gap: 3px; }
}
@media (max-width: 359px) {
    .location-picker summary .icon:last-child { display: none; }
    .header-row { gap: 4px; }
    .site-header .brand .logo { width: 36px; height: 36px; }
}
