/* =============================================================================
   CS Trim panel
   One design system: tokens → base → layout → components → views → overlays
   ============================================================================= */

@font-face {
    font-family: 'Heebo';
    src: url('Heebo.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Surfaces: deep ink with a cool undertone, layered by light instead of by border */
    --bg: #0F1116;
    --surface: #161920;
    --surface-2: #1D212A;
    --surface-3: #262B36;
    --line: rgba(255, 255, 255, 0.06);
    --line-strong: rgba(255, 255, 255, 0.11);
    --hi: rgba(255, 255, 255, 0.05);

    --text: #F2F4F8;
    --text-2: #A5ABB8;
    --text-3: #6B7180;

    /* Brand blue, matches the logo gradient */
    --accent: #3B7BF6;
    --accent-hover: #5A93FF;
    --accent-press: #2A62D8;
    --accent-grad: linear-gradient(180deg, #5A9DFF 0%, #2F6BEA 100%);
    --accent-grad-hover: linear-gradient(180deg, #70ABFF 0%, #3B78F5 100%);
    --accent-soft: rgba(59, 123, 246, 0.14);
    --accent-glow: rgba(59, 123, 246, 0.35);
    --accent-text: #94B8FF;

    --ok: #3FB950;
    --ok-soft: rgba(63, 185, 80, 0.12);
    --warn: #E3A008;
    --warn-soft: rgba(227, 160, 8, 0.12);
    --err: #F06A62;
    --err-soft: rgba(240, 106, 98, 0.12);

    --font: 'Heebo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --r-sm: 7px;
    --r: 10px;
    --r-lg: 14px;
    --h: 32px;
    --h-btn: 40px;
    --gap: 16px;
    --ease: cubic-bezier(0.2, 0, 0, 1);

    --shadow-card: 0 1px 0 var(--hi) inset, 0 6px 18px -8px rgba(0, 0, 0, 0.55);
    --shadow-pop: 0 18px 48px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line-strong);
}

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

html, body {
    background: var(--bg);
    color-scheme: dark;
    scrollbar-width: thin;
    scrollbar-color: #2A2E38 transparent;
}

body {
    color: var(--text);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    padding: 0 12px 10px;
    direction: rtl;
    min-height: 100vh;
    background:
        radial-gradient(120% 60% at 50% -10%, rgba(59, 123, 246, 0.13), transparent 60%),
        var(--bg);
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
}

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; border-radius: var(--r-sm); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2A2E38; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3A404D; }

button { font-family: inherit; color: inherit; }
svg { flex-shrink: 0; }

/* ---------- Header ---------- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    gap: 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.brand-mark {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    box-shadow: 0 0 0 1px var(--line-strong), 0 4px 14px -2px var(--accent-glow);
}

.brand-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.02em;
    direction: ltr;
    background: linear-gradient(180deg, #FFFFFF 20%, #AEB6C8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.icon-btn {
    position: relative;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.icon-btn:hover { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.icon-btn.active { background: var(--surface-3); color: var(--text); }

.log-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: var(--surface-3);
    border: 1.5px solid var(--bg);
    color: var(--text);
    font-size: 8.5px;
    font-weight: 700;
    line-height: 1;
    align-items: center;
    justify-content: center;
}

.log-badge.has-error { background: var(--err); color: #fff; }

.btn-top-update {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 8px;
    margin-left: 4px;
    background: var(--accent-soft);
    border: 1px solid rgba(90, 157, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 0 14px -3px var(--accent-glow);
    color: var(--accent-text);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-top-update:hover { background: rgba(59, 120, 240, 0.24); }

/* ---------- Context bar (sequence + connection) ---------- */
.context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 34px;
    padding: 0 12px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 1px 0 var(--hi) inset;
}

.seq-info {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--text);
    font-size: 11.5px;
}

.seq-icon { color: var(--text-3); }

#seqName {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    color: var(--text-2);
    font-size: 11px;
    cursor: pointer;
}

.status-badge:hover { color: var(--text); }

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px var(--ok-soft), 0 0 8px var(--ok);
}

.status-dot.offline { background: var(--err); box-shadow: 0 0 0 3px var(--err-soft), 0 0 8px var(--err); }

/* ---------- Tabs ---------- */
.tabs-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: var(--gap);
    border-bottom: 1px solid var(--line);
}

.tab-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 38px;
    background: transparent;
    border: none;
    color: var(--text-3);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); }

.tab-btn::after {
    content: "";
    position: absolute;
    inset: auto 14% -1px 14%;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(90deg, transparent, #7DB1FF, transparent);
    box-shadow: 0 0 12px 1px var(--accent-glow);
    transform: scaleX(0);
    transition: transform 0.2s var(--ease);
}

.tab-btn.active::after { transform: scaleX(1); }

.tab-beta-pill {
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    background: var(--accent-soft);
    color: var(--accent-text);
    direction: ltr;
}

/* ---------- Views ---------- */
.tab-view { display: none; }
.tab-view.active { display: block; animation: viewIn 0.18s var(--ease); }
.tab-view.active > .section,
.tab-view.active > .actions {
    animation: riseIn 0.38s var(--ease) both;
}
.tab-view.active > :nth-child(2) { animation-delay: 0.04s; }
.tab-view.active > :nth-child(3) { animation-delay: 0.08s; }
.tab-view.active > :nth-child(4) { animation-delay: 0.12s; }
.tab-view.active > :nth-child(5) { animation-delay: 0.16s; }

@keyframes riseIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .tab-view.active > * { animation: none !important; }
    .btn-primary::after { display: none; }
}

@keyframes viewIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Sections & cards ---------- */
.section { margin-bottom: var(--gap); }

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-2);
    margin: 0 2px 8px;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(to left, var(--line-strong), transparent);
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 60%), var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 0 12px;
    box-shadow: var(--shadow-card);
}

.card > * + * { border-top: 1px solid var(--line); }

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    padding: 6px 0;
}

.row > label,
.toggle-label {
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.field { padding: 9px 0; }

.field > label,
.field-head label {
    display: block;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 6px;
}

.field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.hint {
    color: var(--text-3);
    font-size: 11px;
    line-height: 1.5;
    margin: 6px 2px 0;
}

.hint-center { text-align: center; margin-top: 10px; }

/* ---------- Segmented control ---------- */
.segmented {
    display: flex;
    gap: 2px;
    padding: 2px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35) inset;
}

.segmented > button,
.segmented > label {
    flex: 1 1 0;
    min-width: 0;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s, color 0.15s;
}

.segmented > button:hover,
.segmented > label:hover { color: var(--text); }

.segmented > .active {
    background: linear-gradient(180deg, #333949, #272C39);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 0 0 1px var(--line-strong), 0 3px 8px -2px rgba(0, 0, 0, 0.5);
}

.segmented-sm > button,
.segmented-sm > label { height: 28px; font-size: 11.5px; }

/* Transcription engine: two option cards, so the choice reads as a setting and not another toggle */
.engine-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 0;
}

.engine-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
    padding: 10px 11px 10px 28px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    background: var(--surface-2);
    font-family: var(--font);
    text-align: right;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.engine-btn:hover { border-color: rgba(255, 255, 255, 0.22); }

/* Radio dot in the corner */
.engine-btn::before {
    content: "";
    position: absolute;
    top: 11px;
    left: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid #555;
    box-sizing: border-box;
}

.engine-btn.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent), 0 0 18px -6px var(--accent-glow);
}

.engine-btn.active::before {
    border-color: var(--accent);
    background: radial-gradient(circle, var(--accent) 0 3px, transparent 3.5px);
}

.engine-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
}

.engine-tag {
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 9.5px;
    font-weight: 600;
}

.engine-sub {
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-2);
}

.engine-status {
    font-size: 10.5px;
    color: var(--accent-text);
}

.engine-status.ok { color: #7EE08A; }
.engine-status:empty { display: none; }

.row .segmented { flex: 0 1 auto; }
.row .scope-selector > button { padding: 0 10px; }

.anim-track-btn { font-family: var(--mono); direction: ltr; }

/* ---------- Buttons ---------- */
.actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    width: 100%;
    height: var(--h-btn);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--r);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s, box-shadow 0.2s, transform 0.1s;
}

.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: saturate(0.55); }

/* Soft sheen sweeping across the primary action on hover */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
    transform: translateX(120%);
    transition: transform 0.6s var(--ease);
    pointer-events: none;
}
.btn-primary:hover:not(:disabled)::after { transform: translateX(-120%); }

.btn-primary {
    background: var(--accent-grad);
    color: #fff;
    text-shadow: 0 1px 1px rgba(8, 24, 70, 0.35);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 0 0 1px rgba(20, 60, 160, 0.6), 0 8px 20px -6px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-grad-hover);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.32) inset, 0 0 0 1px rgba(20, 60, 160, 0.6), 0 10px 26px -6px rgba(59, 123, 246, 0.55);
}
.btn-primary:active:not(:disabled) { background: var(--accent-press); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) inset; }

.btn-secondary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-color: var(--line-strong);
    color: var(--text);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); border-color: rgba(255, 255, 255, 0.2); }

.btn-ghost { background: transparent; color: var(--text-2); height: 30px; font-weight: 500; }
.btn-ghost:hover:not(:disabled) { background: var(--surface); color: var(--text); }

.btn-sm { height: 30px; font-size: 11.5px; }

/* ---------- Switch ---------- */
.row-toggle { cursor: pointer; }

.switch {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.switch-track {
    width: 34px;
    height: 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--line-strong);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) inset;
    position: relative;
    transition: background 0.18s, border-color 0.18s;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #9AA1B0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s var(--ease), background 0.18s;
}

.switch input:checked + .switch-track { background: var(--accent-grad); border-color: rgba(20, 60, 160, 0.7); box-shadow: 0 0 12px -2px var(--accent-glow); }
.switch input:checked + .switch-track::after { transform: translateX(-14px); background: #fff; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- API key ---------- */


/* ---------- In/Out hint ---------- */
.scope-hint {
    margin: 0 -10px;
    padding: 7px 10px;
    font-size: 11px;
    color: var(--text-2);
    background: var(--surface-2);
}

.scope-hint.warning { color: #F1C55B; background: var(--warn-soft); }

/* ---------- Word count slider ---------- */
.slider-control-wrap {
    flex: 0 1 170px;
    min-width: 110px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.slider-badge {
    flex-shrink: 0;
    min-width: 48px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 1px var(--line);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
}

.slider-track-wrap { flex: 1; min-width: 0; display: flex; direction: ltr; }

input[type="range"].range-slim {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 18px;
    background: transparent;
    cursor: pointer;
    margin: 0;
}

input[type="range"].range-slim::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #5A9DFF var(--slider-fill, 28.57%), var(--surface-3) var(--slider-fill, 28.57%));
}

input[type="range"].range-slim::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 0 3px var(--accent-soft);
    transition: transform 0.12s;
}

input[type="range"].range-slim:hover::-webkit-slider-thumb { transform: scale(1.12); }

/* ---------- Highlight (marker) ---------- */
.highlight-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.highlight-preview-pill {
    padding: 1px 6px;
    border-radius: 3px;
    background: #FACC15;
    color: #111;
    font-size: 10.5px;
    font-weight: 700;
    opacity: 0.4;
    transition: opacity 0.15s;
}

.row-toggle.highlight-enabled .highlight-preview-pill { opacity: 1; }

.row-highlight-color.is-disabled,
.marker-style.is-disabled { opacity: 0.4; pointer-events: none; }

.marker-style { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.marker-style .btn { margin-top: 6px; }

.select-ctl {
    flex: 0 1 170px;
    min-width: 110px;
    height: 28px;
    padding: 0 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s;
}

.select-ctl:focus { outline: none; border-color: var(--accent); }

.font-picker { position: relative; flex: 0 1 170px; min-width: 110px; }
.font-picker-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    text-align: start;
}
.font-picker-btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-picker-pop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    width: 230px;
    max-width: calc(100vw - 24px);
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-pop);
}
.font-picker-search {
    width: 100%;
    height: 26px;
    padding: 0 8px;
    margin-bottom: 4px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
}
.font-picker-search:focus { outline: none; border-color: var(--accent); }
.font-picker-list { max-height: 190px; overflow-y: auto; }
.font-picker-item {
    padding: 5px 8px;
    border-radius: var(--r-sm);
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.font-picker-item:hover { background: var(--surface-2); }
.font-picker-item.active { background: var(--accent-grad); color: #fff; }
.font-picker-empty { padding: 8px; font-size: 11.5px; color: var(--text-3); }

.highlight-color-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    direction: ltr;
}

.color-swatch,
.custom-color-picker-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
}

.color-swatch { background: var(--swatch-color); }
.color-swatch { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset; }
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--swatch-color); }

.custom-color-picker-wrap { position: relative; display: inline-flex; }

.custom-color-picker-btn {
    background: conic-gradient(#EF4444, #F59E0B, #10B981, #3B82F6, #8B5CF6, #EC4899, #EF4444);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
}

.custom-color-picker-btn:hover { transform: scale(1.1); }
.custom-color-picker-btn.popover-open { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text-2); }

/* ---------- Color popover ---------- */
.highlight-color-popover {
    margin-top: 8px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-pop);
    animation: viewIn 0.16s var(--ease);
}

.popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.popover-title { font-size: 11.5px; font-weight: 600; }

.popover-close-btn,
.btn-modal-close {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    color: var(--text-3);
    cursor: pointer;
}

.popover-close-btn:hover,
.btn-modal-close:hover { background: var(--surface-2); color: var(--text); }

.color-sv-field {
    position: relative;
    height: 100px;
    margin-bottom: 8px;
    border-radius: var(--r-sm);
    overflow: hidden;
    cursor: crosshair;
    background-color: #F00;
    background-image: linear-gradient(to right, #fff, rgba(255, 255, 255, 0)), linear-gradient(to top, #000, rgba(0, 0, 0, 0));
}

.color-sv-cursor {
    position: absolute;
    top: 0;
    left: 100%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.color-hue-bar {
    position: relative;
    height: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    cursor: pointer;
    background: linear-gradient(to right, #F00 0%, #FF0 17%, #0F0 33%, #0FF 50%, #00F 67%, #F0F 83%, #F00 100%);
}

.color-hue-cursor {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.color-inputs-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    direction: ltr;
}

.color-preview-box {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: var(--r-sm);
    background: #FACC15;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.color-hex-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    height: 26px;
    padding: 0 8px;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
}

.color-hex-wrap:focus-within { border-color: var(--accent); }

.color-hex-prefix { color: var(--text-3); font-family: var(--mono); font-size: 11px; margin-right: 2px; }

.color-hex-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--mono);
    font-size: 11.5px;
    text-transform: uppercase;
    user-select: text;
    -webkit-user-select: text;
}

.btn-color-eyedropper,
.btn-color-system {
    height: 26px;
    padding: 0 8px;
    align-items: center;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 11px;
    cursor: pointer;
}

.btn-color-eyedropper:hover,
.btn-color-system:hover { color: var(--text); background: var(--surface-3); }

.color-presets-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 5px;
    margin-bottom: 10px;
    direction: ltr;
}

.color-mini-swatch {
    aspect-ratio: 1;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: var(--swatch-c);
    cursor: pointer;
    transition: transform 0.12s;
}

.color-mini-swatch:hover { transform: scale(1.15); }
.color-mini-swatch.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px #fff; }

/* ---------- Results & progress ---------- */
.results {
    margin-bottom: var(--gap);
    padding: 9px 11px;
    background: var(--ok-soft);
    border: 1px solid rgba(63, 185, 80, 0.3);
    border-radius: var(--r);
    color: var(--text);
    font-size: 11.5px;
}

.results b { color: #7EE08A; font-weight: 700; }

.progress-area {
    margin-top: var(--gap);
    padding: 11px 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-card);
}

.progress-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--text-2);
}

#progressPercent { font-family: var(--mono); color: var(--text); direction: ltr; }

.progress-track { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.progress-bar { width: 0; height: 100%; background: linear-gradient(90deg, #3B7BF6, #7DB1FF); box-shadow: 0 0 10px var(--accent-glow); border-radius: 2px; transition: width 0.25s var(--ease); }

/* ---------- Animations view ---------- */
.anim-preview-grid {
    --anim-cycle-duration: 2.6s;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.anim-preview-card {
    position: relative;
    display: block;
    padding: 0;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.2s, transform 0.15s;
}

.anim-preview-card:hover { border-color: rgba(255, 255, 255, 0.2); transform: translateY(-1px); }
.anim-preview-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -8px var(--accent-glow); }

.anim-card-viewport {
    height: 110px;
    padding-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg);
}

.anim-preview-card.active .anim-card-viewport { background: radial-gradient(circle at 50% 40%, #182a4d, #0F1626); }

.anim-sample-element {
    padding: 6px 16px;
    border-radius: 6px;
    background: var(--surface-3);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    pointer-events: none;
    will-change: transform, opacity, filter;
}

.anim-preview-card.active .anim-sample-element { background: var(--accent-grad); box-shadow: 0 6px 16px -4px var(--accent-glow); }

.anim-card-name {
    position: absolute;
    inset: auto 0 0 0;
    padding: 5px 4px 6px;
    font-size: 11.5px;
    line-height: 1.3;
    color: var(--text-2);
    text-align: center;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
    pointer-events: none;
}
.anim-preview-card.active .anim-card-name { color: var(--text); font-weight: 600; }

.anim-sample-pop { animation: tileAnimPop var(--anim-cycle-duration) cubic-bezier(0.22, 1, 0.36, 1) infinite; }
.anim-sample-slide { animation: tileAnimSlide var(--anim-cycle-duration) cubic-bezier(0.16, 1, 0.3, 1) infinite; }
.anim-sample-zoom { animation: tileAnimZoom var(--anim-cycle-duration) cubic-bezier(0.16, 1, 0.3, 1) infinite; }
.anim-sample-fade { animation: tileAnimFade var(--anim-cycle-duration) cubic-bezier(0.4, 0, 0.2, 1) infinite; }

.with-motion-blur .anim-sample-pop { animation-name: tileAnimPopBlur; }
.with-motion-blur .anim-sample-slide { animation-name: tileAnimSlideBlur; }
.with-motion-blur .anim-sample-zoom { animation-name: tileAnimZoomBlur; }

@keyframes tileAnimPop {
    0% { transform: scale(0.35); opacity: 0; }
    18% { transform: scale(1.12); opacity: 1; }
    28% { transform: scale(0.97); }
    38%, 72% { transform: scale(1); opacity: 1; }
    86%, 100% { transform: scale(0.35); opacity: 0; }
}

@keyframes tileAnimSlide {
    0% { transform: translateY(30px); opacity: 0; }
    20% { transform: translateY(0); opacity: 1; }
    72% { transform: translateY(0); opacity: 1; animation-timing-function: cubic-bezier(0.55, 0, 0.9, 0.4); }
    84% { transform: translateY(-18px); opacity: 0; }
    100% { transform: translateY(30px); opacity: 0; }
}

@keyframes tileAnimZoom {
    0% { transform: scale(0.6); opacity: 0; }
    20%, 72% { transform: scale(1); opacity: 1; }
    86% { transform: scale(1.22); opacity: 0; }
    100% { transform: scale(0.6); opacity: 0; }
}

@keyframes tileAnimFade {
    0% { opacity: 0; }
    20%, 72% { opacity: 1; }
    88%, 100% { opacity: 0; }
}

@keyframes tileAnimPopBlur {
    0% { transform: scale(0.35); opacity: 0; filter: blur(1.2px); }
    18% { transform: scale(1.12); opacity: 1; filter: blur(0); }
    28% { transform: scale(0.97); }
    38%, 72% { transform: scale(1); opacity: 1; filter: blur(0); }
    86% { transform: scale(0.35); opacity: 0; filter: blur(1.2px); }
    100% { transform: scale(0.35); opacity: 0; filter: blur(0); }
}

@keyframes tileAnimSlideBlur {
    0% { transform: translateY(30px) scaleY(1.12); opacity: 0; filter: blur(1.2px); }
    20% { transform: translateY(0) scaleY(1); opacity: 1; filter: blur(0); }
    72% { transform: translateY(0) scaleY(1); opacity: 1; filter: blur(0); animation-timing-function: cubic-bezier(0.55, 0, 0.9, 0.4); }
    84% { transform: translateY(-18px) scaleY(1.08); opacity: 0; filter: blur(1.2px); }
    100% { transform: translateY(30px); opacity: 0; filter: blur(0); }
}

@keyframes tileAnimZoomBlur {
    0% { transform: scale(0.6); opacity: 0; filter: blur(1.2px); }
    20%, 72% { transform: scale(1); opacity: 1; filter: blur(0); }
    86% { transform: scale(1.22); opacity: 0; filter: blur(1.2px); }
    100% { transform: scale(0.6); opacity: 0; filter: blur(0); }
}

.anim-success-pill {
    margin-bottom: 8px;
    padding: 8px 11px;
    background: var(--ok-soft);
    border: 1px solid rgba(63, 185, 80, 0.3);
    border-radius: var(--r);
    color: #7EE08A;
    font-size: 11.5px;
    text-align: center;
}

.anim-success-pill.fade-in { animation: viewIn 0.2s var(--ease); }
.anim-success-pill.fade-out { animation: fadeOut 0.3s ease-in forwards; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ---------- Sub-views (log, caption editor) ---------- */
.subview-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.btn-back {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text-2);
    cursor: pointer;
}

.btn-back:hover { color: var(--text); background: var(--surface-2); }

.subview-title { font-size: 13px; font-weight: 600; flex: 1; }
.subview-meta { font-size: 11px; color: var(--text-3); }
.subview-actions { display: flex; gap: 4px; }

.btn-log-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 11px;
    cursor: pointer;
}

.btn-log-action:hover { color: var(--text); background: var(--surface-2); }

.console-box {
    height: calc(100vh - 230px);
    min-height: 200px;
    overflow-y: auto;
    padding: 6px 0;
    background: #0B0D11;
    border: 1px solid var(--line);
    border-radius: var(--r);
    font-family: var(--mono);
    font-size: 10.5px;
    user-select: text;
    -webkit-user-select: text;
}

.log-entry {
    display: flex;
    gap: 8px;
    padding: 3px 10px;
    line-height: 1.5;
    color: var(--text-2);
}

.log-time { color: var(--text-3); flex-shrink: 0; direction: ltr; }
.log-msg { font-family: var(--font); font-size: 11px; word-break: break-word; }
.log-success .log-msg { color: #7EE08A; }
.log-error { background: var(--err-soft); }
.log-error .log-msg { color: #FF9C95; }
.log-warn .log-msg, .log-warning .log-msg { color: #F1C55B; }
.log-info .log-msg { color: var(--text); }

.log-empty-state { padding: 24px; text-align: center; color: var(--text-3); font-family: var(--font); }

.log-view-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 10.5px;
    color: var(--text-3);
}

.log-status-live { display: inline-flex; align-items: center; gap: 5px; }
.log-status-live::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }

.caption-editor-list {
    max-height: calc(100vh - 250px);
    min-height: 160px;
    overflow-y: auto;
    margin: 10px 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}

.caption-editor-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
}

.caption-editor-row + .caption-editor-row { border-top: 1px solid var(--line); }

.caption-time-btn {
    flex-shrink: 0;
    height: 22px;
    padding: 0 6px;
    background: var(--surface-2);
    border: none;
    border-radius: 4px;
    color: var(--accent-text);
    font-family: var(--mono);
    font-size: 10px;
    cursor: pointer;
    direction: ltr;
}

.caption-time-btn:hover { background: var(--accent-soft); }

.caption-text-input {
    flex: 1;
    min-width: 0;
    height: 28px;
    padding: 0 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font);
    font-size: 12px;
    user-select: text;
    -webkit-user-select: text;
}

.caption-text-input:hover { background: var(--surface-2); }
.caption-text-input:focus { background: var(--bg); border-color: var(--accent); }

/* ---------- Footer ---------- */
.app-footer {
    margin-top: auto;
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-3);
    font-size: 10.5px;
}

.footer-credit {
    direction: ltr;
    letter-spacing: 0.04em;
    opacity: 0.8;
}

.btn-version-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 7px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--text-3);
    font-family: var(--mono);
    font-size: 10px;
    cursor: pointer;
    direction: ltr;
}

.btn-version-pill:hover { color: var(--text-2); border-color: var(--line-strong); }
.btn-version-pill.has-update { color: var(--accent-text); border-color: rgba(59, 120, 240, 0.45); }

.version-update-ping { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.spin-icon.spinning { animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Update banner ---------- */
.update-banner {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    padding: 9px 10px;
    background: linear-gradient(180deg, rgba(59, 123, 246, 0.2), rgba(59, 123, 246, 0.08));
    border: 1px solid rgba(90, 157, 255, 0.35);
    border-radius: var(--r-lg);
    box-shadow: 0 8px 24px -10px var(--accent-glow);
    animation: viewIn 0.2s var(--ease);
}

.update-banner-main { display: flex; align-items: center; gap: 8px; }
.update-banner-info { flex: 1; min-width: 0; }
.update-title-line { display: flex; align-items: center; gap: 6px; }
.update-main-title { font-size: 12px; font-weight: 600; }

.update-vtag {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--accent-text);
    direction: ltr;
}

.update-notes-preview {
    font-size: 10.5px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.update-banner-actions { display: flex; align-items: center; gap: 4px; }

.btn-update-apply,
.btn-update-details {
    height: 24px;
    padding: 0 9px;
    border: none;
    border-radius: var(--r-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.btn-update-apply { background: var(--accent-grad); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset; }
.btn-update-apply:hover { background: var(--accent-grad-hover); }
.btn-update-details { background: transparent; color: var(--text-2); }
.btn-update-details:hover { color: var(--text); }

.btn-update-close {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    color: var(--text-3);
    cursor: pointer;
}

.btn-update-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.update-progress-wrap { flex-direction: column; gap: 5px; margin: 10px 0 4px; }
.update-banner .update-progress-wrap { margin: 0; }

.update-progress-head { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-2); }
.update-progress-pct { font-family: var(--mono); direction: ltr; }
.update-progress-track { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.update-progress-fill { width: 0; height: 100%; background: linear-gradient(90deg, #3B7BF6, #7DB1FF); transition: width 0.25s var(--ease); }

/* ---------- Modals ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 7, 12, 0.66);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.15s ease-out;
}

.modal-card {
    width: 100%;
    max-width: 360px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 50%), var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    box-shadow: var(--shadow-pop);
    animation: modalIn 0.18s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.modal-title { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.modal-desc { font-size: 11.5px; color: var(--text-2); margin-bottom: 12px; }

.modal-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }

.update-modal-ver-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 11px;
}

.update-vtag-new {
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 600;
}

.update-vtag-cur { color: var(--text-3); }

.update-changelog-box {
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.update-changelog-header { font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }

.update-changelog-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 180px;
    overflow-y: auto;
    font-size: 11.5px;
}

.update-changelog-list li { position: relative; padding-right: 12px; }

.update-changelog-list li::before {
    content: "";
    position: absolute;
    right: 0;
    top: 7px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

/* Feedback form */
.pfb-group { margin-bottom: 10px; }
.pfb-label { display: block; font-size: 11px; color: var(--text-2); margin-bottom: 5px; }
.req { color: var(--err); }

.pfb-type-pill input { position: absolute; opacity: 0; pointer-events: none; }

.pfb-textarea,
.pfb-input {
    width: 100%;
    padding: 8px 9px;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 12px;
    resize: vertical;
    user-select: text;
    -webkit-user-select: text;
    transition: border-color 0.15s;
}

.pfb-input { height: var(--h); }
.pfb-textarea::placeholder, .pfb-input::placeholder { color: var(--text-3); }
.pfb-textarea:focus, .pfb-input:focus { border-color: var(--accent); }

.pfb-status { margin-top: 10px; padding: 8px 10px; border-radius: var(--r-sm); font-size: 11.5px; }
.pfb-status.success { background: var(--ok-soft); color: #7EE08A; }
.pfb-status.error { background: var(--err-soft); color: #FF9C95; }

/* ---------- Narrow panels ---------- */
@media (max-width: 330px) {
    .row .scope-selector > button { padding: 0 6px; }
    .slider-control-wrap { flex-basis: 130px; }
    .color-swatch, .custom-color-picker-btn { width: 16px; height: 16px; }
}

/* ---------- Error toast ---------- */
.error-toast {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1000;
    display: none; padding: 10px 12px; border-radius: 8px; cursor: pointer;
    background: #7f1d1d; color: #fff; font-size: 12px; line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}


/* Collapsible groups */
.fold > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 42px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text); user-select: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; width: 7px; height: 7px; margin-inline-start: auto; border-right: 1.6px solid var(--text-3); border-bottom: 1.6px solid var(--text-3); transform: rotate(45deg); transition: transform 0.15s var(--ease); }
.fold[open] > summary::after { transform: rotate(-135deg); }
.fold > summary:hover .fold-title { color: var(--accent-hover); }
.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold > * + * { border-top: 1px solid var(--line); }
.fold > summary + * { border-top: 0; }
.fold-chip { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; color: #4ADE80; background: rgba(74,222,128,0.12); }
.fold-chip-accent { color: var(--accent-text); background: var(--accent-soft); }
.fold-chip:empty { display: none; }
.fold-chip.is-unsafe { color: #F87171; background: rgba(248,113,113,0.12); }
.actions-sticky { position: sticky; bottom: 0; z-index: 5; padding: 10px 0 8px; margin-top: 4px; background: linear-gradient(to top, var(--bg) 70%, rgba(0,0,0,0)); animation: none !important; }

/* Safe zones (Instagram / TikTok / YouTube Shorts) */
.sz-platforms { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(255,255,255,0.05); margin-top: 8px; }
.sz-plat { flex: 1; border: 0; background: transparent; color: var(--text-2, #aab); font: inherit; font-size: 11.5px; font-weight: 600; padding: 6px 4px; border-radius: 7px; cursor: pointer; }
.sz-plat.active { background: #3B7BF6; color: #fff; }
.safezone { display: flex; gap: 14px; align-items: center; padding: 12px 0; }
.safezone-phone { position: relative; flex: 0 0 84px; height: 150px; border-radius: 10px; background: #0F1218; border: 1px solid rgba(255,255,255,0.14); overflow: hidden; cursor: crosshair; touch-action: none; }
.sz-zone { position: absolute; left: 0; right: 0; pointer-events: none; background: repeating-linear-gradient(135deg, rgba(239,68,68,0.34) 0 3px, rgba(239,68,68,0.14) 3px 6px); }
.sz-top { top: 0; height: 14%; }
.sz-bottom { bottom: 0; height: 35%; }
.sz-side { top: 14%; bottom: 35%; width: 6%; }
.sz-side-l { left: 0; right: auto; }
.sz-side-r { right: 0; left: auto; }
.sz-cap { position: absolute; width: 56%; height: 7px; border-radius: 4px; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 0 0 1px rgba(0,0,0,0.6); pointer-events: none; }
.safezone.is-unsafe .sz-cap { background: #F87171; }
.safezone-side { flex: 1; display: flex; flex-direction: column; gap: 6px; justify-content: center; min-width: 0; }
.safezone-status { font-size: 12px; font-weight: 700; color: #4ADE80; }
.safezone.is-unsafe .safezone-status { color: #F87171; }
.safezone-hint { font-size: 10.5px; color: var(--text-3); line-height: 1.35; }
.safezone.is-unsafe #btnSzSnap { border-color: #F87171; }
