/* =====================================================================
   Free-Screen-Visuals — Styles
   Light, minimal UI (white, light grey, hairline borders, round corners)
   ===================================================================== */

:root {
    --bg: #f9f9f9;
    --surface: #ffffff;
    --surface-2: #f4f4f4;
    --hover: #efefef;
    --border: #e5e5e5;
    --border-strong: #d4d4d4;
    --text: #0d0d0d;
    --muted: #6b6b6b;
    --faint: #9b9b9b;
    --primary: #0d0d0d;
    --primary-text: #ffffff;
    --focus: rgba(13, 13, 13, .12);
    --danger: #d93025;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .05);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
    --ui-font: 'Inter', 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }

.fsv-body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--ui-font);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Page layout ---------- */

.fsv-app {
    --stage-w: min(calc(var(--fsv-width, 86) * 1vw), calc(100vw - 32px), calc((100dvh - 104px) * var(--fsv-ratio-num, 1.7778)));
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px;
}

.fsv-stage {
    position: relative;
    width: var(--stage-w);
    aspect-ratio: var(--fsv-ratio, 16 / 9);
}

.fsv-app.is-fill { height: 100dvh; }
.fsv-app.is-fill .fsv-stage {
    --stage-w: min(calc(var(--fsv-width, 86) * 1vw), calc(100vw - 32px));
    flex: 1 1 auto;
    aspect-ratio: auto;
    min-height: 200px;
}

.fsv-screen {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: #0b0b0b;
    border: 1px solid rgba(0, 0, 0, .08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .08);
}

.fsv-stage:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; background: #000; }
.fsv-stage:fullscreen .fsv-screen { border-radius: 0; border: 0; box-shadow: none; }
.fsv-stage:-webkit-full-screen { width: 100vw; height: 100vh; background: #000; }

/* ---------- Video ---------- */

.fsv-video, .fsv-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fsv-video iframe.is-cover {
    inset: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.fsv-dim { position: absolute; inset: 0; background: #000; pointer-events: none; transition: opacity .2s; }
.fsv-empty { display: grid; place-items: center; height: 100%; color: #8a8a8a; font-size: 15px; }

/* ---------- Overlay (layouts render inside .fsv-overlay-body) ---------- */

.fsv-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    padding: var(--ov-inset, 6%);
    pointer-events: none;           /* never block YouTube's own controls */
    color: var(--ov-color, #fff);
    font-family: var(--ov-font);
    font-weight: var(--ov-weight, 700);
    font-size: calc(var(--u, 5px) * 4.2 * var(--ov-scale, 1));
    line-height: 1.15;
}

.fsv-overlay-content { max-width: 100%; }
.fsv-overlay-body > :first-child { margin-top: 0; }

/* position (3 × 3 grid) */
.ov-pos-top-left      { justify-content: flex-start; align-items: flex-start; text-align: left; }
.ov-pos-top-center    { justify-content: center;     align-items: flex-start; text-align: center; }
.ov-pos-top-right     { justify-content: flex-end;   align-items: flex-start; text-align: right; }
.ov-pos-middle-left   { justify-content: flex-start; align-items: center;     text-align: left; }
.ov-pos-center        { justify-content: center;     align-items: center;     text-align: center; }
.ov-pos-middle-right  { justify-content: flex-end;   align-items: center;     text-align: right; }
.ov-pos-bottom-left   { justify-content: flex-start; align-items: flex-end;   text-align: left; }
.ov-pos-bottom-center { justify-content: center;     align-items: flex-end;   text-align: center; }
.ov-pos-bottom-right  { justify-content: flex-end;   align-items: flex-end;   text-align: right; }
/* keep clear of YouTube's control bar when text sits at the bottom */
.fsv-overlay[class*="ov-pos-bottom"] { padding-bottom: max(var(--ov-inset, 6%), 56px); }

/* shadow */
.ov-shadow-soft    { text-shadow: 0 .04em .25em rgba(0, 0, 0, .45); }
.ov-shadow-strong  { text-shadow: 0 .05em .1em rgba(0, 0, 0, .7), 0 .1em .6em rgba(0, 0, 0, .6); }
.ov-shadow-glow    { text-shadow: 0 0 .3em var(--ov-accent), 0 0 .8em var(--ov-accent); }
.ov-shadow-outline { text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 .05em .3em rgba(0, 0, 0, .5); }

/* backdrop card */
.ov-card-glass, .ov-card-dark, .ov-card-light { padding: .7em 1em; border-radius: .55em; }
.ov-card-glass { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
.ov-card-dark  { background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ov-card-light { background: rgba(255, 255, 255, .88); box-shadow: 0 .2em 1em rgba(0, 0, 0, .15); }

/* animation */
.ov-anim-fade  { animation: ov-fade .8s ease both; }
.ov-anim-rise  { animation: ov-rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.ov-anim-zoom  { animation: ov-zoom .8s cubic-bezier(.2, .8, .2, 1) both; }
.ov-anim-pulse { animation: ov-fade .6s ease both, ov-pulse 3s ease-in-out .6s infinite; }
.ov-anim-float { animation: ov-fade .6s ease both, ov-float 6s ease-in-out .6s infinite; }

@keyframes ov-fade  { from { opacity: 0; } }
@keyframes ov-rise  { from { opacity: 0; transform: translateY(.6em); } }
@keyframes ov-zoom  { from { opacity: 0; transform: scale(.85); } }
@keyframes ov-pulse { 50% { transform: scale(1.035); } }
@keyframes ov-float { 50% { transform: translateY(-.25em); } }

@media (prefers-reduced-motion: reduce) {
    .fsv-overlay-content { animation: none !important; }
}

/* ---------- Hover toolbar ---------- */

.fsv-toolbar {
    position: absolute;
    top: 12px;
    left: 50%;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 2px;
    max-width: calc(100% - 24px);
    padding: 4px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .10);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transform: translate(-50%, -6px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.fsv-stage.is-active .fsv-toolbar { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

.fsv-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: 500 13.5px/1 var(--ui-font);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .12s;
}
.fsv-tool:hover { background: var(--hover); }
.fsv-tool.is-open { background: #e8e8e8; }
.fsv-tool.is-disabled { opacity: .4; pointer-events: none; }
.fsv-tool-icon { padding: 0 9px; }
.fsv-tool-sep { width: 1px; height: 18px; margin: 0 3px; background: var(--border); flex: none; }
.fsv-stage.is-compact .fsv-tool span { display: none; }
.fsv-stage.is-compact .fsv-tool { padding: 0 9px; }

.fsv-icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fsv-tool[data-tool="channel"] .fsv-icon { color: #ff0033; }

/* top-edge strip that brings the toolbar back (mouse moves over the iframe can't be seen) */
.fsv-hotzone { position: absolute; top: 0; left: 0; right: 0; height: 64px; z-index: 15; }
.fsv-stage.is-idle, .fsv-stage.is-idle .fsv-hotzone { cursor: none; }
@media (hover: none) { .fsv-hotzone { display: none; } }

/* file:// warning (YouTube Error 153) */
.fsv-notice { position: absolute; inset: 0; z-index: 12; display: grid; place-items: center; padding: 16px; background: rgba(10, 10, 10, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: auto; }
.fsv-notice-card { width: min(440px, 100%); padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); color: var(--text); font: 13.5px/1.5 var(--ui-font); }
.fsv-notice-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.fsv-notice-card p, .fsv-notice-card ol { margin: 0 0 10px; color: #3d3d3d; }
.fsv-notice-card ol { padding-left: 20px; }
.fsv-notice-card li + li { margin-top: 4px; }
.fsv-notice-card code { padding: 1px 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); font: 12px 'JetBrains Mono', ui-monospace, monospace; }
.fsv-notice-alt { font-size: 12.5px; color: var(--muted) !important; }
.fsv-notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fsv-notice-actions a { text-decoration: none; }

/* touch devices: a small handle replaces hover */
.fsv-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 21;
    display: none;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: var(--text);
    cursor: pointer;
}
@media (hover: none) {
    .fsv-handle { display: grid; }
    .fsv-toolbar { left: 10px; top: 10px; max-width: calc(100% - 64px); overflow-x: auto; scrollbar-width: none; transform: translate(0, -6px); }
    .fsv-stage.is-active .fsv-toolbar { transform: translate(0, 0); }
    .fsv-stage.is-active .fsv-handle { opacity: .6; }
}

/* ---------- Settings panel ---------- */

.fsv-panel {
    position: fixed;
    z-index: 50;
    width: 360px;
    max-width: calc(100vw - 24px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    font-family: var(--ui-font);
    animation: fsv-pop .14s ease;
}
@keyframes fsv-pop { from { opacity: 0; transform: translateY(-4px); } }

.fsv-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 12px 18px;
    border-bottom: 1px solid var(--border);
}
.fsv-panel-title { font-size: 15px; font-weight: 600; }
.fsv-panel-sub { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.fsv-panel-body { overflow-y: auto; padding: 4px 18px 16px; overscroll-behavior: contain; }
.fsv-panel-foot { padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border); }

.fsv-section { padding: 12px 0 4px; }
.fsv-section + .fsv-section { border-top: 1px solid var(--border); }
.fsv-section-title { margin: 0 0 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }

.fsv-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.fsv-icon-btn:hover { background: var(--hover); color: var(--text); }

/* ---------- Form controls ---------- */

.fsv-form { display: flex; flex-direction: column; gap: 14px; }
.fsv-field { display: flex; flex-direction: column; gap: 6px; }
.fsv-label { font-size: 12.5px; font-weight: 500; color: #4d4d4d; }
.fsv-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.fsv-range-value { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fsv-hint, .fsv-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }

.fsv-input {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: 14px/1.4 var(--ui-font);
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}
.fsv-input:hover { border-color: var(--border-strong); }
.fsv-input:focus { border-color: #a8a8a8; box-shadow: 0 0 0 3px var(--focus); }
.fsv-input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(217, 48, 37, .12); }
textarea.fsv-input { resize: vertical; min-height: 64px; }
select.fsv-input {
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.fsv-range { width: 100%; margin: 4px 0; accent-color: var(--primary); cursor: pointer; }

.fsv-color { display: flex; gap: 8px; }
.fsv-color input[type="color"] {
    width: 44px;
    height: 38px;
    flex: none;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}
.fsv-color-hex { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; text-transform: lowercase; }

.fsv-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 13.5px; }
.fsv-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.fsv-toggle i { position: relative; width: 36px; height: 20px; flex: none; border-radius: 999px; background: #d9d9d9; transition: background .15s; }
.fsv-toggle i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.fsv-toggle input:checked + i { background: var(--primary); }
.fsv-toggle input:checked + i::after { transform: translateX(16px); }
.fsv-toggle input:focus-visible + i { box-shadow: 0 0 0 3px var(--focus); }

.fsv-position { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 132px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.fsv-position button { display: grid; place-items: center; height: 30px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.fsv-position button i { width: 8px; height: 8px; border-radius: 50%; background: #c4c4c4; }
.fsv-position button:hover { background: #e6e6e6; }
.fsv-position button.is-on { background: var(--surface); box-shadow: var(--shadow-sm); }
.fsv-position button.is-on i { background: var(--primary); width: 10px; height: 10px; }

.fsv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: 500 13.5px/1 var(--ui-font);
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.fsv-btn-primary { background: var(--primary); color: var(--primary-text); }
.fsv-btn-primary:hover { background: #2b2b2b; }
.fsv-btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.fsv-btn-secondary:hover { background: var(--surface-2); }
.fsv-btn-ghost { background: transparent; color: var(--muted); padding: 0 10px; }
.fsv-btn-ghost:hover { background: var(--hover); color: var(--text); }
.fsv-btn-block { width: 100%; margin-top: 14px; }

/* ---------- Image picker ---------- */

.fsv-image { display: flex; gap: 12px; align-items: center; }
.fsv-image-preview {
    position: relative; width: 84px; height: 84px; flex: none; display: grid; place-items: center; overflow: hidden;
    border: 1px dashed var(--border-strong); border-radius: 12px;
    background: repeating-conic-gradient(#f1f1f1 0 25%, #fafafa 0 50%) 50% / 14px 14px;
}
.fsv-image-preview img { display: none; max-width: 100%; max-height: 100%; object-fit: contain; }
.fsv-image-preview span { font-size: 11px; color: var(--faint); }
.fsv-field-image.has-image .fsv-image-preview { border-style: solid; border-color: var(--border); }
.fsv-field-image.has-image .fsv-image-preview img { display: block; }
.fsv-field-image.has-image .fsv-image-preview span { display: none; }
.fsv-image-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.fsv-image-actions .fsv-icon { width: 15px; height: 15px; }
.fsv-image-url { font-size: 13px; }
.fsv-image-msg:empty { display: none; }
.fsv-btn:disabled { opacity: .5; cursor: default; }

/* ---------- Repeating list (e.g. products) ---------- */

.fsv-list { display: flex; flex-direction: column; gap: 8px; }
.fsv-list-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.fsv-list-item[open] { box-shadow: var(--shadow-sm); }
.fsv-list-item > summary { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 500; }
.fsv-list-item > summary::-webkit-details-marker { display: none; }
.fsv-list-item > summary::before { content: '›'; display: inline-block; width: 10px; color: var(--faint); transition: transform .15s; }
.fsv-list-item[open] > summary::before { transform: rotate(90deg); }
.fsv-list-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsv-list-tools { display: flex; gap: 2px; }
.fsv-list-tools button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.fsv-list-tools button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.fsv-list-tools button:disabled { opacity: .3; cursor: default; }
.fsv-list-tools .fsv-icon { width: 15px; height: 15px; }
.fsv-list-item > .fsv-form { padding: 4px 12px 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.fsv-list-add { margin-top: 8px; }

/* ---------- Layout picker ---------- */

.fsv-layout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 14px; }
.fsv-layout-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    text-align: left;
    font-family: var(--ui-font);
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.fsv-layout-card:hover { background: var(--surface-2); }
.fsv-layout-card.is-on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.fsv-layout-icon { font-size: 18px; line-height: 1; margin-bottom: 4px; }
.fsv-layout-name { font-size: 13.5px; font-weight: 600; }
.fsv-layout-desc { font-size: 12px; line-height: 1.35; color: var(--muted); }

/* ---------- Video list ---------- */

.fsv-video-list { display: flex; flex-direction: column; gap: 6px; }
.fsv-video-item { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid transparent; border-radius: 12px; transition: background .12s; }
.fsv-video-item:hover { background: var(--surface-2); }
.fsv-video-item.is-on { border-color: var(--border); background: var(--surface-2); }
.fsv-video-pick { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; font-family: var(--ui-font); color: var(--text); cursor: pointer; }
.fsv-video-pick img { width: 84px; height: 47px; flex: none; object-fit: cover; border-radius: 8px; background: #e9e9e9; }
.fsv-video-item.is-on img { outline: 2px solid var(--primary); outline-offset: 1px; }
.fsv-video-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fsv-video-title { font-size: 13px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fsv-video-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsv-add-video { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- Caption under the player ---------- */

.fsv-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: var(--stage-w);
    max-width: 100%;
    min-height: 36px;
}
.fsv-caption-text { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.fsv-caption-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsv-caption-chip { flex: none; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12px; color: var(--text); }
.fsv-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #10a37f; box-shadow: 0 0 0 3px rgba(16, 163, 127, .15); }
.fsv-caption-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: 500 13px/1 var(--ui-font);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.fsv-caption-btn:hover { background: var(--surface-2); }
.fsv-caption-btn .fsv-icon { width: 15px; height: 15px; }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
    .fsv-app { padding: 12px 16px; justify-content: flex-start; padding-top: max(12px, 6vh); }
    .fsv-screen { border-radius: 12px; }
    .fsv-panel {
        left: 0 !important;
        right: 0;
        bottom: 0;
        top: auto !important;
        width: 100%;
        max-width: none;
        max-height: 75dvh !important;
        border-radius: 18px 18px 0 0;
        border-bottom: 0;
        animation: fsv-sheet .2s ease;
    }
    @keyframes fsv-sheet { from { transform: translateY(24px); opacity: 0; } }
    .fsv-caption-btn span { display: none; }
    .fsv-caption-btn { padding: 0 10px; }
}

/* Very large displays: slightly larger UI chrome */
@media (min-width: 2200px) {
    .fsv-body { font-size: 15px; }
    .fsv-tool { height: 38px; font-size: 14.5px; }
}

/* =====================================================================
   About / SEO section (static HTML below the player)
   ===================================================================== */

.fsv-noscript { max-width: 720px; margin: 24px auto; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: center; }

.fsv-about { max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; color: var(--text); line-height: 1.6; }
.fsv-about h1 { margin: 6px 0 12px; font-size: clamp(28px, 4.2vw, 44px); line-height: 1.12; letter-spacing: -.025em; font-weight: 700; }
.fsv-about h2 { margin: 0 0 14px; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -.015em; }
.fsv-about h3 { margin: 0 0 4px; font-size: 15px; }
.fsv-about p { margin: 0 0 10px; }
.fsv-kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fsv-lead { font-size: 17px; color: #3a3a3a; max-width: 760px; }
.fsv-about-hero { padding: 32px 0 8px; border-top: 1px solid var(--border); }
.fsv-about-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.fsv-about-nav a { padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 13.5px; }
.fsv-about-nav a:hover { background: var(--surface-2); }
.fsv-about-block { padding: 36px 0 4px; scroll-margin-top: 16px; }
.fsv-video-lead { color: var(--muted); max-width: 640px; }
.fsv-about-video { max-width: 400px; margin: 18px auto 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #000; box-shadow: 0 12px 32px rgba(0, 0, 0, .08); }
.fsv-about-video video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; background: #fff; }

.fsv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.fsv-cards li { padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.fsv-cards p { margin: 0; font-size: 14px; color: var(--muted); }

.fsv-steps { margin: 0; padding-inline-start: 22px; }
.fsv-steps li { margin-bottom: 8px; padding-inline-start: 4px; }
.fsv-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.fsv-features li { position: relative; padding-inline-start: 22px; font-size: 14.5px; }
.fsv-features li::before { content: ''; position: absolute; inset-inline-start: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: #10a37f; }

.fsv-about details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 8px; }
.fsv-about summary { padding: 13px 16px; font-weight: 500; cursor: pointer; list-style-position: inside; }
.fsv-about details p { padding: 0 16px 14px; margin: 0; color: #3d3d3d; }

.fsv-tip { margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: #eef7f3; border: 1px solid #cfe9df; font-size: 14px; color: #24493d; }
.fsv-about-foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }

/* ---------- Save & load panel ---------- */
.fsv-file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.fsv-file-actions .fsv-icon { width: 15px; height: 15px; }
.fsv-file-msg:empty { display: none; }
