/* Staged Clipping Agent intake. Its shell stays visually stationary while a
   source uploads, then hands off to a viewport-level configuration workspace. */
.sp-intake {
    width: min(100%, 1080px);
    overflow: visible;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Keep state panels truly absent until the intake runtime opts into them. */
.sp-intake [hidden] { display: none !important; }
.sp-config-panel[hidden] { display: none !important; }

.sp-intake-header {
    display: block;
    margin-bottom: 18px;
    text-align: center;
}

.sp-intake-eyebrow,
.sp-intake-header p,
.sp-intake-step { display: none; }

.sp-intake h1,
.sp-intake h2 {
    color: var(--v2-white, var(--text-main));
    font-family: 'Manrope', sans-serif;
}

.sp-intake h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.2rem);
    line-height: 1.1;
    letter-spacing: -.035em;
}
#clipping-intake-title { font-family: 'Outfit', sans-serif; font-weight: 800; }

.sp-intake h2 {
    margin: .35rem 0 0;
    font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.sp-intake-body { min-width: 0; }
.sp-intake-source-column { width: 100%; max-width: 720px; margin: 0 auto; }
.sp-intake-source-group { margin: 0; }
.sp-intake-source-group > label { text-transform: none; letter-spacing: 0; font-size: .82rem; }
.sp-intake-source-row { grid-template-columns: minmax(0, 1fr) auto; gap: .7rem; }
.sp-intake-source-row input { min-width: 0; min-height: 48px; }
.sp-intake-source-button { min-height: 48px; padding-inline: 1.35rem; white-space: nowrap; }
.sp-intake-message { min-height: 1.35rem; color: var(--v2-muted, var(--text-muted)); font-size: .82rem; line-height: 1.45; }
.sp-intake-message.is-error { color: var(--v2-red); }
.sp-intake-message.is-success { color: var(--v2-green, var(--accent-green)); }
.sp-intake-message.is-warning { color: var(--v2-amber); }

.sp-intake-dropzone {
    display: grid;
    justify-items: center;
    gap: .55rem;
    margin-top: 0;
    min-height: 184px;
    padding: 24px;
    border: 1px dashed color-mix(in srgb, var(--v2-blue-light, var(--accent-cyan)) 45%, var(--v2-border, var(--border-color)));
    border-radius: 16px;
    color: var(--v2-muted, var(--text-muted));
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.sp-intake-dropzone strong { color: var(--v2-white, var(--text-main)); font-size: 1rem; }
.sp-intake-dropzone > span:not(.sp-intake-drop-icon) { font-size: .8rem; }
.sp-intake-drop-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(0, 242, 254, .35);
    border-radius: 50%;
    color: var(--v2-blue-light, var(--accent-cyan));
    font-size: 1.35rem;
    line-height: 1;
    margin-bottom: 18px;
}
.sp-intake-drop-icon svg { width: 26px; height: 26px; }
.sp-intake-dropzone:hover,
.sp-intake-dropzone:focus-visible,
.sp-intake-dropzone.is-dragover {
    border-color: var(--v2-blue-light, var(--accent-cyan));
    background: rgba(0, 242, 254, .07);
}
.sp-intake-dropzone:focus-visible { outline: 3px solid color-mix(in srgb, var(--v2-blue-light, var(--accent-cyan)) 55%, transparent); outline-offset: 3px; }
.sp-intake-dropzone button { min-height: 44px; margin-top: 8px; }
.sp-intake .source-intake-divider { margin-block: 16px; }
.sp-intake .sp-intake-source-row input,
.sp-intake .sp-intake-source-button { min-height: 46px; }

.sp-intake-upload-status,
.sp-intake-ready {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--v2-border, var(--border-color));
    border-radius: 12px;
    background: var(--v2-fill, rgba(255,255,255,.035));
    color: var(--v2-muted, var(--text-muted));
    font-size: .82rem;
}
.sp-intake-upload-status progress { min-width: 130px; flex: 1; accent-color: var(--v2-blue, var(--accent-cyan)); }
.sp-intake-upload-status button,
.sp-intake-ready button { margin-left: auto; flex: none; min-height: 40px; }
.sp-intake-ready { border-color: color-mix(in srgb, var(--v2-green, var(--accent-green)) 45%, var(--v2-border, var(--border-color))); }
.sp-intake-ready strong { display: block; color: var(--v2-green, var(--accent-green)); }
.sp-intake-ready span span { display: block; margin-top: .2rem; }
.sp-intake-ready-actions { display: flex; align-items: center; gap: .55rem; margin-left: auto; }
.sp-intake-ready-actions button { margin-left: 0; }
.sp-intake.is-ready .sp-intake-dropzone,
.sp-intake.is-ready #clipping-intake-divider,
.sp-intake.is-ready .sp-intake-source-group { display: none; }
.sp-intake.is-ready .sp-intake-ready { margin-top: 0; }
.sp-intake-ready > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sp-intake-upload-status { flex-wrap: wrap; }
.sp-intake-upload-status > span { min-width: 0; overflow-wrap: anywhere; }
.sp-intake:has(#clipping-intake-upload-status:not([hidden])) #clipping-intake-message:not(.is-warning):not(.is-error) { display: none; }

body.sp-config-modal-open { overflow: hidden; }

.sp-config-panel.is-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    width: 100vw;
    height: 100dvh;
    max-width: none !important;
    margin: 0 !important;
    padding: clamp(1rem, 2vw, 1.75rem);
    border: 0;
    border-radius: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg-color, #0d0e12);
    box-shadow: none;
}

.sp-config-panel.is-modal:focus { outline: none; }
.sp-config-panel.is-modal .sp-config-modal-header {
    position: sticky;
    top: calc(-1 * clamp(1rem, 2vw, 1.75rem));
    z-index: 20;
    min-height: 58px;
    margin: calc(-1 * clamp(1rem, 2vw, 1.75rem)) calc(-1 * clamp(1rem, 2vw, 1.75rem)) 0;
    padding: 0 clamp(1rem, 2vw, 1.75rem);
    border-bottom: 1px solid var(--v2-border, var(--border-color));
    background: color-mix(in srgb, var(--bg-color, #0d0e12) 94%, transparent);
    backdrop-filter: blur(18px);
}
.sp-config-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .65rem;
    min-width: 0;
}
.sp-config-render-status[hidden] { display: none !important; }
.sp-config-render-status {
    flex: none;
    max-width: min(42vw, 360px);
}
.sp-config-render-status .slice-loader-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sp-config-panel.is-modal .sp-config-back { min-height: 38px; padding: .55rem .9rem; }
.sp-config-panel.is-modal .panel-columns { align-items: start; }
.sp-config-panel.is-modal .input-group { gap: .5rem; margin-bottom: .25rem; }
.sp-config-panel.is-modal .control-hint { line-height: 1.35; }
.sp-config-panel.is-modal .prompt-textarea { min-height: 70px; }
.sp-config-panel.is-modal #source-range-video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(28dvh, 240px);
    aspect-ratio: auto;
    margin: .15rem auto .25rem;
}
.sp-config-panel.is-modal .source-range-card {
    width: min(100%, 620px);
    margin-top: .55rem;
    padding: .65rem;
}
.sp-config-panel.is-modal #btn-source-range-full {
    flex: none;
    white-space: nowrap;
}
.sp-config-panel.is-modal .preview-container { margin-block: .5rem; }

@media (min-width: 1180px) {
    .sp-config-panel.is-modal .panel-columns {
        display: grid !important;
        grid-template-columns: minmax(420px, 1.2fr) minmax(330px, 1fr) minmax(280px, .78fr);
        gap: clamp(1rem, 2vw, 2rem) !important;
        flex-wrap: nowrap !important;
    }
    .sp-config-panel.is-modal .panel-left,
    .sp-config-panel.is-modal .panel-middle,
    .sp-config-panel.is-modal .panel-right {
        min-width: 0 !important;
    }
    .sp-config-panel.is-modal .panel-right.configuration-preview-panel {
        position: sticky;
        top: 74px;
    }
}

@media (min-width: 1580px) and (min-height: 820px) {
    .sp-config-panel.is-modal .panel-columns {
        grid-template-columns: minmax(440px, 620px) minmax(520px, 1fr) minmax(320px, 460px);
    }
    .sp-config-panel.is-modal .panel-left {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-content: start;
        align-items: start;
        gap: .7rem .85rem;
    }
    .sp-config-panel.is-modal .panel-left > .input-group:first-child,
    .sp-config-panel.is-modal #recreate-smart-trim-group {
        grid-column: 1 / -1;
    }
}

.sp-intake-preview-wrap {
    margin-top: 1.35rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--v2-border, var(--border-color));
}
.sp-intake-preview-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.sp-intake-preview-meta { color: var(--v2-muted, var(--text-muted)); font: .72rem 'JetBrains Mono', monospace; text-align: right; }
.sp-intake-preview-wrap video { display: block; width: 100%; max-height: min(55vh, 470px); border: 1px solid var(--v2-border, var(--border-color)); border-radius: 14px; background: #05070a; object-fit: contain; }
.sp-intake-preview-note { min-height: 1.3rem; margin: .65rem 0 0; color: var(--v2-muted, var(--text-muted)); font-size: .8rem; line-height: 1.45; }
.sp-intake-nojs { margin-top: 1rem; color: var(--v2-muted, var(--text-muted)); font-size: .76rem; }

html[data-theme="light"] .sp-intake {
    background: transparent;
    box-shadow: none;
}
html[data-theme="light"] .sp-intake-dropzone { border-color: rgba(16, 20, 239, .28); }

@media (max-width: 760px) {
    .sp-intake { margin-top: 0; }
    .sp-intake-source-row { grid-template-columns: 1fr; }
    .sp-intake-source-button { width: 100%; }
    .sp-intake-upload-status,
    .sp-intake-ready { align-items: stretch; flex-wrap: wrap; }
    .sp-intake-upload-status progress { order: 3; flex-basis: 100%; min-width: 0; }
    .sp-intake-upload-status button,
    .sp-intake-ready button { margin-left: auto; }
    .sp-intake-ready-actions { width: 100%; margin-left: 0; }
    .sp-intake-ready-actions button { flex: 1 1 140px; margin-left: 0; padding: .7rem .65rem; min-height: 46px; font-size: .88rem; white-space: nowrap; }
    .sp-intake-preview-heading { align-items: flex-start; flex-direction: column; }
    .sp-intake-preview-meta { text-align: left; }

    .sp-intake .sp-intake-dropzone {
        min-height: 184px;
        padding: 24px 16px;
    }

    .sp-config-panel.is-modal .panel-columns { gap: 1rem !important; }
    .sp-config-panel.is-modal .panel-left,
    .sp-config-panel.is-modal .panel-middle,
    .sp-config-panel.is-modal .panel-right {
        min-width: 0 !important;
        flex-basis: 100% !important;
    }

    .sp-config-render-status {
        max-width: 58vw;
    }

    .sp-config-render-status .slice-loader-elapsed {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-intake-dropzone { transition: none; }
}

/* Permission box beside CREATE CLIPS (hosted runtime only). */
.sp-rights-confirm.sp-rights-launch {
    margin: 1.25rem 0 0;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}
.sp-rights-confirm.sp-rights-launch.needs-attention {
    color: var(--v2-white, #fff);
    outline: 2px solid #f87171;
    outline-offset: 6px;
    border-radius: 6px;
}
.sp-rights-hint { margin: .6rem 0 0; color: var(--v2-red); font-size: .82rem; }
.sp-rights-hint[hidden] { display: none; }

/* Clip setup: clear sections, a small starting catalog, and optional detail. */
.sp-config-panel .sp-setup-heading {
    margin: 0 0 1rem;
    color: var(--v2-white, var(--text-main));
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.02em;
}
.sp-config-panel .input-group > label,
.sp-config-panel .mode-guide-label > label {
    text-transform: none;
    letter-spacing: 0;
    font-size: .85rem;
}
.sp-config-panel .input-group { margin-bottom: 1.1rem !important; }
.sp-setup-details {
    margin: .5rem 0 1.25rem;
    border-block: 1px solid var(--v2-border, var(--border-color));
}
.sp-setup-details summary {
    padding: .85rem 0;
    cursor: pointer;
    color: var(--v2-white, var(--text-main));
    font-size: .85rem;
    font-weight: 600;
}
.sp-setup-details summary span {
    display: block;
    margin: .3rem 0 0 1rem;
    color: var(--v2-muted, var(--text-muted));
    font-size: .78rem;
    font-weight: 400;
}
.sp-setup-details[open] summary { margin-bottom: .5rem; }
.sp-config-panel .preset-grid { gap: .5rem; }
.sp-config-panel .preset-grid.is-compact .sp-preset-extra { display: none; }
.sp-selected-caption { margin: 0 0 .6rem; color: var(--v2-muted, var(--text-muted)); font-size: .8rem; }
.sp-browse-styles { margin-top: .65rem; width: 100%; min-height: 40px; }
.sp-setup-source { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.sp-setup-source strong { min-width: 0; overflow-wrap: anywhere; font-size: .85rem; font-weight: 500; }
.sp-setup-source button { flex: none; min-height: 40px; }
.sp-config-panel.has-prepared-source .source-row { display: none; }
.sp-config-panel.has-prepared-source #source-message:not(.error) { display: none; }
.sp-setup-source[hidden], .sp-setup-eligibility[hidden] { display: none; }
.sp-setup-eligibility { padding: .85rem; margin: 1rem 0 .5rem; border: 1px solid var(--v2-border); border-radius: 10px; color: var(--v2-white); font-size: .85rem; line-height: 1.5; }
.sp-config-panel button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.sp-config-panel .continuation-banner > .btn-action { flex: none; width: auto; min-width: 0; min-height: 40px; white-space: nowrap; }
.sp-config-panel :focus-visible { outline: 2px solid var(--v2-blue-light); outline-offset: 3px; }
.sp-config-panel.is-modal #phone-mockup-bg {
    width: min(100%, calc(56dvh * var(--preview-aspect-number, .5625)));
    height: auto;
    max-height: none;
}
.sp-config-panel.is-modal #source-range-video {
    width: 100%;
    max-height: min(38dvh, 340px);
}
.sp-source-range-options summary { padding: .7rem 1rem; margin-top: .75rem; cursor: pointer; font-size: .82rem; color: #fff; background: #1014ef; border: 1px solid #484bff; border-radius: 8px; width: fit-content; }
.sp-source-range-options summary:hover { background: #2529ff; }
.sp-source-range-options summary:focus-visible { outline: 3px solid #7d9fff; outline-offset: 3px; }
.sp-source-range-options[open] summary { margin-bottom: .6rem; }
.sp-config-panel .source-range-card > div:first-child > div > div:first-child { color: var(--v2-white) !important; }
html[data-theme="light"] .sp-config-panel .range-value { color: var(--v2-blue); border-color: var(--v2-border); background: var(--v2-slate); }
/* Preset faces depict exported captions, so they retain a dark video stage. */
html[data-theme="light"] .sp-config-panel .preset-btn { background: #10131b; }
html[data-theme="light"] .sp-config-panel .preset-btn.active { background: #161d39; }
.sp-config-panel.is-modal .panel-columns { gap: 1.5rem !important; }
.sp-config-preview-jump { display: none; }
#setup-output-panel, .sp-config-panel .panel-left { scroll-margin-top: 76px; }
.sp-config-panel .continuation-banner strong { color: var(--v2-white); }
.sp-config-panel .control-hint,
.sp-config-panel .range-boundary-title { color: var(--v2-muted); }
.sp-config-panel .mode-guide-button {
    width: 32px; height: 32px;
    color: var(--v2-blue-light);
    border-color: var(--v2-border-strong);
    background: var(--v2-slate);
}
.sp-config-panel #preview-scrub-time { color: var(--v2-muted) !important; }
@media (pointer: coarse), (max-width: 760px) {
    .sp-config-panel .mode-guide-button { width: 44px; height: 44px; }
    .sp-config-panel input:not([type="range"]):not([type="checkbox"]),
    .sp-config-panel textarea, .sp-config-panel select { font-size: 16px; }
}
@media (min-width: 1180px) {
    .sp-config-panel.is-modal .panel-columns { grid-template-columns: minmax(350px, 1.15fr) minmax(290px, 1fr) minmax(260px, .85fr); }
    .sp-config-panel.is-modal .panel-left { display: block; }
    .sp-config-panel.is-modal .configuration-preview-panel { padding-left: 1.25rem; border-left: 1px solid var(--v2-border); }
}
@media (max-width: 1179px) {
    .sp-config-panel.is-modal .panel-columns { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .sp-config-panel.is-modal .panel-left,
    .sp-config-panel.is-modal .panel-middle,
    .sp-config-panel.is-modal .panel-right { min-width: 0 !important; }
    .sp-config-panel.is-modal .panel-right { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .sp-config-preview-jump { display: inline-flex; min-height: 40px; }
    .sp-config-panel.is-modal .panel-columns { grid-template-columns: minmax(0, 1fr); }
    .sp-config-panel.is-modal .panel-right { grid-column: auto; }
    .sp-config-panel.is-modal #phone-mockup-bg {
        width: min(100%, calc(48dvh * var(--preview-aspect-number, .5625)));
    }
    .sp-setup-source { align-items: flex-start; }
}

/* Readable application copy; exported caption faces and video layers are excluded. */
#clipping-background-note { font-size:15px; font-weight:500; line-height:1.5; color:var(--v2-muted); }
#btn-clipping-progress-cancel { font-size:16px; font-weight:650; color:var(--v2-red); }
.sp-config-panel .sp-setup-heading { font-size:18px; font-weight:750; }
.sp-config-panel .checkbox-row, .sp-config-panel .trim-strength-label { font-size:16px; font-weight:650; color:var(--v2-white); text-transform:none; line-height:1.5; }
.sp-config-panel .input-group > label,
.sp-config-panel .mode-guide-label > label,
.sp-intake-source-group > label { font-size:16px; font-weight:650; color:var(--v2-white); }
.sp-config-panel :is(select,textarea,input[type="text"],input[type="url"],input[type="number"]) {
    font-size:16px; font-weight:500; line-height:1.5;
}
.sp-config-panel :is(input,textarea)::placeholder,
.sp-intake :is(input,textarea)::placeholder { color:var(--v2-muted); opacity:1; }
.sp-config-panel .control-hint,
.sp-config-panel .source-message,
.sp-selected-caption,
.sp-setup-details summary span,
.sp-config-panel .smart-trim-toggle-copy small,
.sp-intake-message,
.sp-intake-preview-note,
.sp-intake-nojs { font-size:15px; font-weight:500; line-height:1.5; }
.sp-config-panel .control-hint,
.sp-selected-caption,
.sp-setup-details summary span,
.sp-config-panel .smart-trim-toggle-copy small { color:var(--v2-muted); }
.sp-setup-source strong { font-size:16px; font-weight:650; }
.sp-config-panel .sp-setup-eligibility { font-size:15px; font-weight:500; }
.sp-setup-details summary,
.sp-source-range-options summary { font-size:16px; font-weight:650; line-height:1.5; }
.sp-config-panel .source-range-card > div:first-child > div > div:first-child { font-size:16px!important; font-weight:700; }
.sp-config-panel :is(.range-boundary-title,.range-time-value,.range-value,#preview-scrub-time) { font-size:14px; font-weight:600; }
.sp-config-panel #preview-scrub-time { font-size:14px!important; }
.sp-config-panel :is(.custom-caption-open,.range-control-title,.mode-guide-button) { font-size:16px; font-weight:650; }
.sp-config-panel :is(.custom-caption-count,.range-scale) { font-size:14px; font-weight:500; color:var(--v2-muted); }
.sp-config-panel :is(.btn-secondary,.btn-primary,.btn-action,.fx-btn,.trim-strength-choice,.sp-browse-styles) { font-size:16px; font-weight:650; }
.sp-config-panel .info-tooltip { font-family:inherit; font-size:15px; font-weight:500; line-height:1.5; color:var(--v2-white); background:var(--v2-slate); }
.sp-config-panel .mode-guide-popover { background:var(--v2-slate); border-color:var(--v2-border-strong); }
.sp-config-panel .mode-guide-header h3 { font-size:18px; color:var(--v2-white); }
.sp-config-panel .mode-guide-close { color:var(--v2-muted); }
.sp-config-panel .mode-guide-item strong { font-size:16px; font-weight:700; color:var(--v2-white); }
.sp-config-panel .mode-guide-item p { font-size:15px; font-weight:500; line-height:1.5; color:var(--v2-muted); }
.sp-config-panel .sp-rights-confirm { font-size:15px; font-weight:600; color:var(--v2-white); }
.sp-rights-hint { font-size:15px; font-weight:600; }
.sp-config-panel #configure-agent-title { font-size:22px; font-weight:800; }
.sp-config-panel .continuation-banner strong { font-size:16px; }
.sp-config-panel #continuation-banner-copy { font-size:15px; line-height:1.5; }
.sp-intake-dropzone > span:not(.sp-intake-drop-icon) { font-size:15px; font-weight:500; }
.sp-intake :is(input[type="text"],input[type="url"],.btn-secondary,.btn-primary) { font-size:16px; }
#clipping-dashboard .clip-sub, .clip-more-modal .clip-sub { font-size:14px; font-weight:500; line-height:1.5; }
.clip-more-modal :is(p,label,textarea) { font-size:16px; line-height:1.5; }
@media(max-width:760px) {
    .sp-config-panel .sp-setup-heading { font-size:18px; }
    .sp-config-panel .range-nudge-row { flex-wrap:wrap; }
}

.source-preview-feedback { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; font-size: .8rem; }
.source-preview-feedback button { flex-shrink: 0; }

/* Author display rules must not expose the unused native player or iframe. */
#source-range-video[hidden], #source-range-youtube[hidden],
#source-preview-retry[hidden], #clip-preview-feedback[hidden], #clip-preview-retry[hidden] {
    display: none !important;
}
.clip-preview-feedback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
    width: 100%;
    max-width: 720px;
    min-height: 1.25rem;
    color: var(--v2-muted);
    font-size: .78rem;
    line-height: 1.4;
}
.clip-preview-feedback button { flex-shrink: 0; min-height: 36px; }
.clip-preview-feedback[data-state="error"] { color: var(--v2-white); }

/* Setup controls follow the page theme, including copy inside nested labels. */
.sp-config-panel .smart-trim-toggle-copy strong {
    color: var(--v2-white);
}
.sp-config-panel .trim-strength-choice .info-tip {
    color: var(--v2-blue-light);
    border-color: var(--v2-border-strong);
}

/* Size simple choices to their contents instead of stretching across a column.
   Framing retains its intrinsic width so its longest mode stays readable. */
.sp-config-panel :is(#output-aspect-ratio, #mode-select, #caption-pos-select) {
    display: block;
    align-self: flex-start;
    width: fit-content;
    max-width: 100%;
    min-height: 44px;
}
.sp-config-panel #output-aspect-ratio { width: 15rem; }
.sp-config-panel #caption-pos-select { width: 20rem; }
@media (max-width: 760px) {
    .sp-config-panel :is(#output-aspect-ratio, #mode-select, #caption-pos-select) {
        width: 100%;
    }
}

/* Task groups stay compact; headings carry hierarchy instead of large boxes. */
.sp-config-panel .sp-setup-section { min-width: 0; }
.sp-config-panel .sp-setup-section + .sp-setup-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--v2-border);
}
.sp-config-panel .sp-setup-heading { margin: 0 0 1rem; }
.sp-config-panel .sp-setup-section > .input-group { margin-bottom: 1rem; }
.sp-config-panel .checkbox-row { min-height: 44px; padding: .65rem .8rem; }
.sp-config-panel .priority-control {
    padding: .85rem;
    border-color: var(--v2-border-strong);
    border-radius: 10px;
    background: var(--v2-fill);
}
.sp-config-panel .smart-trim-toggle-copy strong { font-size: 16px; line-height: 1.4; }
.sp-config-panel .smart-trim-toggle-copy small { margin-top: .15rem; }
.sp-config-panel .trim-strength-panel { border-color: var(--v2-border); }
.sp-config-panel .trim-strength-choice {
    color: var(--v2-white);
    border-color: var(--v2-border);
    background: var(--v2-slate);
    box-shadow: none;
}
.sp-config-panel .trim-strength-choice:is(:hover, [aria-pressed="true"]) {
    color: var(--v2-white);
    border-color: var(--v2-blue-light);
    background: var(--v2-fill-hover);
    box-shadow: none;
    transform: none;
}
.sp-config-panel .trim-strength-choice[aria-pressed="true"]::before {
    background: var(--v2-blue-light);
    box-shadow: none;
}
.sp-config-panel .sp-setup-details summary { padding: .75rem 0; }
.sp-config-panel .sp-setup-native[hidden] { display: none !important; }
.sp-choice-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(100%, 320px);
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--v2-border-strong);
    border-radius: 10px;
    background: var(--v2-fill);
}
.sp-choice-list.sp-choice-caption-pos-select { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-choice-option { position: relative; min-width: 0; margin: 0; cursor: pointer; }
.sp-choice-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sp-choice-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .45rem .5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--v2-muted);
    font: 650 15px/1.4 'Manrope', sans-serif;
    letter-spacing: 0;
    text-transform: none;
}
.sp-choice-option input:checked + span {
    color: var(--v2-blue-light);
    border-color: var(--v2-border-strong);
    background: var(--v2-slate);
}
.sp-choice-option input:focus-visible + span { outline: 2px solid var(--v2-blue-light); outline-offset: 1px; }
.sp-choice-option input:disabled + span { opacity: .5; cursor: not-allowed; }
.sp-choice-output-aspect-ratio .sp-choice-option span { flex-direction: column; gap: 2px; }
.sp-choice-option small { color: var(--v2-muted); font: 500 12px/1.3 'Manrope', sans-serif; }
@media (min-width: 1180px) {
    .sp-config-panel.is-modal .panel-right.configuration-preview-panel {
        top: 74px;
        max-height: calc(100dvh - 100px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
    .sp-config-panel.is-modal #phone-mockup-bg {
        width: min(100%, calc(44dvh * var(--preview-aspect-number, .5625)));
    }
    .sp-config-panel.is-modal #source-range-video {
        width: auto;
        max-width: 100%;
        max-height: min(28dvh, 240px);
    }
}
@media (max-width: 760px) {
    .sp-choice-list { width: 100%; }
    .sp-config-panel .sp-setup-section + .sp-setup-section { margin-top: 1rem; padding-top: 1rem; }
}
