/* Clipping section. Loads after design-system.css and only uses its tokens: neutral
   surfaces, mint for primary actions and selection markers, content keeps its color. */
@font-face { font-family: 'Inter Caption'; src: url('/fonts/Inter-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Inter Caption'; src: url('/fonts/Inter-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

.clipping { min-width: 0; }
.clipping h3, .clipping h4, .clipping h5 { font-family: var(--ds-font-heading); color: var(--ds-text); margin: 0 0 var(--ds-space-3); }
.clipping h3 { font-size: 15px; }
.clipping h4 { font-size: 12px; margin-top: var(--ds-space-5); }
.clipping h5 { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ds-text-muted); margin: var(--ds-space-4) 0 var(--ds-space-2); }
.clipping .settings-card { min-width: 0; }
.clipping .field-help { margin: 0 0 var(--ds-space-4); }
.clipping label { color: var(--ds-text-muted); }
.clipping input[type="color"] { width: 100%; height: 44px; padding: 4px; border: 1px solid var(--ds-control-border); border-radius: var(--ds-radius-control); background: var(--ds-field); cursor: pointer; }
.clipping input[type="range"] { width: 100%; accent-color: var(--ds-accent); height: 44px; margin: 0; background: transparent; border: 0; padding: 0; }
.clipping input[type="number"] { -moz-appearance: textfield; }
.clip-range-value { font-size: 11px; color: var(--ds-text-secondary); letter-spacing: 0; font-weight: 500; }
.clip-crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: var(--ds-space-3); font-size: 12px; color: var(--ds-text-muted); flex-wrap: wrap; }
.clip-crumbs strong { color: var(--ds-text); font-weight: 600; }
.clip-crumbs .text-button { padding: 6px 8px; min-height: 36px; }
.tiny-pill.accent { border-color: var(--ds-accent); color: var(--ds-accent); background: transparent; }
.clip-error { color: var(--ds-danger); font-size: 11px; line-height: 1.6; margin: 6px 0 0; overflow-wrap: anywhere; }
.clip-note { font-size: 11px; color: var(--ds-text-secondary); line-height: 1.7; margin: 6px 0 0; }
.clip-stale { font-size: 11px; color: var(--ds-text-secondary); }
.clip-progress { height: 6px; width: 100%; border-radius: 4px; background: #2a2a2a; overflow: hidden; }
.clip-progress > span { display: block; height: 100%; background: var(--ds-accent); border-radius: 4px; transition: width .35s var(--ds-ease); }
.clip-unavailable { margin-top: var(--ds-space-3); }
.clip-unavailable p { margin: 8px 0 0; }
.clip-empty { text-align: center; padding: var(--ds-space-7) var(--ds-space-5); border: 1px dashed var(--ds-control-border); border-radius: var(--ds-radius-card); color: var(--ds-text-secondary); }
.clip-empty span { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--ds-surface-raised); margin-bottom: var(--ds-space-3); color: var(--ds-text); }
.clip-empty h3 { margin-bottom: 6px; }
.clip-empty p { font-size: 12px; line-height: 1.7; max-width: 460px; margin: 0 auto; }
.clip-skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--ds-space-4); }
.clip-skeleton { height: 240px; border-radius: var(--ds-radius-card); background: linear-gradient(90deg, #161616 0%, #202020 50%, #161616 100%); background-size: 200% 100%; animation: clip-shimmer 1.4s linear infinite; }
@keyframes clip-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Job line */
.clip-job { margin-top: var(--ds-space-3); padding: var(--ds-space-3); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-control); background: var(--ds-surface-raised); display: grid; gap: 8px; }
.clip-job-head { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ds-text-secondary); flex-wrap: wrap; }
.clip-job-head strong { color: var(--ds-text); text-transform: capitalize; }
.clip-job.status-failed .clip-progress > span { background: var(--ds-danger-border); }
.clip-job.status-cancelled .clip-progress > span { background: var(--ds-text-muted); }
.clip-job.status-completed .clip-progress > span { background: var(--ds-accent); }
.clip-job .text-button { justify-self: start; }

/* Sources view */
.clip-import-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--ds-space-5); margin-bottom: var(--ds-space-6); }
.clip-import { transition: border-color var(--ds-duration) var(--ds-ease), box-shadow var(--ds-duration) var(--ds-ease); }
.clip-import.dragging { border-color: var(--ds-accent); box-shadow: 0 0 0 3px #82e6bf33; }
.clip-dropzone { display: grid; justify-items: center; gap: 10px; padding: var(--ds-space-6) var(--ds-space-4); border: 1px dashed var(--ds-control-border); border-radius: var(--ds-radius-card); text-align: center; background: var(--ds-field); }
.clip-dropzone strong { font-size: 14px; color: var(--ds-text); }
.clip-dropzone .file-label { margin: 0; align-items: center; }
.clip-drop-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--ds-surface-raised); color: var(--ds-text); }
.clip-limits { margin: 0; max-width: 520px; }
.clip-upload { margin-top: var(--ds-space-4); padding: var(--ds-space-4); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-card); background: var(--ds-surface-raised); display: grid; gap: 10px; }
.clip-upload-head, .clip-upload-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11px; color: var(--ds-text-secondary); flex-wrap: wrap; }
.clip-upload-head strong { color: var(--ds-text); overflow-wrap: anywhere; }
.clip-source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--ds-space-4); }
.clip-source-card { border: 1px solid var(--ds-line); border-radius: var(--ds-radius-card); background: var(--ds-surface); overflow: hidden; display: flex; flex-direction: column; min-width: 0; transition: border-color var(--ds-duration) var(--ds-ease), box-shadow var(--ds-duration) var(--ds-ease); }
.clip-source-card:hover { border-color: var(--ds-control-border-hover); box-shadow: 0 8px 22px #0000004d; }
.clip-source-poster { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #000; overflow: hidden; cursor: pointer; text-align: left; }
.clip-source-poster:disabled { cursor: default; }
.clip-source-poster img, .clip-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.clip-poster-empty { display: grid; place-items: center; width: 100%; height: 100%; color: var(--ds-text-muted); background: linear-gradient(160deg, #1c1c1c, #0e0e0e); }
.clip-status { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 6px; background: #000000b8; color: var(--ds-text); font-size: 10px; font-weight: 600; letter-spacing: .4px; }
.clip-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ds-text-muted); }
.clip-status.status-ready i { background: var(--ds-accent); }
.clip-status.status-preparing i, .clip-status.status-uploading i, .clip-status.status-uploaded i { background: #f5d67a; animation: clip-pulse 1.2s ease-in-out infinite; }
.clip-status.status-failed i { background: var(--ds-danger); }
@keyframes clip-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.clip-source-body { padding: var(--ds-space-4); display: grid; gap: 6px; }
.clip-source-body h3 { font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.clip-source-meta { font-size: 11px; color: var(--ds-text-secondary); margin: 0; }
.clip-source-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.clip-source-actions .button { flex: 1 1 auto; }
.clip-confirm { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ds-text-secondary); flex-wrap: wrap; }

/* Source view */
.clip-source-heading h1 { overflow-wrap: anywhere; }
.clip-analysis-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--ds-space-5); margin-bottom: var(--ds-space-6); }
.clip-analysis-form textarea { min-height: 64px; }
.clip-analysis-form .button.full, .clip-panel .button.full { width: 100%; }
.clip-jev-note { display: grid; gap: 8px; padding: var(--ds-space-3); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-control); background: var(--ds-surface-raised); margin-bottom: var(--ds-space-4); }
.clip-jev-note p { font-size: 11px; line-height: 1.7; color: var(--ds-text-secondary); margin: 0; }
.clip-jev-note .tiny-pill { justify-self: start; }
.clip-transcript-upload { margin-top: var(--ds-space-5); padding-top: var(--ds-space-4); border-top: 1px solid var(--ds-line); }
.clip-transcript-upload strong { display: block; font-size: 12px; margin-bottom: 6px; }
.clip-request-summary { font-size: 12px; color: var(--ds-text); margin: 0; }
.clip-ranking-used { font-size: 11px; color: var(--ds-text-secondary); margin: 10px 0 0; }
.clip-analysis-latest .button { margin-top: var(--ds-space-3); }
.clip-history { list-style: none; margin: var(--ds-space-4) 0 0; padding: 0; display: grid; gap: 8px; }
.clip-history li { display: grid; gap: 2px; font-size: 11px; color: var(--ds-text-secondary); padding-top: 8px; border-top: 1px solid var(--ds-line); }
.clip-history li span:first-child { color: var(--ds-text-muted); }
.clip-batch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--ds-space-4); }
.clip-card { display: flex; flex-direction: column; gap: 10px; padding: var(--ds-space-4); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-card); background: var(--ds-surface); min-width: 0; transition: border-color var(--ds-duration) var(--ds-ease), box-shadow var(--ds-duration) var(--ds-ease); }
.clip-card:hover { border-color: var(--ds-control-border-hover); }
.clip-card.selected { border-color: var(--ds-control-border); box-shadow: inset 3px 0 0 var(--ds-accent); }
.clip-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clip-select { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0; min-height: 44px; font-size: 11px; letter-spacing: 0; color: var(--ds-text); cursor: pointer; }
.clip-select input { width: 18px; height: 18px; margin: 0; }
.clip-score { min-height: 32px; padding: 4px 10px; border: 1px solid var(--ds-control-border); border-radius: 999px; background: var(--ds-surface-raised); color: var(--ds-text); font: 600 11px/1.4 var(--ds-font-body); cursor: pointer; }
.clip-score:hover { background: var(--ds-surface-hover); }
.clip-score[aria-expanded="true"] { border-color: var(--ds-accent); }
.clip-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--ds-line); border-radius: var(--ds-radius-control); overflow: hidden; background: #000; cursor: pointer; }
.clip-thumb:hover { border-color: var(--ds-control-border-hover); }
.clip-duration { position: absolute; right: 8px; bottom: 8px; padding: 3px 7px; border-radius: 5px; background: #000000c0; color: var(--ds-text); font-size: 10px; font-weight: 600; }
.clip-title { width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--ds-radius-control); background: transparent; color: var(--ds-text); font: 600 14px/1.4 var(--ds-font-heading); }
.clip-title:hover { border-color: var(--ds-line); background: var(--ds-field); }
.clip-title:focus { border-color: var(--ds-control-border); background: var(--ds-field); }
.clip-range { font-size: 11px; color: var(--ds-text-secondary); margin: 0; }
.clip-range span { color: var(--ds-text-muted); text-transform: capitalize; }
.clip-rationale { font-size: 12px; line-height: 1.7; color: var(--ds-text-secondary); margin: 0; }
.clip-components { list-style: none; margin: 0; padding: var(--ds-space-3); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-control); background: var(--ds-surface-raised); display: grid; gap: 8px; }
.clip-components li { display: grid; grid-template-columns: 96px 1fr 30px; gap: 4px 10px; align-items: center; font-size: 11px; color: var(--ds-text-secondary); }
.clip-components li small { grid-column: 1 / -1; color: var(--ds-text-muted); line-height: 1.6; }
.clip-component-name { text-transform: capitalize; color: var(--ds-text); }
.clip-component-bar { height: 5px; border-radius: 4px; background: #2a2a2a; overflow: hidden; }
.clip-component-bar i { display: block; height: 100%; background: var(--ds-text-secondary); }
.clip-component-value { text-align: right; font-variant-numeric: tabular-nums; }
.clip-jev-detail { grid-template-columns: 96px 1fr; }
.clip-export-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.clip-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }

/* Editor */
.clip-editor-heading { align-items: flex-start; }
.clip-editor-heading > div:first-child { min-width: 0; flex: 1; }
.clip-editor-title { width: 100%; max-width: 640px; padding: 6px 10px; margin: 0 0 6px -10px; border: 1px solid transparent; border-radius: var(--ds-radius-control); background: transparent; color: var(--ds-text); font: 700 26px/1.2 var(--ds-font-heading); letter-spacing: -.5px; }
.clip-editor-title:hover, .clip-editor-title:focus { border-color: var(--ds-control-border); background: var(--ds-field); }
.clip-save { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ds-text-secondary); min-height: 44px; flex-wrap: wrap; }
.clip-save-ok { display: inline-flex; align-items: center; gap: 6px; }
.clip-save-ok i { width: 7px; height: 7px; border-radius: 50%; background: var(--ds-accent); }
.clip-editor { --clip-stage-max: min(420px, calc(50vh * 9 / 16)); display: grid; grid-template-columns: minmax(240px, var(--clip-stage-max)) minmax(0, 1fr); gap: var(--ds-space-5); align-items: start; outline: none; }
.clip-editor-heading { margin-bottom: var(--ds-space-3); padding-bottom: 0; }
.clip-editor-heading p { margin-top: 0; font-size: 11px; }
.clip-editor-heading .eyebrow { margin-bottom: 2px; }
.clip-editor-title { font-size: 22px; margin-bottom: 2px; }
.clipping .clip-crumbs { margin-bottom: var(--ds-space-2); }
.clip-editor:focus-visible { outline: 3px solid var(--ds-focus); outline-offset: 3px; border-radius: var(--ds-radius-card); }
.clip-stage-column { display: grid; gap: var(--ds-space-2); position: sticky; top: 12px; max-width: var(--clip-stage-max); }
.clip-stage-wrap { display: grid; gap: 8px; }
.clip-stage { position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 18px; background: #000; border: 1px solid var(--ds-line); box-shadow: 0 20px 60px #00000080; user-select: none; touch-action: none; }
.clip-stage video { position: absolute; max-width: none; pointer-events: auto; }
.clip-stage-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--ds-text-muted); font-size: 12px; }
.clip-stage-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); border-radius: 50%; border: 0; background: var(--ds-accent); color: var(--ds-on-accent); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 20px #00000080; }
.clip-stage-play:hover { background: var(--ds-accent-hover); }
.clip-stage-play svg { width: 26px; height: 26px; }
.clip-stage-note { font-size: 10px; color: var(--ds-text-muted); margin: 0; text-align: center; line-height: 1.6; }
.clip-caption { position: absolute; left: 6%; width: 88%; transform: translateY(-50%); text-align: center; font-family: 'Inter Caption', 'Inter', var(--ds-font-body); font-weight: 800; line-height: 1.25; pointer-events: none; word-wrap: break-word; }
.clip-caption span { display: inline; }
.clip-caption.cap-clean { padding: .25em .5em; background: #00000099; border-radius: .3em; }
.clip-caption.cap-bold { text-transform: uppercase; letter-spacing: .02em; text-shadow: 0 .08em .18em #000000cc; }
.clip-caption.cap-outline { -webkit-text-stroke: .06em #000; paint-order: stroke fill; text-shadow: 0 .06em .12em #000000b3; }
.clip-caption.cap-pill { padding: .3em .7em; background: #101010e6; border-radius: 999px; }
.clip-caption .hl { font-weight: 800; }
.clip-overlay { position: absolute; transform: translate(-50%, -50%); max-width: 92%; font-family: 'Inter Caption', 'Inter', var(--ds-font-body); line-height: 1.2; white-space: pre-wrap; cursor: grab; text-shadow: 0 .06em .14em #00000099; }
.clip-overlay:active { cursor: grabbing; }
.clip-transport { display: flex; align-items: center; gap: 10px; }
.clip-time { font-size: 11px; color: var(--ds-text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.clip-scrub { flex: 1; }
.clip-loop { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0; font-size: 10px; letter-spacing: 0; min-height: 44px; }
.clip-loop input { width: 16px; height: 16px; margin: 0; }
.clip-timeline { display: grid; gap: 6px; }
.clip-wave { position: relative; height: 72px; border-radius: var(--ds-radius-control); border: 1px solid var(--ds-line); background-color: #0d0d0d; background-repeat: no-repeat; overflow: hidden; }
.clip-wave-region { position: absolute; top: 0; bottom: 0; background: #82e6bf22; border-left: 2px solid var(--ds-accent); border-right: 2px solid var(--ds-accent); pointer-events: none; }
.clip-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #ffffff; pointer-events: none; }
.clip-handle { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; background: transparent; -webkit-appearance: none; appearance: none; pointer-events: none; }
.clip-handle::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 14px; height: 72px; border-radius: 4px; background: var(--ds-accent); border: 0; cursor: ew-resize; }
.clip-handle::-moz-range-thumb { pointer-events: auto; width: 14px; height: 72px; border-radius: 4px; background: var(--ds-accent); border: 0; cursor: ew-resize; }
.clip-handle::-webkit-slider-runnable-track, .clip-handle::-moz-range-track { background: transparent; height: 100%; }
.clip-handle:focus-visible { outline: none; }
.clip-handle:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--ds-focus); }
.clip-handle:focus-visible::-moz-range-thumb { outline: 3px solid var(--ds-focus); }
.clip-timeline-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--ds-text-muted); flex-wrap: wrap; }
.clip-nudge { display: inline-flex; align-items: center; gap: 2px; }
.clip-nudge span { margin-right: 4px; color: var(--ds-text-secondary); font-weight: 600; }
.clip-nudge .text-button { min-height: 36px; padding: 6px 7px; font-variant-numeric: tabular-nums; }
.clip-panels { min-width: 0; }
.clip-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--ds-line); margin-bottom: var(--ds-space-4); }
.clip-tab { min-height: 44px; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ds-text-secondary); font: 600 12px/1.4 var(--ds-font-body); cursor: pointer; white-space: nowrap; }
.clip-tab:hover { color: var(--ds-text); background: var(--ds-surface-raised); }
.clip-tab.selected { color: var(--ds-text); border-bottom-color: var(--ds-accent); }
.clip-panel { display: grid; gap: var(--ds-space-2); }
.clip-panel .section-top { margin: var(--ds-space-4) 0 var(--ds-space-2); }
.clip-kv { display: flex; justify-content: space-between; font-size: 12px; color: var(--ds-text-secondary); margin: 0 0 var(--ds-space-3); }
.clip-kv strong { color: var(--ds-text); }
.clip-suggestion-box { margin-top: var(--ds-space-4); padding: var(--ds-space-3); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-control); background: var(--ds-surface-raised); font-size: 11px; color: var(--ds-text-secondary); line-height: 1.7; }
.clip-suggestion-box strong { display: block; color: var(--ds-text); margin-bottom: 4px; }
.clip-suggestion-box p { margin: 0; }
.clip-suggestion-box blockquote { margin: 8px 0 0; padding-left: 10px; border-left: 2px solid var(--ds-control-border); color: var(--ds-text-muted); font-style: italic; }
.clip-segmented { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--ds-space-4); }
.clip-segmented button { min-height: 40px; padding: 8px 12px; border: 1px solid var(--ds-control-border); border-radius: var(--ds-radius-control); background: var(--ds-surface-raised); color: var(--ds-text-secondary); font: 600 11px/1.4 var(--ds-font-body); cursor: pointer; }
.clip-segmented button:hover { background: var(--ds-surface-hover); color: var(--ds-text); }
.clip-segmented button.selected { color: var(--ds-text); border-color: var(--ds-accent); box-shadow: inset 0 -2px 0 var(--ds-accent); }
.clip-keyframes, .clip-caption-list, .clip-overlay-list, .clip-effects { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.clip-keyframes li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--ds-line); }
.clip-preset-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: var(--ds-space-4); }
.clip-preset { min-height: 56px; border: 1px solid var(--ds-control-border); border-radius: var(--ds-radius-control); background: #0b0b0b; display: grid; place-items: center; cursor: pointer; font-family: 'Inter Caption', var(--ds-font-body); font-weight: 800; font-size: 12px; color: #fff; }
.clip-preset.selected { border-color: var(--ds-accent); box-shadow: 0 0 0 2px #82e6bf44; }
.clip-preset.cap-clean span { padding: 3px 8px; background: #00000099; border-radius: 4px; }
.clip-preset.cap-bold span { text-transform: uppercase; color: #82e6bf; text-shadow: 0 1px 3px #000; }
.clip-preset.cap-outline span { -webkit-text-stroke: .7px #000; paint-order: stroke fill; }
.clip-preset.cap-pill span { padding: 4px 10px; background: #101010e6; border-radius: 999px; }
.clip-caption-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.clip-caption-list li.live input { border-color: var(--ds-accent); }
.clip-caption-list input { width: 100%; }
.clip-caption-time { min-height: 36px; padding: 6px; font-variant-numeric: tabular-nums; }
.clip-overlay-item { padding: var(--ds-space-3); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-control); background: var(--ds-surface-raised); }
.clip-overlay-item textarea { min-height: 48px; }
.clip-overlay-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.clip-music-current { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--ds-line); border-radius: var(--ds-radius-control); background: var(--ds-surface-raised); font-size: 12px; margin-bottom: var(--ds-space-3); }
.clip-library { margin-top: var(--ds-space-3); }
.clip-library-group { display: grid; gap: 6px; }
.clip-track { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--ds-line); }
.clip-track-body { display: grid; gap: 2px; min-width: 0; font-size: 11px; color: var(--ds-text-secondary); }
.clip-track-body strong { color: var(--ds-text); font-size: 12px; }
.clip-track-body small { color: var(--ds-text-muted); overflow-wrap: anywhere; }
.clip-effects li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: end; padding-top: 6px; border-top: 1px solid var(--ds-line); font-size: 12px; }
.clip-effects label { margin: 0; }
.clip-effects input[type="number"] { width: 84px; }
.clip-effects input[type="range"] { width: 110px; }
.clip-export-done { margin-top: var(--ds-space-3); display: grid; gap: 6px; justify-items: start; }

@media (max-width: 1200px) {
  .clip-import-grid, .clip-analysis-grid { grid-template-columns: 1fr; }
  .clip-editor { grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .clip-editor { grid-template-columns: 1fr; }
  .clip-stage-column { position: static; max-width: 420px; width: 100%; justify-self: center; }
}
@media (max-width: 760px) {
  .clip-preset-row { grid-template-columns: repeat(2, 1fr); }
  .clip-card-actions { grid-template-columns: 1fr; }
  .clip-components li { grid-template-columns: 80px 1fr 30px; }
  .clip-effects li { grid-template-columns: 1fr 1fr; }
  .clip-timeline-foot { justify-content: center; }
  .clip-editor-title { font-size: 20px; }
  .clipping .form-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .clip-progress > span, .clip-source-card, .clip-card { transition: none; }
  .clip-skeleton, .clip-status i { animation: none; }
}

/* Critic round 2: shortcuts legend, warnings, analysis groups, deletion */
.clip-keys { margin: 0; font-size: 10px; color: var(--ds-text-muted); line-height: 2; text-align: center; }
.clip-keys kbd { display: inline-block; min-width: 18px; padding: 0 5px; margin: 0 1px; border: 1px solid var(--ds-control-border); border-bottom-width: 2px; border-radius: 4px; background: var(--ds-surface-raised); color: var(--ds-text-secondary); font: 600 10px/1.6 var(--ds-font-body); }
.clip-warnings { display: grid; gap: 6px; margin: var(--ds-space-3) 0; }
.clip-warnings p { margin: 0; font-size: 12px; line-height: 1.6; }
.clip-groups { display: grid; gap: var(--ds-space-5); }
.clip-group { display: grid; gap: var(--ds-space-3); }
.clip-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--ds-line); }
.clip-group-head h3 { margin: 0; font-size: 13px; }
.clip-group-head span { font-size: 11px; color: var(--ds-text-muted); }
.clip-earlier-toggle { justify-self: start; }
.clip-card-actions { grid-template-columns: 1fr 1fr auto; }
.clip-card-actions .clip-delete { min-height: 44px; padding: 9px 8px; }
.clip-danger-zone { margin-top: var(--ds-space-4); padding-top: var(--ds-space-3); border-top: 1px solid var(--ds-line); }
@media (max-width: 1024px) {
  .clip-editor { --clip-stage-max: min(360px, calc(52vh * 9 / 16)); }
}
@media (hover: none), (max-width: 760px) {
  .clip-keys { display: none; }
}
@media (max-width: 900px) {
  .clip-editor { --clip-stage-max: min(420px, calc(70vh * 9 / 16)); }
  .clip-stage-column { position: static; width: 100%; justify-self: center; }
}
@media (max-width: 760px) {
  .clip-card-actions { grid-template-columns: 1fr 1fr; }
  .clip-card-actions .clip-delete { grid-column: 1 / -1; justify-self: start; }
  .clip-timeline-foot { display: grid; grid-template-columns: 1fr 1fr; justify-items: start; }
  .clip-timeline-foot > span:first-child { grid-column: 1; }
  .clip-timeline-foot > span:last-child { grid-column: 2; justify-self: end; }
  .clip-timeline-foot .clip-nudge { grid-column: 1 / -1; width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .clip-timeline-foot .clip-nudge span { min-width: 28px; }
  .clip-keys { text-align: left; }
  .clipping input[type="range"] { max-width: 100%; }
  .clip-effects input[type="range"], .clip-effects input[type="number"] { width: 100%; }
  .clip-effects li { grid-template-columns: 1fr; }
  .clip-tab { padding: 10px 9px; font-size: 11px; }
}

/* Critic round 3: fit framing backdrop, analysis removal, card warnings and stages */
.clip-stage video.clip-backdrop { filter: blur(22px) brightness(.55); transform: scale(1.08); pointer-events: none; }
.clip-group-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clip-group-meta .text-button { min-height: 36px; padding: 6px 8px; }
.clip-source-warning { margin: 0; font-size: 11px; line-height: 1.6; color: var(--ds-text-muted); }
.clip-stage-list { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 10px; color: var(--ds-text-muted); }
.clip-stage-list li::before { content: "○ "; }
.clip-stage-list li.stage-completed { color: var(--ds-text-secondary); }
.clip-stage-list li.stage-completed::before { content: "✓ "; color: var(--ds-accent); }
.clip-stage-list li.stage-running { color: var(--ds-text); }
.clip-stage-list li.stage-running::before { content: "● "; color: #f5d67a; }
