:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --page: #0a0e1a;
  --surface: #111827;
  --surface-soft: #1a2235;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --primary: #ffa947;
  --primary-dark: #ffe156;
  --primary-hover: #ffbd66;
  --primary-soft: rgba(255, 169, 71, .12);
  --line: rgba(255, 255, 255, .1);
  --error: #f87171;
  --radius: 8px;
  --focus: 0 0 0 3px rgba(255, 169, 71, .28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body { margin: 0; color: var(--ink); background: var(--page); overflow-x: hidden; }
button, input, textarea { font: inherit; }
button, label, summary, a { -webkit-tap-highlight-color: transparent; }
button, summary, label[for], .replace-action { cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, label:has(input:focus-visible), .source-row:focus-visible, .context-input:focus-visible { outline: none; box-shadow: var(--focus); }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
.workspace-shell { width: min(1040px, calc(100% - 48px)); margin: 0 auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.workspace-topbar { position: sticky; top: 0; z-index: 20; min-height: 64px; border-bottom: 1px solid var(--line); background: rgba(10, 14, 26, .94); backdrop-filter: blur(12px); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 14px; min-width: 0; min-height: 44px; font-size: 14px; font-weight: 650; }
.brand-logo { display: block; width: 116px; height: 36px; object-fit: contain; }
.brand > span { padding-left: 14px; border-left: 1px solid var(--line); white-space: nowrap; }
.topbar-tools { display: flex; align-items: center; gap: 18px; }
.dashboard-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--primary); font-size: 13px; font-weight: 650; transition: background .18s ease, border-color .18s ease; }
.dashboard-link:hover { border-color: rgba(255, 169, 71, .45); background: var(--primary-soft); }
.dashboard-link svg { width: 16px; height: 16px; }
.service-state { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.service-state.is-offline .status-dot { background: var(--error); box-shadow: 0 0 0 4px rgba(248, 113, 113, .12); }

.workspace-main { padding: 32px 0 64px; }
.workspace-section { padding: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h1 { font-size: 28px; line-height: 1.2; letter-spacing: 0; }
.section-heading p { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.file-progress { flex: 0 0 auto; min-width: 96px; color: var(--primary); font-size: 18px; line-height: 34px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.import-form { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 16px 20px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.report-context { grid-column: 1 / -1; }
.context-field { display: grid; gap: 7px; width: min(100%, 500px); min-width: 0; }
.context-field > label { color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.4; }
.context-field > label span { color: var(--primary); }
.context-input { width: 100%; min-width: 0; min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.context-input:hover { border-color: rgba(255, 169, 71, .35); }
.context-input[aria-invalid="true"] { border-color: var(--error); }
.context-input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .72; }
.field-error { color: var(--error); font-size: 12px; line-height: 1.4; }
.period-source-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.period-source-group { min-width: 0; }
.period-source-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; }
.period-source-heading h2 { font-size: 16px; line-height: 1.3; }
.period-source-heading span { color: var(--primary); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.source-list { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.source-row { display: grid; grid-template-columns: 32px 82px minmax(0, 1fr) 56px 44px; align-items: center; gap: 7px; min-height: 66px; padding: 9px 7px 9px 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: copy; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.source-row:hover, .source-row.is-dragging { border-color: rgba(255, 169, 71, .65); background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(255, 169, 71, .2); }
.source-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: var(--muted); background: var(--surface-soft); }
.source-icon svg { width: 17px; height: 17px; stroke-width: 1.8; }
.source-row > strong { font-size: 13px; line-height: 1.3; }
.source-file { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.replace-action { display: inline-flex; align-items: center; justify-content: center; min-width: 56px; min-height: 44px; border-radius: 6px; color: var(--primary); font-size: 13px; font-weight: 650; transition: background .18s ease; }
.replace-action:hover { background: var(--primary-soft); }
.clear-source-action { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; transition: color .18s ease, background .18s ease; }
.clear-source-action:hover { color: #fda4af; background: rgba(248, 113, 113, .09); }
.clear-source-action svg { width: 17px; height: 17px; stroke-width: 1.9; }
.source-row.is-ready .source-icon { color: var(--primary); background: var(--primary-soft); }
.source-row.is-ready .source-file { color: var(--ink); }
.source-row.is-dragging .source-icon { color: var(--primary); background: rgba(255, 169, 71, .2); }
.top-material-upload { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--line); }
.top-material-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.top-material-heading > div { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.top-material-heading h2 { font-size: 16px; line-height: 1.35; }
.top-material-heading span { color: var(--muted); font-size: 12px; }
.top-material-heading strong { color: var(--primary); font-size: 12px; font-variant-numeric: tabular-nums; }
.top-video-drop { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 1px dashed rgba(255, 169, 71, .38); border-radius: 6px; color: var(--primary); background: rgba(255, 169, 71, .045); font-size: 13px; font-weight: 700; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.top-video-drop:hover, .top-video-drop.is-dragging { border-color: rgba(255, 169, 71, .72); background: var(--primary-soft); }
.top-video-drop.is-full { cursor: not-allowed; opacity: .42; }
.top-video-drop svg { width: 18px; height: 18px; stroke-width: 1.9; }
.top-video-list { display: grid; gap: 10px; margin-top: 10px; }
.top-video-item { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(0, 1.3fr); gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.top-video-file { display: grid; grid-template-columns: 30px 22px minmax(0, 1fr) 44px; align-items: center; gap: 8px; min-width: 0; }
.top-video-index { color: var(--primary); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.top-video-file > svg { width: 19px; height: 19px; color: var(--muted); stroke-width: 1.8; }
.top-video-file > div { min-width: 0; }
.top-video-file strong, .top-video-file span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-video-file strong { font-size: 12px; line-height: 1.4; }
.top-video-file > div span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.top-video-file button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; }
.top-video-file button:hover { color: #fda4af; background: rgba(248, 113, 113, .09); }
.top-video-file button svg { width: 17px; height: 17px; }
.top-video-fields { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 9px; }
.top-video-fields label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.top-video-fields input, .top-video-fields textarea { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface-soft); font-size: 12px; line-height: 1.45; resize: vertical; }
.top-video-fields input { min-height: 40px; }
.top-video-fields textarea { min-height: 58px; }
.top-video-fields input:focus-visible, .top-video-fields textarea:focus-visible { outline: none; border-color: rgba(255, 169, 71, .55); box-shadow: var(--focus); }
.top-video-description { grid-column: 1 / -1; }

.selection-status { align-self: center; min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.selection-status.is-ready { color: var(--primary-dark); }
.generate-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 6px; color: #1a120b; background: var(--primary); font-size: 14px; font-weight: 700; transition: background .18s ease, box-shadow .18s ease; }
.generate-action:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 6px 18px rgba(255, 169, 71, .2); }
.generate-action:disabled { cursor: not-allowed; opacity: .42; }
.generate-action svg { width: 17px; height: 17px; stroke-width: 1.9; }
.import-result { grid-column: 1 / -1; padding: 12px 14px; border-left: 3px solid var(--primary); border-radius: 4px; color: var(--primary-dark); background: var(--primary-soft); font-size: 13px; line-height: 1.5; }
.import-result.is-error { border-left-color: var(--error); color: var(--error); background: rgba(248, 113, 113, .1); }

.reports-section { margin-top: 32px; }
.reports-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.reports-heading h2 { font-size: 18px; line-height: 1.3; }
.reports-actions { display: flex; align-items: center; gap: 4px; }
.archive-summary { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.archive-notice { min-height: 40px; margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid #4fd1a1; border-radius: 4px; color: #7ce2bd; background: rgba(79, 209, 161, .08); font-size: 13px; line-height: 1.5; }
.archive-notice.is-error { border-left-color: var(--error); color: #fda4af; background: rgba(248, 113, 113, .09); }
.icon-action { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; transition: color .18s ease, background .18s ease; }
.icon-action:hover { color: var(--primary); background: var(--primary-soft); }
.icon-action:disabled { cursor: wait; opacity: .45; }
.icon-action svg { width: 18px; height: 18px; stroke-width: 1.8; }
.icon-count { position: absolute; top: 2px; right: 1px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid var(--page); border-radius: 9px; color: #1a120b; background: var(--primary); font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.project-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 14px; }
.project-control { display: grid; grid-template-columns: minmax(150px, 1fr) 44px; gap: 4px; min-width: 198px; }
.project-tab { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 150px; min-height: 44px; padding: 0 10px 0 13px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface); text-align: left; transition: color .18s ease, border-color .18s ease, background .18s ease, transform .12s ease; }
.project-tab:hover { color: var(--ink); border-color: rgba(255, 169, 71, .35); background: var(--surface-soft); }
.project-tab:active { transform: translateY(1px); }
.project-tab[aria-selected="true"] { color: var(--ink); border-color: rgba(255, 169, 71, .58); background: var(--primary-soft); box-shadow: inset 0 -2px 0 var(--primary); }
.project-tab span { min-width: 0; overflow: hidden; font-size: 13px; font-weight: 650; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.project-tab strong { display: grid; place-items: center; flex: 0 0 auto; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 4px; color: var(--muted); background: rgba(255, 255, 255, .06); font-size: 11px; font-variant-numeric: tabular-nums; }
.project-tab[aria-selected="true"] strong { color: var(--primary-dark); background: rgba(255, 169, 71, .14); }
.archive-batch-toolbar { position: sticky; top: 64px; z-index: 12; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 5px 0 10px; border-bottom: 1px solid var(--line); background: rgba(10, 14, 26, .96); backdrop-filter: blur(10px); }
.batch-select-all { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--ink); font-size: 13px; font-weight: 650; cursor: pointer; }
.batch-select-all input, .report-selector input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.batch-selection-count { margin-right: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.batch-delete-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 13px; border: 1px solid rgba(248, 113, 113, .22); border-radius: 6px; color: #fda4af; background: rgba(248, 113, 113, .07); font-size: 13px; font-weight: 700; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.batch-delete-action:hover:not(:disabled) { color: #fff1f2; border-color: rgba(248, 113, 113, .42); background: rgba(248, 113, 113, .14); }
.batch-delete-action:disabled { cursor: not-allowed; opacity: .35; }
.batch-delete-action svg { width: 16px; height: 16px; stroke-width: 1.9; }
.project-delete, .report-delete { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.project-delete:hover, .report-delete:hover { color: #fda4af; border-color: rgba(248, 113, 113, .24); background: rgba(248, 113, 113, .09); }
.project-delete:active, .report-delete:active { background: rgba(248, 113, 113, .16); }
.project-delete svg, .report-delete svg { width: 17px; height: 17px; stroke-width: 1.8; }
.project-archive { border-top: 1px solid var(--line); }
.report-row { display: grid; grid-template-columns: 44px minmax(220px, 1.1fr) minmax(180px, .75fr) 74px 112px 44px; align-items: center; gap: 12px; min-height: 64px; border-bottom: 1px solid var(--line); transition: background .16s ease, box-shadow .16s ease; }
.report-row.is-selected { background: rgba(255, 169, 71, .055); box-shadow: inset 3px 0 0 rgba(255, 169, 71, .72); }
.report-selector { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.report-period { display: flex; align-items: center; gap: 10px; min-width: 0; }
.report-period strong { display: -webkit-box; overflow: hidden; font-size: 14px; line-height: 1.45; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.latest-tag { flex: 0 0 auto; padding: 3px 7px; border-radius: 4px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 700; }
.report-meta { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-status { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 0 7px; border: 1px solid transparent; border-radius: 4px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.report-status.is-published { color: #66d9ad; border-color: rgba(79, 209, 161, .2); background: rgba(79, 209, 161, .09); }
.report-status.is-draft { color: var(--primary-dark); border-color: rgba(255, 169, 71, .24); background: var(--primary-soft); }
.report-open { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 44px; min-height: 44px; color: var(--primary); font-size: 13px; font-weight: 650; }
.report-open:hover { color: var(--primary-dark); }
.report-open svg { width: 16px; height: 16px; stroke-width: 1.8; }
.empty-state { display: flex; align-items: center; min-height: 72px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.delete-dialog { width: min(430px, calc(100% - 32px)); padding: 0; border: 1px solid rgba(248, 113, 113, .28); border-radius: 8px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 72px rgba(0, 0, 0, .58); }
.delete-dialog::backdrop { background: rgba(3, 6, 14, .76); backdrop-filter: blur(5px); }
.delete-dialog-body { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 22px; }
.delete-dialog-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; color: #fda4af; background: rgba(248, 113, 113, .1); }
.delete-dialog-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }
.delete-dialog h2 { font-size: 17px; line-height: 1.35; }
.delete-dialog p { margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.delete-dialog-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dialog-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 96px; min-height: 44px; padding: 0 14px; border-radius: 6px; font-size: 13px; font-weight: 700; }
.dialog-button.is-cancel { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.dialog-button.is-cancel:hover { background: var(--surface-soft); }
.dialog-button.is-danger { border: 1px solid rgba(248, 113, 113, .32); color: #fff1f2; background: #b4233a; }
.dialog-button.is-danger:hover:not(:disabled) { background: #c92d47; }
.dialog-button.is-danger:disabled { cursor: wait; opacity: .55; }
.dialog-button svg { width: 16px; height: 16px; stroke-width: 1.9; }
.trash-dialog { width: min(680px, calc(100% - 32px)); max-height: min(82vh, 720px); padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 72px rgba(0, 0, 0, .6); }
.trash-dialog::backdrop { background: rgba(3, 6, 14, .72); backdrop-filter: blur(5px); }
.trash-dialog-body { display: grid; grid-template-rows: auto minmax(80px, 1fr) auto; max-height: min(82vh, 720px); }
.trash-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 18px 14px 20px; border-bottom: 1px solid var(--line); }
.trash-dialog-header h2 { font-size: 18px; line-height: 1.35; }
.trash-dialog-header p { margin-top: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.trash-list { overflow-y: auto; overscroll-behavior: contain; padding: 0 20px; }
.trash-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, auto) 44px; align-items: center; gap: 14px; min-height: 68px; border-bottom: 1px solid var(--line); }
.trash-row-main { min-width: 0; }
.trash-row-main strong, .trash-row-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-row-main strong { font-size: 13px; line-height: 1.4; }
.trash-row-main span, .trash-row-meta { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.trash-row-meta { margin-top: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.trash-purge-action { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.trash-purge-action:hover { color: #fda4af; border-color: rgba(248, 113, 113, .26); background: rgba(248, 113, 113, .09); }
.trash-purge-action svg { width: 17px; height: 17px; stroke-width: 1.9; }
.trash-empty-state { display: grid; place-items: center; min-height: 120px; color: var(--muted); font-size: 13px; }
.trash-dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.trash-dialog-footer > span { color: #fda4af; font-size: 11px; }
.trash-empty-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 14px; border: 1px solid rgba(248, 113, 113, .28); border-radius: 6px; color: #fff1f2; background: #b4233a; font-size: 13px; font-weight: 700; }
.trash-empty-action:hover:not(:disabled) { background: #c92d47; }
.trash-empty-action:disabled { cursor: not-allowed; opacity: .35; }
.trash-empty-action svg { width: 16px; height: 16px; stroke-width: 1.9; }
.spin { animation: spin .8s linear infinite; }

@media (max-width: 720px) {
  .workspace-shell { width: min(100% - 32px, 1040px); }
  .workspace-topbar, .topbar-inner { min-height: 60px; }
  .brand-logo { width: 104px; height: 32px; }
  .brand > span { display: none; }
  .topbar-tools { gap: 8px; }
  .dashboard-link { min-height: 40px; padding: 0 9px; }
  .dashboard-link span { display: none; }
  .workspace-main { padding: 24px 0 48px; }
  .section-heading { margin-bottom: 16px; }
  .section-heading h1 { font-size: 24px; }
  .section-heading p { max-width: 250px; font-size: 13px; }
  .file-progress { min-width: 88px; font-size: 15px; }
  .import-form { grid-template-columns: 1fr; gap: 14px; }
  .period-source-grid { grid-template-columns: 1fr; gap: 18px; }
  .source-row { grid-template-columns: 30px 70px minmax(0, 1fr) 48px 44px; gap: 6px; min-height: 70px; padding-left: 10px; }
  .source-icon { width: 30px; height: 30px; }
  .replace-action { min-width: 50px; }
  .top-video-item { grid-template-columns: 1fr; }
  .top-video-fields { grid-template-columns: 1fr; }
  .top-video-description { grid-column: auto; }
  .generate-action { width: 100%; }
  .reports-section { margin-top: 28px; }
  .project-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-control { grid-template-columns: minmax(0, 1fr) 44px; min-width: 0; }
  .project-tab { min-width: 0; width: 100%; }
  .archive-batch-toolbar { top: 60px; flex-wrap: wrap; gap: 4px 10px; }
  .batch-selection-count { order: 3; flex-basis: 100%; }
  .batch-delete-action { margin-left: auto; }
  .trash-dialog-header { padding: 15px 12px 12px 16px; }
  .trash-list { padding: 0 14px; }
  .trash-row { grid-template-columns: minmax(0, 1fr) 44px; gap: 4px 10px; min-height: 78px; padding: 8px 0; }
  .trash-row-main { grid-column: 1; grid-row: 1; }
  .trash-row-meta { grid-column: 1; grid-row: 2; text-align: left; }
  .trash-purge-action { grid-column: 2; grid-row: 1 / span 2; }
  .trash-dialog-footer { align-items: flex-start; flex-direction: column; padding: 12px 14px 16px; }
  .trash-empty-action { width: 100%; }
  .report-row { grid-template-columns: 44px minmax(0, 1fr) auto 44px 44px; gap: 4px 6px; min-height: 78px; padding: 10px 0; }
  .report-selector { grid-column: 1; grid-row: 1 / span 2; }
  .report-period { grid-column: 2 / span 2; align-self: end; }
  .report-meta { grid-column: 2; align-self: start; }
  .report-status { grid-column: 3; grid-row: 2; }
  .report-open { grid-column: 4; grid-row: 1 / span 2; justify-content: center; }
  .report-delete { grid-column: 5; grid-row: 1 / span 2; }
  .report-open span { display: none; }
}

@media (max-width: 380px) {
  .workspace-shell { width: min(100% - 24px, 1040px); }
  .service-state { font-size: 12px; }
  .section-heading p { max-width: 220px; }
  .source-row { grid-template-columns: 28px 64px minmax(0, 1fr) 44px 44px; gap: 4px; padding-right: 4px; }
  .replace-action { min-width: 44px; font-size: 12px; }
  .clear-source-action { width: 44px; min-width: 44px; }
  .project-tabs { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

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