/* Shared source-video intake treatment for Clipping, Editor, and Captions. */
#clipping-intake-title { font-family: 'Outfit', system-ui, sans-serif !important; }
.source-intake-shell {
    width: min(100%, 720px);
    margin-inline: auto;
}
.caption-source-bar.source-intake-shell {
    display: block;
    padding: 28px 32px;
}
.caption-source-bar.source-intake-shell .source-path-stack { display: block; }
.caption-source-bar.source-intake-shell .source-intake-dropzone {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
}
.caption-source-bar.source-intake-shell .source-intake-icon { grid-row: auto; }

.source-intake-dropzone {
    min-height: 184px;
    padding: 24px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 8px;
    border: 2px dashed var(--v2-border-strong, rgba(255,255,255,.14));
    border-radius: 16px;
    background: rgba(255,255,255,.02);
    color: var(--v2-muted, #98a2b3);
    text-align: center;
    cursor: default;
    transition: border-color 150ms ease, background-color 150ms ease;
}
.source-intake-dropzone:hover,
.source-intake-dropzone.drag,
.source-intake-dropzone.is-dragover {
    border-color: var(--v2-blue-light, #93acff);
    background: rgba(16,20,239,.055);
}
.source-intake-dropzone.drag,
.source-intake-dropzone.is-dragover { outline: 2px solid var(--v2-blue-light); outline-offset: 3px; }
.source-intake-dropzone strong {
    color: var(--v2-white, #f4f6f9);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.01em;
}
.source-intake-dropzone p,
.source-intake-dropzone > span:not(.source-intake-icon):not(.sp-intake-drop-icon) {
    margin: 0;
    color: var(--v2-muted, #98a2b3);
    font-size: .92rem;
    line-height: 1.55;
}
.source-intake-dropzone .source-intake-sub {
    color: var(--v2-dim, #687386);
    font-size: .82rem;
}
.source-intake-icon,
.sp-intake-drop-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 4px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: var(--v2-blue, #1014EF);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
    font-size: 1.5rem;
    line-height: 1;
}
.source-intake-icon svg { width: 22px; height: 22px; stroke: currentColor; }
.source-intake-dropzone .btn,
.source-intake-dropzone .btn-primary,
.source-intake-dropzone .btn-secondary { position: relative; z-index: 1; }
.source-intake-dropzone .btn-primary,
.source-intake-url-row .btn-primary {
    border-color: rgba(16, 20, 239, .72);
    background: var(--v2-blue, #1014EF);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.source-intake-dropzone .btn-primary:hover,
.source-intake-url-row .btn-primary:hover { background: var(--v2-blue-hover, #2429FF); }
.source-intake-dropzone button:focus-visible,
.source-intake-url-row button:focus-visible,
.source-intake-url-row input:focus-visible {
    outline: 3px solid rgba(16,20,239,.45);
    outline-offset: 3px;
}
.source-intake-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: var(--v2-dim, #687386);
    /* Sentence case, as on the Editor page: small spaced capitals read as a
       shout and were harder to scan than the rest of the intake. */
    font-size: .8125rem;
    text-transform: none;
    letter-spacing: .02em;
}
.source-intake-divider::before,
.source-intake-divider::after { content: ""; height: 1px; flex: 1; background: var(--v2-border, rgba(255,255,255,.085)); }
.source-intake-url-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 10px;
    width: 100%;
}
.source-intake-url-row input {
    min-width: 0;
    min-height: 46px;
    padding: 12px 15px;
    border: 1px solid var(--v2-border, rgba(255,255,255,.085));
    border-radius: 12px;
    background: rgba(255,255,255,.035);
    color: var(--v2-white, #f4f6f9);
    font-size: .92rem;
}
.source-intake-url-row input:focus { border-color: var(--v2-blue-light, #93acff); box-shadow: 0 0 0 3px rgba(16,20,239,.18); }
.source-intake-url-row button {
    min-height: 46px;
    padding-inline: 18px;
    border-radius: 12px;
}

.editor-page .recent { margin-top: 40px; }
.editor-page .recent h3,
.editor-page .recent-item .r-meta,
.editor-page footer .muted { color: var(--v2-muted); }
.editor-library-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.editor-library-header h3 { margin: 0; font: 800 1.35rem/1.3 'Outfit', sans-serif; color: var(--v2-white); text-transform: none; letter-spacing: -.02em; }
.editor-library-header button { min-height: 44px; }
.editor-library-header .btn-secondary { color: var(--v2-white); background: var(--v2-fill); border: 1px solid var(--v2-border); font-size: .85rem; }
.editor-library-header button:focus-visible { outline: 3px solid var(--v2-blue-light); outline-offset: 3px; }
.editor-history-message { margin: 0 0 16px; color: var(--v2-muted); font-size: .85rem; line-height: 1.5; overflow-wrap: anywhere; }
.editor-history-message:empty { display: none; }
.editor-page a.recent-item { color: inherit; text-decoration: none; }
.editor-page a.recent-item:focus-visible { outline: 3px solid var(--v2-blue-light); outline-offset: 3px; }
.editor-page .recent-item { --session-copy-column: 2; grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 4px 12px; transition: border-color 150ms ease, background-color 150ms ease; }
.editor-page .recent-item .r-thumb { width: 56px; height: 42px; grid-column: 1; grid-row: 1 / 3; }
.editor-page .recent-item .r-title { grid-column: var(--session-copy-column); grid-row: 1; white-space: normal; line-height: 1.4; overflow-wrap: anywhere; }
.editor-page .recent-item .r-meta { min-width: 0; grid-column: var(--session-copy-column); grid-row: 2; text-align: left; white-space: normal; line-height: 1.5; overflow-wrap: anywhere; }
.editor-page .recent-item .r-open { grid-column: -2 / -1; grid-row: 1 / 3; align-self: center; white-space: nowrap; }
.editor-page .recent-item:has(.r-thumb[hidden]) { --session-copy-column: 1; grid-template-columns: minmax(0, 1fr) auto; }
.editor-page .source-intake-dropzone { height: auto; }
.editor-page .source-intake-dropzone .btn { min-height: 44px; margin-top: 8px; }
.editor-page .source-intake-dropzone .btn,
.editor-page .source-intake-url-row .btn { font-size: 1.05rem; font-weight: 700; }
.editor-page .source-intake-url-row input { min-height: 46px; }

@media (max-width: 620px) {
    .source-intake-dropzone { min-height: 184px; padding: 24px 16px; }
    .source-intake-url-row { grid-template-columns: 1fr; }
    .source-intake-url-row button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .source-intake-dropzone { transition: none; }
    .source-intake-dropzone.drag,
    .source-intake-dropzone.is-dragover { transform: none; }
}

/* Keep empty intake controls stationary when switching creative tools.
   Reference: Clipping starts 72px below the shared app header. */
body.editor-page main { padding-top: 32px; }
body.editor-page .ed-hero.ed-hero--compact { width: 100%; max-width: none; margin: 0 0 18px; }
body.editor-page .ed-hero.ed-hero--compact h1 { margin: 0; font-size: clamp(1.75rem,3vw,2.2rem); line-height: 1.1; font-weight: 800; }
body.captions-page-v4 main.main-container.main-container { margin-top: 32px; }
body.captions-page-v4 .caption-workbench { gap: 18px; }
body.captions-page-v4 .caption-page-intro { margin: 0; padding: 0; }
body.captions-page-v4 .caption-page-intro h1 { margin: 0; }
body.editor-page .source-intake-divider { width: min(100%,720px); }
body.editor-page .path-row.source-intake-url-row { margin-top: 0; }
body .source-intake-url-row { display: grid; grid-template-columns: minmax(0,1fr) 154px; gap: 10px; }
body .source-intake-url-row button { width: 154px; }
@media(max-width:620px) {
    body .source-intake-url-row { grid-template-columns: minmax(0,1fr); }
    body .source-intake-url-row button { width: 100%; }
}

/* Match the reference controls, including their contents rather than only the shell. */
body .source-intake-dropzone > button.btn-primary {
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(99, 121, 255, .72);
}
body.editor-page .source-intake-message,
body.captions-page-v4 .caption-source-bar .source-message {
    width: min(100%, 720px);
    min-height: 1.35rem;
    margin: 12px auto 0;
    padding: 0;
    color: var(--v2-muted, #9da6af);
    font-size: .82rem;
    line-height: 1.45;
    text-align: left;
}
#caption-preparation-status { overflow-wrap: anywhere; }
body.editor-page .status-box.error { color: var(--v2-red); }
body.editor-page .status-box.ready { color: var(--v2-green); }
html[data-theme="light"] body.editor-page .status-box:is(.error, .ready) {
    background: var(--v2-slate);
}
@media (pointer: coarse), (max-width: 760px) {
    .source-intake-url-row input { font-size: 16px; }
}

/* Primary source actions give feedback without moving the drop target. */
.source-intake-dropzone button,
.source-intake-url-row button { transition: background-color 150ms ease, scale 150ms ease-out; }
@media (hover: hover) and (pointer: fine) {
    .source-intake-dropzone button:not(:disabled):active,
    .source-intake-url-row button:not(:disabled):active { scale: .96; }
}
@media (prefers-reduced-motion: reduce) {
    .source-intake-dropzone button,
    .source-intake-url-row button { transition: none; scale: 1 !important; transform: none !important; }
}
