/* VID1/VID2 — video platforma (qora / oq / to'q sariq, Apple uslubi, mobil-birinchi). Rang/shrift: /theme/tokens.css. Inline uslub yo'q (CSP).
   Mavzu: lenta (qisqa video) va hikoya ko'rgichi har doim "kino" qora (video ustida matn); qolgan hamma sirt (uzun video, hikoyalar, jonli, varaqlar) Oq/Qora mavzuga bo'ysunadi. */
.vd {
  --vd-bg: var(--mbx-bg, #f5f5f3); --vd-fg: var(--mbx-text, #111); --vd-muted: var(--mbx-text-muted, #5c5c57); --vd-surface: var(--mbx-surface, #fff); --vd-surface-2: var(--mbx-surface-2, #f0f0ed);
  --vd-line: var(--mbx-border-strong, #cfcfc8); --vd-hair: var(--mbx-border, #e4e4df); --vd-danger: var(--mbx-danger, #b3261e); --vd-top-h: 112px;
  margin: 0; background: var(--vd-bg); color: var(--vd-fg); font-family: var(--mbx-font, system-ui, sans-serif); min-height: 100dvh; overscroll-behavior: none;
}
.vd[data-tab="short"] { --vd-bg: #000; }
.vd * { box-sizing: border-box; }
.vd button { font: inherit; color: inherit; cursor: pointer; }
.vd [hidden] { display: none !important; }

/* Yuqori panel: telefonda 2 qator (brend + amallar / yorliqlar), kengda bitta qator */
.vd-top { position: fixed; inset: 0 0 auto 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "tabs tabs"; align-items: center; gap: 2px 8px; padding: max(8px, var(--mbx-sa-top,env(safe-area-inset-top,0px))) 16px 6px; background: var(--vd-bg); border-bottom: 1px solid var(--vd-hair); }
.vd[data-tab="short"] .vd-top { background: linear-gradient(#000c, #0000); border-bottom-color: transparent; color: #f4f4f0; }
.vd-brand { grid-area: brand; color: var(--vd-fg); text-decoration: none; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.vd[data-tab="short"] .vd-brand { color: #f4f4f0; }
.vd-brand b { color: var(--mbx-accent-text, #7a5c00); }
.vd[data-tab="short"] .vd-brand b { color: var(--mbx-accent, #ffd21f); }
:root[data-theme="dark"] .vd-brand b { color: var(--mbx-accent, #ffd21f); }
.vd-tabs { grid-area: tabs; display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.vd-tabs::-webkit-scrollbar { display: none; }
.vd-tabs button { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--vd-muted); font-weight: 600; border-radius: 999px; white-space: nowrap; }
.vd[data-tab="short"] .vd-tabs button { color: #ffffffcc; }
.vd-tabs button[aria-selected="true"], .vd[data-tab="short"] .vd-tabs button[aria-selected="true"] { color: #0a0a0a; background: var(--mbx-accent, #ffd21f); }
.vd-actions { grid-area: actions; display: flex; gap: 6px; }
.vd-icon { min-height: 44px; min-width: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--vd-line); background: var(--vd-surface); border-radius: 999px; font-size: 14px; font-weight: 600; }
.vd[data-tab="short"] .vd-icon { border-color: #ffffff33; background: #0008; color: #f4f4f0; }
.vd-icon .vd-glyph { font-size: 20px; line-height: 1; }
.vd-icon.is-primary { background: var(--mbx-accent, #ffd21f); color: #0a0a0a; border-color: transparent; }
.vd-lbl { display: none; }
.vd button:focus-visible, .vd a:focus-visible, .vd input:focus-visible, .vd select:focus-visible, .vd textarea:focus-visible { outline: 3px solid var(--mbx-focus, #1266c8); outline-offset: 2px; }
.vd[data-tab="short"] button:focus-visible { outline-color: var(--mbx-accent, #ffd21f); }

.vd-main { min-height: 100dvh; outline: none; }
.vd-state { display: grid; place-items: center; min-height: 100dvh; padding: calc(var(--vd-top-h) + 8px) 24px 24px; text-align: center; color: var(--vd-muted); font-size: 16px; line-height: 1.5; }
.vd[data-tab="short"] .vd-state { color: #ffffffb3; }
.vd-state p { max-width: 36ch; margin: 0 auto; }
.vd-note { margin: calc(var(--vd-top-h) + 8px) 0 8px; padding: 12px 16px; border: 1px solid var(--vd-hair); border-radius: 16px; background: var(--vd-surface); color: var(--vd-fg); font-size: 14px; line-height: 1.45; }

/* Qisqa video lentasi: to'liq ekran, snap (kino qora) */
.vd-reel { height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; color: #f4f4f0; }
.vd-reel::-webkit-scrollbar { display: none; }
.vd-card { position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; background: #000; overflow: hidden; }
.vd-media { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.vd-stage { position: relative; width: 100%; max-width: 520px; height: 100%; margin: 0 auto; }
.vd-info { position: absolute; left: 0; right: 76px; bottom: 0; padding: 16px 16px max(24px, var(--mbx-sa-bottom,env(safe-area-inset-bottom,0px))); background: linear-gradient(#0000, #000b); display: grid; gap: 6px; text-align: start; }
.vd-author { font-weight: 700; font-size: 16px; display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.vd-title { font-size: 15px; line-height: 1.4; margin: 0; overflow-wrap: anywhere; }
.vd-tags { font-size: 13px; color: var(--mbx-accent, #ffd21f); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.vd-why { justify-self: start; min-height: 44px; padding: 0 14px; border: 1px solid #ffffff4d; background: #0008; border-radius: 999px; font-size: 13px; }
.vd-why-text { font-size: 13px; color: #ffffffe6; margin: 0; }
.vd-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #ffffff26; font-size: 12px; font-weight: 600; }
.vd-rail { position: absolute; right: 8px; bottom: max(24px, var(--mbx-sa-bottom,env(safe-area-inset-bottom,0px))); display: grid; gap: 8px; justify-items: center; }
.vd-act { display: grid; justify-items: center; gap: 2px; min-width: 56px; min-height: 56px; padding: 6px; border: 0; background: #0006; color: #f4f4f0; border-radius: 20px; font-size: 12px; font-weight: 600; }
.vd-act[aria-pressed="true"] { background: var(--mbx-accent, #ffd21f); color: var(--mbx-accent-ink, #0a0a0a); }
.vd-act .vd-glyph { font-size: 22px; line-height: 1; }
.vd-follow { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--mbx-accent, #ffd21f); color: #0a0a0a; font-weight: 700; font-size: 13px; }
.vd-follow[aria-pressed="true"] { background: #ffffff26; color: #f4f4f0; }
.vd-tap { position: absolute; inset: 0; border: 0; background: none; padding: 0; }

/* Uzun video */
.vd-long { padding: calc(var(--vd-top-h) + 8px) 16px 32px; display: grid; gap: 16px; max-width: 1200px; margin: 0 auto; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.vd-tile { background: var(--vd-surface); border: 1px solid var(--vd-hair); border-radius: 20px; overflow: hidden; display: grid; text-align: start; }
.vd-tile-media { aspect-ratio: 16 / 9; background: #000; width: 100%; display: block; object-fit: cover; }
.vd-tile-body { padding: 12px 16px 16px; display: grid; gap: 4px; }
.vd-tile h3 { margin: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; color: var(--vd-fg); }
.vd-meta { font-size: 13px; color: var(--vd-muted); overflow-wrap: anywhere; }
.vd-open { border: 0; background: none; padding: 0; text-align: start; width: 100%; }
.vd-player { padding: calc(var(--vd-top-h) + 8px) 16px 32px; max-width: 960px; margin: 0 auto; display: grid; gap: 12px; }
.vd-player h2 { margin: 0; overflow-wrap: anywhere; }
.vd-player p { margin: 0; overflow-wrap: anywhere; }
.vd-player video { width: 100%; max-height: 70dvh; background: #000; border-radius: 20px; }
.vd-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vd-row .vd-act, .vd-player .vd-act { background: var(--vd-surface); border: 1px solid var(--vd-line); color: var(--vd-fg); grid-auto-flow: column; align-items: center; gap: 8px; border-radius: 999px; padding: 0 16px; min-height: 48px; font-size: 14px; }
.vd-row .vd-act[aria-pressed="true"], .vd-player .vd-act[aria-pressed="true"] { background: var(--mbx-accent, #ffd21f); color: #0a0a0a; border-color: transparent; }
.vd-btn { min-height: 48px; padding: 0 20px; border: 1px solid var(--vd-line); background: var(--vd-surface); color: var(--vd-fg); border-radius: 999px; font-weight: 600; }
.vd-btn.is-primary { background: var(--mbx-accent, #ffd21f); color: #0a0a0a; border-color: transparent; }
.vd-btn.is-danger { color: var(--vd-danger); }
.vd-btn:disabled { opacity: .55; cursor: not-allowed; }
.vd-back { justify-self: start; }

/* Hikoyalar */
.vd-stories { padding: calc(var(--vd-top-h) + 8px) 16px 32px; display: grid; gap: 16px; max-width: 720px; margin: 0 auto; }
.vd-ring-row { display: flex; gap: 16px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.vd-ring { flex: none; display: grid; justify-items: center; gap: 6px; width: 84px; border: 0; background: none; font-size: 13px; color: var(--vd-fg); }
.vd-ring span:last-child { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-ring-dot { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--vd-surface); border: 3px solid var(--mbx-accent, #ffd21f); font-weight: 700; font-size: 20px; text-transform: uppercase; }
.vd-ring-dot.is-mine { border-style: dashed; }
.vd-story { padding: 0; border: 0; width: 100vw; max-width: 520px; height: 100dvh; max-height: none; background: #000; color: #f4f4f0; margin: 0 auto; }
.vd-story::backdrop, .vd-sheet::backdrop { background: var(--mbx-overlay, #000a); }
.vd-story-bar { position: absolute; top: max(8px, var(--mbx-sa-top,env(safe-area-inset-top,0px))); left: 12px; right: 64px; display: flex; gap: 4px; z-index: 2; }
.vd-story-seg { flex: 1; height: 3px; border-radius: 2px; background: #ffffff4d; }
.vd-story-seg.is-done { background: #f4f4f0; }
.vd-story-seg.is-now { background: var(--mbx-accent, #ffd21f); }
.vd-story-close { position: absolute; top: max(4px, var(--mbx-sa-top,env(safe-area-inset-top,0px))); right: 8px; z-index: 3; color: #f4f4f0; }
.vd-story-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.vd-story-stage .vd-media { max-height: 100%; }
.vd-story-cap { position: absolute; left: 16px; right: 16px; bottom: max(24px, var(--mbx-sa-bottom,env(safe-area-inset-bottom,0px))); background: #000a; color: #f4f4f0; padding: 8px 12px; border-radius: 12px; font-size: 15px; overflow-wrap: anywhere; }

/* Jonli */
.vd-live { padding: 0 16px 32px; display: grid; gap: 12px; max-width: 720px; margin: 0 auto; }
.vd-live-item { padding: 16px; border: 1px solid var(--vd-hair); border-radius: 20px; background: var(--vd-surface); display: grid; gap: 4px; overflow-wrap: anywhere; }
.vd-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mbx-accent, #ffd21f); margin-inline-end: 6px; }

/* Varaq (sheet) */
.vd-sheet { padding: 0; border: 0; width: 100%; max-width: 560px; margin: auto auto 0; max-height: 88dvh; background: var(--vd-surface); color: var(--vd-fg); border-radius: 24px 24px 0 0; overflow: hidden; }
.vd-sheet[open] { display: grid; grid-template-rows: auto auto 1fr; animation: vd-up 220ms cubic-bezier(.2, .8, .2, 1); }
.vd-grip { width: 40px; height: 4px; background: var(--vd-line); border-radius: 2px; margin: 8px auto 0; }
.vd-sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px 0 20px; }
.vd-sheet-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.vd-x { min-width: 44px; min-height: 44px; border: 0; background: none; font-size: 28px; line-height: 1; border-radius: 50%; }
.vd-sheet-body { padding: 8px 20px max(20px, var(--mbx-sa-bottom,env(safe-area-inset-bottom,0px))); overflow-y: auto; display: grid; gap: 12px; align-content: start; min-width: 0; }
.vd-sheet-body h3 { margin: 8px 0 0; font-size: 16px; }
.vd-field { display: grid; gap: 6px; font-size: 14px; min-width: 0; }
.vd-field input[type="text"], .vd-field input[type="email"], .vd-field input[type="password"], .vd-field input[type="file"], .vd-field select, .vd-field textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--vd-line); border-radius: 14px; background: var(--vd-bg); color: var(--vd-fg); font: inherit; }
.vd[data-tab="short"] .vd-field input, .vd[data-tab="short"] .vd-field select, .vd[data-tab="short"] .vd-field textarea { background: var(--vd-surface-2); }
.vd-field textarea { min-height: 88px; resize: vertical; }
.vd-check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.4; min-height: 44px; }
.vd-check input { width: 24px; height: 24px; flex: none; accent-color: var(--mbx-accent, #ffd21f); }
.vd-range { display: grid; gap: 4px; font-size: 14px; }
.vd-range input { width: 100%; accent-color: var(--mbx-accent, #ffd21f); min-height: 32px; }
.vd-progress { width: 100%; height: 8px; border-radius: 4px; accent-color: var(--mbx-accent, #ffd21f); }
.vd-comment { padding: 8px 0; border-bottom: 1px solid var(--vd-hair); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.vd-comment b { display: block; font-size: 12px; color: var(--vd-muted); }
.vd-msg { font-size: 14px; color: var(--vd-muted); margin: 0; overflow-wrap: anywhere; }
.vd-msg.is-error { color: var(--vd-danger); }
.vd-tags-line { font-size: 13px; color: var(--vd-muted); margin: 0; overflow-wrap: anywhere; }

.vd-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(24px, var(--mbx-sa-bottom,env(safe-area-inset-bottom,0px))); z-index: 1000; margin: 0; max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 20px; background: #f4f4f0; color: #0a0a0a; font-weight: 600; font-size: 14px; text-align: center; overflow-wrap: anywhere; box-shadow: 0 6px 20px #0006; }
:root[data-theme="light"] .vd-toast { background: #111; color: #f4f4f0; }

@keyframes vd-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .vd-sheet[open] { animation: none; } .vd-reel { scroll-behavior: auto; } }
@media (min-width: 720px) {
  .vd { --vd-top-h: 72px; }
  .vd-top { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand tabs actions"; padding-inline: 32px; }
  .vd-tabs { justify-content: center; }
  .vd-lbl { display: inline; }
  .vd-sheet { margin: auto; border-radius: 24px; }
}
[dir="rtl"] .vd-rail { right: auto; left: 8px; }
[dir="rtl"] .vd-info { left: 76px; right: 0; }
