:root {
  color-scheme: light;
  --canvas: #f7f8f7;
  --surface: #fff;
  --surface-subtle: #f3f6f4;
  --surface-muted: #e9efeb;
  --ink: #17221c;
  --ink-soft: #425048;
  --ink-muted: #626f67;
  --line: #e1e7e3;
  --line-strong: #cbd5ce;
  --brand: #155b3d;
  --brand-hover: #0f4b31;
  --brand-soft: #e8f4ed;
  --brand-pale: #f5faf7;
  --danger: #a33931;
  --warning: #8b641b;
  --info: #2f6594;
  --success: #24734d;
  --radius-panel: 14px;
  --radius-control: 9px;
  --focus-ring: 0 0 0 3px rgb(21 91 61 / 16%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
video { display: block; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.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;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 60;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 8px;
  color: white;
  background: var(--brand);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 max(4vw, 24px);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand__mark {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--brand);
  border-radius: 9px;
  background: white;
}
.brand__mark span { display: grid; place-items: center; font-size: 12px; font-weight: 780; }
.brand__mark span:first-child { color: white; background: var(--brand); }
.brand__mark span:last-child { color: var(--brand); }
.brand__text { display: grid; gap: 2px; }
.brand__text strong { font-size: 15px; font-weight: 720; letter-spacing: .01em; }
.brand__text small { color: var(--ink-muted); font-size: 9px; font-weight: 650; letter-spacing: .16em; }
.topbar__actions { display: flex; align-items: center; gap: 12px; }
.system-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: white;
  font-size: 13px;
  font-weight: 560;
}
.system-state__pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px rgb(190 139 41 / 12%); }
.system-state--ready .system-state__pulse { background: var(--success); box-shadow: 0 0 0 4px rgb(36 115 77 / 12%); }
.system-state--error .system-state__pulse { background: var(--danger); box-shadow: 0 0 0 4px rgb(163 57 49 / 12%); }
.session-menu { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 7px 5px 5px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.session-menu__avatar { display: grid; flex: 0 0 auto; width: 34px; height: 34px; overflow: hidden; place-items: center; border-radius: 50%; color: white; background: var(--brand); font-size: .72rem; font-weight: 800; }
.session-menu__avatar > * { grid-area: 1 / 1; }
.session-menu__avatar img { width: 100%; height: 100%; object-fit: cover; }
.session-menu__identity { display: grid; min-width: 0; gap: 2px; }
.session-menu__identity strong { max-width: 130px; overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.session-menu__identity small { max-width: 190px; overflow: hidden; color: var(--ink-muted); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.session-menu .text-button { min-height: 32px; padding: 0 7px; font-size: .7rem; }

.login-shell { display: grid; min-height: calc(100vh - 72px); place-items: center; padding: 42px 20px 72px; }
.login-card { display: grid; width: min(520px, 100%); justify-items: center; padding: clamp(28px, 5vw, 46px); text-align: center; box-shadow: 0 24px 70px rgb(23 34 28 / 8%); }
.login-card__brand { display: grid; grid-template-columns: 1fr 1fr; width: 54px; height: 54px; margin-bottom: 22px; overflow: hidden; border: 1px solid var(--brand); border-radius: 13px; background: white; }
.login-card__brand span { display: grid; place-items: center; color: var(--brand); font-size: .9rem; font-weight: 800; }
.login-card__brand span:first-child { color: white; background: var(--brand); }
.login-card__heading { display: grid; justify-items: center; }
.login-card__eyebrow { color: var(--brand); font-size: .68rem; font-weight: 780; letter-spacing: .16em; }
.login-card__heading h1 { margin: 10px 0 10px; font-size: clamp(1.45rem, 4vw, 2rem); letter-spacing: -.035em; }
.login-card__heading p { max-width: 40ch; margin: 0; color: var(--ink-muted); font-size: .82rem; line-height: 1.7; }
.login-frame { width: 100%; margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-subtle); }
.login-frame > div { display: grid; min-height: 420px; place-items: center; }
.login-frame iframe { display: block; max-width: 100%; border: 0; background: white; }
.login-card__action { display: grid; width: min(330px, 100%); gap: 10px; margin-top: 24px; }
.login-card__action .button { width: 100%; }
.login-card__action p { min-height: 20px; margin: 0; color: var(--ink-muted); font-size: .72rem; line-height: 1.5; }
.login-assurance { display: grid; width: 100%; gap: 8px; margin: 26px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); color: var(--ink-muted); text-align: left; list-style: none; }
.login-assurance li { position: relative; padding-left: 21px; font-size: .72rem; line-height: 1.55; }
.login-assurance li::before { content: ""; position: absolute; top: .38em; left: 2px; width: 7px; height: 4px; border-bottom: 1.5px solid var(--brand); border-left: 1.5px solid var(--brand); transform: rotate(-45deg); }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  width: min(960px, calc(100% - 40px));
  margin: 28px auto 72px;
}
.panel { border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: 0 1px 2px rgb(23 34 28 / 3%); }
.studio { overflow: hidden; }
.scope-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.scope-bar > div:first-child { display: grid; gap: 2px; }
.scope-bar > div:first-child span { color: var(--ink-muted); font-size: .64rem; font-weight: 650; letter-spacing: .06em; }
.scope-bar > div:first-child strong { font-size: .82rem; }
.scope-switcher { display: flex; gap: 4px; padding: 4px; border-radius: 9px; background: var(--surface-muted); }
.scope-button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; color: var(--ink-muted); background: transparent; font-size: .72rem; font-weight: 700; cursor: pointer; }
.scope-button[aria-pressed="true"] { color: var(--brand); background: white; box-shadow: 0 1px 3px rgb(23 34 28 / 8%); }
.scope-button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.workspace-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.workspace-tab { min-height: 48px; padding: 0 14px; border: 0; border-radius: 8px; color: var(--ink-muted); background: transparent; font-weight: 700; cursor: pointer; }
.workspace-tab:hover { color: var(--ink); background: rgb(255 255 255 / 58%); }
.workspace-tab[aria-selected="true"] { color: var(--brand); background: white; box-shadow: 0 1px 3px rgb(23 34 28 / 8%); }
.workspace-tab span { display: inline-grid; min-width: 20px; height: 20px; margin-left: 6px; place-items: center; border-radius: 999px; color: var(--ink-muted); background: var(--surface-muted); font-size: .68rem; }
.workspace-tab[aria-selected="true"] span { color: white; background: var(--brand); }
.workspace-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.composer, .monitor, .history { padding: clamp(24px, 4vw, 42px); }
.policy { overflow: hidden; padding: 8px 0 0; }
.section-heading, .subsection-heading, .language-block__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-heading { margin-bottom: 26px; }
.section-heading--compact { align-items: center; margin-bottom: 22px; }
.section-heading h1, .section-heading h2, .subsection-heading h2, .language-block__heading h2 { margin-bottom: 7px; line-height: 1.25; letter-spacing: -.025em; }
.section-heading h1 { font-size: clamp(1.55rem, 3vw, 2rem); font-weight: 730; }
.section-heading h2 { font-size: 1.28rem; font-weight: 710; }
.section-heading p, .subsection-heading p, .language-block__heading p { margin-bottom: 0; color: var(--ink-muted); font-size: .86rem; line-height: 1.65; }
.subsection-heading { align-items: center; margin-bottom: 14px; }
.subsection-heading h2, .language-block__heading h2 { font-size: 1rem; font-weight: 700; }
.subsection-heading > span, .history__count { flex: 0 0 auto; color: var(--ink-muted); font-size: .78rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-weight: 680;
  cursor: pointer;
  transition: transform 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out, opacity 160ms ease-out;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button--quiet { border-color: var(--line-strong); color: var(--ink-soft); background: white; }
.button--quiet:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.button--soft { border-color: transparent; color: var(--brand); background: var(--brand-soft); }
.button--soft:hover:not(:disabled) { background: #dceee4; }
.button--primary { min-height: 48px; color: white; background: var(--brand); }
.button--primary:hover:not(:disabled) { background: var(--brand-hover); }
.button--primary svg { width: 19px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button--danger { border-color: #ecc9c5; color: var(--danger); background: #fff7f6; }
.button { text-decoration: none; }
.button:focus-visible, .text-button:focus-visible, .language-card:focus-visible, .video-action:focus-visible, .selection-control:focus-within, .result-selector:focus-within, .filter-button:focus-visible, .history-search input:focus-visible, .policy summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.source-library { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.source-list { display: grid; gap: 16px; }
.source-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; transition: border-color 160ms ease-out, box-shadow 160ms ease-out; }
.source-card[data-selected="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.source-card__video, .file-card__preview, .video-viewer video {
  width: 100%;
  max-height: 520px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #111713;
}
.source-card__video, .file-card__preview { max-height: 300px; }
.source-card__body { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border-top: 1px solid var(--line); }
.source-card__text { display: grid; min-width: 0; gap: 5px; }
.source-card__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-card__text span { color: var(--ink-muted); font-size: .78rem; }

.upload-zone { border: 1px dashed var(--line-strong); border-radius: 13px; background: var(--brand-pale); transition: border-color 180ms ease-out, background 180ms ease-out, transform 180ms ease-out; }
.upload-zone:hover, .upload-zone:focus-within, .upload-zone--dragging { border-color: var(--brand); background: var(--brand-soft); }
.upload-zone--dragging { transform: translateY(-2px); }
.upload-zone__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone__input:focus-visible + .upload-zone__select { box-shadow: var(--focus-ring); }
.upload-zone__select { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 118px; padding: 22px; border-radius: 12px; cursor: pointer; }
.upload-zone__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 11px; color: white; background: var(--brand); }
.upload-zone__icon svg { width: 25px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.upload-zone__copy { display: grid; min-width: 0; gap: 6px; }
.upload-zone__copy strong { font-size: 1rem; font-weight: 680; }
.upload-zone__copy span { color: var(--ink-muted); font-size: .8125rem; line-height: 1.55; }

.file-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-subtle); }
.file-card__preview { border-radius: 9px; }
.file-card__content { display: grid; min-width: 0; gap: 5px; }
.file-card__content strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card__content span:not(.file-card__type) { color: var(--ink-muted); font-size: .8125rem; }
.file-card__type { color: var(--brand); font-size: .7rem; font-weight: 750; letter-spacing: .08em; }
.file-card > .button { justify-self: start; }

.language-block { margin-top: 32px; }
.language-block__heading { margin-bottom: 14px; }
.language-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.language-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; min-height: 70px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-align: left; background: white; cursor: pointer; transition: border-color 160ms ease-out, background 160ms ease-out, color 160ms ease-out, transform 160ms ease-out; }
.language-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.language-card[aria-checked="true"] { border-color: var(--brand); color: white; background: var(--brand); }
.language-card__code { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--brand); background: var(--brand-soft); font-size: .68rem; font-weight: 850; letter-spacing: .04em; }
.language-card[aria-checked="true"] .language-card__code { color: white; background: rgb(255 255 255 / 14%); }
.language-card__copy { display: grid; min-width: 0; gap: 3px; }
.language-card__copy strong, .language-card__copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.language-card__copy strong { font-size: .82rem; font-weight: 680; }
.language-card__copy span { color: var(--ink-muted); font-size: .68rem; }
.language-card[aria-checked="true"] .language-card__copy span { color: #dcebe2; }
.language-card__check { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 50%; color: transparent; font-size: .68rem; }
.language-card__check::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.language-card[aria-checked="true"] .language-card__check { border-color: white; background: white; }
.language-card[aria-checked="true"] .language-card__check::after { background: var(--brand); }

.composer__footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-message { margin: 0; color: var(--danger); font-size: .8125rem; }
.upload-progress { margin-top: 18px; }
.upload-progress__label { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--ink-soft); font-size: .75rem; }
.progress-track { position: relative; height: 5px; overflow: hidden; border-radius: 999px; background: var(--surface-muted); }
.progress-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--brand); transform: scaleX(var(--progress, 0)); transform-origin: left center; transition: transform 220ms ease-out; }

.text-button { flex: 0 0 auto; min-height: 36px; padding: 0 8px; border: 0; color: var(--ink-muted); white-space: nowrap; background: transparent; cursor: pointer; }
.text-button:hover { color: var(--brand); }
.runner-capacity { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: -4px 0 22px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfb; }
.runner-capacity__summary { display: flex; align-items: center; min-width: 0; gap: 11px; }
.runner-capacity__summary > div { display: grid; min-width: 0; gap: 3px; }
.runner-capacity__summary strong { font-size: .82rem; font-weight: 710; }
.runner-capacity__summary span:last-child { color: var(--ink-muted); font-size: .72rem; line-height: 1.4; }
.runner-capacity__signal { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); box-shadow: 0 0 0 5px var(--surface-muted); }
.runner-capacity[data-tone="idle"] .runner-capacity__signal { background: var(--success); box-shadow: 0 0 0 5px rgb(36 115 77 / 10%); }
.runner-capacity[data-tone="busy"] .runner-capacity__signal { background: var(--info); box-shadow: 0 0 0 5px rgb(47 101 148 / 10%); }
.runner-capacity__metrics { display: grid; grid-template-columns: repeat(3, minmax(76px, 1fr)); min-width: 300px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: white; }
.runner-capacity__metrics > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; min-height: 48px; padding: 9px 11px; border-left: 1px solid var(--line); }
.runner-capacity__metrics > div:first-child { border-left: 0; }
.runner-capacity__metrics dt { color: var(--ink-muted); font-size: .68rem; }
.runner-capacity__metrics dd { margin: 0; color: var(--ink); font-size: .95rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.empty-state { padding: 46px 18px; text-align: center; }
.empty-state strong { font-size: .98rem; font-weight: 700; }
.empty-state p { margin: 9px 0 0; color: var(--ink-muted); font-size: .8125rem; line-height: 1.65; }
.active-job { display: grid; gap: 22px; }
.active-job__header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.active-job__identity { align-content: center; min-width: 0; }
.language-token { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 11px; color: white; background: var(--brand); font-size: .8rem; font-weight: 850; }
.active-job__header h3 { margin: 8px 0 3px; overflow: hidden; font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
.active-job__header p { margin: 0; color: var(--ink-muted); font-size: .75rem; line-height: 1.45; }
.target-language-card { display: grid; grid-template-columns: auto minmax(150px, 1fr); align-items: center; gap: 13px; min-width: 250px; padding: 12px 14px; border: 1px solid #bdd4c6; border-radius: 12px; background: var(--brand-pale); }
.target-language-card > div:last-child { display: grid; gap: 3px; }
.target-language-card span { color: var(--brand); font-size: .7rem; font-weight: 720; letter-spacing: .06em; }
.target-language-card strong { overflow: hidden; color: var(--ink); font-size: 1.18rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 999px; color: var(--ink-soft); background: var(--surface-muted); font-size: .67rem; font-weight: 700; }
.status-pill[data-tone="success"] { color: var(--success); background: #e9f5ee; }
.status-pill[data-tone="danger"] { color: var(--danger); background: #fff0ef; }
.status-pill[data-tone="warning"] { color: var(--warning); background: #fff6e4; }
.status-pill[data-tone="active"] { color: var(--info); background: #edf5fb; }

.video-viewer { display: grid; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.video-viewer__heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.video-viewer__heading > div { display: grid; gap: 3px; }
.video-viewer__heading > .result-video-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.video-viewer__heading span { color: var(--ink-muted); font-size: .7rem; font-weight: 620; }
.video-viewer__heading strong { font-size: .875rem; }
.video-viewer video { border-radius: 9px; }
.video-action { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--brand); text-decoration: none; background: white; font-size: .75rem; font-weight: 680; }
.video-action:hover { border-color: var(--brand); background: var(--brand-pale); }
.video-action--primary { border-color: var(--brand); color: white; background: var(--brand); }
.video-action--primary:hover { color: white; background: var(--brand-hover); }

.progress-experience { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 12px; }
.progress-experience__signal { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); }
.progress-experience__signal::before, .progress-experience__signal i { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.progress-experience__signal i { display: none; }
.progress-experience strong { display: block; font-size: .9375rem; line-height: 1.45; }
.progress-experience p { margin: 4px 0 0; color: var(--ink-soft); font-size: .8125rem; line-height: 1.6; }
.active-job__progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 13px; }
.progress-track--large { height: 9px; }
.progress-track--large > span { position: relative; overflow: hidden; transition: transform 600ms cubic-bezier(.16, 1, .3, 1); }
.progress-track--large > span i { display: none; }
.active-job__progress strong { min-width: 42px; color: var(--brand); font-size: .8125rem; font-variant-numeric: tabular-nums; text-align: right; }
.progress-meta { margin-top: -12px; color: var(--ink-muted); font-size: .72rem; line-height: 1.5; }
.wait-reassurance { display: flex; align-items: flex-start; gap: 9px; margin: -6px 0 0; padding: 12px 14px; border-radius: 9px; color: var(--ink-soft); background: var(--brand-pale); font-size: .75rem; line-height: 1.55; }
.wait-reassurance > span:first-child { display: grid; flex: 0 0 auto; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: white; background: var(--brand); font-size: .67rem; font-weight: 800; }
.wait-reassurance > span:first-child::after { content: ""; width: 7px; height: 4px; border-bottom: 1.5px solid white; border-left: 1.5px solid white; transform: translateY(-1px) rotate(-45deg); }

.stage-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.stage-list li { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 12px; min-height: 56px; opacity: .42; }
.stage-list li::before { content: ""; position: absolute; top: 14px; bottom: -4px; left: 5px; width: 1px; background: var(--line); }
.stage-list li:last-child::before { display: none; }
.stage-list li > span { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 4px; border: 2px solid var(--line-strong); border-radius: 50%; background: white; }
.stage-list li strong { display: block; margin-bottom: 4px; font-size: .82rem; }
.stage-list li small { color: var(--ink-muted); font-size: .7rem; }
.stage-list li.is-complete, .stage-list li.is-current { opacity: 1; }
.stage-list li.is-complete > span { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.stage-list li.is-current > span { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.stage-list li.is-current > span::after { content: ""; display: block; width: 3px; height: 3px; margin: 2px; border-radius: 50%; background: var(--brand); }
.transcript-review { display: grid; gap: 18px; padding: 22px; border: 1px solid #bfd5c8; border-radius: 13px; background: linear-gradient(180deg, #fbfdfc 0%, #f6faf7 100%); box-shadow: 0 10px 28px rgb(21 91 61 / 6%); }
.transcript-review__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.transcript-review__heading > div { min-width: 0; }
.transcript-review__heading span:first-child { color: var(--brand); font-size: .68rem; font-weight: 780; letter-spacing: .08em; }
.transcript-review__heading h3 { margin: 6px 0; font-size: 1.08rem; }
.transcript-review__heading p { max-width: 65ch; margin: 0; color: var(--ink-muted); font-size: .76rem; line-height: 1.65; }
.transcript-review__badge { flex: 0 0 auto; padding: 6px 9px; border: 1px solid #c9ddd1; border-radius: 999px; color: var(--brand); background: white; font-size: .68rem; font-weight: 700; }
.transcript-review__segments { display: grid; max-height: 210px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: white; }
.transcript-review__segments:empty { display: none; }
.transcript-segment { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.transcript-segment:last-child { border-bottom: 0; }
.transcript-segment__meta { color: var(--brand); font-size: .68rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.transcript-segment__text { color: var(--ink-soft); font-size: .76rem; line-height: 1.55; }
.field-label { display: grid; gap: 8px; }
.field-label > span { color: var(--ink); font-size: .78rem; font-weight: 700; }
.field-label small { margin-left: 7px; color: var(--ink-muted); font-size: .68rem; font-weight: 450; }
.field-label textarea { width: 100%; resize: vertical; padding: 12px 13px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: white; font: inherit; font-size: .8rem; line-height: 1.65; }
.field-label textarea:focus { border-color: var(--brand); outline: 0; box-shadow: var(--focus-ring); }
.transcript-review__footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 2px; }
.transcript-review__footer p { margin: 0; color: var(--danger); font-size: .74rem; }
.active-job__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.active-job-switcher { display: grid; gap: 12px; margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-subtle); }
.active-job-switcher__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.active-job-switcher__heading strong { font-size: .82rem; }
.active-job-switcher__heading span { color: var(--ink-muted); font-size: .72rem; }
.active-job-switcher__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.active-job-option { display: grid; min-height: 52px; padding: 9px 11px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; text-align: left; cursor: pointer; }
.active-job-option strong, .active-job-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-job-option strong { font-size: .78rem; }
.active-job-option span { margin-top: 3px; color: var(--ink-muted); font-size: .68rem; }
.active-job-option[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-pale); box-shadow: inset 3px 0 0 var(--brand); }

.history-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.history-filters { display: flex; align-items: center; gap: 7px; }
.filter-button { min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: white; font-size: .75rem; cursor: pointer; }
.filter-button span { color: var(--ink-muted); }
.filter-button.is-active { border-color: var(--brand); color: var(--brand); background: var(--brand-pale); }
.filter-button.is-active span { color: var(--brand); }
.history-search { flex: 1; }
.history-search input { width: 100%; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.history-search input::placeholder { color: var(--ink-muted); }
.download-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 0; padding: 13px 16px; border: 1px solid var(--line); background: var(--surface-subtle); }
.selection-control, .result-selector { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: .8rem; cursor: pointer; }
.selection-control input, .result-selector input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.history-list { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.history-list__empty { margin: 0; padding: 36px 16px; color: var(--ink-muted); text-align: center; }
.history-card { display: grid; grid-template-columns: 28px minmax(190px, 1.35fr) minmax(100px, .65fr) 96px auto; align-items: center; gap: 14px; min-height: 82px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: white; }
.history-card:last-child { border-bottom: 0; }
.history-card__selector { min-width: 17px; }
.history-card__identity { display: grid; min-width: 0; gap: 5px; }
.history-card__identity h3 { max-width: 100%; margin: 0; overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.history-card__identity p { margin: 0; color: var(--ink-muted); font-size: .7rem; line-height: 1.45; }
.history-card__language { color: var(--ink-muted); font-size: .75rem; }
.history-card__actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; white-space: nowrap; }
.history-card__actions .button { min-height: 38px; padding: 0 11px; font-size: .75rem; }
.history-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; color: var(--ink-muted); font-size: .75rem; }
.history-pagination > div { display: flex; gap: 8px; }

.policy summary { display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 0 28px; cursor: pointer; list-style: none; }
.policy summary::-webkit-details-marker { display: none; }
.policy summary > span:first-child { display: grid; gap: 4px; }
.policy summary strong { font-size: .875rem; }
.policy summary small { color: var(--ink-muted); font-size: .72rem; }
.policy__chevron { width: 20px; color: var(--brand); stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease-out; }
.policy[open] .policy__chevron { transform: rotate(180deg); }
.policy > p { max-width: 78ch; margin: 0; padding: 0 28px 18px; color: var(--ink-soft); font-size: .8125rem; line-height: 1.8; }
.policy > .policy__note { color: var(--warning); font-size: .75rem; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: min(390px, calc(100vw - 44px)); padding: 14px 17px; border-radius: 10px; color: white; background: var(--ink); box-shadow: 0 10px 28px rgb(23 34 28 / 18%); font-size: .8125rem; }

@media (max-width: 720px) {
  .topbar { min-height: 66px; padding: 0 14px; }
  .brand { gap: 9px; }
  .brand__mark { width: 36px; height: 36px; }
  .brand__text strong { font-size: .82rem; white-space: nowrap; }
  .brand__text small { display: none; }
  .topbar__actions { gap: 7px; }
  .system-state { max-width: 138px; min-height: 32px; overflow: hidden; padding: 0 10px; white-space: nowrap; text-overflow: ellipsis; font-size: .72rem; }
  .session-menu__identity { display: grid; }
  .session-menu__identity strong { max-width: 82px; }
  .session-menu__identity small { display: none; }
  .session-menu { gap: 3px; }
  .login-shell { min-height: calc(100vh - 66px); padding: 22px 12px 48px; }
  .login-card { padding: 28px 20px; }
  .login-frame > div { min-height: 390px; }
  .workspace { width: calc(100% - 24px); margin-top: 12px; gap: 12px; }
  .scope-bar { align-items: stretch; flex-direction: column; gap: 10px; padding: 13px 14px; }
  .scope-switcher { display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); }
  .composer, .monitor, .history { padding: 19px; }
  .section-heading { margin-bottom: 19px; }
  .section-heading h1 { font-size: 1.4rem; }
  .source-card__body, .download-toolbar { align-items: stretch; flex-direction: column; }
  .source-card__body .button { width: 100%; }
  .upload-zone__select { grid-template-columns: auto minmax(0, 1fr); min-height: 108px; padding: 16px; }
  .upload-zone .button { display: none; }
  .language-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .language-card { grid-template-columns: auto 1fr; min-height: 68px; }
  .language-card__check { display: none; }
  .composer__footer { align-items: stretch; flex-direction: column; }
  .composer__footer .button--primary, .download-toolbar .button--primary { width: 100%; }
  .video-viewer__heading { align-items: stretch; flex-direction: column; }
  .runner-capacity { align-items: stretch; flex-direction: column; gap: 13px; padding: 14px; }
  .runner-capacity__metrics { min-width: 0; width: 100%; }
  .runner-capacity__metrics > div { grid-template-columns: 1fr; justify-items: center; gap: 3px; padding: 8px 5px; }
  .active-job__header { grid-template-columns: 1fr; }
  .target-language-card { min-width: 0; }
  .video-viewer__heading > .result-video-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .result-video-actions .button, .result-video-actions .video-action { width: 100%; min-height: 44px; }
  .video-action { min-height: 44px; }
  .progress-meta { margin-top: -10px; }
  .stage-list li { min-height: 54px; }
  .transcript-review { padding: 17px; }
  .transcript-review__heading, .transcript-review__footer { align-items: stretch; flex-direction: column; }
  .transcript-review__badge { align-self: flex-start; }
  .transcript-review__footer .button { width: 100%; min-height: 44px; }
  .transcript-segment { grid-template-columns: 74px minmax(0, 1fr); }
  .field-label small { display: block; margin: 4px 0 0; line-height: 1.45; }
  .workspace-tabs { padding: 6px; }
  .workspace-tab { min-height: 44px; padding: 0 5px; font-size: .78rem; }
  .history-controls { align-items: stretch; flex-direction: column; }
  .history-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-button, .history-search input { width: 100%; min-height: 44px; }
  .history-card { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px 10px; min-height: 0; padding: 15px 12px; }
  .history-card__selector { grid-column: 1; grid-row: 1; }
  .history-card__identity { grid-column: 2; grid-row: 1; }
  .history-card:not(.history-card--selectable) .history-card__selector { display: none; }
  .history-card:not(.history-card--selectable) .history-card__identity { grid-column: 1 / 3; }
  .history-card > .status-pill { grid-column: 3; grid-row: 1; }
  .history-card__language { grid-column: 2 / -1; grid-row: 2; }
  .history-card:not(.history-card--selectable) .history-card__language { grid-column: 1 / -1; }
  .history-card__actions { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); margin-top: 5px; }
  .history-card__actions .button { width: 100%; min-height: 44px; padding: 0 7px; }
  .history-pagination { align-items: stretch; flex-direction: column; }
  .history-pagination > div { display: grid; grid-template-columns: 1fr 1fr; }
  .result-selector { justify-content: center; min-width: 44px; min-height: 44px; }
  .active-job-switcher { margin-bottom: 15px; padding: 12px; }
  .active-job-switcher__heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .active-job-switcher__list { display: flex; overflow-x: auto; padding-bottom: 2px; scroll-snap-type: x proximity; }
  .active-job-option { flex: 0 0 min(78vw, 245px); min-height: 52px; scroll-snap-align: start; }
  .policy summary { padding: 0 19px; }
  .policy > p { padding-right: 19px; padding-left: 19px; }
}

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