/* Stop-motion — tokenid, siis komponendid. Pinnad/tekstid ainult teemamuutujatest. */
:root {
    --sm-accent-soft: var(--accent-soft, rgba(0, 209, 178, 0.09));
    --sm-ring: var(--accent-ring, rgba(0, 209, 178, 0.32));
    --sm-shutter: #e11d48;
    --sm-danger: #c81e48;
    --sm-r-btn: 8px;
    --sm-r-card: 12px;
    --sm-r-panel: 16px;
}
[data-theme="dark"] { --sm-shutter: #f43f5e; --sm-danger: #fb7185; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --sm-shutter: #f43f5e; --sm-danger: #fb7185; }
}

.sm-body { background: var(--bg-primary); }
/* Bulma .section / .button / flex-reeglid kirjutavad `hidden`-atribuudi üle — peitmine käib
   siin ainult atribuudiga, seega peab see alati võitma. */
#sm-app [hidden] { display: none !important; }
.sm-sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Animatsioonid ---------- */
.sm-head { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; margin-bottom: 32px; }
.sm-head-text { flex: 999 1 320px; min-width: 0; }
.sm-badge {
    flex: none; width: 56px; height: 56px; border-radius: 14px; font-size: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--sm-accent-soft); color: var(--accent-color);
}
.sm-h1 { margin-bottom: 4px !important; letter-spacing: -0.015em; }
.sm-lead { color: var(--text-secondary); max-width: 60ch; line-height: 1.5; }
.sm-cta { flex: none; font-weight: 600; height: 48px; padding-inline: 20px; border-radius: var(--sm-r-btn); }
.sm-empty { color: var(--text-secondary); margin: 16px 0; }
.sm-note {
    display: flex; gap: 12px; align-items: flex-start; margin-top: 32px; max-width: 720px;
    padding: 16px; border-radius: var(--sm-r-card); font-size: 14px; color: var(--text-secondary);
    background: var(--bg-card); border: 1px solid var(--border-light, var(--border-color));
}
.sm-note i { margin-top: 3px; }
/* Hoiatus: brauser võib mälu ise tühjendada (püsivusluba puudub) */
.sm-persist-warn { color: var(--text-primary); border-left: 4px solid hsl(42, 100%, 45%); }
.sm-persist-warn[hidden] { display: none; }
.sm-persist-warn i { color: hsl(38, 95%, 38%); }
.sm-persist-warn + .sm-note { margin-top: 12px; }
[data-theme="dark"] .sm-persist-warn i { color: hsl(45, 100%, 60%); }

.sm-grid {
    display: grid; gap: 16px; margin-top: 8px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.sm-card {
    background: var(--bg-card); border: 1px solid var(--border-light, var(--border-color));
    border-radius: var(--sm-r-card); overflow: hidden; box-shadow: var(--shadow-card);
    display: flex; flex-direction: column;
}
/* max-height: 9:16 animatsiooni kaart oleks muidu ~2x kõrgem kui teised */
.sm-card-thumb {
    display: flex; align-items: center; justify-content: center; width: 100%; max-height: 240px;
    border: 0; padding: 0; cursor: pointer; background: var(--bg-secondary);
    color: var(--text-muted); font-size: 32px; overflow: hidden;
}
.sm-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sm-card-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; }
.sm-card-title { font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.sm-card-meta { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.sm-card-body .dk-actions { margin-top: auto; }

/* ---------- Stuudio: kerimata täisaken ----------
   Stuudio katab kogu akna (saidi menüüriba peidetud) ja jagab selle grid-aladeks; lava võtab
   kogu ülejäänud ruumi. Kolm paigutust: lai (seaded paremal), kitsas/püsti (seaded paneelil
   alt) ja madal pikali (telefon põiki: kaadrid vasakul püsti, nupud paremal). */
body.sm-in-studio { overflow: hidden; }
body.sm-in-studio > nav.navbar { display: none; }
.sm-studio {
    position: fixed; inset: 0; z-index: 35; overflow: hidden;
    display: grid; gap: 12px 16px; padding: 12px 16px;
    background: var(--bg-primary);
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "top panel" "stage panel" "ctl panel" "strip panel";
}
.sm-btn { height: 44px; border-radius: var(--sm-r-btn); font-weight: 600; }
.sm-icon-btn { width: 44px; padding: 0; }
.sm-danger, .sm-danger:hover { color: var(--sm-danger); }

.sm-topbar { grid-area: top; display: flex; gap: 12px; align-items: center; min-width: 0; }
.sm-title {
    flex: 1 1 auto; min-width: 0; margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3;
    color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sm-settings-btn { display: none; }
.sm-export { flex: none; font-weight: 700; padding-inline: 20px; }

/* Video kokkupaneku seis: kaart lava kohal (kerimata vaates ei tohi ta lava kokku suruda) */
.sm-export-state {
    position: absolute; z-index: 6; top: 68px; left: 50%; transform: translateX(-50%);
    width: min(640px, calc(100% - 32px)); max-height: calc(100% - 80px); overflow: auto;
    display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center;
    padding: 12px 44px 12px 16px; background: var(--bg-card); border-radius: var(--sm-r-card);
    border: 1px solid var(--border-light, var(--border-color));
    box-shadow: var(--shadow-3, 0 8px 32px rgba(0, 0, 0, 0.28));
}
.sm-export-close { position: absolute; top: 12px; right: 12px; }
.sm-export-progress { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sm-export-progress .progress { margin: 0; }
.sm-export-state .buttons { margin: 0; flex-wrap: wrap; }
.sm-export-state .buttons .button { margin-bottom: 0; }

/* Lava = suurim kast õiges kuvasuhtes, mis alale mahub (laius JA kõrgus). Konteineri ühikud,
   mitte max-height + aspect-ratio — see moonutaks kasti ja eelvaade näitaks muud kui kaader. */
.sm-stage-area {
    grid-area: stage; min-width: 0; min-height: 0; container-type: size;
    display: grid; place-items: center; position: relative;
}
/* Püsti telefonis on laiuti kaader ekraani laiusega piiratud (~24% ekraanist) — vihje lava all
   tühjas ribas. Kaob esimese kaadriga (kuvasuhe lukus) ja püstise/ruudu kuvasuhtega. */
.sm-rotate-hint {
    position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%);
    width: max-content; max-width: 100%; display: none; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.3;
    background: var(--bg-card); color: var(--text-secondary);
    border: 1px solid var(--border-light, var(--border-color));
}
.sm-rotate-hint i { font-size: 16px; animation: sm-rotate 2.4s var(--ease, ease) infinite; }
@keyframes sm-rotate { 0%, 35% { rotate: 0deg; } 55%, 85% { rotate: -90deg; } 100% { rotate: 0deg; } }
@media (prefers-reduced-motion: reduce) { .sm-rotate-hint i { animation: none; } }
@media (orientation: portrait) and (max-width: 899px) {
    .sm-studio.is-rotate-hint .sm-rotate-hint { display: flex; }
}
.sm-stage {
    position: relative; width: 100%;
    width: min(100cqw, 100cqh * var(--sm-ratio, 1.7778));
    background: #000; border-radius: var(--sm-r-panel); overflow: hidden;
}
.sm-stage video, .sm-stage .sm-onion, .sm-stage .sm-play-img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.sm-stage .sm-onion { pointer-events: none; }
/* Kaamerapildi peal: alati hele kiri tumedal looril (teema värvid ei loe pildi peal) */
.sm-chip {
    position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center;
    height: 28px; padding: 0 12px; border-radius: 999px; pointer-events: none;
    background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 13px; font-weight: 600;
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sm-stage-tools { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; gap: 8px; }
.sm-overlay-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
    background: rgba(0, 0, 0, 0.55); color: #fff;
}
@media (hover: hover) { .sm-overlay-btn:hover { background: rgba(0, 0, 0, 0.75); } }
.sm-overlay-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
#sm-fs .sm-fs-off, #sm-fs[aria-pressed="true"] .sm-fs-on { display: none; }
#sm-fs[aria-pressed="true"] .sm-fs-off { display: inline-block; }
.sm-stage-msg {
    position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 12px; padding: 16px; text-align: center; overflow: auto;
    background: var(--bg-card); color: var(--text-primary);
}
.sm-stage-msg p { max-width: 44ch; }
/* Keskel, aga kitsal laval (9:16 põiki) üle ajades kerib algusest — justify-content:center lõikaks ülaosa ära */
.sm-stage-msg { justify-content: flex-start; }
.sm-stage-msg > :first-child { margin-top: auto; }
.sm-stage-msg > :last-child { margin-bottom: auto; }
.sm-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.sm-flash.is-on { animation: sm-flash 220ms var(--ease-out, ease-out); }
@keyframes sm-flash { from { opacity: 0.55; } to { opacity: 0; } }

/* Pildistamise riba: viis võrdset pesa, päästik keskel — pool ei sõltu nuppude arvust. */
.sm-controls {
    grid-area: ctl; display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; justify-items: center;
    align-items: center; gap: 8px; width: 100%; max-width: 480px; margin: 0 auto;
}
.sm-shutter { grid-column: 3; }
.sm-kbd-hint { grid-column: 4 / 6; justify-self: start; }
.sm-ctl-btn { width: 52px; height: 52px; padding: 0; border-radius: 50%; }
.sm-ctl-btn .sm-btn-text {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.sm-shutter {
    flex: none; width: 76px; height: 76px; border-radius: 50%; cursor: pointer;
    border: 4px solid var(--text-primary); background: transparent; padding: 4px;
    transition: scale var(--dur-fast, 150ms) var(--ease, ease);
}
.sm-shutter:active { scale: 0.94; }
.sm-shutter:focus-visible { outline: 3px solid var(--sm-ring); outline-offset: 3px; }
.sm-shutter-dot { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--sm-shutter); }
.sm-kbd-hint { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.sm-kbd-hint kbd {
    font: inherit; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
    border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-secondary);
}
.sm-file-btn { position: relative; overflow: hidden; }
.sm-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Seaded ---------- */
.sm-panel {
    grid-area: panel; align-self: start; max-height: 100%; overflow: auto;
    display: flex; flex-direction: column; gap: 20px; padding: 20px;
    background: var(--bg-card); border: 1px solid var(--border-light, var(--border-color));
    border-radius: var(--sm-r-panel);
}
.sm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sm-panel-h { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.sm-panel-close { display: none; }
.sm-name { height: 44px; font-weight: 600; border-radius: var(--sm-r-btn); }
.sm-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.sm-field { display: flex; flex-direction: column; gap: 8px; }
.sm-field > .sm-label { margin-bottom: 0; }
.sm-label { display: block; padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.sm-label-sub { font-weight: 400; color: var(--text-muted); }
.sm-seg {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px;
    border-radius: 10px; background: var(--bg-primary);
}
/* Kaks klassi: css/style.css puuteseadme reegel `label:has(> input[type="radio"])` (0-1-2)
   teeb sildist muidu flex-konteineri ja valikukast kahaneb telefonis sisu laiuseks. */
.sm-panel .sm-seg label { position: relative; display: block; min-width: 0; cursor: pointer; }
.sm-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sm-seg span {
    display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 6px;
    font-size: 14px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums;
    transition: background-color var(--dur-fast, 150ms) var(--ease, ease);
}
@media (hover: hover) { .sm-seg input:not(:disabled):not(:checked):hover + span { background: var(--bg-hover, var(--bg-card)); } }
.sm-seg input:checked + span {
    background: var(--bg-card); color: var(--text-primary); font-weight: 700;
    box-shadow: var(--shadow-1, 0 1px 2px rgba(17, 17, 26, 0.06), 0 4px 12px rgba(17, 17, 26, 0.08));
}
.sm-seg input:focus-visible + span { outline: 3px solid var(--sm-ring); outline-offset: 2px; }
.sm-seg input:disabled { cursor: not-allowed; }
.sm-seg input:disabled + span { opacity: 0.6; }
.sm-check { display: flex; gap: 12px; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.sm-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent-color); }
.sm-range-row { display: flex; align-items: center; gap: 12px; }
.sm-range { flex: 1 1 auto; min-width: 0; margin: 0; accent-color: var(--accent-color); }
.sm-range:disabled { opacity: 0.5; }
.sm-range-val { width: 40px; text-align: right; font-size: 14px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sm-help { font-size: 13px; color: var(--text-muted); }
.sm-lock { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.sm-summary {
    display: flex; flex-direction: column; gap: 2px; padding-top: 20px;
    border-top: 1px solid var(--border-light, var(--border-color));
}
.sm-summary .sm-label { margin-bottom: 0; }
.sm-length { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sm-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, 0.5); }

/* ---------- Kaadririba ---------- */
.sm-strip-wrap {
    grid-area: strip; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px 12px;
    background: var(--bg-card); border: 1px solid var(--border-light, var(--border-color));
    border-radius: var(--sm-r-card);
}
.sm-strip-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.sm-strip-h { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.sm-count { font-size: 14px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sm-sel { flex: 1 1 auto; font-size: 14px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sm-strip-tools { display: flex; gap: 4px; flex: none; }
.sm-ic-v { display: none; }
.sm-strip {
    display: flex; gap: 8px; overflow-x: auto; list-style: none; margin: 0; padding: 4px;
    min-height: 74px; scroll-padding: 8px;
}
.sm-strip li { flex: none; }
.sm-frame {
    position: relative; height: 64px; padding: 0; border-radius: 8px; cursor: pointer;
    border: 3px solid transparent; background: var(--bg-secondary); overflow: hidden; display: block;
}
.sm-frame img { height: 100%; width: 100%; object-fit: cover; display: block; }
.sm-frame.is-selected { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--sm-ring); }
.sm-frame:focus-visible { outline: 3px solid var(--sm-ring); outline-offset: 2px; }
.sm-frame-num {
    position: absolute; left: 6px; bottom: 3px; font-size: 12px; font-weight: 700;
    color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); font-variant-numeric: tabular-nums;
}

@media (hover: none) { .sm-kbd-hint { display: none; } }

/* ---------- Kitsas / püsti: lava üleval, kaadrid ja päästik all, seaded paneelil ---------- */
@media (max-width: 899px) {
    .sm-studio {
        gap: 8px; padding: 8px 12px 12px;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto auto;
        grid-template-areas: "top" "stage" "strip" "ctl";
    }
    .sm-topbar { gap: 8px; }
    .sm-back { width: 44px; padding: 0; }
    .sm-back .sm-btn-text, .sm-strip-tools .sm-btn-text {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    .sm-strip-tools .button { width: 44px; padding: 0; }
    .sm-settings-btn { display: inline-flex; }
    .sm-export { padding-inline: 14px; }
    .sm-export-state { top: 60px; }
    .sm-kbd-hint { display: none; }
    .sm-stage { border-radius: var(--sm-r-card); }
    .sm-frame { height: 52px; border-radius: 6px; }
    .sm-strip { min-height: 62px; gap: 6px; }
    .sm-strip-h { display: none; }
    .sm-strip-head { justify-content: space-between; }
    .sm-sel { flex: 0 1 auto; }
    /* Seaded: paneel alt üles */
    .sm-panel {
        position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; max-height: 85%;
        border-radius: var(--sm-r-panel) var(--sm-r-panel) 0 0; border-bottom: 0;
        padding: 16px 16px 24px; gap: 16px; display: none;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
    }
    .sm-studio.is-settings-open .sm-panel { display: flex; }
    .sm-panel-close { display: inline-block; }
    .sm-summary { padding-top: 16px; }
    /* „Kaader kustutatud / Võta tagasi" (js/vota_tagasi.js, tekstisisesed stiilid) on vaikimisi
       all keskel — püstivaates täpselt päästiku peal 9 s. Siin lava ülaserva. */
    body.sm-in-studio .dk-undo-toast { bottom: auto !important; top: 64px !important; }
    .sm-length { font-size: 24px; }
}
@media (max-width: 520px) {
    /* Valitud kaader paistab riba esiletõstust — tekst lükkaks nupud teisele reale */
    .sm-sel { display: none; }
    .sm-strip-head { gap: 4px 8px; }
    .sm-count { font-size: 13px; }
    .sm-strip-tools .button { width: 40px; height: 40px; }
}
@media (max-width: 380px) {
    .sm-export { width: 44px; padding: 0; }
    .sm-export-text {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
}

/* ---------- Madal pikali (telefon põiki): lava kogu kõrguses ----------
   Vasakul tagasi, kaadrid püsti ja kaadri nupud; paremal seaded, pildistamine ja video.
   Mähised (.sm-topbar, .sm-strip-wrap, .sm-strip-head) lahustuvad, nupud lähevad ise aladesse. */
@media (orientation: landscape) and (max-height: 520px) {
    .sm-studio {
        gap: 6px 10px; padding: 8px 12px;
        grid-template-columns: 80px minmax(0, 1fr) 64px;
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-areas: "back stage settings" "strip stage ctl" "tools stage export";
    }
    .sm-topbar, .sm-strip-wrap, .sm-strip-head { display: contents; }
    .sm-title, .sm-strip-h, .sm-count, .sm-sel { display: none; }
    .sm-back { grid-area: back; justify-self: center; }
    .sm-settings-btn { grid-area: settings; justify-self: center; }
    .sm-export { grid-area: export; justify-self: center; align-self: end; width: 52px; height: 52px; padding: 0; border-radius: 50%; }
    .sm-export-text {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    .sm-export-state { top: 8px; }
    .sm-strip {
        grid-area: strip; flex-direction: column; overflow-x: hidden; overflow-y: auto;
        min-height: 0; padding: 3px; gap: 6px; border-radius: var(--sm-r-btn);
        background: var(--bg-card); border: 1px solid var(--border-light, var(--border-color));
    }
    .sm-frame { width: 100%; height: auto; }
    .sm-strip-tools { grid-area: tools; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-self: end; }
    .sm-strip-tools .button { width: 38px; height: 38px; }
    .sm-ic-h { display: none; }
    .sm-ic-v { display: inline-block; }
    .sm-controls {
        grid-area: ctl; display: flex; flex-direction: column; justify-content: center; gap: 10px;
        max-width: none; margin: 0;
    }
    .sm-ctl-btn { width: 48px; height: 48px; }
    .sm-shutter { width: 64px; height: 64px; order: -1; }
    /* Ümmargused nupud ei tohi veerus kokku suruda (ovaalid) — mahutamine käib allpool kompaktsema
       paigutusega, mitte nuppe kahandades */
    .sm-controls > * { flex: none; }
    /* Päästik nupurea keskele: pilt failist üles, esitus alla */
    .sm-controls .sm-file-btn { order: -2; }
    /* Seaded: paneel paremalt (laiemal kui 899 px pikali-telefonil ei kehti kitsa vaate reeglid) */
    .sm-panel {
        position: fixed; z-index: 40; top: 0; left: auto; right: 0; bottom: 0;
        width: min(360px, 85vw); max-height: none; display: none; padding: 16px; gap: 16px;
        align-self: stretch; /* grid-lapse align-self:start teeks fikseeritud paneeli sisu-kõrguseks */
        border-radius: var(--sm-r-panel) 0 0 var(--sm-r-panel);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
    }
    .sm-studio.is-settings-open .sm-panel { display: flex; }
    .sm-panel-close { display: inline-block; }
    .sm-settings-btn { display: inline-flex; }
    .sm-kbd-hint { display: none; }
    .sm-back { width: 44px; padding: 0; }
    .sm-back .sm-btn-text, .sm-strip-tools .sm-btn-text {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    .sm-stage { border-radius: var(--sm-r-card); }
}

/* ---------- Väga madal pikali (brauseri ribadega telefon, ~240–340 px) ----------
   Paremasse veergu jäävad ainult seaded ja pildistamine; „Tee video" läheb vasakule tagasi-nupu
   kõrvale. Mahub 240 px kõrgusele (2026-11-19: 245 px juures surusid nupud ovaaliks ja kattusid). */
@media (orientation: landscape) and (max-height: 340px) {
    .sm-studio {
        gap: 6px 8px; padding: 6px 10px;
        grid-template-areas: "back stage settings" "strip stage ctl" "tools stage ctl";
    }
    .sm-back { justify-self: start; width: 38px; height: 38px; }
    .sm-export {
        grid-area: back; justify-self: end; align-self: center;
        width: 38px; height: 38px; border-radius: var(--sm-r-btn);
    }
    .sm-settings-btn { width: 40px; height: 40px; }
    .sm-controls { gap: 8px; }
    .sm-ctl-btn { width: 40px; height: 40px; }
    .sm-shutter { width: 56px; height: 56px; border-width: 3px; padding: 3px; }
    .sm-strip-tools .button { width: 36px; height: 36px; }
    .sm-overlay-btn { width: 34px; height: 34px; font-size: 14px; }
    .sm-stage-tools { top: 6px; left: 6px; gap: 6px; }
    .sm-chip { right: 6px; bottom: 6px; height: 24px; font-size: 12px; }
}
