/* TV 21 News Video Editor - styles */
/* Offline fonts (bundled). Online Google Fonts load after this file and override these when available. */
@font-face{font-family:"Inter";font-weight:500;src:url(../fonts/inter-medium.woff) format("woff");font-display:swap}
@font-face{font-family:"Inter";font-weight:600 700;src:url(../fonts/inter-bold.woff) format("woff");font-display:swap}
@font-face{font-family:"Inter";font-weight:800;src:url(../fonts/inter-extrabold.woff) format("woff");font-display:swap}
@font-face{font-family:"Inter";font-weight:900;src:url(../fonts/inter-black.woff) format("woff");font-display:swap}
@font-face{font-family:"Noto Sans Devanagari";font-weight:100 600;src:url(../fonts/poppins-medium.woff) format("woff");font-display:swap}
@font-face{font-family:"Noto Sans Devanagari";font-weight:700 900;src:url(../fonts/poppins-bold.woff) format("woff");font-display:swap}
@font-face{font-family:"Poppins";font-weight:100 600;src:url(../fonts/poppins-medium.woff) format("woff");font-display:swap}
@font-face{font-family:"Poppins";font-weight:700 900;src:url(../fonts/poppins-bold.woff) format("woff");font-display:swap}
@font-face{font-family:"Anton";font-weight:400;src:url(../fonts/anton.woff) format("woff");font-display:swap}
        :root {
            --bg-app: #0B0D12;
            --bg-panel: #131722;
            --bg-card: #1A202E;
            --accent-red: #E31E24;
            --accent-gold: #F59E0B;
        }

        * {
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        html, body {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100dvh;
            background-color: var(--bg-app);
            color: #F8FAFC;
            font-family: 'Inter', 'Noto Sans Devanagari', sans-serif;
            overflow: hidden;
            user-select: none;
        }

        /* Custom Range Sliders */
        input[type="range"] {
            -webkit-appearance: none;
            appearance: none;
            background: #252D3D;
            height: 5px;
            border-radius: 999px;
            outline: none;
        }
        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #E31E24;
            border: 2px solid #FFFFFF;
            box-shadow: 0 2px 6px rgba(0,0,0,0.6);
            cursor: pointer;
        }

        /* Hide scrollbars cleanly */
        .no-scrollbar::-webkit-scrollbar {
            display: none;
        }
        .no-scrollbar {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

        /* Studio Grid Pattern */
        .stage-grid {
            background-color: #080A0E;
            background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
            background-size: 16px 16px;
        }

        /* Timeline Filmstrip Look */
        .filmstrip-pattern {
            background-image: repeating-linear-gradient(
                90deg,
                rgba(255,255,255,0.06) 0px,
                rgba(255,255,255,0.06) 28px,
                rgba(0,0,0,0.45) 28px,
                rgba(0,0,0,0.45) 30px
            );
        }

        .audio-wave-pattern {
            background-image: repeating-linear-gradient(
                90deg,
                rgba(16, 185, 129, 0.45) 0px,
                rgba(16, 185, 129, 0.45) 3px,
                transparent 3px,
                transparent 7px
            );
        }

        /* ---- Free crop editor ---- */
        #cropEditorWrap { position: relative; margin: 0 auto; background: #000; border-radius: 8px; overflow: hidden; touch-action: none; }
        #cropEditorCanvas { width: 100%; height: 100%; display: block; }
        #cropBox { position: absolute; border: 2px solid #F59E0B; box-shadow: 0 0 0 9999px rgba(0,0,0,.62); cursor: move; touch-action: none;
            background-image: linear-gradient(to right, transparent 33%, rgba(255,255,255,.28) 33%, rgba(255,255,255,.28) calc(33% + 1px), transparent calc(33% + 1px), transparent 66%, rgba(255,255,255,.28) 66%, rgba(255,255,255,.28) calc(66% + 1px), transparent calc(66% + 1px)),
                              linear-gradient(to bottom, transparent 33%, rgba(255,255,255,.28) 33%, rgba(255,255,255,.28) calc(33% + 1px), transparent calc(33% + 1px), transparent 66%, rgba(255,255,255,.28) 66%, rgba(255,255,255,.28) calc(66% + 1px), transparent calc(66% + 1px)); }
        #cropBox [data-h] { position: absolute; display: flex; align-items: center; justify-content: center; touch-action: none; }
        #cropBox [data-h]::after { content: ''; background: #F59E0B; border: 2px solid #fff; border-radius: 3px; }
        #cropBox .ch { width: 26px; height: 26px; } #cropBox .ch::after { width: 14px; height: 14px; }
        #cropBox [data-h="nw"] { left: -13px; top: -13px; cursor: nwse-resize; } #cropBox [data-h="ne"] { right: -13px; top: -13px; cursor: nesw-resize; }
        #cropBox [data-h="sw"] { left: -13px; bottom: -13px; cursor: nesw-resize; } #cropBox [data-h="se"] { right: -13px; bottom: -13px; cursor: nwse-resize; }
        #cropBox .eh[data-h="n"], #cropBox .eh[data-h="s"] { left: 14px; right: 14px; height: 24px; cursor: ns-resize; }
        #cropBox .eh[data-h="n"] { top: -12px; } #cropBox .eh[data-h="s"] { bottom: -12px; }
        #cropBox .eh[data-h="w"], #cropBox .eh[data-h="e"] { top: 14px; bottom: 14px; width: 24px; cursor: ew-resize; }
        #cropBox .eh[data-h="w"] { left: -12px; } #cropBox .eh[data-h="e"] { right: -12px; }
        #cropBox .eh[data-h="n"]::after, #cropBox .eh[data-h="s"]::after { width: 28px; height: 8px; }
        #cropBox .eh[data-h="w"]::after, #cropBox .eh[data-h="e"]::after { width: 8px; height: 28px; }

        @keyframes pulseLive {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.35; }
        }
        .live-blink {
            animation: pulseLive 1.2s infinite ease-in-out;
        }
    

/* =====================================================================
   TV21 v3 - VN-style buttons, top bar, zoomable timeline
   (plain CSS on purpose: no Tailwind runtime work while the timeline redraws = no lag)
   ===================================================================== */
:root { --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); }
body { padding-left: var(--safe-l); padding-right: var(--safe-r); }
button, label.btn, a.btn { font-family: inherit; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 12px; border: 1px solid #2B3448; background: #1B2232; color: #E2E8F0; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; cursor: pointer; transition: transform .12s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.btn:hover { background: #242D42; border-color: #3A4660; }
.btn:active { transform: scale(.95); }
.btn:focus-visible { outline: 2px solid #F59E0B; outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-sm { min-height: 30px; padding: 0 9px; font-size: 11px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-grow { flex: 1 1 0; min-width: 0; }
.btn-primary { background: linear-gradient(135deg, #F0262C, #C8102E); border-color: rgba(255,255,255,.18); color: #fff; box-shadow: 0 6px 16px rgba(227,30,36,.35), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-primary:hover { background: linear-gradient(135deg, #FF3A40, #D91535); border-color: rgba(255,255,255,.28); }
.btn-green { background: linear-gradient(135deg, #10B981, #059669); border-color: rgba(255,255,255,.16); color: #fff; box-shadow: 0 6px 14px rgba(16,185,129,.28), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-green:hover { background: linear-gradient(135deg, #34D399, #10B981); }
.btn-amber { background: linear-gradient(135deg, #F59E0B, #D97706); border-color: rgba(255,255,255,.16); color: #1A1204; box-shadow: 0 6px 14px rgba(245,158,11,.25), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-amber:hover { background: linear-gradient(135deg, #FBBF24, #F59E0B); }
.btn-soft-amber { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.4); color: #FCD34D; }
.btn-soft-amber:hover { background: rgba(245,158,11,.24); }
.btn-soft-red { background: rgba(239,68,68,.13); border-color: rgba(239,68,68,.4); color: #FCA5A5; }
.btn-soft-red:hover { background: rgba(239,68,68,.24); }
.btn-soft-green { background: rgba(16,185,129,.14); border-color: rgba(16,185,129,.4); color: #6EE7B7; }
.btn-soft-green:hover { background: rgba(16,185,129,.24); }
.btn-ghost { background: transparent; border-color: transparent; color: #CBD5E1; }
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.btn-icon { width: 38px; min-width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; min-width: 32px; }
.btn-round { border-radius: 999px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.chip-btn { min-height: 30px; padding: 0 10px; border-radius: 9px; font-size: 11px; font-weight: 800; background: #1B2232; border: 1px solid #2B3448; color: #E2E8F0; cursor: pointer; transition: transform .12s, background-color .15s; touch-action: manipulation; }
.chip-btn:hover { background: #242D42; } .chip-btn:active { transform: scale(.94); }
.btn-play { width: 44px; height: 44px; min-width: 44px; border-radius: 999px; background: #fff; color: #0B0D12; border: 0; box-shadow: 0 4px 14px rgba(255,255,255,.18), 0 2px 6px rgba(0,0,0,.5); }
.btn-play:hover { background: #F1F5F9; }
.btn-play svg { width: 20px; height: 20px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.panel-box { background: rgba(15,23,42,.75); border: 1px solid #1E2738; border-radius: 14px; padding: 10px; }

/* ---- Top bar ---- */
#topBar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: calc(48px + var(--safe-t)); padding: var(--safe-t) 10px 0 10px; background: linear-gradient(180deg, #121722, #0E121B); border-bottom: 1px solid #1B2232; z-index: 40; }
#topBar .brand { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; color: #fff; }
#topBar .brand img { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; border: 1.5px solid #E31E24; flex: none; }
#topBar .brand b { font-size: 13px; font-weight: 900; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#topBar .brand small { display: block; font-size: 9px; color: #F59E0B; font-weight: 700; margin-top: 1px; }
#topBar .actions { display: flex; align-items: center; gap: 8px; flex: none; }
#headerExportBtn { min-height: 38px; padding: 0 16px; font-size: 13px; font-weight: 900; border-radius: 12px; }
#headerExportBtn svg { width: 17px; height: 17px; }
@media (max-width: 360px) { #topBar .brand small { display: none; } #headerExportBtn { padding: 0 12px; } }

/* ---- Transport bar ---- */
#transportBar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid #1B2232; background: #0F131C; }
#transportBar .tc { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-weight: 700; color: #94A3B8; white-space: nowrap; }
#transportBar .tc #currentTimeLabel { color: #fff; }
#transportBar .mid { display: flex; align-items: center; gap: 8px; justify-content: center; }
#transportBar .end { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
@media (max-width: 380px) { #transportBar { padding: 6px 6px; gap: 4px; } #transportBar .tc { font-size: 10.5px; } #transportBar .end { gap: 4px; } }

/* ---- Zoomable timeline ---- */
#timelineContainer { position: relative; height: 128px; background: #0A0D14; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; cursor: pointer; }
#tlTools { position: absolute; right: 4px; top: 2px; transform: scale(.92); transform-origin: top right; z-index: 30; display: flex; align-items: center; gap: 4px; padding: 2px; background: rgba(10,13,20,.88); border: 1px solid #222B3D; border-radius: 10px; backdrop-filter: none; }
#tlTools .tlz { width: 28px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: #1B2232; border: 1px solid #2B3448; color: #E2E8F0; cursor: pointer; touch-action: manipulation; transition: transform .1s, background-color .15s; }
#tlTools .tlz:hover { background: #2A3550; } #tlTools .tlz:active { transform: scale(.9); }
#tlTools .tlz svg { width: 14px; height: 14px; }
#tlTools .tlfit { width: auto; min-width: 44px; padding: 0 8px; font-size: 10px; font-weight: 900; color: #F59E0B; font-family: ui-monospace, Menlo, Consolas, monospace; }
#tlRuler { position: absolute; left: 0; right: 0; top: 0; height: 30px; background: #0F1420; border-bottom: 1px solid #1E2738; z-index: 5; }
#tlRulerCanvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
#tlScroll { position: absolute; left: 0; right: 0; top: 32px; bottom: 0; overflow: hidden; }
#tlInner { position: absolute; left: 0; top: 0; height: 100%; will-change: transform; transform: translate3d(0,0,0); }
#tlTracks { position: relative; margin-left: 14px; padding-top: 5px; }
#videoTrackBar { position: relative; height: 46px; display: flex; flex-wrap: nowrap; overflow: hidden; border-radius: 10px; background: #111827; border: 1px solid #1F2937; margin-bottom: 6px; }
#audioTrackBar { position: relative; height: 26px; border-radius: 8px; background: #0F172A; border: 1px solid #1E2738; overflow: hidden; }
.tl-seg { position: relative; flex: none; height: 100%; display: flex; align-items: center; justify-content: flex-start; padding: 0 6px; overflow: hidden; border-right: 2px solid #0A0D14; background-color: #1E293B; color: #CBD5E1; font-size: 10px; font-weight: 800; white-space: nowrap; box-sizing: border-box; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0, rgba(255,255,255,.07) 26px, rgba(0,0,0,.3) 26px, rgba(0,0,0,.3) 28px); }
.tl-seg span { text-shadow: 0 1px 2px rgba(0,0,0,.8); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tl-seg.src { background-color: rgba(30,58,138,.9); }
.tl-seg.ad { background-color: rgba(146,64,14,.92); }
.tl-seg.sel { background-color: #4C0F14; color: #fff; box-shadow: inset 0 0 0 2px #F59E0B; }
.tl-seg.sel.src { background-color: #1E3A8A; }
.tl-seg.sel.ad { background-color: #92400E; }
#audioClipVisual { position: absolute; left: 0; top: 3px; bottom: 3px; right: 0; border-radius: 6px; background: rgba(6,78,59,.7); border: 1px solid rgba(16,185,129,.45); display: flex; align-items: center; padding: 0 8px; color: #6EE7B7; font-size: 9px; font-weight: 800; white-space: nowrap; overflow: hidden; }
#audioClipVisual span { overflow: hidden; text-overflow: ellipsis; }
#playheadNeedle { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.9); pointer-events: none; z-index: 20; will-change: transform; transform: translate3d(-100px,0,0); }
#playheadNeedle::before { content: ''; position: absolute; top: 0; left: 50%; width: 14px; height: 14px; margin-left: -7px; background: #E31E24; border: 2px solid #fff; border-radius: 4px 4px 7px 7px; box-sizing: border-box; }
#playheadNeedle::after { content: ''; position: absolute; top: -8px; bottom: 0; left: -16px; right: -16px; }

/* ---- Bottom drawer & tab bar ---- */
#toolDrawer { max-height: 30dvh; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#bottomNav { display: flex; align-items: stretch; gap: 2px; padding: 6px 6px; overflow-x: auto; background: #0E121B; scrollbar-width: none; }
#bottomNav::-webkit-scrollbar { display: none; }
.nav-tab { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 2px 5px; border-radius: 12px; border: 0; background: transparent; color: #94A3B8; cursor: pointer; transition: color .15s, background-color .15s, transform .12s; touch-action: manipulation; }
.nav-tab svg { width: 20px; height: 20px; }
.nav-tab span { font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-weight: 800; line-height: 1; white-space: nowrap; }
.nav-tab:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-tab:active { transform: scale(.94); }
.nav-tab.text-red-500 { color: #F87171; background: rgba(227,30,36,.14); }
.nav-tab.text-red-500::after { content: ''; position: absolute; left: 24%; right: 24%; bottom: 1px; height: 2px; border-radius: 2px; background: #E31E24; }
@media (min-width: 700px) { #bottomNav { justify-content: center; } .nav-tab { flex: 0 0 84px; } .nav-tab span { font-size: 11px; } }
@media (max-width: 350px) { .nav-tab svg { width: 18px; height: 18px; } .nav-tab span { font-size: 9px; } }

/* ---- Laptop / big screens: keep controls centred and uncut ---- */
@media (min-width: 900px) {
  #transportBar, #timelineContainer, #toolDrawer, #bottomNav, #topBar { max-width: 1100px; width: 100%; margin-left: auto; margin-right: auto; }
  #toolDrawer { max-height: 34dvh; }
  #timelineContainer { height: 150px; }
  #videoTrackBar { height: 56px; }
}
@media (max-height: 640px) { #timelineContainer { height: 112px; } #videoTrackBar { height: 38px; } #toolDrawer { max-height: 26dvh; } }
/* select / input safety so nothing is cut off */
select, input[type=text], textarea { max-width: 100%; }
.tool-panel { min-width: 0; }
.tool-panel .btn { min-width: 0; }
#exportModal .modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
#finalDownloadAnchor { text-decoration: none; }
input[type="range"] { touch-action: pan-y; cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #E31E24; border: 2px solid #fff; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -0px; }


/* =====================================================================
   TV21 v4 - BIGGER PREVIEW, compact tools, Shorts / Long mode, title styles
   ===================================================================== */

/* ---- preview stage: as big as the screen allows ---- */
#stage { padding: 2px; }
#previewContainer { max-width: 100%; border-radius: 10px; }
body.mode-long #previewContainer { height: auto; width: 100%; max-height: 100%; aspect-ratio: 16 / 9; }
body.mode-long #stage { align-items: center; }

/* ---- top bar: slimmer ---- */
#topBar { height: calc(42px + var(--safe-t)); padding-left: 8px; padding-right: 8px; gap: 6px; }
#topBar .brand img { width: 28px; height: 28px; border-radius: 8px; }
#topBar .brand b { font-size: 12px; }
#topBar .actions { gap: 6px; }
#installAppBtn { width: 34px; min-width: 34px; min-height: 34px; }
#headerExportBtn { min-height: 34px; padding: 0 12px; font-size: 12px; border-radius: 10px; gap: 5px; }
#headerExportBtn svg { width: 15px; height: 15px; }
.is-app #installAppBtn, .is-app #pwaInstallModal { display: none !important; }
@media (max-width: 440px) { #topBar .brand div { display: none; } }

/* ---- Shorts / Long switch ---- */
#modeSwitch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 11px; background: #0B0F18; border: 1px solid #263046; flex: none; }
#modeSwitch button { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 10px; border-radius: 9px; border: 0; background: transparent; color: #94A3B8; font-size: 11px; font-weight: 800; cursor: pointer; transition: background-color .15s, color .15s; touch-action: manipulation; font-family: inherit; }
#modeSwitch button svg { width: 13px; height: 13px; flex: none; }
#modeSwitch button.on { background: linear-gradient(135deg, #F0262C, #C8102E); color: #fff; box-shadow: 0 3px 10px rgba(227,30,36,.35); }
@media (max-width: 380px) { #modeSwitch button { padding: 0 8px; gap: 4px; font-size: 10.5px; } }

/* ---- transport + timeline: slimmer ---- */
#transportBar { padding: 3px 8px; gap: 4px; }
#transportBar .tc { font-size: 11px; }
#transportBar .btn-icon.btn-round { width: 32px; min-width: 32px; min-height: 32px; }
.btn-play { width: 38px; height: 38px; min-width: 38px; min-height: 38px; }
.btn-play svg { width: 17px; height: 17px; }
#transportBar .btn-sm { min-height: 28px; font-size: 10.5px; padding: 0 8px; }
#transportBar .btn-sm.btn-icon { width: 30px; min-width: 30px; padding: 0; }
#timelineContainer { height: 98px; }
#videoTrackBar { height: 36px; margin-bottom: 4px; }
#audioTrackBar { height: 20px; }
#audioClipVisual { top: 2px; bottom: 2px; font-size: 8.5px; }
body.mode-long #timelineContainer { height: 104px; }

/* ---- tool drawer: smaller buttons, smaller drawer ---- */
#toolDrawer { max-height: 21dvh; padding: 4px 8px !important; }
body.mode-long #toolDrawer { max-height: 33dvh; }
#toolDrawer .tool-panel > * + * { margin-top: 5px !important; }
#toolDrawer .btn { min-height: 28px; padding: 0 9px; font-size: 11px; border-radius: 9px; gap: 5px; }
#toolDrawer .btn svg { width: 14px; height: 14px; }
#toolDrawer .btn-sm { min-height: 25px; padding: 0 8px; font-size: 10px; }
#toolDrawer .chip-btn { min-height: 25px; padding: 0 8px; font-size: 10px; }
#toolDrawer .panel-box { padding: 6px; border-radius: 11px; }
#toolDrawer select, #toolDrawer input[type=text], #toolDrawer textarea, #toolDrawer input[type=number] { font-size: 11px; }
#toolDrawer .row-wrap { gap: 5px; }
#toolDrawer p.text-\[10px\] { font-size: 9.5px; line-height: 1.25; }
#toolDrawer .btn-primary, #toolDrawer .btn-green, #toolDrawer .btn-amber { box-shadow: none; }

/* ---- bottom tab bar: smaller ---- */
#bottomNav { padding: 3px 4px; gap: 1px; }
.nav-tab { padding: 4px 2px 3px; gap: 2px; border-radius: 10px; }
.nav-tab svg { width: 17px; height: 17px; }
.nav-tab span { font-size: 9px; }
@media (min-width: 700px) { .nav-tab { flex: 0 0 76px; } .nav-tab span { font-size: 10px; } }

/* ---- Title style (filter) picker ---- */
.theme-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.theme-chip { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 4px 3px 3px; border-radius: 10px; border: 1px solid #2B3448; background: #111827; color: #CBD5E1; font-family: inherit; font-size: 9px; font-weight: 800; line-height: 1.1; text-align: center; cursor: pointer; touch-action: manipulation; transition: transform .12s, border-color .15s, background-color .15s; min-width: 0; }
.theme-chip i { display: block; height: 15px; border-radius: 6px; }
.theme-chip span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-chip:active { transform: scale(.95); }
.theme-chip.active { border-color: #E31E24; background: rgba(227,30,36,.16); color: #fff; box-shadow: inset 0 0 0 1px #E31E24; }

/* ---- big screens: keep proportions ---- */
@media (min-width: 900px) {
  #timelineContainer { height: 124px; }
  #videoTrackBar { height: 46px; }
  #toolDrawer { max-height: 28dvh; }
  body.mode-long #toolDrawer { max-height: 30dvh; }
}
@media (max-height: 640px) { #timelineContainer { height: 92px; } #toolDrawer { max-height: 24dvh; } }

.layout-chip i { height: auto; display: flex; justify-content: center; background: none !important; box-shadow: none !important; }
.layout-chip svg { display: block; height: 38px; width: auto; max-width: 100%; border-radius: 4px; border: 1px solid #2B3448; }
