:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #1b1f27;
  --muted: #667085;
  --accent: #2f5bea;
  --accent-soft: #e8eefd;
  --ok: #18794e;
  --ok-soft: #e3f4ea;
  --warn: #9a6200;
  --warn-soft: #fdf1d8;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --info: #5b3cc4;
  --info-soft: #efe9fd;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --surface: #1a1e26;
    --surface-2: #222733;
    --border: #2d3340;
    --text: #e7e9ee;
    --muted: #98a2b3;
    --accent: #7b9cff;
    --accent-soft: #232d4d;
    --ok: #4cc38a;
    --ok-soft: #173326;
    --warn: #f0b44c;
    --warn-soft: #3a2d13;
    --bad: #f97066;
    --bad-soft: #3d1c1a;
    --info: #b39dff;
    --info-soft: #2b2447;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px;
}
.brand-mark.lg { width: 44px; height: 44px; font-size: 16px; }
.brand-name { font-weight: 650; }
.brand-sub { color: var(--muted); font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none;
}
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.badge {
  min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--warn); color: #fff; font-size: 11.5px; font-weight: 650; text-align: center;
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 6px; }
.mode { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.mode .pill { align-self: flex-start; }

.main { padding: 20px 28px 40px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }

.btn {
  font: inherit; cursor: pointer; border-radius: 8px; padding: 7px 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.bad:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; text-align: left; }
.link:hover { color: var(--text); text-decoration: underline; }

.alert { padding: 10px 14px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); margin-bottom: 16px; }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--info-soft); color: var(--info); margin-bottom: 16px; }

.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.card-head a { font-size: 13px; color: var(--accent); text-decoration: none; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 28px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-hint { color: var(--muted); font-size: 12px; }

.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }

.pill {
  display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.awaiting_approval, .pill.needs_info, .pill.partial { background: var(--warn-soft); color: var(--warn); }
.pill.failed, .pill.cancelled { background: var(--bad-soft); color: var(--bad); }
.pill.received, .pill.analyzing, .pill.executing { background: var(--accent-soft); color: var(--accent); }
.pill.p4 { background: var(--bad-soft); color: var(--bad); }
.pill.p3 { background: var(--warn-soft); color: var(--warn); }
.pill.mock { background: var(--info-soft); color: var(--info); }

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; gap: 12px; justify-content: space-between; align-items: flex-start;
  padding: 10px 2px; border-top: 1px solid var(--border);
}
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { overflow-wrap: anywhere; }
.list-item .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.clickable { cursor: pointer; }
.clickable:hover { background: var(--surface-2); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-top: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; border-top: 0; }
td.num { color: var(--muted); font-variant-numeric: tabular-nums; width: 48px; }
td.title-cell { overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  font: inherit; font-size: 13px; cursor: pointer; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.pre {
  white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2);
  border-radius: 8px; padding: 10px 12px; margin: 8px 0 0; font: inherit;
}

.approval-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* AI yordamchi */
.chat { display: flex; flex-direction: column; height: calc(100vh - 120px); min-height: 420px; padding: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.bubble .bubble-meta { font-size: 12px; opacity: .8; margin-bottom: 4px; white-space: normal; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-form textarea {
  flex: 1; resize: none; font: inherit; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); min-height: 42px;
}
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }

/* Kirish */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 10px;
}
.login-card p { margin: 0 0 6px; }
.login-card label { font-weight: 600; font-size: 13px; }
.login-card input {
  font: inherit; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.field-error { color: var(--bad); font-size: 13px; }

/* Tafsilotlar paneli */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 16, .35); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--surface); border-left: 1px solid var(--border);
  overflow-y: auto; padding: 18px 20px;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section { margin-top: 18px; }
.section h3 { margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.events { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.events li { padding: 6px 0; border-top: 1px solid var(--border); }
.events li:first-child { border-top: 0; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 12px 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { flex-direction: row; justify-content: space-between; align-items: center; }
  .main { padding: 16px; }
  .bubble { max-width: 92%; }
  .kv { grid-template-columns: 1fr; }
}

/* --- Akbarjon AI bo'limlari --- */
.nav-group {
  margin: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.nav-group:first-child { margin-top: 0; }
.sidebar { overflow-y: auto; }

.lead { margin: 0 0 14px; max-width: 900px; }
.toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.toolbar .lead { flex: 1; min-width: 240px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.list-item .row-actions { margin-top: 0; flex-shrink: 0; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.faded { opacity: .62; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.link-sm { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--warn); text-decoration: none; }

a.stat-link { color: inherit; text-decoration: none; transition: border-color .15s; }
a.stat-link:hover { border-color: var(--accent); }

.pill.src-demo { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border); }
.pill.src-learning { background: var(--info-soft); color: var(--info); }
.pill.enforced { background: var(--info-soft); color: var(--info); }
.pill.lvl-none { background: var(--surface-2); color: var(--muted); }
.pill.lvl-low { background: var(--bad-soft); color: var(--bad); }
.pill.lvl-mid { background: var(--warn-soft); color: var(--warn); }
.pill.lvl-high { background: var(--ok-soft); color: var(--ok); }

.flow { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* forma */
.form { display: flex; flex-direction: column; gap: 12px; }
.form.inline { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(240px, 2.4fr) auto; align-items: end; gap: 10px; }
.form.inline .form-actions { padding-bottom: 1px; }
.form.inline .field-error { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 600; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
input[type="text"], input[type="search"], input[type="number"], input[type="tel"], input[type="password"], input[type="datetime-local"], select, textarea {
  font: inherit; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); min-width: 0;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50;
  padding: 10px 16px; border-radius: 8px; background: var(--text); color: var(--bg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2); max-width: calc(100% - 32px);
}
.toast.bad { background: var(--bad); color: #fff; }

/* daraja */
.bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); margin: 12px 0 4px; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--accent); }
.bar-target { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--text); opacity: .55; }

/* rivojlanish */
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.checklist input { margin-top: 3px; }
.inline-add { display: flex; gap: 6px; margin-top: 10px; }
.inline-add input { flex: 1; }

/* buyruqlar */
.search-row { margin-bottom: 10px; }
.search-row input { width: 100%; }
.directive { padding: 12px 2px; border-top: 1px solid var(--border); }
.directive:first-child { border-top: 0; }
.directive.off { opacity: .6; }
.directive-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.directive-head code { color: var(--accent); font-weight: 600; }
.directive-body { margin-top: 4px; overflow-wrap: anywhere; }
.directive .row-actions { margin-top: 8px; }

/* o'rganish */
.diff { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.diff div { white-space: pre-wrap; overflow-wrap: anywhere; padding: 6px 10px; border-radius: 6px; }
.diff .del { background: var(--bad-soft); text-decoration: line-through; opacity: .85; }
.diff .ins { background: var(--ok-soft); }

/* Telegram agenti */
.tg-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.chat-item {
  display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer;
}
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chat-item .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.thread { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.draft { align-self: flex-end; width: min(560px, 100%); border: 1px dashed var(--warn); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.draft textarea { width: 100%; margin-top: 6px; }
.draft.done-sent { border-style: solid; border-color: var(--border); }
.draft.done-rejected, .draft.done-failed { border-style: solid; border-color: var(--border); opacity: .7; }
.draft-context { font-size: 12px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.draft-actions-solo { align-self: flex-end; }

/* xavfsizlik */
.perm-edit { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; max-width: 360px; }
.perm-edit input { width: 140px; }

@media (max-width: 900px) {
  .tg-layout { grid-template-columns: 1fr; }
  .form.inline { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav-group { width: 100%; margin: 8px 0 2px; }
  .list-item { flex-wrap: wrap; }
  .perm-edit { justify-content: flex-start; max-width: none; }
}

/* Telegram ulash */
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 4px 0 0; flex-wrap: wrap; counter-reset: step; }
.stepper li { flex: 1; min-width: 90px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted);
  font-size: 13px; counter-increment: step; }
.stepper li::before { content: counter(step) ". "; font-weight: 700; }
.stepper li.done { background: var(--ok-soft); color: var(--ok); }
.stepper li.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tg-status { margin-bottom: 16px; }
.confirm-box { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); }
.confirm-box p { margin: 0 0 6px; }
a.btn { text-decoration: none; display: inline-block; }
.change-creds { margin-top: 16px; }
.change-creds summary { cursor: pointer; color: var(--accent); margin-bottom: 10px; }

/* Avtomatik javob */
.auto-card { margin-bottom: 16px; border-left: 4px solid var(--border); }
.auto-card.on { border-left-color: var(--ok); }
.auto-card .row-actions input[type="text"] { width: 200px; }
.auto-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); }
.auto-stats strong { color: var(--text); font-size: 16px; }
.bad-text { color: var(--bad); }
label.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.draft.escalated { border-color: var(--bad); }
.draft .alert ul { margin: 6px 0 0; padding-left: 18px; }

/* Sotuvchi bot */
.claim-code { font: 700 40px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .25em; padding: 16px 20px;
  margin: 10px 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent); text-align: center; }

/* Sotuvchi bot mahsulotlari */
.sp-card { display: grid; grid-template-columns: 160px 1fr; gap: 14px; }
.sp-media { width: 160px; min-height: 120px; border-radius: 8px; background: var(--surface-2); display: grid;
  place-items: center; color: var(--muted); font-size: 13px; overflow: hidden; text-align: center; }
.sp-media img, .sp-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-body { min-width: 0; }
@media (max-width: 680px) { .sp-card { grid-template-columns: 1fr; } .sp-media { width: 100%; max-height: 260px; } }

/* --- 4 bo'limli panel --- */
.title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.back { font-size: 13px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--accent); }
.nav a > span:first-child { white-space: nowrap; }
.conn-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.conn { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 12px 14px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; min-width: 0; }
.conn:hover { border-color: var(--accent); }
.conn .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); grid-row: span 2; }
.conn.ok .dot { background: var(--ok); }
.conn-title { font-weight: 600; }
.conn-text { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modules { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card.module { color: var(--text); text-decoration: none; }
.card.module:hover { border-color: var(--accent); }
a.list-item { color: var(--text); text-decoration: none; }
.agent-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.agent-turn { display: flex; flex-direction: column; gap: 6px; }
.agent-plan { margin: 6px 0; padding-left: 20px; }
.agent-steps { margin: 6px 0; padding-left: 0; list-style: none; font-size: 13px; color: var(--muted); }
.bubble .row-actions { margin-top: 8px; }
.grow { flex: 1; min-width: 0; }
@media (max-width: 900px) { .conn-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .layout { padding-bottom: 64px; }
  .sidebar { position: static; }
  .sidebar .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid;
    grid-template-columns: repeat(4, 1fr); gap: 0; padding: 4px; background: var(--surface); border-top: 1px solid var(--border); }
  .sidebar .nav a { flex-direction: column; justify-content: center; gap: 2px; padding: 8px 4px; font-size: 12px; text-align: center; }
  .sidebar .nav a > span:first-child { white-space: normal; }
  .conn-row { grid-template-columns: 1fr; }
}

.redraft { margin-top: 6px; }
.redraft input { flex: 1; min-width: 180px; }

/* AI Video Montaj */
.drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted);
  cursor: pointer; margin: 10px 0; }
.drop:hover, .drop.over, .drop:focus { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); outline: none; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.bar span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.upload-panel { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: min(360px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.up-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vplayer { width: 100%; max-height: 420px; border-radius: 8px; background: #000; margin: 8px 0; }
.edl .list-item { gap: 8px; align-items: center; flex-wrap: wrap; }
.edl .list-item.off { opacity: .5; }
.edl input.t { width: 72px; padding: 2px 4px; font: inherit; font-size: 12px; }
.edl select { font: inherit; font-size: 12.5px; }
@media (max-width: 680px) { .upload-panel { bottom: 76px; } }
.asset { padding: 10px 0; border-top: 1px solid var(--border); }
.asset-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.asset-head .title { overflow-wrap: anywhere; }
.asset details summary { cursor: pointer; }
.edl .subrow { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.edl input.subtext { flex: 1; min-width: 200px; padding: 3px 6px; font: inherit; font-size: 13px; }
.qc { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.qc li { margin: 2px 0; }
.card.accepted { border-color: var(--ok); }

/* Instagram Studio */
.ig-card { display: grid; grid-template-columns: 180px 1fr; gap: 14px; }
.ig-thumb { width: 100%; aspect-ratio: 4 / 5; background: var(--surface-2); border-radius: 8px; overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.ig-thumb.tall { aspect-ratio: 9 / 16; }
.ig-thumb img, .ig-thumb video { width: 100%; height: 100%; object-fit: cover; }
.ig-mini { width: 54px; aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.ig-mini img { width: 100%; height: 100%; object-fit: cover; }
.ig-strip { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.ig-variants { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.ig-var { font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text); }
.ig-var.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ig-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
tr.off { opacity: .45; }
.btn.active { border-color: var(--accent); color: var(--accent); }
@media (max-width: 680px) { .ig-card { grid-template-columns: 1fr; } .ig-thumb.tall { max-height: 360px; } }
.ig-card .sp-body { min-width: 0; overflow-wrap: anywhere; }
.ig-card .card-head { flex-wrap: wrap; gap: 6px; }

/* AI Avatar reklama */
.teleprompter { font-size: 15px; line-height: 1.6; margin: 8px 0; }
.tp-line { padding: 3px 0; border-bottom: 1px dashed var(--border); }
.tp-sec { display: inline-block; min-width: 62px; font-size: 11px; color: var(--muted); text-transform: uppercase; margin-right: 6px; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.av-portrait { border: 2px solid transparent; border-radius: 8px; padding: 4px; }
.av-portrait.chosen { border-color: var(--ok); }
.av-img img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; }
.av-audio audio { width: 100%; }
.av-video video { width: 100%; max-height: 420px; background: #000; border-radius: 8px; }

/* Instagram: sodda ulash */
.flow .sub-steps { margin: 6px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.ig-connect-progress { margin-top: 12px; }
.ig-connect-progress:empty { display: none; }

/* Instagram Auto Publisher: kalendar va statistika */
.ig-kpi { text-align: left; cursor: pointer; padding: 12px 14px; }
.ig-kpi-value { font-size: 26px; font-weight: 700; }
.ig-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border, #ddd); border-left: 1px solid var(--border, #ddd); }
.ig-wd { font-size: 12px; font-weight: 600; text-align: center; padding: 6px; border-right: 1px solid var(--border, #ddd); border-bottom: 1px solid var(--border, #ddd); opacity: .75; }
.ig-cell { position: relative; min-height: 100px; padding: 4px; display: flex; flex-direction: column; gap: 4px; min-width: 0; border-right: 1px solid var(--border, #ddd); border-bottom: 1px solid var(--border, #ddd); }
.ig-week .ig-cell { min-height: 320px; }
.ig-cell.other { opacity: .5; }
.ig-cell.today .ig-cell-date { background: var(--accent, #6d28d9); color: #fff; }
.ig-cell.over, .ig-hour.over { outline: 2px dashed var(--accent, #6d28d9); outline-offset: -2px; }
.ig-cell-date { align-self: flex-start; border: 0; background: transparent; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; cursor: pointer; color: inherit; }
.ig-cell-items { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ig-cell-count { display: none; }
.ig-cal-item { display: block; width: 100%; text-align: left; font-size: 12px; padding: 3px 6px; border-radius: 6px; border: 0; border-left: 3px solid #3b82f6; background: rgba(59, 130, 246, .1); color: inherit; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ig-cal-item[draggable="true"] { cursor: grab; }
.ig-cal-item.st-published { border-left-color: #16a34a; background: rgba(22, 163, 74, .1); }
.ig-cal-item.st-failed { border-left-color: #dc2626; background: rgba(220, 38, 38, .1); }
.ig-cal-item.st-publishing { border-left-color: #f59e0b; background: rgba(245, 158, 11, .12); }
.ig-cal-sub { display: block; font-size: 11px; opacity: .7; overflow: hidden; text-overflow: ellipsis; }
.ig-day { display: flex; flex-direction: column; border-top: 1px solid var(--border, #ddd); }
.ig-hour { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; min-height: 40px; padding: 4px 0; border-bottom: 1px solid var(--border, #ddd); }
.ig-hour-items { display: flex; flex-wrap: wrap; gap: 6px; }
.ig-hour-items .ig-cal-item { width: auto; max-width: 320px; }
@media (max-width: 720px) {
  .ig-cell { min-height: 54px; padding: 2px; }
  .ig-week .ig-cell { min-height: 110px; }
  .ig-month .ig-cell-items { display: none; }
  .ig-month .ig-cell-count { display: inline-block; align-self: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent, #6d28d9); border-radius: 999px; padding: 0 7px; }
  .ig-wd, .ig-week .ig-cal-item { font-size: 10px; }
}

/* AI Multserial Studio */
.ser-chars { display: grid; gap: 10px; }
.ser-char { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; color: inherit; text-decoration: none; }
.ser-char:hover { background: rgba(0, 0, 0, 0.03); }
.ser-thumb { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: #f3f4f6; display: grid; place-items: center; font-size: 12px; color: #6b7280; flex: none; }
.ser-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ser-refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.ser-ref .ser-thumb { width: 100%; height: 180px; }
.ser-ref.primary .ser-thumb { outline: 3px solid #f59e0b; }
.ser-swatch { display: inline-block; width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.15); margin-right: 4px; }
.ser-code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: #f8fafc; padding: 8px; border-radius: 8px; }
.ser-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ser-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 999px; cursor: pointer; }
.ser-drop { border: 2px dashed #94a3b8; border-radius: 12px; padding: 22px; text-align: center; color: #475569; cursor: pointer; }
.ser-drop.over, .ser-drop:hover { border-color: #2563eb; background: rgba(37, 99, 235, 0.05); }
.ser-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 12px; }
.ser-img .ser-thumb { width: 100%; height: 200px; }
.ser-img .title { font-weight: 600; margin-top: 6px; }
#drawer-body .ser-thumb { width: 100%; height: 300px; margin-bottom: 12px; }
#drawer-body .ser-thumb img { object-fit: contain; }
.ser-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.ser-step { padding: 4px 10px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: 13px; }
.ser-step.done { background: #dcfce7; color: #166534; }
.ser-shots { display: grid; gap: 10px; margin-top: 10px; }
.ser-shot { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; }
.ser-shot .grow { flex: 1; min-width: 0; }
.ser-shot-media { width: 150px; flex: none; display: grid; gap: 4px; }
.ser-shot-media .ser-thumb { width: 150px; height: 120px; }
.ser-shot-media video { width: 100%; height: 100%; object-fit: cover; }
.ser-shot-line { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.ser-shot-line input { flex: 1; }
.ser-video video { width: 100%; max-width: 360px; border-radius: 10px; background: #000; }
@media (max-width: 640px) { .ser-shot { flex-direction: column; } .ser-shot-media { width: 100%; } .ser-shot-media .ser-thumb { width: 100%; height: 200px; } }
.ser-card { background: #000; color: #fde047; font-weight: 700; flex-direction: column; text-align: center; padding: 6px; }
.ser-card small { color: #fff; font-weight: 500; font-size: 11px; }
.ser-logo .ser-thumb { width: 56px; height: 56px; border-radius: 50%; }

/* Video skachat */
.dl-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.dl-video { min-height: 60px; display: grid; place-items: center; background: #0f172a; border-radius: 10px; overflow: hidden; }
.dl-video video { width: 100%; max-height: 380px; background: #000; }
.dl-url { width: 100%; min-height: 96px; }
.dl-video .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); }

/* Instagram Studio */
.igs-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.igs-step { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--muted); font-size: 13px; }
.igs-step-t { font-weight: 600; color: var(--text); }
.igs-step-s { font-size: 12px; }
.igs-todo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.igs-step b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); flex: none; }
.igs-step.cur { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.igs-step.cur b { background: var(--accent); color: #fff; }
.igs-step.ok b { background: var(--ok, #2e9d5b); color: #fff; }
.igs-drop { padding: 36px 18px; }
.igs-drop-big { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.igs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.igs-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.igs-card.chosen { border-color: var(--accent); background: var(--accent-soft); }
.igs-video { width: 100%; aspect-ratio: 9 / 16; max-height: 440px; border-radius: 8px; background: #000; object-fit: contain; }
.igs-wait { display: grid; place-items: center; color: #ccc; font-size: 14px; text-align: center; padding: 8px; }
.igs-pick { cursor: pointer; }
.igs-excerpt { font-style: italic; }
@media (max-width: 700px) { .igs-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.igs-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.igs-mode { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px 16px; border: 2px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.igs-mode:hover { border-color: var(--accent); }
.igs-mode.cur { border-color: var(--accent); background: var(--accent-soft); }
.igs-mode-i { font-size: 28px; }
.igs-mode-t { font-weight: 700; font-size: 15px; }
.igs-mode-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.igs-form { max-width: 720px; }
@media (max-width: 700px) { .igs-modes { grid-template-columns: 1fr; } }
.igs-form .field, .igs-steps + .card .field { margin-bottom: 16px; }
.igs-form .field > label { font-weight: 600; margin-bottom: 6px; display: block; }
.igs-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.igs-style { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; background: var(--surface); }
.igs-style.cur { border-color: var(--accent); background: var(--accent-soft); }
.igs-style input { margin-top: 3px; }
.igs-compare-row { display: flex; gap: 16px; align-items: flex-start; }
.igs-src { width: 200px; flex: none; }
.igs-timeline { position: relative; height: 34px; background: var(--surface-2); border-radius: 6px; margin: 12px 0 4px; }
.igs-seg { position: absolute; top: 3px; height: 28px; border: none; border-radius: 4px; color: #fff; font-size: 11px; font-weight: 700;
  cursor: pointer; overflow: hidden; padding: 0 2px; opacity: .9; }
.igs-seg.reel { background: var(--accent); }
.igs-seg.story { background: #d97706; top: 18px; height: 13px; font-size: 9px; }
.igs-seg:hover { opacity: 1; outline: 2px solid var(--text); }
.igs-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.igs-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.igs-dot.reel { background: var(--accent); }
.igs-dot.story { background: #d97706; }
.igs-changes { margin: 2px 0 4px 18px; padding: 0; font-size: 12.5px; color: var(--muted); }
.igs-changes li { margin: 2px 0; }
@media (max-width: 700px) { .igs-styles { grid-template-columns: 1fr; } .igs-compare-row { flex-direction: column; } .igs-src { width: 100%; } }
.igs-script-row { display: flex; gap: 18px; align-items: flex-start; }
.igs-script-side { position: sticky; top: 12px; width: 230px; flex: none; }
.igs-script-side .igs-src { width: 100%; }
.igs-sum { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0 10px; }
.igs-lines { display: flex; flex-direction: column; gap: 10px; }
.igs-line { border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: var(--radius); padding: 10px 12px;
  background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.igs-line.hook { border-left-color: #e11d48; }
.igs-line.body { border-left-color: var(--accent); }
.igs-line.cta { border-left-color: #16a34a; }
.igs-line textarea { width: 100%; font-size: 15px; line-height: 1.4; resize: vertical; }
.igs-line-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.igs-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2);
  font-size: 12px; font-weight: 700; }
.igs-role { font-weight: 700; padding: 3px 6px; border-radius: 6px; }
.igs-role.hook { color: #e11d48; }
.igs-role.body { color: var(--accent); }
.igs-role.cta { color: #16a34a; }
.igs-line-eff { display: flex; gap: 6px; flex-wrap: wrap; }
.igs-line-eff input { flex: 1; min-width: 160px; }
.igs-off { margin-top: 12px; }
.igs-off-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.igs-script-actions { margin-top: 14px; position: sticky; bottom: 0; background: var(--surface); padding: 10px 0; }
@media (max-width: 800px) { .igs-script-row { flex-direction: column; } .igs-script-side { position: static; width: 100%; } }
.igs-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 8px; }
.igs-cover { border: 2px solid var(--border); border-radius: var(--radius); padding: 6px; cursor: pointer; display: flex;
  flex-direction: column; gap: 4px; background: var(--surface); }
.igs-cover.chosen { border-color: var(--accent); background: var(--accent-soft); }
.igs-cover input { position: absolute; opacity: 0; pointer-events: none; }
.igs-cover-img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; background: #111; }
.igs-cover-none .igs-cover-img { display: grid; place-items: center; font-size: 12px; color: #bbb; text-align: center; padding: 8px; }
.igs-dup { margin: 4px 0; padding: 6px 10px; border-radius: 6px; background: #fff4d6; color: #7a4b00; font-size: 12.5px; border: 1px solid #f3d27a; }
@media (prefers-color-scheme: dark) { .igs-dup { background: #3a2c0a; color: #f6d58a; border-color: #6b5214; } }
.igs-cover.story input { position: absolute; opacity: 0; }

/* --- CRM — Lidlar ------------------------------------------------------------------------- */
.crm-head { margin-bottom: 16px; }
.crm-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.crm-head-top h2 { margin: 0 0 4px; }
.crm-head-top p { margin: 0; max-width: 720px; }
.crm-head .filters { margin-bottom: 0; }
.crm-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.crm-tile .stat-value { font-size: 24px; }
.crm-tile.ok .stat-value { color: var(--ok); }
.crm-tile.warn .stat-value { color: var(--warn); }
.crm-tile.bad .stat-value { color: var(--bad); }
.crm-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; }
.crm-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.crm-toolbar .crm-search { flex: 1 1 260px; min-width: 0; }
.crm-toolbar select { flex: 0 1 220px; }
.crm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto;
  padding-bottom: 8px; align-items: start; }
.crm-col { background: var(--surface-2); border-radius: var(--radius); padding: 8px; min-height: 160px; border-top: 3px solid var(--border);
  display: flex; flex-direction: column; gap: 8px; transition: outline-color .15s; outline: 2px dashed transparent; }
.crm-col.over { outline-color: var(--accent); }
.crm-col header { display: flex; justify-content: space-between; align-items: center; font-weight: 650; font-size: 13px; padding: 2px 4px; }
.crm-count { background: var(--surface); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.crm-empty { color: var(--muted); text-align: center; padding: 16px 0; font-size: 13px; }
.st-new { border-top-color: var(--accent); }
.st-contacted { border-top-color: var(--info); }
.st-interested { border-top-color: #0e9384; }
.st-thinking { border-top-color: var(--warn); }
.st-awaiting_payment { border-top-color: #dc6803; }
.st-won { border-top-color: var(--ok); }
.st-lost { border-top-color: var(--bad); }
.crm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; cursor: pointer;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.crm-card:hover, .crm-card:focus-visible { border-color: var(--accent); outline: none; }
.crm-card-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.crm-card-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-line.ok { color: var(--ok); font-weight: 600; }
.crm-card-foot { display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 2px; }
.crm-profile-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.crm-status-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-status-bar .chip:disabled { opacity: 1; cursor: default; }
.pill.crm-st.st-new { background: var(--accent-soft); color: var(--accent); }
.pill.crm-st.st-won { background: var(--ok-soft); color: var(--ok); }
.pill.crm-st.st-lost { background: var(--bad-soft); color: var(--bad); }
.pill.crm-st.st-thinking, .pill.crm-st.st-awaiting_payment { background: var(--warn-soft); color: var(--warn); }
.pill.crm-st.st-contacted, .pill.crm-st.st-interested { background: var(--info-soft); color: var(--info); }
.crm-timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.crm-timeline li { position: relative; padding: 4px 0 10px 14px; }
.crm-timeline li::before { content: ""; position: absolute; left: -6px; top: 9px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--muted); }
.crm-timeline li.ev-status::before { border-color: var(--accent); }
.crm-timeline li.ev-created::before { border-color: var(--ok); }
.crm-timeline li.ev-merge::before, .crm-timeline li.ev-request::before { border-color: var(--warn); }
@media (max-width: 1100px) { .crm-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .crm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-head-top { flex-direction: column; }
}
.crm-h { margin: 18px 0 8px; font-size: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* --- Sayt boshqaruvi (biznesmner.uz) ---------------------------------------------------------- */
.site-head { margin-bottom: 14px; }
.site-head-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.site-head-top h2 { margin: 0 0 4px; }
.site-head-top p { margin: 0; max-width: 760px; }
.site-demo { margin: 14px 0 8px; padding: 12px 14px; border-radius: 8px; background: var(--ok-soft); color: var(--text); }
.site-demo.on { background: var(--warn-soft); }
.site-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.site-check input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.site-check .hint { display: block; }
.site-state { font-size: 13px; color: var(--ok); font-weight: 600; margin-bottom: 4px; }
.site-state.warn { color: var(--warn); }
.site-body { display: grid; gap: 16px; }
.site-body .card h3 { margin: 0 0 12px; font-size: 16px; }
.site-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.site-grid .wide { grid-column: 1 / -1; }
.site-grid .site-check { align-self: end; padding-bottom: 8px; }
.site-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-top: 12px; background: var(--surface); }
.site-item.is-demo { border-style: dashed; border-color: var(--warn); background: color-mix(in srgb, var(--warn-soft) 40%, var(--surface)); }
.site-item-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.site-item-head .spacer { flex: 1; }
.site-media { display: flex; gap: 12px; align-items: flex-start; }
.site-media-in { flex: 1; display: grid; gap: 6px; min-width: 0; }
.site-prev { width: 96px; height: 64px; border-radius: 8px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; flex: none; font-size: 12px; }
.site-prev img, .site-prev video { width: 100%; height: 100%; object-fit: cover; }
.site-savebar { position: sticky; bottom: 0; padding: 12px 0; margin-top: 16px; background: linear-gradient(transparent, var(--bg) 30%); display: flex; justify-content: flex-end; }
input[type="color"] { width: 64px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
@media (max-width: 760px) { .site-grid { grid-template-columns: 1fr; } }

.site-tunnel { margin-bottom: 14px; }
.site-tunnel summary { cursor: pointer; font-weight: 600; }
.site-tunnel .row-actions input { flex: 1 1 320px; min-width: 0; }
.site-steps { margin: 10px 0; padding-left: 20px; display: grid; gap: 4px; }

.mb-overs { display: grid; gap: 8px; }
.mb-over { display: grid; grid-template-columns: 1fr 80px 140px; gap: 8px; align-items: center; font-size: 14px; }

/* --- AI sotuvchi ---------------------------------------------------------------------------- */
.ag-group h4 { margin: 16px 0 4px; font-size: 14px; color: var(--muted); }
.ag-msgs { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 60vh; overflow-y: auto; }
.ag-msg { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); max-width: 85%; font-size: 14px; white-space: pre-wrap; }
.ag-msg.user { align-self: flex-start; }
.ag-msg.ai { align-self: flex-end; background: var(--accent-soft); }
.ag-msg.operator { align-self: flex-end; background: var(--ok-soft); }
.ag-msg.system { align-self: center; background: var(--warn-soft); font-size: 12.5px; }
.ag-who { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.ag-test .row-actions input { flex: 1 1 300px; min-width: 0; }
