:root {
  color-scheme: light;
  --ground: #f7f8fa;
  --surface: #ffffff;
  --surface-low: #f3f4f6;
  --surface-high: #ebedf0;
  --raised: #e2e5e9;
  --active: rgba(59, 130, 246, 0.11);
  --border: #e5e7eb;
  --control: #d1d5db;
  --text: #18181b;
  --muted: #52525b;
  --faint: #71717a;
  --accent: #18181b;
  --accent-hover: #2c2c31;
  --accent-strong: #18181b;
  --accent-soft: #f3f4f6;
  --accent-border: #d4d4d8;
  --selection-tint: rgba(59, 130, 246, 0.12);
  --selection-border: rgba(59, 130, 246, 0.48);
  --selection-handle: #60a5fa;
  --selection-handle-hover: #3b82f6;
  --selection-ink: #2563eb;
  --telemetry: #60a5fa;
  --crimson: #18181b;
  --signal-lime: #16a34a;
  --negative: #dc2626;
  --warning: #b45309;
  --wave-bar: #6b7280;
  --radius-card: 16px;
  --radius-control: 10px;
  --radius-pill: 999px;
  --gap: 14px;
  --pad: 20px;
  --container-max: 1280px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background-color: var(--ground);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ground);
  color: var(--text);
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 14px; border: 1px solid var(--control);
  border-radius: var(--radius-control); background: var(--surface); color: var(--text); line-height: 1.35;
  box-shadow: none;
  transition: background-color 140ms cubic-bezier(.2, 0, 0, 1), border-color 140ms cubic-bezier(.2, 0, 0, 1), color 140ms cubic-bezier(.2, 0, 0, 1), transform 100ms cubic-bezier(.2, 0, 0, 1), box-shadow 140ms cubic-bezier(.2, 0, 0, 1);
}
button:hover:not(:disabled) { background: #f4f4f5; border-color: #a1a1aa; color: #09090b; }
button:active:not(:disabled) { background: var(--surface-high); transform: translateY(1px); }
button:disabled { color: #a1a1aa; border-color: #eceef1; background: var(--ground); box-shadow: none; cursor: not-allowed; }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  border-radius: var(--radius-pill);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
button.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
button.primary:disabled { background: var(--surface-low); border-color: var(--border); color: #a1a1aa; box-shadow: none; }
button.quiet { border-color: var(--border); background: var(--surface); color: var(--muted); box-shadow: none; }
button.quiet:hover:not(:disabled) { color: var(--text); border-color: var(--control); background: var(--surface-low); }
button.destructive { color: var(--negative); border-color: rgba(220, 38, 38, 0.35); }
button.destructive:hover:not(:disabled) { background: #fef2f2; border-color: var(--negative); color: #991b1b; }
button.destructive:disabled { color: #a1a1aa; border-color: var(--border); }
button.icon-button { width: 34px; min-height: 34px; padding: 0; font-size: 16px; border-radius: var(--radius-pill); }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--selection-handle-hover); outline-offset: 2px;
}
input[type="number"], select {
  min-height: 34px; min-width: 0; padding: 5px 12px; border: 1px solid var(--control);
  border-radius: var(--radius-control); background: var(--surface); color: var(--text);
  transition: border-color 140ms ease, background-color 140ms ease;
}
input[type="number"]:hover:not(:disabled), select:hover:not(:disabled) { border-color: #a1a1aa; background: #fafafa; }
input[type="number"]:disabled, select:disabled { color: #a1a1aa; border-color: var(--border); opacity: 0.65; cursor: not-allowed; }
input[type="number"] { width: 96px; text-align: right; }
input[type="range"] { display: block; width: 100%; margin: 8px 0; accent-color: var(--accent); cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
a { color: var(--text); text-underline-offset: 4px; }
svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 650; letter-spacing: -.02em; color: var(--text); }
h2, h3 { font-size: 15px; line-height: 1.45; font-weight: 600; color: var(--text); }
strong { font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.count {
  color: var(--muted);
  background: var(--surface-low);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.row, .panel-heading, .heading-label { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-heading { justify-content: space-between; margin-bottom: 14px; }
.heading-label { gap: 10px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--pad);
  min-width: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
}
.skip-link { position: fixed; left: 24px; top: -80px; padding: 10px 18px; z-index: 60; background: var(--accent); color: #ffffff; border-radius: var(--radius-pill); }
.skip-link:focus { top: 12px; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner { max-width: var(--container-max); margin: auto; min-height: 54px; padding: 0 32px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 15px; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
.brand-badge {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  box-shadow: none;
}
.brand-mark { width: 16px; height: 16px; stroke: none; }
.brand-secondary { font-weight: 400; color: var(--muted); font-size: 13px; }
.navigation { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.navigation .nav-portal-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  color: #2563eb;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.22);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  margin-right: 4px;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.navigation .nav-portal-link:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.4);
  color: #1d4ed8;
}
.navigation button {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--muted);
  padding: 6px 14px;
  background: transparent;
  box-shadow: none;
  font-size: 13.5px;
  font-weight: 500;
}
.navigation button:hover:not(:disabled) { color: var(--text); background: var(--surface-low); }
.navigation [aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background: var(--surface-low);
}
.navigation button:disabled { color: #a1a1aa; background: transparent; opacity: 0.6; }
.session-notice {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  padding: 4px 12px;
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.lang-toggle { min-height: 30px; padding: 3px 12px; font-size: 12px; font-weight: 600; border-radius: var(--radius-pill); cursor: pointer; white-space: nowrap; }
main { max-width: var(--container-max); padding: 18px 32px 28px; margin: auto; }
main:focus { outline: none; }
.workspace-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  min-height: 36px;
  padding: 7px 14px;
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.intro { color: var(--muted); margin-top: 6px; }
.local-note {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 12px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.local-note svg { color: var(--muted); width: 16px; height: 16px; }
.analysis-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); align-items: stretch; }
.queue-panel { display: flex; flex-direction: column; }
#drop-zone { flex: 1; display: grid; align-content: center; border-radius: 12px; transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
#drop-zone.drag-over { background: rgba(59, 130, 246, 0.06); outline: 2px dashed var(--selection-handle); outline-offset: 4px; }
.queue { min-width: 0; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 38px 18px; text-align: center; color: var(--muted); }
.empty strong { color: var(--text); font-size: 18px; font-weight: 600; }
.empty span { font-size: 14px; }
.empty small { color: var(--faint); font-size: 12px; }
.queue-footer { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 14px; margin-top: auto; }
.queue-footer .muted { font-size: 12px; }
.workflow-list { list-style: none; margin: 14px 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.workflow-list li { padding: 12px 14px 12px 38px; position: relative; background: var(--surface-low); border: 1px solid var(--border); border-radius: var(--radius-control); }
.workflow-list li p { color: var(--muted); margin-top: 4px; font-size: 12px; }
.demo-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.demo-action button { width: auto; justify-content: space-between; }
.demo-action p { margin: 0; font-size: 12px; }
.file { padding: 16px 0; border-top: 1px solid #eceef1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, .9fr); column-gap: 20px; row-gap: 12px; transition: background-color 150ms ease; }
.file:first-child { border-top: 0; }
.file-info strong { display: block; overflow-wrap: anywhere; color: var(--text); }
.file small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.file-status { font-size: 13px; }
.file[data-status="analyzing"] .file-status { color: var(--text); }
.file-actions { grid-column: 1 / -1; gap: 8px; }
.file-actions button { padding: 6px 14px; font-size: 13px; }
.file-actions [data-action="review"] { background: var(--surface-low); border-color: var(--border); color: var(--text); font-weight: 600; }
.file-meter { display: block; appearance: none; width: 100%; height: 5px; margin: 8px 0 0; border: 0; border-radius: 999px; background: var(--surface-high); accent-color: var(--accent); overflow: hidden; }
.file-meter::-webkit-progress-bar { background: var(--surface-high); border-radius: 999px; }
.file-meter::-webkit-progress-value { background: #3f3f46; border-radius: 999px; transition: width 180ms ease; }
.file-meter::-moz-progress-bar { background: #3f3f46; border-radius: 999px; }
.settings-panel {
  margin: var(--gap) 0 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px var(--pad);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
}
summary {
  cursor: pointer;
  color: var(--muted);
  min-height: 28px;
  font-weight: 600;
  user-select: none;
  transition: color 140ms ease;
}
summary:hover { color: var(--text); }
summary::marker { font-size: 11px; color: var(--muted); }
.settings-content { padding-top: 12px; border-top: 1px solid var(--border); margin-top: 8px; }
.settings-content > p + p { margin-top: 10px; }
.settings { margin: 14px 0; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.field input, .field select { color: var(--text); }
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface-low);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
#analysis-timing { max-height: 260px; overflow: auto; }
.review-heading { margin-bottom: 12px; }
.review-heading select { max-width: 48%; }
.source-progress { margin: 0; overflow-wrap: anywhere; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: var(--gap); align-items: start; }
.preview { min-width: 0; display: grid; gap: 10px; }
.player-panel { padding: 14px; }
.player-frame { position: relative; background: transparent; border-radius: 0; overflow: hidden; }
canvas { display: block; width: 100%; aspect-ratio: 16 / 9; }
#player-status { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(20, 22, 26, 0.82); border-top: 1px solid rgba(255, 255, 255, 0.14); color: #f8fafc; padding: 8px 14px; font-size: 13px; }
#player-status:empty { display: none; }
.player-controls { gap: 8px; }
.playback-time { font-size: 13px; color: var(--muted); }
.candidate-nav { margin-left: auto; }
#range-editor .panel-heading { margin-bottom: 6px; }
.range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin: 14px 0; }
.range-fields input { width: 100%; }
.range-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.range-actions button { flex: 1; font-size: 13px; }
.inline-details { margin-top: 14px; font-size: 13px; }
.inline-details > p { margin-top: 10px; }
.review-list .panel-heading { margin-bottom: 8px; }
.badge {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--selection-ink);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.08);
}
.badge:empty { display: none; }
.selection-actions { padding: 12px 0; margin: 10px 0; border-bottom: 1px solid var(--border); }
#selection-summary { margin-bottom: 8px; font-size: 14px; line-height: 1.5; }
#export { width: 100%; }
#export-note { margin-top: 6px; font-size: 12px; }
.clip-toolbar { gap: 6px; margin-top: 10px; }
.clip-toolbar button { font-size: 13px; padding-inline: 10px; }
#clips { margin-top: 10px; max-height: 320px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--control) transparent; scrollbar-gutter: stable; }
#clips .empty { padding: 16px 8px; text-align: left; font-size: 13px; }
.clip {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  margin: 5px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  transition: border-color 140ms ease, background-color 140ms ease;
}
.clip:hover { border-color: var(--control); background: var(--ground); }
.clip.selected-range {
  background: var(--selection-tint);
  border-color: var(--selection-border);
  box-shadow: inset 3px 0 0 var(--selection-handle);
}
.clip.unselected { opacity: .68; }
.clip.unselected:focus-within, .clip.unselected:hover { opacity: 1; }
.clip.excluded { background: var(--ground); border-style: dashed; border-color: var(--control); }
.clip.excluded .clip-title { color: var(--muted); text-decoration: line-through; cursor: default; }
.clip-title {
  grid-column: 2;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  min-width: 0;
}
.clip-badge {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  margin-right: 6px;
  border-radius: 6px;
  background: var(--surface-low);
  color: var(--muted);
  border: 1px solid var(--border);
  vertical-align: 1px;
}
.clip.selected-range .clip-badge {
  background: var(--selection-handle);
  color: #ffffff;
  border-color: var(--selection-handle);
}
.clip.excluded .clip-badge { color: var(--muted); border-color: transparent; background: transparent; }
.clip-jump { grid-column: 3; justify-self: end; }
.clip-exclude { grid-column: 4; justify-self: end; }
.clip button { font-size: 12px; min-height: 28px; padding: 4px 10px; }
#candidate-tail { font-size: 12px; margin-top: 8px; }
.filter-settings { border-top: 1px solid var(--border); padding-top: 12px; }
.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border-radius: var(--radius-card);
  border: 1px solid #fde68a;
  border-left: 3px solid var(--warning);
  background: #fffbeb;
  color: #78350f;
}
.notice button { flex: none; color: var(--text); }
.error { color: var(--negative) !important; }
.exports-panel { margin-top: 16px; }
.exports-panel > .panel-heading { margin-bottom: 8px; }
.empty-batches { padding: 22px 0 8px; color: var(--faint); }
.export-settings { margin-top: 12px; }
.export-batch { padding: 18px 0; border-top: 1px solid var(--border); margin-top: 14px; }
.batch-title { overflow-wrap: anywhere; color: var(--text); }
.batch-state { margin: 6px 0; font-size: 13px; }
.batch-ranges { overflow-wrap: anywhere; font-size: 12px; }
.clip-outcomes { padding-left: 22px; color: var(--muted); font-size: 13px; }
.clip-outcome { padding: 3px 0; overflow-wrap: anywhere; }
.batch-outputs { margin: 12px 0; }
.output-item { padding: 8px 0; overflow-wrap: anywhere; }
.output-item small { display: block; margin-top: 4px; font-size: 12px; }
.workspace-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid #eceef1;
  color: var(--faint);
  font-size: 12px;
}
@media (max-width: 1200px) {
  .header-inner { gap: 12px; padding-inline: 24px; }
  .brand-secondary { display: none; }
  .navigation button, .navigation .nav-portal-link { padding-inline: 8px; }
}
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .file { grid-template-columns: 1fr; }
  .file-actions { grid-column: auto; }
}
@media (max-width: 850px) {
  .header-inner { flex-wrap: wrap; padding: 10px 24px; gap: 10px 18px; }
  .brand { flex: 1; }
  .navigation { order: 3; width: 100%; flex-wrap: wrap; }
  .navigation button { min-height: 36px; }
  .session-notice { max-width: 52%; white-space: normal; }
  main { padding: 16px 24px 24px; }
  .analysis-layout, .workspace { grid-template-columns: 1fr; }
  .workflow-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .empty { padding-block: 28px; }
  .workspace-status { margin-bottom: 14px; }
  .review-list { margin-top: 0; }
  #clips { max-height: 320px; }
}
@media (max-width: 540px) {
  :root { --pad: 16px; }
  .header-inner { padding: 12px 20px 8px; gap: 10px; }
  .brand { font-size: 15px; }
  .session-notice { width: 100%; max-width: none; order: 2; }
  .navigation { margin-top: 2px; }
  .navigation button { min-height: 40px; }
  main { padding: 16px 20px 22px; }
  h1 { font-size: 22px; }
  .page-heading { align-items: start; flex-direction: column; gap: 10px; margin-bottom: 14px; }
  .intro { font-size: 13px; }
  .local-note { font-size: 12px; }
  .panel-heading { gap: 10px; }
  .queue-panel .heading-label { gap: 4px; flex-direction: column; align-items: start; }
  .queue-footer { gap: 4px; }
  .empty { padding: 24px 0; gap: 10px; }
  .empty strong { font-size: 17px; }
  .empty span { font-size: 13px; }
  .workflow-list { grid-template-columns: 1fr; gap: 10px; }
  .demo-action { display: block; }
  .demo-action button { width: 100%; }
  .demo-action p { margin-top: 8px; }
  button, select, input[type="number"], summary { min-height: 44px; }
  summary { display: list-item; align-content: center; }
  .file-actions button { min-height: 44px; }
  .review-heading { gap: 10px; }
  .review-heading select { max-width: 100%; width: 100%; }
  .player-panel { padding: 12px; }
  .player-controls { gap: 8px; }
  .playback-time { order: 3; width: 100%; }
  :is(#prev-candidate, #next-candidate) { font-size: 13px; }
  input[type="range"] { min-height: 28px; }
  .clip { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .clip-title { grid-column: 2 / -1; }
  .clip-jump { grid-column: 2; justify-self: start; }
  .clip-exclude { grid-column: 3; grid-row: 2; }
  .clip button { min-height: 44px; }
  .clip-toolbar button { min-height: 44px; }
  .notice { align-items: start; flex-direction: column; }
  #range-editor .panel-heading { align-items: start; }
  #range-editor .panel-heading button { padding-inline: 0; font-size: 13px; }
  .exports-panel > .panel-heading { align-items: start; }
  .exports-panel .heading-label { align-items: start; flex-direction: column; gap: 4px; }
  .workspace-footer { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.batch-destination { margin: 8px 0; overflow-wrap: anywhere; }
.batch-details { margin: 12px 0; }
.output-details { color: var(--muted); font-size: 12px; }
.output-details summary { cursor: pointer; }
.review-preview-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 8px 16px; margin-bottom: 14px; font-size: 12px; }
.review-preview-banner .preview-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-preview-banner label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.review-preview-banner select, .review-preview-banner button { min-height: 28px; padding: 2px 10px; font-size: 12px; }
.review-preview-banner p { margin: 0; color: var(--muted); font-size: 12px; }
