/* ==========================================================================
   2Brain — LIME + QORA ko'rinish (2026-10)

   app.css va work.css dan KEYIN yuklanadi va ularning ustiga yoziladi.
   Tuzilish namunadan: suzuvchi qora yon menyu, lime aktiv bo'lim,
   iliq kulrang maydon ustida chegarasiz oq kartalar, ikonka plitalari,
   katta raqamlar. Komponentlar shadcn/ui uslubida: aniq chegaralar,
   yumshoq fokus halqasi, bir xil balandlikdagi boshqaruvlar.

   Qoidalar: bo'shliq 4/8pt, radius 6·10·14·20·28, lime — faqat urg'u
   (oq fonda matn rangi emas), asosiy tugma — qora (dark'da lime).
   ========================================================================== */

/* ---------- Maydon ---------- */
.app-body { background: var(--canvas); }
.boot { background: var(--canvas); }
.boot-mark { color: var(--ink); }

/* ---------- Yon menyu: suzuvchi qora panel ---------- */
.shell { grid-template-columns: 264px 1fr; }
@media (max-width: 1000px) { .shell { grid-template-columns: 1fr; } }

.side {
  background: var(--night); color: var(--night-ink); border: 0;
  margin: 12px 0 12px 12px; border-radius: var(--r-lg);
  height: calc(100vh - 24px); top: 12px; padding: 20px 12px 12px;
}
@media (max-width: 1000px) {
  .side { margin: 0; border-radius: 0 var(--r-lg) var(--r-lg) 0; height: 100vh; top: 0; width: 264px; }
}
.side .brand { color: var(--night-ink); }
.side-brand { padding: 4px 12px 20px; }

.snav-group { color: var(--night-mut); padding: 16px 12px 8px; }
.snav-group:hover { color: var(--night-ink); }
.snav {
  color: color-mix(in srgb, var(--night-ink) 78%, transparent);
  padding: 8px 12px; border-radius: var(--r-full); gap: 12px; min-height: 40px;
}
.snav-ic { background: none; color: inherit; width: 20px; height: 20px; border-radius: 0; }
.snav-ic svg { width: 18px; height: 18px; stroke-width: 1.7; }
.snav:hover { background: var(--night-2); color: var(--night-ink); }
.snav:hover .snav-ic { background: none; color: var(--night-ink); }
.snav.active { background: var(--lime); color: var(--lime-ink); font-weight: var(--w-semibold); }
.snav.active .snav-ic { background: none; color: var(--lime-ink); }
.snav-badge { background: var(--lime); color: var(--lime-ink); }
.snav.active .snav-badge { background: var(--lime-ink); color: var(--lime); }
.side-nav::-webkit-scrollbar-thumb { background: var(--night-3); border-color: var(--night); }

.side-foot { padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
/* Limit qutisi — namunadagi pastki karta: qora ustida yumshoq panel */
.usage { background: var(--night-2); border-color: var(--night-bd); color: var(--night-ink); border-radius: var(--r-md); }
.usage:hover { border-color: var(--lime); }
.usage-l, .usage-foot { color: var(--night-mut); }
.usage-n { color: var(--night-ink); }
.usage-bar { background: var(--night-3); }
.usage-bar i { background: var(--lime); }
.usage-add { color: var(--lime); }
.usage.low, .usage.out { background: var(--night-2); }
.usage.low .usage-bar i { background: var(--warn); }
.usage.out .usage-bar i { background: var(--err); }

.side-user { border-color: var(--night-bd); background: transparent; border-radius: var(--r-full); padding: 4px 4px 4px 4px; }
.side-avatar { background: var(--lime); color: var(--lime-ink); width: 32px; height: 32px; }
.side-user-t b { color: var(--night-ink); }
.side-user-t span { color: var(--night-mut); }
.side-out { color: var(--night-mut); border-radius: var(--r-full); }
.side-out:hover { background: var(--night-3); color: var(--night-ink); }
.snav-admin { color: var(--night-mut); }

/* ---------- Yuqori qator ---------- */
.topbar {
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  border-bottom: 0; padding: 20px 28px 12px;
}
.topbar-t { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); letter-spacing: -.035em; }
.topbar-s { font-size: var(--step--1); color: var(--muted); margin-top: 2px; }
.icon-btn { background: var(--surface); color: var(--ink-2); width: 40px; height: 40px; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.lang { background: var(--surface); }
.lang button.active { background: var(--ink); color: var(--bg); box-shadow: none; }
.wsw-btn { background: var(--surface); border-radius: var(--r-full); }

/* ---------- Kartalar: chegarasiz, katta radius ---------- */
.card, .kpi, .wk-tile, .wk-pcard, .wk-people, .wk-tablewrap, .wk-cal, .wk-ai {
  border-color: transparent; border-radius: var(--r-lg);
}
.card { padding: 24px; }
:root[data-theme="dark"] :is(.card, .kpi, .wk-tile, .wk-pcard, .wk-people, .wk-tablewrap, .wk-cal) { border-color: var(--border); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.card, .kpi, .wk-tile, .wk-pcard, .wk-people, .wk-tablewrap, .wk-cal) { border-color: var(--border); }
}
.card-h h3 { font-size: var(--step-0); font-weight: var(--w-semibold); letter-spacing: -.02em; }

/* ---------- Tugmalar (shadcn: aniq, bir xil balandlik) ---------- */
.btn { font-weight: var(--w-semibold); min-height: 44px; padding: 8px 20px; }
.btn-sm { min-height: 40px; padding: 8px 16px; }  /* katta yoshdagi odam ham adashmasdan bossin */
.btn-lg { min-height: 52px; padding: 12px 28px; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn-outline { background: transparent; }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
/* Lime tugma — sahifada bittadan ko'p bo'lmasin */
.btn-lime { background: var(--lime); color: var(--lime-ink); }
.btn-lime:hover { background: var(--lime-600); }

/* ---------- Kiritish maydonlari ---------- */
.input, .select, .textarea { border-radius: var(--r-sm); background: var(--surface); border-color: var(--border-2); min-height: 44px; }
.input-sm, .select-sm { min-height: 36px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted-2); }

/* ---------- Belgilar, holatlar ---------- */
.badge { background: var(--surface-3); color: var(--ink-2); }
.tag, .auto-act, .auto-sentence .a, .feed-ic { background: var(--lime-soft); color: var(--ink); }
.alert-info { background: var(--surface); color: var(--ink); border-color: var(--border); }
.alert-info a, .alert-info button { color: var(--ink); }
.switch input:checked + span { background: var(--ink); }
.chart-bar.on { background: var(--ink); }
.chart-bar[data-v]:hover { background: var(--lime); }
.kpi.accent { background: var(--lime); }
.kpi.accent :is(.kpi-l, .kpi-v, .kpi-s) { color: var(--lime-ink); }

/* Jamoa moduli */
/* Ustun foni matn rangidan: yorug'da sahifadan biroz to'q, qorong'ida biroz och —
   ikkala rejimda ham oq/qora kartochkalar ostida aniq "polka" bo'lib turadi */
.wk-col { background: color-mix(in srgb, var(--ink) 5%, transparent); border-radius: var(--r-lg); }
.wk-col.is-over { background: color-mix(in srgb, var(--lime) 22%, transparent); border-color: transparent; }
.wk-col-h { min-height: 36px; }
.wk-card { border-color: transparent; box-shadow: 0 1px 2px rgba(18,19,16,.06); border-radius: var(--r-md); }
.wk-card:hover { border-color: var(--border-2); }
.wk-st[data-s="doing"]  { background: var(--lime-soft); color: var(--ink); }
.wk-st[data-s="doing"]::before { background: #7FA300; opacity: 1; }
.wk-ev[data-s="doing"]  { background: var(--lime-soft); color: var(--ink); }
.wk-score[data-g="good"] { background: var(--lime-soft); color: var(--ink); }
.wk-plan .wk-progress i { background: var(--ink); }
.wk-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.wk-seg { background: var(--surface-3); border-color: transparent; border-radius: var(--r-full); }
.wk-seg button { border-radius: var(--r-full); }
.wk-seg button.on { background: var(--surface); }
.wk-stat { background: var(--surface); }
.wk-day.is-today .wk-dn b { background: var(--lime); color: var(--lime-ink); }
.wk-design.is-pick { outline-color: var(--lime); }
.seat-step b { color: var(--ink); }
:root[data-theme="dark"] .wk-st[data-s="doing"]::before { background: var(--lime); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wk-st[data-s="doing"]::before { background: var(--lime); } }

/* ==========================================================================
   BOSH SAHIFA (dashboard)
   ========================================================================== */
/* Eski .wk-home ikki ustunli edi — yangi bosh sahifa bitta .db bloki, butun kenglikda */
.wk-home { display: block; margin-bottom: 0; }
.wk-home:empty { display: none; }
.db { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.db-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.db-hello { font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -.04em; line-height: 1.1; }
.db-sub { color: var(--muted); font-size: var(--step--1); margin-top: 8px; }
.db-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Ko'rsatkich kartalari: ikonka plitasi + o'q tugmasi + katta raqam */
.db-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.db-stat {
  background: var(--surface); border-radius: var(--r-lg); padding: 20px; min-height: 152px;
  display: flex; flex-direction: column; gap: 12px; text-align: left; border: 0; color: inherit; font: inherit;
  cursor: pointer; transition: transform .2s var(--ease-out);
}
.db-stat:hover { transform: translateY(-2px); }
.db-stat:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.db-stat-top { display: flex; align-items: center; justify-content: space-between; }
.db-ic {
  width: 40px; height: 40px; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink);
}
.db-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.db-go {
  width: 40px; height: 40px; border-radius: var(--r-full); display: grid; place-items: center;
  border: 1px solid var(--border-2); color: var(--ink);
}
.db-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.db-num { font-family: var(--font-display); font-size: clamp(28px, 3.2vw, 40px); font-weight: 600; letter-spacing: -.05em; line-height: 1; margin-top: auto; font-variant-numeric: tabular-nums; }
.db-lbl { font-size: var(--step--1); color: var(--muted); }
.db-lbl b { color: var(--ink); font-weight: var(--w-semibold); }
/* Bitta ajratilgan karta — lime. Sahifadagi eng baland ovoz shu. */
.db-stat.is-hl { background: var(--lime); color: var(--lime-ink); }
.db-stat.is-hl .db-ic { background: rgba(18,19,16,.08); color: var(--lime-ink); }
.db-stat.is-hl .db-go { border-color: rgba(18,19,16,.25); color: var(--lime-ink); }
.db-stat.is-hl .db-lbl { color: rgba(18,19,16,.7); }
.db-stat.is-hl .db-lbl b { color: var(--lime-ink); }
.db-stat.is-alert .db-num { color: var(--err); }

.db-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.db-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.db-card { background: var(--surface); border-radius: var(--r-lg); padding: 20px 24px 24px; min-width: 0; }
:root[data-theme="dark"] :is(.db-card, .db-stat) { border: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.db-card, .db-stat) { border: 1px solid var(--border); } }
:root[data-theme="dark"] .db-stat.is-hl { border-color: transparent; }
.db-card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.db-card-h h3 { font-size: var(--step-0); font-weight: var(--w-semibold); letter-spacing: -.02em; }
.db-card-h .db-meta { margin-left: auto; }
.db-meta { font-size: 14px; color: var(--muted); }
.db-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: var(--w-semibold); padding: 4px 8px; border-radius: var(--r-full); background: var(--lime-soft); color: var(--ink); }
.db-delta.is-down { background: var(--err-bg); color: var(--err); }

/* Faollik grafigi — qora ustunlar, bugungisi lime */
.db-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: stretch; height: 176px; padding-top: 8px; }
.db-bar { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; }
.db-bar i { width: min(28px, 100%); border-radius: var(--r-full); background: var(--ink); min-height: 6px; transition: height .5s var(--ease-out); }
.db-bar.is-today i { background: var(--lime); }
.db-bar.is-zero i { background: var(--surface-3); }
.db-bar span { font-size: 14px; color: var(--muted); }
.db-bar-c { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.db-bar b { font-size: 14px; font-weight: var(--w-semibold); color: var(--ink); font-variant-numeric: tabular-nums; line-height: 16px; }
:root[data-theme="dark"] .db-bar i { background: var(--ink-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .db-bar i { background: var(--ink-2); } }
:root[data-theme="dark"] .db-bar.is-today i { background: var(--lime); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .db-bar.is-today i { background: var(--lime); } }

/* Kichik kalendar */
.db-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.db-cal span { font-size: 14px; color: var(--muted-2); padding: 4px 0; font-weight: var(--w-semibold); }
.db-cal button {
  aspect-ratio: 1; max-width: 100%; border-radius: var(--r-full); font-size: 14px; font-variant-numeric: tabular-nums;
  color: var(--ink-2); position: relative; display: grid; place-items: center;
}
.db-cal button:hover { background: var(--surface-2); }
.db-cal button.is-out { color: var(--muted-2); opacity: .5; }
.db-cal button.is-today { background: var(--lime); color: var(--lime-ink); font-weight: var(--w-bold); }
.db-cal button.has-mark::after {
  content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink);
}
.db-cal button.is-today.has-mark::after { background: var(--lime-ink); }
.db-cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.db-cal-h b { font-weight: var(--w-semibold); }

/* Ro'yxat qatorlari */
.db-list { display: flex; flex-direction: column; }
.db-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 8px; margin: 0 -8px; border-radius: var(--r-md); text-align: left; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; width: calc(100% + 16px);
}
.db-row:hover { background: var(--surface-2); }
.db-row-ic { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface-3); color: var(--ink); font-size: 14px; font-weight: var(--w-bold); }
.db-row-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Pastel plitalar — tur bo'yicha (namunadagi kabi), matn har doim qora */
.db-row-ic[data-t="reels"], .db-row-ic[data-t="video"] { background: #FDE7D7; }
.db-row-ic[data-t="post"], .db-row-ic[data-t="carousel"] { background: #E3E8FF; }
.db-row-ic[data-t="design"] { background: #F7DEF1; }
.db-row-ic[data-t="stories"] { background: #DDF3F0; }
.db-row-ic[data-t="ads"], .db-row-ic[data-t="report"] { background: var(--lime-soft); }
:root[data-theme="dark"] .db-row-ic[data-t] { background: var(--surface-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .db-row-ic[data-t] { background: var(--surface-3); } }
.db-row-t { min-width: 0; }
.db-row-t b { display: block; font-size: var(--step--1); font-weight: var(--w-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-row-t small { display: block; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-pill { font-size: 14px; font-weight: var(--w-semibold); padding: 4px 12px; border-radius: var(--r-full); background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.db-pill.is-late { background: var(--err-bg); color: var(--err); }
.db-pill.is-today { background: var(--lime-soft); color: var(--ink); }
.db-empty { font-size: var(--step--1); color: var(--muted); padding: 8px 0; }

/* Platforma belgisi */
.pf { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; flex: none; }
.pf svg { width: 18px; height: 18px; fill: currentColor; }
.pf[data-p="instagram"] { background: linear-gradient(135deg, #F58529, #DD2A7B 55%, #8134AF); }
.pf[data-p="telegram"] { background: #27A7E7; }
.pf[data-p="youtube"] { background: #FF0033; }
.pf.sm { width: 24px; height: 24px; border-radius: var(--r-xs); }
.pf.sm svg { width: 12px; height: 12px; }

/* Boshlash qadamlari (tanishuvdan keyin) */
.db-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.db-step {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r-md);
  background: var(--surface-2); text-align: left; border: 1px solid transparent; font: inherit; color: inherit; cursor: pointer;
}
.db-step:hover { border-color: var(--border-2); }
.db-step b { font-size: var(--step--1); font-weight: var(--w-semibold); }
.db-step small { font-size: 14px; color: var(--muted); line-height: 1.45; }
.db-step i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: var(--w-bold); background: var(--ink); color: var(--bg); }
.db-step.is-done { opacity: .55; }
.db-step.is-done i { background: var(--lime); color: var(--lime-ink); }

/* Eski Instagram bloki — sarlavha bilan, pastda */
.db-sec-h { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; }
.db-sec-h h3 { font-size: var(--step-0); font-weight: var(--w-semibold); }
.db-sec-h span { font-size: 14px; color: var(--muted); }

@media (max-width: 1100px) { .db-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .db-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .topbar-t { font-size: var(--step-0); }
  .db-stat { min-height: 128px; padding: 16px; }
  .db-card { padding: 16px; }
  .db-bars { gap: 8px; height: 144px; }
}
@media (prefers-reduced-motion: reduce) { .db-stat, .db-bar i { transition: none; } }

/* ==========================================================================
   TANISHUV (onboarding) — chapda qora panel, o'ngda savollar
   ========================================================================== */
.ob { position: fixed; inset: 0; z-index: 400; background: var(--canvas); overflow-y: auto; }
.ob-wrap { min-height: 100%; display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); }
.ob-aside {
  background: var(--night); color: var(--night-ink); padding: 32px;
  display: flex; flex-direction: column; gap: 32px; position: sticky; top: 0; height: 100vh;
}
.ob-aside .brand { color: var(--night-ink); }
.ob-aside-t { margin-top: auto; }
.ob-aside-t b { display: block; font-family: var(--font-display); font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.04em; line-height: 1.15; color: var(--lime); }
.ob-aside-t p { margin-top: 16px; color: var(--night-mut); font-size: var(--step-0-5); line-height: 1.55; max-width: 32ch; }
.ob-progress { display: flex; gap: 8px; }
.ob-progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--night-3); transition: background .3s var(--ease); }
.ob-progress i.on { background: var(--lime); }

.ob-main { padding: 56px clamp(24px, 6vw, 96px) 48px; max-width: 880px; width: 100%; display: flex; flex-direction: column; gap: 16px; position: relative; }
.ob-count { font-size: 14px; font-weight: var(--w-semibold); color: var(--muted); letter-spacing: .06em; }
.ob-h { font-family: var(--font-display); font-size: clamp(26px, 3vw, 36px); font-weight: 600; letter-spacing: -.045em; line-height: 1.1; }
.ob-h2 { font-size: var(--step-0); font-weight: var(--w-semibold); margin-top: 16px; }
.ob-lead { color: var(--muted); margin-top: -8px; }
.ob-hint { display: block; font-weight: var(--w-regular); color: var(--muted); font-size: 14px; }

.ob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.ob-grid.two { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ob-opt { position: relative; cursor: pointer; }
.ob-opt input, .ob-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ob-opt span {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 16px 16px 16px 48px; border-radius: var(--r-md); background: var(--surface);
  border: 1.5px solid var(--border); transition: border-color .16s var(--ease), background .16s var(--ease);
}
.ob-opt span::before {
  content: ''; position: absolute; left: 16px; top: 18px; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--border-2); background: var(--surface);
}
.ob-opt input[type="checkbox"] + span::before { border-radius: var(--r-xs); }
.ob-opt b { font-weight: var(--w-semibold); font-size: var(--step-0-5); }
.ob-opt small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.ob-opt:hover span { border-color: var(--border-2); }
.ob-opt input:checked + span { border-color: var(--ink); background: var(--surface); }
.ob-opt input:checked + span::before {
  border-color: var(--ink); background: var(--lime) no-repeat center/12px
    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='%23121310' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.ob-opt input:focus-visible + span, .ob-chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ob-chip { cursor: pointer; position: relative; }
.ob-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 20px; border-radius: var(--r-full); background: var(--surface); border: 1.5px solid var(--border); font-weight: var(--w-medium); }
.ob-chip span small { display: none; }
.ob-chip:hover span { border-color: var(--border-2); }
.ob-chip input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.ob-form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; max-width: 520px; }
.ob-form label { display: flex; flex-direction: column; gap: 8px; font-weight: var(--w-semibold); font-size: var(--step--1); }
.ob-err { color: var(--err); font-size: var(--step--1); min-height: 20px; }
.ob-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.ob-nav .btn { min-width: 160px; }
.ob-skip { position: absolute; top: 24px; right: 24px; color: var(--muted); font-size: var(--step--1); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }

.ob-links { display: flex; flex-direction: column; gap: 8px; }
.ob-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); }
.ob-link b { font-size: var(--step--1); }
.ob-link code { grid-column: 1; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.ob-link .btn { grid-row: 1 / span 2; grid-column: 2; }
.ob-link.is-bad span { grid-column: 1; font-size: 14px; color: var(--err); }

@media (max-width: 860px) {
  .ob-wrap { grid-template-columns: 1fr; }
  .ob-aside { position: static; height: auto; padding: 20px 20px 24px; gap: 20px; }
  .ob-aside-t { margin-top: 0; }
  .ob-aside-t p { display: none; }
  .ob-main { padding: 28px 20px 40px; }
  .ob-nav .btn { min-width: 0; flex: 1; }
}

/* ==========================================================================
   AKKAUNTLAR — mijoz (loyiha) bo'yicha guruhlar
   ========================================================================== */
.ch-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.ch-group { background: var(--surface); border-radius: var(--r-lg); padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
:root[data-theme="dark"] .ch-group { border: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ch-group { border: 1px solid var(--border); } }
.ch-group-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-group-h h3 { font-size: var(--step-0); font-weight: var(--w-semibold); letter-spacing: -.02em; }
.ch-count { font-size: 14px; font-weight: var(--w-semibold); background: var(--surface-3); border-radius: var(--r-full); padding: 2px 8px; color: var(--ink-2); }
.ch-link { margin-left: auto; }
.ch-list { display: flex; flex-direction: column; gap: 8px; }
.ch-acc {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 8px; border-radius: var(--r-md); background: var(--surface-2);
}
.ch-acc.has-problem { background: var(--warn-bg); }
.ch-acc-t { min-width: 0; }
.ch-acc-t b { display: block; font-size: var(--step--1); font-weight: var(--w-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-acc-t small { display: block; font-size: 14px; color: var(--muted); }
.ch-problem { display: block; font-size: 14px; color: var(--warn); font-weight: var(--w-semibold); margin-top: 2px; }
.ch-move { max-width: 160px; background-color: var(--surface); }
.ch-adds { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-add {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 16px 4px 8px;
  border-radius: var(--r-full); border: 1px dashed var(--border-2); font-size: var(--step--1); font-weight: var(--w-semibold); color: var(--ink);
}
.ch-add:hover:not(:disabled) { border-style: solid; border-color: var(--ink); }
.ch-add:disabled { opacity: .45; cursor: not-allowed; }
.ch-note { font-size: var(--step--1); color: var(--muted); background: var(--surface); border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 16px; }
.ch-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: var(--step--1); line-height: 1.5; }
@media (max-width: 640px) {
  .ch-group { padding: 16px; }
  .ch-acc { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "ic t x" "ic mv mv"; row-gap: 8px; }
  .ch-acc > .pf { grid-area: ic; align-self: start; }
  .ch-acc-t { grid-area: t; }
  .ch-move { grid-area: mv; max-width: none; }
  .ch-acc > .icon-btn { grid-area: x; align-self: start; }
}

/* Vazifa → Nashr: qayerga chiqadi va har akkaunt holati */
.wk-chans { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.wk-chan {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px 4px 6px;
  border-radius: var(--r-full); background: var(--surface-2); font-size: var(--step--1); font-weight: var(--w-medium);
  cursor: pointer; user-select: none; box-shadow: inset 0 0 0 1px transparent;
  transition: background var(--dur-fast), box-shadow var(--dur-fast);
}
.wk-chan input { position: absolute; opacity: 0; pointer-events: none; }
.wk-chan.is-on { background: var(--lime-soft); box-shadow: inset 0 0 0 1px var(--lime-600); color: var(--ink); }
.wk-chan.is-off { opacity: .45; cursor: not-allowed; }
.wk-chan:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--lime); }
.wk-chan span { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-tgts { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wk-tgts li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--step--1); padding: 4px 0; }
.wk-tgt-n { font-weight: var(--w-medium); }
.wk-tgt-st { font-size: 14px; font-weight: var(--w-semibold); padding: 2px 8px; border-radius: var(--r-full); background: var(--surface-3); color: var(--ink-2); }
.wk-tgt-st[data-s="scheduled"] { background: var(--info-bg); color: var(--info); }
.wk-tgt-st[data-s="published"] { background: var(--lime); color: var(--lime-ink); }
.wk-tgt-st[data-s="failed"] { background: var(--err-bg); color: var(--err); }
.wk-tgt-st[data-s="draft"] { background: var(--warn-bg); color: var(--warn); }
.wk-tgts a { font-size: 14px; color: var(--ink); font-weight: var(--w-semibold); }
.wk-tgt-err { flex-basis: 100%; padding-left: 32px; font-size: 14px; color: var(--err); }
.wk-caps { margin-bottom: 12px; }
.wk-cap { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px 8px; align-items: center; margin-top: 8px; font-size: var(--step--1); font-weight: var(--w-medium); }
.wk-cap textarea { grid-column: 1 / -1; resize: vertical; }

/* Kalendar → nashr: platforma kartasi */
.plat-ic { background: none; width: auto; height: auto; }
.plat.is-locked { opacity: .6; }
.plat.is-locked .switch { pointer-events: none; }
.plat-b > .select:first-child { margin-bottom: 8px; }
.pf.xs { width: 16px; height: 16px; border-radius: var(--r-xs); }
.pf.xs svg { width: 10px; height: 10px; }
.crow .crow-ic { background: none; }
.db-ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: var(--night); color: var(--night-ink); }
.db-ask h3 { font-size: var(--step-0); font-weight: var(--w-semibold); margin: 0 0 4px; }
.db-ask p { margin: 0; font-size: var(--step--1); color: var(--night-mut); max-width: 56ch; line-height: 1.5; }
.db-ask-b { display: flex; gap: 8px; }
.db-ask .btn-ghost { background: transparent; color: var(--night-ink); border-color: var(--night-3); }
.db-ask .btn-ghost:hover { background: var(--night-2); }
.ch-grp { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.ch-grp h4 { margin: 0; font-size: var(--step--1); font-weight: var(--w-semibold); color: var(--muted); }
.ch-grp .ch-add { align-self: flex-start; }
.wk-tg .card-h h3 { display: flex; align-items: center; gap: 8px; }
.wk-tg .card-h h3 svg { width: 18px; height: 18px; flex: none; }

/* ==========================================================================
   TELEFON — bosh barmoq bilan ishlatish uchun
   Pastki panel, yig'iq filtrlar, ustunlar bo'yicha tez o'tish, kunlar ro'yxati,
   KPI kartochkalari. Ish stoli ko'rinishiga tegmaydi.
   ========================================================================== */
.tabbar, .side-scrim, .wk-colnav, .wk-agenda, .wk-ftoggle { display: none; }

@media (max-width: 1000px) {
  .side-scrim {
    display: block; position: fixed; inset: 0; z-index: 119; background: rgba(0, 0, 0, .45);
    opacity: 0; pointer-events: none; transition: opacity .25s var(--ease-out);
  }
  .side.open ~ .side-scrim { opacity: 1; pointer-events: auto; }
}

@media (max-width: 760px) {
  /* iPhone 16px dan kichik maydonga bosilganda sahifani kattalashtiradi */
  input, select, textarea, .input, .select, .textarea, .input-sm, .select-sm { font-size: 16px !important; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--night) 94%, transparent);
    backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, .06);
  }
  .tabbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 54px; padding: 6px 2px; border: 0; border-radius: var(--r-md); background: none;
    color: var(--night-mut); font: inherit; font-size: 14px; font-weight: 600; letter-spacing: .01em; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar button.is-on { color: var(--lime); }
  .tabbar .tab-add {
    justify-self: center; width: 56px; height: 56px; min-height: 56px; margin-top: -20px; border-radius: 50%;
    background: var(--lime); color: var(--lime-ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  }
  .tabbar .tab-add[hidden] { display: none; }
  .tabbar .tab-add svg { width: 26px; height: 26px; stroke-width: 2.4; }
  .tabbar .tab-add:active { transform: scale(.94); }
  /* "+" boshqa tugmalar kabi: tepada lime doira, ostida nima qilishi yozilgan */
  .tabbar .tab-add {
    width: auto; height: auto; min-height: 54px; margin-top: 0; border-radius: var(--r-md);
    background: none; box-shadow: none; color: var(--night-ink);
  }
  .tabbar .tab-add svg {
    width: 40px; height: 40px; padding: 8px; border-radius: 50%; box-sizing: border-box;
    background: var(--lime); color: var(--lime-ink); stroke: var(--lime-ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  }
  /* Uzun nom ("Bosh sahifa") kesilmasin — ikki qatorga tushadi */
  .tabbar button span { font-size: 13px; white-space: normal; line-height: 1.15; text-align: center; overflow: visible; }
  .tab-badge {
    position: absolute; top: 2px; left: calc(50% + 4px); min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--r-full); background: var(--lime); color: var(--lime-ink); font-size: 14px; line-height: 18px; text-align: center;
  }
  .main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

  /* Yuqori panel: menyu pastda, til — Sozlamalarda */
  .topbar #sideToggle, .topbar .lang { display: none; }
  .topbar-t { font-size: 24px; }
  /* Bu ekran nima uchunligini telefonda ham aytsin (ilgari yashirilgan edi) */
  .topbar-s { display: block; font-size: 15px; line-height: 1.35; }

  /* Vazifalar: filtrlar yig'iq, "+ Yangi vazifa" pastki panelda */
  #tkNew { display: none; }
  .wk-ftoggle { display: inline-flex; align-items: center; gap: 6px; }
  .wk-ftoggle.has-active::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lime-600); }
  #tkFilters { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  #tkFilters:not(.is-open) > select, #tkFilters:not(.is-open) > .wk-search { display: none; }
  #tkFilters.is-open > select, #tkFilters.is-open > .wk-search { flex: 1 1 100%; width: 100%; }
  .wk-seg { width: 100%; }
  .wk-seg button { flex: 1; min-height: 40px; }
  /* Hisob tugmalari ikki ustunda — yashirin surish qatori o'ng chetda kesilib qolardi */
  .wk-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wk-sum > * { min-width: 0; }

  /* Doska: bitta ustun ko'rinadi, surib o'tiladi; yuqorida holat chiplari */
  .wk-colnav {
    display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 4px 16px;
    position: sticky; top: 0; z-index: 5; background: var(--canvas);
  }
  .wk-colnav::-webkit-scrollbar { display: none; }
  .wk-colnav button {
    flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
    border: 0; border-radius: var(--r-full); background: var(--surface); color: var(--ink);
    font: inherit; font-size: 14px; font-weight: 600; -webkit-tap-highlight-color: transparent;
  }
  .wk-colnav button b { font-size: 14px; font-weight: 600; color: var(--muted); }
  .wk-colnav button.is-on { background: var(--brand); color: var(--brand-ink); }
  .wk-colnav button.is-on b { color: inherit; opacity: .7; }
  .wk-board { grid-auto-columns: 88%; scroll-snap-type: x mandatory; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
  .wk-col { scroll-snap-align: start; min-height: 50vh; }
  .wk-card { min-height: 44px; }

  /* Kalendar: oylik to'r o'rniga kunlar ro'yxati */
  .wk-cal { display: none; }
  .wk-agenda { display: flex; flex-direction: column; gap: 20px; }
  .wk-ag-day h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); text-transform: none; }
  .wk-ag-day.is-today h4 { color: var(--ink); }
  .wk-ag-it {
    width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
    min-height: 52px; padding: 10px 12px; margin-bottom: 6px; border: 0; border-radius: var(--r-md);
    background: var(--surface); color: var(--ink); font: inherit; text-align: left;
  }
  .wk-ag-it.is-late { box-shadow: inset 3px 0 0 var(--err); }
  .wk-ag-t { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* KPI: jadval o'rniga har xodimga kartochka */
  .wk-kpitbl thead { display: none; }
  .wk-kpitbl, .wk-kpitbl tbody { display: block; }
  .wk-kpitbl tr {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 12px;
    padding: 16px; border-bottom: 1px solid var(--border);
  }
  .wk-kpitbl td { display: block; padding: 0; border: 0; text-align: left !important; }
  .wk-kpitbl td:first-child { display: none; }
  .wk-kpitbl td:nth-child(2) { grid-column: 1 / span 2; grid-row: 1; }
  .wk-kpitbl .wk-kpi-score { grid-column: 3; grid-row: 1; justify-self: end; align-self: center; }
  .wk-kpitbl td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 2px; font-size: 14px; font-weight: 500; color: var(--muted); }
  .wk-kpitbl td:nth-child(4) { grid-column: 1 / -1; }
  .wk-tablewrap:has(.wk-kpitbl) { overflow-x: visible; }

  /* Modal — pastdan chiqadigan varaq */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-backdrop > * {
    width: 100%; max-width: none; max-height: 88vh; margin: 0; border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  /* Vazifa sahifasi: pastdagi tugmalar uchun joy */
  .wk-drawer { padding-bottom: env(safe-area-inset-bottom); }
}
.side-lang { display: none; }
@media (max-width: 760px) {
  .side-lang { display: flex; align-self: flex-start; margin: 0 0 12px 8px; background: var(--night-2); }
  .side-lang button { color: var(--night-mut); min-height: 36px; min-width: 44px; }
  .side-lang button.active { background: var(--lime); color: var(--lime-ink); }
}

/* ---------- TRENDLAR: soha bo'yicha eng ko'p ko'rilgan reelslar ---------- */
.tr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.tr-bar .select { width: auto; background-color: var(--surface); }
.tr-n { font-size: 14px; font-weight: var(--w-semibold); color: var(--muted); margin-left: 2px; }
.tr-add { display: flex; gap: 8px; margin-left: auto; min-width: 0; flex: 0 1 340px; }
.tr-add .input { min-width: 0; flex: 1; background: var(--surface); }
.tr-accs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tr-acc { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: var(--r-full); background: var(--surface); font-size: 14px; }
.tr-acc small { color: var(--muted); }
.tr-acc.is-err small { color: var(--warn); }
.tr-acc button { width: 28px; height: 28px; border-radius: var(--r-full); display: grid; place-items: center; color: var(--muted); }
.tr-acc button:hover { background: var(--surface-3); color: var(--ink); }

.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.tr-card { display: flex; flex-direction: column; gap: 8px; text-align: left; min-width: 0; border-radius: var(--r-lg); padding: 8px 8px 12px; background: var(--surface); transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.tr-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tr-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tr-thumb { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: calc(var(--r-lg) - 8px); overflow: hidden;
  background: linear-gradient(160deg, var(--night-2), var(--night-3)); }
.tr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tr-views, .tr-x { position: absolute; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: var(--r-full);
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tr-views { left: 8px; bottom: 8px; background: rgba(0, 0, 0, .62); color: #fff; }
.tr-x { right: 8px; top: 8px; background: var(--lime); color: var(--lime-ink); }
.tr-views svg, .tr-x svg { width: 12px; height: 12px; }
.tr-meta { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; min-width: 0; }
.tr-meta b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-meta small { font-size: 14px; color: var(--muted); }
.tr-cap { padding: 0 4px; font-size: 14px; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.tr-empty { background: var(--surface); border-radius: var(--r-lg); padding: 24px; max-width: 720px; display: flex; flex-direction: column; gap: 12px; }
.tr-empty h3 { margin: 0; font-size: var(--step-1); }
.tr-empty p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.tr-empty .btn { align-self: flex-start; }
.tr-setup code { font-size: 14px; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.tr-niches { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-foot { margin-top: 24px; font-size: 14px; color: var(--muted); }
.tr-foot a, .tr-foot .link { color: var(--ink-2); text-decoration: underline; font-size: 14px; padding: 0; }
.tr-warn { color: var(--warn); }

.tr-modal { width: min(940px, 100%); }
.tr-detail { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; margin-top: 16px; }
.tr-d-media { display: flex; flex-direction: column; gap: 12px; }
.tr-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.tr-stats div { background: var(--surface); border-radius: var(--r-md); padding: 8px 12px; }
.tr-stats dt { font-size: 14px; color: var(--muted); }
.tr-stats dd { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tr-d-acc { margin: 0; font-size: 14px; color: var(--muted); }
.tr-d-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tr-sum { margin: 0; font-size: 16px; line-height: 1.5; font-weight: var(--w-semibold); }
.tr-a p, .tr-a ul { margin: 0; line-height: 1.5; color: var(--ink-2); }
.tr-a ul { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.tr-a { padding-top: 12px; border-top: 1px solid var(--border); }
.tr-take { background: var(--lime-soft); border: 0; border-radius: var(--r-md); padding: 12px 16px; }
.tr-take p { color: var(--ink); }
.tr-d-act { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.tr-d-act .hint { margin: 0; }

@media (max-width: 760px) {
  .tr-add { flex-basis: 100%; margin-left: 0; }
  .tr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tr-detail { grid-template-columns: 1fr; gap: 16px; }
  /* Telefonda muqova kichik, raqamlar yonida: tahlil birinchi ekranda ko'rinsin */
  .tr-d-media { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px 12px; align-items: start; }
  .tr-d-media .tr-thumb { grid-row: span 3; }
  .tr-stats div { padding: 4px 8px; }
  .tr-stats dd { font-size: 15px; }
}

/* ---------- KONTENT STUDIYA: imkoniyatlar galereyasi ---------- */
.std-hero { width: min(1040px, 100%); }
.std-hero > h2, .std-hero > p, .std-box-hero { max-width: 680px; margin-left: auto; margin-right: auto; }
.gal { margin-top: 32px; text-align: left; }
.gal-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; justify-content: center; flex-wrap: wrap; }
.gal-tabs::-webkit-scrollbar { display: none; }
.gal-tab { padding: 8px 16px; min-height: 36px; border-radius: var(--r-full); font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.gal-tab:hover { color: var(--ink); background: var(--surface); }
.gal-tab.on { background: var(--ink); color: var(--bg); }
.gal-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.gal-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gal-card { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 16px 16px 20px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid transparent; min-height: 156px;
  transition: border-color .15s var(--ease), transform .15s var(--ease);
  animation: galIn .3s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 30ms); }
.gal-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.gal-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.gal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.gal-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--lime); color: var(--lime-ink); flex: none; }
.gal-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gal-cat { font-size: 14px; color: var(--muted); }
.gal-go { margin-left: auto; color: var(--muted); font-size: 16px; }
.gal-t { font-size: 16px; font-weight: var(--w-semibold); letter-spacing: -.01em; line-height: 1.3; }
.gal-d { font-size: 14px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes galIn { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .gal-card { animation: none; } }
@media (max-width: 1000px) { .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .gal-tabs { justify-content: flex-start; flex-wrap: nowrap; margin: 0 -16px; padding: 0 16px 4px; }
  .gal-grid { grid-template-columns: 1fr; }
  .gal-card { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 12px; }
  .gal-head { margin: 0; }
  .gal-cat, .gal-go { display: none; }
  .gal-t { flex: 1; min-width: 0; }
  .gal-d { flex-basis: 100%; }
}

/* ---------- CHAT-BOTLAR ---------- */
.bt-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bt-step { background: var(--surface); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bt-n { width: 32px; height: 32px; border-radius: var(--r-full); display: grid; place-items: center; border: 1px solid var(--border); font-size: 14px; font-weight: 700; }
.bt-step h3 { margin: 4px 0 0; font-size: 16px; line-height: 1.3; }
.bt-step p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.bt-ok { margin-top: auto; font-size: 14px; font-weight: var(--w-semibold); color: var(--ok); background: var(--ok-bg); padding: 4px 12px; border-radius: var(--r-full); }
.bt-step .btn { margin-top: auto; }
.bt-places { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.bt-place { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; cursor: pointer; }
.bt-place input { width: 18px; height: 18px; accent-color: var(--ink); }
.bt-stat { margin-top: auto; font-size: 14px; color: var(--ink-2); }
.bt-stat b { font-family: var(--font-display); font-size: 20px; color: var(--ink); }
.bt-h { margin: 32px 0 12px; font-size: var(--step-1); }
.bt-kinds .wk-seg { display: inline-flex; flex-wrap: wrap; }
.bt-lead { margin: 12px 0 0; color: var(--ink-2); max-width: 72ch; line-height: 1.5; }
.bt-kind { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; margin-top: 16px; }
.bt-card { background: var(--surface); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.bt-card h4 { margin: 0; font-size: 14px; color: var(--muted); font-weight: var(--w-semibold); }
.bt-chat { display: flex; flex-direction: column; gap: 8px; }
.bt-msg { max-width: 78%; padding: 8px 12px; border-radius: 16px; font-size: 14px; line-height: 1.4; }
.bt-msg.them { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 4px; }
.bt-msg.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.bt-msg small { display: block; font-size: 14px; opacity: .7; margin-bottom: 2px; }
.bt-note { align-self: center; font-size: 14px; font-weight: var(--w-semibold); color: var(--lime-ink); background: var(--lime); padding: 4px 12px; border-radius: var(--r-full); }
.bt-when { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; }
.bt-card .btn { align-self: flex-start; margin-top: auto; }
.bt-leads { margin-top: 32px; }
.bt-leads-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.bt-leads-h h2 { margin: 0; font-size: var(--step-1); }
.bt-lead-list { display: flex; flex-direction: column; gap: 8px; }
.bt-lead-row { display: grid; grid-template-columns: minmax(0, 1.1fr) 168px minmax(0, 1.6fr) auto; gap: 12px; align-items: center;
  background: var(--surface); border-radius: var(--r-md); padding: 12px 16px; }
.bt-lead-row.new { box-shadow: inset 3px 0 0 var(--lime); }
.bt-lead-who { display: flex; flex-direction: column; min-width: 0; }
.bt-lead-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-lead-who small { font-size: 14px; color: var(--muted); }
.bt-phone { font-variant-numeric: tabular-nums; font-weight: var(--w-semibold); color: var(--ink); }
.bt-ans { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.bt-ans span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-ans em { font-style: normal; color: var(--muted); }
.bt-act { display: flex; gap: 4px; justify-content: flex-end; }
.bt-done { font-size: 14px; color: var(--muted); }
@media (max-width: 1000px) { .bt-steps { grid-template-columns: 1fr; } .bt-kind { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .bt-lead-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bt-ans { grid-column: 1 / -1; }
  .bt-act { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Trendlar: kalit so'z qidiruvi */
.tr-search { display: flex; gap: 8px; margin-bottom: 16px; max-width: 720px; }
.tr-search .input { flex: 1; min-width: 0; background: var(--surface); }
.tr-dur { position: absolute; right: 8px; bottom: 8px; padding: 4px 8px; border-radius: var(--r-full); background: rgba(0, 0, 0, .62);
  color: #fff; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tr-note { margin: 0 0 12px; font-size: 14px; color: var(--muted); min-height: 0; }
.tr-note:empty { display: none; }
.tr-wait { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--ink-2); }
.tr-tr summary { cursor: pointer; }
.tr-tr p { margin-top: 8px; white-space: pre-wrap; }

/* ---------- O'qilishi: ilova ichida mayda matn yo'q ----------
   50 yoshli egasi ham ko'zini qisib o'qimasin (2026-10-29). Apple shkalasining
   11-12pt pog'onalari izoh va yorliqlar uchun juda kichik edi — ilova ichida
   ular 13-14px ga ko'tariladi. Landing sahifasi bunga tegmaydi. */
.app-body {
  --step--3: 0.875rem;    /* 12 → 14 */
  --step--2: 0.875rem;    /* 11 → 14 */
  --step--1: 0.9375rem;   /* 13 → 15: tugma, menyu, yorliq */
  --step-0-5: 1rem;       /* 15 → 16 */
}
/* Bo'lim ichidagi yorliqlar (tab) ham menyu bilan bir o'lchamda */
.app-body :is(.btab, .ctab, .crew-tab) { font-size: 15px; }
