* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

:root {
  --bg: #0f1115;
  --bg-2: #171a21;
  --bg-3: #1f232d;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --text-dim: #9aa1b0;
  --primary: #e53935;
  --primary-hover: #f4433f;
  --success: #2e9e5b;
  --warn: #d9a013;
  --danger: #d64545;
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}
.sidebar-header h1 { font-size: 17px; }
.lang-switch { display: flex; gap: 4px; margin-top: 10px; }
.lang-btn {
  flex: 1;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { border-color: var(--primary); color: var(--text); background: rgba(229,57,53,0.1); }
/* min-height:0 — flex ustunda overflow ishlashi uchun shart (busiz ro'yxat qisqarmay,
   menyuni pastga surib yuboradi) */
.project-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.project-item {
  position: relative;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s;
}
.project-item:hover { background: var(--bg-3); }
.project-item .p-del {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  background: var(--bg-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  padding: 2px 7px;
  cursor: pointer;
}
.project-item:hover .p-del { display: block; }
.project-item .p-del:hover { color: #e08a80; border-color: #b4453a; }
.project-item .p-del.p-del-confirm {
  display: block;
  color: #fff;
  background: #b4453a;
  border-color: #b4453a;
}
.project-item.active { background: var(--bg-3); border-color: var(--primary); }
.project-item .p-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item .p-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.project-item .p-id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px;
  color: var(--text-dim);
  opacity: 0.75;
  cursor: copy;
}
.project-item .p-id:hover { opacity: 1; color: var(--primary); }

/* ---------- Main ---------- */
.main { flex: 1; overflow-y: auto; padding: 24px 32px; position: relative; }
.empty-state { text-align: center; margin-top: 20vh; color: var(--text-dim); }
.empty-state h2 { margin-bottom: 8px; color: var(--text); }

.project-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.project-title {
  flex: 1;
  font-size: 22px;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text);
  border-bottom: 1px solid transparent;
  padding: 4px 0;
}
.project-title:focus { outline: none; border-bottom-color: var(--primary); }

/* ---------- Steps ---------- */
.step {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.step h2 { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
}
.row { display: flex; gap: 10px; align-items: center; margin: 10px 0; flex-wrap: wrap; }

input, textarea, select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); }
select { max-width: 420px; }
#voiceSelect { flex: 1; }
#searchInput { flex: 1; }
textarea { width: 100%; resize: vertical; line-height: 1.6; }
.input-sm { width: 70px; }

/* ---------- Buttons ---------- */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, opacity 0.15s;
  background: var(--bg-3);
  color: var(--text);
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); }
.btn-danger-ghost { background: transparent; border: 1px solid var(--border); color: var(--danger); }
.btn-block { width: 100%; }

/* ---------- Video grid ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.video-card {
  background: var(--bg-3);
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.video-card:hover { border-color: var(--border); }
.video-card.selected { border-color: var(--primary); }
.video-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.video-card .v-body { padding: 10px; }
.video-card .v-title { font-size: 13px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-card .v-meta { font-size: 11px; color: var(--text-dim); margin-top: 6px; }

/* ---------- Transcripts ---------- */
.transcript-item {
  background: var(--bg-3);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.transcript-item summary {
  padding: 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.transcript-item .t-text {
  padding: 0 12px 12px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.badge-ok { background: rgba(46,158,91,0.2); color: #5fd68f; }
.badge-fail { background: rgba(214,69,69,0.2); color: #ef8080; }

/* ---------- Results ---------- */
.result-box {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}
.result-box h3 { font-size: 14px; margin-bottom: 10px; color: var(--text-dim); }
.md-content { line-height: 1.7; font-size: 14px; white-space: pre-wrap; }

.change-item {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.change-item .c-original { color: #ef8080; text-decoration: line-through; }
.change-item .c-corrected { color: #5fd68f; }
.change-item .c-reason { color: var(--text-dim); margin-top: 4px; font-size: 12px; }

.finding-item {
  border-left: 4px solid var(--warn);
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.finding-item.sev-yuqori { border-left-color: var(--danger); }
.finding-item.sev-past { border-left-color: var(--success); }
.finding-item .f-quote { font-style: italic; color: var(--text-dim); margin-bottom: 6px; }
.finding-item .f-suggestion { color: #5fd68f; margin-top: 6px; }

.verdict {
  padding: 14px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-weight: 500;
}
.verdict-toza { background: rgba(46,158,91,0.15); color: #5fd68f; }
.verdict-ogohlantirish { background: rgba(217,160,19,0.15); color: #e8c35a; }
.verdict-jiddiy_muammo { background: rgba(214,69,69,0.15); color: #ef8080; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-content {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: min(700px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
}
.modal-content h2 { margin-bottom: 8px; }
.hint { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }

/* ---------- Toast / loading ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  z-index: 200;
  max-width: 400px;
}
.toast.error { border-color: var(--danger); }

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Yon panel menyusi. 7 ta yo'g'on ramkali tugma ~370px egallab, loyihalar ro'yxatiga
   joy qoldirmasdi — chap tekislangan yengil qatorlarga aylantirildi (~150px tejaladi). */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0; /* past bo'yli ekranda menyu emas, ro'yxat qisqarsin */
}
.sidebar-footer .btn {
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.35; /* global 1.6 menyu qatorlarini keraksiz baland qilardi */
  /* Sarlavhalar emoji bilan boshlanadi — kichik shriftda emoji matnga yopishib qoladi.
     1px yetarli: emoji nafas oladi, so'zlar orasi esa sun'iy ochilib ketmaydi. */
  word-spacing: 1px;
  text-align: left;
  background: transparent;
  color: var(--text-dim);
  border-radius: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}
.sidebar-footer .btn:hover { background: var(--bg-3); color: var(--text); opacity: 1; }
/* Chiqish — qolganlaridan ajratilgan, chunki bu qaytarib bo'lmaydigan amal */
#logoutBtn { margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0 0 7px 7px; padding-top: 10px; }
#logoutBtn:hover { color: var(--danger); background: rgba(229, 57, 53, 0.1); }

/* ---------- Rasm tanlash ---------- */
.scene-card {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}
.scene-card .s-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.scene-card .s-query { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
}
.photo-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.photo-item:hover { border-color: var(--border); }
.photo-item.picked { border-color: var(--success); }
.photo-item.picked::after {
  content: "✓";
  position: absolute;
  top: 4px; right: 6px;
  background: var(--success);
  color: #fff;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.photo-item .p-credit {
  position: absolute;
  inset: auto 0 0 0;
  font-size: 10px;
  color: #ddd;
  background: rgba(0,0,0,0.5);
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-item .p-zoom {
  position: absolute;
  top: 4px; left: 4px;
  background: rgba(0,0,0,0.55);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  cursor: zoom-in;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s;
}
.photo-item:hover .p-zoom { opacity: 1; }

/* ---------- Kanal ustaxonasi ---------- */
.channel-chip {
  padding: 8px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.channel-chip:hover { border-color: var(--text-dim); }
.channel-chip.active { border-color: var(--primary); }
.channel-chip .c-del { color: var(--danger); cursor: pointer; font-size: 12px; }
.channel-section { margin-top: 16px; }
.channel-section h3 { font-size: 13px; color: var(--text-dim); margin: 14px 0 6px; }
.pillar-item {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 6px;
  font-size: 13px;
}
.pillar-item b { display: block; margin-bottom: 2px; }
.audience-box {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13px;
  line-height: 1.7;
}

/* ---------- Hikoya ustaxonasi ---------- */
.mode-switch { display: flex; gap: 8px; margin-bottom: 18px; }
.mode-btn {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  cursor: pointer;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active { border-color: var(--primary); color: var(--text); background: rgba(229,57,53,0.08); }

.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.variant-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.variant-card .v-dir { font-size: 12px; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.variant-card .v-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.variant-card .v-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-bottom: 10px;
  flex: 1;
}

/* Ovoz progress bar */
.progress-outer {
  height: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 8px 0;
  overflow: hidden;
}
.progress-inner {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Qadamlarni yig'ish (svernut) */
.step-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; }
.step-caret { margin-left: auto; font-size: 13px; color: var(--text-dim); }
.step-toggle:hover .step-caret { color: var(--primary); }
.step.collapsed > *:not(h2) { display: none !important; }
.step.collapsed { padding-bottom: 10px; }

/* Kontsept rejimi: kadrlar va langar rasm */
.shot-item {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin: 5px 0;
  font-size: 13px;
}
.shot-item .sh-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shot-item .sh-body { display: flex; gap: 12px; align-items: flex-start; }
.shot-item .sh-main { flex: 1; min-width: 0; }
.shot-item .sh-thumb {
  width: 64px;
  flex: 0 0 64px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
}
.shot-item .sh-empty {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  background: var(--bg-2);
  cursor: default;
}
.shot-item .sh-vo { font-size: 12.5px; color: var(--text); margin-top: 3px; }
.shot-item .sh-screen { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.shot-item .sh-silent { font-size: 11px; color: var(--text-dim); opacity: 0.8; margin-top: 3px; }
.anchor-box {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 10px 0;
}
.anchor-box textarea { width: 100%; font-size: 12px; margin-top: 6px; }
.anchor-img {
  max-width: 240px;
  border-radius: 8px;
  margin-top: 8px;
  cursor: zoom-in;
  display: block;
}

.pick-wrap { position: relative; display: inline-block; max-width: 100%; }
.pick-wrap img { max-width: 100%; max-height: 60vh; border-radius: 8px; cursor: crosshair; display: block; }
.pick-dot {
  position: absolute;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #f0c419;
  border: 2px solid #fff;
  box-shadow: 0 0 6px rgba(0,0,0,0.6);
  pointer-events: none;
}
.sh-ontext {
  width: 100%;
  font-size: 12px;
  padding: 4px 8px;
  resize: none;
  overflow: hidden;
  min-height: 26px;
  background: var(--bg-2);
}
.sh-screen { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; }

.anchor-img.picking { cursor: crosshair; outline: 2px dashed var(--primary); }
.sh-zoom { width: 52px; font-size: 11px; padding: 1px 4px; background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: 5px; }
.sh-clearfocus { cursor: pointer; color: var(--text-dim); margin-left: 3px; }
.sh-clearfocus:hover { color: #e08a80; }
#pointerColor { width: 34px; height: 26px; padding: 1px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-2); }

/* Matn modellari (admin): rol | model (narx bilan) | effort | sinov | natija */
.model-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 110px 40px;
  gap: 8px 10px;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 8px 0;
}
.model-row .mr-name { font-size: 13px; line-height: 1.5; }
.model-row .mr-model { min-width: 0; font-size: 12.5px; }
.model-row .mr-test { padding: 4px 0; text-align: center; }
.model-row .mr-test-out { grid-column: 2 / -1; font-size: 12px; min-height: 0; }
.model-row .mr-test-out:empty { display: none; }
@media (max-width: 720px) {
  .model-row { grid-template-columns: 1fr 40px; }
  .model-row .mr-name { grid-column: 1 / -1; }
  .model-row .mr-model, .model-row .mr-effort { grid-column: 1; }
  .model-row .mr-test-out { grid-column: 1 / -1; }
}

/* Izoh qatoridagi havolalar (video/SRT yuklab olish) — brauzerning standart to'q ko'ki
   qorong'i fonda deyarli o'qilmaydi */
.hint a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.hint a:hover { color: var(--primary-hover); }

/* Musiqa kutubxonasi */
.ml-row {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 8px 0;
}
.ml-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ml-head .ml-name { font-size: 14px; }
.ml-head .ml-used { margin-left: auto; white-space: nowrap; }
.ml-row audio { width: 100%; height: 32px; margin: 8px 0 4px; display: block; }
.ml-acts { display: flex; gap: 14px; font-size: 12px; }
.ml-acts a { color: var(--text-dim); text-decoration: none; }
.ml-acts a:hover { color: var(--text); text-decoration: underline; }
.ml-acts a.ml-del { color: var(--danger); }
.ml-rename-input { font-size: 14px; padding: 2px 6px; max-width: 260px; }
@media (max-width: 620px) {
  .ml-head .ml-used { margin-left: 0; }
}

/* Balanslar paneli */
.bal-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 8px 0;
}
.bal-item .bal-name { min-width: 120px; font-weight: 600; }
.bal-item .bal-info { font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.bal-item.bal-bad { border-color: #b4453a; }
.bal-item.bal-bad .bal-info { color: #e08a80; }

/* Qoralama versiya tarixi (Faza 4) */
.hist-item {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 6px 0;
}
.hist-item .hist-meta { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.hist-item .hist-preview {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
  white-space: pre-wrap;
  margin-bottom: 6px;
}

/* Personajlar kastingi (Faza 2) */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.cast-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cast-card .c-name { font-size: 14px; font-weight: 600; }
.cast-card .c-role { font-size: 12px; font-weight: 400; color: var(--text-dim); }
.cast-card .c-field { font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }
.cast-card textarea { font-size: 12px; margin: 4px 0 0; }
.cast-card .c-ref { width: 180px; border-radius: 8px; margin-top: 4px; cursor: zoom-in; }
.cast-card .c-ref-note { font-size: 11px; margin: 2px 0 0; }

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 900px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-col {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.compare-col.enriched { border-color: rgba(46,158,91,0.5); }
.compare-head {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.compare-col.enriched .compare-head { color: #5fd68f; }
.compare-text {
  padding: 12px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 380px;
  overflow-y: auto;
}

/* ---------- Sahna promptlari ---------- */
.scene-prompt-item {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 6px 0;
}
.scene-prompt-item .sp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.scene-prompt-item .sp-prompt {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-wrap;
}
.sp-char {
  font-size: 11px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
}
.sp-dur {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
  cursor: default;
}
.sp-model {
  max-width: 200px;
  font-size: 11px;
  padding: 2px 6px;
  background: var(--bg-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sp-asset {
  display: block;
  height: 72px;
  border-radius: 8px;
  margin-top: 8px;
  cursor: zoom-in;
  border: 1px solid var(--border);
}

/* ---------- Outlier jadval va g'oya kartalari ---------- */
.outlier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.outlier-table th, .outlier-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.outlier-table th { color: var(--text-dim); font-weight: 500; font-size: 12px; }
.outlier-table a { color: var(--text); text-decoration: none; }
.outlier-table a:hover { text-decoration: underline; }
.score-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.score-high { background: rgba(229,57,53,0.2); color: #ff8a80; }
.score-mid { background: rgba(217,160,19,0.2); color: #e8c35a; }
.score-low { background: var(--bg-3); color: var(--text-dim); }
.idea-card {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 14px;
  margin: 8px 0;
}
.idea-card .i-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.idea-card .i-combining { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.idea-card .i-why { font-size: 13px; margin-bottom: 10px; line-height: 1.5; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- SEO ---------- */
.seo-h { font-size: 13px; color: var(--text-dim); margin: 14px 0 6px; }
.btn-copy {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
.btn-copy:hover { color: var(--text); }
.title-option {
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.title-option:hover { border-color: var(--text-dim); }
.title-option.selected { border-color: var(--primary); background: rgba(229,57,53,0.08); }
.title-option .t-len { color: var(--text-dim); font-size: 11px; white-space: nowrap; }

/* Thumbnail rasm tanlash */
#thumbImagePick .photo-item.picked { border-color: var(--primary); }
#thumbImagePick .photo-item.picked::after { background: var(--primary); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  cursor: zoom-out;
}
.lightbox img, .lightbox video {
  max-width: 94vw;
  max-height: 94vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* ---------- Montaj: rasm to'plami ---------- */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.image-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border);
}
.image-card img, .image-card video { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
/* Vertikal (9:16) loyihada kartalar ham vertikal — rasm kesilmasdan ko'rinadi */
.image-grid.vertical { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.image-grid.vertical .image-card img, .image-grid.vertical .image-card video { aspect-ratio: 9/16; }
.image-card .i-actions {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-between;
  background: rgba(0,0,0,0.55);
  padding: 4px 6px;
}
.image-card .i-actions button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 6px;
}
.image-card .i-actions button:hover { background: rgba(255,255,255,0.15); }
.image-card .i-num {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
}

/* ---------- Oddiy rejim (sehrgar) ---------- */
.ui-mode { display:flex; gap:4px; padding:10px 12px 0; }
.ui-mode-btn { flex:1; padding:7px 10px; border:1px solid var(--border,#2a2a2a); background:transparent;
  color:inherit; border-radius:8px; cursor:pointer; font-size:13px; }
.ui-mode-btn.is-on { background:var(--accent,#e5322d); border-color:transparent; color:#fff; font-weight:600; }
.simple-view { max-width:760px; margin:0 auto; padding:18px 16px 60px; }
.simple-title { font-size:26px; margin:0 0 4px; }
.q { margin:26px 0 0; }
.q h3 { display:flex; align-items:center; gap:9px; font-size:16px; margin:0 0 10px; font-weight:600; }
.q-num { display:inline-grid; place-items:center; width:23px; height:23px; border-radius:50%;
  background:var(--accent,#e5322d); color:#fff; font-size:12px; font-weight:700; }
.q textarea { width:100%; }
.opts { display:flex; gap:10px; }
.opts-wrap { flex-wrap:wrap; }
.opt { flex:1; min-width:150px; padding:12px 14px; border:1.5px solid var(--border,#2a2a2a);
  background:transparent; color:inherit; border-radius:10px; cursor:pointer; text-align:left; font-size:14px; }
.opt b { display:block; }
.opt small { display:block; opacity:.6; font-size:12px; margin-top:3px; line-height:1.35; }
.opt:hover { border-color:var(--accent,#e5322d); }
.opt.is-on { border-color:var(--accent,#e5322d); background:color-mix(in srgb, var(--accent,#e5322d) 12%, transparent); }

/* Format ikonkasi — nisbati AYNAN to'g'ri to'rtburchak (emoji o'rniga).
   O'lchamlar 9:16 va 16:9 ga qat'iy mos: 27x48 va 48x27. */
.opt-fmt { display:flex; align-items:center; gap:12px; }
.opt-fmt .opt-txt { min-width:0; }
.ratio { flex:none; border:2px solid currentColor; border-radius:4px; opacity:.4;
  background:linear-gradient(160deg, #ffffff14, transparent); transition:opacity .15s, border-color .15s; }
.ratio-v { width:27px; height:48px; }
.ratio-h { width:48px; height:27px; }
.opt:hover .ratio { opacity:.7; }
.opt.is-on .ratio { opacity:1; border-color:var(--accent,#e5322d); }
.fmt-tag { font-style:normal; font-size:11px; font-weight:600; letter-spacing:.4px;
  padding:1px 5px; border-radius:4px; background:#ffffff1a; opacity:.75; vertical-align:1px; }
.opt.is-on .fmt-tag { background:color-mix(in srgb, var(--accent,#e5322d) 30%, transparent); opacity:1; }

/* Uslub demolari — haqiqiy kadr, foydalanuvchi sifatni TASAVVUR qilmasin, KO'RSIN */
/* Grid — flex-wrap oxirgi qatorda yolg'iz karta qoldirardi; auto-fill kenglikka
   qarab ustun sonini o'zi tanlaydi va kartalar bir xil o'lchamda qoladi. */
.opts-style { display:grid; grid-template-columns:repeat(auto-fill, minmax(148px, 1fr)); gap:12px; }
.opt-style { flex:none; min-width:0; padding:8px 8px 10px; position:relative; }
/* Ko'p tanlanadigani ko'rinib tursin — faqat ramka yetarli emas */
.opt-style .tick { position:absolute; top:14px; right:14px; width:22px; height:22px; border-radius:50%;
  display:none; place-items:center; font-size:13px; font-weight:700; color:#fff;
  background:var(--accent,#e5322d); box-shadow:0 1px 4px #0007; }
.opt-style.is-on .tick { display:grid; }
.chip-more { margin-top:10px; }
.style-next { margin-top:9px; font-size:12.5px; opacity:.8; }
.opt-style .demo { display:block; width:100%; aspect-ratio:3/4; object-fit:cover;
  border-radius:7px; margin-bottom:8px; background:#ffffff12; }
.opt-style .demo.is-missing { display:grid; place-items:center; font-size:11px; opacity:.5; }
.opt-style b { font-size:13.5px; }
.demo-note { margin-top:9px; font-size:12px; opacity:.55; }

.chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.chip { padding:5px 10px; border:1px dashed var(--border,#2a2a2a); border-radius:20px; cursor:pointer;
  font-size:12.5px; opacity:.8; background:transparent; color:inherit; }
.chip:hover { opacity:1; border-style:solid; }
.simple-go { display:flex; align-items:center; gap:14px; margin-top:28px; }
.btn-big { font-size:16px; padding:13px 26px; }
.sbar { height:8px; border-radius:6px; background:#ffffff18; overflow:hidden; }
.sbar-fill { height:100%; width:0; background:var(--accent,#e5322d); transition:width .4s ease; }
.slog { list-style:none; padding:0; margin:10px 0 0; font-size:13px; opacity:.75; }
.slog li { padding:2px 0; }
