/* ---------- Загварын токенууд ---------- */
:root {
  color-scheme: light;
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --border: #dde2e9;
  --border-strong: #c4ccd6;
  --text: #14202e;
  --text-soft: #3a4757;
  --muted: #5a6675;
  --primary: #0f2f57;
  --primary-hover: #0a2240;
  --primary-soft: #e7edf5;
  --on-primary: #ffffff;
  --ink: #0b2545;
  --ink-2: #123257;
  --ink-text: #c5d0dd;

  --heading: #0b2545;
  --ink-line: rgba(255, 255, 255, .18);
  --accent: #a9c7e8;
  --amber: #8f4a07;
  --amber-soft: #fbf1dc;
  --red: #a92318;
  --red-soft: #fbeceb;
  --blue: #1a4fa3;
  --blue-soft: #e5edf9;
  --green: #14663a;
  --green-soft: #e1f3e8;
  --gray-soft: #edf0f3;
  --on-red: #ffffff;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: none;
  --shadow-lg: 0 1px 2px rgba(11, 37, 69, .08), 0 16px 40px -16px rgba(11, 37, 69, .3);
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

/* Бараан горим: хэрэглэгч сонгоогүй бол системийн тохиргоог дагана (data-theme байхгүй).
   Сонгосон бол <html data-theme="light|dark"> нь системийнхийг дарна. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141b;
    --surface: #161e28;
    --surface-2: #1d2733;
    --border: #2a3644;
    --border-strong: #3b4959;
    --text: #e6ecf2;
    --text-soft: #c3ccd6;
    --muted: #95a2b0;
    --primary: #8db8ec;
    --primary-hover: #aecdf3;
    --primary-soft: #1b2a3e;
    --on-primary: #0b1626;
    --ink: #0b1d33;
    --ink-2: #11294a;
    --ink-text: #c5d0dd;

    --heading: #eef3f8;
    --accent: #a9c7e8;
    --amber: #f0b45b;
    --amber-soft: #33260f;
    --red: #ff8f85;
    --red-soft: #3b1a17;
    --blue: #8ab4f8;
    --blue-soft: #172a45;
    --green: #6fd39a;
    --green-soft: #133024;
    --gray-soft: #222c37;
    --on-red: #2a0b08;
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141b;
  --surface: #161e28;
  --surface-2: #1d2733;
  --border: #2a3644;
  --border-strong: #3b4959;
  --text: #e6ecf2;
  --text-soft: #c3ccd6;
  --muted: #95a2b0;
  --primary: #8db8ec;
  --primary-hover: #aecdf3;
  --primary-soft: #1b2a3e;
  --on-primary: #0b1626;
  --ink: #0b1d33;
  --ink-2: #11294a;
  --ink-text: #c5d0dd;

  --heading: #eef3f8;
  --accent: #a9c7e8;
  --amber: #f0b45b;
  --amber-soft: #33260f;
  --red: #ff8f85;
  --red-soft: #3b1a17;
  --blue: #8ab4f8;
  --blue-soft: #172a45;
  --green: #6fd39a;
  --green-soft: #133024;
  --gray-soft: #222c37;
  --on-red: #2a0b08;
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Суурь ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss03";
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.012em; }
h1 { font-size: 26px; letter-spacing: -.02em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.container { max-width: 1120px; margin: 0 auto; padding: 32px 24px 72px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.deal-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4, .deal-layout { grid-template-columns: 1fr; }
  .container { padding: 24px 16px 56px; }
}

/* ---------- Дээд цэс ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; min-height: 64px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 17px; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand svg { color: var(--primary); flex-shrink: 0; }
.nav { display: flex; gap: 2px; margin-left: 12px; align-self: stretch; }
.nav a, .nav button { display: inline-flex; align-items: center; padding: 0 12px; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; background: none; border: 0; cursor: pointer; position: relative; }
.nav a:hover, .nav button:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); }
.nav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--primary); }
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
@media (max-width: 640px) {
  .topbar-inner { padding: 0 16px; gap: 10px; }
  .brand { flex-shrink: 0; }
  .nav:not(.lp-nav) { margin-left: 0; flex: 1 1 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav:not(.lp-nav) + .spacer { display: none; }
  .nav a { padding: 0 8px; white-space: nowrap; flex-shrink: 0; }
  .nav a.active::after { left: 8px; right: 8px; bottom: 0; }
  .user-chip { flex-shrink: 0; }
  .user-chip .uname { display: none; }
}

/* ---------- Карт ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card:not(.grid > .card) { margin-top: 16px; }
.card-title { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.stat-primary .stat-label { color: var(--ink-text); }

/* ---------- Товч ба маягт ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 550;
  cursor: pointer; transition: background .12s, border-color .12s, color .12s; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--red); border-color: currentColor; background: transparent; }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.btn-lg { min-height: 48px; padding: 12px 22px; font-size: 15px; }
label { display: block; font-weight: 500; font-size: 13.5px; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
input, select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--primary); }
input[type=checkbox]:focus { box-shadow: none; }
textarea { resize: vertical; min-height: 88px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label { margin: 0; flex: 1; min-width: 120px; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; min-height: 0; padding: 0; }
.seg span {
  display: block; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; text-align: center; font-weight: 500; transition: border-color .12s, background .12s;
}
.seg span:hover { background: var(--surface-2); }
.seg input:checked + span { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-soft); color: var(--primary); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Төлөвийн тэмдэг ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 550; white-space: nowrap; line-height: 1.5; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-gray { background: var(--gray-soft); color: var(--muted); }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-blue { background: var(--blue-soft); color: var(--blue); }
.b-green { background: var(--green-soft); color: var(--green); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-teal { background: var(--primary-soft); color: var(--primary); }

/* ---------- Нүүр хуудас ---------- */
.container.is-landing { max-width: none; padding: 0; }
.is-landing > section { padding-inline: max(24px, calc((100% - 1072px) / 2)); scroll-margin-top: 64px; }
.lp-eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.lp-display { font-family: var(--serif); font-weight: 500; letter-spacing: -.012em; line-height: 1.15; }

.lp-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding-block: 80px 88px; }
.lp-hero h1 { color: var(--heading); }
.lp-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 72px; align-items: center; }
.lp-hero h1 { font-size: 46px; margin: 0 0 20px; }
.lp-lead { font-size: 17px; line-height: 1.65; color: var(--muted); max-width: 52ch; margin-bottom: 30px; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-note { margin: 16px 0 0; font-size: 13.5px; color: var(--muted); }

/* Жишээ гэрээний самбар */
.lp-deal { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.lp-deal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; }
.lp-deal-head b { display: block; font-size: 15px; font-weight: 600; }
.lp-deal-head span.sub { font-size: 12.5px; color: var(--muted); }
.lp-deal .stepper { padding: 0 14px 18px; margin: 0; }
.lp-deal .stepper .s { font-size: 11.5px; }
.lp-held { background: var(--surface-2); border-block: 1px solid var(--border); padding: 16px 22px; display: flex; align-items: center; gap: 14px; }
.lp-held svg { color: var(--primary); flex-shrink: 0; }
.lp-held span { display: block; font-size: 12.5px; color: var(--muted); }
.lp-held b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.lp-deal-rows { margin: 0; padding: 14px 22px 18px; font-size: 13.5px; }
.lp-deal-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.lp-deal-rows dt { color: var(--muted); }
.lp-deal-rows dd { margin: 0; font-weight: 500; }

.lp-section { padding-block: 80px; background: var(--surface); border-bottom: 1px solid var(--border); }
.lp-section.alt { background: var(--bg); }
.lp-section h2 { font-size: 32px; margin: 0 0 12px; }
.lp-head { max-width: 680px; margin-bottom: 40px; }
.lp-head p { font-size: 16px; color: var(--muted); margin: 0; }

/* Үйлчилгээ */
.lp-services { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.lp-service { padding: 24px; border-left: 1px solid var(--border); }
.lp-service:first-child { border-left: 0; }
.lp-service svg { color: var(--primary); margin-bottom: 14px; display: block; }
.lp-service h3 { font-size: 16px; margin-bottom: 8px; }
.lp-service p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.6; }

/* Үйл ажиллагаа */
.lp-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.lp-step { border-top: 2px solid var(--primary); padding-top: 18px; }
.lp-step-num { font-family: var(--serif); font-size: 22px; color: var(--primary); margin-bottom: 8px; }
.lp-step h3 { font-size: 16px; margin-bottom: 8px; }
.lp-step p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0; }

/* Хоёр талын хамгаалалт */
.lp-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.lp-col .lp-eyebrow { margin-bottom: 6px; }
.lp-col h3 { font-size: 18px; margin-bottom: 16px; }
.lp-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lp-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-soft); font-size: 14.5px; }
.lp-list svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; margin-top: 3px; }

/* Тариф */
.tariff-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.tariff-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tariff-table table { font-size: 15px; }
.tariff-table th { background: var(--surface-2); color: var(--text-soft); padding: 12px 18px; }
.tariff-table td { padding: 14px 18px; white-space: normal; }
.tariff-table tr:last-child td { border-bottom: 0; }
.tariff-table td.r { font-weight: 600; }
.tariff-notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; font-size: 14.5px; color: var(--text-soft); }
.tariff-notes li { padding-left: 14px; border-left: 2px solid var(--border-strong); line-height: 1.6; }

/* Аюулгүй ажиллагаа, бидний тухай */
.lp-split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 72px; align-items: start; }
.lp-prose h2 { margin-bottom: 18px; }
.lp-prose p { color: var(--text-soft); font-size: 16px; line-height: 1.7; }
.lp-principles { list-style: none; padding: 0; margin: 0; }
.lp-principles li { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.lp-principles li:last-child { border-bottom: 1px solid var(--border); }
.lp-principles svg { color: var(--primary); flex-shrink: 0; margin-top: 1px; }
.lp-principles b { display: block; font-weight: 600; margin-bottom: 2px; }
.lp-principles span { font-size: 14px; color: var(--muted); }

/* Түгээмэл асуулт */
.lp-faq { max-width: 800px; border-top: 1px solid var(--border-strong); }
.lp-faq details { border-bottom: 1px solid var(--border-strong); }
.lp-faq summary { cursor: pointer; padding: 18px 28px 18px 0; font-weight: 600; font-size: 15.5px; list-style: none; position: relative; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 22px; font-weight: 400; color: var(--muted); }
.lp-faq details[open] summary::after { content: "−"; }
.lp-faq p { margin: 0; padding: 0 28px 20px 0; color: var(--text-soft); line-height: 1.7; }

.lp-mvv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.lp-mvv .lp-eyebrow { margin-bottom: 6px; }
.lp-mvv p { margin: 0; color: var(--text-soft); line-height: 1.65; }

/* Сайтын доод хэсэг */
.site-footer { background: var(--ink); color: var(--ink-text); padding: 48px max(24px, calc((100% - 1072px) / 2)) 24px; }
.site-footer .brand { color: #fff; }
.site-footer .brand svg { color: #fff; --logo-check: var(--ink); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-note { margin: 10px 0 0; font-size: 14px; max-width: 38ch; }
.footer-org { margin: 12px 0 0; font-size: 13.5px; line-height: 1.7; }
.footer-col { display: grid; gap: 8px; align-content: start; font-size: 14px; }
.footer-col b { color: #fff; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.footer-col a { color: var(--ink-text); }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--ink-line); font-size: 13px; }
.site-footer :focus-visible { outline-color: #fff; }

/* Нийтэд нээлттэй хуудас */
.public-page { max-width: 820px; margin: 0 auto; }
.public-page h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; letter-spacing: -.012em; }

@media (max-width: 960px) {
  .lp-nav { display: none; }
  .lp-hero { padding-block: 56px 64px; }
  .lp-hero-grid, .lp-split, .tariff-grid { grid-template-columns: 1fr; gap: 40px; }
  .lp-hero h1 { font-size: 36px; }
  .lp-section { padding-block: 56px; }
  .lp-section h2 { font-size: 26px; }
  .lp-services { grid-template-columns: 1fr 1fr; }
  .lp-service:nth-child(3) { border-left: 0; }
  .lp-service:nth-child(n+3) { border-top: 1px solid var(--border); }
  .lp-steps { grid-template-columns: 1fr 1fr; }
  .lp-columns, .lp-mvv { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .is-landing > section, .site-footer { padding-inline: 16px; }
  .lp-hero h1 { font-size: 30px; }
  .lp-lead { font-size: 16px; }
  .lp-cta .btn { flex: 1 1 100%; }
  .lp-services, .lp-steps { grid-template-columns: 1fr; }
  .lp-service { border-left: 0; }
  .lp-service + .lp-service { border-top: 1px solid var(--border); }
}

.steps { display: grid; gap: 12px; margin-top: 24px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.step b { display: block; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.features { margin-top: 40px; }
.feature-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 10px; }

/* Deal list */
.deal-item { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; }
.deal-item:hover { border-color: var(--primary); text-decoration: none; }
.deal-item + .deal-item { margin-top: 10px; }
.thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.deal-item .info { flex: 1; min-width: 0; }
.deal-item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-item .price { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* Stepper */
.stepper { display: flex; gap: 0; margin: 4px 0 8px; }
.stepper .s { flex: 1; text-align: center; position: relative; font-size: 12px; color: var(--muted); }
.stepper .s .dot { width: 28px; height: 28px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--border); font-weight: 700; font-size: 12px; position: relative; z-index: 1; }
.stepper .s::before { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.stepper .s:first-child::before { display: none; }
.stepper .s.done .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper .s.done::before, .stepper .s.current::before { background: var(--primary); }
.stepper .s.current .dot { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.stepper .s.current { color: var(--text); font-weight: 600; }
.stepper .s.bad .dot { background: var(--red-soft); border-color: var(--red); color: var(--red); }
@media (max-width: 640px) { .stepper .s span { display: none; } }

/* Deal detail */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin: 12px 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; border: 1px solid var(--border); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.money-box { background: var(--surface-2); border-radius: 10px; padding: 14px; }
.money-row { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.money-row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 15px; }
.action-card { border: 2px solid var(--primary); }
.action-card.warn { border-color: var(--amber); }
.action-card.bad { border-color: var(--red); }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice svg { flex-shrink: 0; margin-top: 2px; }
.n-teal { background: var(--primary-soft); color: var(--text); }
.n-teal svg { color: var(--primary); }
.n-amber { background: var(--amber-soft); }
.n-amber svg { color: var(--amber); }
.n-red { background: var(--red-soft); }
.n-red svg { color: var(--red); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.money::before { background: var(--primary); }
.timeline li.alert::before { background: var(--red); }
.timeline .when { font-size: 12px; color: var(--muted); }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; padding: 4px 0 8px; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.msg.mine { align-self: flex-end; background: var(--primary-soft); }
.msg .who { font-size: 11px; color: var(--muted); font-weight: 600; }
.party { display: flex; gap: 10px; align-items: center; }
.party + .party { margin-top: 12px; }
.code-box { font-family: ui-monospace, Consolas, monospace; font-size: 26px; font-weight: 700; letter-spacing: .2em; padding: 10px; text-align: center; background: var(--surface-2); border-radius: 10px; margin: 8px 0; }
.countdown { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* Modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; padding: 22px; border: 1px solid var(--border); }
.modal h2 { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.qr { width: 180px; height: 180px; margin: 8px auto; display: block; background: #fff; padding: 10px; border-radius: 10px; }
.lightbox img { max-width: 100%; max-height: 85vh; border-radius: 10px; display: block; margin: auto; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 500; z-index: 60; max-width: calc(100% - 32px); }
.toast.error { background: var(--red); color: var(--on-red); }
.photo-input { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-input .ph { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; position: relative; border: 1px solid var(--border); }
.photo-input .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-input .ph button { position: absolute; top: 2px; right: 2px; border: 0; background: rgba(0,0,0,.6); color: #fff; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 1; }
.photo-input .add { width: 72px; height: 72px; border: 1px dashed var(--border); border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--muted); margin: 0; }
.photo-input .add input { display: none; }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: var(--on-red); font-size: 12px; font-weight: 700; margin-left: 4px; }
.support-item { padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); margin-bottom: 8px; }
.support-item.resolved { background: var(--surface-2); opacity: .8; }

/* Бүртгэлийн маягт */
.grid.tight { gap: 0 12px; }
.field-error { font-size: 12px; color: var(--red); margin-top: 4px; min-height: 0; }
.field-error:empty { display: none; }
.has-error input, .has-error .seg span { border-color: var(--red); }
.regno { display: grid; grid-template-columns: 48px 48px 1fr; gap: 8px; }
.reg-letter { text-align: center; text-transform: uppercase; font-weight: 600; padding-left: 0; padding-right: 0; }
.regno input:disabled { background: var(--surface-2); cursor: not-allowed; }
.pw-rules { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.pw-rules li::before { content: "○"; display: inline-block; width: 16px; }
.pw-rules li.ok { color: var(--green); }
.pw-rules li.ok::before { content: "✓"; }
@media (max-width: 520px) { .pw-rules { grid-template-columns: 1fr; } }

/* Профайл ба баталгаажуулалт */
.grow { flex: 1; min-width: 0; }
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.profile-name { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.verify-progress { text-align: center; min-width: 120px; }
.verify-progress .bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.verify-progress .bar span { display: block; height: 100%; background: var(--primary); }
.trust-card { margin-bottom: 16px; }
.trust-score { display: flex; align-items: center; gap: 14px; margin: 12px 0 8px; }
.trust-score .bar { flex: 1; height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.trust-score .bar span { display: block; height: 100%; background: var(--green); }
.trust-fair .trust-score .bar span { background: var(--amber); }
.trust-low .trust-score .bar span { background: var(--red); }
.trust-log summary { cursor: pointer; font-size: 14px; font-weight: 500; margin-top: 4px; }
.trust-log ul { list-style: none; margin: 10px 0 0; padding: 0; }
.trust-log li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.trust-log li .muted { display: block; }
.trust-delta { min-width: 36px; font-weight: 600; }
.trust-delta.neg { color: var(--red); }
.trust-delta.pos { color: var(--green); }
.verify-grid { margin-top: 16px; }
.verify-grid .card + .card { margin-top: 0; }
.verify-card { display: flex; flex-direction: column; gap: 10px; }
.verify-card p { margin: 0; }
.verify-card.is-done { border-color: var(--green-soft); }
.verify-head { display: flex; align-items: center; gap: 12px; }
.verify-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.verify-title { font-weight: 600; }
.otp-input { font-size: 22px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.verify-banner { display: block; margin-bottom: 20px; color: inherit; }
.verify-banner:hover { text-decoration: none; }

/* Баруун дээд буланд нэр дээр дарахад профайл руу */
.profile-link { display: flex; align-items: center; gap: 8px; color: var(--text); padding: 4px 8px 4px 4px; border-radius: 10px; }
.profile-link:hover, .profile-link.active { background: var(--surface-2); text-decoration: none; }
.profile-link .avatar { position: relative; }
.avatar-count { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: var(--on-red); font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }

/* Баталгаажуулалт дутуу үед гэрээ үүсгэх / нэгдэхийн оронд */
.gate-card { max-width: 560px; margin: 24px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 24px; }
.gate-card h1 { margin: 8px 0 0; }
.verify-icon.lg { width: 56px; height: 56px; border-radius: 16px; }
.gate-list { list-style: none; padding: 0; margin: 12px 0 16px; width: 100%; display: grid; gap: 8px; text-align: left; }
.gate-list li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; }
.gate-list li span:nth-child(2) { flex: 1; font-weight: 500; }
.gate-list li.ok { border-color: var(--green-soft); }
.gate-list li.ok svg { color: var(--green); }
.gate-list .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--amber); flex-shrink: 0; }

/* Нэрийн цэс */
.user-chip { position: relative; }
button.profile-link { border: 0; background: transparent; font: inherit; cursor: pointer; text-align: left; }
.profile-link .chev { color: var(--muted); transition: transform .15s; }
.profile-link[aria-expanded="true"] { background: var(--surface-2); }
.profile-link[aria-expanded="true"] .chev { transform: rotate(180deg); }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); padding: 6px; z-index: 20; }
.user-menu [role=menuitem] { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; min-height: 44px; }
.user-menu [role=menuitem] svg { color: var(--muted); flex-shrink: 0; }
.user-menu [role=menuitem] span:first-of-type { flex: 1; }
.user-menu [role=menuitem]:hover, .user-menu [role=menuitem]:focus-visible { background: var(--surface-2); text-decoration: none; outline: none; }
.user-menu #logout, .user-menu #logout svg { color: var(--red); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: var(--on-red); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

/* Мэдэгдлийн жагсаалт */
.notif-list { padding: 6px; }
.notif { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 10px; color: var(--text); }
.notif + .notif { border-top: 1px solid var(--border); border-radius: 0; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--gray-soft); color: var(--muted); }
.notif-icon.t-money { background: var(--primary-soft); color: var(--primary); }
.notif-icon.t-alert { background: var(--red-soft); color: var(--red); }
.notif-icon.t-message { background: var(--blue-soft); color: var(--blue); }
.notif .grow { display: flex; flex-direction: column; gap: 2px; }
.notif.unread .notif-text { font-weight: 600; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }

/* Аудитын лог */
.link-btn { display: block; margin: 10px auto 0; padding: 4px; border: 0; background: none; color: var(--primary); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }
.step-up { display: grid; gap: 10px; margin-bottom: 16px; }
.step-up .btn { justify-self: start; }
.check-list { display: grid; gap: 2px; max-height: 45vh; overflow-y: auto; }
.check-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 2px; border-top: 1px solid var(--border); cursor: pointer; }
.check-item:first-child { border-top: 0; }
.check-item input { width: 18px; height: 18px; margin: 2px 0 0; }
.contract-list { padding: 0; }
.contract-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); }
.contract-row:first-child { border-top: 0; }
.contract-row .grow { flex: 1; min-width: 0; }
.contract-title { font-weight: 600; overflow-wrap: anywhere; }
.todo-bar { height: 8px; margin-top: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.todo-bar span { display: block; height: 100%; background: var(--green); }
.todo-form { display: grid; grid-template-columns: 1fr 200px auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.todo-form .field, .todo-filter { margin: 0; }
.todo-filter { max-width: 260px; }
.todo-list { padding: 0; }
.todo-item { display: grid; grid-template-columns: auto minmax(0, 1fr) 150px auto auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); }
.todo-item:first-child { border-top: 0; }
.todo-text { overflow-wrap: anywhere; }
.todo-item.is-done .todo-text { color: var(--muted); text-decoration: line-through; }
.todo-check { width: 18px; height: 18px; margin: 0; }
@media (max-width: 760px) {
  .todo-form { grid-template-columns: 1fr; }
  .todo-item { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .todo-item .todo-body { grid-column: 2 / -1; }
  .todo-item .todo-status { grid-column: 2; min-width: 0; }
}
.audit-filter { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.audit-filter .field { margin: 0; }
@media (max-width: 760px) { .audit-filter { grid-template-columns: 1fr; } }
.audit-table td { vertical-align: top; }
.audit-table tr.audit-bad td { background: color-mix(in srgb, var(--red-soft) 35%, transparent); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.nowrap { white-space: nowrap; }
.audit-table td:nth-child(6) { white-space: normal; min-width: 160px; }

/* ---------- Нэгдсэн засвар: дотоод дэлгэцүүд ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 2px; }
.page-head p { margin: 0; }
.section-title { font-size: 15px; font-weight: 600; margin: 32px 0 12px; }
.section-title .muted { font-weight: 400; }

.deal-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.deal-list .deal-item { border: 0; border-radius: 0; background: transparent; padding: 14px 18px; box-shadow: none; transition: background .12s; }
.deal-list .deal-item + .deal-item { margin: 0; border-top: 1px solid var(--border); }
.deal-list .deal-item:hover { background: var(--surface-2); }
.deal-item .price { font-weight: 600; }
.thumb { width: 48px; height: 48px; border-radius: var(--radius-sm); }
.deal-item .badge { font-size: 11.5px; }
.empty { padding: 48px 16px; }
.empty svg { color: var(--muted); }

.step-num { background: var(--primary); color: var(--on-primary); }
.tabs { background: var(--surface-2); border-radius: var(--radius-sm); }
.tabs button { min-height: 36px; border-radius: 6px; font-size: 14px; font-weight: 550; }
.tabs button.active { box-shadow: 0 1px 2px rgba(16, 32, 29, .12); }

.stepper .s .dot { background: var(--surface); border-width: 1.5px; font-weight: 600; }
.stepper .s.done .dot { color: var(--on-primary); }
.stepper .s::before { height: 1.5px; }

.gallery img { border-radius: var(--radius-sm); }
.money-box { border-radius: var(--radius-sm); }
.money-row.total { font-weight: 600; }
.action-card { border: 1px solid var(--border); border-top: 3px solid var(--primary); }
.action-card.warn { border-color: var(--border); border-top-color: var(--amber); }
.action-card.bad { border-color: var(--border); border-top-color: var(--red); }
.notice { border-radius: var(--radius-sm); line-height: 1.5; }
.n-teal { border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); }
.n-amber { border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent); }
.n-red { border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); }
.code-box { border-radius: var(--radius-sm); }
.msg { border-radius: 10px; }

th { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12.5px; }
th, td { padding: 11px 10px; }

.modal-backdrop { background: rgba(9, 20, 28, .5); }
.modal { border-radius: 12px; box-shadow: var(--shadow-lg); padding: 24px; }
.modal h2 { font-size: 18px; }
.toast { border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 14px; }

.verify-icon, .notif-icon { border-radius: var(--radius-sm); }
.verify-card.is-done { border-color: var(--border); }
.verify-progress .stat-value { font-size: 22px; }
.gate-list li { border-radius: var(--radius-sm); }
.gate-card { padding: 36px 28px; }
.user-menu { border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.user-menu [role=menuitem] { border-radius: 6px; }
.profile-link { border-radius: var(--radius-sm); }

.terms-doc { max-width: 760px; padding: 28px 32px; }
.terms-doc h2 { font-size: 16px; margin: 24px 0 8px; }
.terms-doc h2:first-child { margin-top: 0; }
.terms-doc p { color: var(--text-soft); line-height: 1.7; }
.terms-accept { max-width: 760px; margin-top: 16px; }
.terms-accept label { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 14px; cursor: pointer; margin: 0; }
.terms-accept input { width: 18px; height: 18px; flex-shrink: 0; margin: 2px 0 0; }
.terms-accept label.is-locked { opacity: .45; cursor: not-allowed; }
.terms-accept .terms-hint { margin: 0 0 10px; }
@media (max-width: 640px) { .terms-doc { padding: 20px; } }

/* Албан ёсны хэв маяг: гарчиг, үндсэн багана */
body { display: flex; flex-direction: column; min-height: 100vh; }
#app { flex: 1 0 auto; width: 100%; }
#app:not(.is-landing) h1 { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: -.012em; }
.stat-value { font-weight: 600; }
.stat-primary { background: var(--surface); border-color: var(--border); border-top: 3px solid var(--primary); color: var(--text); }
.stat-primary .stat-label { color: var(--muted); }
.thumb, .notif-icon, .verify-icon { border-radius: var(--radius-sm); }
.msg { border-radius: var(--radius); }
.deal-item:hover { border-color: var(--border-strong); }
.tabs button { border-radius: var(--radius-sm); }

/* Гэрээ үүсгэх алхамууд */
.wizard { max-width: 720px; margin: 0 auto; }
.wizard-progress { display: flex; gap: 4px; margin: 10px 0 18px; }
.wizard-progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); }
.wizard-progress span.on { background: var(--primary); }
.wizard-title { font-size: 18px; margin: 0 0 16px; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.req { color: var(--red); }

/* Туршилтын лог */
.devlog-code { font-size: 17px; letter-spacing: 2px; }
.audit-table tr.devlog-new td { background: color-mix(in srgb, var(--amber-soft, #fdf3d7) 70%, transparent); }
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
/* Профайлын зураг солих */
.avatar-edit { display: grid; justify-items: center; gap: 4px; }
.avatar-pick { position: relative; cursor: pointer; }
.avatar-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.avatar-pick:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.avatar-cam { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; border: 2px solid var(--surface, #fff); }
.avatar-cam svg { width: 13px; height: 13px; }
.avatar-edit .link-btn { margin: 0; font-size: 13px; }
/* Админ: хэрэглэгчид */
.admin-stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
a.stat-link { color: inherit; text-decoration: none; transition: border-color .15s; }
a.stat-link:hover { border-color: var(--primary); }
.users-filter { grid-template-columns: 2fr 1fr auto; }
@media (max-width: 760px) { .users-filter { grid-template-columns: 1fr; } }
.click-row { cursor: pointer; }
.click-row:hover td { background: var(--surface-2); }
.user-checks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.user-checks li { display: flex; gap: 8px; align-items: center; }
.user-checks li.ok svg { color: var(--green); flex: none; }
.user-checks li.no { color: var(--muted); }

/* Харагдах байдлын товч (систем / цайвар / бараан) */
.theme-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.theme-btn:hover { border-color: var(--border-strong); color: var(--text); }
.theme-btn svg { width: 18px; height: 18px; }
.brand svg { --logo-check: var(--surface); }
/* Ажилтан, эрх */
.perm-list { display: grid; gap: 8px; margin-top: 4px; }
.perm-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.perm-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.perm-item input { margin-top: 3px; }
.perm-item span { display: grid; gap: 2px; }
.perm-tags { display: flex; flex-wrap: wrap; gap: 4px; white-space: normal; }
.temp-pw { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; margin: 12px 0; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.temp-pw code { font: 600 18px ui-monospace, Consolas, monospace; letter-spacing: 1px; user-select: all; }
