/* =========================================================
   SuperBot — дизайн систем
   ========================================================= */
/* Өнгө: хар бэх + дулаан цаас, ганц accent (вермилион) зөвхөн дохио болгон.
   Primary товч нь бэх өнгөтэй — accent-ийг хэтрүүлж ашиглахгүй. */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #f1f0eb;
  --surface-3: #e8e6e0;
  --border: #e3e1da;
  --border-strong: #d2cfc6;
  --text: #121310;
  --text-2: #3a3c36;
  --muted: #6c6e66;
  --faint: #9b9d94;
  --brand: #121310;
  --brand-2: #121310;
  --brand-hover: #2b2d28;
  --brand-soft: #ebe9e3;
  --brand-ring: rgb(18 19 16 / .14);
  --on-brand: #ffffff;
  --accent: #e5482b;
  --accent-soft: #fbe7e2;
  --ok: #1f7a46; --ok-soft: #e4f2e8;
  --warn: #9a5b0c; --warn-soft: #f8eedb;
  --danger: #c8321f; --danger-soft: #fae5e1;
  --info: #1f5f8b; --info-soft: #e3eef6;
  --bubble-in: #ecebe6;
  --grid-dot: #d6d3ca;
  --shadow-xs: 0 1px 1px rgb(18 19 16 / .04);
  --shadow-sm: 0 1px 2px rgb(18 19 16 / .05), 0 0 0 1px rgb(18 19 16 / .02);
  --shadow-md: 0 8px 24px -10px rgb(18 19 16 / .14), 0 2px 4px -2px rgb(18 19 16 / .06);
  --shadow-lg: 0 32px 64px -24px rgb(18 19 16 / .28), 0 8px 16px -8px rgb(18 19 16 / .08);
  --r-sm: 7px; --r: 10px; --r-lg: 14px; --r-xl: 18px;
  --sidebar-w: 248px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Literata", "PT Serif", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f0d; --surface: #161714; --surface-2: #1c1d1a; --surface-3: #262723; --border: #2a2b27; --border-strong: #3a3b36;
    --text: #efede7; --text-2: #c9c7bf; --muted: #93958c; --faint: #6c6e66;
    --brand: #efede7; --brand-2: #efede7; --brand-hover: #ffffff; --brand-soft: #24251f; --brand-ring: rgb(239 237 231 / .18); --on-brand: #121310;
    --accent: #ff6a4a; --accent-soft: #3a1d16;
    --ok: #5cc98a; --ok-soft: #142a1d; --warn: #e8b65a; --warn-soft: #2d2412; --danger: #ff7a62; --danger-soft: #3a1a15; --info: #6fb3e0; --info-soft: #132634;
    --bubble-in: #24251f; --grid-dot: #2a2b27;
    --shadow-xs: 0 1px 1px rgb(0 0 0 / .4); --shadow-sm: 0 1px 2px rgb(0 0 0 / .5); --shadow-md: 0 10px 24px -10px rgb(0 0 0 / .6); --shadow-lg: 0 32px 64px -20px rgb(0 0 0 / .75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f0d; --surface: #161714; --surface-2: #1c1d1a; --surface-3: #262723; --border: #2a2b27; --border-strong: #3a3b36;
  --text: #efede7; --text-2: #c9c7bf; --muted: #93958c; --faint: #6c6e66;
  --brand: #efede7; --brand-2: #efede7; --brand-hover: #ffffff; --brand-soft: #24251f; --brand-ring: rgb(239 237 231 / .18); --on-brand: #121310;
  --accent: #ff6a4a; --accent-soft: #3a1d16;
  --ok: #5cc98a; --ok-soft: #142a1d; --warn: #e8b65a; --warn-soft: #2d2412; --danger: #ff7a62; --danger-soft: #3a1a15; --info: #6fb3e0; --info-soft: #132634;
  --bubble-in: #24251f; --grid-dot: #2a2b27;
  --shadow-xs: 0 1px 1px rgb(0 0 0 / .4); --shadow-sm: 0 1px 2px rgb(0 0 0 / .5); --shadow-md: 0 10px 24px -10px rgb(0 0 0 / .6); --shadow-lg: 0 32px 64px -20px rgb(0 0 0 / .75);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
a.btn, a.icon-btn, a.list-item, .nav a, a.l-link { text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.012em; }
h1 { font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
::selection { background: var(--brand-ring); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.sidebar-top { padding: 14px 12px 6px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-group { margin-top: 14px; }
.nav-group-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 0 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; margin-bottom: 1px; transition: background .12s, color .12s; }
.nav a svg { color: var(--muted); flex: none; transition: color .12s; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav a.active svg { color: var(--brand); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--accent); color: #fff; border-radius: 10px; padding: 1px 7px; min-width: 20px; text-align: center; }
.sidebar-bottom { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.content { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.main { flex: 1; overflow-y: auto; min-width: 0; min-height: 0; position: relative; }
.page { padding: 28px 32px 64px; max-width: 1200px; margin: 0 auto; animation: fade-in .18s ease-out; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 5px 0 0; color: var(--muted); }
.page-head .spacer { flex: 1; }
.mobile-bar { display: none; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Workspace солигч, хэрэглэгчийн цэс */
.ws-switch { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); border: 1px solid transparent; background: transparent; cursor: pointer; text-align: left; }
.ws-switch:hover { background: var(--surface-2); border-color: var(--border); }
.ws-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--on-brand); font-family: var(--serif); font-weight: 600; font-size: 16px; flex: none; background: var(--brand); }
.ws-meta { flex: 1; min-width: 0; }
.ws-meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.ws-meta small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r); cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; }
.user-chip:hover { background: var(--surface-2); }
.menu { position: fixed; z-index: 60; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; animation: pop .12s ease-out; }
.menu-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px 4px; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: transparent; border-radius: var(--r-sm); cursor: pointer; text-align: left; color: var(--text); font-weight: 500; }
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu .sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu .check { margin-left: auto; color: var(--brand); }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Товч, оролт ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border: 1px solid var(--border-strong); background: var(--surface); padding: 0 14px; border-radius: 10px; cursor: pointer; font-weight: 550; white-space: nowrap; box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s, box-shadow .12s, transform .05s; color: var(--text); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgb(0 0 0 / .18); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; flex: none; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; height: 38px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 10px; padding: 0 12px; outline: none; transition: border-color .12s, box-shadow .12s; box-shadow: var(--shadow-xs);
}
textarea { height: auto; padding: 9px 12px; resize: vertical; min-height: 80px; line-height: 1.5; }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7180' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
input[readonly] { background: var(--surface-2); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font-weight: 550; font-size: 13px; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon input { padding-left: 36px; }
.input-icon .pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.input-icon .pw-eye svg { position: static; transform: none; color: inherit; }
.input-icon:has(.pw-eye) input { padding-right: 40px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { min-width: 0; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.switch { position: relative; width: 36px; height: 20px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 20px; cursor: pointer; transition: .18s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: var(--surface); border-radius: 50%; transition: .18s; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px var(--brand-ring); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 550; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge.accent { background: var(--accent); color: #fff; border-color: transparent; }
.dot-status { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); }
.dot-status.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 6px 0 10px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 550; }
.chip.plain { padding-right: 10px; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; display: grid; opacity: .7; }
.chip button:hover { opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kbd { font-family: var(--font); font-size: 11px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--surface); }

/* ---------- Карт, хүснэгт ---------- */
.card-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-box.pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { flex: 1; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.stat .value { font-family: var(--serif); font-size: 34px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 6px; line-height: 1.1; }
.stat .sub { font-size: 12.5px; color: var(--muted); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 550; padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.tbl th:first-child { border-top-left-radius: var(--r-lg); }
.tbl th:last-child { border-top-right-radius: var(--r-lg); }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tbody tr { transition: background .1s; }
.tbl tr.click:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .empty-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--faint); border: 1px solid var(--border); }
.empty b { color: var(--text); font-size: 15px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 12px; cursor: pointer; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; transition: color .12s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--brand); border-color: var(--brand); }
.tabs button .badge { height: 19px; font-size: 11px; padding: 0 6px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; cursor: pointer; font-weight: 550; font-size: 13px; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); transition: background .1s; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
a.list-item { color: inherit; }
a.list-item:hover { text-decoration: none; }
.list-item .title { font-weight: 600; }
.list-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.chart { width: 100%; height: 220px; display: block; }
.chart text { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); margin-bottom: 18px; flex-wrap: wrap; font-weight: 500; }
.banner.info { background: var(--info-soft); color: var(--info); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.help { font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 11px 14px; margin-bottom: 16px; line-height: 1.55; }
.progress { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 6px; transition: width .4s; }
.checklist { display: flex; flex-direction: column; }
.check-item { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); }
.check-item .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; flex: none; color: #fff; }
.check-item.done .tick { background: var(--ok); border-color: var(--ok); }
.check-item.done .label { color: var(--muted); text-decoration: line-through; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Modal, toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgb(10 12 16 / .5); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .16s ease-out; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 16px 22px 8px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; }
#toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--surface); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); transition: opacity .3s, transform .3s; max-width: min(420px, 90vw); font-weight: 500; animation: slide-in .2s ease-out; }
.toast .t-ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok); color: #fff; }
.toast.err .t-ico { background: var(--danger); }
.toast.hide { opacity: 0; transform: translateY(6px); }
@keyframes slide-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Avatar, мессеж ---------- */
.avatar { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; flex: none; object-fit: cover; letter-spacing: 0; }
.bubble-row { display: flex; flex-direction: column; align-items: flex-start; margin: 4px 0; max-width: 100%; }
.bubble-row.out { align-items: flex-end; }
.bubble { background: var(--bubble-in); padding: 8px 13px; border-radius: 18px; max-width: 78%; white-space: pre-wrap; word-wrap: break-word; }
.bubble-row.out .bubble { background: var(--brand); color: var(--on-brand); }
.bubble-row.out.agent .bubble { background: #0f766e; }
.bubble.with-btns { padding: 0; overflow: hidden; background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border); min-width: 210px; box-shadow: var(--shadow-xs); }
.bubble.with-btns .bubble-text { padding: 10px 13px; white-space: pre-wrap; }
.card-btn { display: block; width: 100%; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--brand); padding: 9px; cursor: pointer; font-weight: 600; }
.card-btn:hover { background: var(--surface-2); }
.bubble-img { max-width: 220px; border-radius: 16px; border: 1px solid var(--border); }
.carousel { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
.carousel .card { flex: none; width: 214px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-xs); }
.carousel .card img { width: 100%; height: 112px; object-fit: cover; display: block; }
.carousel .card-body { padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; }
.carousel .card-body small { color: var(--muted); }
.bubble-note { align-self: center; font-size: 12px; color: var(--warn); background: var(--warn-soft); padding: 5px 11px; border-radius: 8px; margin: 8px auto; }
.bubble-err { font-size: 11.5px; color: var(--danger); margin-top: 3px; max-width: 78%; }
.bubble-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.quick-replies { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; padding: 6px 12px; }
.quick-replies:empty { display: none; }
.quick-replies button { border: 1px solid var(--brand); color: var(--brand); background: var(--surface); border-radius: 18px; padding: 5px 13px; cursor: pointer; font-weight: 550; }
.quick-replies button:hover { background: var(--brand-soft); }

/* ---------- Live чат ---------- */
.inbox { display: grid; grid-template-columns: 200px 320px minmax(0, 1fr); height: 100%; min-height: 0; }
.inbox > * { min-width: 0; }
.inbox .chat-side { display: none; }
@media (min-width: 1640px) {
  .inbox.has-chat { grid-template-columns: 210px 340px minmax(0, 1fr) 290px; }
  .inbox.has-chat .chat-side { display: block; }
}
.chat-head .grow > b, .chat-head .grow > div { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .grow > div { display: flex; }
.chat-head .btn { flex: none; }
.chat-head .assignee-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-nav { background: var(--surface-2); border-right: 1px solid var(--border); padding: 18px 10px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.ib-nav h2 { font-family: var(--serif); font-size: 22px; font-weight: 500; padding: 0 8px; }
.ib-folders { display: flex; flex-direction: column; gap: 1px; }
.ib-folder { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; padding: 7px 9px; border-radius: var(--r-sm); cursor: pointer; text-align: left; color: var(--text-2); font-weight: 500; }
.ib-folder svg { color: var(--muted); flex: none; }
.ib-folder:hover { background: var(--surface-3); color: var(--text); }
.ib-folder.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.ib-folder .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.inbox-list { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.inbox-list .head { padding: 14px 12px 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--border); }
.ib-toolbar { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.ib-toolbar select.sm { height: 30px; width: auto; padding: 0 28px 0 10px; font-size: 13px; border-radius: 8px; }
.ib-toolbar .btn.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.ib-check { width: 16px; height: 16px; margin: 0 4px; accent-color: var(--brand); cursor: pointer; flex: none; }
.ib-bulk { display: flex; align-items: center; gap: 6px; width: 100%; flex-wrap: wrap; }
.ib-bulk b { font-size: 13px; white-space: nowrap; }
.inbox-list .items { overflow-y: auto; flex: 1; padding: 6px; }
.conv { display: flex; gap: 11px; padding: 10px; cursor: pointer; border-radius: var(--r); align-items: flex-start; margin-bottom: 1px; transition: background .1s; position: relative; }
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--brand-soft); }
.conv.sel { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.conv-av { position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center; }
.conv-av .ib-check { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; opacity: 0; }
.conv:hover .conv-av .avatar, .conv.selecting .conv-av .avatar, .conv.sel .conv-av .avatar { opacity: 0; }
.conv:hover .conv-av .ib-check, .conv.selecting .conv-av .ib-check, .conv.sel .conv-av .ib-check { opacity: 1; }
.conv-tags { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.conv-tags .badge { height: 19px; font-size: 11px; padding: 0 6px; }
.conv-assignee { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.conv-assignee .avatar { font-size: 8px !important; }
.conv-star { color: var(--warn); display: inline-flex; }
.conv-star svg, .icon-btn.starred svg { fill: currentColor; }
.icon-btn.starred { color: var(--warn); }
.unread-dot { position: absolute; right: 12px; bottom: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chat-empty { margin: auto; max-width: 360px; text-align: center; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chat-empty h3 { font-family: var(--serif); font-size: 22px; font-weight: 500; margin-top: 16px; }
.chat-empty p { color: var(--muted); margin: 0 0 12px; line-height: 1.6; }
.chat-empty-art { width: 260px; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.chat-empty-art .mm.in { background: var(--bubble-in); color: var(--text); }
.chat-empty-art .mm.out { background: var(--brand); color: var(--on-brand); }
.ib-back { display: none; }
.conv .meta { flex: 1; min-width: 0; }
.conv .name { font-weight: 600; display: flex; justify-content: space-between; gap: 6px; }
.conv .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .name small { color: var(--faint); font-weight: 400; flex: none; font-size: 11.5px; }
.conv .preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread .preview { color: var(--text); font-weight: 600; }
.chat { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); min-height: 64px; }
.chat-msgs { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px 24px; }
.chat-compose { border-top: 1px solid var(--border); background: var(--surface); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-compose textarea { min-height: 46px; max-height: 160px; border-radius: 12px; }
.chat-side { border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 22px 18px; }
.chat-side section { margin-bottom: 22px; }
.chat-side h4 { margin: 0 0 9px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- Симулятор ---------- */
.sim { position: fixed; right: 22px; bottom: 22px; width: 370px; height: min(660px, calc(100vh - 44px)); background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40; overflow: hidden; animation: pop .16s ease-out; }
.sim-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.sim-msgs { flex: 1; overflow-y: auto; padding: 14px; background: var(--bg); }
.sim-foot { border-top: 1px solid var(--border); padding: 10px; display: flex; gap: 6px; align-items: center; }
.sim-foot input { border-radius: 20px; }
.sim-tools { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.sim-menu { border-top: 1px solid var(--border); background: var(--surface-2); max-height: 200px; overflow-y: auto; }
.sim-menu button { display: block; width: 100%; text-align: left; padding: 10px 16px; border: 0; background: transparent; cursor: pointer; border-bottom: 1px solid var(--border); }
.sim-menu button:hover { background: var(--surface); }

/* ---------- Flow builder ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 370px; height: 100%; min-height: 0; }
.builder-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.builder-bar { display: flex; gap: 8px; align-items: center; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.builder-bar input.name { max-width: 300px; font-weight: 600; border-color: transparent; box-shadow: none; background: transparent; font-size: 15px; }
.builder-bar input.name:hover { border-color: var(--border); }
.builder-bar input.name:focus { border-color: var(--brand); background: var(--surface); }
.canvas-wrap { position: relative; flex: 1; overflow: hidden; background-color: var(--bg); background-image: radial-gradient(var(--grid-dot) 1.3px, transparent 1.3px); background-size: 22px 22px; cursor: grab; touch-action: none; }
.canvas-wrap.panning { cursor: grabbing; }
.canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: 1px; height: 1px; }
.canvas svg.links { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; width: 1px; height: 1px; }
.canvas svg path { fill: none; stroke: var(--faint); stroke-width: 2; }
.canvas svg path.temp { stroke: var(--brand); stroke-dasharray: 6 4; }
.node { position: absolute; width: 256px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-md); cursor: default; user-select: none; transition: border-color .12s, box-shadow .12s; }
.node:hover { border-color: var(--border-strong); }
.node.selected { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring), var(--shadow-md); }
.node.drop { border-color: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.node-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: move; border-radius: 14px 14px 0 0; }
.node-head .dot { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; color: #fff; }
.node-head b { flex: 1; font-size: 13px; }
.node-head .start { font-size: 10.5px; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 6px; padding: 1px 7px; letter-spacing: .03em; }
.node-body { padding: 10px 12px; font-size: 13px; color: var(--text-2); white-space: pre-wrap; max-height: 120px; overflow: hidden; word-break: break-word; }
.node-in { position: absolute; left: -7px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--faint); }
.ports { border-top: 1px solid var(--border); }
.port { position: relative; display: flex; align-items: center; justify-content: flex-end; padding: 7px 22px 7px 12px; font-size: 12.5px; color: var(--text-2); border-bottom: 1px solid var(--border); gap: 6px; }
.port:last-child { border-bottom: 0; }
.port span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port .out { position: absolute; right: -8px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); cursor: crosshair; transition: transform .1s; }
.port .out.linked { background: var(--brand); }
.port .out:hover { transform: translateY(-50%) scale(1.3); }
.zoom-ctl { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 2px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; box-shadow: var(--shadow-md); }
.palette { position: absolute; left: 16px; top: 16px; display: flex; flex-direction: column; gap: 1px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-md); max-height: calc(100% - 90px); overflow-y: auto; width: 196px; }
.palette .p-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 6px 8px 4px; }
.palette button { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 6px 8px; border-radius: 9px; cursor: pointer; font-size: 13px; text-align: left; white-space: nowrap; font-weight: 500; }
.palette button:hover { background: var(--surface-2); }
.palette .dot { width: 24px; height: 24px; border-radius: 7px; flex: none; display: grid; place-items: center; color: #fff; }
.inspector { border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 20px; }
.inspector h3 { margin-bottom: 4px; }
.sub-box { border: 1px solid var(--border); border-radius: var(--r); padding: 12px; margin-bottom: 10px; background: var(--surface-2); }
.sub-box .row { margin-bottom: 8px; }
.sub-box .row:last-child { margin-bottom: 0; }

/* ---------- Брэнд тэмдэг ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.wordmark svg { flex: none; }
.serif { font-family: var(--serif); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- Нэвтрэх хуудсууд ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); }
.auth-art { position: relative; overflow: hidden; background: #121310; color: #efede7; padding: 40px 48px; display: flex; flex-direction: column; }
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgb(255 255 255 / .045) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .045) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 30% 60%, #000 20%, transparent 75%); pointer-events: none; }
.auth-art > * { position: relative; }
.auth-art .wordmark, .lp-cta { --brand: #efede7; --on-brand: #121310; }
.auth-art .wordmark { color: #efede7; }
.auth-copy { margin-top: auto; max-width: 470px; }
.auth-copy h2 { font-family: var(--serif); font-size: 40px; line-height: 1.08; font-weight: 500; letter-spacing: -.03em; margin-bottom: 16px; }
.auth-copy h2 em { font-style: italic; color: #ff8a70; }
.auth-copy p { font-size: 15.5px; color: #a9a79f; line-height: 1.65; margin: 0 0 32px; }
.auth-card { background: #1b1c19; border: 1px solid #2c2d29; border-radius: 16px; padding: 16px; max-width: 380px; display: flex; flex-direction: column; gap: 8px; }
.auth-card .meta { display: flex; justify-content: space-between; font-size: 12px; color: #8b8981; padding-bottom: 6px; border-bottom: 1px solid #2c2d29; margin-bottom: 4px; }
.auth-foot { margin-top: 32px; font-size: 12.5px; color: #77756d; display: flex; gap: 16px; flex-wrap: wrap; }
.auth-foot a { color: inherit; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form { width: 100%; max-width: 380px; animation: fade-in .2s ease-out; }
.auth-form h1 { font-size: 34px; font-weight: 500; letter-spacing: -.03em; margin-bottom: 8px; }
.auth-form .lead { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
.auth-form .alt { text-align: center; color: var(--muted); margin-top: 22px; }
.pw-meter { display: flex; gap: 4px; margin-top: 2px; }
.pw-meter i { flex: 1; height: 3px; border-radius: 3px; background: var(--surface-3); transition: background .2s; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; font-weight: 500; }
.form-ok { background: var(--ok-soft); color: var(--ok); padding: 12px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; font-weight: 500; }
.mobile-brand { display: none; }

/* Messenger-ийн мессежийн жижиг дүрслэл (нүүр, нэвтрэх хуудсанд) */
.mm { padding: 8px 12px; border-radius: 16px; max-width: 86%; font-size: 13.5px; line-height: 1.45; }
.mm.in { background: #2a2b27; color: #efede7; align-self: flex-start; border-bottom-left-radius: 5px; }
.mm.out { background: #efede7; color: #121310; align-self: flex-end; border-bottom-right-radius: 5px; }
.mm-qr { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.mm-qr span { border: 1px solid #55564f; border-radius: 14px; padding: 3px 10px; font-size: 12px; color: #d6d4cc; }
.mm-inv { align-self: flex-end; width: 78%; background: #efede7; color: #121310; border-radius: 14px; overflow: hidden; font-size: 13px; }
.mm-inv .row1 { display: flex; justify-content: space-between; padding: 10px 12px 2px; color: #6c6e66; font-size: 12px; }
.mm-inv .amt { padding: 0 12px 10px; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.mm-inv .paid { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid #dddbd3; color: #1f7a46; font-weight: 600; }

/* ---------- Нүүр (landing) ---------- */
.lp { min-height: 100vh; background: var(--bg); color: var(--text); }
.lp .av { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 12px; flex: none; }
.lp-wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.lp-nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.lp-nav.scrolled { border-bottom-color: var(--border); }
.lp-nav .lp-wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.lp-links { display: flex; gap: 24px; font-size: 14px; }
.lp-links a { color: var(--muted); text-decoration: none; }
.lp-links a:hover { color: var(--text); }
.lp-nav .grow { flex: 1; }

.lp-hero { padding: 84px 0 48px; }
.lp-hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 48px; align-items: end; }
.lp-hero h1 { font-size: clamp(44px, 6.4vw, 82px); line-height: 1.0; font-weight: 500; letter-spacing: -.04em; margin: 18px 0 0; }
.lp-hero h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
.lp-hero-side p { font-size: 17px; line-height: 1.6; color: var(--text-2); margin: 0 0 24px; }
.lp-hero-side .cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.lp-hero-side .note { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* Бүтээгдэхүүний дэлгэцийн дүрслэл */
.shot { margin-top: 56px; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.shot-bar { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.shot-bar .dots { display: flex; gap: 6px; }
.shot-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.shot-bar .url { flex: 1; max-width: 360px; margin: 0 auto; height: 24px; border-radius: 7px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--muted); display: grid; place-items: center; }
.shot-body { display: grid; grid-template-columns: 200px 250px minmax(0, 1fr) 260px; min-height: 470px; font-size: 13px; }
.shot-body > * { min-width: 0; }
.s-side { border-right: 1px solid var(--border); padding: 14px 10px; background: var(--surface); }
.s-side .ws { display: flex; gap: 8px; align-items: center; padding: 4px 6px 14px; font-weight: 600; }
.s-side .ws b { width: 24px; height: 24px; border-radius: 7px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-family: var(--serif); font-size: 13px; }
.s-side .it { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; color: var(--text-2); }
.s-side .it svg { color: var(--muted); }
.s-side .it.on { background: var(--brand-soft); color: var(--text); font-weight: 500; }
.s-side .it .n { margin-left: auto; font-size: 11px; background: var(--accent); color: #fff; border-radius: 9px; padding: 0 6px; }
.s-list { border-right: 1px solid var(--border); padding: 12px 8px; background: var(--surface); }
.s-list .h { font-weight: 600; padding: 2px 8px 10px; }
.s-conv { display: flex; gap: 9px; align-items: center; padding: 8px; border-radius: 9px; }
.s-conv.on { background: var(--surface-2); }
.s-conv .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; flex: none; }
.s-conv .t { min-width: 0; flex: 1; }
.s-conv .t b { display: flex; justify-content: space-between; font-weight: 600; font-size: 12.5px; }
.s-conv .t b small { color: var(--faint); font-weight: 400; }
.s-conv .t span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-chat { display: flex; flex-direction: column; background: var(--bg); }
.s-chat .top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.s-chat .top .tag { margin-left: auto; font-size: 11.5px; border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; color: var(--muted); }
.s-msgs { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 7px; }
.s-msgs .b { padding: 7px 11px; border-radius: 15px; max-width: 74%; line-height: 1.4; }
.s-msgs .b.in { background: var(--bubble-in); align-self: flex-start; border-bottom-left-radius: 4px; }
.s-msgs .b.out { background: var(--brand); color: var(--on-brand); align-self: flex-end; border-bottom-right-radius: 4px; }
.s-msgs .b.agent { background: var(--surface); border: 1px solid var(--border); color: var(--text); align-self: flex-end; }
.s-msgs .who { align-self: flex-end; font-size: 11px; color: var(--muted); margin-top: -3px; }
.s-msgs .qr { display: flex; gap: 6px; justify-content: flex-end; }
.s-msgs .qr span { border: 1px solid var(--text); border-radius: 13px; padding: 2px 10px; font-size: 12px; }
.s-msgs .sys { align-self: center; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.s-msgs .sys::before, .s-msgs .sys::after { content: ""; width: 40px; height: 1px; background: var(--border-strong); }
.s-inv { align-self: flex-end; width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.s-inv .r { display: flex; justify-content: space-between; padding: 9px 12px 0; font-size: 11.5px; color: var(--muted); }
.s-inv .a { padding: 2px 12px 9px; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.s-inv .p { padding: 7px 12px; border-top: 1px solid var(--border); color: var(--ok); font-weight: 600; font-size: 12px; display: flex; gap: 6px; align-items: center; }
.s-compose { margin: 0 12px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 9px 12px; color: var(--faint); display: flex; justify-content: space-between; }
.s-compose b { color: var(--on-brand); background: var(--brand); border-radius: 6px; padding: 1px 9px; font-weight: 500; font-size: 12px; }
.s-right { border-left: 1px solid var(--border); background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.s-right h5 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.s-right .chips { gap: 5px; }
.s-right .chips span { font-size: 11.5px; border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; color: var(--text-2); }
.s-right dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; margin: 0; font-size: 12px; }
.s-right dt { color: var(--muted); }
.s-right dd { margin: 0; text-align: right; }
.s-flow { position: relative; height: 150px; border: 1px dashed var(--border-strong); border-radius: 10px; background-color: var(--bg); background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px); background-size: 14px 14px; }
.s-flow .nd { position: absolute; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 5px 8px; font-size: 11px; box-shadow: var(--shadow-xs); display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.s-flow .nd i { width: 7px; height: 7px; border-radius: 2px; background: var(--text); }
.s-flow .nd.acc i { background: var(--accent); }
.s-flow svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.s-flow path { fill: none; stroke: var(--faint); stroke-width: 1.3; }

/* Боломжууд (bento) */
.lp-sec { padding: 96px 0 0; }
.lp-sec-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 48px; align-items: end; margin-bottom: 40px; }
.lp-sec-head h2 { font-family: var(--serif); font-size: clamp(32px, 4vw, 48px); font-weight: 500; letter-spacing: -.035em; line-height: 1.05; margin-top: 14px; }
.lp-sec-head p { color: var(--text-2); font-size: 16px; line-height: 1.6; margin: 0; }
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.bx { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.bx .no { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.bx h3 { font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -.02em; margin-top: 2px; }
.bx p { margin: 0; color: var(--muted); line-height: 1.55; max-width: 46ch; }
.bx .vis { margin-top: 18px; flex: 1; min-height: 170px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 8px; justify-content: center; position: relative; overflow: hidden; }
.span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; } .span-2 { grid-column: span 2; }
.v-post { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.v-post .h { display: flex; gap: 9px; align-items: center; margin-bottom: 8px; }
.v-post .h b { font-size: 13px; }
.v-post .h small { color: var(--muted); display: block; font-size: 11.5px; }
.v-post .ph { height: 54px; border-radius: 8px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--surface-3) 10px 20px); margin-bottom: 10px; }
.v-cmt { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.v-cmt .av { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 10px; color: #fff; font-weight: 600; }
.v-cmt .tx { background: var(--surface-2); border-radius: 12px; padding: 6px 10px; font-size: 12.5px; }
.v-cmt .tx b { display: block; font-size: 12px; }
.v-cmt.reply { margin-left: 32px; }
.v-dm { position: absolute; right: 16px; bottom: 16px; width: 210px; background: var(--brand); color: var(--on-brand); border-radius: 14px 14px 4px 14px; padding: 10px 12px; font-size: 12.5px; box-shadow: var(--shadow-md); }
.v-dm small { display: block; opacity: .65; font-size: 11px; margin-bottom: 3px; }
.v-qr { display: grid; grid-template-columns: repeat(13, 1fr); gap: 2px; width: 104px; aspect-ratio: 1; padding: 6px; background: var(--surface); border-radius: 8px; border: 1px solid var(--border); }
.v-qr i { background: var(--text); border-radius: 1px; }
.v-qr i.o { background: transparent; }
.v-pay { display: flex; gap: 14px; align-items: center; }
.v-pay .amt { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.v-pay small { color: var(--muted); display: block; }
.v-steps { display: flex; flex-direction: column; gap: 0; }
.v-step { display: grid; grid-template-columns: 64px 14px 1fr; gap: 10px; align-items: center; font-size: 13px; padding: 7px 0; }
.v-step .d { color: var(--muted); font-size: 12px; text-align: right; }
.v-step .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--text); background: var(--surface); position: relative; }
.v-step .dot.on { background: var(--accent); border-color: var(--accent); }
.v-step .m { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px; }
.v-roles { display: flex; flex-direction: column; gap: 6px; }
.v-role { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.v-role .av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; }
.v-role span { margin-left: auto; font-size: 11.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 7px; }
.v-hand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.v-hand .p { text-align: center; font-size: 12px; color: var(--muted); }
.v-hand .p b { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.v-hand .ln { flex: 0 1 80px; height: 1px; background: repeating-linear-gradient(90deg, var(--text) 0 4px, transparent 4px 8px); position: relative; }
.v-hand .ln::after { content: ""; position: absolute; right: -2px; top: -3px; border: 3.5px solid transparent; border-left: 6px solid var(--text); }

/* Хэрхэн ажилладаг */
.lp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--border-strong); }
.lp-step { padding: 28px 28px 0 0; }
.lp-step + .lp-step { padding-left: 28px; border-left: 1px solid var(--border); }
.lp-step .n { font-family: var(--serif); font-size: 44px; font-weight: 400; color: var(--faint); line-height: 1; }
.lp-step h3 { font-size: 17px; margin: 18px 0 6px; }
.lp-step p { margin: 0; color: var(--muted); line-height: 1.6; }

/* FAQ */
.faq { border-top: 1px solid var(--border-strong); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; padding: 20px 0; font-size: 16.5px; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--serif); font-size: 24px; line-height: 1; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: -6px 0 22px; color: var(--text-2); line-height: 1.65; max-width: 70ch; }

/* Төгсгөлийн CTA, footer */
.lp-cta { margin: 112px 0 0; background: #121310; color: #efede7; border-radius: 22px; padding: 64px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; position: relative; overflow: hidden; }
.lp-cta::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgb(255 255 255 / .04) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .04) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(90deg, transparent, #000); }
.lp-cta > * { position: relative; }
.lp-cta h2 { font-family: var(--serif); font-size: clamp(32px, 4.4vw, 54px); font-weight: 500; letter-spacing: -.035em; line-height: 1.04; }
.lp-cta h2 em { font-style: italic; color: #ff8a70; font-weight: 400; }
.lp-cta p { color: #a9a79f; margin: 14px 0 0; font-size: 16px; }
.lp-cta .btn { background: #efede7; color: #121310; border-color: #efede7; }
.lp-cta .btn:hover { background: #fff; }
.lp-foot { margin-top: 72px; border-top: 1px solid var(--border); padding: 40px 0 48px; display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; font-size: 14px; }
.lp-foot h6 { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.lp-foot a { display: block; color: var(--text-2); text-decoration: none; margin-bottom: 8px; }
.lp-foot a:hover { color: var(--text); }
.lp-foot p { color: var(--muted); margin: 12px 0 0; max-width: 36ch; line-height: 1.6; }
.lp-copy { color: var(--faint); font-size: 13px; padding-bottom: 32px; }

@media (max-width: 1180px) {
  .inbox { grid-template-columns: 190px 310px minmax(0, 1fr); }
  .chat-side { display: none; }
  .builder { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .mobile-brand { display: flex; margin-bottom: 28px; }
  .inbox { grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .ib-nav { grid-column: 1; grid-row: 1; flex-direction: row; align-items: center; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow-x: auto; }
  .ib-nav h2 { display: none; }
  .ib-folders { flex-direction: row; }
  .ib-folder { white-space: nowrap; }
  .inbox-list { grid-column: 1; grid-row: 2; }
  .chat { grid-column: 2; grid-row: 1 / span 2; }
  .lp-links { display: none; }
  .lp-hero { padding-top: 48px; }
  .lp-hero-grid, .lp-sec-head { grid-template-columns: 1fr; gap: 24px; }
  .shot-body { grid-template-columns: 220px minmax(0, 1fr); }
  .s-side, .s-right { display: none; }
  .bento { grid-template-columns: 1fr; }
  .span-4, .span-3, .span-2 { grid-column: auto; }
  .lp-steps { grid-template-columns: 1fr; }
  .lp-step, .lp-step + .lp-step { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--border); }
  .lp-cta { grid-template-columns: 1fr; padding: 40px 28px; }
  .lp-foot { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 45; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .mobile-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
  .page { padding: 18px 16px 90px; }
  .grid.two { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .inbox.has-chat { grid-template-rows: minmax(0, 1fr); }
  .inbox.has-chat .inbox-list, .inbox.has-chat .ib-nav { display: none; }
  .inbox:not(.has-chat) .chat { display: none; }
  .ib-back { display: inline-grid; }
  .ib-nav, .inbox-list { border-right: 0; }
  .chat { grid-column: 1; grid-row: 1 / -1; }
  .chat-head { flex-wrap: wrap; padding: 10px 12px; }
  .builder { grid-template-columns: 1fr; }
  .inspector { position: fixed; inset: auto 0 0 0; max-height: 55vh; z-index: 30; border-left: 0; border-top: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 20px 20px 0 0; }
  .sim { right: 8px; left: 8px; bottom: 8px; width: auto; }
  .palette { flex-direction: row; width: auto; max-width: calc(100% - 32px); overflow-x: auto; }
  .palette .p-label { display: none; }
  .lp-wrap { padding: 0 18px; }
  .lp-nav .btn.ghost { display: none; }
  .shot-body { grid-template-columns: 1fr; min-height: 0; }
  .s-list { display: none; }
  .lp-sec { padding-top: 72px; }
  .lp-cta { margin-top: 72px; }
  #toasts { left: 16px; right: 16px; bottom: 16px; }
}
