/* =========================================================================
   2Brain — dashboard
   ========================================================================= */

.app-body { background: var(--surface-2); }

/* ---------- Boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 999; }
.boot-mark { font-size: 40px; color: var(--brand); animation: bootPulse 1.1s ease-in-out infinite; }
@keyframes bootPulse { 0%,100% { opacity: .35; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.05); } }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
@media (max-width: 1000px) { .shell { grid-template-columns: 1fr; } }

/* ---------- Sidebar ---------- */
.side {
  background: var(--bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding:20px 16px;
  position: sticky; top: 0; height: 100vh;
}
@media (max-width: 1000px) {
  .side {
    position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 120;
    transform: translateX(-100%); transition: transform .26s var(--ease-out);
    box-shadow: var(--shadow-lg);
  }
  .side.open { transform: none; }
}
.side-brand { padding:4px 8px 20px; }

.side-nav { display: flex; flex-direction: column; gap:2px; overflow-y: auto; margin:0 -4px; padding:0 4px; }

/* Guruh sarlavhasi bosiladi — kerak bo'lmagan bo'limni yig'ib qo'yish mumkin */
.snav-sec { display: flex; flex-direction: column; }
.snav-group {
  display: flex; align-items: center; gap:8px; width: 100%;
  padding:16px 12px 8px; cursor: pointer; background: none; border: 0;
  font-family: inherit; font-size: 14px; font-weight: var(--w-semibold);
  letter-spacing: 0; color: var(--label-4);
  transition: color .15s var(--ease);
}
.snav-group:hover { color: var(--label-2); }
.snav-chev {
  margin-left:auto; fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0;
  transition: transform .2s var(--ease), opacity .15s var(--ease);
}
.snav-sec:hover .snav-chev, .snav-group:focus-visible .snav-chev { opacity: .7; }
.snav-sec.is-closed .snav-chev { opacity: .7; transform: rotate(-90deg); }
.snav-items { display: flex; flex-direction: column; gap:2px; }
.snav-sec.is-closed .snav-items { display: none; }

.snav {
  display: flex; align-items: center; gap:12px; width: 100%;
  padding:4px 8px; border-radius:var(--r-md);
  font-size: var(--step--1); font-weight: var(--w-medium); color: var(--label-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
/* Ikonka o'z kvadratchasida — ro'yxat bir maromda o'qiladi */
.snav-ic {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border-radius:var(--r-sm); background: var(--surface-2); color: var(--label-2);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.snav-ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.snav-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.snav[hidden] { display: none; }
.snav-admin { margin-top:8px; }
.snav:hover { background: var(--surface-2); color: var(--ink); }
.snav:hover .snav-ic { background: var(--surface-3); color: var(--ink); }

/* Faol bo'lim: to'la bo'yalgan qator o'rniga yumshoq tus.
   Ilgari butun qator to'q siyoh rangda edi va menyuni og'irlashtirardi. */
.snav.active { background: var(--brand-50); color: var(--brand); font-weight: var(--w-semibold); }
.snav.active .snav-ic { background: var(--brand); color: var(--brand-ink); }

.snav-badge {
  margin-left:auto; background: var(--err); color: #fff; font-size: 14px;
  font-weight: var(--w-semibold); padding:0 8px; line-height: 18px; border-radius:var(--r-full);
}

.side-foot { margin-top:auto; padding-top:12px; }
.side-user {
  display: flex; align-items: center; gap:8px; padding:8px;
  border-radius:var(--r-md); border: 1px solid var(--border);
}
.side-avatar {
  width: 28px; height: 28px; border-radius:50%; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none;
}
.side-user-t { min-width: 0; flex: 1; }
.side-user-t b { display: block; font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-t span { font-size: 14px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; }
.side-out {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border-radius:var(--r-sm); color: var(--label-3); position: relative;
}
.side-out:hover { background: var(--err-bg); color: var(--err); }

/* ---------- Main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap:16px;
  padding:16px 28px; background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) { .topbar { padding:12px 16px; } }
.topbar-h { min-width: 0; }
.topbar-t { font-size: var(--step-1); }
.topbar-s { font-size: var(--step--2); color: var(--label-3); margin-top:1px; }
.topbar-s:empty { display: none; }
.topbar-r { margin-left:auto; display: flex; align-items: center; gap:8px; }
.side-toggle { display: none; }
@media (max-width: 1000px) { .side-toggle { display: grid; } }

/* Telefonda til tugmalari butunlay yashirilgan edi va foydalanuvchi
   tilni almashtira olmasdi. Endi ular kichrayadi, sarlavha esa
   kerak bo'lsa qisqartiriladi. */
@media (max-width: 520px) {
  .app-body .lang { display: flex; padding:2px; }
  .app-body .lang button { padding:4px 8px; font-size: 14px; }
  .topbar { padding:12px 16px; gap:8px; }
  .topbar-s { display: none; }
  .topbar-t { font-size: var(--step-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.view { display: none; padding:24px 28px 56px; }
.view.active { display: block; animation: fade .25s var(--ease-out); }
@media (max-width: 640px) { .view { padding:16px 16px 48px; } }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.view-tools { display: flex; gap:8px; margin-bottom:16px; flex-wrap: wrap; }

.card-h { display: flex; align-items: center; gap:12px; margin-bottom:16px; }
.card-h h3 { font-size: var(--step-0); }
.card-h > *:last-child:not(:first-child) { margin-left:auto; }

/* Kartaning ostidagi kirish gapi — bo'lim nima uchunligini aytadi */
.card-lead { margin:-8px 0 16px; max-width: 62ch; }

/* Maydon ostidagi kichik izoh: nima yozish kerakligini aytadi.
   Ilgari "Persona" yoki "Operatorga uzatish qoidasi" degan yorliq
   yolg'iz turardi va odam nima yozishini bilmasdi. */
.hlp {
  display: block; margin:-2px 0 8px;
  font-size: var(--step--2); color: var(--label-3); line-height: 1.45;
}

/* Kalit yonidagi holat so'zi — yoqilganmi yoki yo'qmi, ko'rinib tursin */
.sw-state {
  margin-left:auto; font-size: var(--step--2); font-weight: var(--w-medium);
  color: var(--label-3);
}
.sw-state.on { color: var(--ok); }
.card-h .sw-state + .switch { margin-left:0; }

.input-sm, .select-sm { padding:8px 12px; font-size: var(--step--1); }
.select-sm { padding-right:32px; }

.empty { display: grid; place-items: center; gap:8px; padding:48px 20px; text-align: center; color: var(--muted); }
.empty b { font-size: var(--step-0); color: var(--ink); }
.empty span { font-size: var(--step--1); max-width: 34ch; }
.empty .btn { margin-top:8px; }

/* ---------- Alerts ---------- */
.alerts { padding:0 28px; }
.alerts:empty { display: none; }
@media (max-width: 640px) { .alerts { padding:0 16px; } }
/* Bitta qatorli ogohlantirish. Ilgari uch qatorli quti edi va uchtasi
   birga chiqqanda ekranning yuqori uchdan biri shularga ketardi. */
.alert {
  display: flex; align-items: center; gap:8px; padding:8px 12px;
  border-radius:var(--r-md); margin-top:8px; font-size: var(--step--2);
  line-height: 1.45; border: 1px solid transparent;
}
.alert-ic { width: 16px; height: 16px; flex: none; }
.alert-b { min-width: 0; flex: 1; }
.alert b { font-weight: var(--w-semibold); margin-inline-end:4px; }
.alert-warn { background: var(--warn-bg); color: var(--ink); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
/* Ogohlantirishda matn qora (to'q sariq och fon ustida o'qilmasdi), rang faqat belgida */
.alert-warn svg, .alert-warn .alert-ic { color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }
.alert a { text-decoration: underline; font-weight: 700; }
.alert-go {
  flex: none; padding:4px 12px; border-radius:var(--r-full); cursor: pointer;
  font-family: inherit; font-size: var(--step--2); font-weight: var(--w-semibold);
  color: inherit; background: color-mix(in srgb, currentColor 12%, transparent);
  border: 0; transition: background .15s var(--ease);
}
.alert-go:hover { background: color-mix(in srgb, currentColor 20%, transparent); }
.alert-x { flex: none; opacity: .55; font-size: 14px; line-height: 1; padding:4px; }
.alert-x:hover { opacity: 1; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap:16px; margin-bottom:16px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--bg); border: 1px solid var(--border); border-radius:var(--r-lg); padding:20px; }
.kpi-l { font-size: var(--step--1); color: var(--muted); }
.kpi-v { font-size: var(--step-3); font-weight: 700; letter-spacing: -.04em; margin-top:4px; }
.kpi-s { font-size: 14px; color: var(--muted-2); margin-top:2px; }
/* Ilgari bu katak butunlay siyoh rangda bo'yalardi va sahifadagi eng
   baland ovozli narsa edi — holbuki eng muhim ko'rsatkich emas.
   Rang endi faqat raqamga tushadi. */
.kpi.accent .kpi-v { color: var(--brand); }

.home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap:16px; align-items: start; }
/* Grafik kartasi yonidagi ustunga cho'zilib, ustunlar orasida bo'sh
   joy qolardi — endi o'z bo'yiga qarab turadi. */
.home-grid > .card:last-child { grid-column: 1 / -1; }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } .home-grid > .card:last-child { grid-column: auto; } }
.card { background: var(--bg); border: 1px solid var(--border); border-radius:var(--r-lg); padding:24px; }

.chart-note { margin-top:12px; }
.chart-note:empty { display: none; }

/* Chart */
.chart { display: flex; align-items: flex-end; gap:4px; height: 170px; }
.chart-bar { flex: 1; background: var(--surface-3); border-radius:6px 6px 4px 4px; position: relative; min-height: 4px; transition: background .16s var(--ease); }
.chart-bar[data-v]:hover { background: var(--brand); }
.chart-bar[data-v]:hover::after {
  content: attr(data-v) ' xabar'; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); font-size: 14px; padding:4px 8px; border-radius:6px;
  white-space: nowrap; margin-bottom:8px;
}
.chart-bar.on { background: var(--brand-300); }

.quick { display: grid; gap:8px; }
.qbtn { text-align: left; padding:16px 16px; border-radius:var(--r-sm); background: var(--surface-2); transition: background .15s var(--ease); }
.qbtn:hover { background: var(--surface-3); }
.qbtn b { display: block; font-size: var(--step--1); }
.qbtn span { font-size: 14px; color: var(--muted); }

.feed { list-style: none; padding:0; margin:0; display: flex; flex-direction: column; }
.feed li { display: flex; align-items: center; gap:12px; padding:12px 0; border-bottom: 1px solid var(--border); font-size: var(--step--1); }
.feed li:last-child { border: 0; }
.feed-ic { width: 30px; height: 30px; border-radius:10px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-size: 14px; flex: none; }
.feed-t { margin-left:auto; color: var(--muted-2); font-size: 14px; white-space: nowrap; }

/* ---------- Inbox ---------- */
.inbox { display: grid; grid-template-columns: 320px 1fr; gap:16px; height: calc(100vh - 130px); }
@media (max-width: 900px) { .inbox { grid-template-columns: 1fr; height: auto; } .ibx-list { height: 340px; } }
.ibx-list, .ibx-thread { background: var(--bg); border: 1px solid var(--border); border-radius:var(--r-lg); display: flex; flex-direction: column; overflow: hidden; }
.ibx-tools { display: flex; gap:8px; padding:16px; border-bottom: 1px solid var(--border); }
.ibx-scroll { flex: 1; overflow-y: auto; }

.conv { display: flex; gap:12px; padding:12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .14s var(--ease); }
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand); }
.conv-av { width: 36px; height: 36px; border-radius:50%; background: var(--surface-3); color: var(--ink-2); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.conv-b { min-width: 0; flex: 1; }
.conv-top { display: flex; align-items: center; gap:8px; }
.conv-n { font-weight: 700; font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { margin-left:auto; font-size: 14px; color: var(--muted-2); white-space: nowrap; }
.conv-p { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top:2px; }
.conv-tags { display: flex; gap:4px; margin-top:8px; }

.thread-h { display: flex; align-items: center; gap:12px; padding:16px 16px; border-bottom: 1px solid var(--border); }
.thread-h-b { min-width: 0; }
.thread-h-b b { display: block; font-size: var(--step--1); }
.thread-h-b span { font-size: 14px; color: var(--muted); }
.thread-h .select { margin-left:auto; width: auto; }

.thread-log { flex: 1; overflow-y: auto; padding:16px; display: flex; flex-direction: column; gap:12px; min-height: 240px; }
.msg { max-width: 76%; }
.msg-b { padding:12px 16px; border-radius:14px; font-size: var(--step--1); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.msg.in { align-self: flex-start; }
.msg.in .msg-b { background: var(--surface-2); border-bottom-left-radius: 5px; }
.msg.out { align-self: flex-end; }
.msg.out .msg-b { background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 5px; }
.msg-m { font-size: 14px; color: var(--muted-2); margin-top:4px; display: flex; gap:8px; align-items: center; }
.msg.out .msg-m { justify-content: flex-end; }

.msg.pending .msg-b { background: var(--warn-bg); color: var(--ink); border: 1px dashed var(--warn); }
.pending-acts { display: flex; gap:8px; margin-top:8px; justify-content: flex-end; }
.msg-src { display: flex; flex-wrap: wrap; gap:4px; margin-top:8px; }
.msg-src .badge { font-size: 13px; padding:4px 8px; }

.thread-form { display: flex; gap:8px; padding:16px 16px; border-top: 1px solid var(--border); }
.thread-form .input { flex: 1; }

/* ---------- 2-Miyya ---------- */
.brain-top { display: flex; align-items: center; gap:32px; flex-wrap: wrap; margin-bottom:24px; }
.bstats { display: flex; gap:24px; }
.bstat b { display: block; font-size: var(--step-2); font-weight: 700; letter-spacing: -.03em; }
.bstat span { font-size: 14px; color: var(--muted); }
/* Segmentli boshqaruv — butun ilovada bitta ko'rinish.
   Ilgari to'rt xil tab uslubi bor edi (btabs, ctabs, crew-tabs, cal-modes);
   bir sahifadan ikkinchisiga o'tganda boshqa ilovaga tushgandek tuyulardi. */
.btabs, .ctabs, .crew-tabs, .cal-modes {
  display: inline-flex; gap:2px; background: var(--surface-2);
  border-radius:var(--r-full); padding:4px; flex-wrap: wrap;
}
.btab, .ctab, .crew-tab, .cal-mode {
  border:0; background: none; cursor: pointer; font-family: inherit;
  padding:8px 16px; border-radius:var(--r-full);
  font-size: var(--step--1); font-weight: var(--w-medium);
  color: var(--label-2); transition: color .16s var(--ease), background .16s var(--ease);
}
.btab:hover, .ctab:hover, .crew-tab:hover, .cal-mode:hover { color: var(--ink); }
.btab.active, .ctab.active, .crew-tab.active, .cal-mode.active {
  background: var(--bg); color: var(--ink); font-weight: var(--w-semibold);
  box-shadow: var(--shadow-xs);
}
.ctabs, .crew-tabs { margin-bottom:24px; }
.bpane, .cpane { display: none; }
.bpane.active, .cpane.active { display: block; animation: fade .25s var(--ease-out); }

.bitems { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap:12px; }
.bitem { background: var(--bg); border: 1px solid var(--border); border-radius:var(--r-md); padding:16px; position: relative; }
.bitem.pinned { border-color: var(--brand); }
.bitem-h { display: flex; align-items: center; gap:8px; margin-bottom:8px; }
.bitem-h b { font-size: var(--step--1); }
.bitem-c { font-size: 14px; color: var(--muted); line-height: 1.6; max-height: 108px; overflow: hidden; white-space: pre-wrap; }
.bitem-acts { display: flex; gap:8px; margin-top:16px; }

.add-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap:16px; align-items: start; }
@media (max-width: 900px) { .add-grid { grid-template-columns: 1fr; } }
.add-side { display: grid; gap:16px; }
.drop {
  display: grid; place-items: center; gap:4px; padding:32px 16px; text-align: center;
  border: 2px dashed var(--border-2); border-radius:var(--r-md); cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-50); }
.drop b { font-size: var(--step--1); }
.drop span { font-size: 14px; color: var(--muted); }

.chk { display: flex; align-items: center; gap:8px; font-size: var(--step--1); cursor: pointer; }
.chk input { width: 17px; height: 17px; accent-color: var(--brand); }

.bchat { background: var(--bg); border: 1px solid var(--border); border-radius:var(--r-lg); display: flex; flex-direction: column; height: calc(100vh - 260px); min-height: 400px; }
.bchat-log { flex: 1; overflow-y: auto; padding:20px; display: flex; flex-direction: column; gap:16px; }
.bchat-form { display: flex; gap:8px; padding:16px 16px; border-top: 1px solid var(--border); }
.bchat-form .input { flex: 1; }

/* ---------- Agent ---------- */
.agent-grid { display: grid; grid-template-columns: 1fr 420px; gap:16px; align-items: start; }
@media (max-width: 1100px) { .agent-grid { grid-template-columns: 1fr; } }
.agent-cfg { display: grid; gap:16px; }

.switch { position: relative; width: 44px; height: 25px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin:0; cursor: pointer; z-index: 2; }
.switch span { position: absolute; inset: 0; background: var(--border-2); border-radius:var(--r-full); transition: background .2s var(--ease); }
.switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px;
  background: #fff; border-radius:50%; transition: transform .2s var(--ease-out); box-shadow: var(--shadow-xs);
}
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(19px); }

/* Tanlanadigan yorliqlar (kanallar). Ilgari bular ham `.chip` deb
   atalardi — kalit so'z maydonidagi yorliqlar bilan bir xil nom.
   Ikkinchi ta'rif birinchisini bosib ketib, kanallar kulrang quti
   ichida ko'rinmas holatda turardi. */
.picks { display: flex; flex-wrap: wrap; gap:8px; }
.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; }
.pick span {
  display: flex; align-items: center; gap:8px;
  padding:8px 16px 8px 12px; border-radius:var(--r-full);
  border: 1px solid var(--border-2); background: var(--bg);
  font-size: var(--step--1); font-weight: var(--w-medium); color: var(--label-2);
  transition: all .16s var(--ease); min-height: 36px;
}
/* Belgi — tanlangani bir qarashda ko'rinishi uchun */
.pick span::before {
  content: ''; width: 15px; height: 15px; border-radius:var(--r-full); flex: none;
  border: 1.5px solid var(--border-2); transition: all .16s var(--ease);
}
.pick:hover span { border-color: var(--label-3); color: var(--ink); }
.pick input:checked + span {
  background: var(--brand-50); border-color: var(--brand); color: var(--brand);
  font-weight: var(--w-semibold);
}
.pick input:checked + span::before {
  background: var(--brand) no-repeat center/9px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.4 4.6 9 10 3.3' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border-color: var(--brand);
}
.pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.autopilot { display: flex; gap:16px; align-items: flex-start; margin-top:20px; padding:16px; background: var(--surface-2); border-radius:var(--r-md); }
.autopilot b { font-size: var(--step--1); }
.autopilot p { font-size: 14px; color: var(--muted); margin-top:4px; line-height: 1.5; }

.range { width: 100%; accent-color: var(--brand); margin-top:4px; }

.samples-h { display: flex; align-items: center; gap:8px; margin:20px 0 8px; }
.samples-h .btn { margin-left:auto; }
.sample { background: var(--surface-2); border-radius:var(--r-sm); padding:12px; margin-bottom:8px; position: relative; }
.sample .input, .sample .textarea { background: var(--bg); margin-bottom:8px; }
.sample-x { position: absolute; top: 8px; right: 8px; color: var(--muted-2); font-size: 14px; }
.sample-x:hover { color: var(--err); }

.sim-card { display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 460px; position: sticky; top: 88px; }
.sim-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap:12px; padding:4px 0; }
.sim-form { display: flex; gap:8px; padding-top:16px; border-top: 1px solid var(--border); margin-top:16px; }
.sim-form .input { flex: 1; }

/* ---------- Avtomatizatsiya ---------- */
.autos { display: grid; gap:12px; }
.auto {
  background: var(--bg); border: 1px solid var(--border); border-radius:var(--r-lg);
  padding:16px 20px; display: grid; grid-template-columns: auto 1fr auto; gap:16px; align-items: start;
  transition: border-color .15s, box-shadow .15s;
}
.auto:hover { border-color: var(--brand); box-shadow: 0 2px 12px rgba(0, 0, 0, .05); }
.auto.off { opacity: .6; }
.auto.off:hover { border-color: var(--border); box-shadow: none; }
/* Har qoidaning kanali bir qarashda ko'rinishi uchun ikonka */
.auto-ic {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius:var(--r-md); background: var(--surface-2); color: var(--label-2); line-height: 0;
}
.auto-ic svg { width: 18px; height: 18px; }
.auto-b { min-width: 0; }
.auto-h { display: flex; align-items: center; gap:8px; margin-bottom:8px; flex-wrap: wrap; }
.auto-h b { font-size: var(--step-0); }
/* Nom — kartaning asosiy ajratuvchisi */
.auto-name {
  font-weight: 700; letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.auto-tag {
  font-size: 14px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  background: var(--brand-50); color: var(--brand); padding:4px 8px; border-radius:var(--r-full);
}
.auto-tag.off { background: var(--surface-2); color: var(--muted); }
.auto-del { color: var(--muted-2); }
.auto-del:hover { color: var(--err, #e5484d); }
.auto-keys { display: flex; flex-wrap: wrap; gap:4px; margin:8px 0; }
.auto-key { font-family: var(--font-mono); font-size: 14px; background: var(--surface-2); padding:4px 8px; border-radius:6px; }
.auto-acts { display: flex; flex-wrap: wrap; gap:8px; }
.auto-act { font-size: 14px; background: var(--brand-50); color: var(--brand); padding:4px 8px; border-radius:var(--r-full); font-weight: 600; }
.auto-r { display: flex; align-items: center; gap:8px; }
.auto-runs { font-size: 14px; color: var(--muted-2); white-space: nowrap; }

.auto-edit { display: grid; gap:12px; margin-top:16px; padding-top:16px; border-top: 1px solid var(--border); grid-column: 1 / -1; }
.auto-edit .gen-row { grid-template-columns: 1fr 1fr; }

/* ---------- Kontent ---------- */
.gen-form { max-width: 640px; margin-bottom:20px; }
.gen-row { display: grid; grid-template-columns: 1fr 1fr; gap:12px; margin-top:16px; }

.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap:12px; margin-top:16px; }
.slide { background: var(--bg); border: 1px solid var(--border); border-radius:var(--r-md); padding:16px; aspect-ratio: 4/5; display: flex; flex-direction: column; gap:8px; }
.slide:first-child { background: var(--night); color: var(--night-ink); border-color: var(--night); }
.slide:last-child { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.slide-n { font-family: var(--font-mono); font-size: 14px; opacity: .6; }
.slide h4 { font-size: 15px; line-height: 1.25; }
.slide p { font-size: 14px; line-height: 1.5; opacity: .8; }
.slide-v { margin-top:auto; font-size: 13px; font-family: var(--font-mono); opacity: .55; }

.scenes { width: 100%; border-collapse: collapse; font-size: var(--step--1); margin-top:16px; }
.scenes th { text-align: left; padding:8px 12px; background: var(--surface-2); color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.scenes td { padding:12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.scenes td:first-child { font-family: var(--font-mono); color: var(--brand); white-space: nowrap; font-size: 14px; }

.hooks { display: grid; gap:8px; margin-top:12px; }
.hook-i { display: flex; gap:8px; padding:12px 16px; background: var(--surface-2); border-radius:var(--r-sm); font-size: var(--step--1); }
.hook-i b { color: var(--brand); flex: none; }

.out-card { background: var(--bg); border: 1px solid var(--border); border-radius:var(--r-lg); padding:24px; margin-bottom:16px; }
.out-h { display: flex; align-items: center; gap:12px; margin-bottom:4px; flex-wrap: wrap; }
.out-h h3 { font-size: var(--step-1); }
.out-h .btn { margin-left:auto; }
.out-sec { margin-top:24px; }
.out-sec > .label { margin-bottom:8px; }
.out-text { white-space: pre-wrap; font-size: var(--step--1); line-height: 1.7; background: var(--surface-2); padding:16px; border-radius:var(--r-sm); }
.tags { display: flex; flex-wrap: wrap; gap:8px; margin-top:8px; }
.tag { font-size: 14px; color: var(--brand); background: var(--brand-50); padding:4px 8px; border-radius:var(--r-full); }

.plan-tbl { width: 100%; border-collapse: collapse; font-size: var(--step--1); margin-top:16px; }
.plan-tbl th { text-align: left; padding:8px 12px; background: var(--surface-2); color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.plan-tbl td { padding:8px 12px; border-bottom: 1px solid var(--border); }
.plan-tbl td:first-child { font-family: var(--font-mono); color: var(--muted-2); width: 40px; }

.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap:12px; }
.lib-i { background: var(--bg); border: 1px solid var(--border); border-radius:var(--r-md); padding:16px; cursor: pointer; transition: border-color .16s var(--ease); }
.lib-i:hover { border-color: var(--brand); }
.lib-i b { display: block; font-size: var(--step--1); margin:8px 0 4px; }
.lib-i span { font-size: 14px; color: var(--muted-2); }

/* ---------- CRM ---------- */
.crm-grid { display: grid; grid-template-columns: 1fr 300px; gap:16px; align-items: start; }
@media (max-width: 1000px) { .crm-grid { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.tbl th { text-align: left; padding:12px 16px; background: var(--surface-2); color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.tbl td { padding:12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl tr:last-child td { border: 0; }
.tbl .select-sm { padding:4px 28px 4px 8px; font-size: 14px; }

.lb { list-style: none; counter-reset: lb; padding:0; margin:0; }
.lb li { display: flex; align-items: center; gap:12px; padding:8px 0; border-bottom: 1px solid var(--border); font-size: var(--step--1); }
.lb li:last-child { border: 0; }
.lb li::before {
  counter-increment: lb; content: counter(lb);
  width: 24px; height: 24px; border-radius:50%; background: var(--surface-2);
  display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--muted); flex: none;
}
.lb li:nth-child(1)::before { background: var(--brand); color: var(--brand-ink); }
.lb-p { margin-left:auto; font-weight: 700; color: var(--brand); }

/* ---------- Sozlamalar ---------- */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap:16px; align-items: start; }
.set-grid + .set-grid { margin-top:16px; }
.set-grid-1 { grid-template-columns: 1fr; }
/* Bo'lim sarlavhasi — sozlamalarni to'rt guruhga ajratadi */
.set-sec {
  font-size: var(--step--1); font-weight: var(--w-semibold);
  letter-spacing: .05em; text-transform: uppercase; color: var(--label-3);
  margin:32px 0 12px;
}
.view[data-view="settings"] > .set-sec:first-child { margin-top:0; }
.ig-acc { display: flex; align-items: center; gap:12px; padding:16px; background: var(--surface-2); border-radius:var(--r-md); margin-bottom:8px; }
.ig-acc-b { min-width: 0; flex: 1; }
.ig-acc-b b { display: block; font-size: var(--step--1); }
.ig-acc-b span { font-size: 14px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap:12px; padding:8px 0; border-bottom: 1px solid var(--border); font-size: var(--step--1); }
.kv:last-child { border: 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; }

/* ---------- Onboarding ---------- */
.onb { position: fixed; inset: 0; background: var(--surface-2); display: grid; place-items: center; padding:20px; z-index: 200; overflow-y: auto; }
.onb-card { width: min(560px, 100%); background: var(--bg); border-radius:var(--r-xl); padding:36px; box-shadow: var(--shadow-lg); }
@media (max-width: 560px) { .onb-card { padding:24px; } }
.onb-steps { display: flex; gap:8px; margin-bottom:24px; }
.onb-dot { flex: 1; height: 4px; border-radius:4px; background: var(--border-2); transition: background .3s var(--ease); }
.onb-dot.active { background: var(--brand); }
.onb-pane { display: none; }
.onb-pane.active { display: block; animation: fade .3s var(--ease-out); }
.onb-pane h2 { font-size: var(--step-2); margin:16px 0 8px; }
.onb-lead { color: var(--muted); font-size: var(--step--1); line-height: 1.6; margin-bottom:24px; }
.onb-nav { display: flex; gap:8px; margin-top:24px; }
.onb-nav .btn:last-child { margin-left:auto; }
.onb-test { background: var(--surface-2); border-radius:var(--r-md); padding:16px; display: flex; flex-direction: column; gap:8px; min-height: 120px; }
.onb-msg { max-width: 84%; padding:8px 16px; border-radius:14px; font-size: var(--step--1); line-height: 1.5; white-space: pre-wrap; }
.onb-msg.in { background: var(--bg); align-self: flex-start; border-bottom-left-radius: 4px; }
.onb-msg.out { background: var(--brand); color: var(--brand-ink); align-self: flex-end; border-bottom-right-radius: 4px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap:8px; }
.toast {
  background: var(--ink); color: var(--bg); padding:12px 16px; border-radius:var(--r-md);
  font-size: var(--step--1); font-weight: 600; box-shadow: var(--shadow-lg);
  animation: toastIn .28s var(--ease-out); max-width: 340px;
}
.toast.err { background: var(--err); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }

/* Skeleton */
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: skel 1.4s infinite; border-radius:var(--r-sm); }
@keyframes skel { to { background-position: -200% 0; } }

.backdrop { position: fixed; inset: 0; background: rgba(10,10,15,.45); z-index: 110; display: none; }
.backdrop.on { display: block; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 10, 15, .55); backdrop-filter: blur(6px);
  z-index: 250; display: flex; align-items: center; justify-content: center; padding:20px;
  animation: modalFadeIn .2s var(--ease-out);
}
.modal-backdrop[hidden] { display: none !important; }
.modal-card {
  width: min(520px, 100%); background: var(--bg); border: 1px solid var(--border);
  border-radius:var(--r-xl); padding:24px; box-shadow: var(--shadow-lg);
  animation: modalScaleIn .25s var(--ease-out); max-height: 90vh; overflow-y: auto;
}
.modal-h { display: flex; align-items: center; justify-content: space-between; gap:12px; }
.modal-h h3 { font-size: var(--step-1); margin:0; }

@keyframes modalFadeIn { from { opacity: 0; } }
@keyframes modalScaleIn { from { opacity: 0; transform: scale(.96); } }

/* ==================== LIMIT KO'RSATKICHI ==================== */
.usage {
  width: 100%; text-align: left; background: var(--surface-2);
  border: 1px solid var(--border); border-radius:var(--r-md);
  padding:12px 12px; margin-bottom:8px; cursor: pointer;
  display: flex; flex-direction: column; gap:8px;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.usage:hover { border-color: var(--brand); }
.usage[hidden] { display: none !important; }
/* Cheksiz tarif: bosiladigan to'ldirish qutisi emas, holat yorlig'i */
.usage.is-unlimited { cursor: default; }
.usage.is-unlimited:hover { border-color: var(--border); }
.usage.is-unlimited .usage-bar { display: none; }
.usage.is-unlimited .usage-n { color: var(--ok); }
.usage-top { display: flex; align-items: baseline; justify-content: space-between; gap:8px; }
.usage-l { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.usage-n { font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.usage-bar { height: 6px; border-radius:4px; background: var(--surface-3); overflow: hidden; }
.usage-bar i { display: block; height: 100%; background: var(--brand); border-radius:4px; transition: width .3s var(--ease); }
.usage-foot { display: flex; align-items: center; justify-content: space-between; gap:8px; font-size: 14px; color: var(--muted); }
.usage-add { font-weight: 700; color: var(--brand); }

.usage.low  { border-color: var(--warn); background: var(--warn-bg); }
.usage.low  .usage-bar i { background: var(--warn); }
.usage.low  .usage-add { color: var(--warn); }
.usage.out  { border-color: var(--err); background: var(--err-bg); }
.usage.out  .usage-bar i { background: var(--err); }
.usage.out  .usage-add { color: var(--err); }

/* ==================== TO'LDIRISH OYNASI ==================== */
/* Xodimlar soni — tarif narxi o'rin boshiga */
.seat-pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--step--1); font-weight: var(--w-semibold); }
.seat-pick small { display: block; font-weight: var(--w-regular); color: var(--muted); font-size: 14px; }
.seat-step { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 4px; }
.seat-step button { width: 36px; height: 36px; border: 0; border-radius: var(--r-xs); background: none; color: var(--ink); font-size: 18px; cursor: pointer; }
.seat-step button:hover { background: var(--surface-3); }
.seat-step b { min-width: 32px; text-align: center; font-variant-numeric: tabular-nums; font-size: var(--step-0); }
.modal-wide { max-width: 560px; }
.topup-step { display: none; margin-top:16px; }
.topup-step.active { display: block; }
.topup-lead { color: var(--muted); font-size: var(--step--1); margin-bottom:16px; }
.topup-hint { color: var(--muted-2); font-size: var(--step--2); margin-top:16px; text-align: center; }

.buy-sec { display: grid; gap:8px; margin-bottom:24px; }
.buy-sec:last-child { margin-bottom:0; }
.buy-h { display: flex; align-items: center; justify-content: space-between; gap:12px; flex-wrap: wrap; }
.chips2 { display: inline-flex; gap:2px; background: var(--surface-2); border-radius:var(--r-full); padding:4px; }
.chip2 { padding:4px 12px; border-radius:var(--r-full); font-size: 14px; font-weight: var(--w-medium); color: var(--label-2); }
.chip2.active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-xs); }
.plans2 { display: grid; grid-template-columns: repeat(2, 1fr); gap:8px; }
.plan2 {
  border: 1px solid var(--border); border-radius:var(--r-md); padding:16px; text-align: left;
  display: grid; gap:4px; background: var(--surface); transition: border-color .15s var(--ease);
}
.plan2:hover { border-color: var(--brand); }
.plan2.is-cur { border-color: var(--ok); }
.plan2-n { font-weight: var(--w-semibold); }
.plan2-p { font-size: var(--step-1); font-weight: var(--w-bold); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan2-p small { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan2-d { font-size: 14px; color: var(--muted); line-height: 1.4; }
.pay-methods { display: grid; gap:8px; margin:16px 0; }
.pay-method {
  display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap:12px; align-items: center; text-align: left;
  border: 1px solid var(--border); border-radius:var(--r-md); padding:12px 16px; background: var(--surface);
}
.pay-method:hover { border-color: var(--brand); }
.pay-method .ic { width: 40px; height: 40px; border-radius:var(--r-sm); background: var(--surface-2); display: grid; place-items: center; font-weight: var(--w-bold); }
.pay-method b { font-size: var(--step--1); }
.pay-method span { font-size: 14px; color: var(--muted); }
.pay-method .go { color: var(--muted); font-size: 18px; }
@media (max-width: 520px) { .plans2 { grid-template-columns: 1fr; } }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap:8px; }
@media (max-width: 520px) { .packs { grid-template-columns: 1fr; } }
.pack {
  position: relative; border: 2px solid var(--border); border-radius:var(--r-md);
  background: var(--surface); padding:16px 12px 16px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; gap:4px;
  transition: border-color .16s var(--ease), transform .16s var(--ease);
}
.pack:hover { border-color: var(--brand-300); transform: translateY(-2px); }
.pack.sel { border-color: var(--brand); background: var(--brand-50); }
.pack-n { font-size: var(--step-1); font-weight: 700; letter-spacing: -.02em; }
.pack-u { font-size: 14px; color: var(--muted); }
.pack-p { font-size: var(--step-2); font-weight: 700; margin-top:8px; }
.pack-b {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: var(--brand-ink); font-size: 13px; font-weight: 700;
  padding:4px 8px; border-radius:var(--r-full); white-space: nowrap;
}

.pay-code { background: var(--surface-2); border-radius:var(--r-md); padding:16px 16px; }
.pay-code-row { display: flex; align-items: center; justify-content: space-between; gap:8px; margin-top:4px; }
.pay-code-row b { font-size: var(--step-2); font-weight: 700; letter-spacing: .06em; font-family: var(--mono, monospace); }
.pay-steps { margin:16px 0 0; padding-left:20px; display: flex; flex-direction: column; gap:8px; }
.pay-steps li { font-size: var(--step--1); line-height: 1.55; }
.pay-steps b { font-family: var(--mono, monospace); letter-spacing: .04em; }
.pay-contact { margin-top:16px; font-size: var(--step--2); color: var(--muted); }
.pay-contact a { color: var(--brand); font-weight: 600; }

.topup-orders { margin-top:16px; border-top: 1px solid var(--border); padding-top:16px; }
.topup-orders:empty { display: none; }
.torder { display: flex; align-items: center; justify-content: space-between; gap:8px; padding:8px 0; font-size: var(--step--2); }
.torder b { font-family: var(--mono, monospace); }

/* ==================== AVTOMATIZATSIYA: BOSHLASH ==================== */
.auto-start { display: grid; grid-template-columns: 1fr 1fr; gap:12px; margin-bottom:16px; }
@media (max-width: 700px) { .auto-start { grid-template-columns: 1fr; } }
.astart {
  text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius:var(--r-lg); padding:20px; cursor: pointer;
  display: flex; flex-direction: column; gap:4px;
  transition: border-color .16s var(--ease), transform .16s var(--ease);
}
.astart:hover { border-color: var(--brand); transform: translateY(-2px); }
.astart-ic { color: var(--brand); margin-bottom:4px; line-height: 0; }
.astart-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* Ikonkali tugma — ikonka va matn bir chiziqda tursin */
.btn-ic { display: inline-flex; align-items: center; gap:8px; }
.btn-ic svg { flex: none; }
.astart b { font-size: var(--step-0); }
.astart-d { color: var(--muted); font-size: var(--step--1); line-height: 1.5; }

/* ==================== SHABLONLAR ==================== */
.tpl-list { display: flex; flex-direction: column; gap:8px; margin-top:8px; }
.tpl {
  display: flex; align-items: flex-start; gap:16px; padding:16px;
  border: 1px solid var(--border); border-radius:var(--r-md); background: var(--surface);
}
.tpl-ic { font-size: 22px; line-height: 1.2; }
.tpl-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap:4px; }
.tpl-b b { font-size: var(--step--1); }
.tpl-b span { color: var(--muted); font-size: var(--step--2); line-height: 1.5; }
.tpl .btn { align-self: center; white-space: nowrap; }

/* ==================== QOIDA KARTASI (sodda o'qiladigan) ==================== */
.auto-sentence { display: flex; flex-wrap: wrap; align-items: baseline; gap:4px; font-size: var(--step--1); line-height: 1.9; }
.auto-sentence .w { color: var(--muted); }
.auto-sentence .k {
  background: var(--surface-3); border-radius:var(--r-sm, 6px);
  padding:1px 8px; font-weight: 700; color: var(--ink);
}
.auto-sentence .a { background: var(--brand-50); color: var(--brand); border-radius:var(--r-sm, 6px); padding:1px 8px; font-weight: 600; }

/* ==================== QOIDA SEHRGARI ==================== */
.wiz {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.wiz[hidden] { display: none !important; }
@media (max-width: 900px) { .wiz { grid-template-columns: 1fr; } .wiz-right { display: none; } }

.wiz-left { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.wiz-exit {
  padding:16px 24px; text-align: left; color: var(--muted); font-weight: 600;
  font-size: var(--step--1); cursor: pointer; background: none; flex: none;
}
.wiz-exit:hover { color: var(--ink); }
.wiz-scroll { flex: 1; overflow-y: auto; padding:0 24px 24px; }
.wiz-scroll > section { max-width: 520px; margin-inline: auto; }
.wiz-h { max-width: 520px; margin:0 auto 24px; display: flex; align-items: baseline; justify-content: space-between; gap:16px; }
.wiz-h h2 { font-size: var(--step-2); letter-spacing: -.03em; }
.wiz-step { color: var(--muted); font-size: var(--step--1); white-space: nowrap; }

.wiz-foot {
  flex: none; display: flex; gap:8px; justify-content: flex-end;
  padding:16px 24px; border-top: 1px solid var(--border); background: var(--bg);
}
.wiz-foot .btn { min-width: 130px; }

.wstep { display: none; }
.wfield-name { margin-top:0; }
.wfield-name .input { font-size: var(--step-0); font-weight: 600; padding:12px 16px; }
.wnote {
  margin-top:16px; padding:12px 16px; border-radius:var(--r-md);
  background: var(--warn-bg); border: 1px solid var(--warn);
  font-size: var(--step--2); line-height: 1.6; color: var(--warn);
  font-weight: 600;
}
.wnote[hidden] { display: none; }
.wstep.active { display: block; }
.wsec { font-size: var(--step-0); margin:24px 0 8px; }
.wstep > .wsec:first-child { margin-top:0; }
.wsec-d { color: var(--muted); font-size: var(--step--1); margin-bottom:12px; }

.wselect {
  display: flex; align-items: center; gap:8px; padding:12px 16px;
  border: 1px solid var(--border); border-radius:var(--r-md); background: var(--surface);
  font-weight: 600; font-size: var(--step--1);
}

.wtoggle {
  display: flex; align-items: center; gap:16px; padding:16px 16px; margin-top:8px;
  border: 1px solid var(--border); border-radius:var(--r-md); background: var(--surface-2); cursor: pointer;
}
.wtoggle-t { flex: 1; display: flex; flex-direction: column; gap:2px; }
.wtoggle-t b { font-size: var(--step--1); }
.wtoggle-t span { color: var(--muted); font-size: var(--step--2); line-height: 1.45; }

.wcard {
  display: flex; align-items: center; gap:12px; padding:16px;
  border: 2px solid var(--border); border-radius:var(--r-md); background: var(--surface);
  cursor: pointer; margin-bottom:8px; transition: border-color .16s var(--ease);
}
.wcard:hover { border-color: var(--brand-300); }
.wcard.on { border-color: var(--brand); }
.wcard-ic { width: 22px; color: var(--label-3); line-height: 0; }
.wcard-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.wcard.on .wcard-ic { color: var(--brand); }
.wcard b { flex: 1; font-size: var(--step--1); font-weight: 600; }
.wcard input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }

.wradios { display: flex; flex-direction: column; gap:4px; margin:16px 0 12px; }
.wradio { display: flex; align-items: center; gap:8px; padding:8px 2px; cursor: pointer; font-size: var(--step--1); }
.wradio input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }

.chips {
  display: flex; flex-wrap: wrap; align-items: center; gap:8px; min-height: 46px;
  padding:8px 8px; border: 1px solid var(--border); border-radius:var(--r-md); background: var(--surface);
}
.chips:focus-within { border-color: var(--brand); }
.chip {
  display: inline-flex; align-items: center; gap:8px; padding:4px 8px;
  background: var(--surface-3); border-radius:var(--r-sm, 6px); font-size: var(--step--2); font-weight: 600;
}
.chip button { color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; background: none; }
.chip button:hover { color: var(--err); }
.chips-in { flex: 1; min-width: 120px; border: 0; outline: 0; background: none; font: inherit; font-size: var(--step--1); color: var(--ink); }

.wcheck { display: flex; align-items: center; gap:8px; margin-top:12px; cursor: pointer; font-size: var(--step--1); }
.wcheck input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
.wcheck em {
  font-style: normal; width: 17px; height: 17px; border-radius:var(--r-full);
  border: 1px solid var(--border-2); color: var(--muted); font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; cursor: help;
}

.wfield { margin-top:16px; display: flex; flex-direction: column; gap:8px; }
.wfield[hidden] { display: none !important; }
.wfield-row { display: grid; grid-template-columns: 1fr 1fr; gap:8px; }
@media (max-width: 520px) { .wfield-row { grid-template-columns: 1fr; } }
.wfield .hint { font-size: var(--step--2); color: var(--muted); line-height: 1.5; }
.wtexts { display: flex; flex-direction: column; gap:8px; }
.wtext-row { display: flex; gap:8px; align-items: center; }
.wtext-row .input { flex: 1; }
.wtext-x { color: var(--muted); font-size: 17px; cursor: pointer; background: none; padding:0 4px; }
.wtext-x:hover { color: var(--err); }
.wadd {
  align-self: flex-start; color: var(--brand); font-weight: 700;
  font-size: var(--step--1); cursor: pointer; background: none; padding:4px 0;
}

/* ---- Jonli ko'rinish ---- */
.wiz-right {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap:16px; padding:24px; background: var(--surface-2); overflow-y: auto;
}
.phone {
  width: 320px; max-width: 100%; height: 620px; max-height: 78vh;
  /* Ramka har ikkala mavzuda ham telefonga o'xshab tursin — shuning uchun
     mavzuga bog'liq bo'lmagan qora rang. */
  background: var(--bg); border: 8px solid #14141A; border-radius:28px;
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.phone-top {
  flex: none; display: flex; align-items: center; gap:8px; padding:16px 16px;
  border-bottom: 1px solid var(--border); font-size: var(--step--2);
}
.phone-top span { color: var(--muted); }
.phone-body { flex: 1; overflow-y: auto; padding:16px; display: flex; flex-direction: column; gap:8px; }

.pv-msg { max-width: 82%; padding:8px 12px; border-radius:14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.pv-msg.them { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 5px; }
.pv-msg.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 5px; }
.pv-btn {
  align-self: flex-end; max-width: 82%; padding:8px 16px; border-radius:14px;
  border: 1px solid var(--brand); color: var(--brand); font-size: 14px; font-weight: 700; text-align: center;
}
.pv-cm { display: flex; gap:8px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.pv-cm .pv-av { width: 26px; height: 26px; border-radius:var(--r-full); background: var(--surface-3); flex: none; }
.pv-cm.mine .pv-av { background: var(--brand-100); }
.pv-cm b { font-size: 14px; }
.pv-cm p { margin:1px 0 0; white-space: pre-wrap; }
.pv-note { text-align: center; color: var(--muted-2); font-size: 14px; padding:8px 0; }
.pv-empty { margin:auto; text-align: center; color: var(--muted-2); font-size: 14px; padding:20px; line-height: 1.6; }

.pv-tabs { display: inline-flex; background: var(--surface-3); border-radius:var(--r-full); padding:4px; flex: none; }
.pv-tab { padding:8px 24px; border-radius:var(--r-full); font-size: var(--step--2); font-weight: 700; color: var(--muted); cursor: pointer; background: none; }
.pv-tab.active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-xs); }

/* ------------------------------------- POST TANLASH (qoida yaratish oynasi) */
#wPostsWrap[hidden] { display: none; }
.pgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap:8px; margin-top:4px;
}
.pgrid-empty {
  grid-column: 1 / -1; padding:16px; text-align: center;
  color: var(--muted); font-size: var(--step--2); background: var(--surface-2);
  border-radius:var(--r-md); line-height: 1.6;
}
/* Post ro'yxati kelmaganda: sabab o'qiladigan rangda, ostida ikki yo'l */
.pgrid-dead { display: grid; gap: 12px; justify-items: center; color: var(--ink); font-size: var(--step--1); }
.pgrid-dead p { margin: 0; max-width: 48ch; }
.pgrid-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pcard {
  display: flex; flex-direction: column; gap:4px; padding:0; text-align: left;
  background: none; border: 0; cursor: pointer; font: inherit; color: inherit;
}
.pcard-img {
  position: relative; display: block; aspect-ratio: 1; border-radius:var(--r-md);
  overflow: hidden; background: var(--surface-2); border: 2px solid transparent;
  transition: border-color .15s;
}
.pcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-ph { display: grid; place-items: center; height: 100%; font-size: 26px; opacity: .5; }
.pcard-tick {
  position: absolute; inset-block-start: 6px; inset-inline-end: 6px;
  width: 22px; height: 22px; border-radius:50%; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); font-size: 14px; font-weight: 700;
  opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s;
}
.pcard:hover .pcard-img { border-color: var(--border-2); }
.pcard.on .pcard-img { border-color: var(--brand); }
.pcard.on .pcard-tick { opacity: 1; transform: scale(1); }
.pcard-meta { font-size: 14px; color: var(--muted); }
.pcard-meta b { color: var(--ink-2); }
.pcard-cap {
  font-size: 14px; line-height: 1.4; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard.on .pcard-cap { color: var(--ink-2); }

/* Jonli ko'rinishdagi post satri */
.pv-post {
  display: flex; align-items: center; gap:8px; padding:8px 8px; margin-bottom:4px;
  background: var(--surface-2); border-radius:var(--r-md);
  font-size: 14px; color: var(--muted);
}
.pv-post img { width: 28px; height: 28px; border-radius:6px; object-fit: cover; flex: none; }
.pv-post-ph { width: 28px; height: 28px; display: grid; place-items: center; background: var(--surface-3); border-radius:6px; }

/* ---------------------------------------------------- QOIDANI SINASH */
.atest {
  display: flex; flex-wrap: wrap; align-items: center; gap:8px; margin-bottom:16px;
  padding:12px 16px; background: var(--surface-2); border-radius:var(--r-md);
}
.atest-l { font-size: var(--step--1); font-weight: 700; margin-inline-end: 4px; }
.atest .input { flex: 1 1 220px; min-width: 160px; width: auto; }
/* Bazadagi .select 100% kenglikda — bu yerda yonma-yon turishi kerak */
.atest .select { flex: 0 0 auto; width: auto; min-width: 132px; max-width: 240px; }
.atest .select[hidden] { display: none; }
.atest-out { margin-bottom:16px; display: grid; gap:8px; }
.atest-out[hidden] { display: none; }
.atest-hit b, .atest-miss b { font-size: var(--step--1); }
.atest-hit span, .atest-miss span { display: block; font-size: var(--step--2); color: var(--muted); margin-top:2px; line-height: 1.5; }
.atest-miss { padding:12px 16px; border-radius:var(--r-md); background: var(--warn-bg); }
.atest-miss b { color: var(--warn); }
.atest-row {
  display: flex; align-items: center; gap:8px; flex-wrap: wrap;
  padding:8px 16px; border: 1px solid var(--border); border-radius:var(--r-md);
}
.atest-row.dim { opacity: .55; }
.atest-n {
  width: 20px; height: 20px; flex: none; display: grid; place-items: center;
  border-radius:50%; background: var(--brand); color: var(--brand-ink); font-size: 14px; font-weight: 700;
}
.atest-row.dim .atest-n { background: var(--surface-3); color: var(--muted); }
.atest-acts { font-size: var(--step--2); color: var(--muted); }
.atest-stop { font-size: 14px; color: var(--brand); font-weight: 600; margin-inline-start: auto; }

/* ---------------------------------------------------- META SOZLASH PANELI */
.card-wide { grid-column: 1 / -1; }
.mset {
  margin-top:8px; padding:16px; border-radius:var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
}
.mset-d { margin-top:12px; }
.mset-d > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap:8px;
  font-size: var(--step--2); font-weight: var(--w-semibold); color: var(--brand);
}
.mset-d > summary::-webkit-details-marker { display: none; }
.mset-d > summary::before { content: '▸'; transition: transform .15s var(--ease); }
.mset-d[open] > summary::before { transform: rotate(90deg); }
.mset-h b { display: block; font-size: var(--step--1); }
.mset-h span { display: block; font-size: var(--step--2); color: var(--muted); line-height: 1.6; margin-top:4px; }
.mset-h code, .mset .hint code {
  font-family: var(--font-mono); font-size: .92em; background: var(--surface-3);
  padding:1px 4px; border-radius:4px;
}
.mset-s {
  margin:16px 0 8px; font-size: var(--step--2); font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.mrow { padding:8px 0; border-top: 1px solid var(--border); }
.mrow-t b { font-size: var(--step--2); }
.mrow-t span { font-size: 14px; color: var(--muted); margin-inline-start: 8px; }
.mrow-v { display: flex; align-items: center; gap:8px; margin-top:4px; }
.mrow-v code {
  flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius:6px;
  padding:8px 8px; overflow-x: auto; white-space: nowrap;
}
.mrow-v .btn { flex: none; }
.mset .hint { margin-top:16px; font-size: var(--step--2); color: var(--muted); line-height: 1.6; }

@media (max-width: 720px) {
  .mrow-v { flex-direction: column; align-items: stretch; }
  .mrow-v code { white-space: normal; word-break: break-all; }
}

/* ==================================================== NASHR KALENDARI */
.cal-top { display: flex; flex-wrap: wrap; gap:16px; align-items: center; justify-content: space-between; margin-bottom:16px; }
.cal-nav { display: flex; align-items: center; gap:8px; }
.cal-nav b { font-size: var(--step-1); min-width: 160px; }
.cal-tools { display: flex; align-items: center; gap:8px; }

.cal-warn { padding:12px 16px; margin-bottom:16px; border-radius:var(--r-md); background: var(--warn-bg); color: var(--warn); font-size: var(--step--2); line-height: 1.6; }
.cal-warn b { display: block; }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap:1px; background: var(--border); border: 1px solid var(--border); border-radius:var(--r-lg); overflow: hidden; }
.cal-wd { background: var(--surface-2); padding:8px 8px; font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-day { background: var(--bg); min-height: 112px; padding:8px 8px; display: flex; flex-direction: column; gap:4px; }
.cal-day.other { background: var(--surface); }
.cal-day.other .cal-d-h span { color: var(--muted-2); }
.cal-day.today .cal-d-h span { background: var(--brand); color: var(--brand-ink); border-radius:var(--r-full); width: 22px; height: 22px; display: grid; place-items: center; }
.cal-d-h { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; min-height: 22px; }
.cal-add { opacity: 0; border: 0; background: var(--surface-2); color: var(--muted); width: 20px; height: 20px; border-radius:6px; cursor: pointer; font-size: 14px; line-height: 1; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-add:hover { background: var(--brand); color: var(--brand-ink); }
.cal-d-b { display: flex; flex-direction: column; gap:4px; overflow: hidden; }

.cchip { display: flex; align-items: center; gap:4px; width: 100%; padding:4px 8px; border: 0; border-left: 3px solid var(--muted-2); border-radius:6px; background: var(--surface-2); cursor: pointer; font: inherit; font-size: 14px; text-align: left; color: var(--ink); }
.cchip:hover { background: var(--surface-3); }
.cchip.ig { border-left-color: #D946A0; }
.cchip.yt { border-left-color: #E5484D; }
.cchip.st-published { opacity: .62; }
.cchip.st-failed { border-left-color: var(--err); background: var(--err-bg); }
.cchip.st-publishing { border-left-color: var(--warn); }
.cchip-t { font-variant-numeric: tabular-nums; color: var(--muted); flex: none; }
.cchip-ic { flex: none; font-size: 13px; }
.cchip-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cal-list { display: grid; gap:8px; }
.crow { display: grid; grid-template-columns: auto 1fr auto; gap:16px; align-items: center; padding:16px 16px; background: var(--bg); border: 1px solid var(--border); border-radius:var(--r-lg); cursor: pointer; }
.crow:hover { border-color: var(--brand); }
.crow.st-published { opacity: .68; }
.crow-ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius:var(--r-md); background: var(--surface-2); font-size: 16px; }
.crow-b { min-width: 0; }
.crow-h { display: flex; align-items: center; gap:8px; }
.crow-badge { font-size: 14px; font-weight: 600; padding:2px 8px; border-radius:var(--r-full); background: var(--surface-2); color: var(--muted); }
.st-published .crow-badge { background: var(--ok-bg, var(--brand-50)); color: var(--ok, var(--brand)); }
.st-failed .crow-badge { background: var(--err-bg); color: var(--err); }
.crow-c { display: block; font-size: var(--step--2); color: var(--muted); margin-top:4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow-e { display: block; font-size: 14px; color: var(--err); margin-top:4px; }
.crow-r { text-align: right; }
.crow-r b { display: block; font-size: var(--step--1); }
.crow-r span { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ==================================================== NASHR OYNASI */
/* .modal-card `width: min(520px, 100%)` beradi — nashr oynasi ikki ustunli,
   shuning uchun kengroq. */
.pub-card { width: min(900px, 100%); max-width: 900px; }
.pub-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap:24px; }
.pub-left, .pub-right { display: flex; flex-direction: column; gap:4px; min-width: 0; }

.drop { display: block; border: 1.5px dashed var(--border-2); border-radius:var(--r-md); background: var(--surface-2); cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-50); }
.drop.locked { cursor: default; border-style: solid; }
.drop.locked:hover { border-color: var(--border-2); background: var(--surface-2); }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap:4px; padding:32px 16px; text-align: center; }
.drop-ic { font-size: 24px; }
.drop-empty b { font-size: var(--step--1); }
.drop-empty span { font-size: var(--step--2); color: var(--muted); }
.drop-file video, .drop-file img { width: 100%; max-height: 220px; object-fit: cover; display: block; background: #000; }
.drop-meta { display: flex; align-items: baseline; gap:8px; padding:8px 12px; }
.drop-meta b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-meta span { font-size: 14px; color: var(--muted); flex: none; }

.pub-when { margin-bottom:8px; }
.pub-when .wtoggle { margin-top:0; }
.pub-when .wfield-row { margin-top:8px; }
.pub-when .wfield-row[hidden] { display: none; }

.plats { display: flex; flex-direction: column; gap:8px; }
.plat { border: 1px solid var(--border); border-radius:var(--r-md); overflow: hidden; }
.plat.on { border-color: var(--brand); }
.plat-h { display: flex; align-items: center; gap:12px; padding:12px 16px; cursor: pointer; }
.plat-ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius:6px; background: var(--surface-2); font-size: 15px; }
.plat-t { flex: 1; min-width: 0; }
.plat-t b { display: block; font-size: var(--step--1); }
.plat-t span { font-size: 14px; color: var(--muted); }
.plat-b { display: flex; flex-direction: column; gap:8px; padding:0 16px 16px; border-top: 1px solid var(--border); padding-top:12px; }
.plat-b[hidden] { display: none; }
.plat-when[hidden] { display: none; }
.plat-b .hint { font-size: var(--step--2); color: var(--muted); }

.pub-foot { display: flex; align-items: center; gap:8px; }
.pub-del { margin-right:auto; color: var(--muted-2); }
.pub-del:hover { color: var(--err); }
.pub-status { font-size: var(--step--2); color: var(--muted); }

@media (max-width: 860px) {
  .pub-body { grid-template-columns: 1fr; }
  .cal-day { min-height: 78px; }
  .cchip-n { display: none; }
}

/* ------------------------------------------ INSTAGRAM ULANISHINI TEKSHIRISH */
/* Nom, holat va uchta tugma tor ustunga sig'maydi — tugmalar o'z qatoriga
   tushadi, ism va obunachilar soni bir-birining ustiga chiqmaydi. */
.ig-acc { display: flex; flex-wrap: wrap; align-items: center; gap:8px 8px; }
.ig-acc .conv-av { flex: none; }
.ig-acc .ig-acc-b { flex: 1 1 120px; min-width: 0; }
.ig-acc .ig-acc-b b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-acc .ig-acc-b span { display: block; font-size: var(--step--2); color: var(--muted); }
.ig-acc > .badge { flex: none; }
.ig-acc-act { display: flex; flex-wrap: wrap; gap:8px; flex: 1 1 100%; }
.ig-acc-act .btn { flex: 0 1 auto; }
.ig-acc-act .ig-del { margin-inline-start: auto; }
.ig-del { color: var(--muted-2); }
.ig-del:hover { color: var(--err); }
.ig-check { position: relative; margin:-4px 0 8px; padding:12px 32px 12px 16px; border-radius:var(--r-md); background: var(--surface-2); }
.ig-check-x {
  position: absolute; inset-block-start: 8px; inset-inline-end: 8px;
  width: 22px; height: 22px; padding:0; border: 0; border-radius:6px;
  background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1;
}
.ig-check-x:hover { background: var(--surface-3); color: var(--ink); }
.ig-check[hidden] { display: none; }
.ig-check-h { font-size: var(--step--1); font-weight: 700; margin-bottom:8px; }
.ig-check-h.ok { color: var(--ok, #17794C); }
.ig-check-h.bad { color: var(--err); }
.ig-check-row { display: grid; grid-template-columns: 16px 1fr; gap:4px 8px; align-items: baseline; font-size: var(--step--2); padding:4px 0; }
.ig-check-row span:last-child { grid-column: 2; }
@media (min-width: 900px) {
  .card-wide .ig-check-row { grid-template-columns: 16px 118px 1fr; }
  .card-wide .ig-check-row span:last-child { grid-column: auto; }
}
.ig-check-row b { font-weight: 600; }
.ig-check-row span:last-child { color: var(--muted); overflow-wrap: anywhere; }
.ig-check-i.ok { color: var(--ok, #17794C); }
.ig-check-i.bad { color: var(--err); }

/* ------------------------------------ ONBOARDING 4-BOSQICH: INSTAGRAM */
.onb-ig-card { text-align: center; }
.onb-ig-icon {
  width: 62px; height: 62px; margin:0 auto 16px; display: grid; place-items: center;
  border-radius:var(--r-lg); background: var(--brand-50); color: var(--brand);
}
.onb-ig-card h2 { margin-bottom:8px; }
.onb-ig-card .onb-lead { margin-inline: auto; max-width: 46ch; }
.onb-ig-status { margin:20px 0 4px; text-align: left; }
.onb-ig-hint {
  padding:12px 16px; border-radius:var(--r-md); background: var(--surface-2);
  font-size: var(--step--2); line-height: 1.6; color: var(--muted);
}
.onb-ig-hint b { color: var(--ink); }
.onb-ig-ok {
  padding:12px 16px; border-radius:var(--r-md);
  background: var(--brand-50); color: var(--brand);
  font-size: var(--step--1); font-weight: 600; text-align: center;
}
.onb-ig-sandbox {
  padding:12px 16px; border-radius:var(--r-md); background: var(--warn-bg);
  font-size: var(--step--2); line-height: 1.6;
}
.onb-ig-sandbox b { display: block; color: var(--warn); margin-bottom:4px; font-size: var(--step--1); }
.onb-ig-sandbox span { color: var(--muted); }
/* Uchta tugma bitta qatorga sig'sin: `.onb-nav .btn:last-child { margin-left:auto }`
   bu yerda ortiqcha — o'chiramiz. */
.onb-ig-card .onb-nav { justify-content: center; flex-wrap: wrap; }
.onb-ig-card .onb-nav .btn:last-child { margin-left:0; }
.onb-ig-card .onb-nav .btn { flex: 0 1 auto; }
@media (max-width: 520px) {
  .onb-ig-card .onb-nav { flex-direction: column-reverse; }
  .onb-ig-card .onb-nav .btn { width: 100%; }
}

/* Postlar ko'p bo'lganda: qidiruv + aylantiriladigan ro'yxat */
.pgrid-top { display: flex; align-items: center; gap:8px; margin-bottom:8px; }
.pgrid-top .input { flex: 1; width: auto; }
.pgrid-n { flex: none; font-size: var(--step--2); color: var(--muted); white-space: nowrap; }
.pgrid-wrap {
  max-height: 340px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--border); border-radius:var(--r-md); padding:8px;
}
.pgrid-wrap .pgrid { margin-top:0; }

/* Karusel: tanlangan fayllar tasmasi */
.drop-multi { display: block; margin-top:4px; font-size: 14px; color: var(--muted-2); }
.mstrip { display: flex; flex-wrap: wrap; gap:8px; margin-top:8px; }
.mstrip[hidden] { display: none; }
.mitem {
  position: relative; width: 54px; height: 54px; flex: none;
  border-radius:6px; overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--border);
}
.mitem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mitem-v { display: grid; place-items: center; height: 100%; font-size: 18px; }
.mitem-n {
  position: absolute; inset-block-start: 3px; inset-inline-start: 3px; z-index: 1;
  min-width: 16px; height: 16px; padding:0 4px; border-radius:6px;
  background: rgba(0, 0, 0, .62); color: #fff;
  font-size: 13px; font-weight: 700; line-height: 16px; text-align: center;
}
.mitem-x {
  position: absolute; inset-block-start: 3px; inset-inline-end: 3px; z-index: 1;
  width: 16px; height: 16px; padding:0; border: 0; border-radius:6px;
  background: rgba(0, 0, 0, .62); color: #fff;
  font-size: 13px; line-height: 16px; cursor: pointer;
}
.mitem-x:hover { background: var(--err); }

/* ---------------------------------------------------- WEBHOOK JURNALI */
.hook-head { display: grid; gap:4px; margin-bottom:16px; }
.hook-head code { font-family: var(--font-mono); font-size: 14px; }
.hooks { display: grid; gap:8px; max-height: 380px; overflow-y: auto; }
.hook { display: grid; grid-template-columns: 18px 1fr; gap:8px; padding:8px 12px; border-radius:var(--r-md); background: var(--surface-2); }
.hook.bad { background: var(--err-bg); }
.hook-i { font-weight: 700; }
.hook.ok .hook-i { color: var(--ok, #17794C); }
.hook.bad .hook-i { color: var(--err); }
.hook-h { display: flex; align-items: center; gap:8px; flex-wrap: wrap; font-size: var(--step--2); }
.hook-t { margin-inline-start: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.hook-x { font-size: var(--step--2); margin-top:2px; }
.hook-n { font-size: 14px; color: var(--muted); margin-top:2px; line-height: 1.5; }
.hook-raw { display: block; margin-top:4px; font-family: var(--font-mono); font-size: 13px; color: var(--muted-2); overflow-wrap: anywhere; }

/* ---------------------------------------------------- KARUSEL DIZAYNI */
.dz { margin:16px 0 16px; padding:16px; border-radius:var(--r-md); background: var(--surface-2); }
.dz-h { display: flex; align-items: center; gap:8px; flex-wrap: wrap; margin-bottom:12px; }
.dz-h > b { font-size: var(--step--1); }
.dz-themes { display: flex; gap:8px; }
/* Shrift oilasi: siqiq / nafis / yumaloq */
.dz-fams { display: inline-flex; gap:4px; padding:4px; border-radius:var(--r-full); background: var(--surface-3); margin-inline-end: auto; }
.dz-fams button { height: 28px; padding:0 12px; border:0; border-radius:var(--r-full); background: none; cursor: pointer;
  font: inherit; font-size: var(--step--2); font-weight: var(--w-medium); color: var(--label-3); }
.dz-fams button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-xs); }
.dz-fams button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.dz-th {
  width: 22px; height: 22px; padding:0; border-radius:50%; cursor: pointer;
  border: 2px solid var(--border-2); transition: transform .12s, border-color .12s;
}
.dz-th:hover { transform: scale(1.12); }
.dz-th.on { border-color: var(--brand); transform: scale(1.12); }
.dz-strip {
  display: flex; gap:8px; overflow-x: auto; padding-bottom:8px;
  scroll-snap-type: x mandatory;
}
.dz-item { position: relative; flex: none; scroll-snap-align: start; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; }
.dz-item:hover canvas { box-shadow: 0 0 0 2px var(--ink), 0 2px 10px rgba(0, 0, 0, .18); }
.dz-item:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.dz-item canvas {
  display: block; width: 168px; height: 210px; border-radius:10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.dz-n {
  position: absolute; inset-block-end: 8px; inset-inline-start: 8px;
  padding:2px 8px; border-radius:6px; background: rgba(0, 0, 0, .55);
  color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.hint-ok { color: var(--ok, #17794C); }
.hint-warn { color: var(--warn); }
.auto-sentence .a.a-warn { background: var(--warn-bg); color: var(--warn); }

/* ==================================================== KONTENT SUHBATI */
/* Bitta ustun — markazlash butun kenglikka nisbatan hisoblanadi. Suhbatlar
   tarixi alohida ustun EMAS (u markazni o'ngga surib yuborardi), balki
   pastda chizilib turadigan panel — asosiy kontent joyidan qo'zg'almaydi. */
.std { display: flex; flex-direction: column; min-height: 62vh; }
.std-top { display: flex; align-items: center; gap:8px; margin-bottom:16px; }
.std-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Bo'sh holat — katta so'rov maydoni, sahifa markaziga nisbatan o'rtada */
.std-hero { margin:auto; width: min(680px, 100%); text-align: center; padding:24px 0; }
.std-hero[hidden] { display: none; }
.std-hero h2 { font-size: var(--step-3); letter-spacing: -.02em; }
.std-hero > p { margin:8px auto 24px; max-width: 46ch; color: var(--muted); font-size: var(--step--1); line-height: 1.6; }

/* Suhbatlar tarixi — chapdan chiqadigan qoplama panel */
.std-drawer[hidden] { display: none; }
.std-drawer-back {
  position: fixed; inset: 0; background: rgba(10, 10, 15, .38);
  z-index: 60; animation: stdFade .15s ease;
}
.std-drawer-panel {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 61;
  width: min(300px, 86vw); background: var(--bg); border-inline-end: 1px solid var(--border);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  padding:16px 16px; animation: stdSlide .18s var(--ease-out, ease-out);
}
@keyframes stdFade { from { opacity: 0; } }
@keyframes stdSlide { from { transform: translateX(-100%); } }
.std-drawer-h { display: flex; align-items: center; justify-content: space-between; margin-bottom:16px; }
.std-drawer-h b { font-size: var(--step-0); }

.std-list { display: flex; flex-direction: column; gap:4px; overflow-y: auto; flex: 1; }
.std-item {
  display: flex; align-items: center; gap:8px; padding:8px 8px; border-radius:6px;
  cursor: pointer; font-size: var(--step--2); color: var(--ink-2);
}
.std-item:hover { background: var(--surface-2); }
.std-item.on { background: var(--brand-50); color: var(--brand); }
.std-item > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.std-x { flex: none; border: 0; background: none; color: var(--muted-2); cursor: pointer; font-size: 14px; opacity: 0; }
.std-item:hover .std-x { opacity: 1; }
.std-x:hover { color: var(--err); }
.std-empty { padding:8px; font-size: var(--step--2); color: var(--muted-2); }

.std-box {
  display: flex; align-items: flex-end; gap:8px; padding:12px 12px 12px 16px;
  border: 1px solid var(--border); border-radius:var(--r-lg); background: var(--bg);
  box-shadow: var(--shadow-xs);
}
.std-box:focus-within { border-color: var(--brand); }
.std-box textarea {
  flex: 1; border: 0; outline: none; resize: none; background: none; color: var(--ink);
  font: inherit; font-size: var(--step--1); line-height: 22px; max-height: 160px;
  /* Bir qatorda balandligi tugma bilan teng (38px): matn tugma bilan bir
     chiziqda, o'rtada turadi. Ko'p qatorda yuqoriga o'sadi, tugma pastda qoladi. */
  box-sizing: border-box; min-height: 38px; padding: 8px 0; margin: 0; overflow-y: auto;
}
.std-box-hero { padding:16px 16px 16px 20px; text-align: left; }
.std-send {
  flex: none; width: 38px; height: 38px; border: 0; border-radius:50%;
  background: var(--brand); color: var(--brand-ink); cursor: pointer; font-size: 17px; line-height: 1;
}
.std-send:hover { filter: brightness(1.08); }

.std-chips { display: flex; flex-wrap: wrap; gap:8px; justify-content: center; margin-top:16px; }
.std-chip {
  padding:8px 16px; border: 1px solid var(--border); border-radius:var(--r-full);
  background: var(--bg); color: var(--ink-2); cursor: pointer;
  font: inherit; font-size: var(--step--2);
}
.std-chip:hover { border-color: var(--brand); color: var(--brand); }

/* Suhbat */
.std-chat { display: flex; flex-direction: column; gap:16px; flex: 1; min-height: 0; }
.std-chat[hidden] { display: none; }
.std-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap:16px; padding-right:4px; max-height: 58vh; }
.std-msg { display: flex; flex-direction: column; gap:8px; max-width: 88%; }
.std-msg.user { align-self: flex-end; align-items: flex-end; }
.std-msg.assistant { align-self: flex-start; max-width: 100%; }
.std-bubble {
  padding:12px 16px; border-radius:var(--r-lg); font-size: var(--step--1);
  line-height: 1.62; white-space: pre-wrap; overflow-wrap: anywhere;
}
.std-msg.user .std-bubble { background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; }
.std-msg.assistant .std-bubble { background: var(--surface-2); border-bottom-left-radius: 6px; }
.std-art { width: 100%; }
.std-art .out-card { margin:0; }

.std-dots { display: inline-flex; gap:4px; align-items: center; height: 20px; }
.std-dots i { width: 6px; height: 6px; border-radius:50%; background: var(--muted-2); animation: stdb 1.1s infinite; }
.std-dots i:nth-child(2) { animation-delay: .15s; }
.std-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes stdb { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

#stdDrawerClose.std-x { opacity: 1; width: 26px; height: 26px; border-radius:6px; }
#stdDrawerClose.std-x:hover { background: var(--surface-2); color: var(--ink); }

/* ============================================================
   2-MIYYA — "Nima ishladi" (natija qatlami)
   Raqamlar ustunda tekis turishi uchun tabular-nums; jalb foizi
   kartaning asosiy o'lchovi, shuning uchun eng katta element.
   ============================================================ */
.learn-head { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; margin-bottom:24px; }
.learn-head h3 { margin:0 0 8px; font-size:19px; }
.learn-head .hint { margin:0; max-width:62ch; }
.learn-count { text-align:right; flex:0 0 auto; }
.learn-count b { display:block; font-size:30px; line-height:1; font-variant-numeric:tabular-nums; }
.learn-count span { font-size:14px; color:var(--muted); }
.learn-loading { color:var(--muted); font-size:14px; padding:24px 0; }

.learn-live { display:flex; gap:12px; align-items:flex-start; padding:16px 16px; border-radius:10px;
  background:color-mix(in srgb, var(--ok) 10%, transparent); border:1px solid rgba(34,197,94,.28); margin-bottom:20px; }
.learn-live b { display:block; font-size:14px; margin-bottom:2px; }
.learn-live span { font-size:14px; color:var(--muted); }
.learn-live--wait { background:var(--surface-2); border-color:var(--border); }
.learn-dot { width:8px; height:8px; border-radius:50%; background:var(--ok); margin-top:8px; flex:0 0 auto;
  box-shadow:0 0 0 0 rgba(34,197,94,.55); animation:learnPulse 2.4s ease-out infinite; }
@keyframes learnPulse { to { box-shadow:0 0 0 10px rgba(34,197,94,0); } }
@media (prefers-reduced-motion: reduce) { .learn-dot { animation:none; } }

.learn-grid { display:flex; flex-direction:column; gap:8px; }
.lcard { display:flex; align-items:center; gap:16px; padding:16px 16px; border:1px solid var(--border);
  border-radius:10px; background:var(--surface); }
.lcard--best { border-color:rgba(34,197,94,.45); }
.lcard--weak { opacity:.72; }
.lcard-rate { font-size:24px; font-weight:700; font-variant-numeric:tabular-nums; min-width:72px; line-height:1; }
.lcard-rate small { font-size:14px; font-weight:600; opacity:.6; margin-left:1px; }
.lcard--best .lcard-rate { color:var(--ok); }
.lcard--weak .lcard-rate { color:var(--muted); }
.lcard-main { flex:1; min-width:0; }
.lcard-main b { display:block; font-size:14px; margin-bottom:4px; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; }
.lcard-nums { display:flex; flex-wrap:wrap; gap:12px; font-size:14px; color:var(--muted);
  font-variant-numeric:tabular-nums; }
.lcard-link { font-size:14px; color:var(--muted); text-decoration:none; white-space:nowrap; flex:0 0 auto; }
.lcard-link:hover { color:var(--ink); text-decoration:underline; }
@media (max-width: 640px) {
  .learn-head { flex-direction:column; }
  .lcard { flex-wrap:wrap; }
  .lcard-rate { min-width:auto; }
}

.ref-list { display:flex; flex-direction:column; gap:8px; margin-top:16px; }
.ref-item { position:relative; padding:12px 40px 12px 16px; border:1px solid var(--border);
  border-radius:10px; background:var(--surface-2); }
.ref-item b { display:block; font-size:14px; margin-bottom:4px; }
.ref-item p { margin:0; font-size:14px; color:var(--muted); line-height:1.5; white-space:pre-wrap; }
.ref-del { position:absolute; top:8px; right:8px; width:26px; height:26px; border:0; border-radius:6px;
  background:transparent; color:var(--muted); cursor:pointer; font-size:14px; }
.ref-del:hover { background:var(--border); color:var(--ink); }

/* ============================================================
   MEDIA STUDIYASI (Higgsfield)
   Natija kartasi rasm ham, video ham bo'lishi mumkin — o'lcham
   bir xil turishi uchun media qismi qat'iy nisbatda.
   ============================================================ */
/* ==================== YARATISH SAHNASI ====================
   Qora sahna ikkala mavzuda ham bir xil: rasm va video qorong'i fonda
   yaxshiroq o'qiladi. Sahna ichida ranglar mahalliy qayta belgilanadi,
   shuning uchun ichidagi biriktirma, yuz tanlagich va izohlar alohida
   qoidasiz qorong'i ko'rinishga o'tadi. Lime faqat harakat joyida:
   yuborish tugmasi, fokus, tanlangan yuz. */
.stu-stage {
  --bg: var(--night-2); --surface: var(--night-2); --surface-2: var(--night-3);
  --surface-3: #30312B; --border: var(--night-bd); --border-2: #363731;
  --ink: var(--night-ink); --ink-2: #D9DAD2; --muted: var(--night-mut); --muted-2: #6E7068;
  --label-2: #D9DAD2; --label-3: var(--night-mut); --label-4: #6E7068;
  --brand: var(--lime); --brand-ink: var(--lime-ink); --brand-600: var(--lime-600);
  --brand-50: color-mix(in srgb, var(--lime) 14%, transparent);
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--night); color: var(--ink);
  border: 1px solid var(--night-bd); border-radius: var(--r-xl);
  padding: 56px 24px 32px;
}
.stu { position: relative; max-width: 760px; margin: 0 auto; text-align: center; }
.stu-h {
  display: flex; flex-direction: column; font-family: var(--font-display);
  font-weight: 600; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  line-height: 1.12; letter-spacing: -.045em; text-wrap: balance;
}
.stu-h2 { color: var(--night-mut); }
.stu-lead { margin-top: 12px; font-size: var(--step--1); color: var(--label-3); }

.comp {
  position: relative; margin-top: 40px; text-align: left;
  background: var(--night-2); border: 1px solid var(--border-2);
  border-radius: var(--r-lg); box-shadow: 0 24px 64px -24px rgba(0, 0, 0, .7);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
/* Ufq: katta doiraning faqat yuqori yoyi ko'rinadi, nur yuqoriga taraladi.
   Kompozitorga bog'langan — sarlavha qancha qator bo'lmasin, chiziq matn
   ustidan o'tmaydi. z-index -1: sahna fonidan yuqorida, qutining ortida. */
.comp::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: -28px;
  width: 1600px; aspect-ratio: 1; translate: -50% 0; border-radius: 50%; pointer-events: none;
  border-top: 1.5px solid color-mix(in srgb, var(--lime) 75%, #fff);
  background: radial-gradient(40% 14% at 50% 0%, color-mix(in srgb, var(--lime) 12%, var(--night)), var(--night) 100%);
  box-shadow: 0 -20px 64px -12px color-mix(in srgb, var(--lime) 42%, transparent);
}
.comp:focus-within {
  border-color: color-mix(in srgb, var(--lime) 55%, transparent);
  box-shadow: 0 0 0 4px var(--brand-50), 0 24px 64px -24px rgba(0, 0, 0, .7);
}
.comp-in {
  display: block; width: 100%; resize: none; border: 0; background: none;
  padding: 16px 16px 8px; font: inherit; font-size: var(--step-0);
  line-height: 1.5; color: var(--ink); min-height: 80px;
}
.comp-in:focus { outline: none; }
.comp-in::placeholder { color: var(--label-4); }
.comp-bar { display: flex; align-items: center; gap: 8px; padding: 8px; }
.comp-plus { border: 1px solid var(--border-2); color: var(--ink); }

/* Rasm / Video / UGC — bitta tanlov, uchta holat */
.seg {
  display: inline-flex; gap: 2px; padding: 4px; flex: none;
  border-radius: var(--r-full); background: var(--night-3);
}
.seg-b {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px;
  border: 0; border-radius: var(--r-full); background: none; cursor: pointer;
  font: inherit; font-size: var(--step--1); font-weight: var(--w-medium); color: var(--label-3);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.seg-b:hover { color: var(--ink); }
.seg-b[aria-checked="true"] { background: color-mix(in srgb, var(--night-ink) 13%, transparent); color: var(--ink); }
.seg-b:disabled { opacity: .4; cursor: not-allowed; }
.seg-b:focus-visible { outline: 2px solid var(--lime); outline-offset: 1px; }

/* Model tanlovi — yorliq ko'rinishida, ichida oddiy select (telefonda tizim ro'yxati ochiladi) */
.comp-pick {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  padding: 0 8px 0 12px; height: 36px; border-radius: var(--r-full);
  background: var(--surface-2); color: var(--label-2); cursor: pointer;
  font-size: var(--step--1); font-weight: var(--w-medium);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.comp-pick[hidden] { display: none; }
.comp-pick:hover { background: var(--surface-3); color: var(--ink); }
.comp-pick:focus-within { outline: 2px solid var(--lime); outline-offset: 1px; }
.comp-pick select {
  appearance: none; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; padding: 0; max-width: 180px; text-overflow: ellipsis;
}
.comp-pick select:focus { outline: none; }
.comp-pick select option { color: initial; background: initial; }
.comp-pick-c { flex: none; opacity: .6; }

.comp-price, .comp-quota {
  font-size: var(--step--2); color: var(--label-3); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.comp-quota { margin-left: auto; }
.comp-quota.is-low { color: var(--warn); font-weight: var(--w-semibold); }

.comp-send {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-full); background: var(--brand); color: var(--brand-ink);
  transition: background .15s var(--ease), opacity .15s var(--ease), transform .15s var(--ease);
}
.comp-send:hover { background: var(--brand-600); }
.comp-send:active { transform: scale(.94); }
.comp-send:disabled { opacity: .55; }
/* Ikonkali tugmada matnni almashtirib bo'lmaydi — aylanadigan belgi */
.comp-send.is-busy svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.comp-faces { display: flex; align-items: center; gap: 12px; margin-top: 12px; text-align: left; }
.comp-faces[hidden] { display: none; }
.comp-faces-l { font-size: var(--step--2); color: var(--label-3); flex: none; }

/* Tayyor boshlanishlar — tanlangan rejimga qarab almashadi */
.stu-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.stu-chip {
  padding: 8px 16px; border-radius: var(--r-full); cursor: pointer;
  border: 1px solid var(--border-2); background: none;
  font-family: inherit; font-size: var(--step--2); color: var(--label-3);
  transition: border-color .16s var(--ease), color .16s var(--ease), background .16s var(--ease);
}
.stu-chip[hidden] { display: none; }
.stu-chip:hover { border-color: color-mix(in srgb, var(--lime) 60%, transparent); color: var(--ink); background: var(--brand-50); }
.stu-chip:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* ==================== ISH KARTALARI ====================
   Har karta bitta ish. Ichida mijozning o'z oxirgi natijasi turadi;
   hali yo'q bo'lsa CSS bilan chizilgan namuna (tashqi rasm yuklanmaydi). */
.tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.tool {
  position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; isolation: isolate;
  padding: 0; border: 1px solid var(--night-bd); border-radius: var(--r-lg);
  background: var(--night-2); color: var(--night-ink); text-align: left; cursor: pointer; font: inherit;
  transition: transform .3s var(--ease-out), border-color .2s var(--ease);
}
.tool:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--lime) 50%, transparent); }
.tool:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.tool-vis, .tool-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.tool-media { background: var(--night-2); }
.tool-media:empty { display: none; }
.tool-media img, .tool-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s var(--ease-out);
}
.tool:hover .tool-media > * { transform: scale(1.04); }
/* Pastki qoraytirish — matn har qanday rasm ustida o'qilsin */
.tool::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, transparent 42%, rgba(10, 11, 9, .9) 100%);
}
.tool-t { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.tool-t b { font-size: var(--step-0); font-weight: var(--w-semibold); letter-spacing: -.02em; line-height: 1.2; }
/* Tavsif doim ikki qatorlik joy oladi — sarlavhalar bir chiziqda turadi */
.tool-t small { font-size: var(--step--2); line-height: 1.4; min-height: 2.8em; color: color-mix(in srgb, var(--night-ink) 70%, transparent); }
.tool-go {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; color: var(--night-ink);
  background: color-mix(in srgb, var(--night) 60%, transparent); backdrop-filter: blur(8px);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.tool:hover .tool-go { background: var(--lime); color: var(--lime-ink); }

/* Chizilgan namunalar: ikkita <i> va ::before bilan, hammasi yuqori 2/3 qismda */
.tool-vis i { position: absolute; display: block; }
.tv-image { background: radial-gradient(80% 55% at 70% 18%, color-mix(in srgb, var(--lime) 16%, transparent), transparent 70%), var(--night-2); }
.tv-image i { left: 26%; top: 12%; width: 48%; aspect-ratio: 4 / 5; border-radius: 10px; border: 1px solid #ffffff1f; }
.tv-image i:first-child { rotate: -9deg; translate: -14% 4%; background: var(--night-3); }
.tv-image i:last-child {
  rotate: 5deg; translate: 12% 0; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7);
  background:
    radial-gradient(circle at 68% 30%, var(--lime) 0 10px, transparent 11px),
    linear-gradient(155deg, transparent 58%, #0F100E 58.5%),
    linear-gradient(210deg, transparent 64%, #262722 64.5%),
    linear-gradient(180deg, #44463C, #1C1D19);
}

.tv-video { background: linear-gradient(180deg, #1F201C, var(--night)); }
.tv-video::before {
  content: ''; position: absolute; inset: 12% 12% 40%; border-radius: var(--r-md); border: 1px solid #ffffff17;
  background: repeating-linear-gradient(90deg, #ffffff08 0 14%, transparent 14% 28%), linear-gradient(135deg, #2D2E28, #1A1B17);
}
.tv-video i:first-child {
  left: 50%; top: 36%; width: 48px; height: 48px; translate: -50% -50%; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 0 8px color-mix(in srgb, var(--lime) 18%, transparent);
}
.tv-video i:first-child::after {
  content: ''; position: absolute; left: 19px; top: 15px;
  border-left: 14px solid var(--lime-ink); border-top: 9px solid transparent; border-bottom: 9px solid transparent;
}
.tv-video i:last-child {
  left: 12%; right: 12%; top: 64%; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--lime) 0 42%, #ffffff29 42%);
}

.tv-ugc { background: radial-gradient(70% 50% at 50% 28%, color-mix(in srgb, var(--lime) 14%, transparent), transparent 70%), var(--night-2); }
.tv-ugc::before {
  content: ''; position: absolute; left: 50%; top: 8%; width: 40%; aspect-ratio: 9 / 16; translate: -50% 0;
  border-radius: var(--r-md); border: 1.5px solid #ffffff2e; background: linear-gradient(180deg, #2C2D27, #1A1B17);
}
.tv-ugc::after {
  content: ''; position: absolute; left: 50%; top: 37%; width: 28%; height: 13%; translate: -50% 0;
  border-radius: 50% 50% 6px 6px / 100% 100% 6px 6px; background: linear-gradient(160deg, #55574C, #26271F);
}
.tv-ugc i:first-child {
  left: 50%; top: 18%; width: 17%; aspect-ratio: 1; translate: -50% 0; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #ffffff5c 0, transparent 45%),
    radial-gradient(circle at 70% 85%, color-mix(in srgb, var(--lime) 60%, transparent) 0, transparent 55%),
    linear-gradient(160deg, #6B6D62, #2E2F29);
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .3);
}
.tv-ugc i:last-child {
  right: 10%; top: 14%; width: 26%; height: 12%; border-radius: 10px 10px 10px 4px;
  background:
    linear-gradient(var(--lime-ink) 0 0) 10px 32% / 58% 2px no-repeat,
    linear-gradient(var(--lime-ink) 0 0) 10px 66% / 36% 2px no-repeat,
    var(--lime);
}

.tv-edit { background: var(--night-2); }
.tv-edit::before {
  content: ''; position: absolute; inset: 12% 12% 38%; border-radius: var(--r-md);
  background: radial-gradient(circle at 50% 50%, var(--lime) 0 30px, transparent 31px),
              linear-gradient(135deg, color-mix(in srgb, var(--lime) 28%, #1C1D19), #1C1D19);
}
.tv-edit i:first-child {
  left: 12%; top: 12%; bottom: 38%; width: 38%; border-radius: var(--r-md) 0 0 var(--r-md);
  background: radial-gradient(circle at 100% 50%, #8E9086 0 30px, transparent 31px),
              linear-gradient(135deg, #3A3B35, #24251F);
}
.tv-edit i:last-child { left: 50%; top: 9%; bottom: 35%; width: 2px; translate: -1px 0; background: var(--night-ink); }
.tv-edit i:last-child::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; translate: -50% -50%;
  border-radius: 50%; background: var(--night-ink); box-shadow: 0 0 0 4px rgba(0, 0, 0, .35);
}

.tv-face { background: radial-gradient(60% 45% at 50% 32%, color-mix(in srgb, var(--lime) 18%, transparent), transparent 70%), var(--night-2); }
.tv-face i:first-child {
  left: 50%; top: 12%; width: 34%; aspect-ratio: 1; translate: -50% 0; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #ffffff66 0, transparent 45%),
    radial-gradient(circle at 70% 85%, color-mix(in srgb, var(--lime) 70%, transparent) 0, transparent 55%),
    linear-gradient(160deg, #5C5E54, #232420);
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, .35), inset 0 8px 14px rgba(255, 255, 255, .12);
}
.tv-face i:last-child {
  left: 50%; top: 45%; width: 64%; height: 26%; translate: -50% 0;
  border-radius: 50% 50% 0 0 / 80% 80% 0 0;
  background: radial-gradient(circle at 35% 20%, #ffffff2e, transparent 50%), linear-gradient(160deg, #4A4C43, #1C1D19);
  box-shadow: inset 0 2px 0 color-mix(in srgb, var(--lime) 60%, transparent);
}

.stu-gal { margin-top: 32px; }
.stu-gal[hidden] { display: none; }
.stu-gal-h { display: flex; align-items: center; gap: 12px; }
.stu-gal-h h3 { font-size: var(--step-0); }
.stu-gal-h > *:last-child { margin-left: auto; }

/* Kartalar sig'masa yonga suriladi — sahifa emas, faqat shu qator */
@media (max-width: 1100px) {
  .tools {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(200px, 30%);
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
  }
  .tools::-webkit-scrollbar { display: none; }
  .tool { scroll-snap-align: start; }
}
@media (max-width: 640px) {
  .stu-stage { padding: 40px 16px 24px; border-radius: var(--r-lg); }
  .comp::before { width: 820px; }
  /* 1-qator: "+" va rejim. 2-qator: model (qolgan joyga sig'adi), limit, yuborish */
  .comp-bar { flex-wrap: wrap; }
  .seg { flex: 1 0 calc(100% - 44px); }
  .seg-b { flex: 1; justify-content: center; padding: 0 8px; }
  .comp-pick { flex: 1 1 0; min-width: 0; }
  .comp-pick select { width: 100%; max-width: none; min-width: 0; }
  .stu-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none;
    margin-inline: -16px; padding-inline: 16px; }
  .stu-chips::-webkit-scrollbar { display: none; }
  .stu-chip { flex: none; }
  .tools { grid-auto-columns: 62%; }
}
@media (prefers-reduced-motion: reduce) {
  .tool, .tool-media img, .tool-media video, .comp-send { transition: none; }
  .tool:hover, .tool:hover .tool-media > * { transform: none; }
}

.std-note { padding:8px 12px; border-radius:var(--r-md); font-size:var(--step--2); line-height:1.5;
  border:1px solid var(--border); background:var(--surface-2); color:var(--label-2); margin-bottom:16px; }
.std-note:empty { display: none; }
.hfcard-sum { font-size: var(--step--2); color: var(--label-3); margin-top:4px; }
.hfcard-ai { margin-top:8px; font-size: var(--step--2); }
.hfcard-ai > summary { cursor: pointer; color: var(--brand); font-weight: var(--w-medium); }
.hfcard-ai p { margin-top:4px; color: var(--label-2); line-height: 1.45; }
   /* bo'sh eslatma kulrang chiziq bo'lib qolmasin */
.std-note code { font-size:14px; padding:1px 4px; border-radius:4px; background:var(--border); }

.hfgrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:16px; margin-top:16px; }
.hfcard { border:1px solid var(--border); border-radius:14px; overflow:hidden; background:var(--surface);
  display:flex; flex-direction:column; }
.hfcard-media { aspect-ratio:4/5; background:var(--surface-2); overflow:hidden; }
.hfcard-media img, .hfcard-media video { width:100%; height:100%; object-fit:cover; display:block; }
.hfcard-ph { width:100%; height:100%; display:flex; align-items:center; justify-content:center;
  font-size:14px; color:var(--muted); }
.hfcard--busy .hfcard-ph { animation:hfPulse 1.6s ease-in-out infinite; }
@keyframes hfPulse { 50% { opacity:.45; } }
@media (prefers-reduced-motion: reduce) { .hfcard--busy .hfcard-ph { animation:none; } }
.hfcard-body { padding:12px 12px 12px; display:flex; flex-direction:column; gap:8px; flex:1; }
.hfcard-prompt { margin:0; font-size:14px; line-height:1.5; color:var(--muted);
  display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.hfcard-err { margin:0; font-size:14px; line-height:1.5; color:var(--warn); }
.hfcard-foot { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:auto;
  padding-top:8px; font-size:14px; }
.hfcard-foot span { color:var(--muted); font-variant-numeric:tabular-nums; }
.hfcard-foot a, .hfcard-foot button { border:0; background:none; padding:0; cursor:pointer;
  font-size:14px; color:var(--muted); text-decoration:none; font-family:inherit; }
.hfcard-foot a:hover, .hfcard-foot button:hover { color:var(--ink); text-decoration:underline; }
@media (max-width: 560px) {
  .hf-row { flex-direction:column; align-items:stretch; }
  .hf-quota { text-align:left; }
}

/* ============================================================
   JAMOA VA ROLLAR
   ============================================================ */
.team-seats { font-size:14px; color:var(--muted); font-variant-numeric:tabular-nums; }
.tm { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); }
.tm:last-of-type { border-bottom:0; }
.tm-b { flex:1; min-width:0; }
.tm-b b { display:block; font-size:14px; }
.tm-b span { font-size:14px; color:var(--muted); }
.tm-x { width:28px; height:28px; border:0; border-radius:6px; background:transparent;
  color:var(--muted); cursor:pointer; font-size:14px; flex:0 0 auto; }
.tm-x:hover { background:var(--border); color:var(--ink); }
.select-sm { width:auto; min-width:150px; padding:8px 8px; font-size:14px; }

.team-invite { display:flex; gap:8px; flex-wrap:wrap; margin-top:16px;
  padding-top:16px; border-top:1px solid var(--border); }
.team-invite .input { flex:1; min-width:200px; }
.team-invite .select { width:auto; min-width:170px; }
.team-link { margin-top:16px; padding:12px 16px; border-radius:10px; font-size:14px;
  background:var(--surface-2); border:1px solid var(--border);
  display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.team-link code { flex:1; min-width:220px; font-size:14px; word-break:break-all; color:var(--muted); }

/* Ish maydoni almashtirgichi */
.wsw { position:relative; }
.wsw-btn { display:flex; align-items:center; gap:8px; padding:8px 8px; border-radius:10px;
  border:1px solid var(--border); background:var(--surface); color:var(--ink);
  cursor:pointer; font-family:inherit; font-size:14px; max-width:230px; }
.wsw-btn b { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wsw-dot { width:6px; height:6px; border-radius:50%; background:var(--brand); flex:0 0 auto; }
.wsw-role { font-size:14px; color:var(--muted); white-space:nowrap; }
.wsw-menu { position:absolute; top:calc(100% + 6px); right:0; z-index:40; min-width:230px;
  border:1px solid var(--border); border-radius:10px; background:var(--surface);
  box-shadow:0 12px 32px rgba(0,0,0,.16); overflow:hidden; }
.wsw-menu button { display:block; width:100%; text-align:left; padding:8px 12px; border:0;
  background:none; color:var(--ink); cursor:pointer; font-family:inherit; }
.wsw-menu button:hover { background:var(--surface-2); }
.wsw-menu button.is-cur { background:var(--surface-2); }
.wsw-menu b { display:block; font-size:14px; font-weight:600; }
.wsw-menu span { font-size:14px; color:var(--muted); }

.role-note { padding:8px 16px; font-size:14px; color:var(--muted);
  background:var(--surface-2); border-bottom:1px solid var(--border); }
.role-note b { color:var(--ink); font-weight:600; }

/* ============================================================
   AI MARKETING JAMOASI
   Qadamlar ro'yxati jamoa qanday ishlayotganini ko'rsatadi —
   shuning uchun holat belgisi rangdan tashqari shaklda ham farq
   qiladi (rang ko'rmaydiganlar uchun).
   ============================================================ */
.crew-pane { display:none; }
.crew-pane.active { display:block; }

.crew-hero { display:flex; justify-content:space-between; align-items:flex-start; gap:24px;
  margin-bottom:24px; flex-wrap:wrap; }
.crew-hero h2 { margin:0 0 8px; font-size:21px; }
.crew-hero p { margin:0; max-width:64ch; color:var(--muted); font-size:14px; line-height:1.65; }
.crew-acc { flex:0 0 auto; text-align:right; max-width:260px; }
.crew-acc b { display:block; font-size:15px; }
.crew-acc span { font-size:14px; color:var(--muted); line-height:1.5; display:block; }

.crew-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(196px, 1fr)); gap:16px; margin-bottom:24px; }
.agent-card { padding:16px 16px; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.agent-ic { font-size:22px; line-height:1; margin-bottom:12px; }
.agent-card b { display:block; font-size:15px; }
.agent-role { display:block; font-size:14px; color:var(--brand); margin:2px 0 8px; font-weight:600; }
.agent-card p { margin:0; font-size:14px; line-height:1.6; color:var(--muted); }

.crew-quota { font-size:14px; color:var(--muted); }
.crew-form { display:flex; gap:16px; flex-wrap:wrap; }
.crew-form > div:first-child { flex:0 0 auto; }
.crew-form .select { width:auto; min-width:130px; }
.crew-goal { flex:1; min-width:240px; }

/* Ishlar */
.run-row { display:flex; align-items:center; gap:12px; padding:12px 16px; border:1px solid var(--border);
  border-radius:10px; background:var(--surface); cursor:pointer; margin-bottom:8px; }
.run-row:hover { border-color:var(--muted); }
.run-b { flex:1; min-width:0; }
.run-b b { display:block; font-size:14px; }
.run-b span { font-size:14px; color:var(--muted); }
.run-dot { width:8px; height:8px; border-radius:50%; background:var(--muted); flex:0 0 auto; }
.run-dot.run-done { background:var(--ok); }
.run-dot.run-failed { background:var(--err); }
.run-dot.run-running { background:var(--warn); animation:hfPulse 1.4s ease-in-out infinite; }

.run-head { display:flex; align-items:center; gap:12px; margin:20px 0 16px; }
.run-head h3 { margin:0; font-size:18px; }

.steps { display:flex; flex-direction:column; gap:2px; }
.step { display:flex; gap:12px; align-items:flex-start; padding:12px 16px; border-radius:10px; }
.step--running { background:var(--surface-2); }
.step--failed .step-m { color:var(--err); }
.step--done .step-m { color:var(--ok); }
.step--skipped { opacity:.6; }
.step-m { font-size:14px; line-height:1.5; width:14px; flex:0 0 auto; color:var(--muted); }
.step--running .step-m { animation:hfPulse 1.2s ease-in-out infinite; }
.step-b b { display:block; font-size:13.5px; }
.step-b span { font-size:14px; color:var(--muted); }

/* Tahlil chizmasi */
.an-rows { display:flex; flex-direction:column; gap:8px; }
.an-row { display:flex; align-items:center; gap:12px; font-size:14px; }
.an-row > span:first-child { width:90px; flex:0 0 auto; color:var(--muted); }
.an-row b { width:48px; text-align:right; font-variant-numeric:tabular-nums; }
.an-bar { flex:1; height:8px; border-radius:4px; background:var(--border); overflow:hidden; }
.an-bar i { display:block; height:100%; background:var(--brand); border-radius:4px; }
.an-bar--alt i { background:var(--ok); }
.an-read { margin:16px 0 0; font-size:13.5px; line-height:1.7; color:var(--muted); white-space:pre-wrap; }

.pillars { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:12px; margin:24px 0; }
.pillar { padding:12px 16px; border:1px solid var(--border); border-radius:10px; background:var(--surface); }
.pillar b { display:block; font-size:13.5px; margin-bottom:4px; }
.pillar span { font-size:14px; color:var(--muted); line-height:1.55; }

.plan-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:24px 0 16px; }
.plan-head h3 { margin:0; font-size:17px; }
.plan-list { display:flex; flex-direction:column; gap:8px; }
.pday { display:flex; gap:16px; padding:16px 16px; border:1px solid var(--border);
  border-radius:10px; background:var(--surface); }
.pday-when { width:160px; flex:0 0 auto; display:flex; flex-direction:column; gap:8px; align-items:flex-start; }
.pday-when b { font-size:14px; font-variant-numeric:tabular-nums; }
.pday-b { flex:1; min-width:0; }
.pday-b b { display:block; font-size:14px; margin-bottom:4px; }
.pday-b p { margin:0; font-size:14px; line-height:1.6; color:var(--muted); white-space:pre-wrap; }
.pday-slides { display:inline-block; margin-top:8px; font-size:14px; color:var(--brand); }
.pday-pillar { flex:0 0 auto; font-size:14px; color:var(--muted); align-self:flex-start; }

/* Xotira */
.mem-head { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; margin-bottom:16px; }
.mem-head h3 { margin:0 0 8px; font-size:18px; }
.mem-head .hint { margin:0; max-width:66ch; }
.mem-count { text-align:right; flex:0 0 auto; }
.mem-count b { display:block; font-size:26px; line-height:1; font-variant-numeric:tabular-nums; }
.mem-count span { font-size:14px; color:var(--muted); }
.mem { padding:16px 16px; border:1px solid var(--border); border-radius:10px;
  background:var(--surface); margin-bottom:8px; }
.mem-t { display:flex; align-items:center; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.mem-t b { font-size:14px; }
.mem-agent { font-size:14px; color:var(--muted); }
.mem-x { margin-left:auto; width:24px; height:24px; border:0; border-radius:6px; background:transparent;
  color:var(--muted); cursor:pointer; font-size:14px; }
.mem-x:hover { background:var(--border); color:var(--ink); }
.mem p { margin:0; font-size:14px; line-height:1.65; color:var(--muted); }
.mem-src { display:block; margin-top:8px; font-size:14px; color:var(--muted); opacity:.8; }

@media (max-width: 720px) {
  .pday { flex-direction:column; gap:8px; }
  .pday-when { width:auto; flex-direction:row; align-items:center; }
  .crew-hero { flex-direction:column; }
  .crew-acc { text-align:left; }
}

/* -------------------------------------------- Jamoa suhbati va faoliyati */
.agent-card { display:flex; flex-direction:column; }
.agent-last { margin-top:12px; padding-top:8px; border-top:1px solid var(--border); font-size:14px; }
.agent-last b { display:block; font-size:14px; font-weight:600; line-height:1.5;
  color:var(--ink); margin-bottom:2px; }
.agent-last span { color:var(--muted); }
.agent-last.is-idle, .agent-last.is-skip { color:var(--muted); }
.agent-ask { margin-top:8px; align-self:flex-start; padding:4px 12px; border-radius:6px;
  border:1px solid var(--border); background:none; color:var(--muted);
  cursor:pointer; font-family:inherit; font-size:14px; }
.agent-ask:hover { color:var(--ink); border-color:var(--muted); }

.cchat { display:flex; flex-direction:column; height:min(70vh, 640px);
  border:1px solid var(--border); border-radius:14px; background:var(--surface); overflow:hidden; }
.cchat-log { flex:1; overflow-y:auto; padding:20px; display:flex; flex-direction:column; gap:16px; }
.cmsg { display:flex; gap:12px; max-width:78%; }
.cmsg--user { align-self:flex-end; flex-direction:row-reverse; }
.cmsg-ic { width:30px; height:30px; border-radius:10px; flex:0 0 auto;
  display:flex; align-items:center; justify-content:center; font-size:15px;
  background:var(--surface-2); }
.cmsg-b { min-width:0; }
.cmsg-who { display:block; font-size:14px; color:var(--muted); margin-bottom:4px; font-weight:600; }
.cmsg--user .cmsg-who { text-align:right; }
.cmsg-b p { margin:0; padding:12px 16px; border-radius:14px; font-size:13.5px; line-height:1.65;
  white-space:pre-wrap; background:var(--surface-2); }
.cmsg--user .cmsg-b p { background:var(--brand); color:var(--brand-ink); }

.cchat-chips { display:flex; gap:8px; flex-wrap:wrap; padding:0 20px 4px; }
.cchat-chips button { padding:8px 12px; border-radius:20px; border:1px solid var(--border);
  background:none; color:var(--muted); cursor:pointer; font-family:inherit; font-size:14px; }
.cchat-chips button:hover { color:var(--ink); border-color:var(--muted); }
.cchat-form { display:flex; gap:8px; padding:16px 20px; border-top:1px solid var(--border); }
.cchat-form .input { flex:1; }

.acts { display:flex; flex-direction:column; gap:2px; }
.act { display:flex; gap:12px; align-items:flex-start; padding:12px 16px; border-radius:10px; }
.act:hover { background:var(--surface-2); }
.act--skipped { opacity:.62; }
.act-ic { width:26px; height:26px; border-radius:6px; flex:0 0 auto; font-size:14px;
  display:flex; align-items:center; justify-content:center;
  background:var(--surface-2); }
.act-b { flex:1; min-width:0; }
.act-b b { display:block; font-size:13.5px; margin-bottom:2px; }
.act-verb { font-weight:400; color:var(--muted); font-size:14px; }
.act-b > span { font-size:14px; color:var(--muted); line-height:1.55; }
.act-t { font-size:14px; color:var(--muted); flex:0 0 auto; white-space:nowrap; }
.act--failed .act-ic { background:rgba(239,68,68,.14); }

@media (max-width: 620px) {
  .cmsg { max-width:92%; }
  .act { flex-wrap:wrap; }
}

/* ============================================================
   2-MIYYA XARITASI
   Foizli joylashuv: konteyner o'lchami o'zgarsa tugunlar
   nisbatini saqlaydi va qayta hisoblash kerak bo'lmaydi.
   ============================================================ */
.bmap { position:relative; width:100%; aspect-ratio:16/10; min-height:440px; max-height:640px;
  border:1px solid var(--border); border-radius:20px; overflow:hidden;
  background:
    radial-gradient(circle at 50% 50%, var(--surface-2) 0%, transparent 62%),
    var(--surface);
}
.bmap::before { /* nuqtali to'r — chuqurlik hissi */
  content:''; position:absolute; inset:0; opacity:.5;
  background-image:radial-gradient(currentColor .5px, transparent .5px);
  background-size:22px 22px; color:var(--border); pointer-events:none;
}
.bmap-lines { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
/* preserveAspectRatio="none" chizmani cho'zadi — chiziq qalinligi
   buzilmasligi uchun non-scaling-stroke shart. Qatlamlar turli
   quyuqlikda: to'r fon, nurlar asosiy, poya eng aniq. */
.bmap-lines line { vector-effect:non-scaling-stroke; stroke:var(--border); }
.bmap-lines .ln-web   { stroke-width:1; opacity:.30; }
.bmap-lines .ln-ring  { stroke-width:1; opacity:.55; }
.bmap-lines .ln-spoke { stroke-width:1.2; opacity:.85; }
.bmap-lines .ln-stem  { stroke-width:1; opacity:.65; stroke-dasharray:3 3; }

.bmap-core { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  display:flex; flex-direction:column; align-items:center; gap:12px; z-index:3; pointer-events:none; }
.bmap-orb { width:52px; height:52px; border-radius:50%;
  background:radial-gradient(circle at 38% 34%, #fff 0%, var(--brand) 58%, transparent 72%);
  box-shadow:0 0 42px 8px color-mix(in srgb, var(--brand) 35%, transparent); }
.bmap-title { text-align:center; }
.bmap-title b { display:block; font-size:14px; }
.bmap-title span { font-size:14px; color:var(--muted); font-variant-numeric:tabular-nums; }

.bnode { position:absolute; transform:translate(-50%,-50%); z-index:2;
  display:flex; flex-direction:column; align-items:center; gap:4px;
  border:0; background:none; cursor:pointer; font-family:inherit; padding:4px; }
.bnode-ic { width:34px; height:34px; border-radius:10px; display:flex; align-items:center;
  justify-content:center; font-size:15px; border:1px solid var(--border);
  background:var(--surface); color:var(--muted); transition:border-color .16s, color .16s; }
.bnode:hover .bnode-ic, .bnode.is-on .bnode-ic { border-color:var(--brand); color:var(--ink); }
.bnode-l { font-size:14px; color:var(--muted); white-space:nowrap; }
.bnode.is-on .bnode-l { color:var(--ink); font-weight:600; }
.bnode-n { position:absolute; top:-3px; right:-1px; min-width:16px; height:16px; padding:0 4px;
  border-radius:6px; background:var(--brand); color:var(--brand-ink); font-size:13px;
  display:flex; align-items:center; justify-content:center; font-variant-numeric:tabular-nums; }

.bcard { position:absolute; transform:translate(-50%,-50%); z-index:1;
  width:min(215px, 26vw); text-align:left; padding:12px 12px; border-radius:10px;
  border:1px solid var(--border); background:var(--surface); cursor:pointer;
  font-family:inherit; transition:border-color .16s, transform .16s; }
.bcard:hover { border-color:var(--brand); transform:translate(-50%,-50%) scale(1.03); }
.bcard b { display:block; font-size:14px; margin-bottom:4px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bcard span { display:-webkit-box; -webkit-line-clamp:4; line-clamp:4; -webkit-box-orient:vertical;
  overflow:hidden; font-size:14px; line-height:1.5; color:var(--muted); }

.bmap-empty { position:absolute; left:50%; top:64%; transform:translateX(-50%);
  width:min(440px, 86%); text-align:center; }
.bmap-empty b { display:block; font-size:14px; margin-bottom:8px; }
.bmap-empty span { font-size:14px; color:var(--muted); line-height:1.65; }
/* Bosilsa quyidagi maydonni to'ldiradi — "nima yozay?" savoliga javob */
.bmap-eg { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin-top:16px; }
.bmap-eg-b {
  border:1px solid var(--border-2); background:var(--bg); cursor:pointer;
  padding:8px 16px; border-radius:var(--r-full); font-family:inherit;
  font-size:var(--step--2); font-weight:var(--w-medium); color:var(--label-2);
  transition: all .16s var(--ease);
}
.bmap-eg-b:hover { border-color:var(--brand); color:var(--brand); background:var(--brand-50); }

.bmap-list { margin-top:16px; border:1px solid var(--border); border-radius:14px;
  background:var(--surface); overflow:hidden; }
.bmap-list-h { display:flex; align-items:center; gap:8px; padding:12px 16px;
  border-bottom:1px solid var(--border); }
.bmap-list-h b { font-size:14px; }
.bmap-list-h span { font-size:14px; color:var(--muted); flex:1; }
.brow { display:block; width:100%; text-align:left; padding:12px 16px; border:0;
  border-bottom:1px solid var(--border); background:none; cursor:pointer; font-family:inherit; }
.brow:last-child { border-bottom:0; }
.brow:hover { background:var(--surface-2); }
.brow b { display:block; font-size:13.5px; color:var(--ink); margin-bottom:4px; }
.brow span { font-size:14px; color:var(--muted); line-height:1.55; }
.brow em { display:inline-block; margin-top:8px; font-style:normal; font-size:14px;
  color:var(--brand); }

.bmap-add { margin-top:16px; border:1px solid var(--border); border-radius:14px;
  background:var(--surface); padding:16px 16px; }
.bmap-add textarea { width:100%; border:0; background:none; color:var(--ink);
  font-family:inherit; font-size:14px; line-height:1.6; resize:none; outline:none; }
.bmap-add textarea::placeholder { color:var(--muted); }
.bmap-add-r { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:8px; }
.bmap-send { width:36px; height:36px; border-radius:50%; border:0; cursor:pointer;
  background:var(--brand); color:var(--brand-ink); display:flex; align-items:center; justify-content:center; }
.bmap-send:hover { filter:brightness(1.08); }

.bedit-f { display:flex; justify-content:space-between; gap:12px; margin-top:24px; }

/* Xarita o'rnini bosuvchi ro'yxat — faqat kichik ekranda ko'rinadi */
.bmap-kinds { display:none; }
.bkind {
  display:flex; align-items:center; gap:12px; width:100%; text-align:left;
  padding:12px 16px; border:1px solid var(--border); border-radius:var(--r-md);
  background:var(--bg); cursor:pointer; font-family:inherit;
}
.bkind.is-on { border-color:var(--brand); background:var(--brand-50); }
.bkind b { font-size:var(--step--1); flex:1; }
.bkind span { font-size:var(--step--2); color:var(--label-3); }

@media (max-width: 860px) {
  /* Kichik ekranda xarita o'qib bo'lmaydi — ro'yxat foydaliroq */
  .bmap { display:none; }
  .bmap-kinds { display:grid; gap:8px; margin-bottom:16px; }
  .bmap-list { margin-top:0; }
}

/* -------------------------------------------------- Brend yuzi va UGC */
.hf-faces { display:flex; gap:8px; flex-wrap:wrap; margin-top:4px; }
.fpick { width:74px; padding:0; border:2px solid transparent; border-radius:10px;
  background:none; cursor:pointer; font-family:inherit; overflow:hidden; }
.fpick img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:10px; display:block;
  border:1px solid var(--border); }
.fpick span { display:block; font-size:14px; color:var(--muted); margin-top:4px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fpick.is-on { border-color:var(--brand); }
.fpick.is-on span { color:var(--ink); font-weight:600; }

.face-new { display:grid; grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));
  gap:24px; margin-bottom:24px; }
.face-new-c b { display:block; font-size:14px; margin-bottom:4px; }
.face-new-c > span { display:block; font-size:14px; color:var(--muted);
  line-height:1.6; margin-bottom:12px; }
.face-up { display:inline-flex; cursor:pointer; }

.facegrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(178px, 1fr)); gap:16px; }
.facecard { border:1px solid var(--border); border-radius:14px; overflow:hidden; background:var(--surface); }
.facecard.is-def { border-color:var(--brand); }
.facecard img { width:100%; aspect-ratio:4/5; object-fit:cover; display:block; }
.facecard-b { padding:12px 12px 12px; }
.facecard-b b { display:block; font-size:13.5px; margin-bottom:4px; }
.facecard-a { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.facecard-a button { border:0; background:none; padding:0; cursor:pointer;
  font-family:inherit; font-size:14px; color:var(--muted); }
.facecard-a button:hover { color:var(--ink); text-decoration:underline; }

.hfcard-note { display:block; font-size:14px; color:var(--brand); font-weight:600; }

.crew-acc b.is-warn { color:var(--warn); }
.crew-acc-r { margin-top:8px; margin-left:8px; padding:4px 12px; border-radius:6px;
  border:1px solid var(--border); background:none; color:var(--muted);
  cursor:pointer; font-family:inherit; font-size:14px; }
.crew-acc-r:hover { color:var(--ink); border-color:var(--muted); }

.cmsg-warn { margin-top:8px; padding:8px 12px; border-radius:10px; font-size:14px;
  background:color-mix(in srgb, var(--warn) 12%, transparent);
  border:1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.cmsg-warn b { display:block; font-size:14px; margin-bottom:4px; }
.cmsg-warn span { display:block; color:var(--muted); line-height:1.55; }
.cmsg-warn button { margin-top:8px; border:0; background:none; padding:0; cursor:pointer;
  font-family:inherit; font-size:14px; color:var(--brand); font-weight:600; }
.cmsg-warn button:hover { text-decoration:underline; }

/* ============================================================
   AI MODELLARI VA TAQQOSLASH
   Narx ustuni tabular-nums bilan — raqamlar tekis turishi
   taqqoslashni ancha osonlashtiradi.
   ============================================================ */
.mdl-slot { display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:12px 0; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.mdl-slot:last-of-type { border-bottom:0; }
.mdl-slot b { display:block; font-size:14px; }
.mdl-slot > div > span { font-size:14px; color:var(--muted); font-variant-numeric:tabular-nums; }
.mdl-slot .select { width:auto; min-width:280px; }

.mdl-all { margin-top:16px; }
.mdl-all summary { cursor:pointer; font-size:14px; color:var(--muted); padding:8px 0; }
.mdl-all summary:hover { color:var(--ink); }
.mdl-t { width:100%; border-collapse:collapse; margin-top:12px; font-size:14px; }
.mdl-t th { text-align:left; font-size:14px; color:var(--muted); font-weight:600;
  padding:8px 8px; border-bottom:1px solid var(--border); }
.mdl-t td { padding:8px 8px; border-bottom:1px solid var(--border); vertical-align:top; }
.mdl-t td:last-child { color:var(--muted); font-size:14px; line-height:1.55; }
.mdl-t .num { font-variant-numeric:tabular-nums; white-space:nowrap; }
.mdl-t tr.is-off { opacity:.5; }

.mdl-try { margin-top:24px; padding-top:24px; border-top:1px solid var(--border); }
.mdl-try-r { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.mdl-try-r .select { width:auto; min-width:220px; }
.mdl-pick { display:flex; gap:16px; flex-wrap:wrap; margin:16px 0; }
.mdl-chk { font-size:14px; }

.cmp-q { font-size:14px; color:var(--muted); line-height:1.6; margin:16px 0 16px; }
.cmp-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:16px; }
.cmp { border:1px solid var(--border); border-radius:10px; padding:16px 16px; background:var(--surface); }
.cmp.is-bad { opacity:.75; }
.cmp-h { display:flex; align-items:baseline; justify-content:space-between; gap:8px; margin-bottom:8px; }
.cmp-h b { font-size:13.5px; }
.cmp-h span { font-size:14px; color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap; }
.cmp-txt { margin:0; font-size:14px; line-height:1.7; white-space:pre-wrap; }
.cmp-flags { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.cmp-flags span { font-size:14px; padding:4px 8px; border-radius:20px;
  background:color-mix(in srgb, var(--warn) 15%, transparent); color:var(--warn); }
.cmp-flags.cmp-ok span { background:color-mix(in srgb, var(--ok) 14%, transparent); color:var(--ok); }

@media (max-width: 620px) {
  .mdl-slot { flex-direction:column; align-items:stretch; }
  .mdl-slot .select { min-width:auto; }
}

/* ------------------------------------------------ L3: Terminologiya */
.gloss-add { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
.gloss-add .input { flex:1; min-width:150px; }
.gloss-arr { color:var(--muted); font-size:15px; }

.glist { display:flex; flex-direction:column; gap:8px; }
.gitem { position:relative; padding:12px 40px 12px 16px; border:1px solid var(--border);
  border-radius:10px; background:var(--surface-2); }
.gitem-p { font-size:14px; line-height:1.5; }
.gitem-p s { color:var(--muted); text-decoration-thickness:1px; }
.gitem-p b { font-weight:600; }
.gitem-ex { margin-top:4px; font-size:14px; color:var(--muted); }
.gitem-m { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:8px;
  font-size:14px; color:var(--muted); }
.gitem-x { position:absolute; top:9px; right:9px; width:26px; height:26px; border:0;
  border-radius:6px; background:transparent; color:var(--muted); cursor:pointer; font-size:14px; }
.gitem-x:hover { background:var(--border); color:var(--ink); }

/* ============================================================
   PIKSEL OFIS
   Kanvas piksel uslubda chiziladi, shuning uchun brauzer
   silliqlashini ham o'chirish kerak — aks holda kattalashtirilgan
   piksellar xiralashadi.
   ============================================================ */
.office-head { display:flex; justify-content:space-between; align-items:flex-start;
  gap:20px; margin-bottom:16px; flex-wrap:wrap; }
.office-head h2 { margin:0 0 4px; font-size:20px; }
.office-head p { margin:0; font-size:14px; color:var(--muted); }
.office-act { flex:0 0 auto; }

.office-wrap { border:1px solid var(--border); border-radius:14px; overflow:hidden;
  background:var(--surface-2); line-height:0; }
#officeCanvas { display:block; width:100%;
  image-rendering:pixelated; image-rendering:crisp-edges; }

.office-legend { display:flex; gap:16px; flex-wrap:wrap; margin:16px 0 24px;
  font-size:14px; color:var(--muted); }
.office-legend > span { display:flex; align-items:center; gap:8px; }
.lg { width:9px; height:9px; border-radius:4px; display:inline-block; }
.lg-busy { background:var(--brand); }
.lg-done { background:var(--ok); }
.lg-skip { background:var(--muted); }
.lg-fail { background:var(--err); }

.office-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(210px, 1fr)); gap:12px; }
.ocard { padding:12px 16px; border:1px solid var(--border); border-radius:10px;
  background:var(--surface); }
.ocard--running { border-color:var(--brand); }
.ocard--failed { border-color:var(--err); }
.ocard--skipped { opacity:.65; }
.ocard-h { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.ocard-h b { font-size:14px; }
.ocard-st { font-size:14px; color:var(--muted); white-space:nowrap; }
.ocard--running .ocard-st { color:var(--brand); font-weight:600; }
.ocard--done .ocard-st { color:var(--ok); }
.ocard-role { display:block; font-size:14px; color:var(--muted); margin:2px 0 8px; }
.ocard p { margin:0; font-size:14px; line-height:1.55; color:var(--muted); }
.ocard p.is-dim { opacity:.7; }

/* Nomlash oynasi */
.nrow { display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:8px 0; border-bottom:1px solid var(--border); }
.nrow:last-child { border-bottom:0; }
.nrow b { display:block; font-size:13.5px; }
.nrow span { font-size:14px; color:var(--muted); }
.nrow .input { width:170px; flex:0 0 auto; }

@media (max-width: 560px) {
  .nrow { flex-direction:column; align-items:stretch; gap:8px; }
  .nrow .input { width:100%; }
}

/* ============================================================
   APPLE MEZONLARI BO'YICHA TUZATISHLAR
   ============================================================ */

/* Bosish maydoni.
   Bu tugmalarning KO'RINISHI kichik (24–28px) va shunday qolishi kerak —
   ular ikkilamchi amallar. Lekin barmoq uchun 44px joy bo'lishi shart,
   aks holda telefonda tegib bo'lmaydi. Shuning uchun ko'rinmas maydon
   ::after bilan kengaytiriladi. */
.alert-x, .gitem-x, .mem-x, .tm-x, .ref-del, .hfcard-foot button,
.facecard-a button, .crew-acc-r, .lcard-link {
  position: relative;
}
.alert-x::after, .gitem-x::after, .mem-x::after, .tm-x::after,
.ref-del::after, .hfcard-foot button::after, .facecard-a button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, var(--tap));
  height: max(100%, var(--tap));
  transform: translate(-50%, -50%);
}

/* Sarlavhalarga Apple tracking'i.
   Katta matn manfiy tracking'siz yoyilib ketadi — bu eng sezilarli
   farqlardan biri. */
h1, .t-large  { letter-spacing: var(--track-4); line-height: var(--lh-tight); }
h2            { letter-spacing: var(--track-3); line-height: var(--lh-tight); }
h3            { letter-spacing: var(--track-2); line-height: var(--lh-snug); }
h4            { letter-spacing: var(--track-1); line-height: var(--lh-snug); }

/* Kichik matn esa YOYILADI — aks holda harflar yopishib o'qilmaydi. */
.hint, .badge, .t-foot   { letter-spacing: var(--track--1); }
.t-caption               { letter-spacing: var(--track--3); }

/* Ierarxiya vazn bilan quriladi, o'lcham bilan emas.
   Ilgari deyarli hamma matn qalin edi va shuning uchun hech nima
   ajralib turmasdi. */
.card-h h3    { font-weight: var(--w-semibold); }
.hint         { font-weight: var(--w-regular); color: var(--label-3); }
.label        { font-weight: var(--w-medium); color: var(--label-2); }

/* Fokus — klaviatura bilan yuruvchi uchun yagona yo'l ko'rsatkich */
.btn:focus-visible,
button:focus-visible,
[data-i18n]:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Harakat: yumshoq, lekin tez. Hover 150ms dan uzun bo'lsa sekin tuyuladi. */
.btn, .card, .snav, .crew-tab, .btab, .ctab, .agent-card, .ocard, .lcard {
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   3D AVATAR — AI xodimlar uchun
   Tashqi rasm fayli yo'q: hajm uch qatlam bilan beriladi —
   asosiy shakl, yuqoridan yorug'lik va pastdan aks-yorug'lik.
   Shu tufayli rang har xodimga moslashadi va fayl yuklanmaydi.
   ============================================================ */
.av3 {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
  color: #fff;
  /* Uch qatlam: yuqori yorug'lik → pastki aks → asosiy hajm */
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,.55) 0%, transparent 46%),
    radial-gradient(circle at 70% 84%, color-mix(in srgb, var(--av-tint) 70%, #fff) 0%, transparent 52%),
    linear-gradient(158deg,
      color-mix(in srgb, var(--av-tint) 88%, #fff) 0%,
      var(--av-tint) 52%,
      color-mix(in srgb, var(--av-tint) 72%, #000) 100%);
  /* Ichki soya hajm beradi, tashqi soya yerdan ko'taradi */
  box-shadow:
    inset 0 -6px 12px rgba(0,0,0,.22),
    inset 0 5px 10px rgba(255,255,255,.28),
    0 2px 6px color-mix(in srgb, var(--av-tint) 34%, transparent),
    0 8px 20px color-mix(in srgb, var(--av-tint) 22%, transparent);
  --av-tint: var(--brand);
}

/* Yuqoridagi yaltiroq — shisha sharcha taassuroti */
.av3::before {
  content: '';
  position: absolute;
  inset: 3px 3px auto 3px;
  height: 42%;
  border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, rgba(255,255,255,.42), transparent);
  pointer-events: none;
}

.av3--sm { width: 30px; height: 30px; font-size: 14px; }
.av3--lg { width: 64px; height: 64px; font-size: 25px; }

/* Ishlayotgan xodim atrofida yumshoq halqa — status rangdan tashqari
   HARAKAT bilan ham bilinadi */
.av3--busy::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--av-tint) 55%, transparent);
  animation: av3pulse 2s var(--ease-out) infinite;
}
@keyframes av3pulse {
  0%   { transform: scale(.94); opacity: .9; }
  70%  { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(1.12); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .av3--busy::after { animation: none; } }

/* Har xodimning o'z rangi — jamoa bir xil ko'rinmasin */
.av3[data-agent="analyst"]    { --av-tint: #4F8DF7; }
.av3[data-agent="marketer"]   { --av-tint: #F2994A; }
.av3[data-agent="community"]  { --av-tint: #27AE60; }
.av3[data-agent="sales"]      { --av-tint: #EB5757; }
.av3[data-agent="strategist"] { --av-tint: #9B51E0; }
.av3[data-agent="copywriter"] { --av-tint: #2D9CDB; }
.av3[data-agent="designer"]   { --av-tint: #F2C94C; }
.av3[data-agent="scheduler"]  { --av-tint: #56CCF2; }


/* ==================== PIKSEL OFIS — suzuvchi kichik panel ====================
   Kanvas mantiqiy o'lchami 168x88; ekranda aynan 2 barobar — piksellar tiniq. */
.pxdock {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  width: 352px; max-width: calc(100vw - 24px);
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border); border-radius:var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pxIn .28s var(--ease-out);
}
.pxdock[hidden] { display: none; }
@keyframes pxIn { from { opacity: 0; transform: translateY(8px); } }
.pxdock-h { display: flex; align-items: center; gap:8px; padding:8px 8px 8px 12px; }
.pxdock-dot { width: 8px; height: 8px; border-radius:50%; background: var(--label-4); flex: none; }
.pxdock.is-busy .pxdock-dot { background: var(--ok); animation: pxPulse 1.2s var(--ease) infinite; }
@keyframes pxPulse { 50% { opacity: .35; } }
.pxdock-t { font-size: var(--step--1); }
.pxdock-s { font-size: var(--step--2); color: var(--label-3); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pxdock-b {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border-radius:var(--r-sm); color: var(--label-3); position: relative;
}
.pxdock-b:hover { background: var(--surface-2); color: var(--ink); }
.pxdock-body { padding:0 8px 8px; }
.pxdock-c {
  display: block; width: 336px; max-width: 100%; aspect-ratio: 168 / 88; height: auto;
  image-rendering: pixelated; image-rendering: crisp-edges;
  border-radius:var(--r-sm); background: var(--surface-2);
}
.pxdock-now { margin-top:8px; font-size: var(--step--2); color: var(--label-2); min-height: 18px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pxdock.is-min { width: auto; }
.pxdock.is-min .pxdock-body { display: none; }
.pxdock.is-min .pxdock-h { cursor: pointer; }
.pxdock.is-min #pxMin { display: none; }
@media (max-width: 640px) { .pxdock { right: 12px; bottom: 12px; } }
@media (prefers-reduced-motion: reduce) { .pxdock, .pxdock.is-busy .pxdock-dot { animation: none; } }


/* ==================== FAYL BIRIKTIRISH ==================== */
.att-btn {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; cursor: pointer;
  border-radius:var(--r-full); color: var(--label-3); position: relative;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.att-btn:hover { background: var(--surface-2); color: var(--ink); }
.att-btn:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.att-list { display: flex; flex-wrap: wrap; gap:8px; padding:8px 0; }
.att-list[hidden] { display: none; }
.att-list--in { padding:12px 12px 0; }
.att-list--chat { padding:12px 20px 4px; }
.att {
  position: relative; display: flex; align-items: center; gap:8px; max-width: 220px;
  padding:4px 8px 4px 4px; border-radius:var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: var(--step--2); color: var(--label-2);
}
.att img, .att video { width: 40px; height: 40px; object-fit: cover; border-radius:var(--r-sm); flex: none; background: var(--surface-3); }
.att span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att.is-busy { opacity: .6; }
.att-x { width: 20px; height: 20px; flex: none; border-radius:var(--r-full); color: var(--label-3); line-height: 1; }
.att-x:hover { background: var(--surface-3); color: var(--ink); }

/* Xabardagi biriktirmalar */
.cmsg-files { display: flex; flex-wrap: wrap; gap:8px; margin-top:8px; }
.cmsg-files img, .cmsg-files video { max-width: 220px; max-height: 220px; border-radius:var(--r-md); display: block; background: var(--surface-3); }

/* Rasm tahriri — kartochka ichida */
.hfedit { display: flex; gap:8px; margin-top:8px; }
.hfedit[hidden] { display: none; }
.hfedit .input { flex: 1; min-width: 0; }
.hfcard-tag { display: inline-block; align-self: flex-start; width: fit-content; font-size: 14px; font-weight: var(--w-semibold); color: var(--brand);
  background: var(--brand-50); border-radius:var(--r-full); padding:0 8px; margin-bottom:4px; }

/* ==================== RASM / VIDEO KO'RISH OYNASI ==================== */
/* Rasm katta, tahrir yonida. Telefonda rasm tepada, boshqaruv pastda. */
.mview-back { padding:24px; }
.mview {
  width: min(1180px, 100%); height: min(820px, calc(100vh - 48px));
  display: grid; grid-template-columns: minmax(0, 1fr) 372px;
  background: var(--bg); border: 1px solid var(--border); border-radius:var(--r-xl);
  box-shadow: var(--shadow-lg); overflow: hidden; animation: modalScaleIn .25s var(--ease-out);
}
.mview-stage { position: relative; min-height: 0; background: #0B0B10; }
/* Mutlaq joylashuv: rasm, video va kanvas tabiiy nisbatini saqlab sahnaga sig'adi.
   Grid ichida height:100% kanvasni asl o'lchamida (1080×1350) qoldirib ketardi. */
.mview-media { position: absolute; inset: 24px 72px 44px; display: flex; align-items: center; justify-content: center; }
.mview-media img, .mview-media video {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius:var(--r-md); display: block;
}
/* Kanvas 1080×1350: qutini to'ldiradi, surat esa nisbatini saqlab ichiga sig'adi */
.mview-media canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.mview-ph { color: rgba(255,255,255,.7); font-size: var(--step--1); text-align: center; }
.mview-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius:var(--r-full); display: grid; place-items: center;
  background: rgba(255,255,255,.12); color: #fff; font-size: 28px; line-height: 1;
  transition: background .15s var(--ease);
}
.mview-nav:hover { background: rgba(255,255,255,.24); }
.mview-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mview-nav[hidden] { display: none; }
.mview-prev { left:16px; }
.mview-next { right:16px; }
.mview-count {
  position: absolute; left: 50%; bottom:16px; transform: translateX(-50%);
  font-size: 14px; color: rgba(255,255,255,.72); font-variant-numeric: tabular-nums;
}
.mview-busy {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap:12px;
  background: rgba(8,8,14,.62); color: #fff; font-size: var(--step--1);
}
.mview-busy[hidden] { display: none; }
.mview-spin {
  width: 36px; height: 36px; border-radius:var(--r-full);
  border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite;
}
.mview-side { display: flex; flex-direction: column; gap:16px; padding:20px; overflow-y: auto; min-height: 0; }
.mview-h { display: flex; align-items: center; justify-content: space-between; gap:12px; }
.mview-h h3 { font-size: var(--step-1); margin:0; }
.mview-meta { display: flex; flex-direction: column; gap:8px; font-size: var(--step--1); color: var(--ink-2); }
.mview-meta p { margin:0; line-height: var(--lh-body); }
.mview-meta .mview-prompt { color: var(--ink); }
.mview-tags { display: flex; flex-wrap: wrap; gap:4px; }
.mview-form { display: flex; flex-direction: column; gap:8px; }
.mview-form[hidden] { display: none; }
.mview-form textarea { resize: vertical; min-height: 72px; }
.mview-chips { display: flex; flex-wrap: wrap; gap:4px; }
.mview-chips button {
  font-size: 14px; padding:4px 12px; border-radius:var(--r-full);
  border: 1px solid var(--border); color: var(--ink-2); background: var(--surface);
}
.mview-chips button:hover { border-color: var(--brand); color: var(--brand); }
.mview-hint { margin:0; font-size: 14px; color: var(--muted); }
.mview-hint[hidden] { display: none; }
.mview-act { display: flex; flex-wrap: nowrap; gap:8px; margin-top: auto; padding-top:12px; border-top: 1px solid var(--border); }
.mview-act .btn { white-space: nowrap; }
.mview-del { color: var(--err); margin-left: auto; }
.mview-act [hidden] { display: none; }
.hfcard-media { cursor: zoom-in; }
.hfcard-media:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

@media (max-width: 860px) {
  .mview-back { padding:0; }
  .mview-media { inset: 16px 56px 40px; }
  .mview { grid-template-columns: 1fr; grid-template-rows: minmax(240px, 52vh) auto;
           height: 100vh; border-radius:0; border: 0; overflow-y: auto; }
  .mview-side { overflow: visible; }
}

/* ==================== CHATDAGI DIZAYN ==================== */
.cdz { margin-top:12px; border: 1px solid var(--border); border-radius:var(--r-lg); background: var(--surface); overflow: hidden; }
.cdz-h { display: flex; align-items: center; justify-content: space-between; gap:12px; padding:12px 16px; }
.cdz-h b { font-size: var(--step--1); }
.cdz-st { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cdz-st.is-done { color: var(--ok); }
.cdz-strip { display: flex; gap:8px; overflow-x: auto; padding:0 16px 12px; scroll-snap-type: x mandatory; }
.cdz-it {
  position: relative; flex: none; width: 168px; aspect-ratio: 4 / 5; padding:0;
  border-radius:var(--r-md); overflow: hidden; background: var(--surface-3); scroll-snap-align: start;
  cursor: zoom-in; border: 1px solid var(--border);
}
.cdz--image .cdz-it { width: 220px; aspect-ratio: auto; height: 220px; }
.cdz-it canvas, .cdz-it img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cdz-it:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cdz-wait {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap:8px;
  background: rgba(8,8,14,.45); color: #fff; font-size: 14px;
}
.cdz-wait .mview-spin { width: 24px; height: 24px; }
.cdz-err { position: absolute; left:8px; right:8px; bottom:8px; font-size: 14px; line-height: 1.3;
  color: #fff; background: rgba(180,30,30,.82); border-radius:var(--r-sm); padding:4px 8px; }
.cdz-f { display: flex; flex-wrap: wrap; gap:8px; padding:12px 16px; border-top: 1px solid var(--border); }
/* Dizayndan oldin ko'rilgan Pinterest namunalari — qayerdan ilhom olingani ochiq */
.cdz-refs { display: flex; align-items: center; gap:8px; padding:0 16px 12px; overflow-x: auto; }
.cdz-refs span { flex: none; font-size: 14px; color: var(--muted); margin-inline-end: 4px; }
.cdz-refs a { flex: none; display: block; width: 40px; height: 52px; border-radius:var(--r-xs); overflow: hidden; border: 1px solid var(--border); }
.cdz-refs img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Ariza yig'ish savollari (qoida ustasi, 2-qadam) */
.wform-q { display: grid; grid-template-columns: 24px minmax(0, 1fr) 168px auto; gap: 8px; align-items: center; }
.wform-n { width: 24px; height: 24px; border-radius: var(--r-full); display: grid; place-items: center; background: var(--surface-3); font-size: 14px; font-weight: 700; }
.wform-q .select { padding-top: 8px; padding-bottom: 8px; }
.wform-qs { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 560px) { .wform-q { grid-template-columns: 24px minmax(0, 1fr) auto; } .wform-q .select { grid-column: 2; } }

/* Qaysi model chizgani — keyingi safar shunisini tanlash uchun */
.hfcard-eng { align-self: flex-start; font-size: 14px; line-height: 18px; padding: 0 8px; border-radius: var(--r-full);
  color: var(--label-3); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }

/* Yuz yo'q: bo'limga o'tish tugmasi matn ichida */
.comp-faces-none { margin: 0; }
.comp-faces-go { border: 0; background: none; padding: 0; font: inherit; font-weight: var(--w-semibold);
  color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.comp-faces-go:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 4px; }

/* ==================== KARUSEL MUHARRIRI ====================
   Canva'dagi kabi: chapda katta slayd va slaydlar qatori, o'ngda
   Shablon / Matn / Ranglar. Telefonda bitta ustun. */
body.ced-open { overflow: hidden; }
.ced-backdrop {
  position: fixed; inset: 0; z-index: 300; padding: 24px;
  background: rgba(10, 10, 15, .55); backdrop-filter: blur(6px);
  display: flex; align-items: stretch; justify-content: center;
}
.ced {
  width: min(1320px, 100%); display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.ced-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px 12px 24px; border-bottom: 1px solid var(--border); }
.ced-h > b { font-size: var(--step-0); margin-inline-end: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ced-saved { font-size: var(--step--2); color: var(--muted); margin-inline-end: auto; white-space: nowrap; }
.ced-x {
  width: 40px; height: 40px; border: 0; border-radius: var(--r-full); background: var(--surface-2);
  color: var(--ink); cursor: pointer; font-size: 16px; flex: none;
}
.ced-x:hover { background: var(--surface-3); }
.ced-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 0; }

.ced-stage { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-height: 0; background: var(--surface-2); }
/* Har bo'lak o'z qatorida: element asboblari yashirin bo'lsa ham slayd 1fr qatorda qoladi */
.ced-tools { grid-row: 1; }
.ced-etool { grid-row: 2; }
.ced-main { grid-row: 3; }
.ced-strip { grid-row: 4; }
/* Kanva asboblari: matn qo'shish, slaydni asl holiga, maslahat */
.ced-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px 0; }
.ced-hint { font-size: 14px; color: var(--muted); }
/* Tanlangan element asboblari */
.ced-etool { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 16px 0; padding: 8px 12px;
  border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--border); font-size: 14px; }
.ced-etool[hidden] { display: none; }
.ced-etool b { margin-inline-end: 4px; }
.ced-etool button { min-height: 36px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid var(--border-2);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; font-weight: var(--w-medium); cursor: pointer; }
.ced-etool button:hover { border-color: var(--ink); }
.ced-et-c input { width: 36px; height: 36px; padding: 0; border: 1px solid var(--border-2); border-radius: 50%; background: none; cursor: pointer; }
.ced-et-t { flex: 1; min-width: 160px; height: 36px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--r-sm); font: inherit; font-size: 14px; }
/* Tanlov ramkasi: kanva ustida, burchakda kattalashtirish dastagi */
.ced-main canvas { touch-action: none; cursor: default; }
.ced-sel { position: absolute; border: 2px solid #2B6BFF; border-radius: 4px; pointer-events: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .8); }
.ced-sel[hidden] { display: none; }
.ced-sel-h { position: absolute; right: -10px; bottom: -10px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid #2B6BFF; pointer-events: auto; cursor: nwse-resize; touch-action: none; }
.ced-main { position: relative; min-height: 0; overflow: hidden; }
/* Slayd mavjud joyga sig'adi va o'rtada turadi — nisbat (4:5) buzilmaydi */
.ced-main canvas {
  position: absolute; inset: 24px 64px; margin: auto; width: auto; height: auto;
  max-width: calc(100% - 128px); max-height: calc(100% - 48px);
  box-shadow: var(--shadow-md); background: #fff;
}
.ced-nav {
  position: absolute; top: 50%; translate: 0 -50%; width: 40px; height: 40px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--bg); color: var(--ink); cursor: pointer; font-size: 24px; line-height: 1;
}
.ced-nav[data-ced-prev] { left: 16px; }
.ced-nav[data-ced-next] { right: 16px; }
.ced-nav:hover { background: var(--surface-3); }
.ced-strip { display: flex; gap: 8px; padding: 12px 16px 16px; overflow-x: auto; border-top: 1px solid var(--border); background: var(--bg); }
.ced-thumb {
  position: relative; flex: none; width: 72px; padding: 0; border: 2px solid transparent; border-radius: var(--r-sm);
  background: none; cursor: pointer; overflow: hidden;
}
.ced-thumb canvas { width: 100%; aspect-ratio: 4 / 5; height: auto; display: block; }
.ced-thumb span {
  position: absolute; left: 4px; bottom: 4px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: var(--r-xs);
  background: rgba(10, 10, 15, .7); color: #fff; font-size: 14px; line-height: 20px; text-align: center;
}
.ced-thumb.is-on { border-color: var(--ink); }
.ced-thumb:focus-visible, .ced-tpl:focus-visible, .ced-presets button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.ced-panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); }
.ced-tabs { display: flex; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ced-tabs button {
  flex: 1; height: 36px; border: 0; border-radius: var(--r-full); background: none; cursor: pointer;
  font: inherit; font-size: var(--step--1); font-weight: var(--w-medium); color: var(--label-3);
}
.ced-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.ced-pane { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ced-pane[hidden] { display: none; }
.ced-sub { font-size: var(--step--2); font-weight: var(--w-semibold); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.ced-tpls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ced-tpl {
  display: flex; flex-direction: column; gap: 8px; padding: 4px 4px 8px; border: 2px solid transparent;
  border-radius: var(--r-md); background: none; cursor: pointer; font: inherit; color: var(--ink); text-align: left;
}
.ced-tpl canvas { width: 100%; aspect-ratio: 4 / 5; height: auto; display: block; border-radius: var(--r-xs); box-shadow: var(--shadow-xs); }
.ced-tpl span { font-size: var(--step--1); font-weight: var(--w-semibold); padding-left: 4px; }
.ced-tpl:hover { background: var(--surface-2); }
.ced-tpl.is-on { border-color: var(--ink); }

.ced-f { display: flex; flex-direction: column; gap: 4px; }
.ced-f > span { font-size: var(--step--2); font-weight: var(--w-semibold); color: var(--label-2); }
.ced-f input, .ced-f textarea, .ced-f select {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border-2); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); font: inherit; font-size: var(--step--1); line-height: 1.4; resize: vertical;
}
.ced-f input:focus, .ced-f textarea:focus, .ced-f select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-50); }
.ced-f small { font-size: 14px; color: var(--muted); }
.ced-row { display: flex; gap: 8px; flex-wrap: wrap; }

.ced-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ced-presets button {
  display: flex; height: 36px; padding: 4px; gap: 0; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg); cursor: pointer; overflow: hidden;
}
.ced-presets i { flex: 1; display: block; }
.ced-presets i:first-child { border-radius: 6px 0 0 6px; }
.ced-presets i:last-child { border-radius: 0 6px 6px 0; }
.ced-presets button:hover { border-color: var(--ink); }
.ced-colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ced-c { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; color: var(--label-2); cursor: pointer; }
.ced-c input { width: 44px; height: 44px; padding: 0; border: 1px solid var(--border-2); border-radius: var(--r-full); background: none; cursor: pointer; }
.ced-c input::-webkit-color-swatch-wrapper { padding: 2px; }
.ced-c input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.ced-seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-full); background: var(--surface-2); }
.ced-seg button {
  flex: 1; height: 32px; border: 0; border-radius: var(--r-full); background: none; cursor: pointer;
  font: inherit; font-size: var(--step--2); font-weight: var(--w-medium); color: var(--label-3);
}
.ced-seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-xs); }

@media (max-width: 900px) {
  .ced-backdrop { padding: 0; }
  .ced { border-radius: 0; border: 0; }
  .ced-h { padding: 8px 8px 8px 16px; flex-wrap: wrap; }
  /* Telefonda oddiy oqim: slayd, slaydlar qatori, keyin panel — hammasi bitta aylantirishda */
  .ced-body { display: block; overflow-y: auto; }
  .ced-stage { display: block; }
  .ced-main { height: 62vh; }
  .ced-main canvas { inset: 16px 48px; max-width: calc(100% - 96px); max-height: calc(100% - 32px); }
  .ced-panel { border-left: 0; border-top: 1px solid var(--border); }
  .ced-pane { overflow: visible; }
  .ced-tpls { grid-template-columns: repeat(3, 1fr); }
}

/* Karusel kartasi: shablon nomi va muharrirni ochish */
.dz-tpl { font-size: var(--step--2); color: var(--muted); margin-inline-end: auto; }

/* ==================== KARUSEL YARATISH SHAKLI ====================
   To'rt qadam ketma-ket: nima haqida, ko'rinishi, nechta slayd, maqsad.
   Ochiluvchi ro'yxat yo'q — hamma tanlov ko'rinib turadi, tugmalar katta. */
.car-form { max-width: 960px; display: flex; flex-direction: column; gap: 32px; padding: 32px; margin-bottom: 24px; }
.car-step { display: flex; flex-direction: column; gap: 12px; }
.car-q { display: flex; align-items: center; gap: 12px; font-size: var(--step-1); font-weight: var(--w-semibold); color: var(--ink); }
.car-n {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-size: var(--step--1); font-weight: var(--w-bold);
}
.car-topic { font-size: var(--step-0); line-height: 1.45; padding: 16px; resize: vertical; min-height: 88px; }
.car-ideas { display: flex; flex-wrap: wrap; gap: 8px; }
.car-idea {
  min-height: 40px; padding: 8px 16px; border-radius: var(--r-full); border: 1px solid var(--border-2);
  background: var(--bg); color: var(--label-2); font: inherit; font-size: var(--step--1); cursor: pointer; text-align: left;
}
.car-idea:hover { border-color: var(--ink); color: var(--ink); }
.car-idea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.car-tpls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.car-tpl {
  display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 2px solid var(--border); border-radius: var(--r-md);
  background: var(--bg); cursor: pointer; font: inherit; color: var(--ink); text-align: left; position: relative;
}
.car-tpl canvas { width: 100%; aspect-ratio: 4 / 5; height: auto; display: block; border-radius: 6px; }
.car-tpl span { font-size: var(--step--1); font-weight: var(--w-semibold); padding: 0 4px 4px; }
.car-tpl:hover { border-color: var(--border-2); }
.car-tpl[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
/* Tanlangan shablonda belgi — rang yagona signal bo'lmasin */
.car-tpl[aria-checked="true"]::after {
  content: '✓'; position: absolute; bottom: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 700;
}
.car-tpl:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.car-two { display: grid; grid-template-columns: auto 1fr; gap: 32px; }
.car-two > div { display: flex; flex-direction: column; gap: 12px; }
.car-seg { display: flex; gap: 8px; }
.car-seg--wrap { flex-wrap: wrap; }
.car-seg button {
  min-width: 64px; min-height: 48px; padding: 8px 20px; border-radius: var(--r-sm); border: 2px solid var(--border-2);
  background: var(--bg); color: var(--ink); font: inherit; font-size: var(--step-0); font-weight: var(--w-medium); cursor: pointer;
}
.car-seg button:hover { border-color: var(--ink); }
.car-seg button[aria-checked="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.car-seg button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.car-go { align-self: flex-start; min-height: 56px; padding: 0 40px; font-size: var(--step-0); }
.car-note { margin-top: -20px; font-size: var(--step--1); color: var(--muted); }

@media (max-width: 760px) {
  .car-form { padding: 20px 16px; gap: 28px; }
  .car-tpls { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; padding-bottom: 4px; }
  .car-two { grid-template-columns: 1fr; gap: 28px; }
  .car-go { align-self: stretch; }
}

/* ==================== MATNLI ASOSIY TUGMALAR ====================
   Faqat strelka yoki "+" bo'lgan asosiy tugmalar katta yoshdagi odamga
   tushunarsiz edi (2026-10-29 audit). Endi ichida so'z bor. */
.comp-send { width: auto; min-width: 40px; padding: 0 20px 0 16px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font: inherit; font-size: 15px; font-weight: var(--w-semibold); }
.std-send { width: auto; padding: 0 20px; border-radius: var(--r-full); font: inherit; font-size: 15px; font-weight: var(--w-semibold); }
.bmap-send { width: auto; padding: 0 16px 0 12px; gap: 8px; border-radius: var(--r-full); font: inherit; font-size: 15px; font-weight: var(--w-semibold); }

/* Telefonda kalit so'z qoidasi: tugmalar alohida qatorga tushadi —
   ilgari sarlavha 17px ustunga siqilib, har qatorda 1-2 harf qolardi */
@media (max-width: 640px) {
  .auto { grid-template-columns: auto 1fr; }
  .auto-r { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
}

/* Mijozlar ro'yxati: qoldirilgan raqam — bosilsa qo'ng'iroq */
.crm-phone { white-space: nowrap; font-variant-numeric: tabular-nums; }
.crm-phone a { color: var(--ink); font-weight: var(--w-semibold, 600); text-decoration: none; }
.crm-phone a:hover { text-decoration: underline; }

/* Eski yozishmalardan o'rganish */
.ig-learn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.ig-learn-st { margin: 0; flex: 1 1 240px; color: var(--ink); line-height: 1.5; }
.ig-learn-st:empty { display: none; }
.crm-note { margin: 0 0 12px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink); line-height: 1.5; }

/* Mijozlar ro'yxati telefonda: jadval o'rniga kartochka — ism va raqam
   bir qarashda, ustunlar o'ngga surilib yashirinmaydi */
@media (max-width: 640px) {
  #crmTable thead { display: none; }
  #crmTable, #crmTable tbody { display: block; }
  #crmTable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
    gap: 8px 12px; padding: 16px; border-bottom: 1px solid var(--border); }
  #crmTable tr:last-child { border-bottom: 0; }
  #crmTable td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; }
  #crmTable td:nth-child(1) { grid-column: 1; overflow-wrap: anywhere; }
  #crmTable td:nth-child(2) { grid-column: 2; text-align: right; }
  #crmTable td:nth-child(3) { grid-column: 1; }
  #crmTable td:nth-child(4) { grid-column: 1 / -1; }
  #crmTable td:nth-child(4):has(.crm-none), #crmTable td:nth-child(5) { display: none; }
  #crmTable td:nth-child(6) { grid-column: 2; grid-row: 2; display: flex; gap: 4px; justify-content: flex-end; }
  #crmTable td[colspan] { grid-column: 1 / -1; }
}
