:root {
  --bg: #f6f7fb; --surface: #fff; --surface-2: #f1f2f8; --border: #e5e7f0; --text: #161a2e; --muted: #6b7090; --faint: #9aa0bd;
  --primary: #5b3df5; --primary-2: #7a5cff; --primary-soft: #efebff; --primary-ink: #fff;
  --green: #12b76a; --green-soft: #e3f8ee; --red: #e5484d; --red-soft: #fdecec; --amber: #f59e0b; --amber-soft: #fff5e0; --blue: #2b8cff; --blue-soft: #e6f1ff;
  --shadow: 0 1px 2px rgba(20, 22, 50, .05), 0 4px 16px rgba(20, 22, 50, .06); --shadow-lg: 0 20px 60px rgba(20, 22, 50, .18);
  --r: 14px; --r-sm: 10px; --side: 248px;
  --tg-bg: #dfe8f1; --tg-in: #fff; --tg-out: #e2ffc7;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1020; --surface: #161a2e; --surface-2: #1d2238; --border: #2a3050; --text: #eef0fb; --muted: #a0a6c6; --faint: #6c7398;
    --primary: #7c62ff; --primary-2: #9a85ff; --primary-soft: #262046; --green-soft: #11342a; --red-soft: #3a1c22; --amber-soft: #3a2e12; --blue-soft: #14294a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --tg-bg: #0f1724; --tg-in: #1e2c3a; --tg-out: #2b5278; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1020; --surface: #161a2e; --surface-2: #1d2238; --border: #2a3050; --text: #eef0fb; --muted: #a0a6c6; --faint: #6c7398;
  --primary: #7c62ff; --primary-2: #9a85ff; --primary-soft: #262046; --green-soft: #11342a; --red-soft: #3a1c22; --amber-soft: #3a2e12; --blue-soft: #14294a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --tg-bg: #0f1724; --tg-in: #1e2c3a; --tg-out: #2b5278; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; } h2 { font-size: 20px; font-weight: 800; } h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--primary-soft); }

/* ── Layout ── */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; padding: 4px 8px 14px; color: var(--text); }
.logo-img { width: 32px; height: 32px; border-radius: 9px; flex: none; box-shadow: 0 4px 14px rgba(91,61,245,.28); }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), #b05cff); display: grid; place-items: center; color: #fff; font-size: 18px; box-shadow: 0 6px 16px rgba(91,61,245,.35); }
.nav-a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14.5px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.nav-a:hover { background: var(--surface-2); color: var(--text); }
.nav-a.on { background: var(--primary-soft); color: var(--primary); }
.nav-a .ico { width: 19px; height: 19px; opacity: .85; }
.nav-a.on .ico { opacity: 1; }
.nav-a .cnt { background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 6px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; padding: 8px 12px 4px; }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.page { padding: 26px 28px 80px; max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.mob-nav { display: none; }

/* bot switcher */
.botsw { position: relative; }
.botsw-btn { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--surface); padding: 6px 12px 6px 6px; border-radius: 12px; cursor: pointer; font-weight: 700; max-width: 280px; }
.ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex: none; background: linear-gradient(135deg, #5b3df5, #2b8cff); }
.ava.lg { width: 44px; height: 44px; font-size: 17px; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.menu-i { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; width: 100%; border: 0; background: none; text-align: left; }
.menu-i:hover { background: var(--surface-2); }

/* ── Ikonkalar ── */
.i { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.2em; }
.btn .i { width: 17px; height: 17px; margin-left: -2px; }
.btn.sm .i { width: 15px; height: 15px; }
.btn.icon .i { width: 18px; height: 18px; margin: 0; }
.ok-ic { color: var(--primary); }
.menu-plus { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.ava-btn { border: 0; padding: 0; width: auto; height: auto; background: none !important; }
.plan-mini { padding: 14px; border-radius: var(--r); background: var(--surface-2); }
.ico-chip { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.ico-chip .i { width: 18px; height: 18px; }
.ico-chip.green { background: var(--green-soft); color: var(--green); } .ico-chip.amber { background: var(--amber-soft); color: #b06d00; } .ico-chip.blue { background: var(--blue-soft); color: var(--blue); } .ico-chip.red { background: var(--red-soft); color: var(--red); } .ico-chip.gray { background: var(--surface-2); color: var(--muted); }
.ico-chip.lg { width: 44px; height: 44px; border-radius: 13px; } .ico-chip.lg .i { width: 22px; height: 22px; }

/* ── Components ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; } .muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; } .bold { font-weight: 700; } .center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent; font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; transition: transform .06s, background .15s, box-shadow .15s; background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); box-shadow: 0 6px 18px rgba(91,61,245,.28); }
.btn.primary:hover { box-shadow: 0 8px 24px rgba(91,61,245,.38); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.green { background: var(--green); color: #fff; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 13px; }
.btn.icon { width: 36px; padding: 0; height: 36px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; font-weight: 700; padding: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-weight: 700; font-size: 13.5px; }
.hint { font-size: 12.5px; color: var(--muted); }
.inp, .ta, .sel { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 11px; padding: 10px 12px; outline: none; transition: border .15s, box-shadow .15s; }
.inp:focus, .ta:focus, .sel:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.ta { resize: vertical; min-height: 90px; line-height: 1.5; }
.inp.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13.5px; }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); } .badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: #b06d00; } .badge.blue { background: var(--blue-soft); color: var(--blue); } .badge.violet { background: var(--primary-soft); color: var(--primary); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; font-size: 14px; line-height: 1; }

.stat { padding: 18px 20px; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.stat .k { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .d { font-size: 12.5px; margin-top: 2px; }

.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; width: fit-content; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--muted); font-size: 14px; }
.tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.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 tr.click:hover td { background: var(--surface-2); }
.tbl-wrap { overflow-x: auto; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-ic { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty-ic .i { width: 28px; height: 28px; }
.empty p { max-width: 420px; margin: 0 auto; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 99px; transition: width .4s; }
.progress.warn > i { background: linear-gradient(90deg, var(--amber), var(--red)); }

.spin { width: 22px; height: 22px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px; }

/* modal & toast */
.overlay { position: fixed; inset: 0; background: rgba(12, 14, 30, .45); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; animation: pop .18s; }
.modal.wide { max-width: 760px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-b { padding: 18px 22px 22px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1c1f35; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop .2s; max-width: 90vw; }
.toast.err { background: var(--red); } .toast.ok { background: #0f9d5c; }

/* ── Auth ── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-l { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(20px, 6vw, 90px); }
.auth-r { background: radial-gradient(1200px 600px at 20% 10%, #8a6bff 0%, #5b3df5 40%, #2a1b8f 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 22px; position: relative; overflow: hidden; }
.auth-r h2 { font-size: 34px; line-height: 1.15; }
.auth-list { padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-list li { list-style: none; display: flex; align-items: center; gap: 12px; font-size: 16px; }
.auth-list li .i { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.14); }
.auth-mark { width: 64px; height: 64px; border-radius: 18px; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.auth-mark .i { width: 34px; height: 34px; }
.auth-box { max-width: 400px; width: 100%; }
.tg-btn { background: #229ed9; color: #fff; box-shadow: 0 6px 18px rgba(34,158,217,.35); }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Onboarding ── */
.steps { display: flex; gap: 8px; margin-bottom: 26px; }
.steps i { flex: 1; height: 5px; border-radius: 99px; background: var(--border); }
.steps i.on { background: var(--primary); }
.tpl { padding: 16px; border: 2px solid var(--border); border-radius: 14px; cursor: pointer; background: var(--surface); text-align: left; transition: .15s; }
.tpl:hover { border-color: var(--primary-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.tpl.on { border-color: var(--primary); background: var(--primary-soft); }
.tpl .ico-chip { margin-bottom: 4px; }
.howto { counter-reset: s; display: flex; flex-direction: column; gap: 12px; }
.howto li { list-style: none; position: relative; padding-left: 40px; }
.howto li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.success-burst { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 24px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); animation: pop .4s; }
.success-burst .i { width: 42px; height: 42px; }

/* ── Flow builder ── */
.builder { display: grid; grid-template-columns: 240px minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.grid.fit { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.flist { display: flex; flex-direction: column; gap: 6px; }
.fitem { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; cursor: pointer; border: 1px solid transparent; background: var(--surface); }
.fitem:hover { border-color: var(--border); }
.fitem.on { border-color: var(--primary); background: var(--primary-soft); }
.fitem .tr { font-size: 11.5px; color: var(--muted); }
.step { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); margin-bottom: 10px; position: relative; }
.step-h { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.step-h .ico-chip { width: 32px; height: 32px; }
.step-actions .i { width: 15px; height: 15px; display: block; }
.add-step .ico-chip { width: 28px; height: 28px; border-radius: 8px; } .add-step .ico-chip .i { width: 15px; height: 15px; }
.sys { display: inline-flex; align-items: center; gap: 5px; } .sys .i { width: 12px; height: 12px; }
.phone-in .i { width: 20px; height: 20px; align-self: center; }
.step-b { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.step-actions { margin-left: auto; display: flex; gap: 2px; }
.step-actions button { border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 7px; color: var(--muted); font-size: 14px; }
.step-actions button:hover { background: var(--surface-2); color: var(--text); }
.connector { display: flex; justify-content: center; margin: -4px 0 6px; }
.add-step { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.add-step button { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px dashed var(--border); border-radius: 11px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13.5px; text-align: left; }
.add-step button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.add-step button:hover .ico-chip { background: var(--surface); }
.btn-row { display: flex; gap: 6px; align-items: center; }

/* phone preview */
.phone { position: sticky; top: 84px; border-radius: 30px; border: 8px solid #1c1f35; background: var(--tg-bg); height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
.phone-top { background: #517da2; color: #fff; padding: 10px 14px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
:root[data-theme="dark"] .phone-top { background: #17212b; }
.phone-body { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 6px; background-image: radial-gradient(rgba(255,255,255,.25) 1px, transparent 1px); background-size: 18px 18px; }
.bub { max-width: 85%; padding: 7px 10px 8px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.bub.in { background: var(--tg-in); align-self: flex-start; border-bottom-left-radius: 4px; }
.bub.out { background: var(--tg-out); align-self: flex-end; border-bottom-right-radius: 4px; }
.bub img { display: block; max-width: 100%; border-radius: 10px; margin: -3px -6px 6px; width: calc(100% + 12px); max-width: none; }
.bub a { color: #2b8cff; }
.ikb { display: flex; flex-direction: column; gap: 4px; align-self: flex-start; width: 85%; }
.ikb button { background: rgba(80, 110, 140, .55); color: #fff; border: 0; border-radius: 9px; padding: 7px; font-size: 13px; font-weight: 600; cursor: pointer; }
.rkb { background: var(--tg-in); padding: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; border-top: 1px solid rgba(0,0,0,.08); }
.rkb button { background: var(--surface); border: 0; border-radius: 8px; padding: 9px 4px; font-size: 12.5px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,.1); color: var(--text); }
.phone-in { display: flex; gap: 6px; padding: 8px; background: var(--tg-in); }
.phone-in input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14px; }
.sys { align-self: center; background: rgba(0,0,0,.25); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 99px; }

/* ── Inbox ── */
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr); height: calc(100vh - 61px); }
.inbox:has(.ib-side) { grid-template-columns: 330px minmax(0, 1fr) 280px; }
.ib-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface); }
.ib-item { display: flex; gap: 11px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.ib-item:hover { background: var(--surface-2); }
.ib-item.on { background: var(--primary-soft); }
.ib-chat { display: flex; flex-direction: column; min-width: 0; background: var(--tg-bg); }
.ib-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.ib-msgs .bub { max-width: 70%; font-size: 14.5px; }
.ib-msgs .bub .t { font-size: 11px; color: var(--faint); text-align: right; margin-top: 2px; }
.ib-compose { display: flex; gap: 8px; padding: 12px; background: var(--surface); border-top: 1px solid var(--border); align-items: flex-end; }
.ib-compose textarea { flex: 1; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; resize: none; max-height: 140px; outline: none; background: var(--surface); }
.ib-side { border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 18px; }
.ib-head { padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; }

/* qidiruv maydoni */
.search { position: relative; display: flex; align-items: center; }
.search > .i { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.search > .inp { padding-left: 38px; }
.ib-msgs .bub .t { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.ib-msgs .bub .t .i { width: 12px; height: 12px; }

/* reyting */
.rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; margin-right: 10px; font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.rank.r1 { background: #fff1c2; color: #a26b00; } .rank.r2 { background: #eceff4; color: #5b6476; } .rank.r3 { background: #fbe3d2; color: #a2541c; }
.ribbon { box-shadow: 0 6px 16px rgba(91,61,245,.3); }

/* dashboard */
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.checklist { display: flex; flex-direction: column; gap: 14px; }
.chk { display: flex; align-items: flex-start; gap: 12px; }
.chk-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; flex: none; margin-top: 1px; color: #fff; }
.chk-mark .i { width: 13px; height: 13px; stroke-width: 3; }
.chk.done .chk-mark { background: var(--green); border-color: var(--green); }
.chk.done .bold { color: var(--faint); text-decoration: line-through; }
.chk-act { flex: none; }
.badge .i { width: 13px; height: 13px; }
.card-h h3 .i, h3.row .i { width: 18px; height: 18px; }
.link.row { gap: 4px; } .link .i { width: 15px; height: 15px; }
.stat .row .ico-chip { margin: -4px -4px 0 0; }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; }
.bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bars > div > i { display: block; background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-radius: 4px 4px 2px 2px; min-height: 2px; }
.bars > div:hover > i { opacity: .8; }
.bars > div > i.z { background: var(--surface-2); }
.bars > div > span { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: #1c1f35; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 6px; white-space: nowrap; display: none; z-index: 3; }
.bars > div:hover > span { display: block; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.plan { padding: 22px; border-radius: 18px; border: 2px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 12px; position: relative; }
.plan.pop { border-color: var(--primary); box-shadow: 0 12px 40px rgba(91,61,245,.18); }
.plan.cur { border-color: var(--green); }
.plan .price { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.plan ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.plan li { display: flex; gap: 9px; align-items: flex-start; }
.plan li::before { content: ''; flex: none; width: 16px; height: 16px; margin-top: 3px; background: var(--green); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat; }
.plan li.no { color: var(--faint); } .plan li.no::before { background: var(--faint); -webkit-mask: none; mask: none; height: 2px; width: 10px; margin: 11px 3px 0; border-radius: 2px; }
.ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 12px; border-radius: 99px; white-space: nowrap; }

.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); }
.banner.amber { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.banner.green { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.banner .e { font-size: 24px; }
.banner > .bi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--primary); }
.banner.amber > .bi { color: #b06d00; } .banner.green > .bi { color: var(--green); }
.banner > .bi .i { width: 19px; height: 19px; }
.copybox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 11px; padding: 6px 6px 6px 12px; }
.copybox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.kbd { font-family: ui-monospace, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

@media (max-width: 1380px) {
  .builder { grid-template-columns: 240px minmax(0, 1fr); }
  .builder .phone-col { display: none; }
}
@media (max-width: 1200px) {
  .inbox, .inbox:has(.ib-side) { grid-template-columns: 300px minmax(0, 1fr); }
  .ib-side { display: none; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mob-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .mob-nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 8px; position: relative; }
  .mob-nav button.on { color: var(--primary); }
  .mob-nav .ico { width: 22px; height: 22px; }
  .mob-nav .cnt { position: absolute; top: 0; right: 4px; background: var(--red); color: #fff; border-radius: 99px; font-size: 10px; padding: 0 5px; }
  .top { padding: 10px 16px; }
  .page { padding: 18px 16px 100px; }
  .g2, .g3, .g4, .g-main { grid-template-columns: 1fr; }
  .g4.keep2, .g3.keep2 { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-r { display: none; }
  .builder { grid-template-columns: 1fr; }
  .inbox, .inbox:has(.ib-side) { grid-template-columns: 1fr; height: calc(100dvh - 57px - 64px); }
  .inbox.chat-open .ib-list { display: none; } .inbox:not(.chat-open) .ib-chat { display: none; }
  .plans { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .hide-m { display: none !important; }
}
@media (min-width: 861px) { .show-m { display: none !important; } }

/* Til almashtirgich */
.lang-sel { width: auto; padding: 7px 30px 7px 12px; font-weight: 700; cursor: pointer; }
.lang-sel.sm { padding: 6px 26px 6px 10px; font-size: 13px; }

/* Segment tugmalar ($ / so'm) */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
