:root {
  color-scheme: light;
  --blue: #2f63f5;
  --blue-strong: #1748d8;
  --blue-soft: #edf3ff;
  --blue-pale: #f6f8ff;
  --ink: #17191e;
  --text: #343841;
  --muted: #7a818d;
  --faint: #a7adb7;
  --line: #e6e8ec;
  --line-strong: #d9dde4;
  --surface: #ffffff;
  --subtle: #f7f8fa;
  --success: #23855a;
  --success-soft: #edf8f2;
  --warning: #b56d13;
  --warning-soft: #fff7e8;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--surface); color: var(--ink); }
body { overflow: hidden; }
button, textarea { font: inherit; }
button { color: inherit; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { display: block; color: var(--muted); font-size: 10px; line-height: 1; font-weight: 700; letter-spacing: .14em; }
@keyframes cutcut-shimmer { 0% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes cutcut-spin { to { transform: rotate(360deg); } }

.app-frame { width: 100vw; height: 100vh; background: var(--surface); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand strong { font-size: 18px; letter-spacing: -.04em; }
.brand-mark { position: relative; width: 24px; height: 24px; display: grid; grid-template-columns: repeat(2, 9px); gap: 3px; align-content: center; justify-content: center; border-radius: 7px; background: var(--blue); }
.brand-mark i { width: 9px; height: 5px; border-radius: 2px; background: #fff; transform: skewX(-17deg); }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.icon-button:hover { background: var(--subtle); }
.account-button { height: 36px; display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.account-button span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: var(--blue-soft); color: var(--blue-strong); font-size: 10px; font-weight: 800; }
.account-button span svg { width: 21px; height: 15px; stroke: none; }
.account-button strong { min-width: 0; overflow: hidden; font-size: 12px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }

.workspace { --left-rail-width: clamp(260px, calc(100vw - 1036px), 420px); --right-rail-width: 292px; --source-width: 406px; --subtitle-style-width: 328px; height: 100vh; display: grid; grid-template-columns: var(--left-rail-width) 8px minmax(728px, 1fr) 8px var(--right-rail-width); grid-template-rows: 56px minmax(0, 1fr); overflow: hidden; }
.shared-header { grid-column: 3; grid-row: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 4px; overflow: hidden; border-bottom: 1px solid var(--line); background: #fff; }
.shared-header .brand { flex: 0 0 auto; margin-left: 0; }
.shared-header .account-button { flex: 0 0 auto; max-width: 205px; }
.task-tabs-shell { min-width: 0; flex: 1; align-self: stretch; display: flex; align-items: flex-end; gap: 5px; margin-left: 0; overflow: hidden; }
.task-tabs { min-width: 0; display: flex; align-items: flex-end; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.task-tabs::-webkit-scrollbar { display: none; }
.task-tab { flex: 0 0 auto; min-width: 126px; max-width: 190px; height: 39px; display: grid; grid-template-columns: minmax(0, 1fr) 27px; align-items: center; border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; background: #f4f5f7; color: var(--muted); }
.task-tab.is-active { border-color: var(--line); background: var(--blue-pale); color: var(--ink); box-shadow: inset 0 2px 0 var(--blue); }
.task-tab-select, .task-tab-close, .new-task-button { border: 0; background: transparent; cursor: pointer; }
.task-tab-select { min-width: 0; height: 100%; display: flex; align-items: center; gap: 7px; padding: 0 4px 0 11px; overflow: hidden; }
.task-tab-select i { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #adb3bd; }
.task-tab.is-active .task-tab-select i { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.task-tab-select span { overflow: hidden; font-size: 11px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.task-tab-select.is-saving i { background: #e69b36; box-shadow: 0 0 0 3px #fff2d8; }
.task-tab-select.is-error i { background: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }
.task-tab-save-retry { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #b42318; font-size: 15px; cursor: pointer; }
.task-tab-save-retry:hover { background: #fff1f0; }
.task-tab-editor { cursor: text; }
.task-tab-input { min-width: 0; width: 100%; height: 24px; padding: 0 6px; border: 0; border-radius: 6px; outline: 0; background: #fff; box-shadow: inset 0 0 0 1px #bdd0ff; color: var(--ink); font: inherit; font-size: 11px; font-weight: 700; }
.task-tab-input::selection { color: #fff; background: var(--blue); }
.task-tab.is-editing { box-shadow: inset 0 2px 0 var(--blue), 0 0 0 1px var(--blue-soft); }
.task-tab-close { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border-radius: 6px; color: var(--faint); font-size: 16px; line-height: 1; }
.task-tab-close:hover { background: #e8ebf1; color: var(--ink); }
.new-task-button { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 8px; color: var(--blue); font-size: 20px; }
.new-task-button:hover { background: var(--blue-soft); }
.resize-handle { position: relative; z-index: 3; width: 8px; min-width: 8px; cursor: col-resize; touch-action: none; outline: 0; background: transparent; }
.resize-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line); transform: translateX(-50%); transition: background .16s ease; }
.resize-handle:hover::before, .resize-handle:focus-visible::before { background: var(--line-strong); }
.resize-handle.is-dragging::before { background: var(--blue); }
.resize-handle:focus-visible { outline: 0; }
[data-resize-handle="left"] { grid-column: 2; grid-row: 1 / 3; }
[data-resize-handle="right"] { grid-column: 4; grid-row: 1 / 3; }
.subtitle-style-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: -6px; right: -6px; }
.subtitle-style-handle.is-locked { cursor: default; }
.subtitle-style-handle.is-locked:hover::before, .subtitle-style-handle.is-locked:focus-visible::before { background: var(--line); }

.conversation-rail { --library-height: 560px; grid-column: 1; grid-row: 1 / 3; min-width: 0; min-height: 0; overflow: hidden; container-type: inline-size; display: grid; grid-template-rows: minmax(150px, var(--library-height)) 8px minmax(220px,1fr); border-right: 0; background: #fff; }
.rail-resize-handle { position: relative; cursor: row-resize; touch-action: none; background: transparent; border: 0; }
.rail-resize-handle::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); transform: translateY(-50%); transition: background .16s ease; }
.rail-resize-handle:hover::before, .rail-resize-handle:focus-visible::before { background: var(--blue); }
.rail-resize-handle:focus-visible { outline: 0; }
.library-section { width: 100%; min-width: 0; max-width: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; padding: 18px 0 0; border-bottom: 0; }
.section-heading { min-width: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 18px; }
.section-heading h1, .task-header h2 { margin: 6px 0 0; font-size: 16px; line-height: 1.1; letter-spacing: -.025em; }
.library-title-row { display: flex; align-items: center; gap: 6px; }
.library-settings-button { position: relative; width: 24px; height: 24px; display: grid; place-items: center; margin-top: 5px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #9aa3b2; cursor: pointer; transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease; }
.library-settings-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.library-settings-button:hover, .library-settings-button:focus-visible { color: var(--blue); border-color: #c8d5ff; background: var(--blue-pale); outline: none; transform: translateY(-1px); }
.library-settings-button.is-bound::after { content: ""; position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; border: 2px solid #fff; border-radius: 999px; background: var(--blue); box-shadow: 0 0 0 1px #bdd0ff; }
.scroll-actions { display: flex; gap: 4px; }
.scroll-actions button { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); cursor: pointer; }
.scroll-actions button:hover { color: var(--blue); border-color: #c9d6ff; background: var(--blue-pale); }
.scroll-actions .upload-button { width: auto; grid-template-columns: auto auto; gap: 4px; padding: 0 8px; color: var(--blue-strong); border-color: #c8d5ff; background: var(--blue-pale); font-size: 10px; font-weight: 700; }
.upload-button svg { width: 14px; height: 14px; }
.material-strip { width: 100%; min-width: 0; max-width: 100%; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; align-content: start; gap: 16px 14px; margin-top: 14px; padding: 0 18px 16px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-color: #dfe3ea transparent; scrollbar-width: thin; }
.material-card-shell { container-type: inline-size; position: relative; width: 100%; min-width: 0; min-height: 184px; }
.material-card { position: relative; width: 100%; min-width: 0; min-height: 184px; display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; border: 1px solid #eef1f6; border-radius: 13px; background: #fff; text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.upload-card { container-type: inline-size; }
.material-card:hover { background: var(--subtle); border-color: var(--line); }
.material-card.active { background: var(--blue-pale); border-color: #bfcfff; }
.material-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; display: block; overflow: hidden; border-radius: 12px 12px 7px 7px; background: #d8e2ff; }
.material-thumb::before, .material-thumb::after { content: ""; position: absolute; border-radius: 50%; }
.material-thumb::before { width: 42%; aspect-ratio: 1; right: -8%; top: 12%; background: rgba(255,255,255,.5); }
.material-thumb::after { width: 56%; height: 30%; left: -7%; bottom: -8%; border-radius: 60% 50% 0 0; background: rgba(20,29,54,.32); transform: rotate(-8deg); }
.material-thumb.has-thumbnail { background: #111827; }
.material-thumb.has-thumbnail::before, .material-thumb.has-thumbnail::after { content: none; }
.material-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.thumb-violet { background: #dcd7f7; }
.thumb-sky { background: #c9e7f1; }
.thumb-ink { background: #3b475c; }
.material-thumb i { position: absolute; z-index: 2; right: 9px; bottom: 8px; padding: 4px 7px; border-radius: 6px; background: rgba(18,22,31,.72); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; }
.material-card-body { display: grid; grid-template-rows: auto auto minmax(26px, auto); gap: 3px; min-height: 86px; padding: 10px 12px 10px; }
.material-card strong { display: block; min-width: 0; overflow: hidden; margin: 0; font-size: 15px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.material-card small { display: block; min-width: 0; overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.material-card-footer { min-width: 0; min-height: 26px; display: flex; align-items: flex-end; padding-right: 44px; }
.material-card-progress { min-width: 0; display: block; align-self: end; }
.material-card-progress .upload-progress { margin: 9px 0 0; }
.material-classification { box-sizing: border-box; display: block; width: max-content; max-width: 100%; height: 22px; padding: 0 7px; overflow: hidden; border: 1px solid #d9e2f7; border-radius: 7px; background: #f8fbff; color: #42526b; font-size: 10px; font-weight: 800; line-height: 20px; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; }
.material-classification.is-completed { border-color: #c8d5ff; background: var(--blue-pale); color: var(--blue); }
.material-classification.is-running { border-color: #bfdbfe; background: #eff6ff; color: #2563eb; }
.material-classification.is-failed { border-color: #fecaca; background: #fff1f2; color: #dc2626; }
.material-classification.is-pending { border-color: #e5e7eb; background: #f9fafb; color: #6b7280; }
.material-more { position: absolute; z-index: 8; right: 10px; bottom: 8px; box-sizing: border-box; flex: 0 0 34px; width: 34px; min-width: 34px; max-width: 34px; height: 34px; min-height: 34px; max-height: 34px; aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 0; line-height: 0; border: 1px solid transparent; border-radius: 10px; background: rgba(255,255,255,.82); color: #9aa3b2; cursor: pointer; opacity: .94; pointer-events: auto; touch-action: manipulation; user-select: none; transition: opacity .18s ease, color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.material-more svg { display: block; flex: 0 0 18px; width: 18px; min-width: 18px; max-width: 18px; height: 18px; min-height: 18px; max-height: 18px; aspect-ratio: 1 / 1; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; transform: none; }
.material-more:hover, .material-more:focus-visible, .material-more.is-open { opacity: 1; border-color: #c8d5ff; background: var(--blue-pale); color: var(--blue); box-shadow: 0 8px 22px rgba(47,99,245,.12); outline: none; }
.material-more:disabled { opacity: .55; cursor: wait; transform: none; }
.has-upload-pause .material-thumb i { right: 62px; }
.material-upload-pause { position: absolute; z-index: 6; top: 62px; top: calc(56.25cqw - 36px); right: 9px; height: 28px; padding: 0 10px; border: 1px solid #c8d5ff; border-radius: 9px; background: rgba(255,255,255,.94); color: var(--blue); font-size: 10px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 22px rgba(47,99,245,.12); transition: background .18s ease, transform .18s ease, border-color .18s ease; }
.material-upload-pause:hover, .material-upload-pause:focus-visible { border-color: #9eb5ff; background: var(--blue-pale); outline: none; transform: translateY(-1px); }
.material-card-shell.is-deleting .material-card { opacity: .58; pointer-events: none; }
.material-empty { grid-column: 1 / -1; width: 100%; min-height: 128px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 17px 18px; border: 1px dashed #cbd5e8; border-radius: 10px; background: var(--blue-pale); }
.material-empty span { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.material-empty strong { margin: 7px 0 12px; color: var(--text); font-size: 12px; line-height: 1.45; }
.material-empty button { height: 28px; padding: 0 10px; border: 1px solid var(--blue); border-radius: 7px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 700; cursor: pointer; }
.material-empty.is-error { border-color: #fecaca; background: #fff7f7; }
.material-empty.is-error span { color: #dc2626; }
.material-loading { grid-column: 1 / -1; width: 100%; display: grid; gap: 12px; padding: 2px 0 4px; }
.material-loading-copy { padding: 2px 2px 0; }
.material-loading-copy span { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.material-loading-copy strong { display: block; margin-top: 6px; color: var(--text); font-size: 12px; line-height: 1.45; }
.material-skeleton-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
.material-skeleton-grid i { position: relative; min-height: 166px; overflow: hidden; border-radius: 13px; border: 1px solid #e3e9ff; background: linear-gradient(180deg, #f4f7ff, #ffffff); }
.material-skeleton-grid i::before { content: ""; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px 12px 7px 7px; background: #dfe8ff; }
.material-skeleton-grid i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: cutcut-shimmer 1.25s infinite; }
.upload-card { position: relative; cursor: default; }
.thumb-upload { background: #e4edff; }
.upload-progress { display: block; height: 4px; margin: 10px 12px 0; overflow: hidden; border-radius: 2px; background: #dfe6f4; }
.upload-progress i { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .3s ease; }
.upload-progress.is-indeterminate i { width: 42%; animation: cutcut-progress-slide 1.1s ease-in-out infinite; }

.chat-section { width: 100%; min-width: 0; min-height: 0; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.chat-history { min-width: 0; min-height: 0; padding: 18px; overflow-x: hidden; overflow-y: auto; scrollbar-color: #dfe3ea transparent; scrollbar-width: thin; }
.message { min-width: 0; max-width: 100%; display: flex; align-items: flex-start; gap: 8px; margin-bottom: 17px; }
.message.user { justify-content: flex-end; }
.message > div { min-width: 0; max-width: min(88%, 100%); }
.message p { min-width: 0; margin: 0; padding: 10px 12px; overflow-wrap: anywhere; word-break: break-word; border-radius: 4px 12px 12px 12px; background: var(--subtle); color: var(--text); font-size: 12px; line-height: 1.55; }
.message.user p { border-radius: 12px 4px 12px 12px; background: var(--blue); color: #fff; }
.message small { display: block; margin-top: 5px; color: var(--faint); font-size: 9px; }
.message.user small { text-align: right; }
.find-choice-list { min-width: 0; display: grid; gap: 8px; margin-top: 8px; }
.find-choice-card { min-width: 0; padding: 10px; border: 1px solid #dce5ff; border-radius: 12px; background: #fff; box-shadow: 0 8px 22px rgba(17,24,39,.05); }
.find-choice-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.find-choice-head span { flex: 0 0 auto; color: var(--blue); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.find-choice-head strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.find-choice-card p { min-width: 0; margin: 7px 0 0; padding: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 10px; line-height: 1.45; }
.find-choice-card .find-choice-preview { color: var(--text); font-size: 11px; }
.find-choice-card button { width: 100%; height: 30px; margin-top: 9px; border: 1px solid var(--blue); border-radius: 8px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 800; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.find-choice-card button:hover:not(:disabled) { background: var(--blue-strong); border-color: var(--blue-strong); transform: translateY(-1px); }
.find-choice-card.is-selected { border-color: #a9bcff; background: var(--blue-pale); box-shadow: inset 0 0 0 1px #d8e2ff; }
.find-choice-card.is-muted { opacity: .62; }
.find-choice-card button:disabled { border-color: #d9dde4; background: #eef1f6; color: var(--muted); cursor: default; transform: none; }
.find-choice-card.is-selected button:disabled { border-color: #b9c9ff; background: #dfe8ff; color: var(--blue-strong); }
.find-run-retry { height: 30px; margin-top: 9px; padding: 0 13px; border: 1px solid #cfd8f5; border-radius: 7px; background: #f4f7ff; color: var(--blue-strong); font-size: 10px; font-weight: 750; cursor: pointer; }
.find-run-retry:hover { border-color: #9eb3f5; background: var(--blue-soft); }
.find-run-diagnostic { display: block; margin-top: 7px; color: #7a5d13; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.find-run-diagnostic.is-running { color: #68748a; }
.find-run-diagnostic.is-recovering { color: #8a6a18; }
.find-run-diagnostic.is-failed { color: #b42318; }
.find-run-diagnostic.is-no_match,
.find-run-diagnostic.is-needs_choice,
.find-run-diagnostic.is-success { color: #68748a; }
.find-run-diagnostic.is-warning { color: #9a6700; }
.assistant-avatar { flex: 0 0 23px; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 800; }
.composer { width: calc(100% - 28px); min-width: 0; margin: 0 14px 14px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.composer:focus-within { border-color: #9db4ff; box-shadow: 0 0 0 3px rgba(47,99,245,.08); }
.composer-context { min-width: 0; padding: 8px 10px 0; }
.composer-context[hidden] { display: none; }
.context-chip { max-width: 100%; display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid #dce5ff; border-radius: 999px; background: #f5f8ff; color: #1f2937; font-size: 10px; font-weight: 750; line-height: 1; }
.context-chip.is-disabled { opacity: .62; }
.context-chip-label { color: var(--blue); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.context-chip-title { min-width: 0; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-chip-meta { color: var(--muted); font-weight: 650; }
.composer textarea { width: 100%; min-width: 0; min-height: 66px; max-height: 120px; resize: vertical; padding: 12px 12px 4px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; line-height: 1.5; }
.composer textarea::placeholder { color: #a1a7b0; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; padding: 5px 7px 7px 10px; }
.composer-tools { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 9px; }
.composer-tools button { width: 25px; height: 25px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.composer-tools button:hover { background: var(--subtle); color: var(--blue); }
.query-mode-bar { min-width: 0; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 8px 11px 0; color: var(--faint); font-size: 9px; font-weight: 700; }
.send-button { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: var(--blue); color: #fff; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.send-button:hover { background: var(--blue-strong); transform: translateY(-1px); }
.send-button:disabled { background: #c9cfda; cursor: default; transform: none; }
.send-button:disabled:hover { background: #c9cfda; transform: none; }

.review-stage { grid-column: 3; grid-row: 2; min-width: 0; display: grid; background: #fff; }

.document-grid { min-width: 0; min-height: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 8px minmax(0, var(--source-width)); }
.document-panel.source-panel { grid-column: 1; grid-row: 3; grid-template-rows: minmax(0, 1fr) auto; }
.conversation-panel { grid-column: 3; grid-row: 1; }
.source-toolbar { display: flex; justify-content: flex-end; padding: 10px 18px; border-top: 1px solid var(--line); background: #fff; }
.conversation-rail.source-closed { grid-template-rows: minmax(0, 1fr); }
.conversation-rail.source-closed .source-panel, .conversation-rail.source-closed .rail-resize-handle { display: none; }
.inner-handle { grid-column: 2; grid-row: 1; }
.cut-panel { grid-column: 1; grid-row: 1; }
.document-panel { min-width: 0; min-height: 0; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); background: #fff; }
.document-panel + .document-panel { border-left: 1px solid var(--line); }
.cut-panel { grid-template-rows: auto minmax(0, 1fr); background: #fbfcff; }
.document-header { min-width: 0; min-height: 88px; overflow: hidden; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 14px; border-bottom: 1px solid var(--line); }
.document-header > div { min-width: 0; }
.document-header h3 { overflow: hidden; margin: 7px 0 3px; font-size: 15px; line-height: 1.2; letter-spacing: -.02em; white-space: nowrap; text-overflow: ellipsis; }
.document-header p { margin: 0; color: var(--muted); font-size: 10px; }
.document-header .edit-flow-title { margin: 4px 0; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.document-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.document-label i { width: 6px; height: 6px; border-radius: 50%; }
.source-dot { background: #8c94a1; }
.cut-dot { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.quiet-button { flex: 0 0 auto; width: 29px; height: 29px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); cursor: pointer; }
.quiet-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quiet-button:hover { color: var(--blue); border-color: #c8d4fa; }
.quiet-button:disabled { cursor: not-allowed; color: #c2c9d6; border-color: #e3e7ef; background: #f8fafc; }
.quiet-button:disabled:hover { color: #c2c9d6; border-color: #e3e7ef; }
.source-file-export.is-loading svg { opacity: .55; }
.preview-header-actions { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 6px; }
.preview-header-actions .subtitle-source-export { margin-top: 4px; }
.subtitle-source-export.is-loading svg { opacity: .55; }
.document-actions { flex: 0 0 auto; display:flex; gap:6px; }.source-close { font-size:16px; line-height:1; }

.document-scroll { min-height: 0; overflow-y: auto; scrollbar-color: #dfe3ea transparent; scrollbar-width: thin; outline: 0; }
.document-scroll:focus, .document-scroll:focus-visible { outline: 0; }
.source-document { padding: 20px 22px 40px; }
.source-empty { min-height: 100%; display: grid; align-content: center; justify-items: center; padding: 40px 20px; text-align: center; }
.source-empty::before { content: ""; width: 52px; height: 52px; margin-bottom: 16px; border: 1px dashed #b9c8ff; border-radius: 14px; background: linear-gradient(135deg, #f6f8ff, #edf3ff); }
.source-empty span { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.source-empty strong { max-width: 280px; margin-top: 8px; color: var(--text); font-size: 14px; line-height: 1.55; }
.source-empty p { max-width: 310px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.chapter { margin-bottom: 30px; }
.chapter:last-child { margin-bottom: 0; }
.chapter-heading { display: grid; grid-template-columns: 44px 1fr; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.chapter-heading time { color: var(--blue); font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chapter-heading h4 { margin: 0; font-size: 12px; font-weight: 700; }
.chapter p { margin: 0 0 12px 54px; color: #4a4f58; font-family: ui-serif, "Songti SC", "STSong", serif; font-size: 13px; line-height: 1.82; overflow-wrap: anywhere; word-break: break-word; }
.chapter p:last-child { margin-bottom: 0; }
.source-line-time { color: var(--faint); font-family: ui-sans-serif, sans-serif; font-size: 8px; vertical-align: .08em; }

.cut-content-grid { min-width: 0; min-height: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 8px var(--subtitle-style-width); }
.preview-document { grid-column: 1; grid-row: 1; padding: 14px 20px 30px; counter-reset: subtitle; }
.subtitle-style-handle { grid-column: 2; grid-row: 1; }
.subtitle-style-shell { grid-column: 3; grid-row: 1; min-width: 0; min-height: 0; overflow: hidden; background: #fff; }
.subtitle-style-panel { height: 100%; min-height: 0; overflow-y: auto; display: block; padding: 14px 10px 16px; scrollbar-color: #dfe3ea transparent; scrollbar-width: thin; }
.subtitle-style-preview { --subtitle-preview-frame-size: 9px; position: relative; justify-self: stretch; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; border: 0; border-radius: 14px; background: linear-gradient(180deg, #141922, #232c3a 52%, #10141c); box-shadow: inset 0 0 0 1px #dbe4ff, inset 0 0 0 1px rgba(255,255,255,.06); }
.subtitle-style-preview::before { content: ""; position: absolute; width: 48%; aspect-ratio: 1 / 1; right: -15%; top: 5%; border-radius: 50%; background: rgba(255,255,255,.11); }
.subtitle-style-preview::after { content: ""; position: absolute; width: 72%; height: 14%; left: -22%; bottom: 3%; border-radius: 60% 45% 0 0; background: rgba(103,132,203,.32); transform: rotate(-9deg); }
.style-preview-frame { position: absolute; z-index: 2; right: 4%; top: 3%; color: rgba(255,255,255,.58); font-size: var(--subtitle-preview-frame-size); font-weight: 800; }
.subtitle-style-drag { position: absolute; z-index: 3; left: 0; top: 0; box-sizing: border-box; max-width: none; padding: 0; border: 0; border-radius: 0; background: transparent; color: #ffffff; text-align: center; white-space: pre; overflow-wrap: normal; cursor: grab; touch-action: none; transform: none; box-shadow: none; }
.subtitle-style-drag svg { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.subtitle-style-drag[data-subtitle-preview-state="loading"], .subtitle-style-drag[data-subtitle-preview-state="error"] { left: 50%; top: 72%; width: max-content; max-width: 90%; padding: 8px; border-radius: 7px; background: rgba(0,0,0,.7); font-size: 11px; white-space: normal; cursor: default; transform: translateX(-50%); }
.subtitle-style-drag:active { cursor: grabbing; }
.subtitle-style-controls { min-width: 0; display: grid; grid-template-columns: 1fr; gap: 12px; align-content: start; padding: 14px 2px 0; }
.subtitle-preset-row { display: grid; grid-template-columns: 1fr; gap: 7px; }
.subtitle-preset-row button { min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 750; cursor: pointer; }
.subtitle-preset-row button.is-active, .subtitle-preset-row button:hover, .subtitle-preset-row button:focus-visible { border-color: #adc0ff; background: var(--blue-pale); color: var(--blue); outline: none; }
.subtitle-style-controls label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.subtitle-range-control > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.subtitle-range-control output { color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.subtitle-style-controls input[type="color"] { width: 100%; height: 30px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.subtitle-style-controls input[type="range"] { width: 100%; accent-color: var(--blue); cursor: pointer; }
.subtitle-line { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: start; gap: 10px; margin: 0 -8px; padding: 10px 8px; border-bottom: 1px solid #eceff5; border-radius: 6px; cursor: pointer; transition: background .16s ease; counter-increment: subtitle; }
.subtitle-line:hover { background: #f4f7ff; }
.subtitle-line.is-muted { opacity: .42; }
.subtitle-line .line-number { color: var(--faint); font-size: 9px; font-variant-numeric: tabular-nums; }
.subtitle-line .line-number::before { content: counter(subtitle, decimal-leading-zero); }
.subtitle-line p { margin: 0; color: #303640; font-size: 13px; line-height: 1.55; }
.subtitle-line time { color: var(--faint); font-size: 8px; font-variant-numeric: tabular-nums; }
.preview-intro { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 6px 1px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.preview-intro strong { color: var(--blue); font-size: 9px; }
.preview-empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px; text-align: center; }
.preview-empty::before { content: "Aa"; width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 15px; border: 1px solid #c8d5ff; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 800; }
.preview-empty span { color: var(--blue); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.preview-empty strong { max-width: 260px; margin-top: 8px; color: var(--text); font-size: 13px; line-height: 1.55; }
.preview-empty p { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.source-empty.is-loading::before, .preview-empty.is-loading::before { content: ""; border-style: solid; border-color: #c8d5ff; border-top-color: var(--blue); border-radius: 50%; background: transparent; color: transparent; animation: cutcut-spin .85s linear infinite; }
.source-empty.is-error::before, .preview-empty.is-error::before { content: ""; border-color: #fecaca; background: #fff7f7; }
.source-empty.is-error span, .preview-empty.is-error span { color: #dc2626; }
.confirm-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid var(--blue); border-radius: 8px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 650; white-space: nowrap; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.confirm-button:hover { border-color: var(--blue-strong); background: var(--blue-strong); transform: translateY(-1px); }
.confirm-button:disabled { border-color: #ccd1db; background: #ccd1db; cursor: default; transform: none; }
.document-header .confirm-button { flex: 0 0 auto; align-self: flex-start; }

.task-panel { grid-column: 5; grid-row: 1 / 3; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; border-left: 0; background: #fafbfc; }
.task-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.task-count { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 10px; }
.task-count strong { color: var(--ink); }
.task-filter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 12px 14px 6px; padding: 3px; border-radius: 8px; background: #eef0f3; }
.task-filter button { height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.task-filter button.active { background: #fff; color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(28,32,40,.07); }
.task-list { min-height: 0; padding: 7px 14px 20px; overflow-y: auto; scrollbar-color: #dfe3ea transparent; scrollbar-width: thin; }
.task-empty { min-height: 178px; display: grid; align-content: center; justify-items: center; padding: 24px 18px; border: 1px dashed #cbd5e8; border-radius: 12px; background: linear-gradient(180deg, #f8faff, #fff); text-align: center; }
.task-empty span { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.task-empty strong { max-width: 210px; margin-top: 8px; color: var(--text); font-size: 13px; line-height: 1.5; }
.task-empty p { max-width: 230px; margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.task-item { position: relative; margin-bottom: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.task-item.is-hidden { display: none; }
.task-item.is-new { border-color: #aebfff; }
@keyframes task-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.task-status { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.task-status span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 700; }
.task-status span i { width: 6px; height: 6px; border-radius: 50%; background: #a5abb5; }
.task-status small { color: var(--muted); font-size: 9px; font-weight: 700; }
.task-item.running .task-status span { color: var(--blue); }
.task-item.running .task-status span i { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.task-item.running .task-status small, .task-item.waiting .task-status small { color: var(--blue); font-weight: 850; }
.task-item.waiting .task-status span { color: var(--warning); }
.task-item.waiting .task-status span i { background: #e69b36; }
.task-item.done .task-status span { color: var(--success); }
.task-item.done .task-status span i { background: var(--success); }
.task-item.failed .task-status span { color: #dc2626; }
.task-item.failed .task-status span i { background: #dc2626; box-shadow: 0 0 0 4px #fee2e2; }
.task-item > strong { display: block; overflow: hidden; font-size: 12px; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
.task-item > p { margin: 5px 0 11px; color: var(--muted); font-size: 9px; }
.task-item > p.task-error { display: -webkit-box; margin-top: -5px; color: #dc2626; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.45; }
.task-progress { display: block; height: 3px; margin: 11px 0; overflow: hidden; border-radius: 2px; background: #e9ecf2; }
.task-progress i { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .5s ease; }
.task-item footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; color: var(--faint); font-size: 8px; }
.task-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.view-button { width: 100%; height: 31px; margin-top: 3px; border: 1px solid #cfd8f5; border-radius: 7px; background: var(--blue-pale); color: var(--blue-strong); font-size: 10px; font-weight: 650; cursor: pointer; }
.view-button:hover { border-color: #9eb3f5; background: var(--blue-soft); }
.queue-note { display: flex; align-items: center; gap: 8px; padding: 12px 15px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 9px; line-height: 1.4; }
.queue-note svg { flex: 0 0 auto; color: var(--blue); }

.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 8px; background: #20242c; color: #fff; font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .2s ease, transform .2s ease; box-shadow: 0 8px 25px rgba(13,17,25,.16); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(15,20,31,.38); cursor: pointer; }
.modal-card { position: relative; width: min(420px, 100%); padding: 25px; border: 1px solid rgba(255,255,255,.9); border-radius: 14px; background: #fff; text-align: center; box-shadow: 0 24px 70px rgba(15,20,31,.22); }
.modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--subtle); color: var(--muted); cursor: pointer; }
.modal-kicker { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.video-placeholder { position: relative; width: 110px; height: 180px; margin: 15px auto; overflow: hidden; border-radius: 10px; background: #1b2d5f; }
.video-placeholder::before { content: ""; position: absolute; width: 135px; height: 135px; left: -33px; bottom: -20px; border-radius: 50%; background: #6e8fe7; }
.video-placeholder::after { content: ""; position: absolute; width: 100px; height: 100px; right: -30px; top: 16px; border-radius: 50%; background: #d3dfff; }
.video-placeholder span { position: absolute; z-index: 2; top: 9px; right: 9px; color: rgba(255,255,255,.8); font-size: 8px; }
.video-placeholder i { position: absolute; z-index: 2; left: 50%; top: 50%; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.88); transform: translate(-50%,-50%); }
.modal-card h2 { margin: 12px 0 7px; font-size: 18px; }
.modal-card p { margin: 0 auto 18px; max-width: 310px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.media-domain-gate { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(248,250,255,.96); backdrop-filter: blur(10px); }
.media-domain-gate-open { overflow: hidden; }
.media-domain-card { width: min(540px, 100%); padding: 28px; border: 1px solid rgba(226,232,246,.95); border-radius: 16px; background: #fff; text-align: left; box-shadow: 0 24px 80px rgba(15,20,31,.16); }
.media-domain-card h2 { margin: 12px 0 8px; color: var(--ink); font-size: 22px; line-height: 1.25; }
.media-domain-card p { max-width: none; margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.media-domain-form { display: grid; gap: 14px; }
.media-domain-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.media-domain-option { min-height: 48px; display: flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font-size: 13px; font-weight: 800; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease; }
.media-domain-option:hover, .media-domain-option:focus-visible { border-color: #adc0ff; background: var(--blue-pale); color: var(--blue); outline: none; }
.media-domain-option.is-selected { border-color: #9eb3f5; background: var(--blue-soft); color: var(--blue-strong); box-shadow: inset 0 0 0 1px rgba(47,99,245,.12); }
.media-domain-form small { min-height: 18px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.media-domain-form small.is-error { color: #dc2626; }
.media-domain-submit { justify-self: end; min-width: 112px; }
.delete-modal { z-index: 40; }
.delete-modal-card { text-align: left; }
.delete-modal-card h2 { margin-top: 12px; }
.delete-modal-card p { max-width: none; margin: 0 0 18px; }
.danger-kicker { color: #dc2626; }
.delete-modal-actions { display: flex; justify-content: flex-end; gap: 9px; }
.rename-modal { z-index: 42; }
.rename-modal-card { text-align: left; }
.rename-modal-card h2 { margin: 12px 0 16px; }
.rename-form input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; background: #fff; color: var(--ink); font-size: 13px; font-weight: 650; }
.rename-form input:focus { border-color: #9db4ff; box-shadow: 0 0 0 3px rgba(47,99,245,.08); }
.rename-form small { display: block; min-height: 18px; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.rename-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 14px; }
.phrase-modal { z-index: 45; }
.phrase-modal-card { width: min(500px, 100%); text-align: left; }
.phrase-modal-card h2 { margin: 12px 0 8px; }
.phrase-modal-card .phrase-modal-copy { max-width: none; margin: 0 0 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.phrase-bind-form label { color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.phrase-bind-form { margin: 0 0 14px; }
.phrase-bind-form label { display: block; margin-bottom: 7px; }
.phrase-tags-input { min-height: 96px; max-height: 206px; display: flex; flex-wrap: wrap; align-content: flex-start; align-items: flex-start; gap: 8px; padding: 10px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; cursor: text; transition: border-color .18s ease, box-shadow .18s ease; }
.phrase-tags-input:focus-within { border-color: #9db4ff; box-shadow: 0 0 0 3px rgba(47,99,245,.08); }
.phrase-tags-input.is-error { border-color: #fca5a5; box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.phrase-tags-input.is-error:focus-within { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.phrase-tags-input input { flex: 1 1 180px; min-width: 160px; height: 30px; padding: 0 2px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 650; }
.phrase-tags-input input::placeholder { color: #8d96a6; }
.phrase-done-button { min-height: 38px; padding: 0 18px; border-radius: 9px; font-size: 11px; }
.phrase-bind-form small { display: block; min-height: 17px; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.phrase-word-list { display: contents; }
.phrase-word-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 30px; padding: 0 7px 0 10px; border: 1px solid #dbe4ff; border-radius: 999px; background: #eef3ff; color: var(--blue-strong); font-size: 11px; font-weight: 800; }
.phrase-word-chip span { overflow: hidden; max-width: 136px; white-space: nowrap; text-overflow: ellipsis; }
.phrase-word-chip button { width: 18px; height: 18px; min-width: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 999px; background: rgba(47,99,245,.12); color: var(--blue-strong); cursor: pointer; }
.phrase-word-chip button:hover { background: rgba(47,99,245,.2); }
.phrase-modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 2px; }
.material-global-menu { position: fixed; z-index: 80; min-width: 104px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.99); box-shadow: 0 16px 44px rgba(15,20,31,.2); }
.material-global-menu button { width: 100%; height: 32px; display: flex; align-items: center; justify-content: flex-start; gap: 7px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 11px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.material-global-menu button:hover, .material-global-menu button:focus-visible { background: var(--blue-pale); color: var(--blue); outline: none; }
.material-global-menu button.is-danger { color: #dc2626; }
.material-global-menu button.is-danger:hover, .material-global-menu button.is-danger:focus-visible { background: #fff1f2; color: #b91c1c; }
.secondary-button, .danger-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--text); }
.secondary-button:hover { border-color: #cbd5e8; background: var(--subtle); }
.danger-button { border: 1px solid #dc2626; background: #dc2626; color: #fff; }
.danger-button:hover { border-color: #b91c1c; background: #b91c1c; transform: translateY(-1px); }
.danger-button:disabled { border-color: #fca5a5; background: #fca5a5; cursor: wait; transform: none; }

@media (max-width: 1280px) {
  body { overflow: auto; }
  .app-frame { width: 100%; height: auto; min-height: 100vh; }
  .workspace { height: auto; min-height: 100vh; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: 56px minmax(720px,auto) auto; overflow: visible; }
  .shared-header { grid-column: 2; grid-row: 1; }
  .resize-handle { display: none; }
  .document-grid { grid-template-columns: minmax(360px, 1fr) minmax(280px, min(35vw, 406px)); }
  .cut-content-grid { grid-template-columns: minmax(0, 1fr) var(--subtitle-style-width); }
  .conversation-panel { grid-column: 2; }
  .cut-panel { grid-column: 1; }
  .preview-document { grid-column: 1; }
  .subtitle-style-shell { grid-column: 2; }
  .conversation-rail { grid-column: 1; grid-row: 1 / 3; min-height: 776px; border-right: 1px solid var(--line); }
  .review-stage { grid-column: 2; grid-row: 2; min-height: 720px; }
  .task-panel { grid-column: 1 / -1; grid-row: 3; min-height: 300px; grid-template-rows: auto auto auto auto; border-top: 1px solid var(--line); border-left: 0; }
  .task-list { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 10px; overflow-x: auto; }
  .task-item { margin-bottom: 0; }
}

@media (max-width: 820px) {
  .workspace { display: flex; flex-direction: column; }
  .conversation-rail { order: 0; flex-shrink: 0; }
  .shared-header { order: 1; flex-shrink: 0; }
  .review-stage { order: 2; }
  .task-panel { order: 3; }
  .conversation-rail .source-panel { min-height: 0; }
  .shared-header { height: 56px; }
  .conversation-rail { height: 680px; min-height: 680px; grid-template-rows: minmax(150px,var(--library-height)) 8px minmax(220px,1fr); border-right: 0; border-bottom: 1px solid var(--line); }
  .material-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-stage { min-height: 960px; }
  .document-grid { grid-template-columns: 1fr; }
  .conversation-panel, .cut-panel { grid-column: 1; }
  .conversation-panel { grid-row: 2; min-height: 410px; }
  .cut-panel { grid-row: 1; }
  .document-panel { min-height: 410px; }
  .document-panel + .document-panel { border-top: 1px solid var(--line); border-left: 0; }
  .cut-content-grid { grid-template-columns: 1fr; }
  .preview-document, .subtitle-style-shell { grid-column: 1; }
  .preview-document { grid-row: 1; }
  .subtitle-style-shell { grid-row: 2; border-top: 1px solid var(--line); border-left: 0; }
  .subtitle-style-panel { grid-template-columns: minmax(180px, 40vw) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); padding-bottom: 16px; }
  .subtitle-style-controls { padding-bottom: 0; }
  .task-list { grid-template-columns: minmax(235px, .8fr) minmax(235px, .8fr) minmax(235px, .8fr); }
}

@media (max-width: 520px) {
  .shared-header { padding-inline: 10px; gap: 7px; }
  .shared-header .brand strong { display: none; }
  .material-strip { grid-template-columns: 1fr; }
  .shared-header .account-button { max-width: 58px; }
  .shared-header .account-button strong { display: none; }
  .task-tab { min-width: 112px; }
  .account-button { padding-right: 7px; }
  .source-document, .preview-document { padding-inline: 16px; }
  .subtitle-style-panel { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); padding-inline: 16px; padding-bottom: 0; }
  .subtitle-style-controls { grid-template-columns: 1fr; }
  .chapter p { margin-left: 0; }
  .chapter-heading { grid-template-columns: 42px 1fr; }
}

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

@keyframes cutcut-progress-slide {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(80%); }
  100% { transform: translateX(245%); }
}

/* Complete lightweight originals keep true paragraph timestamps; batches only limit DOM. */
.source-document .original-paragraph { margin: 0 0 14px; color: #4a4f58; font-family: ui-serif, "Songti SC", "STSong", serif; font-size: 13px; line-height: 1.82; overflow-wrap: anywhere; word-break: break-word; }
.source-document .original-paragraph .source-line-time { display: inline-block; min-width: 38px; margin-right: 8px; }
.source-empty [data-original-retry] { margin-top: 12px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--blue); cursor: pointer; }

/* The compact workspace has automatic outer height; keep full original text locally scrollable. */
@media (min-width: 821px) and (max-width: 1280px) {
  .conversation-rail .source-panel { max-height: 60vh; }
}

/* Read-only Plan preview. Keep the surrounding CutCut workspace unchanged. */
.cut-panel { background: var(--surface); }
.cut-content-grid { display: block; min-width: 0; min-height: 0; }
.preview-document { height: 100%; padding: 18px 20px 24px; container-type: inline-size; }
.plan-preview { min-width: 0; display: grid; gap: 12px; align-content: start; }
.plan-frame { position: relative; width: 100%; min-width: 0; aspect-ratio: var(--plan-aspect-ratio, 16 / 9); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--subtle) url('/assets/preview-line-art.svg') center / contain no-repeat; }
.plan-frame img, .plan-frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.plan-reference { position: absolute; inset: auto 7% 8%; margin: 0; min-width: 0; color: var(--text); font-size: 12px; line-height: 1.6; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-note { position: absolute; top: 10px; left: 12px; max-width: calc(100% - 24px); color: var(--muted); font-size: 9px; line-height: 1.5; }
.plan-transport { min-width: 0; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.plan-play { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font-size: 10px; cursor: pointer; }
.plan-play:hover:not(:disabled) { color: var(--blue); border-color: var(--line-strong); background: var(--subtle); }
.plan-play:disabled { color: var(--faint); cursor: default; }
.plan-time { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-transport-note { color: var(--faint); font-size: 9px; margin-left: auto; }
.plan-settings-button, [data-subtitle-settings-open] { flex: 0 0 auto; margin-left: auto; min-height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font: inherit; font-size: 10px; cursor: pointer; }
.plan-settings-button:hover, [data-subtitle-settings-open]:hover { border-color: var(--line-strong); color: var(--blue); background: var(--subtle); }
.plan-timeline { position: relative; min-width: 0; display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 5px 0; }
.plan-track-label { grid-column: 1; grid-row: 1; color: var(--muted); font-size: 10px; line-height: 1.4; font-weight: 500; user-select: none; }
.plan-track { grid-column: 2; grid-row: 1; min-width: 0; position: relative; display: flex; align-items: stretch; height: 22px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--subtle); }
.plan-track + .plan-track { margin-top: 6px; }
.plan-segment { flex: 0 0 auto; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; box-shadow: inset -1px 0 var(--line-strong); container-type: inline-size; color: var(--muted); background: var(--subtle); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; pointer-events: none; }
.plan-segment:last-child { box-shadow: none; }
.plan-segment span { display: block; width: 100%; min-width: 0; padding: 0 5px; overflow: hidden; text-overflow: ellipsis; }
.plan-playhead { appearance: none; -webkit-appearance: none; position: absolute; z-index: 2; inset: 0 -8px 0 20px; width: calc(100% - 12px); height: 100%; margin: 0; padding: 0; border: 0; background: transparent; outline: none; pointer-events: none; touch-action: none; }
.plan-playhead::-webkit-slider-runnable-track { height: 100%; background: transparent; pointer-events: none; }
.plan-playhead::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 16px; height: 100%; min-height: 32px; border: 0; border-radius: 0; background: linear-gradient(var(--blue), var(--blue)) center / 2px 100% no-repeat, linear-gradient(var(--blue), var(--blue)) center top / 10px 4px no-repeat; cursor: ew-resize; pointer-events: auto; }
.plan-playhead::-moz-range-track { height: 100%; background: transparent; pointer-events: none; }
.plan-playhead::-moz-range-thumb { width: 16px; height: 32px; border: 0; border-radius: 0; background: linear-gradient(var(--blue), var(--blue)) center / 2px 100% no-repeat, linear-gradient(var(--blue), var(--blue)) center top / 10px 4px no-repeat; cursor: ew-resize; pointer-events: auto; }
.plan-playhead:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.plan-playhead:disabled::-webkit-slider-thumb { opacity: .35; cursor: default; }
.plan-playhead:disabled::-moz-range-thumb { opacity: .35; cursor: default; }
.plan-empty { min-height: 180px; display: grid; align-content: center; justify-items: center; padding: 24px 16px; color: var(--muted); text-align: center; }
.plan-empty strong { color: var(--text); font-size: 13px; line-height: 1.6; }
.plan-empty p { max-width: 280px; margin: 8px 0 0; font-size: 10px; line-height: 1.6; }

/* One original subtitle settings instance inside a native second-level dialog. */
.subtitle-settings-dialog { width: min(720px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); padding: 20px; border: 1px solid var(--line); border-radius: 14px; overflow-y: auto; color: var(--text); background: var(--surface); box-shadow: 0 24px 70px rgba(15,20,31,.18); scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.subtitle-settings-dialog::backdrop { background: rgba(15,20,31,.38); }
.subtitle-settings-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subtitle-settings-header h2 { margin: 0; font-size: 15px; line-height: 1.4; color: var(--ink); }
.subtitle-settings-close { flex: 0 0 auto; }
.subtitle-settings-status { margin: 8px 0 14px; min-height: 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.subtitle-settings-status[data-state="error"] { color: #b42318; }
.subtitle-settings-dialog .subtitle-style-shell { display: block; border: 0; overflow: visible; }
.subtitle-settings-dialog .subtitle-style-panel { height: auto; display: grid; grid-template-columns: minmax(0, 244px) minmax(0, 1fr); gap: 24px; align-items: start; padding: 0; overflow: visible; }
.subtitle-settings-dialog .subtitle-style-preview { border-radius: 10px; }
.subtitle-settings-dialog .subtitle-style-controls { padding: 0; gap: 13px; }
.subtitle-settings-dialog .subtitle-preset-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.subtitle-settings-dialog .subtitle-preset-row button { padding: 0 4px; font-weight: 600; }
.subtitle-settings-dialog .subtitle-style-controls label { font-size: 10px; font-weight: 500; letter-spacing: 0; }
.subtitle-settings-dialog .subtitle-style-controls input { margin: 0; min-width: 0; }
@container (max-width: 350px) {
  .plan-transport-note { display: none; }
  .plan-reference { font-size: 11px; }
  .plan-segment { font-size: 8px; }
}
@container (max-width: 24px) {
  .plan-segment span { visibility: hidden; }
}
@media (max-width: 560px) {
  .subtitle-settings-dialog { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 16px; }
  .subtitle-settings-dialog .subtitle-style-panel { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .subtitle-settings-dialog .subtitle-style-preview { width: min(180px, 100%); justify-self: center; }
  .subtitle-settings-dialog .subtitle-style-controls { padding: 0 0 4px; }
  .preview-document { padding: 16px; }
}
.subtitle-settings-status [data-subtitle-settings-retry] { margin-left: 6px; padding: 0; border: 0; background: transparent; color: var(--blue); font: inherit; cursor: pointer; }
.subtitle-settings-status [data-subtitle-settings-retry]:hover { text-decoration: underline; }
.subtitle-settings-status [data-subtitle-settings-retry]:disabled { color: var(--faint); cursor: default; }

/* Stage3 draft: one frame, two read-only overview rows, one shared playhead. */
.plan-frame { --plan-frame-max-height: clamp(220px, calc(100dvh - 330px), 560px); --plan-frame-ratio: 1.777777778; width: min(100%, calc(var(--plan-frame-max-height) * var(--plan-frame-ratio))); aspect-ratio: var(--plan-frame-ratio); justify-self: center; }
.plan-frame[data-has-cover="true"] { background-image: none; }
.plan-frame .plan-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.plan-frame[data-has-cover="true"] .plan-note { padding: 3px 6px; border-radius: 4px; background: rgba(255,255,255,.82); }
.plan-reference { z-index: 1; }
.plan-note { z-index: 2; }
.plan-timeline { grid-template-columns: 40px minmax(0, 1fr); row-gap: 6px; }
.plan-subtitle-label { grid-row: 2; font-size: 9px; white-space: nowrap; }
.plan-subtitle-track { grid-row: 2; display: block; }
.plan-track + .plan-track { margin-top: 0; }
.plan-playhead { inset: 0 -8px 0 40px; width: calc(100% - 32px); }
.plan-playhead::-moz-range-thumb { height: 60px; }
.plan-cue-blocks { position: absolute; inset: 0; pointer-events: none; }
.plan-cue { position: absolute; top: 0; height: 100%; min-width: 0; padding: 0; border: 0; background: #eef0f4; box-shadow: inset -1px 0 var(--line-strong); overflow: hidden; container-type: inline-size; pointer-events: none; }
.plan-cue span { display: block; min-width: 0; width: 100%; padding: 0 5px; color: var(--muted); font-size: 9px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-subtitle-state { position: absolute; z-index: 3; inset: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; color: var(--muted); font-size: 9px; }
.plan-subtitle-state [data-subtitle-draft-status] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-draft-action { flex: 0 0 auto; margin: 0; padding: 0; border: 0; background: transparent; color: var(--blue); font: inherit; cursor: pointer; }
.plan-draft-action:hover { text-decoration: underline; }
.plan-draft-action:disabled { color: var(--faint); cursor: default; }
@container (max-width: 24px) { .plan-cue span { visibility: hidden; } }
@container (max-width: 350px) { .plan-transport-note { display: inline; flex-basis: 100%; order: 5; margin-left: 0; font-size: 9px; } }
.plan-subtitle-state { pointer-events: none; }
.plan-draft-action { pointer-events: auto; }
