:root {
  --background: #0d0e0e;
  --panel: #151616;
  --panel-raised: #1a1b1b;
  --field: #111212;
  --line: #303131;
  --line-strong: #444544;
  --text: #f3f0e9;
  --muted: #a6a299;
  --orange: #f68712;
  --orange-hover: #ff9c2d;
  --green: #4fc07a;
  --blue: #65bce8;
  --yellow: #e6b846;
  --drop-shadow: 0 16px 40px rgba(0, 0, 0, .6);
  --review-header: #262727;
  --review-header-text: #e4e0d7;
  --field-label: #dcd8cf;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  color: var(--text);
  background: var(--background);
  font-family: Inter, "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html.i18n-pending body { visibility: hidden; }
body { min-height: 100vh; display: flex; flex-direction: column; margin: 0; color: var(--text); background: var(--background); }
button, input, textarea, select { color: inherit; font: inherit; }
button { cursor: pointer; }
input, textarea, select { color-scheme: dark; }
input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--orange); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(13, 14, 14, 0.96);
}

.brand { display: inline-flex; align-items: center; color: var(--text); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.brand-logo { display: block; width: auto; height: 26px; }
.login-logo { display: block; width: 512px; max-width: 100%; height: auto; margin: 0 auto 26px; }
.main-nav { align-self: stretch; display: flex; align-items: stretch; gap: 4px; margin-left: clamp(18px, 4vw, 64px); margin-right: auto; }
.main-nav button { position: relative; padding: 0 14px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 13px; font-weight: 650; }
.main-nav button:hover { color: var(--text); }
.main-nav button.active { color: var(--text); border-bottom-color: var(--orange); }
.main-nav i { min-width: 18px; height: 18px; display: inline-grid; place-items: center; margin-left: 6px; color: #17110a; border-radius: 99px; background: var(--orange); font-size: 12px; font-style: normal; }
.topbar-tools { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.user-session { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.user-session #session-username { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-session .text-button { padding: 5px 8px; }

.login-page { background: radial-gradient(circle at 50% 18%, #202221 0, var(--background) 42%); }
.login-topbar { justify-content: flex-end; }
.login-main { width: 100%; display: grid; place-items: center; align-content: center; padding: clamp(52px, 10vh, 110px) 20px; }
.login-card { width: min(430px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.login-eyebrow { color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.login-card h1 { margin: 9px 0 10px; font-size: clamp(32px, 6vw, 43px); font-weight: 520; line-height: 1.05; letter-spacing: -.04em; }
.login-card > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.login-card form { display: grid; gap: 15px; margin-top: 25px; }
.login-card label { color: var(--muted); font-size: 12px; }
.login-card input { width: 100%; min-height: 42px; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); }
.login-card input:focus { border-color: var(--orange); outline: 2px solid rgba(246, 135, 18, .17); outline-offset: 1px; }
.login-card .primary-button { width: 100%; min-height: 42px; margin-top: 3px; }
.login-error, .login-warning { margin: 0 !important; padding: 10px 11px; border-radius: 6px; font-size: 12px !important; line-height: 1.45 !important; }
.login-error { color: #ffaaa2 !important; background: rgba(255, 118, 107, .09); }
.login-warning { color: #ecd38e !important; background: rgba(230, 184, 70, .09); }

main { width: min(1500px, 100%); flex: 1; margin: 0 auto; }
.site-footer { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px 20px 28px; color: var(--muted); font-size: 13px; line-height: 1.4; text-align: center; }
.site-footer a { color: inherit; text-decoration: none; transition: color 120ms ease; }
.site-footer a:hover { color: var(--orange); }
.site-footer a:focus-visible { color: var(--orange); outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 2px; }
.launcher-view { width: min(680px, calc(100% - 40px)); margin: 0 auto; padding: clamp(64px, 10vh, 110px) 0 80px; }
.launcher-label { color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.launcher-view h1 { margin: 10px 0 12px; font-size: clamp(38px, 6vw, 58px); font-weight: 500; line-height: 1; letter-spacing: -.045em; }
.launcher-view > p { max-width: 610px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.launcher-card { margin-top: 28px; padding: 24px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); box-shadow: var(--shadow); }
.launcher-card ol { margin: 0 0 22px; padding-left: 23px; color: var(--text); line-height: 1.55; }
.launcher-card li + li { margin-top: 9px; }
.launcher-card > span { display: block; margin-top: 13px; color: var(--muted); font-size: 12px; }
.import-view { width: min(900px, calc(100% - 40px)); margin: 0 auto; padding: clamp(46px, 7vh, 76px) 0 80px; }
.import-heading { margin-bottom: 32px; }
.import-heading h1 { margin: 0; font-size: clamp(38px, 6vw, 62px); font-weight: 500; line-height: 1; letter-spacing: -0.045em; }

.language-control { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.language-switch { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); }
.language-switch button { min-width: 38px; padding: 5px 9px; color: var(--muted); border: 0; border-radius: 99px; background: transparent; font-size: 12px; font-weight: 700; }
.language-switch button.active { color: #17110a; background: var(--orange); }

.workspace-view { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: clamp(46px, 7vh, 76px) 0 80px; }
.workspace-heading { max-width: 760px; margin-bottom: 32px; }
.workspace-eyebrow { color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workspace-heading h1 { margin: 0 0 9px; font-size: clamp(38px, 6vw, 58px); font-weight: 500; line-height: 1; letter-spacing: -.045em; }
.workspace-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.translation-workspace-heading { max-width: none; }
.workspace-summary { min-height: 42px; display: flex; align-items: center; margin-bottom: 32px; padding: 9px 19px; color: var(--muted); border: solid #fff; border-width: 0 0 0 10px; background: transparent; font-size: 12px; }
.workflow-stack { display: grid; gap: 32px; }
.workspace-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.settings-card { overflow: hidden; border: 0; background: transparent; }
.panel-heading { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0 0 5px; font-size: 20px; font-weight: 520; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.workflow-stack > .workspace-panel { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
/* Workflow panel headings (confirmed imports, queues, translated files): no fill, square corners, a 5px white rule beneath. */
.workflow-stack .panel-heading { border: 0; border-bottom: 5px solid #fff; border-radius: 0; background: transparent; box-shadow: none; }
.workflow-stack .panel-heading p { color: var(--muted); }
.workflow-title { min-width: 0; display: flex; align-items: center; gap: 13px; }
.workflow-title > div { min-width: 0; }
.workflow-step { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--orange); font-size: 13px; font-weight: 800; }
.selectable-list, .queue-list, .translated-library { min-height: 150px; max-height: 520px; overflow-y: auto; }
.selectable-item, .queue-item { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; }
.selectable-item + .selectable-item, .queue-item + .queue-item { border-top: 1px solid #272828; }
.workflow-stack .selectable-list, .workflow-stack .queue-list, .workflow-stack .translated-library { background: transparent; }
.workflow-stack .selectable-item:first-child, .workflow-stack .queue-item:first-child, .workflow-stack .saved-result:first-child { border-top: 0; }
.workflow-stack .selectable-item:last-child, .workflow-stack .queue-item:last-child, .workflow-stack .saved-result:last-child { border-bottom: 0; }
.selectable-item[draggable="true"] { cursor: grab; }
.selectable-item > div, .queue-item > div { min-width: 0; }
.selectable-item strong, .queue-item strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.selectable-item span, .queue-item span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.selectable-item button, .queue-item button { flex: 0 0 auto; min-height: 32px; padding: 5px 9px; font-size: 12px; }
.selectable-item.nested-export-item { position: relative; width: calc(100% - 28px); margin-left: 28px; background: rgba(101, 188, 232, .035); }
.translated-export-title strong { color: var(--blue); }
.selectable-item.nested-export-item::before { content: ""; position: absolute; width: 13px; height: 22px; left: -17px; top: 0; border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); border-bottom-left-radius: 5px; }
.queue-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(145px, .65fr) auto; }
.queue-item select { min-height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); font-size: 12px; }
#export-queue .queue-item { grid-template-columns: minmax(0, 1fr) auto; }
#export-queue .queue-item button { width: auto; justify-self: end; }
/* Queue drop area: the same detached, borderless, fully rounded surface as the import drop zone, sitting below the heading rule. */
.workflow-stack .queue-panel .queue-list { min-height: 150px; margin-top: 18px; border: 1px solid transparent; border-radius: 14px; background: linear-gradient(180deg, #202121 0%, #1a1b1b 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 2px 5px rgba(0, 0, 0, .35), var(--drop-shadow); transition: border-color 140ms ease, box-shadow 140ms ease; }
.workflow-stack .queue-panel .empty-state { min-height: 150px; color: var(--text); font-size: 22px; font-weight: 500; }
.workflow-stack .queue-panel.dragging .queue-list { border-color: rgba(246, 135, 18, .72); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 0 0 1px rgba(246, 135, 18, .25), 0 0 0 3px rgba(246, 135, 18, .12), var(--drop-shadow); }
.workflow-stack .queue-panel .queue-item:first-child { border-top: 0; }
.queue-item.status-processing { box-shadow: inset 3px 0 var(--orange); }
.queue-item.status-ready { box-shadow: inset 3px 0 var(--green); }
.queue-item.status-failed { box-shadow: inset 3px 0 #ff766b; }
.translated-panel { margin-top: 0; }
.translated-panel .translated-library { max-height: none; }
.translation-disclosure-dialog { width: min(570px, calc(100vw - 32px)); padding: 0; color: var(--text); border: 1px solid var(--line-strong); border-radius: 11px; background: var(--panel); box-shadow: 0 24px 70px rgba(0, 0, 0, .58); }
.translation-disclosure-dialog::backdrop { background: rgba(3, 4, 4, .78); }
.translation-disclosure-dialog form { margin: 0; }
.translation-disclosure-content { padding: 24px 25px 22px; }
.translation-disclosure-content > span { color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.translation-disclosure-content h2 { margin: 8px 0 11px; font-size: 25px; font-weight: 520; line-height: 1.15; letter-spacing: -.025em; }
.translation-disclosure-content p { margin: 0; color: #d2cec5; font-size: 13px; line-height: 1.58; }
.translation-disclosure-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--field); }
.empty-state { min-height: 148px; display: grid; place-items: center; padding: 24px; color: var(--muted); font-size: 12px; text-align: center; }
.export-generation { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 15px; }
.export-generation p { flex: 1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.export-generation p.validation-error { color: #ffaaa2; }
.loop-settings-card { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 24px; align-items: center; margin-bottom: 32px; padding: 16px 0; border: 0; background: transparent; }
.loop-settings-card > div:first-child { border-left: 10px solid #fff; padding-left: 19px; }
.loop-settings-card h2 { margin: 0 0 5px; font-size: 18px; font-weight: 520; }
.loop-settings-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.loop-settings-controls { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.loop-settings-controls label { color: var(--muted); font-size: 12px; }
.loop-settings-controls input { width: 112px; min-height: 36px; display: block; margin-top: 5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); font-variant-numeric: tabular-nums; }
.target-loop-control { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.loop-settings-controls .target-loop-control input { width: 56px; margin-top: 0; }
.settings-loop-controls { gap: 12px 28px; padding: 17px 17px 17px 19px; }
/* Loop defaults: label and value share one line, like the target-loop control in Exports. */
.settings-loop-controls label { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.settings-loop-controls input { width: 84px; margin-top: 0; }
.loops-preview-panel { margin-top: 32px; scroll-margin-top: 18px; }
.loops-preview-heading { min-height: 86px; }
.loops-download-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.loops-preview { padding: 24px 17px 17px; background: #111212; }
.loop-episode + .loop-episode { margin-top: 34px; }
.loop-episode-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 0 14px; padding: 15px 17px; background: #242525; }
.loop-episode-heading h3 { margin: 0; font-size: 22px; font-weight: 550; }
.loop-episode-heading span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.loop-episode-heading > strong { flex: 0 0 auto; padding: 5px 9px; color: var(--green); border-radius: 99px; background: rgba(79, 192, 122, .1); font-size: 12px; }
.loop-card { overflow: hidden; border-bottom: 1px solid var(--line-strong); background: var(--panel); }
.loop-card-heading { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 17px; border-bottom: 1px solid var(--line-strong); background: #2a2b2b; }
.loop-card.is-over-limit .loop-card-heading { box-shadow: inset 4px 0 rgba(230, 184, 70, .72); }
.loop-card-heading strong, .loop-card-heading span { display: block; }
.loop-card-heading strong { font-size: 15px; }
.loop-card-heading div > span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.loop-title-line { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.loop-card-heading .loop-title-line > span { margin-top: 0; }
.loop-limit-warning { flex: 0 0 auto; padding: 4px 7px; color: #ecd38e; border-radius: 99px; background: rgba(230, 184, 70, .11); font-size: 12px; font-weight: 750; }
.loop-dialogue-heading, .loop-dialogue-row { display: grid; grid-template-columns: 145px 190px minmax(260px, 1fr); gap: 12px; padding: 9px 17px; }
.loop-dialogue-heading { color: #d2cec5; border-bottom: 1px solid var(--line-strong); background: #222323; font-size: 12px; font-weight: 650; }
.loop-dialogue-row { border-bottom: 1px solid #272828; font-size: 12px; line-height: 1.42; }
.loop-dialogue-row:last-child { border-bottom: 0; }
.loop-dialogue-row:hover { background: rgba(255, 255, 255, .018); }
.loop-dialogue-row > span { color: var(--muted); font-variant-numeric: tabular-nums; }
.loop-dialogue-row > strong { font-weight: 600; }
.loop-dialogue-row > p { margin: 0; white-space: pre-wrap; }
.loop-boundary { position: relative; height: 30px; cursor: ns-resize; touch-action: none; user-select: none; outline: 0; }
.loop-boundary::before { content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 4px; background: #565857; transition: background 120ms ease, box-shadow 120ms ease; }
.loop-boundary:hover::before, .loop-boundary:focus-visible::before, .loop-boundary.is-selected::before, .loop-boundary.is-dragging::before { background: var(--orange); box-shadow: 0 0 0 1px rgba(246, 135, 18, .22); }
body.loop-boundary-dragging, body.loop-boundary-dragging * { cursor: ns-resize !important; user-select: none !important; }
.plan-preview-panel { margin-top: 32px; scroll-margin-top: 18px; }
.plan-preview-heading { min-height: 86px; }
.plan-preview { max-height: 620px; overflow: auto; background: #111212; }
.plan-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.plan-table th, .plan-table td { height: 34px; padding: 7px 10px; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); text-align: right; white-space: nowrap; }
.plan-table thead th { position: sticky; top: 0; z-index: 2; color: #fff; background: #050606; font-weight: 700; }
.plan-table thead th:first-child { z-index: 4; text-align: left; }
.plan-table tbody th { position: sticky; left: 0; z-index: 1; min-width: 190px; background: #171818; font-weight: 700; text-align: left; }
.plan-table tbody tr:nth-child(even) th, .plan-table tbody tr:nth-child(even) td { background: #252626; }
.plan-table tbody tr:hover th, .plan-table tbody tr:hover td { background: #303131; }
.plan-table td:nth-child(2) { min-width: 110px; }

.settings-view { width: min(1040px, calc(100% - 40px)); }
.settings-card + .settings-card { margin-top: 32px; }
.settings-card .panel-heading { min-height: 0; padding-bottom: 4px; border-bottom: 0; border-left: 10px solid #fff; padding-left: 19px; }
/* Gap between the heading row (with its white bar) and the preset list/form, without stretching the bar. */
.preset-layout { margin-top: 20px; }
.settings-card > :not(.panel-heading) { margin-left: 10px; }
.preset-list button:last-child { border-bottom: 0; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(180px, .5fr); gap: 12px; padding: 17px 17px 17px 19px; }
.settings-grid label, .preset-form label, .metadata-fields label { color: var(--muted); font-size: 12px; }
.settings-grid input, .settings-grid select, .preset-form input, .preset-form select, .preset-form textarea, .metadata-fields input, .metadata-fields select { width: 100%; min-height: 42px; margin-top: 7px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); line-height: 1.4; }
.settings-grid small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.35; }
#deepl-key.key-tested::placeholder, #openai-key.key-tested::placeholder { color: var(--green); opacity: .95; }
#deepl-key.key-pending::placeholder, #openai-key.key-pending::placeholder { color: var(--orange); opacity: .95; }
#deepl-key.key-set::placeholder, #openai-key.key-set::placeholder { color: var(--text); opacity: .8; }
.settings-actions { display: flex; gap: 8px; padding: 0 17px 17px 19px; }
.field-help { margin: -6px 17px 17px 19px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.preset-layout { display: grid; grid-template-columns: 285px minmax(0, 1fr); min-height: 470px; }
.preset-list { border-right: 1px solid var(--line); }
.preset-list button { width: 100%; display: block; padding: 14px 15px 14px 19px; color: var(--text); border: 0; border-bottom: 1px solid #272828; background: transparent; text-align: left; }
.preset-list button:hover { background: var(--panel-raised); }
.preset-list button.preset-unavailable { opacity: .62; }
.preset-list button.preset-unavailable strong::after { content: " · !"; color: var(--orange); }
.preset-list strong, .preset-list span { display: block; }
.preset-list strong { font-size: 13px; }
.preset-list span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.preset-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 17px; align-content: start; }
.preset-form .wide-field { grid-column: 1 / -1; }
/* Provider spans the row while the model field is hidden, keeping source and target languages side by side. */
.preset-form:not(:has(#preset-model-field:not([hidden]))) #preset-provider-field { grid-column: 1 / -1; }
.preset-form textarea { resize: vertical; line-height: 1.4; }
.preset-form small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.preset-form .settings-actions { padding: 0; }

.metadata-panel { margin: 32px 0 0; padding: 0; border: 0; background: transparent; }
.metadata-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 15px; border-left: 10px solid #fff; padding-left: 19px; }
.metadata-heading h2 { margin: 0 0 5px; font-size: 20px; font-weight: 520; }
.metadata-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.metadata-heading > span { padding: 4px 8px; color: #ffc071; border-radius: 99px; background: rgba(246, 135, 18, .12); font-size: 12px; font-weight: 700; }
.metadata-fields { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(110px, .65fr)); gap: 10px; padding-left: 29px; }
/* Translation review: every cell in a row is centred on the row's vertical middle, so short and long replicas line up. */
table.translation-review td { vertical-align: middle; }
table.translation-review td:first-child { padding-top: 11px; }
.source-cell.translation-source { padding-top: 11px; }
.original-dialogue { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
td input[readonly], td textarea[readonly] { color: var(--muted); cursor: default; }
.translation-result.nested-result { position: relative; margin-left: 28px; background: rgba(79, 192, 122, .035); }
.translation-result.nested-result::before { content: ""; position: absolute; width: 13px; height: 22px; left: -17px; top: 0; border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); border-bottom-left-radius: 5px; }

.dropzone {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 36px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: linear-gradient(180deg, #202121 0%, #1a1b1b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 2px 5px rgba(0, 0, 0, .35), var(--drop-shadow);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.dropzone.dragging { border-color: rgba(246, 135, 18, .72); background: linear-gradient(180deg, #262019 0%, #1f1a14 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 0 0 1px rgba(246, 135, 18, .25), 0 0 0 3px rgba(246, 135, 18, .12), var(--drop-shadow); }
.dropzone h2 { margin: 0; font-size: 22px; font-weight: 500; }
.dropzone-heading { text-align: center; }
.dropzone-heading p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.upload-note { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
.upload-note p { margin: 0; }
.upload-note p + p { margin-top: 2px; }
.upload-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.primary-button, .secondary-button, .page-button, .danger-button {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 700;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.primary-button { color: #17110a; background: var(--orange); }
.primary-button:hover:not(:disabled) { background: var(--orange-hover); }
.secondary-button, .page-button { color: var(--text); border-color: var(--line-strong); background: var(--panel-raised); }
.secondary-button:hover:not(:disabled), .page-button:hover:not(:disabled) { border-color: var(--orange); }
/* Disabled buttons keep their resting look under the pointer; nothing on them reacts. */
.primary-button:disabled, .secondary-button:disabled, .page-button:disabled, .danger-button:disabled { cursor: not-allowed; opacity: .38; border-color: var(--line); }
.danger-button { color: #fff; border-color: rgba(255, 100, 87, .24); background: rgba(255, 100, 87, .16); }
.danger-button:hover:not(:disabled) { border-color: rgba(255, 100, 87, .52); background: rgba(255, 100, 87, .24); }
/* Destructive actions sit apart from the others, at the right end of the row. */
.settings-actions .danger-button { margin-left: auto; }
.text-button { padding: 0; color: var(--muted); border: 0; background: transparent; }
.text-button:hover { color: var(--orange); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.loading-view { width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: clamp(52px, 8vh, 88px) 0 80px; }
.processing-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.processing-heading h1 { margin: 0 0 6px; font-size: clamp(30px, 5vw, 44px); font-weight: 500; letter-spacing: -.035em; }
.processing-heading p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.loader { display: flex; gap: 5px; }
.loader span { width: 6px; height: 24px; border-radius: 3px; background: var(--orange); animation: pulse 800ms infinite alternate ease-in-out; }
.loader span:nth-child(2) { animation-delay: 140ms; }
.loader span:nth-child(3) { animation-delay: 280ms; }
.queue-progress { width: 100%; height: 5px; margin-top: 28px; overflow: hidden; border-radius: 99px; background: var(--line); }
.queue-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--orange); transition: width 180ms ease; }
.processing-summary { margin: 11px 0 18px; color: var(--muted); font-size: 12px; }
.processing-queue { overflow: hidden; border: solid var(--line-strong); border-width: 1px 0; background: transparent; }
.processing-item { min-height: 72px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 12px 15px; }
.processing-item + .processing-item { border-top: 1px solid #272828; }
.processing-status-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--line-strong); font-size: 13px; font-weight: 800; }
.processing-status-icon::before { content: "·"; }
.status-processing { background: rgba(246, 135, 18, .05); }
.status-processing .processing-status-icon { background: var(--orange); animation: queue-pulse 900ms infinite alternate; }
.status-processing .processing-status-icon::before { content: "…"; color: #17110a; }
.status-ready .processing-status-icon { color: #102116; background: var(--green); }
.status-ready .processing-status-icon::before { content: "✓"; }
.status-failed .processing-status-icon { color: #2a0d0a; background: #ff766b; }
.status-failed .processing-status-icon::before { content: "!"; }
.status-canceled .processing-status-icon::before { content: "×"; }
.status-skipped .processing-status-icon::before { content: "—"; }
.processing-item-copy { min-width: 0; }
.processing-item-copy strong { display: block; overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.processing-item-copy span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.processing-item button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
@keyframes pulse { to { transform: scaleY(.45); opacity: .45; } }
@keyframes queue-pulse { to { opacity: .55; transform: scale(.9); } }

.batch-view { width: min(920px, calc(100% - 40px)); margin: 0 auto; padding: clamp(54px, 8vh, 90px) 0 80px; }
.batch-heading { max-width: 680px; margin-bottom: 30px; }
.batch-complete-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 19px; color: #102116; border-radius: 50%; background: var(--green); font-size: 24px; font-weight: 800; }
.batch-complete-icon.no-results { color: #2a0d0a; background: #ff766b; }
.batch-eyebrow { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.batch-heading h1 { margin: 8px 0 9px; font-size: clamp(36px, 6vw, 54px); font-weight: 500; line-height: 1.02; letter-spacing: -.04em; }
.batch-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.batch-results { overflow: hidden; border: solid var(--line-strong); border-width: 1px 0; background: transparent; }
.batch-result { min-height: 86px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 15px 17px; }
.batch-result + .batch-result { border-top: 1px solid #272828; }
.batch-result-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-size: 15px; font-weight: 800; }
.batch-confirmed .batch-result-icon { color: #102116; background: var(--green); }
.batch-unreviewed .batch-result-icon { color: #17110a; background: var(--orange); }
.batch-failed .batch-result-icon { color: #2a0d0a; background: #ff766b; }
.batch-skipped .batch-result-icon, .batch-canceled .batch-result-icon { color: var(--text); background: var(--line-strong); }
.batch-result-copy { min-width: 0; }
.batch-result-copy strong { display: block; overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.batch-result-copy span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.batch-result-copy .verification-status { width: fit-content; margin-top: 8px; padding: 3px 7px; border-radius: 99px; font-weight: 750; }
.verification-status.is-confirmed { color: #8fe0aa; background: rgba(79, 192, 122, .12); }
.verification-status.needs-verification { color: #ffc071; background: rgba(246, 135, 18, .12); }
.batch-result-actions { display: flex; gap: 8px; }
.batch-result-actions button { min-height: 36px; font-size: 12px; }
.batch-result-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.batch-failed .batch-result-label { color: #ffaaa2; }
.batch-footer { display: flex; gap: 9px; margin-top: 20px; }

.saved-library { margin-top: 32px; scroll-margin-top: 20px; }
.library-heading { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 8px; padding: 17px 19px; border: solid #fff; border-width: 0 0 0 10px; background: transparent; }
.library-heading h2 { margin: 0 0 5px; font-size: 21px; font-weight: 500; }
.library-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.library-heading > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.saved-result { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 17px; }
.saved-result + .saved-result { border-top: 1px solid #272828; }
.saved-result.recent-result { background: rgba(246, 135, 18, .08); box-shadow: inset 3px 0 var(--orange); }
.saved-result-copy { min-width: 0; }
.saved-result-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.saved-result-title strong { min-width: 0; display: block; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.saved-result-title .verification-badge { flex: 0 0 auto; display: inline-flex; padding: 3px 7px; border-radius: 99px; font-size: 12px; font-weight: 750; letter-spacing: 0; }
.verification-badge.is-confirmed { color: #8fe0aa; background: rgba(79, 192, 122, .12); }
.verification-badge.is-translated { color: var(--blue); background: rgba(101, 188, 232, .12); }
.verification-badge.needs-verification { color: #ffc071; background: rgba(246, 135, 18, .12); }
.saved-result-copy span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.saved-result-copy .translation-source-name { color: var(--text); font-size: 12px; }
.saved-result-title .verification-badge { margin-top: 0; }
.saved-result-actions { flex: 0 0 auto; display: flex; gap: 7px; }
.saved-result-actions button { min-height: 34px; padding: 6px 10px; font-size: 12px; }

.results-view { padding: 44px clamp(18px, 3vw, 46px) 70px; }
.results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 34px; }
.results-title { min-width: 0; }
.results-title .text-button { margin-bottom: 22px; }
.results-heading h1 { margin: 0; font-size: clamp(34px, 4vw, 48px); font-weight: 500; line-height: 1.04; letter-spacing: -0.035em; }
.results-heading p { max-width: 680px; margin: 8px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.results-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; }
.status-legend { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 12px; }
.status-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.export-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.header-toggle { display: flex; align-items: center; gap: 7px; margin-right: 4px; color: var(--muted); font-size: 12px; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 24px; margin: 32px 0; }
/* Translation review: preset and editing values are long, language and row counts are short. */
.summary-grid.translation-summary { grid-template-columns: minmax(220px, 2fr) minmax(110px, .7fr) minmax(110px, .7fr) minmax(170px, 1.1fr) minmax(260px, 2fr); }
.summary-card { min-height: 72px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.summary-card span { display: block; padding-bottom: 8px; color: var(--muted); border-bottom: 1px solid var(--line-strong); font-size: 12px; }
.summary-card strong { display: block; margin-top: 9px; font-size: 22px; font-weight: 500; overflow-wrap: anywhere; }
.summary-card strong.confirmed-value { color: var(--green); }

/* Warnings keep the block's left bar but in the warning colour, so the bar signals the tone of the text beside it. */
.warnings { margin: 0 0 32px; padding: 13px 19px; color: #ecd38e; border: solid #ecd38e; border-width: 0 0 0 10px; background: transparent; font-size: 13px; line-height: 1.45; }
.warnings div + div { margin-top: 5px; }

.estimation-panel { display: grid; grid-template-columns: minmax(240px, .75fr) minmax(520px, 1.25fr); gap: 26px; align-items: center; margin: 0 0 32px; padding: 18px 0; border: 0; background: transparent; }
.estimation-copy { border-left: 10px solid #fff; padding-left: 19px; }
.estimation-copy h2 { margin: 3px 0 5px; font-size: 22px; font-weight: 500; }
.estimation-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.estimate-label { color: var(--orange); font-size: 12px; }
.estimation-controls { display: grid; grid-template-columns: repeat(4, minmax(105px, 1fr)); gap: 9px; align-items: end; }
.estimation-controls label { color: var(--muted); font-size: 12px; }
.estimation-controls input, .estimation-controls select { width: 100%; height: 37px; margin-top: 5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); }
.estimation-controls button { grid-column: 1 / -1; justify-self: end; }

/* `clip` keeps the rounded corners without turning the panel into a scroll container, which would trap the sticky header. */
.review-panel { --review-toolbar-height: 64px; overflow: clip; border: 0; background: transparent; }
.review-toolbar { position: sticky; top: 0; z-index: 5; min-height: 64px; display: flex; align-items: center; gap: 18px; padding: 11px 0; background: var(--background); }
.search-field { flex: 1; max-width: 540px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--field); }
.search-field > span { color: var(--text); font-size: 24px; line-height: 1; opacity: .7; }
.search-field input { width: 100%; padding: 9px 0; border: 0; outline: 0; background: transparent; }
.search-field input::placeholder { color: var(--text); opacity: .5; }
.switch { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; }
.switch-track { position: relative; width: 34px; height: 19px; border-radius: 99px; background: var(--line-strong); transition: background 120ms ease; }
.switch-track::after { content: ""; position: absolute; width: 13px; height: 13px; left: 3px; top: 3px; border-radius: 50%; background: var(--text); transition: transform 120ms ease; }
.switch input:checked + .switch-track { background: var(--orange); }
.switch input:checked + .switch-track::after { transform: translateX(15px); }
.row-count { margin-left: auto; color: var(--review-header-text); font-size: 12px; white-space: nowrap; }

.table-wrap { overflow-x: clip; }
table { width: 100%; min-width: 1040px; table-layout: fixed; border-collapse: collapse; }
th { position: sticky; top: var(--review-toolbar-height); z-index: 3; padding: 11px 10px; color: var(--review-header-text); background: var(--review-header); box-shadow: inset 0 1px 0 var(--line-strong), inset 0 -1px 0 var(--line-strong); font-size: 12px; font-weight: 600; text-align: left; }
td { padding: 11px 10px; border-bottom: 1px solid #272828; vertical-align: top; }
col.col-include { width: 42px; }
col.col-timecode { width: 148px; }
col.col-role { width: 200px; }
col.col-source { width: 92px; }
col.col-status { width: 54px; }
th:nth-child(1), td:nth-child(1), th:nth-child(6), td:nth-child(6) { text-align: center; }
/* The handle straddles the column boundary; the header cell that owns it must paint above its right-hand neighbour. */
th.dialogue-heading { z-index: 4; }
.column-resizer { position: absolute; top: 0; right: -10px; z-index: 1; width: 20px; height: 100%; cursor: col-resize; touch-action: none; }
.column-resizer::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 8px; width: 4px; border-radius: 2px; background: var(--line-strong); transition: background 120ms ease, box-shadow 120ms ease; }
.column-resizer:hover::before, .column-resizer:focus-visible::before, .column-resizer.is-dragging::before { background: var(--orange); box-shadow: 0 0 0 1px rgba(246, 135, 18, .22); }
.column-resizer:focus-visible { outline: none; }
body.column-resizing { cursor: col-resize; user-select: none; }
body.column-resizing td textarea, body.column-resizing td input { pointer-events: none; }
td:first-child { padding-top: 19px; }
tbody tr:hover { background: #191a1a; }
tbody tr.excluded { opacity: .38; }
td input[type="text"], td textarea { width: 100%; min-height: 38px; padding: 6px 7px; color: var(--text); border: 1px solid transparent; border-radius: 5px; background: transparent; line-height: 1.42; }
td textarea { display: block; min-height: 34px; overflow: hidden; resize: none; field-sizing: content; }
td input[type="text"]:focus, td textarea:focus, td input[type="text"]:focus-visible, td textarea:focus-visible { border-color: var(--orange); outline: none; background: var(--field); }
.source-cell { padding-top: 18px; color: var(--muted); font-size: 12px; }
.status-cell { padding-top: 21px; }
.status-dot { display: inline-block; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; }
.status-dot.ready { background: var(--green); }
.status-dot.warning { background: var(--yellow); }

.pagination { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 9px; }
.page-button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.page-button:disabled { cursor: default; opacity: .35; }
#page-label { min-width: 110px; color: var(--muted); font-size: 12px; text-align: center; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; padding: 10px 14px; color: #17110a; border-radius: 7px; background: var(--orange); box-shadow: var(--shadow); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity 160ms ease, transform 160ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.settings-status-error { color: #ff9d94 !important; font-weight: 700; }

@media (min-width: 931px) {
  .translation-workspace-heading > p { white-space: nowrap; }
}

@media (max-width: 1140px) {
  /* The 1040px table no longer fits: scroll it horizontally, which means the header cannot stay pinned. */
  .table-wrap { overflow-x: auto; }
  .review-toolbar, th { position: static; }
  th.dialogue-heading { position: relative; }
}

@media (max-width: 930px) {
  .topbar { height: auto; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .main-nav { order: 3; width: 100%; height: 42px; margin: 6px 0 -8px; overflow-x: auto; }
  .main-nav button { flex: 1 0 auto; }
  .preset-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .metadata-fields { grid-template-columns: 1fr 1fr; }
  .metadata-title-field { grid-column: 1 / -1; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .results-tools { width: 100%; align-items: flex-start; }
  .export-actions { justify-content: flex-start; }
  .summary-grid, .summary-grid.translation-summary { grid-template-columns: repeat(2, 1fr); }
  .estimation-panel { grid-template-columns: 1fr; }
  .loop-settings-card { grid-template-columns: 1fr auto; }
  .review-toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-field { max-width: none; flex-basis: 100%; }
  .row-count { margin-left: 0; }
}

@media (max-width: 620px) {
  .topbar { height: 58px; padding: 0 16px; }
  .import-view { width: min(100% - 28px, 760px); padding-top: 38px; }
  .dropzone { min-height: 220px; padding: 24px; }
  .results-view { padding: 32px 12px 54px; }
  .summary-grid, .summary-grid.translation-summary { grid-template-columns: 1fr 1fr; }
  .estimation-controls { grid-template-columns: 1fr 1fr; }
  .status-legend { flex-wrap: wrap; }
  .saved-result { align-items: flex-start; flex-direction: column; }
  .saved-result-actions { width: 100%; flex-wrap: wrap; }
  .processing-heading { grid-template-columns: auto minmax(0, 1fr); }
  .processing-heading > button { grid-column: 1 / -1; justify-self: start; }
  .processing-item { grid-template-columns: 28px minmax(0, 1fr); }
  .processing-item button { grid-column: 2; justify-self: start; }
  .batch-view { width: calc(100% - 28px); padding-top: 42px; }
  .batch-result { grid-template-columns: 34px minmax(0, 1fr); }
  .batch-result-actions, .batch-result-label { grid-column: 2; }
  .batch-result-actions { flex-wrap: wrap; }
  .batch-footer { align-items: stretch; flex-direction: column; }
  .workspace-view, .settings-view { width: calc(100% - 28px); padding-top: 38px; }
  .queue-item { grid-template-columns: minmax(0, 1fr); }
  .queue-item select, .queue-item button { justify-self: stretch; }
  #export-queue .queue-item { grid-template-columns: minmax(0, 1fr); }
  #export-queue .queue-item button { justify-self: start; }
  .export-generation { align-items: stretch; flex-direction: column; }
  .loop-settings-card { grid-template-columns: 1fr; }
  .loops-preview-heading, .plan-preview-heading, .loop-episode-heading { align-items: stretch; flex-direction: column; }
  .loops-download-actions { flex-wrap: wrap; }
  .loop-dialogue-heading, .loop-dialogue-row { grid-template-columns: 112px minmax(110px, .6fr) minmax(220px, 1.4fr); }
  .loop-card { overflow-x: auto; }
  .loop-dialogue-heading, .loop-dialogue-row { min-width: 620px; }
  .loop-boundary { height: 34px; }
  .loop-boundary::before { top: 15px; }
  .settings-grid, .preset-layout, .preset-form { grid-template-columns: 1fr; }
  .site-footer { gap: 6px; padding-right: 14px; padding-left: 14px; font-size: 12px; }
  .preset-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .preset-form .wide-field { grid-column: 1; }
  .metadata-fields { grid-template-columns: 1fr; }
  .metadata-title-field { grid-column: 1; }
  .metadata-heading { flex-direction: column; }
}

.inline-alert { margin: 12px 0 0; padding: 10px 12px; color: #ffaaa2; border: 1px solid rgba(255, 118, 107, .28); border-radius: 7px; background: rgba(255, 118, 107, .09); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.inline-alert.is-info { color: #ecd38e; border-color: rgba(230, 184, 70, .3); background: rgba(230, 184, 70, .09); }
.results-view > .inline-alert { margin: 14px 0 0; }
.preset-form .inline-alert { margin: 0; }
.session-warning { padding: 9px clamp(20px, 4vw, 56px); color: #17110a; background: var(--yellow); font-size: 12px; font-weight: 650; line-height: 1.4; }
/* Demo servers keep the quota in view: one line under the top bar, plain text with the counters emphasised. */
.demo-banner { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px clamp(20px, 4vw, 56px); color: #d6ecf8; border-bottom: 1px solid rgba(101, 188, 232, .28); background: rgba(101, 188, 232, .1); font-size: 12px; line-height: 1.4; }
.demo-banner strong { color: var(--text); font-weight: 700; }
.demo-banner .demo-banner-label { color: var(--blue); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.demo-banner .demo-banner-exhausted { color: #ffaaa2; }
.login-info { margin: 0 !important; padding: 10px 11px; color: #cfe6d6 !important; border-radius: 6px; background: rgba(79, 192, 122, .12); font-size: 12px !important; line-height: 1.45 !important; }
.confirm-dialog .translation-disclosure-content h2 { font-size: 22px; }
.confirm-dialog .translation-disclosure-content p + p { margin-top: 10px; color: var(--muted); }
.metadata-fields input[aria-invalid="true"], .metadata-fields select[aria-invalid="true"] { border-color: #ff766b; box-shadow: 0 0 0 2px rgba(255, 118, 107, .2); }
/* Popup buttons: native menulist styling ignores height and padding (Safari especially), so draw them ourselves at the
   same height as the fields beside them, with a chevron. The menu they open is still the browser's own. */
select, .settings-grid select, .preset-form select, .metadata-fields select, .estimation-controls select, .queue-item select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='20' viewBox='0 0 12 20' fill='none' stroke='%23d8d4cb' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M2.5 5.5 6 2l3.5 3.5M2.5 14.5 6 18l3.5-3.5'/></svg>"); background-repeat: no-repeat; background-position: right 11px center; background-size: 12px 20px; }
.settings-grid select, .preset-form select, .metadata-fields select { height: 42px; min-height: 42px; }
/* Fields and popup buttons brighten under the pointer so they read as interactive; focus keeps the orange treatment. */
select, input[type="number"], .settings-grid input, .preset-form input, .preset-form textarea, .metadata-fields input, .loop-settings-controls input, .estimation-controls input { transition: background-color 120ms ease, border-color 120ms ease; }
select:hover:not(:disabled), input[type="number"]:hover:not(:disabled), .settings-grid input:hover:not(:disabled), .preset-form input:hover:not(:disabled), .preset-form textarea:hover:not(:disabled), .metadata-fields input:hover:not(:disabled), .loop-settings-controls input:hover:not(:disabled), .estimation-controls input:hover:not(:disabled) { border-color: var(--line-strong); background-color: var(--panel-raised); }
.estimation-controls select { height: 37px; }
.queue-item select { height: 36px; min-height: 36px; padding-top: 0; padding-bottom: 0; }
.translation-progress { display: block; width: 100%; height: 4px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: var(--line); }
.translation-progress span { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width 240ms ease; }

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

/* Number fields: the native spin buttons sit too close together and cannot be spaced, so they are hidden and replaced by
   two drawn chevrons 10px apart; app.js steps the value when the chevron area is clicked. Keep this after every rule that
   sets a field background with the shorthand, or the chevrons are wiped out. */
input[type="number"], .loop-settings-controls input[type="number"], .estimation-controls input[type="number"] { appearance: textfield; -moz-appearance: textfield; padding-right: 34px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24' fill='none' stroke='%23d8d4cb' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M2.5 6.5 6 3l3.5 3.5M2.5 17.5 6 21l3.5-3.5'/></svg>"); background-repeat: no-repeat; background-position: right 11px center; background-size: 12px 24px; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { cursor: text; text-align: right; padding-right: 32px; }

.update-details { padding: 0 17px 6px 19px; }
.update-details p { margin: 0 0 10px; color: var(--text); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.update-details a { display: inline-block; margin: 0 16px 10px 0; color: var(--orange); font-size: 13px; text-decoration: none; }
.update-details a:hover { text-decoration: underline; }
.update-card .inline-alert { margin: 0 17px 17px 19px; }
/* The update actions sit clear of the heading (or the notes above them) instead of hugging the description. */
.update-card .settings-actions { padding-top: 16px; }

/* Field labels: bold and lighter than helper text so they stand apart from the value typed beneath them. */
.settings-grid label, .preset-form label, .metadata-fields label, .loop-settings-controls label, .estimation-controls label, .login-card label { color: var(--field-label); font-size: 12px; font-weight: 700; letter-spacing: .01em; }
.settings-grid small, .preset-form small, .settings-grid label input, .settings-grid label select, .preset-form label input, .preset-form label select, .preset-form label textarea, .metadata-fields label input, .metadata-fields label select, .loop-settings-controls label input, .estimation-controls label input, .estimation-controls label select, .login-card label input { font-weight: 400; letter-spacing: normal; }
