/* Yaponiya Iqtisodiyoti — Admin: blok konstruktori (studio).
   Ranglar admin.css tokenlaridan; kanvas — sayt gazeta ko‘rinishining .cv ichiga cheklangan nusxasi (admin interfeysiga ta’sir qilmaydi). */

/* ---------- Studio rejimi: admin yon paneli yashiriladi, ish maydoni to‘liq ekran ---------- */
body.studio-mode { overflow: hidden; }
body.studio-mode .app { grid-template-columns: minmax(0, 1fr); }
body.studio-mode .sidebar, body.studio-mode .app > .topbar, body.studio-mode #scrim { display: none !important; }
body.studio-mode .main { padding: 0; }

.st {
  --st-top: 56px; --pal-w: 248px; --insp-w: 356px;
  position: relative; display: grid; grid-template-rows: var(--st-top) minmax(0, 1fr);
  height: 100vh; height: 100dvh; background: var(--bg); overflow: hidden; overflow: clip; color: var(--text);
}
@media (max-width: 1360px) { .st { --pal-w: 228px; --insp-w: 336px; } }

/* ---------- Yuqori panel ---------- */
.st-top {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; min-width: 0; z-index: 45;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.st-back { flex: none; }
.st-doc { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.st-doc-t {
  border: 0; background: none; font-weight: 600; font-size: 14.5px; color: var(--text); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; padding: 5px 8px; border-radius: 7px; cursor: text; min-width: 0; max-width: 46ch; text-align: left;
  transition: background .15s;
}
.st-doc-t:hover { background: var(--surface-2); }
.st-doc-t.ph { color: var(--text-3); font-weight: 500; }
.st-doc-m { display: flex; align-items: center; gap: 10px; flex: none; }
.st-doc-m > span { display: inline-flex; align-items: center; }
.st-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.st-slot { display: inline-flex; align-items: center; gap: 6px; }
.st-hist { display: inline-flex; }
.st-hist .btn[disabled] { opacity: .35; }
.st-dev button { padding: 0 8px; }
.st-dev svg { width: 15px; height: 15px; }
.st-tg { display: none; }
.st-x { display: none; }

/* Holat belgisi va saqlash holati */
.st-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 0; cursor: default; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.st-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-pill.ok { background: var(--up-soft); color: var(--up); }
.st-pill.err { background: var(--down-soft); color: var(--down); cursor: pointer; }
.st-pill.err:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--down) 40%, transparent); }
.st-state { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-state svg { width: 14px; height: 14px; }
.st-state.dirty { color: var(--warn); }
.st-state.dirty::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-state.busy .spinner { width: 12px; height: 12px; }

/* Ajratilgan "Saqlash" tugmasi */
.split { display: inline-flex; position: relative; }
.split > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split > .btn + .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; width: 30px; padding: 0; margin-left: 1px; }
.split > .btn + .btn svg { width: 14px; height: 14px; }

/* Ochiladigan menyu */
.st-menu-w { position: relative; }
.st-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; z-index: 80; display: grid; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); animation: st-pop .14s ease-out;
}
@keyframes st-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.st-menu [role=menuitem] {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 7px; text-align: left;
  font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; transition: background .12s;
}
.st-menu [role=menuitem]:hover, .st-menu [role=menuitem]:focus-visible { background: var(--surface-2); outline: none; }
.st-menu [role=menuitem] svg { color: var(--text-3); }
.st-menu [role=menuitem].primary svg { color: var(--accent); }
.st-menu [role=menuitem] kbd { margin-left: auto; }
.st-menu [role=menuitem] small { display: block; color: var(--text-3); font-size: 11.5px; white-space: normal; }
.st-menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }

/* ---------- Asosiy qism: panel | kanvas | inspektor ---------- */
.st-body { position: relative; display: grid; grid-template-columns: var(--pal-w) minmax(0, 1fr) var(--insp-w); grid-template-rows: minmax(0, 1fr); min-height: 0; overflow: hidden; overflow: clip; }
.st-pal, .st-insp { background: var(--surface); min-height: 0; display: flex; flex-direction: column; min-width: 0; }
.st-pal { border-right: 1px solid var(--border); }
.st-insp { border-left: 1px solid var(--border); }
.st-scrim { display: none; }
.st-fab { display: none; }

/* Bloklar paneli */
.st-pal-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 14px 10px; }
.st-pal-h b { font-size: 13.5px; display: block; }
.st-pal-h span { display: block; font-size: 11.5px; color: var(--text-3); }
.st-pal-q { margin: 0 12px 6px; }
.st-pal-q .input { height: 34px; }
.st-pal-list { overflow: auto; padding: 6px 12px 24px; display: grid; gap: 16px; align-content: start; flex: 1; min-height: 0; overscroll-behavior: contain; }
.st-grp h3 { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 2px 7px; }
.st-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.st-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 66px; padding: 10px 6px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 500;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; text-align: center; line-height: 1.25;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s, color .15s;
}
.st-tile svg { width: 20px; height: 20px; color: var(--accent); }
.st-tile:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.st-tile:active { cursor: grabbing; }
.st-tile.is-armed { transform: scale(.96); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.st-snips { display: grid; gap: 6px; }
.st-snip { flex-direction: row; justify-content: flex-start; min-height: 0; padding: 9px 10px; text-align: left; gap: 10px; }
.st-snip-i { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); flex: none; }
.st-snip-i svg { width: 17px; height: 17px; }
.st-snip-t { display: grid; min-width: 0; }
.st-snip-t b { font-size: 12.5px; color: var(--text); font-weight: 600; }
.st-snip-t small { color: var(--text-3); font-size: 11.5px; font-weight: 400; }
.st-pal-none { color: var(--text-3); font-size: 13px; text-align: center; padding: 18px 0; }

/* ---------- Kanvas sahnasi ---------- */
.st-stage { overflow: auto; min-height: 0; position: relative; padding: 32px 28px 140px; scroll-padding: 90px 0; overscroll-behavior: contain;
  background-image: radial-gradient(color-mix(in srgb, var(--text-3) 22%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.st-stage:focus { outline: none; }
.st-page {
  --pad: 60px;
  margin: 0 auto; max-width: 860px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 44px 60px 36px; transition: max-width .2s ease, padding .2s ease, border-radius .2s ease;
}
.st[data-device="tablet"] .st-page { --pad: 36px; max-width: 768px; padding: 34px 36px 30px; }
.st[data-device="phone"] .st-page { --pad: 16px; max-width: 390px; padding: 22px 16px 24px; border-radius: 26px; box-shadow: var(--shadow-md), 0 0 0 7px var(--surface-3); }

/* Markdown rejimi */
.st-md { display: flex; flex-direction: column; gap: 10px; max-width: 920px; margin: 0 auto; height: 100%; }
.st-md-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--text-2); }
.st-md-bar > span { display: inline-flex; align-items: center; gap: 8px; }
.st-md-ta { flex: 1; min-height: 60vh; font-family: var(--font-mono); font-size: 13px; line-height: 1.65; padding: 14px 16px !important; tab-size: 2; resize: none; }

/* ---------- Kanvas: gazeta ko‘rinishi (faqat .cv ichida) ---------- */
.cv {
  --cv-ink: var(--text); --cv-ink-2: color-mix(in srgb, var(--text) 84%, var(--surface)); --cv-muted: var(--text-3);
  --cv-line: var(--border); --cv-line-2: var(--border-strong); --cv-sun: var(--brand-red); --cv-acc: var(--accent);
  --fs: 19px; --f-display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-family: var(--f-display); font-size: var(--fs); line-height: 1.72; color: var(--cv-ink-2); position: relative;
}
.st[data-device="tablet"] .cv, .st[data-device="phone"] .cv { --fs: 18px; }
.cv ::selection { background: var(--accent-soft-2); }
.cv-ph { color: var(--cv-muted); opacity: .75; font-style: italic; font-weight: 400; }
.cv-tplnote { display: flex; align-items: center; gap: 8px; font: 500 12.5px/1.4 var(--font-sans); color: var(--text-3); padding: 0 0 18px; margin-bottom: 22px; border-bottom: 3px double var(--cv-line-2); }

/* Sarlavha qismi */
.cv-head { border-top: 3px double var(--cv-ink); padding-top: 18px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.cv-kicker {
  display: inline-flex; gap: 12px; align-self: flex-start; align-items: center; border: 0; background: none; padding: 3px 5px; margin: -3px 0 0 -5px;
  border-radius: 5px; cursor: pointer; font: 700 12px/1.3 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--cv-muted);
}
.cv-kicker .k-cat { color: var(--cv-acc); }
.cv-kicker:hover, .cv-byline:hover { background: var(--surface-2); }
.k-ph { color: var(--cv-acc); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.cv-kicker .k-ph svg { width: 13px; height: 13px; }
.cv-h1 { font-family: var(--f-display); font-size: 44px; line-height: 1.07; letter-spacing: -.022em; font-weight: 600; color: var(--cv-ink); margin: 0; text-wrap: balance; }
.st[data-device="tablet"] .cv-h1 { font-size: 38px; }
.st[data-device="phone"] .cv-h1 { font-size: 30px; }
.cv-h1-meta { display: flex; gap: 10px; font: 12px var(--font-sans); color: var(--cv-muted); min-height: 0; margin-top: -6px; }
.cv-h1-meta:has(span:empty + span:empty) { display: none; }
.cv-count { opacity: 0; transition: opacity .15s; }
.cv-head.is-edit .cv-count, .cv-count.warn { opacity: 1; }
.cv-count.warn { color: var(--warn); }
.cv-ferr { color: var(--down); font-weight: 500; }
.cv-deck { font-family: var(--f-display); font-style: italic; font-size: 21px; line-height: 1.45; color: var(--cv-ink-2); margin: 0; }
.st[data-device="phone"] .cv-deck { font-size: 18px; }
.cv-byline {
  display: flex; flex-wrap: wrap; gap: 4px 0; width: 100%; text-align: left; cursor: pointer; padding: 9px 4px; margin: 0;
  font: 13px/1.4 var(--font-sans); color: var(--cv-muted); background: none; border: 0; border-top: 1px solid var(--cv-line); border-bottom: 1px solid var(--cv-line); border-radius: 0;
}
.cv-byline > span + span::before { content: "|"; margin: 0 12px; color: var(--cv-line-2); }
.cv-byline b { color: var(--cv-ink); }
.cv-hero { margin: 6px 0 0; }
.cv-hero-i { position: relative; }
.cv-hero img { width: 100%; height: auto; max-height: 460px; object-fit: cover; display: block; background: var(--surface-2); }
.cv-hero-a { position: absolute; right: 10px; bottom: 10px; opacity: 0; transition: opacity .15s; }
.cv-hero:hover .cv-hero-a, .cv-hero:focus-within .cv-hero-a { opacity: 1; }
.cv-hero figcaption, .cv-img figcaption, .cv-video figcaption, .cv-embed figcaption {
  font: 12.5px/1.45 var(--font-sans); color: var(--cv-ink-2); padding: 8px 0; border-bottom: 1px solid var(--cv-line);
}
.cv-embed figcaption:empty { display: none; }
.cv-credit { color: var(--cv-muted); font-size: 11.5px; margin-left: 4px; }
.cv-hero-ph, .cv-img-ph {
  width: 100%; display: grid; justify-items: center; gap: 4px; padding: 26px 16px; border: 1.5px dashed var(--cv-line-2); border-radius: 8px;
  background: var(--surface-2); color: var(--cv-muted); cursor: pointer; font: 13px var(--font-sans); transition: border-color .15s, color .15s, background .15s;
}
.cv-hero-ph svg, .cv-img-ph svg { width: 22px; height: 22px; }
.cv-hero-ph b, .cv-img-ph b { color: var(--text-2); font-weight: 600; }
.cv-hero-ph:hover, .cv-img-ph:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.cv-hero-ph.bad, .cv-img-ph.bad { border-color: color-mix(in srgb, var(--down) 50%, transparent); }
.cv-hero-ph.bad b, .cv-img-ph.bad b { color: var(--down); }
.cv-img-ph { aspect-ratio: 16 / 7; align-content: center; }
.cv-hero-load { aspect-ratio: 16 / 9; border-radius: 4px; }

/* Tahrirlanadigan matn */
.cv-rich, .cv-plain { position: relative; outline: none; border-radius: 3px; white-space: pre-wrap; word-break: break-word; cursor: text; }
.cv-plain { transition: box-shadow .15s, background .15s; }
.cv-plain:hover { box-shadow: 0 0 0 4px var(--surface-2); background: var(--surface-2); }
.cv-plain:focus { box-shadow: 0 0 0 4px var(--accent-soft); background: var(--accent-soft); }
.cv-plain.invalid { box-shadow: 0 0 0 4px var(--down-soft); background: var(--down-soft); }
.cv-rich.is-empty::before, .cv-plain.is-empty::before {
  content: attr(data-placeholder); position: absolute; left: 0; right: 0; top: 0; color: var(--cv-muted); opacity: .7; pointer-events: none;
  font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cv-rich a { color: var(--cv-acc); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.cv-rich b { color: var(--cv-ink); font-weight: 600; }

/* Bloklar */
.cv-body { position: relative; }
.cv-blocks { display: flow-root; min-height: 40px; }
.cv-blocks > .cv-blk + .cv-blk, .cv-col-in > .cv-blk + .cv-blk { margin-top: 1em; }
.cv-blk { position: relative; border-radius: 4px; outline: 1px solid transparent; outline-offset: 7px; transition: outline-color .15s, opacity .15s, box-shadow .2s; }
.cv-blk:focus { outline: 1px solid transparent; }
.cv-blk:hover { outline-color: color-mix(in srgb, var(--accent) 38%, transparent); }
.cv-blk.has-err { outline: 1px dashed color-mix(in srgb, var(--down) 60%, transparent); }
.cv-blk.is-sel { outline: 2px solid var(--accent); }
.cv-blk:focus-visible { outline: 2px solid var(--focus); }
.cv-blk.is-new { animation: cv-new .6s ease-out; }
@keyframes cv-new { from { box-shadow: 0 0 0 10px var(--accent-soft); background: var(--accent-soft); } to { box-shadow: 0 0 0 10px transparent; background: transparent; } }
.cv-blk.is-ping { animation: cv-new .9s ease-out; }
.cv-blk.is-src { opacity: .35; }
.cv-c { min-width: 0; }
.cv-err { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; font: 500 12.5px/1.4 var(--font-sans); color: var(--down); }
.cv-err svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }

/* Blok amallari paneli */
.cv-bar {
  position: absolute; right: -8px; top: -21px; z-index: 6; display: flex; align-items: center; gap: 1px; padding: 2px; height: 28px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-md);
  font-family: var(--font-sans); opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity .15s, transform .15s;
}
.cv-blk:hover > .cv-bar, .cv-blk.is-sel > .cv-bar, .cv-blk:focus-within > .cv-bar { opacity: 1; pointer-events: auto; transform: none; }
.cv-blk.is-sel > .cv-bar { border-color: var(--accent); }
body.st-dragging .cv-bar { opacity: 0 !important; pointer-events: none !important; }
.cv-bar button {
  height: 22px; min-width: 24px; border: 0; background: transparent; color: var(--text-2); border-radius: 5px; display: inline-flex;
  align-items: center; justify-content: center; gap: 4px; cursor: pointer; padding: 0 3px; font-size: 11.5px; font-weight: 600; transition: background .12s, color .12s;
}
.cv-bar button:hover { background: var(--surface-2); color: var(--text); }
.cv-bar button.danger:hover { background: var(--down-soft); color: var(--down); }
.cv-bar svg { width: 14px; height: 14px; }
.cv-grip { cursor: grab !important; touch-action: none; padding: 0 6px 0 2px !important; color: var(--text) !important; }
.cv-grip svg { stroke-width: 2.8; color: var(--text-3); }
.cv-blk.is-sel .cv-grip { background: var(--accent-soft); color: var(--accent) !important; }
.cv-grip:active { cursor: grabbing !important; }

/* Matnli bloklar */
.cv-p { margin: 0; }
.cv-blocks > .cv-blk[data-type="p"]:first-child .cv-p { font-size: calc(var(--fs) * 1.08); color: var(--cv-ink); }
.cv-p[data-dl]:not(.is-empty)::before { content: attr(data-dl) " "; font: 700 .7em var(--font-sans); letter-spacing: .08em; color: var(--cv-ink); margin-right: 2px; }
.cv-h { margin: 0; font-family: var(--f-display); font-weight: 600; color: var(--cv-ink); letter-spacing: -.01em; }
h2.cv-h { font-size: calc(var(--fs) * 1.38); line-height: 1.2; padding-top: .55em; margin-top: .35em; border-top: 1px solid var(--cv-line); }
h3.cv-h { font-size: calc(var(--fs) * 1.12); line-height: 1.3; }
h2.cv-h.is-empty::before { top: .55em; }
.cv-quote { margin: .3em 0; padding: 18px 46px 16px 0; border-top: 2px solid var(--cv-ink); border-bottom: 1px solid var(--cv-line); font-size: calc(var(--fs) * 1.24); line-height: 1.4; font-style: italic; color: var(--cv-ink); position: relative; }
.cv-quote::after { content: "“"; position: absolute; right: 0; top: -6px; font-size: 84px; line-height: 1; color: var(--cv-sun); font-style: normal; opacity: .85; pointer-events: none; }
.cv-cite { display: block; margin-top: 10px; font: normal 600 13px/1.4 var(--font-sans); color: var(--cv-muted); letter-spacing: .02em; min-height: 1.4em; }
.cv-cite:not(.is-empty)::before { content: "— "; }
.cv-cite.is-empty::before { font-style: normal; font-weight: 500; }
.cv-list { margin: 0; padding-left: 1.25em; display: flex; flex-direction: column; gap: .45em; }
.cv-list li::marker { color: var(--cv-acc); font-family: var(--font-sans); font-weight: 600; }
.cv-note { background: var(--surface-2); padding: 14px 16px; font: 14.5px/1.55 var(--font-sans); color: var(--cv-ink-2); border-left: 3px solid var(--cv-acc); }
.cv-note.tone-warn { background: var(--warn-soft); border-left-color: var(--warn); }
.cv-note.tone-good { background: var(--up-soft); border-left-color: var(--up); }
.cv-note.tone-bad { background: var(--down-soft); border-left-color: var(--down); }

/* Grafik, jadval va boshqa "figure" bloklar */
.cv-fig { margin: .4em 0 0; border-top: 2px solid var(--cv-ink); padding-top: 10px; font-family: var(--font-sans); }
.cv-fig-t { font-size: 15px; font-weight: 700; color: var(--cv-ink); line-height: 1.35; margin-bottom: 8px; }
.cv-fig-s { font-size: 12px; color: var(--cv-muted); border-top: 1px solid var(--cv-line); margin-top: 8px; padding-top: 6px; line-height: 1.45; }
.cv-chart-c { min-height: 80px; pointer-events: none; }
.cv-table { overflow-x: auto; }
.cv-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cv-table th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--cv-muted); border-bottom: 2px solid var(--cv-ink); padding: 8px 10px 8px 0; font-weight: 600; }
.cv-table td { border-bottom: 1px solid var(--cv-line); padding: 9px 10px 9px 0; font-variant-numeric: tabular-nums; color: var(--cv-ink); }
.cv-table .al-right { text-align: right; }
.cv-table .al-center { text-align: center; }
.cv-table tr.hl td { background: var(--accent-soft); font-weight: 600; }
.cv-tbl.sortable th::after { content: " ↕"; opacity: .35; }
.cv-mk-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; color: var(--cv-ink); }
.cv-chip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.cv-mk-n { color: var(--cv-muted); font-size: 12px; margin-left: auto; }
.cv-mk-c { height: 120px; color: var(--cv-acc); }
.cv-mk-c svg { width: 100%; height: 100%; display: block; }
.cv-stock-c { display: grid; place-content: center; justify-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--cv-line); color: var(--cv-muted); font-size: 12.5px; text-align: center; padding: 12px; min-height: 160px; }
.cv-stock-c svg { width: 26px; height: 26px; color: var(--cv-acc); }
.cv-stock-c b { color: var(--cv-ink); font-size: 15px; }
.cv-img { margin: 0; }
.cv-img img { width: 100%; height: auto; display: block; background: var(--surface-2); }
.cv-video { margin: 0; }
.cv-yt { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.cv-yt img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.cv-yt-p { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: var(--cv-sun); box-shadow: 0 8px 30px rgba(0, 0, 0, .4); }
.cv-yt-p::after { content: ""; position: absolute; left: 26px; top: 20px; border-style: solid; border-width: 12px 0 12px 19px; border-color: transparent transparent transparent #fff; }
.cv-yt.ph, .cv-embed-f.ph { display: grid; place-content: center; justify-items: center; gap: 4px; background: var(--surface-2); border: 1.5px dashed var(--cv-line-2); color: var(--cv-muted); font: 13px var(--font-sans); text-align: center; }
.cv-yt.ph b, .cv-embed-f.ph b { color: var(--text-2); }
.cv-yt.ph svg, .cv-embed-f.ph svg { width: 24px; height: 24px; }
.cv-embed { margin: 0; }
.cv-embed-f { width: 100%; max-height: 640px; border: 1px solid var(--cv-line); background: var(--surface-2); overflow: hidden; }
.cv-embed-f iframe { width: 100%; height: 100%; border: 0; display: block; pointer-events: none; }
.cv-file { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; border: 1px solid var(--cv-line-2); padding: 12px 14px; font-family: var(--font-sans); color: var(--cv-ink); background: var(--surface); }
.cv-file.ph { border-style: dashed; color: var(--cv-muted); }
.cv-file-x { width: 46px; height: 54px; display: grid; place-items: center; background: var(--cv-acc); color: var(--accent-fg); font-weight: 700; font-size: 12px; letter-spacing: .04em; clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%); }
.cv-file.ph .cv-file-x { background: var(--surface-3); color: var(--text-3); }
.cv-file-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cv-file-t b { font-size: 15px; }
.cv-file-t span { font-size: 13px; color: var(--cv-muted); }
.cv-file-s { font-size: 12.5px; color: var(--cv-acc); font-weight: 600; white-space: nowrap; }
.cv-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-top: 2px solid var(--cv-ink); border-bottom: 1px solid var(--cv-line); font-family: var(--font-sans); }
.cv-facts > div { padding: 12px 14px 12px 0; display: flex; flex-direction: column; gap: 3px; }
.cv-facts > div + div { padding-left: 14px; border-left: 1px solid var(--cv-line); }
.cv-facts .v { font-family: var(--f-display); font-size: calc(var(--fs) * 1.4); font-weight: 700; color: var(--cv-ink); line-height: 1.1; }
.cv-facts .k { font-size: 12.5px; color: var(--cv-muted); line-height: 1.4; }
.cv-raw { border: 1px dashed var(--cv-line-2); border-radius: 6px; padding: 10px 12px; background: var(--surface-2); }
.cv-raw-l { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px var(--font-sans); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.cv-raw-l svg { width: 13px; height: 13px; }
.cv-raw pre { margin: 6px 0 0; font: 12.5px/1.6 var(--font-mono); color: var(--text-2); white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }

/* Ajratgichlar (sayt bilan bir xil + inspektor namunalari) */
.cv-div { margin: .3em 0; color: var(--cv-muted); display: flex; align-items: center; justify-content: center; min-height: 18px; font-family: var(--font-sans); }
.cv-div-line { border-top: 1px solid var(--cv-line-2); min-height: 0; height: 0; margin: .9em 0; }
.cv-div-double { border-top: 3px double var(--cv-ink); min-height: 0; height: 0; margin: .9em 0; }
.cv-div-dots::before { content: "• • •"; letter-spacing: .6em; font-size: 18px; color: var(--cv-ink-2); }
.cv-div-ornament::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--cv-sun); box-shadow: -34px 0 0 -2px var(--cv-line-2), 34px 0 0 -2px var(--cv-line-2); }
.cv-div-space { height: 24px; border: 1px dashed transparent; }
.cv-blk:hover .cv-div-space, .cv-blk.is-sel .cv-div-space { border-color: var(--cv-line); }
.cv-div-label { gap: 14px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cv-ink); }
.cv-div-label::before, .cv-div-label::after { content: ""; flex: 1; border-top: 1px solid var(--cv-line-2); }

/* Bo‘sh kanvas va sudrash */
.cv-empty {
  display: grid; justify-items: center; text-align: center; gap: 8px; padding: 44px 20px; border: 2px dashed var(--border-strong); border-radius: 12px;
  color: var(--text-3); font: 13.5px/1.5 var(--font-sans); background: var(--surface-2); transition: border-color .15s, background .15s, transform .15s;
}
.cv-empty b { color: var(--text); font-size: 15px; font-weight: 600; }
.cv-empty-i { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.cv-empty-i svg { width: 22px; height: 22px; }
.cv-empty-a { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.cv-empty.is-over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.st.is-empty .cv-end { display: none; }
.cv-end { display: flex; justify-content: center; padding-top: 26px; }
.cv-add {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px dashed var(--border-strong);
  background: transparent; color: var(--text-2); cursor: pointer; font: 500 13px var(--font-sans); transition: border-color .15s, color .15s, background .15s;
}
.cv-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.cv-ind {
  position: absolute; left: -14px; right: -14px; top: 0; height: 3px; border-radius: 2px; background: var(--accent); pointer-events: none; z-index: 8;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); transition: transform .09s ease-out, opacity .15s;
}
.cv-ind::before, .cv-ind::after { content: ""; position: absolute; top: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--accent); box-sizing: border-box; }
.cv-ind::before { left: -6px; }
.cv-ind::after { right: -6px; }
.cv-ind.noop { opacity: .35; }
.st-ghost {
  position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; display: flex; gap: 9px; align-items: center; padding: 8px 12px;
  background: var(--surface); border: 1.5px solid var(--accent); border-radius: 10px; box-shadow: var(--shadow-lg); font: 600 13px/1.3 var(--font-sans);
  color: var(--text); max-width: 280px; will-change: transform; transition: border-color .12s, opacity .12s;
}
.st-ghost svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.st-ghost span { display: grid; min-width: 0; }
.st-ghost small { font-weight: 400; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-ghost.no { border-color: var(--border-strong); opacity: .75; }
body.st-dragging, body.st-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }

/* ---------- Inspektor ---------- */
.st-insp-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 0 8px; border-bottom: 1px solid var(--border); }
.st-tabs { display: flex; gap: 2px; }
.st-tabs button {
  border: 0; background: none; padding: 10px 12px; font-weight: 600; font-size: 13px; color: var(--text-3); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; transition: color .15s, border-color .15s;
}
.st-tabs button:hover { color: var(--text); }
.st-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.st-tab-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--down); color: #fff; font-size: 11px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.st-insp-b { overflow: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.st-panel { padding: 14px 16px 28px; display: grid; gap: 16px; align-content: start; }
.st-help { border-top: 1px solid var(--border); padding: 9px 14px; font-size: 12.5px; flex: none; }
.st-help summary { cursor: pointer; color: var(--text-2); display: flex; gap: 7px; align-items: center; font-weight: 500; list-style: none; border-radius: 5px; }
.st-help summary::-webkit-details-marker { display: none; }
.st-help[open] summary { margin-bottom: 8px; }
.st-help dl { display: grid; gap: 6px; margin: 0; max-height: 34vh; overflow: auto; }
.st-help dl div { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.st-help dt { color: var(--text-2); }
.st-help dd { margin: 0; white-space: nowrap; }

.ins-head { display: flex; gap: 10px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin: -2px 0 -4px; }
.ins-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.ins-head-t { min-width: 0; flex: 1; display: grid; }
.ins-head-t b { font-size: 14px; }
.ins-head-t small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-head-a { display: flex; }
.ins-err { background: var(--down-soft); border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; }
.ins-err p { display: flex; gap: 7px; color: var(--down); font-size: 12.5px; font-weight: 500; align-items: flex-start; }
.ins-err svg { flex: none; margin-top: 2px; width: 14px; height: 14px; }
.ins-body { gap: 16px; }
.ins-sec { display: grid; gap: 8px; min-width: 0; }
.ins-sec + .ins-sec { padding-top: 14px; border-top: 1px solid var(--border); }
.ins-sec h4 { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ins-sec h4 .counter { font-weight: 400; color: var(--text-3); }
.ins-tip { display: flex; gap: 9px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); padding: 10px 11px; border-radius: 8px; line-height: 1.5; }
.ins-tip svg { flex: none; margin-top: 2px; color: var(--accent); }
.ins-conv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.ins-conv button, .ins-tones button, .ins-dv button {
  display: grid; justify-items: center; gap: 4px; padding: 8px 3px 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 11px; color: var(--text-2); transition: border-color .15s, background .15s, color .15s; min-width: 0;
}
.ins-conv button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ins-conv button:hover, .ins-tones button:hover, .ins-dv button:hover { border-color: var(--border-strong); color: var(--text); }
.ins-conv [aria-checked="true"], .ins-tones [aria-checked="true"], .ins-dv [aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--accent); }
.ins-tones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ins-tones button { grid-template-columns: auto 1fr; justify-items: start; align-items: center; padding: 8px 10px; font-size: 12.5px; gap: 8px; }
.ins-tones i { width: 18px; height: 18px; border-radius: 4px; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.ins-tones i.tone-info { background: var(--surface-2); }
.ins-tones i.tone-warn { background: var(--warn-soft); border-color: var(--warn); }
.ins-tones i.tone-good { background: var(--up-soft); border-color: var(--up); }
.ins-tones i.tone-bad { background: var(--down-soft); border-color: var(--down); }
.ins-dv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ins-dv button { padding: 10px 8px 6px; gap: 6px; }
.ins-dv .cv-div { width: 100%; margin: 6px 0; min-height: 14px; font-size: 10px; }
.ins-dv .cv-div-line, .ins-dv .cv-div-double { margin: 12px 0 6px; }
.ins-dv .cv-div-label { gap: 6px; letter-spacing: .08em; }
.ins-dv .cv-div-space { height: 14px; border-color: var(--border); border-radius: 3px; }
.ins-dv .cv-div-ornament::before { box-shadow: -18px 0 0 -2px var(--border-strong), 18px 0 0 -2px var(--border-strong); }
.ins-dv .cv-div-dots::before { font-size: 12px; letter-spacing: .4em; }
.ins-dv button { --cv-ink: var(--text); --cv-ink-2: var(--text-2); --cv-line-2: var(--border-strong); --cv-sun: var(--brand-red); --cv-muted: var(--text-3); }
.ins-presets { display: flex; flex-wrap: wrap; gap: 5px; }
.ins-presets .ticker { font-family: var(--font-sans); font-size: 12px; }
.ins-warn { display: flex; gap: 8px; font-size: 12px; line-height: 1.5; color: var(--text-2); background: var(--warn-soft); padding: 9px 10px; border-radius: 8px; }
.ins-warn svg { flex: none; margin-top: 2px; color: var(--warn); }
.ins-warn.bad { background: var(--down-soft); color: var(--down); }
.ins-warn.bad svg { color: var(--down); }
.ins-media { display: flex; gap: 12px; align-items: flex-start; }
.ins-thumb { width: 104px; aspect-ratio: 3 / 2; flex: none; border-radius: 7px; overflow: hidden; border: 1px dashed var(--border-strong); background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); padding: 0; cursor: pointer; }
.ins-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ins-media-m { display: grid; gap: 6px; min-width: 0; }
.ins-media-m b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-media .file-ext { width: 42px; height: 48px; }
.ins-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ins-facts { display: grid; gap: 6px; }
.ins-fact { display: grid; grid-template-columns: minmax(0, .42fr) minmax(0, 1fr) auto; gap: 5px; align-items: center; }
.ins-fv { font-weight: 600; font-variant-numeric: tabular-nums; }
.ins-fact-a { display: flex; }
.ins-fact .input { height: 32px; padding: 0 8px; }
.ins-raw { font-size: 12.5px; line-height: 1.6; }
.ins-grid .tg-wrap { max-height: 300px; }
.ins-grid .tg-cell { min-width: 74px; }
.ins-grid .tb-bar { margin-bottom: 8px; }
.ins-outline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ins-outline button {
  display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 7px; cursor: pointer; color: var(--text-2);
  transition: background .12s;
}
.ins-outline button:hover { background: var(--surface-2); color: var(--text); }
.ins-outline button > span { display: grid; min-width: 0; flex: 1; }
.ins-outline b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.ins-outline small { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-outline button.bad > svg:last-child { color: var(--down); }
.ins-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 8px; color: var(--text-3); font-size: 13px; }
.ins-empty b { color: var(--text-2); }
.ins-empty svg { width: 22px; height: 22px; }
.ins-empty.sm { display: flex; text-align: left; align-items: flex-start; padding: 10px 11px; background: var(--surface-2); border-radius: 8px; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.ins-empty.sm svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent); }

/* Inspektordagi ixcham grafik konstruktori */
.cb.compact { grid-template-columns: minmax(0, 1fr); gap: 12px; min-height: 0; }
.cb.compact .cb-col { gap: 12px; }
.cb.compact .cb-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cb.compact .cb-gridwrap { max-height: 240px; }
.cb.compact .tg-cell { min-width: 70px; }
.cb.compact .cb-pal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cb.compact .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cb.compact .cb-switches { gap: 10px; flex-direction: column; }
.cb.compact .cb-big { justify-self: start; }
.cb.compact .cb-row { grid-template-columns: minmax(0, .45fr) minmax(0, 1fr) auto; }
.cb.compact .cb-tabs button { padding: 8px 8px; font-size: 12.5px; }
.cb-stat-line { margin-top: -4px; }

/* "Maqola" yorlig‘i (admin.js) */
.doc-panel { display: grid; gap: 0; margin: -14px -16px -28px; }
.doc-sec { padding: 14px 16px 16px; display: grid; gap: 12px; border-bottom: 1px solid var(--border); }
.doc-sec:last-child { border-bottom: 0; }
.doc-sec > h4 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.doc-sec > h4 svg { color: var(--text-3); }
.doc-sec > .hint { margin-top: -8px; line-height: 1.45; }
.doc-sec .grid-2 { gap: 10px; }
.doc-sec .input, .doc-sec .select { height: 34px; }
.doc-sec .row-item.src { grid-template-columns: minmax(0, 1fr) auto; }
.doc-sec .row-item.src .input:nth-child(2) { grid-column: 1; }
.doc-sec .row-item.src .btn { grid-row: 1 / span 2; grid-column: 2; }
.doc-sec .row-item.src + .row-item.src { padding-top: 8px; border-top: 1px dashed var(--border); }
.doc-sec .ticker-grid { max-height: 150px; overflow: auto; padding: 2px; }
.field.has-err .input, .field.has-err .select, .field.has-err .chips-input { border-color: var(--down); }
.f-err { font-size: 12px; color: var(--down); font-weight: 500; display: flex; gap: 5px; align-items: center; }
.f-err svg { width: 13px; height: 13px; }
.doc-probs { margin: 0; padding: 12px 16px 14px; display: grid; gap: 8px; border-bottom: 1px solid var(--border); background: var(--down-soft); }
.doc-probs.ok { background: var(--up-soft); }
.doc-probs h4 { font-size: 13px; display: flex; align-items: center; gap: 7px; color: var(--down); }
.doc-probs.ok h4 { color: var(--up); }
.doc-probs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.doc-probs button {
  display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 5px 6px; border-radius: 6px;
  font-size: 12.5px; color: var(--text); cursor: pointer; line-height: 1.4;
}
.doc-probs button:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.doc-probs button svg { flex: none; margin-top: 2px; width: 14px; height: 14px; color: var(--down); }
.doc-probs button small { color: var(--text-3); display: block; }
.doc-probs .hint { color: var(--text-2); }
.doc-status { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.doc-status label {
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 10px; cursor: pointer; display: grid; gap: 2px; font-size: 13px; font-weight: 600; position: relative;
  transition: border-color .15s, background .15s;
}
.doc-status label small { font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.doc-status input { position: absolute; opacity: 0; }
.doc-status label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.doc-status label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.doc-img { display: flex; gap: 12px; align-items: center; }
.doc-img .ph { width: 104px; height: 70px; border-radius: 7px; border: 1px dashed var(--border-strong); background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); flex: none; overflow: hidden; padding: 0; cursor: pointer; }
.doc-img .ph img { width: 100%; height: 100%; object-fit: cover; }
.doc-img .meta { min-width: 0; display: grid; gap: 4px; }
.doc-img .meta .id { font-family: var(--font-mono); font-size: 12.5px; }
.doc-img .meta .cap { font-size: 12px; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Oldindan ko‘rish oynasi */
dialog.dlg.pv-dlg .dlg-body { padding: 0; gap: 0; }
.pv-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pv-bar .status { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; margin-right: auto; }
.pv-stage { position: relative; flex: 1; overflow: hidden; background: var(--surface-2); min-height: 300px; }
.pv-stage iframe { position: absolute; top: 0; left: 0; border: 0; background: #fff; transform-origin: 0 0; transition: opacity .2s; }
.pv-stage.loading iframe { opacity: .55; }
.pv-stage:not(.desktop) iframe { box-shadow: 0 0 0 1px var(--border), var(--shadow-md); }
dialog.dlg.pv-dlg .dlg-body { display: flex; flex-direction: column; }
.pv-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
dialog.dlg.tbl-dlg .tg-wrap { max-height: calc(100vh - 230px); }

/* Shablon tanlash dialogi */
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tpl-pick .tpl-card { cursor: pointer; }
.tpl-pick .tpl-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---------- Moslashuvchan: < 1100px — panel va inspektor chekka oynalarga ---------- */
@media (max-width: 1099px) {
  .st-body { grid-template-columns: minmax(0, 1fr); }
  .st-tg, .st-x { display: inline-flex; }
  .st-pal, .st-insp {
    position: absolute; top: 0; bottom: 0; z-index: 40; box-shadow: var(--shadow-lg); visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
  }
  .st-pal { left: 0; width: min(300px, 86vw); transform: translateX(-102%); }
  .st-insp { right: 0; width: min(400px, 94vw); transform: translateX(102%); }
  .st.pal-open .st-pal, .st.insp-open .st-insp { transform: none; visibility: visible; transition: transform .2s ease, visibility 0s; }
  .st-scrim { display: block; position: absolute; inset: 0; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 35; }
  .st.pal-open .st-scrim, .st.insp-open .st-scrim { opacity: 1; pointer-events: auto; }
  .st-tg[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
  .st-stage { padding: 24px 18px 120px; }
}
@media (max-width: 820px) {
  .st-dev { display: none; }
  .st-doc-t { max-width: 30ch; }
}
@media (max-width: 680px) {
  [data-slot="state"] .st-state-t { display: none; }
  [data-slot="state"] .st-state:not(.dirty):not(.busy) { display: none; }
}
@media (max-width: 1240px) { [data-slot="actions"] .btn-ghost { display: none; } }
@media (max-width: 1099px) { [data-slot="actions"] .lbl { display: none; } [data-slot="actions"] .btn { width: var(--h); padding: 0; } }
/* Telefon: kanvas to‘liq kenglikda, bloklar pastki "+ Blok" varag‘idan */
@media (max-width: 639px) {
  .st { --st-top: 52px; }
  .st-top { padding: 0 6px; gap: 2px; }
  .st-tools { gap: 2px; }
  .st-doc { gap: 4px; }
  .st-doc-t { padding: 4px; font-size: 14px; }
  .st-tg-pal, [data-slot="actions"] { display: none !important; }
  .st-pill { font-size: 0; width: 22px; padding: 0; justify-content: center; gap: 0; }
  .st-pill::before { width: 8px; height: 8px; }
  .split > .btn:first-child { padding: 0 10px; }
  .split > .btn:first-child .kbd-hint { display: none; }
  .st-stage { padding: 0 0 110px; background-image: none; background: var(--surface); }
  .st-page, .st[data-device] .st-page { --pad: 16px; max-width: none; border-radius: 0; border: 0; box-shadow: none; padding: 18px 16px 24px; }
  .cv { --fs: 18px; }
  .cv-h1, .st[data-device] .cv-h1 { font-size: 29px; }
  .cv-deck, .st[data-device] .cv-deck { font-size: 18px; }
  .cv-bar { right: -4px; }
  .cv-bar .cv-grip span { display: none; }
  .st-fab { display: inline-flex; position: absolute; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30; border-radius: 999px; --h: 46px; padding: 0 20px; box-shadow: var(--shadow-lg); font-size: 14px; }
  .st.pal-open .st-fab, .st.insp-open .st-fab { opacity: 0; pointer-events: none; }
  .st-pal, .st-insp { top: auto; left: 0; right: 0; bottom: 0; width: auto; border-radius: 16px 16px 0 0; border: 0; transform: translateY(102%); }
  .st-pal { max-height: 74vh; }
  .st-insp { height: 84vh; }
  .st-pal::before, .st-insp::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 8px auto 0; flex: none; }
  .st-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-pal-list { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
}
@media (hover: none) {
  .cv-blk:hover:not(.is-sel) { outline-color: transparent; }
  .cv-blk:hover:not(.is-sel):not(:focus-within) > .cv-bar { opacity: 0; pointer-events: none; }
  .cv-bar button { min-width: 30px; height: 26px; }
  .cv-bar { height: 32px; top: -24px; }
}

/* =====================================================================
   V3: blok joylashuvi, o‘lcham tutqichlari, ustunlar, matn uslubi, kanvasda tahrir
   ===================================================================== */
/* Joylashuv (faqat asosiy qismda; ustunlar ichida — oddiy oqim) */
.cv-blocks > .cv-blk[data-ly] { clear: both; }
.cv-blocks > .cv-blk[data-ly="center"] { width: var(--w, 100%); margin-left: auto; margin-right: auto; }
.cv-blocks > .cv-blk[data-ly="narrow"] { width: var(--w, 66%); margin-left: auto; margin-right: auto; }
.cv-blocks > .cv-blk[data-ly="wide"] { margin-left: calc(var(--pad, 60px) * -.6); margin-right: calc(var(--pad, 60px) * -.6); }
.cv-blocks > .cv-blk[data-ly="full"] { margin-left: calc(var(--pad, 60px) * -1); margin-right: calc(var(--pad, 60px) * -1); }
.cv-blocks > .cv-blk[data-ly="left"] { float: left; clear: left; width: var(--w, 45%); margin: .35em 1.5em .9em 0; }
.cv-blocks > .cv-blk[data-ly="right"] { float: right; clear: right; width: var(--w, 45%); margin: .35em 0 .9em 1.5em; }
.cv-blocks > .cv-blk[data-ly="left"] + .cv-blk, .cv-blocks > .cv-blk[data-ly="right"] + .cv-blk { margin-top: 0; }
.cv-blocks > .cv-blk[data-type="row"], .cv-blocks > .cv-blk[data-type="divider"], .cv-blocks > .cv-blk[data-type="h"] h2.cv-h { clear: both; }
.cv-blocks > .cv-blk[data-type="row"] { clear: both; }
.cv-blocks > .cv-blk[data-ly="full"] .cv-fig, .cv-blocks > .cv-blk[data-ly="full"] .cv-img figcaption { padding-left: var(--pad, 60px); padding-right: var(--pad, 60px); }
.cv-blocks > .cv-blk[data-ly="full"] .cv-fig .cv-chart-w, .cv-blocks > .cv-blk[data-ly="full"] .cv-table { margin: 0 calc(var(--pad, 60px) * -1); padding: 0 var(--pad, 60px); }
.cv-col-in > .cv-blk[data-ly="center"], .cv-col-in > .cv-blk[data-ly="narrow"] { width: var(--w, 100%); margin-left: auto; margin-right: auto; }
.cv-blk[data-space="s"] { margin-top: .4em !important; margin-bottom: .4em; }
.cv-blk[data-space="m"] { margin-top: 1.3em !important; margin-bottom: 1.3em; }
.cv-blk[data-space="l"] { margin-top: 2.4em !important; margin-bottom: 2.4em; }
.st[data-device="phone"] .cv-blocks > .cv-blk[data-ly="left"], .st[data-device="phone"] .cv-blocks > .cv-blk[data-ly="right"],
.st[data-device="phone"] .cv-blocks > .cv-blk[data-ly="narrow"] { float: none; width: auto; margin-left: 0; margin-right: 0; }
@media (max-width: 639px) {
  .cv-blocks > .cv-blk[data-ly="left"], .cv-blocks > .cv-blk[data-ly="right"], .cv-blocks > .cv-blk[data-ly="narrow"] { float: none; width: auto; margin-left: 0; margin-right: 0; }
}

/* Blok paneli: joylashuv tugmalari va "Turini o‘zgartirish" */
.cv-bar-ly { display: inline-flex; gap: 1px; padding: 0 3px; margin: 0 2px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.cv-bar button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 639px) { .cv-bar-ly { display: none; } }

/* O‘lcham tutqichlari */
.cv-rz { position: absolute; z-index: 7; display: none; padding: 0; border: 0; background: transparent; touch-action: none; }
.cv-blk.is-sel > .cv-rz:not([hidden]) { display: block; }
.cv-rz::after { content: ""; position: absolute; background: var(--surface); border: 2px solid var(--accent); border-radius: 4px; box-shadow: var(--shadow-sm); transition: transform .12s; }
.cv-rz.rz-l, .cv-rz.rz-r { top: 50%; width: 16px; height: 44px; margin-top: -22px; cursor: ew-resize; }
.cv-rz.rz-l { left: -16px; }
.cv-rz.rz-r { right: -16px; }
.cv-rz.rz-l::after, .cv-rz.rz-r::after { left: 5px; top: 6px; width: 6px; height: 32px; }
.cv-rz.rz-b { left: 50%; bottom: -15px; width: 48px; height: 16px; margin-left: -24px; cursor: ns-resize; }
.cv-rz.rz-b::after { left: 6px; top: 5px; width: 36px; height: 6px; }
.cv-rz:hover::after, .cv-rz:focus-visible::after, .cv-blk.is-rz > .cv-rz::after { background: var(--accent); transform: scale(1.12); }
.cv-rz:focus-visible { outline: none; }
.cv-blk.is-rz { outline: 2px dashed var(--accent) !important; }
.cv-rz-tip { position: absolute; z-index: 9; pointer-events: none; padding: 3px 8px; border-radius: 6px; background: var(--text); color: var(--surface); font: 600 12px/1.4 var(--font-mono); white-space: nowrap; box-shadow: var(--shadow-md); }
body.st-resizing, body.st-resizing * { user-select: none !important; -webkit-user-select: none !important; }
body.st-resizing.rz-ew, body.st-resizing.rz-ew * { cursor: ew-resize !important; }
body.st-resizing.rz-ns, body.st-resizing.rz-ns * { cursor: ns-resize !important; }
@media (hover: none) { .cv-rz.rz-l, .cv-rz.rz-r { width: 22px; } .cv-rz.rz-l { left: -20px; } .cv-rz.rz-r { right: -20px; } }

/* Ustunlar (:::: row) */
.cv-row { display: grid; grid-template-columns: var(--cols, 1fr 1fr); gap: 1.6em; }
.cv-row[data-gap="s"] { gap: .8em; }
.cv-row[data-gap="l"] { gap: 2.6em; }
.cv-col { min-width: 0; display: flex; flex-direction: column; gap: 8px; border-radius: 8px; padding: 6px; margin: -6px; outline: 1px dashed transparent; transition: outline-color .15s, background .15s; }
.cv-blk[data-type="row"]:hover > .cv-c > .cv-row > .cv-col, .cv-blk[data-type="row"].is-sel > .cv-c > .cv-row > .cv-col, .cv-blk[data-type="row"]:focus-within > .cv-c > .cv-row > .cv-col { outline-color: var(--border-strong); }
.cv-col.is-over { outline: 2px solid var(--accent) !important; background: var(--accent-soft); }
.cv-col-in { display: flow-root; min-height: 24px; }
.cv-col-add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 4px 10px; border: 1px dashed var(--border-strong); border-radius: 7px;
  background: transparent; color: var(--text-3); font: 500 12px var(--font-sans); cursor: pointer; opacity: .0; transition: opacity .15s, border-color .15s, color .15s, background .15s; }
.cv-col-in:empty + .cv-col-add { opacity: 1; min-height: 80px; background: var(--surface-2); }
.cv-blk[data-type="row"]:hover .cv-col-add, .cv-blk[data-type="row"].is-sel .cv-col-add, .cv-col-add:focus-visible { opacity: 1; }
.cv-col-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.cv-col-add svg { width: 14px; height: 14px; }
.cv-col .cv-bar { right: -4px; }
.st[data-device="phone"] .cv-row { grid-template-columns: minmax(0, 1fr) !important; }
@media (max-width: 639px) { .cv-row { grid-template-columns: minmax(0, 1fr) !important; } }

/* Matn uslubi (::: text) */
.cv-tx { position: relative; }
.cv-tx.tx-lead { font-size: calc(var(--fs) * 1.16); line-height: 1.55; color: var(--cv-ink); }
.cv-tx.tx-small { font: 14px/1.6 var(--font-sans); color: var(--cv-muted); }
.cv-tx.tx-highlight { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--warn) 22%, transparent) 58%); color: var(--cv-ink); font-weight: 500; }
.cv-tx.tx-box { border: 1.5px solid var(--cv-ink); padding: 14px 18px; font: 15px/1.6 var(--font-sans); color: var(--cv-ink); }
.cv-tx.tx-center { text-align: center; font-style: italic; font-size: calc(var(--fs) * 1.08); color: var(--cv-ink); }
.cv-tx.tx-center .cv-rich.is-empty::before { left: 0; right: 0; text-align: center; }

/* Kanvasdagi bir qatorli tahrir maydonlari */
.cv-inl { position: relative; outline: none; border-radius: 3px; cursor: text; transition: box-shadow .15s, background .15s; min-width: 2ch; display: inline-block; }
div.cv-inl { display: block; }
.cv-inl:hover { box-shadow: 0 0 0 3px var(--surface-2); background: var(--surface-2); }
.cv-inl:focus { box-shadow: 0 0 0 3px var(--accent-soft); background: var(--accent-soft); }
.cv-inl.is-empty::before { content: attr(data-placeholder); color: var(--cv-muted); opacity: .7; pointer-events: none; font-style: italic; font-weight: 400; }
.cv-inl a { color: var(--cv-acc); text-decoration: underline; }
.cv-fig-s-ed { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.cv-fig-sl { font-weight: 600; }
.cv-fig-sep { color: var(--cv-line-2); }
.cv-fig-s-ed .cv-nt2.is-empty, .cv-fig-s-ed .cv-nt2.is-empty + * { opacity: .7; }
.cv-blk:not(:hover):not(.is-sel):not(:focus-within) .cv-nt2.is-empty, .cv-blk:not(:hover):not(.is-sel):not(:focus-within) .cv-nt2.is-empty ~ *,
.cv-blk:not(:hover):not(.is-sel):not(:focus-within) .cv-fig-sep:has(+ .cv-nt2.is-empty) { visibility: hidden; }

/* Jadval: kataklar joyida */
.cv-tw { position: relative; }
.cv-cell { outline: none; cursor: text; position: relative; min-width: 3ch; transition: background .12s, box-shadow .12s; }
.cv-cell:hover { background: var(--surface-2); }
.cv-cell:focus { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.cv-cell.is-empty::before { content: attr(data-placeholder); color: var(--cv-muted); opacity: .55; pointer-events: none; }
.cv-table th.cv-cell { text-transform: none; }
.cv-tctl { position: absolute; z-index: 6; display: none; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; box-shadow: var(--shadow-md); font-family: var(--font-sans); }
.cv-blk:hover .cv-tctl:not([hidden]), .cv-blk.is-sel .cv-tctl:not([hidden]) { display: flex; }
.cv-trow { left: -34px; flex-direction: column; }
.cv-tcol { top: -30px; }
.cv-tctl button { width: 22px; height: 20px; border: 0; background: none; border-radius: 4px; display: grid; place-items: center; cursor: pointer; color: var(--text-2); padding: 0; }
.cv-tctl button:hover { background: var(--accent-soft); color: var(--accent); }
.cv-tctl button.danger:hover { background: var(--down-soft); color: var(--down); }
.cv-tctl button:disabled { opacity: .3; cursor: default; background: none; }
.cv-tctl svg { width: 13px; height: 13px; }
.cv-col .cv-trow { left: -28px; }

/* Grafik: kanvasdagi ma’lumot muharriri */
.cv-chart-w { position: relative; }
.cv-blk.is-sel .cv-chart-c { pointer-events: auto; }
.cv-blk.is-sel .cv-chart-c .yic-legend span, .cv-blk.is-sel .cv-chart-c .yic-dl li { cursor: text; border-radius: 4px; }
.cv-blk.is-sel .cv-chart-c .yic-legend span:hover, .cv-blk.is-sel .cv-chart-c .yic-dl li:hover { background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.cv-lgin { position: absolute; z-index: 8; height: 28px !important; font: 500 13px var(--font-sans) !important; padding: 0 8px !important; box-shadow: var(--shadow-md); }
.cv-ced { margin-top: 12px; border: 1px solid var(--accent); border-radius: 10px; background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); font-family: var(--font-sans); overflow: hidden; animation: st-pop .14s ease-out; }
.cv-ctb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cv-ctb-sp { flex: 1; }
.cv-ctypes, .cv-cpal { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.cv-ctypes button, .cv-cpal button { height: 28px; min-width: 30px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--text-2); display: grid; place-items: center; padding: 0 5px; }
.cv-ctypes button:hover, .cv-cpal button:hover { background: var(--surface-2); color: var(--text); }
.cv-ctypes button[aria-checked="true"], .cv-cpal button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cv-ctypes svg { width: 16px; height: 16px; }
.cv-cpal button > span:first-child { display: flex; width: 26px; height: 12px; border-radius: 3px; overflow: hidden; }
.cv-cpal i { flex: 1; }
.cv-canim .select { height: 32px; font-size: 12.5px; padding-right: 28px; width: auto; }
.cv-cg-w { max-height: 300px; overflow: auto; }
.cv-cg { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.cv-cg th, .cv-cg td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 0; text-align: left; }
.cv-cg thead th { background: var(--surface-2); font-size: 11.5px; color: var(--text-3); font-weight: 600; position: sticky; top: 0; z-index: 1; }
.cv-cg thead th:first-child { padding: 0 8px; }
.cv-cg-in { width: 100%; min-width: 84px; height: 30px; border: 0; background: transparent; padding: 0 8px; font: inherit; color: var(--text); }
.cv-cg-in.num { text-align: right; font-family: var(--font-mono); font-size: 12.5px; }
.cv-cg-in:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.cv-cg-in.invalid { box-shadow: inset 0 0 0 2px var(--down); background: var(--down-soft); }
.cv-cg-name { font-weight: 600; }
.cv-cg-sh { display: flex; align-items: center; }
.cv-cg-x { width: 30px; text-align: center !important; border-right: 0 !important; }
.cv-cg-h { display: flex; gap: 7px; align-items: flex-start; margin: 0; padding: 8px 10px; font-size: 12px; color: var(--text-3); line-height: 1.45; }
.cv-cg-h svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--accent); }

/* Faktlar joyida */
.cv-fx { position: relative; }
.cv-fx .v, .cv-fx .k { display: block; }
.cv-fx-del { position: absolute; right: 4px; top: 6px; width: 22px; height: 22px; border-radius: 6px; border: 0; background: var(--surface); color: var(--text-3); display: none; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.cv-fx-del svg { width: 12px; height: 12px; }
.cv-blk.is-sel .cv-fx:hover .cv-fx-del, .cv-fx:focus-within .cv-fx-del { display: grid; }
.cv-fx-del:hover { color: var(--down); background: var(--down-soft); }
.cv-fx-add { display: none; margin-top: 8px; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px dashed var(--border-strong); background: none; font: 500 12px var(--font-sans); color: var(--text-2); cursor: pointer; }
.cv-fx-add svg { width: 13px; height: 13px; }
.cv-blk.is-sel .cv-fx-add, .cv-blk:focus-within .cv-fx-add { display: inline-flex; }
.cv-fx-add:hover { border-color: var(--accent); color: var(--accent); }

/* Rasm: nisbat, ramka, havola */
.cv-img-w { position: relative; }
.cv-img img.bordered { border: 1px solid var(--cv-line-2); padding: 4px; background: var(--surface); }
.cv-img-link { position: absolute; right: 8px; top: 8px; max-width: 70%; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-sm); font: 500 11.5px var(--font-sans); color: var(--cv-acc); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cv-img-link svg { width: 12px; height: 12px; flex: none; }
.cv-img-link > span { overflow: hidden; text-overflow: ellipsis; }

/* Inspektor: joylashuv, matn uslubi, ustunlar */
.ins-ly { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.ins-ly button, .ins-tx button { display: grid; justify-items: center; gap: 3px; padding: 7px 3px 5px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 11px; color: var(--text-2); min-width: 0; transition: border-color .15s, background .15s, color .15s; }
.ins-ly button:hover, .ins-tx button:hover { border-color: var(--border-strong); color: var(--text); }
.ins-ly [aria-checked="true"], .ins-tx [aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--accent); }
.ins-ly svg { width: 22px; height: 18px; }
.ins-range { display: flex; gap: 8px; align-items: center; }
.ins-range input[type=range] { flex: 1; accent-color: var(--accent); }
.ins-range .input { flex: 1; height: 32px; }
.ins-seg { display: flex; flex-wrap: wrap; }
.ins-seg button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.ins-seg button svg { width: 15px; height: 15px; }
.ins-tx { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ins-tx .cv-tx { --fs: 15px; --cv-ink: var(--text); --cv-muted: var(--text-3); width: 100%; min-height: 30px; display: grid; place-items: center; font-family: "Newsreader", Georgia, serif; padding: 2px 4px; }
.ins-tx .cv-tx.tx-box { padding: 2px 4px; }
.ins-aligns { display: flex; flex-wrap: wrap; gap: 5px; }
.ins-aligns .btn { max-width: 100%; }
.ins-aligns .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12ch; }
.ins-outline.sub { padding-left: 14px; border-left: 1px dashed var(--border-strong); margin: 2px 0 4px 16px; }
.ins-ocol > span { display: block; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px 0; }
.ins-ocol > small { display: block; padding: 0 8px 4px; font-size: 11.5px; }
.ins-tip .btn { margin-left: auto; align-self: center; }
.ins-lywrap { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.ins-sec h4 svg { width: 14px; height: 14px; color: var(--text-3); vertical-align: -2px; margin-right: 4px; }

/* =====================================================================
   V4: aksiya pill’i — “$” avtoto‘ldirish va popover muharrir
   ===================================================================== */
.tk-ac {
  position: fixed; z-index: 96; width: 300px; max-width: calc(100vw - 16px); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; display: grid; gap: 1px;
  font: 13px/1.4 var(--font-sans); animation: dlg-in .1s ease-out;
}
.tk-ac-h { display: flex; align-items: center; gap: 6px; padding: 6px 8px 5px; color: var(--text-3); font-size: 11.5px; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.tk-ac-h svg { width: 14px; height: 14px; }
.tk-ac-h small { margin-left: auto; font-size: 10.5px; }
.tk-opt { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 7px; cursor: pointer; color: var(--text); font: inherit; width: 100%; }
.tk-opt b { font-size: 12.5px; }
.tk-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.tk-opt small { color: var(--text-3); font-size: 11px; white-space: nowrap; }
.tk-opt:hover, .tk-opt[aria-selected="true"], .tk-opt:focus-visible { background: var(--accent-soft); outline: none; }
.tk-opt[aria-selected="true"] b { color: var(--accent); }

.tk-pop {
  position: fixed; z-index: 97; width: 344px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 12px 14px 14px; display: grid; gap: 12px; font: 13.5px/1.45 var(--font-sans); animation: dlg-in .12s ease-out;
}
.tk-pop-h { display: flex; align-items: center; justify-content: space-between; margin: -2px -4px -4px 0; }
.tk-pop-h b { font-size: 14px; }
.tk-pv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); font: 17px/1.5 "Newsreader", Georgia, serif; min-height: 52px; }
.tk-pv .tkp { cursor: default; }
.tk-raw { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52%; }
.tk-pop .field { gap: 6px; }
.tk-symf { position: relative; }
.tk-sug { display: grid; gap: 1px; border: 1px solid var(--border); border-radius: 8px; padding: 3px; max-height: 180px; overflow: auto; }
.tk-name { min-height: 18px; }
.warn-t { color: var(--warn); }
.seg-sm button, .seg-sm label { height: 26px; font-size: 12px; padding: 0 9px; }
.seg [role="radio"][aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.tk-val { display: flex; align-items: center; gap: 6px; }
.tk-val .input { width: 120px; }
.tk-val span { color: var(--text-3); font-weight: 600; }
.tk-styles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.tk-styles button { display: grid; justify-items: center; gap: 4px; padding: 8px 2px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; color: var(--text-2); font: 11px var(--font-sans); }
.tk-styles button .tkp { font-size: 12px; pointer-events: none; }
.tk-styles button[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--text); }
.tk-col { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-col input[type="color"], .pill-col-r input[type="color"], .cp-col input[type="color"] { width: 38px; height: 30px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); cursor: pointer; }
.tk-err:empty { display: none; }
.tk-pop-a { display: flex; gap: 6px; align-items: center; padding-top: 2px; }
.tk-pop-a .sp { flex: 1; }

/* ----- Rasm bloki: belgilar va tahrir tugmalari ----- */
.cv-tags { position: absolute; inset: 0; pointer-events: none; }
.cv-tag { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }
.cv-tag-d { display: block; width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .92); border: 3px solid var(--brand-red); box-shadow: 0 0 0 3px rgba(0, 0, 0, .22), 0 2px 6px rgba(0, 0, 0, .3); }
.cv-tag-c { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); background: rgba(13, 20, 36, .92); color: #fff; padding: 5px 9px; border-radius: 7px;
  font: 600 12px/1.35 var(--font-sans); white-space: nowrap; display: grid; opacity: 0; pointer-events: none; transition: opacity .12s; }
.cv-tag-c em { font-style: normal; font-weight: 400; opacity: .75; font-size: 11px; }
.cv-tag:hover .cv-tag-c { opacity: 1; }
.cv-img-acts { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.cv-blk:hover .cv-img-acts, .cv-blk.is-sel .cv-img-acts, .cv-img-acts:focus-within { opacity: 1; }
.cv-img-acts button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(13, 20, 36, .82); color: #fff; font: 600 12px var(--font-sans); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cv-img-acts button:hover { background: rgba(13, 20, 36, .95); }
.cv-img-acts svg { width: 14px; height: 14px; }
@media (hover: none) { .cv-img-acts { opacity: 1; } }
.cv-people { display: block; margin-top: 4px; font: 12.5px/1.45 var(--font-sans); color: var(--cv-muted); }
.cv-people b { font-weight: 600; color: var(--cv-ink-2); }
.ins-imged .ins-row { flex-wrap: wrap; }
.ins-tags { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ins-tags li { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.ins-tags small { color: var(--text-3); }
.ins-tag-d { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--brand-red); flex: none; transform: translateY(1px); }

/* =====================================================================
   V4: rasm muharriri (to‘liq ekran)
   ===================================================================== */
dialog.dlg.ie-dlg { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; border: 0; }
dialog.dlg.ie-dlg[open] { animation: none; }
dialog.dlg.ie-dlg .dlg-head { padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: center; }
dialog.dlg.ie-dlg .dlg-body { padding: 0; flex: 1; min-height: 0; display: flex; overflow: hidden; color: var(--text); }
.ie { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ie-bar { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface); }
.ie-tools button svg { width: 15px; height: 15px; }
.ie-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.ie-bar-t { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.ie-dim { margin-left: auto; color: var(--text-3); font-size: 12px; }
.ie-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.ie-stage { position: relative; min-height: 0; overflow: hidden; touch-action: none;
  background: #0E121A repeating-conic-gradient(#151A24 0% 25%, #0E121A 0% 50%) 0 0 / 24px 24px; }
.ie-cv { position: absolute; inset: 0; display: block; outline: none; }
.ie-cv:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.ie-load { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #A6AEC1; font-size: 13px; }
.ie-marks { position: absolute; pointer-events: none; }
.ie-mark { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; border: 0; background: none; padding: 0; cursor: grab; display: flex; align-items: center; gap: 6px; touch-action: none; }
.ie-mark:active { cursor: grabbing; }
.ie-mark .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #0D1424; font: 700 12px var(--font-sans);
  border: 3px solid var(--brand-red); box-shadow: 0 0 0 3px rgba(0, 0, 0, .25), 0 3px 10px rgba(0, 0, 0, .35); }
.ie-mark-l { position: absolute; left: 32px; top: 50%; transform: translateY(-50%); background: rgba(13, 20, 36, .88); color: #fff; padding: 3px 8px; border-radius: 6px; font: 600 12px var(--font-sans); white-space: nowrap; pointer-events: none; }
.ie-mark.on .n { background: var(--brand-red); color: #fff; border-color: #fff; }
.ie-mark:focus-visible { outline: none; }
.ie-mark:focus-visible .n { box-shadow: 0 0 0 3px var(--focus); }
.ie-tagpop { position: absolute; z-index: 3; width: 300px; max-width: calc(100% - 16px); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 12px 14px 14px; display: grid; gap: 10px; font-size: 13.5px; }
.ie-tp-h { display: flex; justify-content: space-between; align-items: center; margin: -2px -4px -2px 0; }
.ie-tp-a { display: flex; align-items: center; gap: 6px; }
.ie-tp-a .sp { flex: 1; }
.ie-tp-u { justify-self: start; margin-top: 4px; }
.ie-ulist { display: grid; gap: 6px; margin-top: 6px; }
.ie-ul { display: grid; gap: 1px; max-height: 170px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.ie-ul button { display: grid; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--text); font: inherit; }
.ie-ul button:hover, .ie-ul button:focus-visible { background: var(--accent-soft); outline: none; }
.ie-ul small { color: var(--text-3); font-size: 11px; }
.ie-side { border-left: 1px solid var(--border); background: var(--surface); overflow: auto; display: flex; flex-direction: column; }
.ie-opts, .ie-save { padding: 16px; display: grid; gap: 12px; align-content: start; }
.ie-save { margin-top: auto; border-top: 1px solid var(--border); background: var(--surface-2); }
.ie-side h3 { font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.ie-side h3 .counter { margin-left: auto; }
.ie-ratios { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.ie-ratios button { display: grid; justify-items: center; gap: 5px; padding: 8px 2px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; color: var(--text-2); font: 11.5px var(--font-sans); }
.ie-ratios i { display: block; height: 18px; max-width: 30px; border: 1.5px solid currentColor; border-radius: 2px; }
.ie-ratios i.free { width: 24px; border-style: dashed; }
.ie-ratios button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ie-blist, .ie-taglist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ie-blist li, .ie-taglist li { display: flex; align-items: center; gap: 4px; }
.ie-blist li > button:first-child, .ie-taglist li > button:first-child { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 6px 8px; cursor: pointer; color: var(--text); font: 12.5px var(--font-sans); }
.ie-blist li.on > button:first-child { border-color: var(--accent); background: var(--accent-soft); }
.ie-blist .n, .ie-taglist .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font: 700 11px var(--font-sans); flex: none; }
.ie-taglist li > button:first-child > span:last-child { display: grid; min-width: 0; }
.ie-taglist small { color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ie-warn { color: var(--down); }
.ie-lock { display: flex; gap: 6px; align-items: flex-start; }
.ie-lock svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
@media (max-width: 860px) {
  .ie-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(260px, 1fr) auto; }
  .ie-side { border-left: 0; border-top: 1px solid var(--border); max-height: 44vh; }
  .ie-bar .lbl { display: none; }
  .ie-dim { width: 100%; margin-left: 0; }
}
.st-pill.sched { background: color-mix(in srgb, #7C3AED 12%, var(--surface)); color: #6D28D9; }
.st-banner.sched > svg { color: #7C3AED; }
.st-banner.sched { border-color: color-mix(in srgb, #7C3AED 30%, var(--border)); }
