:root {
  --ink: #17211f;
  --ink-soft: #53615d;
  --paper: #fffef9;
  --canvas: #edf3f0;
  --canvas-deep: #dbe9e4;
  --primary: #0f766e;
  --primary-dark: #0a4f4a;
  --primary-pale: #d8f3eb;
  --accent: #c2410c;
  --accent-pale: #ffeadf;
  --line: #bfd0ca;
  --line-dark: #8ea59e;
  --danger: #b42318;
  --danger-pale: #fff0ed;
  --shadow: 0 22px 70px rgba(20, 43, 36, 0.13);
  --display: "Iowan Old Style", "Palatino Linotype", "Noto Serif SC", serif;
  --body: "Avenir Next", "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  --utility: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease: 220ms cubic-bezier(.2,.75,.3,1);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; }
button, select, input { font: inherit; }
button, [role="button"] { touch-action: manipulation; }
button { color: inherit; }
button:not(:disabled), [role="button"] { cursor: pointer; }
button:focus-visible, select:focus-visible, [role="button"]:focus-visible, a:focus-visible { outline: 3px solid #f59d75; outline-offset: 3px; }
h1[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; z-index: 1000; top: 10px; left: 10px; padding: 10px 14px; background: var(--ink); color: white; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.app-header { height: 76px; padding: 0 clamp(20px, 4.3vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(23,33,31,.12); }
.brand { min-height: 44px; display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: 38px; height: 38px; overflow: hidden; border: 1.5px solid var(--ink); border-radius: 4px 12px 4px 4px; font: 700 13px/1 var(--utility); }
.brand-mark::after { content: ""; position: absolute; inset: 0 50% 0 auto; border-right: 1px solid var(--ink); }
.brand-mark span { display: grid; place-items: center; }
.brand-mark span:last-child { background: var(--primary); color: white; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.04em; }
.brand-name span { color: var(--primary); }
.brand-name small { margin-left: 7px; color: var(--ink-soft); font: 600 9px/1 var(--utility); letter-spacing: .04em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.local-note, .text-button { display: inline-flex; align-items: center; gap: 8px; }
.local-note { font: 11px/1 var(--utility); letter-spacing: .02em; color: var(--ink-soft); }
.local-note svg { width: 15px; height: 15px; }
.text-button { min-height: 44px; border: 0; background: transparent; font-size: 14px; font-weight: 600; }
.text-button:hover { color: var(--primary); }

.landing { min-height: calc(100dvh - 76px); display: grid; grid-template-columns: minmax(0, .88fr) minmax(420px, 1fr); align-items: center; gap: clamp(40px, 7vw, 124px); max-width: 1500px; margin: 0 auto; padding: 72px clamp(24px, 6.5vw, 104px) 96px; overflow: hidden; }
.eyebrow { margin: 0 0 18px; font: 700 11px/1.2 var(--utility); letter-spacing: .15em; color: var(--primary); }
.hero-copy { position: relative; z-index: 2; }
.hero-copy h1, .setup-heading h1, .processing-copy h1 { max-width: 680px; margin: 0; font-family: var(--display); font-size: clamp(50px, 5.7vw, 86px); font-weight: 500; line-height: .98; letter-spacing: -.055em; }
.hero-copy h1 em { position: relative; color: var(--primary); font-style: italic; }
.hero-copy h1 em::after { content: ""; position: absolute; left: 4px; right: 0; bottom: -5px; height: 5px; background: url("data:image/svg+xml,%3Csvg width='120' height='6' viewBox='0 0 120 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4.5C28 1 78 2 119 1.5' stroke='%23C2410C' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left center / 120px 6px; }
.hero-intro { max-width: 530px; margin: 34px 0 0; color: var(--ink-soft); font-size: clamp(17px, 1.4vw, 20px); line-height: 1.75; }
.trust-line { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 38px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.trust-line span { display: inline-flex; align-items: center; gap: 6px; }
.trust-line svg { width: 16px; height: 16px; color: var(--primary); stroke-width: 2.4; }

.upload-stage { position: relative; min-width: 0; }
.paper-shadow { position: absolute; inset: 10px 24px -7px; border: 1px solid var(--line); background: #e6efeb; box-shadow: var(--shadow); transform-origin: bottom; }
.paper-shadow-one { transform: rotate(4deg); }
.paper-shadow-two { transform: rotate(-3deg); }
.upload-sheet { position: relative; z-index: 2; min-height: 590px; padding: 34px 34px 26px 58px; background-color: var(--paper); background-image: linear-gradient(rgba(15,118,110,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(15,118,110,.025) 1px, transparent 1px); background-size: 24px 24px; border: 1px solid var(--line); box-shadow: 0 24px 64px rgba(19,52,43,.14); }
.sheet-ruler { position: absolute; inset: 0 auto 0 0; width: 34px; display: flex; flex-direction: column; align-items: center; justify-content: space-around; border-right: 1px solid #ebc9bd; color: var(--accent); font: 9px/1 var(--utility); }
.sheet-ruler::before { content: ""; position: absolute; inset: 0 6px 0 auto; width: 4px; background: repeating-linear-gradient(to bottom, transparent 0 11px, #d7dedb 11px 12px); }
.drop-zone { min-height: 380px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; border: 1.5px dashed var(--line-dark); background: rgba(255,255,255,.6); text-align: center; transition: background var(--ease), border-color var(--ease), transform var(--ease); }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--primary); background: var(--primary-pale); }
.drop-zone.dragging { transform: scale(.992); }
.drop-zone.is-parsing { border-style: solid; border-color: var(--primary); background: #f3fbf8; cursor: progress; }
.drop-zone.is-parsing > :not(.parse-status) { display: none; }
.parse-status { display: flex; flex-direction: column; align-items: center; max-width: 390px; color: var(--ink); }
.parse-status[hidden] { display: none; }
.parse-spinner { width: 56px; height: 56px; margin-bottom: 22px; border: 2px solid #bddad0; border-top-color: var(--primary); border-radius: 50%; animation: parse-spin 820ms linear infinite; }
.parse-status strong { font-family: var(--display); font-size: 28px; }
.parse-status small { max-width: 320px; overflow: hidden; margin-top: 8px; color: var(--primary-dark); font: 700 11px/1.4 var(--utility); text-overflow: ellipsis; white-space: nowrap; }
.parse-status > span:last-child { margin-top: 18px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
@keyframes parse-spin { to { transform: rotate(360deg); } }
.upload-icon { display: grid; place-items: center; width: 66px; height: 66px; margin-bottom: 22px; border-radius: 50%; background: var(--primary-pale); color: var(--primary-dark); }
.upload-icon svg { width: 27px; height: 27px; }
.drop-zone h2 { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -.025em; }
.drop-zone p { margin: 6px 0 22px; color: var(--ink-soft); font-size: 14px; }
.primary-button, .translate-button, .export-button { border: 0; background: var(--primary); color: white; font-weight: 700; transition: background var(--ease), transform var(--ease); }
.primary-button { min-width: 144px; min-height: 48px; display: inline-grid; place-items: center; padding: 0 20px; }
.primary-button:hover, .translate-button:hover, .export-button:hover { background: var(--primary-dark); }
.primary-button:active, .translate-button:active, .export-button:active { transform: scale(.98); }
.file-limit { margin-top: 14px; color: #71807b; font: 10px/1 var(--utility); letter-spacing: .08em; }
.demo-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0 12px; color: #788781; font-size: 12px; }
.demo-divider::before, .demo-divider::after { content: ""; height: 1px; flex: 1; background: #dce5e1; }
.sample-button { width: 100%; min-height: 70px; display: grid; grid-template-columns: 42px 1fr 24px; align-items: center; gap: 14px; padding: 9px 10px; border: 0; background: transparent; text-align: left; transition: background var(--ease); }
.sample-button:hover { background: #eef5f2; }
.sample-thumb { display: grid; place-items: center; height: 48px; background: var(--accent-pale); color: var(--accent); font: 700 9px/1 var(--utility); border: 1px solid #efc2ae; border-radius: 2px 8px 2px 2px; }
.sample-button strong, .sample-button small { display: block; }
.sample-button strong { font-size: 14px; }
.sample-button small { margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.sample-button > svg { color: var(--ink-soft); }
.inline-error { min-height: 84px; margin-top: 18px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #efb7ae; background: var(--danger-pale); color: var(--danger); }
.inline-error strong, .inline-error span { display: block; }
.inline-error strong { font-size: 13px; }
.inline-error span { margin-top: 2px; font-size: 12px; color: #7a342c; }
.inline-error button { min-height: 44px; border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 700; }

.setup-view { max-width: 1240px; min-height: calc(100dvh - 76px); margin: 0 auto; padding: 58px clamp(24px, 5vw, 72px) 96px; }
.back-link { min-height: 44px; margin: 0 0 34px; padding: 0; border: 0; background: transparent; color: var(--ink-soft); font-size: 13px; }
.back-link:hover { color: var(--primary); }
.setup-heading h1 { font-size: clamp(46px, 5.5vw, 78px); }
.setup-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(430px, 1.2fr); gap: clamp(32px, 6vw, 80px); align-items: start; margin-top: 64px; }
.file-ticket { display: grid; grid-template-columns: 92px 1fr; min-height: 286px; border: 1px solid var(--line-dark); background: var(--paper); box-shadow: 0 14px 40px rgba(20,43,36,.08); }
.ticket-stub { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 22px 12px; border-right: 1px dashed var(--line-dark); background: var(--primary-pale); color: var(--primary-dark); }
.ticket-stub::before, .ticket-stub::after { content: ""; position: absolute; right: -8px; width: 14px; height: 14px; border-radius: 50%; background: var(--canvas); border: 1px solid var(--line-dark); }
.ticket-stub::before { top: -8px; }
.ticket-stub::after { bottom: -8px; }
.ticket-stub span { font: 800 11px/1 var(--utility); }
.ticket-stub svg { width: 34px; height: 34px; }
.file-ticket[data-file-type="doc"] .ticket-stub,
.file-ticket[data-file-type="docx"] .ticket-stub { background: #e5edff; color: #3156a3; }
.file-ticket[data-file-type="txt"] .ticket-stub { background: #ecefed; color: #4c5955; }
.ticket-body { min-width: 0; padding: 24px; }
.ticket-label { color: var(--ink-soft); font-size: 11px; }
.ticket-body h2 { overflow: hidden; margin: 7px 0 8px; font-family: var(--display); font-size: 22px; text-overflow: ellipsis; white-space: nowrap; }
.ticket-status { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--primary-dark); font-size: 11px; font-weight: 700; }
.ticket-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-pale); }
.file-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 22px 0 2px; border-block: 1px solid var(--line); }
.file-metrics > div { min-width: 0; padding: 12px 12px 12px 0; }
.file-metrics > div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
.file-metrics > div:nth-child(n+3) { border-top: 1px solid var(--line); }
.file-metrics dt { margin-bottom: 4px; color: var(--ink-soft); font: 700 9px/1 var(--utility); letter-spacing: .08em; text-transform: uppercase; }
.file-metrics dd { overflow: hidden; margin: 0; color: var(--ink); font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; }
.ticket-body button { min-height: 44px; margin: 8px 0 -10px; padding: 0; border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 700; }
.translation-form { padding: clamp(24px, 4vw, 48px); border-top: 4px solid var(--primary); background: var(--paper); box-shadow: var(--shadow); }
.language-row { display: grid; grid-template-columns: 1fr 52px 1fr; align-items: end; gap: 10px; }
.field-group > span, .layout-options legend { display: block; margin-bottom: 9px; color: var(--ink-soft); font: 700 10px/1 var(--utility); letter-spacing: .08em; text-transform: uppercase; }
select { width: 100%; min-height: 52px; padding: 0 42px 0 15px; border: 1px solid var(--line); border-radius: 0; background: white; color: var(--ink); }
.swap-button { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 4px 4px; border: 1px solid var(--line); border-radius: 50%; background: var(--canvas); color: var(--primary); transition: transform var(--ease); }
.swap-button:hover { transform: rotate(180deg); }
.layout-options { margin: 34px 0 0; padding: 0; border: 0; }
.option-row { position: relative; display: grid; grid-template-columns: 22px 1fr auto; align-items: start; gap: 12px; min-height: 76px; padding: 15px; border: 1px solid var(--line); cursor: pointer; }
.option-row + .option-row { margin-top: 10px; }
.option-row:has(input:checked) { border-color: var(--primary); background: #f3fbf8; }
.option-row:has(input:disabled) { border-color: #d9e1de; background: #f3f5f4; color: #7b8783; cursor: not-allowed; }
.option-row:has(input:disabled) small { color: #7b8783; }
.option-row input, .checkbox-row input { position: absolute; opacity: 0; pointer-events: none; }
.radio-mark { width: 20px; height: 20px; margin-top: 2px; border: 1.5px solid var(--line-dark); border-radius: 50%; background: white; }
.option-row input:checked + .radio-mark { border: 6px solid var(--primary); }
.option-row strong, .option-row small, .checkbox-row strong, .checkbox-row small { display: block; }
.option-row strong, .checkbox-row strong { font-size: 14px; }
.option-row small, .checkbox-row small { margin-top: 3px; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.recommended { align-self: center; color: var(--primary); font: 700 10px/1 var(--utility); }
.checkbox-row { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 12px; margin-top: 22px; cursor: pointer; }
.checkbox-mark { display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--line-dark); background: white; color: white; }
.checkbox-mark svg { width: 15px; height: 15px; stroke-width: 2.5; }
.checkbox-row input:checked + .checkbox-mark { border-color: var(--primary); background: var(--primary); }
.privacy-copy { display: flex; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid #dde6e2; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.privacy-copy svg { flex: 0 0 auto; width: 16px; color: var(--primary); }
.privacy-copy strong { color: var(--ink); }
.translate-button { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding: 0 22px; }

.processing-view { min-height: calc(100dvh - 76px); display: grid; place-items: center; padding: 48px 24px; }
.processing-sheet { position: relative; width: min(760px, 100%); padding: clamp(30px, 6vw, 72px); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.processing-sheet::before { content: ""; position: absolute; top: 0; left: 0; width: 7px; height: 100%; background: repeating-linear-gradient(to bottom, var(--primary) 0 28px, var(--paper) 28px 36px, var(--accent) 36px 44px, var(--paper) 44px 52px); }
.processing-copy h1 { max-width: 570px; font-size: clamp(42px, 6vw, 68px); }
.processing-copy > p:last-child { margin: 24px 0 0; color: var(--ink-soft); }
.progress-track { height: 5px; margin-top: 40px; overflow: hidden; background: #dce5e1; }
.progress-track span { display: block; width: 8%; height: 100%; background: var(--primary); transition: width 520ms ease-out; }
.progress-number { margin: 15px 0 32px; font: 500 clamp(54px, 8vw, 86px)/1 var(--display); color: var(--primary); }
.progress-number small { font: 700 13px/1 var(--utility); }
.process-steps { margin: 0; padding: 0; list-style: none; }
.process-steps li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 0 12px; min-height: 70px; padding: 10px 0; color: #89948f; }
.process-steps li > span { grid-row: 1 / span 2; position: relative; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid var(--line-dark); border-radius: 50%; background: var(--paper); }
.process-steps li:not(:last-child) > span::after { content: ""; position: absolute; top: 20px; left: 8px; width: 1px; height: 50px; background: var(--line); }
.process-steps strong { font-size: 14px; }
.process-steps small { font-size: 11px; }
.process-steps li.active, .process-steps li.done { color: var(--ink); }
.process-steps li.active > span { border: 6px solid var(--primary); }
.process-steps li.done > span { border-color: var(--primary); background: var(--primary); }
.process-steps li.done > span::before { content: "✓"; position: absolute; inset: -2px 0 0; color: white; font: 700 12px/20px var(--body); text-align: center; }
.cancel-button { min-height: 44px; margin-top: 14px; padding: 0; border: 0; background: transparent; color: var(--ink-soft); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }

.workspace { min-height: calc(100dvh - 76px); background: #dfe8e4; }
.workspace-bar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(20px, 3vw, 46px); border-bottom: 1px solid var(--line); background: var(--paper); }
.document-title, .workspace-actions { display: flex; align-items: center; gap: 14px; min-width: 0; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid var(--line); background: transparent; transition: background var(--ease); }
.icon-button:hover { background: var(--primary-pale); }
.document-title > div { min-width: 0; }
.document-title span { display: block; color: var(--primary); font: 700 9px/1.4 var(--utility); letter-spacing: .1em; }
.document-title h1 { overflow: hidden; max-width: 38vw; margin: 2px 0 0; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.view-toggle, .mobile-page-toggle { display: flex; padding: 3px; background: #e5ede9; }
.view-toggle button, .mobile-page-toggle button { min-height: 38px; padding: 0 14px; border: 0; background: transparent; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.view-toggle button.active, .mobile-page-toggle button.active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(23,33,31,.12); }
.export-button { min-height: 46px; display: inline-flex; align-items: center; gap: 9px; padding: 0 18px; }
.prototype-notice { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 8px 54px 8px 18px; position: relative; background: #fff5e8; border-bottom: 1px solid #ecd4b7; color: #63472f; font-size: 12px; }
.prototype-notice > span { color: var(--accent); font: 800 10px/1 var(--utility); letter-spacing: .08em; }
.prototype-notice button { position: absolute; right: 16px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; }
.prototype-notice svg { width: 16px; height: 16px; }
.workspace-body { display: grid; grid-template-columns: 86px 1fr; min-height: calc(100dvh - 200px); }
.page-rail { padding: 24px 16px; border-right: 1px solid var(--line); background: #edf2ef; }
.page-rail > p { margin: 0 0 16px; color: var(--ink-soft); font: 700 9px/1 var(--utility); letter-spacing: .1em; text-align: center; }
.page-thumb { width: 54px; min-height: 72px; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 18px; padding: 5px 5px 3px; border: 1px solid transparent; background: transparent; }
.page-thumb > span { width: 42px; height: 54px; display: flex; flex-direction: column; gap: 5px; padding: 10px 6px; background: var(--paper); box-shadow: 0 2px 8px rgba(23,33,31,.1); }
.page-thumb i { display: block; height: 2px; background: #bcc7c3; }
.page-thumb i:nth-child(2) { width: 75%; }
.page-thumb b { font: 600 10px/1 var(--utility); }
.page-thumb.active { border-color: var(--primary); background: var(--primary-pale); }
.document-stage { min-width: 0; display: grid; grid-template-columns: minmax(340px, 600px) 22px minmax(340px, 600px); justify-content: center; align-items: start; padding: 42px clamp(24px, 4vw, 64px) 80px; }
.document-page { min-height: 790px; padding: clamp(34px, 4vw, 64px); background: var(--paper); box-shadow: 0 14px 42px rgba(23,33,31,.13); }
.page-meta { display: flex; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid #d9e1de; color: var(--ink-soft); font: 700 9px/1 var(--utility); letter-spacing: .1em; }
.page-content { padding-top: 44px; }
.page-content .doc-kicker { margin: 0 0 11px; color: var(--accent); font: 700 9px/1 var(--utility); letter-spacing: .16em; text-transform: uppercase; }
.page-content h2 { max-width: 520px; margin: 0; font-family: var(--display); font-size: clamp(32px, 3.1vw, 48px); font-weight: 500; line-height: 1.07; letter-spacing: -.035em; }
.page-content .doc-deck { max-width: 500px; margin: 20px 0 34px; color: var(--ink-soft); font-family: var(--display); font-size: 17px; font-style: italic; line-height: 1.55; }
.page-content h3 { margin: 28px 0 9px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.page-content p { margin: 0 0 16px; color: #34413d; font-family: var(--display); font-size: 15px; line-height: 1.78; }
.page-content blockquote { margin: 28px 0; padding: 18px 22px; border-left: 3px solid var(--accent); background: #fff6ef; font-family: var(--display); font-size: 18px; line-height: 1.55; }
.doc-stat { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 18px; margin: 30px 0; padding: 20px 0; border-block: 1px solid #d9e1de; }
.doc-stat strong { font: 500 46px/1 var(--display); color: var(--primary); }
.doc-stat span { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.translation-binding { display: flex; flex-direction: column; justify-content: space-evenly; height: 790px; }
.translation-binding span { display: block; height: 1px; background: var(--accent); }
.translation-binding span::after { content: ""; display: block; width: 5px; height: 5px; margin: -2px auto 0; border-radius: 50%; background: var(--accent); }
.translated-page { position: relative; }
.translated-page::before { content: "译"; position: absolute; top: 110px; right: 34px; color: rgba(15,118,110,.08); font: 500 92px/1 var(--display); }
.page-footer { margin-top: 50px; padding-top: 12px; border-top: 1px solid #d9e1de; color: #7b8783; font: 9px/1.3 var(--utility); }
.document-stage.translated-mode { grid-template-columns: minmax(340px, 720px); }
.document-stage.translated-mode .source-page, .document-stage.translated-mode .translation-binding { display: none; }
.mobile-page-toggle { display: none; }

.drawer-scrim { position: fixed; z-index: 80; inset: 0; background: rgba(11,25,21,.48); }
.history-drawer { position: fixed; z-index: 90; top: 0; right: 0; width: min(430px, 100%); height: 100dvh; padding: 28px; background: var(--paper); box-shadow: -20px 0 60px rgba(18,31,28,.18); transform: translateX(105%); visibility: hidden; transition: transform 260ms ease-out, visibility 260ms; }
.history-drawer.open { transform: translateX(0); visibility: visible; }
.drawer-header { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 0; font-family: var(--display); font-size: 30px; }
.history-content { padding-top: 22px; }
.history-empty { padding: 50px 20px; text-align: center; color: var(--ink-soft); }
.history-empty svg { width: 34px; height: 34px; color: var(--line-dark); }
.history-empty h3 { margin: 16px 0 6px; color: var(--ink); font-family: var(--display); font-size: 22px; }
.history-empty p { margin: 0; font-size: 13px; }
.history-item { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid #e2e8e5; }
.history-item > span { display: grid; place-items: center; height: 50px; background: var(--primary-pale); color: var(--primary); }
.history-item h3 { overflow: hidden; margin: 0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.history-item p { margin: 3px 0 0; color: var(--ink-soft); font-size: 11px; }
.history-item button { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 700; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: 26px; max-width: calc(100vw - 32px); padding: 12px 18px; background: var(--ink); color: white; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 13px; transform: translateX(-50%); }

@media (max-width: 960px) {
  .landing { grid-template-columns: 1fr; padding-top: 52px; }
  .hero-copy { max-width: 680px; }
  .upload-stage { width: min(660px, calc(100% - 16px)); margin-inline: auto; }
  .setup-grid { grid-template-columns: 1fr; }
  .file-ticket { max-width: 560px; }
  .document-stage { grid-template-columns: minmax(280px, 1fr) 16px minmax(280px, 1fr); padding-inline: 24px; }
  .document-page { min-height: 700px; padding: 34px; }
  .translation-binding { height: 700px; }
}

@media (max-width: 799px) {
  .app-header { height: 66px; padding-inline: 18px; }
  .local-note { display: none; }
  .text-button { font-size: 0; }
  .text-button svg { width: 21px; height: 21px; }
  .landing, .setup-view, .processing-view { min-height: calc(100dvh - 66px); }
  .landing { padding: 42px 20px 68px; gap: 56px; }
  .hero-copy h1 { font-size: clamp(47px, 13.5vw, 68px); }
  .hero-intro { font-size: 17px; }
  .upload-stage { width: calc(100% - 12px); }
  .upload-sheet { min-height: 500px; padding: 24px 18px 20px 42px; }
  .drop-zone { min-height: 320px; padding-inline: 18px; }
  .sheet-ruler { width: 28px; }
  .trust-line { gap: 10px 16px; }
  .setup-view { padding: 34px 20px 70px; }
  .setup-heading h1 { font-size: 49px; }
  .setup-grid { margin-top: 42px; }
  .translation-form { padding: 26px 20px; }
  .language-row { grid-template-columns: 1fr 44px 1fr; }
  .swap-button { margin-inline: 0; }
  .recommended { display: none; }
  .processing-sheet { padding: 38px 30px; }
  .workspace-bar { align-items: flex-start; padding: 13px 14px; }
  .workspace-actions { gap: 8px; }
  .view-toggle { display: none; }
  .export-button { font-size: 0; padding-inline: 14px; }
  .export-button svg { width: 20px; height: 20px; }
  .document-title h1 { max-width: 42vw; }
  .prototype-notice { justify-content: flex-start; padding-left: 16px; }
  .prototype-notice > span { display: none; }
  .mobile-page-toggle { display: flex; width: calc(100% - 32px); margin: 16px auto 0; }
  .mobile-page-toggle button { flex: 1; }
  .workspace-body { display: block; min-height: auto; }
  .page-rail { display: flex; align-items: center; gap: 10px; padding: 14px 16px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .page-rail > p { margin: 0 4px 0 0; }
  .page-thumb { width: 48px; min-height: 46px; flex: 0 0 auto; margin: 0; padding: 4px; }
  .page-thumb > span { display: none; }
  .document-stage, .document-stage.translated-mode { display: block; padding: 20px 16px 64px; }
  .document-page { min-height: 650px; padding: 30px 24px; }
  .translation-binding { display: none; }
  .document-stage .translated-page { display: none; }
  .document-stage.mobile-translated .source-page { display: none; }
  .document-stage.mobile-translated .translated-page { display: block; }
  .document-stage.translated-mode .translated-page { display: block; }
  .page-content { padding-top: 34px; }
  .page-content h2 { font-size: 36px; }
}

@media (max-width: 520px) {
  .brand-name { font-size: 18px; }
  .brand-name small { display: none; }
  .header-actions { gap: 4px; }
  .hero-copy h1 { letter-spacing: -.065em; }
  .trust-line { display: grid; grid-template-columns: 1fr 1fr; }
  .paper-shadow { inset-inline: 14px; }
  .inline-error { grid-template-columns: 20px 1fr; }
  .inline-error button { grid-column: 2; justify-self: start; }
  .file-ticket { grid-template-columns: 72px 1fr; }
  .ticket-body { padding: 20px 16px; }
  .language-row { grid-template-columns: 1fr 44px; }
  .language-row .field-group:first-child { grid-column: 1 / -1; }
  .swap-button { display: none; }
  .option-row { grid-template-columns: 22px 1fr; }
  .processing-copy h1 { font-size: 43px; }
  .process-steps li { min-height: 66px; }
  .document-title h1 { max-width: 44vw; }
  .prototype-notice { font-size: 11px; }
}

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

/* Rezi-inspired product finish: cool canvas, compact controls, document-first workspace. */
:root {
  --ink: #17181d;
  --ink-soft: #666974;
  --paper: #ffffff;
  --canvas: #f7f8fb;
  --canvas-deep: #eceef4;
  --primary: #5b6fe8;
  --primary-dark: #4758c9;
  --primary-pale: #eef0ff;
  --accent: #e86545;
  --accent-pale: #fff0eb;
  --line: #e2e4ea;
  --line-dark: #c7cad3;
  --danger: #c9362b;
  --danger-pale: #fff3f2;
  --shadow: 0 16px 42px rgba(31, 35, 48, .08);
  --display: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  --body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  --utility: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease: 200ms cubic-bezier(.2,.75,.3,1);
}

body { background: var(--canvas); letter-spacing: -.005em; }
button:focus-visible, select:focus-visible, [role="button"]:focus-visible, a:focus-visible { outline: 3px solid rgba(91,111,232,.28); outline-offset: 2px; }
.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; }

.app-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 72px;
  padding: 0 clamp(22px, 5vw, 80px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.95);
}
.brand { justify-self: start; gap: 11px; }
.brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 0;
  border-radius: 11px;
  background: transparent;
  box-shadow: 0 7px 16px rgba(36,17,79,.2);
  transition: box-shadow var(--ease), transform var(--ease);
}
.brand:hover .brand-mark { box-shadow: 0 9px 20px rgba(36,17,79,.22); transform: translateY(-1px); }
.brand-mark::after { display: none; }
.brand-mark img { display: block; width: 40px; height: 40px; object-fit: cover; }
.brand-name { display: grid; gap: 1px; font-size: inherit; line-height: 1; letter-spacing: 0; }
.brand-name .brand-word { color: #18191e; font-size: 19px; font-weight: 760; letter-spacing: -.055em; }
.brand-name .brand-word strong { color: var(--primary); font-weight: 760; }
.brand-name small { margin: 0; color: #858894; font-family: var(--body); font-size: 7px; font-weight: 700; line-height: 1; letter-spacing: .2em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 13px; border-radius: 7px; color: #4f525b; font-size: 13px; font-weight: 600; text-decoration: none; }
.main-nav a:hover { color: var(--primary-dark); background: #f3f4fa; }
.main-nav a.active { color: var(--primary-dark); background: var(--primary-pale); }
.local-note { color: #747782; font-family: var(--body); font-size: 11px; }
.local-note svg { color: #24a36a; }
.header-actions { justify-self: end; gap: 12px; }
.locale-control { position: relative; display: block; }
.locale-control::before { content: "A/文"; position: absolute; z-index: 1; left: 10px; top: 50%; color: var(--primary); font-size: 9px; font-weight: 750; transform: translateY(-50%); pointer-events: none; }
.locale-control select { width: auto; min-width: 118px; min-height: 44px; padding: 0 28px 0 38px; border: 1px solid var(--line); border-radius: 8px; background-color: white; color: #444750; font-size: 12px; font-weight: 600; }
.text-button { padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 13px; }
.text-button:hover { border-color: #c8cce0; background: #f8f9fd; }

.landing {
  display: block;
  min-height: calc(100dvh - 72px);
  max-width: 1240px;
  padding: 28px clamp(24px, 5vw, 72px) 112px;
  overflow: visible;
}
.hero-copy { max-width: 850px; margin: 0 auto; text-align: center; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin: 0 0 38px; color: #777a84; font-size: 12px; text-align: left; }
.breadcrumb b { color: #b0b2ba; font-size: 15px; font-weight: 500; }
.breadcrumb span:last-child { color: #444750; }
.eyebrow { margin-bottom: 20px; color: var(--primary); font-family: var(--body); font-size: 11px; letter-spacing: .13em; }
.hero-copy h1, .setup-heading h1, .processing-copy h1 {
  color: #111216;
  font-family: var(--display);
  font-size: clamp(52px, 5.15vw, 78px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -.062em;
}
.hero-copy h1 { max-width: 850px; font-size: clamp(38px,4.7vw,56px); letter-spacing: -.048em; }
.hero-copy h1 em { color: #73757c; font-style: normal; }
.hero-copy h1 em::after { display: none; }
.hero-intro { max-width: 720px; margin: 17px auto 0; color: #5f626c; font-size: clamp(15px, 1.2vw, 17px); line-height: 1.65; }
.trust-line { justify-content: center; gap: 12px 26px; margin-top: 26px; color: #4f525b; font-size: 12px; font-weight: 500; }
.trust-line svg { color: #25a56c; }

.upload-stage { width: min(940px,100%); margin: 34px auto 0; filter: none; }
.paper-shadow { display: none; }
.upload-sheet {
  min-height: 470px;
  padding: 28px 34px 20px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg,#536be8 0%,#685fdc 100%);
  box-shadow: 0 18px 44px rgba(65,72,168,.2);
}
.upload-sheet::before, .upload-sheet::after { display: none; }
.upload-sheet-title { display: none; }
.upload-sheet-title i {
  width: 34px;
  height: 8px;
  background: radial-gradient(circle, #c5c8d0 2px, transparent 2.5px) 0 0 / 12px 8px;
}
.book-progress { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; }
.book-progress b { display: block; width: 4px; border-radius: 3px; background: #d8dbe4; }
.book-progress b:nth-child(1) { height: 9px; }
.book-progress b:nth-child(2) { height: 14px; background: #9ba7f6; }
.book-progress b:nth-child(3) { height: 18px; background: var(--primary); }
.sheet-ruler { display: none; }
.drop-zone {
  min-height: 330px;
  padding: 42px 26px 30px;
  border: 1.5px dashed rgba(255,255,255,.35);
  border-radius: 7px;
  background: rgba(255,255,255,.045);
}
.drop-zone:hover, .drop-zone.dragging { border-color: rgba(255,255,255,.78); background: rgba(255,255,255,.1); }
.drop-zone.dragging { transform: none; box-shadow: inset 0 0 0 3px rgba(255,255,255,.1); }
.upload-icon { position: relative; width: 62px; height: 62px; margin-bottom: 18px; border-radius: 14px; background: rgba(255,255,255,.17); color: white; }
.upload-icon::after {
  content: "↔";
  position: absolute;
  right: -5px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(232,101,69,.25);
}
.upload-icon svg { width: 25px; height: 25px; stroke-width: 2; }
.drop-zone h2 { color: white; font-family: var(--body); font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
.drop-zone p { margin: 7px 0 22px; color: rgba(255,255,255,.78); font-size: 13px; }
.primary-button, .translate-button, .export-button { border-radius: 8px; background: var(--primary); box-shadow: 0 7px 16px rgba(91,111,232,.2); }
.primary-button { min-width: 210px; min-height: 48px; padding: 0 20px; font-size: 13px; }
.drop-zone .primary-button { background: white; color: var(--primary-dark); box-shadow: 0 8px 20px rgba(35,37,105,.18); }
.file-limit { margin-top: 15px; color: rgba(255,255,255,.72); font-family: var(--body); font-size: 10px; letter-spacing: .03em; }
.demo-divider { margin: 17px 0 6px; color: rgba(255,255,255,.72); }
.demo-divider::before, .demo-divider::after { background: rgba(255,255,255,.22); }
.sample-button { min-height: 62px; border-radius: 7px; color: white; }
.sample-button:hover { background: rgba(255,255,255,.1); }
.sample-button > svg { color: rgba(255,255,255,.82); }
.sample-thumb { width: 44px; border: 1px solid rgba(255,255,255,.5); border-radius: 6px; background: rgba(255,255,255,.14); color: white; font-family: var(--body); font-size: 9px; }
.sample-button strong { color: white; font-size: 13px; }
.sample-button small { color: rgba(255,255,255,.7); }
.inline-error { border-radius: 8px; }

.setup-view { max-width: 1180px; min-height: calc(100dvh - 72px); padding-top: 46px; }
.back-link { margin-bottom: 28px; color: #696c76; }
.setup-heading .eyebrow { margin-bottom: 12px; }
.setup-heading h1 { font-size: clamp(42px, 4.8vw, 64px); }
.setup-grid { grid-template-columns: minmax(280px,.7fr) minmax(500px,1.3fr); gap: clamp(30px,5vw,64px); margin-top: 46px; }
.file-ticket { grid-template-columns: 78px 1fr; min-height: 154px; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 26px rgba(29,32,44,.06); overflow: hidden; }
.ticket-stub { padding: 19px 11px; border-right: 1px solid var(--line); background: #f0f2ff; color: var(--primary); }
.ticket-stub::before, .ticket-stub::after { display: none; }
.file-ticket[data-file-type="doc"] .ticket-stub, .file-ticket[data-file-type="docx"] .ticket-stub { background: #edf4ff; color: #3971c2; }
.file-ticket[data-file-type="txt"] .ticket-stub { background: #f1f2f4; color: #5a5d66; }
.file-ticket[data-file-type="epub"] .ticket-stub { background: #f1edff; color: #5b46ad; }
.ticket-body { padding: 21px; }
.ticket-body h2 { font-family: var(--body); font-size: 17px; font-weight: 650; }
.ticket-body button { color: var(--primary); }
.translation-form { padding: clamp(28px,4vw,42px); border: 1px solid var(--line); border-top: 3px solid var(--primary); border-radius: 10px; box-shadow: 0 12px 38px rgba(29,32,44,.07); }
.field-group > span, .layout-options legend { color: #565963; font-family: var(--body); font-size: 11px; letter-spacing: .02em; text-transform: none; }
.field-group select { border-color: #d8dae1; border-radius: 8px; background-color: white; }
.swap-button { border-color: var(--line); border-radius: 8px; background: #f8f9fb; }
.swap-button:hover { transform: none; border-color: #bfc4dd; background: #f0f2ff; }
.layout-options { margin-top: 28px; }
.option-row { min-height: 72px; border-radius: 8px; }
.option-row:has(input:checked) { border-color: var(--primary); background: #f7f8ff; box-shadow: inset 0 0 0 1px rgba(91,111,232,.08); }
.recommended { align-self: start; margin-top: 1px; padding: 5px 8px; border-radius: 5px; background: var(--primary-pale); font-family: var(--body); }
.radio-mark, .checkbox-mark { border-color: #bfc2cc; }
.checkbox-mark { border-radius: 5px; }
#consistencyRow { margin-top: 10px; }
#consistencyRow .checkbox-mark { background: #f7f8ff; }
.privacy-copy { border-color: var(--line); }
.translate-button { min-height: 52px; }

.processing-view { min-height: calc(100dvh - 72px); background: #f7f8fb; }
.processing-sheet { width: min(720px,100%); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 60px rgba(28,32,46,.08); }
.processing-sheet::before { width: 4px; border-radius: 12px 0 0 12px; background: var(--primary); }
.processing-copy h1 { font-size: clamp(40px,5vw,60px); }
.progress-track { height: 7px; border-radius: 7px; background: #e8eaf0; }
.progress-track span { border-radius: 7px; background: var(--primary); }
.progress-number { color: var(--primary); font-family: var(--body); font-size: clamp(50px,7vw,76px); font-weight: 650; letter-spacing: -.06em; }
.process-steps li { color: #8b8e97; }
.process-steps li > span { border-color: #c8cbd4; background: white; }
.process-steps li:not(:last-child) > span::after { background: #dfe1e7; }

.workspace { min-height: calc(100dvh - 72px); background: #eef0f4; }
.workspace-bar { min-height: 76px; padding: 12px clamp(18px,2.6vw,38px); border-color: var(--line); box-shadow: 0 2px 8px rgba(30,33,44,.03); }
.icon-button { border-color: var(--line); border-radius: 8px; }
.icon-button:hover { background: var(--primary-pale); }
.document-title span { color: #22a46d; font-family: var(--body); font-size: 9px; }
.document-title h1 { font-size: 14px; font-weight: 650; }
.view-toggle, .mobile-page-toggle { border: 1px solid #e0e2e8; border-radius: 8px; background: #f2f3f6; }
.view-toggle button, .mobile-page-toggle button { border-radius: 6px; }
.view-toggle button.active, .mobile-page-toggle button.active { box-shadow: 0 1px 4px rgba(26,30,42,.1); }
.export-button { min-height: 44px; }
.prototype-notice { min-height: 40px; border-color: #e4d9bd; background: #fffaf0; color: #6d5a34; }
.prototype-notice > span { color: #a76f13; font-family: var(--body); }
.workspace-body { grid-template-columns: 76px 1fr; min-height: calc(100dvh - 188px); }
.page-rail { padding: 18px 11px; border-color: rgba(255,255,255,.11); background: linear-gradient(180deg,#321269,#24114f); color: white; }
.page-rail > p { color: rgba(255,255,255,.62); font-family: var(--body); }
.page-thumb { width: 54px; border-radius: 7px; color: rgba(255,255,255,.68); }
.page-thumb > span { border-radius: 3px; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.page-thumb.active { border-color: #aab5ff; background: rgba(255,255,255,.13); color: white; }
.document-stage { grid-template-columns: minmax(340px,580px) 18px minmax(340px,580px); padding: 36px clamp(22px,3.2vw,52px) 72px; }
.document-page { min-height: 790px; border: 1px solid #e2e4e9; border-radius: 4px; box-shadow: 0 12px 34px rgba(29,32,43,.09); }
.page-meta { border-color: #e1e3e7; color: #777a83; font-family: var(--body); }
.page-content .doc-kicker { color: var(--primary); font-family: var(--body); }
.page-content h2 { font-family: var(--body); font-weight: 650; }
.page-content .doc-deck { color: #666974; font-family: var(--body); font-style: normal; }
.page-content h3 { color: #31333a; }
.page-content p { color: #3e414a; font-family: var(--body); font-size: 14px; line-height: 1.75; }
.page-content blockquote { border-color: var(--primary); background: #f6f7ff; font-family: var(--body); }
.doc-stat { border-color: #e0e2e7; }
.doc-stat strong { color: var(--primary); font-family: var(--body); font-weight: 650; }
.translation-binding span { background: #9ba7f6; }
.translation-binding span::after { background: #5b6fe8; box-shadow: 0 0 0 3px #eef0ff; }
.translated-page::before { color: rgba(91,111,232,.06); font-family: var(--body); font-weight: 650; }
.page-footer { border-color: #e1e3e8; color: #888b94; font-family: var(--body); }

.drawer-scrim { background: rgba(18,14,30,.48); }
.history-drawer { border-left: 1px solid var(--line); box-shadow: -22px 0 54px rgba(26,22,39,.13); }
.drawer-header h2 { font-family: var(--body); font-size: 26px; }
.history-empty h3 { font-family: var(--body); }
.history-item > span { border-radius: 8px; background: var(--primary-pale); }
.toast { border-radius: 8px; background: #24262d; }

.below-upload { width: min(940px,100%); display: grid; grid-template-columns: minmax(0,1.25fr) minmax(260px,.75fr); gap: 70px; align-items: start; margin: 36px auto 0; padding: 0 8px; }
.below-upload-copy h2 { margin: 0 0 11px; color: #202127; font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.below-upload-copy p { max-width: 610px; margin: 0; color: #666974; font-size: 14px; line-height: 1.72; }
.below-upload .trust-line { flex-direction: column; align-items: flex-start; gap: 13px; margin: 1px 0 0; }
.below-upload .trust-line span { color: #4c4f58; font-size: 13px; }
.below-upload .trust-line svg { flex: 0 0 auto; width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: #e8f8ef; color: #1f9b60; }

@media (max-width: 960px) {
  .app-header { grid-template-columns: 1fr auto; }
  .main-nav { display: none; }
  .landing { padding-top: 56px; }
  .hero-copy { max-width: 760px; }
  .upload-stage { width: min(820px,100%); }
  .below-upload { grid-template-columns: 1fr; gap: 25px; }
  .below-upload .trust-line { display: grid; grid-template-columns: repeat(3,1fr); width: 100%; }
  .setup-grid { grid-template-columns: 1fr; }
  .file-ticket { max-width: 540px; }
  .document-stage { grid-template-columns: minmax(280px,1fr) 14px minmax(280px,1fr); }
}

@media (max-width: 799px) {
  .app-header { height: 66px; }
  .locale-control select { min-width: 96px; padding-left: 34px; }
  .landing { min-height: calc(100dvh - 66px); padding-top: 46px; }
  .hero-copy h1 { font-size: clamp(36px,9.5vw,48px); }
  .breadcrumb { margin-bottom: 28px; }
  .upload-sheet { min-height: 450px; padding: 22px 20px 16px; }
  .drop-zone { min-height: 316px; }
  .below-upload .trust-line { grid-template-columns: 1fr; }
  .setup-view, .processing-view { min-height: calc(100dvh - 66px); }
  .workspace { min-height: calc(100dvh - 66px); }
  .workspace-body { min-height: auto; }
  .prototype-notice > span[data-i18n="demoNotice"] { display: inline; }
  .page-rail { border-bottom-color: rgba(255,255,255,.12); background: #2b145b; }
  .document-stage, .document-stage.translated-mode { padding-top: 18px; }
}

@media (max-width: 520px) {
  .header-actions { gap: 6px; }
  .locale-control select { width: 82px; min-width: 82px; font-size: 11px; }
  .text-button { width: 44px; padding: 0; justify-content: center; }
  .text-button span { display: none; }
  .brand { gap: 8px; }
  .brand-mark, .brand-mark img { width: 36px; height: 36px; }
  .brand-name .brand-word { font-size: 18px; }
  .brand-name small { display: none; }
  .landing { padding-inline: 18px; }
  .hero-copy h1 { font-size: clamp(34px,10.5vw,44px); }
  .hero-intro { font-size: 16px; }
  .trust-line { grid-template-columns: 1fr; }
  .upload-stage { width: 100%; }
  .paper-shadow { display: none; }
  .upload-sheet { border-radius: 12px; box-shadow: 0 14px 38px rgba(24,28,40,.08); }
  .drop-zone { padding-inline: 16px; }
  .primary-button { min-width: 0; width: 100%; }
  .setup-heading h1 { font-size: 41px; }
  .translation-form { padding: 24px 18px; }
  .document-page { border-radius: 3px; }
}

/* Arabic interface: mirror navigation and controls while keeping brand and document content stable. */
html[dir="rtl"] .brand,
html[dir="rtl"] .brand-name,
html[dir="rtl"] .brand-mark,
html[dir="rtl"] .file-limit,
html[dir="rtl"] .sample-thumb,
html[dir="rtl"] .page-count,
html[dir="rtl"] .document-page { direction: ltr; }
html[dir="rtl"] .locale-control::before { right: 10px; left: auto; }
html[dir="rtl"] .locale-control select { padding-right: 38px; padding-left: 28px; }
html[dir="rtl"] .breadcrumb { text-align: right; }
html[dir="rtl"] .breadcrumb b,
html[dir="rtl"] .sample-button > svg { transform: scaleX(-1); }
html[dir="rtl"] .sheet-ruler { right: 0; left: auto; border-right: 0; border-left: 1px solid #ebc9bd; }
html[dir="rtl"] .sample-button { text-align: right; }
html[dir="rtl"] .ticket-stub { border-right: 0; border-left: 1px dashed var(--line-dark); }
html[dir="rtl"] .ticket-stub::before,
html[dir="rtl"] .ticket-stub::after { right: auto; left: -8px; }
html[dir="rtl"] .processing-sheet::before { right: 0; left: auto; }
html[dir="rtl"] .process-steps li:not(:last-child) > span::after { right: 8px; left: auto; }
html[dir="rtl"] .prototype-notice button { right: auto; left: 16px; }
html[dir="rtl"] .page-rail { border-right: 0; border-left: 1px solid var(--line); }
html[dir="rtl"] .page-content blockquote { border-left: 0; border-right: 3px solid var(--accent); }
html[dir="rtl"] .translated-page::before { right: auto; left: 34px; }
html[dir="rtl"] .history-drawer { right: auto; left: 0; border-left: 0; border-right: 1px solid var(--line); box-shadow: 22px 0 54px rgba(26,22,39,.13); transform: translateX(-105%); }
html[dir="rtl"] .history-drawer.open { transform: translateX(0); }
html[dir="rtl"] .step-card > span { right: auto; left: 24px; }

@media (max-width: 980px) {
  html[dir="rtl"] .page-rail { border-left: 0; }
}

/* LingoBound editorial edition: a digital book cover, not another file-tool card. */
:root {
  --ink: #1b1a17;
  --ink-soft: #67625a;
  --paper: #fffdf8;
  --canvas: #f2f0e9;
  --canvas-deep: #e5e0d5;
  --primary: #ef4b18;
  --primary-dark: #c9360a;
  --primary-pale: #fff0e8;
  --accent: #5b6fe8;
  --accent-pale: #eceeff;
  --line: #d8d2c5;
  --line-dark: #aaa294;
  --shadow: 0 28px 70px rgba(53, 42, 25, .14);
  --display: "Arial Narrow", "Avenir Next Condensed", "Helvetica Neue", "Noto Sans", sans-serif;
  --body: "Avenir Next", "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
}

body {
  background-color: var(--canvas);
  background-image: linear-gradient(rgba(27,26,23,.025) 1px, transparent 1px);
  background-size: 100% 32px;
}

button:focus-visible,
select:focus-visible,
[role="button"]:focus-visible,
a:focus-visible { outline-color: rgba(239,75,24,.55); }

.app-header {
  border-bottom-color: rgba(27,26,23,.16);
  background: rgba(255,253,248,.74);
  backdrop-filter: blur(14px);
}
.brand-name .brand-word strong { color: var(--primary); }
.brand-name small { color: #777167; letter-spacing: .08em; }
.main-nav a::after { background: var(--primary); }
.locale-control::before { color: var(--primary); }

.landing { max-width: 1360px; padding-top: 22px; }
.hero-primary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px,.72fr) minmax(540px,1.28fr);
  gap: clamp(44px,6vw,92px);
  align-items: center;
  padding: 54px clamp(0px,2vw,28px) 66px;
  border-top: 1px solid rgba(27,26,23,.18);
  border-bottom: 1px solid rgba(27,26,23,.18);
}
.hero-primary::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0 0 auto;
  height: 22px;
  border-top: 3px solid var(--primary);
  background: repeating-linear-gradient(90deg, transparent 0 15px, rgba(27,26,23,.27) 15px 16px, transparent 16px 31px);
  mask-image: linear-gradient(to bottom, #000 0 8px, transparent 8px);
}
.hero-primary::after {
  content: "01 / 32";
  position: absolute;
  top: 16px;
  right: 0;
  padding-left: 12px;
  background: var(--canvas);
  color: #777167;
  font: 700 10px/1 var(--utility);
  letter-spacing: .12em;
}
.hero-copy { max-width: none; margin: 0; text-align: left; }
.breadcrumb { margin-bottom: 72px; }
.hero-copy::before {
  content: "LINGOBOUND / BOOK TRANSLATION";
  display: block;
  width: fit-content;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  color: #655f56;
  font: 700 10px/1 var(--utility);
  letter-spacing: .11em;
}
.hero-copy h1 {
  max-width: 620px;
  font-size: clamp(48px,5.25vw,76px);
  font-weight: 800;
  line-height: .94;
  letter-spacing: -.07em;
}
.hero-copy h1::first-line { color: var(--ink); }
.hero-intro { max-width: 510px; margin: 26px 0 0; font-size: 16px; line-height: 1.72; }

.upload-stage { width: 100%; margin: 0; padding: 15px 18px 18px 0; }
.paper-shadow { display: block; inset: 28px 0 0 20px; border-color: #c9c1b3; background: #ddd6ca; box-shadow: none; }
.paper-shadow-one { transform: translate(14px,8px); }
.paper-shadow-two { transform: translate(7px,4px); background: #ebe6dc; }
.upload-sheet {
  min-height: 540px;
  padding: 24px 32px 20px 106px;
  overflow: visible;
  border: 1px solid #25231f;
  border-radius: 2px 13px 13px 2px;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(27,26,23,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(27,26,23,.04) 1px, transparent 1px);
  background-size: 22px 22px;
  box-shadow: 0 26px 54px rgba(58,45,26,.16);
}
.upload-sheet::before {
  content: "LINGOBOUND  ·  MANUSCRIPT 001";
  display: flex;
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 70px;
  align-items: center;
  justify-content: center;
  border: 1px solid #25231f;
  border-right: 0;
  border-radius: 2px 0 0 2px;
  background: var(--primary);
  color: white;
  font: 800 10px/1 var(--utility);
  letter-spacing: .13em;
  text-orientation: mixed;
  writing-mode: vertical-rl;
}
.upload-sheet::after {
  content: "";
  display: block;
  position: absolute;
  z-index: 3;
  top: 20px;
  right: -8px;
  bottom: 15px;
  width: 7px;
  border: 1px solid #cfc6b7;
  border-left: 0;
  background: repeating-linear-gradient(to bottom, #fffdf8 0 5px, #d8d1c4 5px 6px);
  transform: skewY(12deg);
}
.upload-sheet-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(27,26,23,.22);
  color: #4e4942;
  font: 700 10px/1 var(--utility);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.book-progress { gap: 5px; height: 16px; }
.book-progress b { width: 14px; height: 16px !important; border: 1px solid #a7a092; border-radius: 1px 4px 4px 1px; background: #e7e1d7 !important; }
.book-progress b:nth-child(2) { border-color: var(--accent); background: var(--accent-pale) !important; }
.book-progress b:nth-child(3) { border-color: var(--primary); background: var(--primary) !important; }
.sheet-ruler {
  display: flex;
  inset: -1px auto -1px 69px;
  width: 26px;
  border-right-color: #d4cdc0;
  background: #f7f2e9;
  color: var(--primary-dark);
}
.sheet-ruler::before { background: repeating-linear-gradient(to bottom, transparent 0 9px, #aaa294 9px 10px); }
.drop-zone {
  position: relative;
  min-height: 345px;
  padding: 38px 26px 28px;
  border: 1px solid #9f9789;
  border-radius: 0;
  background: rgba(255,255,255,.54);
  box-shadow: inset 0 0 0 8px rgba(255,253,248,.6);
}
.drop-zone::before,
.drop-zone::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  pointer-events: none;
}
.drop-zone::before { top: 10px; left: 10px; border-top: 2px solid var(--primary); border-left: 2px solid var(--primary); }
.drop-zone::after { right: 10px; bottom: 10px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); }
.drop-zone:hover,
.drop-zone.dragging { border-color: var(--primary); background: #fff8f2; }
.upload-icon {
  width: 68px;
  height: 68px;
  margin-bottom: 20px;
  border: 1px solid #292620;
  border-radius: 2px 14px 14px 2px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--accent-pale);
}
.upload-icon::after {
  content: "↔";
  right: -9px;
  bottom: -9px;
  border-color: var(--paper);
  background: var(--primary);
}
.drop-zone h2 { color: var(--ink); font-family: var(--display); font-size: 26px; font-weight: 800; }
.drop-zone p { color: var(--ink-soft); }
.drop-zone .primary-button {
  border: 1px solid #bd330c;
  border-radius: 5px;
  background: var(--primary);
  color: white;
  box-shadow: 0 7px 0 #c9c1b4;
}
.drop-zone .primary-button:hover { background: var(--primary-dark); }
.file-limit { color: #777167; font-family: var(--utility); }
.demo-divider { color: #756f65; }
.demo-divider::before,
.demo-divider::after { background: #d9d2c5; }
.sample-button { color: var(--ink); }
.sample-button:hover { background: var(--primary-pale); }
.sample-thumb {
  border-color: #282621;
  border-radius: 1px 7px 7px 1px;
  background: var(--accent);
  color: white;
  box-shadow: inset 5px 0 0 rgba(255,255,255,.18);
}
.sample-button strong { color: var(--ink); }
.sample-button small,
.sample-button > svg { color: var(--ink-soft); }
.sample-button:disabled { opacity: .45; cursor: wait; }
.resume-job-button {
  width: 100%; min-height: 66px; display: grid; grid-template-columns: 34px 1fr; gap: 12px;
  align-items: center; margin: 14px 0 4px; padding: 10px 14px; border: 1px solid var(--accent);
  border-radius: 0; background: var(--accent-pale); color: var(--ink); text-align: left;
}
.resume-job-button[hidden] { display: none; }
.resume-job-button > span:first-child { color: var(--accent); font-size: 24px; }
.resume-job-button strong, .resume-job-button small { display: block; }
.resume-job-button strong { font-family: var(--display); font-size: 15px; font-weight: 800; }
.resume-job-button small { margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.drop-zone.is-parsing { border-color: var(--primary); background: #fff8f2; box-shadow: inset 0 0 0 8px rgba(255,240,232,.72); }
.parse-spinner { border-color: #e7c4b7; border-top-color: var(--primary); }
.parse-status strong { color: var(--ink); font-family: var(--display); font-weight: 800; }
.parse-status small { color: var(--primary-dark); }

.file-ticket { min-height: 286px; }
.file-metrics { border-color: var(--line); }
.file-metrics > div:nth-child(even),
.file-metrics > div:nth-child(n+3) { border-color: var(--line); }
.file-metrics dd { font-family: var(--display); font-weight: 800; }

.below-upload { width: min(1120px,100%); margin-top: 42px; padding: 0 30px; }
.below-upload-copy { padding-left: 20px; border-left: 3px solid var(--primary); }
.below-upload-copy h2 { font-family: var(--display); font-size: 25px; font-weight: 800; }
.below-upload .trust-line svg { border-radius: 2px; background: var(--primary-pale); color: var(--primary); }
.landing-lower { width: min(1160px,100%); margin: 138px auto 0; }
.landing-lower .section-heading { max-width: 920px; margin: 0 0 48px; text-align: left; }
.landing-lower .section-heading .eyebrow { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; color: var(--primary); font-family: var(--utility); }
.landing-lower .section-heading .eyebrow::after { content: ""; height: 1px; background: var(--line-dark); }
.landing-lower .section-heading h2 { max-width: 900px; font-family: var(--display); font-weight: 800; }

/* The three actions are one reading path, not three interchangeable cards. */
.steps-grid { position: relative; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line-dark); }
.steps-grid::before { content: ""; position: absolute; z-index: 0; top: 72px; right: 0; left: 0; height: 2px; background: linear-gradient(90deg,var(--primary) 0 33.333%,var(--accent) 33.333% 66.666%,var(--ink) 66.666%); }
.step-card { position: relative; z-index: 1; min-height: 278px; padding: 28px 34px 36px; border: 0; border-radius: 0; background: transparent; background-image: none; box-shadow: none; }
.step-card + .step-card { border-left: 1px solid var(--line); }
.step-card > span { position: static; display: block; width: max-content; margin-bottom: 57px; padding: 0 8px 10px 0; background: var(--canvas); color: var(--ink); font: 800 22px/.9 var(--display); letter-spacing: -.04em; }
.step-card > svg { position: absolute; top: 58px; left: 34px; width: 29px; height: 29px; padding: 0; border: 0; border-radius: 0; background: var(--canvas); color: var(--primary); stroke-width: 1.65; }
.step-card:nth-child(2) > svg { background: var(--canvas); color: var(--accent); }
.step-card:nth-child(3) > svg { color: var(--ink); }
.step-card h3 { margin: 0 0 12px; color: var(--ink); font-family: var(--display); font-size: clamp(20px,2vw,26px); font-weight: 800; letter-spacing: -.03em; }
.step-card p { max-width: 310px; margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.75; }

/* A continuous format index: book spines + catalogue rows, never feature cards. */
.formats-section { position: relative; margin-top: 140px; padding: 0; border: 0; border-radius: 0; background: transparent; background-image: none; box-shadow: none; }
.formats-section::before { content: ""; position: absolute; top: 0; right: 0; width: clamp(70px,9vw,112px); height: 13px; border-top: 4px solid var(--primary); border-bottom: 4px solid var(--accent); }
.formats-section .section-heading.compact { max-width: 960px; margin: 0 0 54px; padding-right: clamp(90px,12vw,150px); }
.formats-section .section-heading.compact h2 { font-size: clamp(32px,4.1vw,54px); }
.format-grid { display: block; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.format-card { --format-accent: var(--primary); position: relative; min-width: 0; min-height: 174px; display: grid; grid-template-columns: minmax(150px,.42fr) 48px minmax(260px,1.3fr) minmax(250px,.95fr); gap: 28px; align-items: center; align-content: center; padding: 24px 28px; border: 0; border-radius: 0; background: transparent; }
.format-card + .format-card { border-top: 1px solid var(--line-dark); }
.format-card::before { content: ""; position: absolute; top: 24px; bottom: 24px; left: 0; width: 7px; background: var(--format-accent); }
.format-card > span { grid-column: 1; grid-row: 1; align-self: center; margin: 0; color: var(--ink); font: 800 clamp(23px,2.7vw,36px)/.95 var(--display); letter-spacing: -.045em; }
.format-card > svg { grid-column: 2; grid-row: 1; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--format-accent); stroke-width: 1.6; }
.format-card > div { grid-column: 3; grid-row: 1; }
.format-card h3 { margin: 0 0 8px; color: var(--ink); font-family: var(--display); font-size: clamp(18px,2vw,24px); font-weight: 800; letter-spacing: -.025em; }
.format-card p { max-width: 650px; margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.format-specs { grid-column: 4; grid-row: 1; display: grid; grid-template-columns: minmax(86px,.7fr) minmax(140px,1.3fr); gap: 0; margin: 0; padding-inline-start: 28px; border-inline-start: 1px solid var(--line); }
.format-specs > div { min-width: 0; padding: 7px 15px; }
.format-specs > div + div { border-inline-start: 1px solid var(--line); }
.format-specs dt { margin-bottom: 8px; color: #837d73; font: 700 9px/1.2 var(--utility); letter-spacing: .09em; text-transform: uppercase; }
.format-specs dd { margin: 0; color: var(--ink); font: 700 13px/1.45 var(--body); }
.format-limit-note { display: flex; gap: 12px; align-items: center; margin: 17px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.format-limit-note::before { content: ""; flex: 0 0 auto; width: 24px; height: 2px; background: var(--primary); box-shadow: 28px 0 0 var(--accent); }
.format-card.epub-card,
.format-card.document-card,
.format-card.text-card { border-left: 0; }
.format-card.epub-card { --format-accent: var(--primary); border-top: 0; }
.format-card.document-card { --format-accent: var(--accent); border-top: 1px solid var(--line-dark); }
.format-card.text-card { --format-accent: var(--ink); border-top: 1px solid var(--line-dark); }
.format-card.text-card > svg { background: transparent; color: var(--ink); }

.translation-form { border-top-color: var(--primary); }
.option-row:has(input:checked) { border-color: var(--primary); background: var(--primary-pale); }
.queue-progress { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; margin: 0 0 26px; padding: 13px 0; border-block: 1px solid var(--line); }
.queue-progress > span { color: var(--ink-soft); font: 700 9px/1.4 var(--utility); letter-spacing: .1em; text-transform: uppercase; }
.queue-progress strong { color: var(--primary); font: 800 17px/1 var(--display); font-variant-numeric: tabular-nums; }
.queue-progress small { grid-column: 1 / -1; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.glossary-live { margin-top: 22px; padding: 18px 0 4px; border-top: 2px solid var(--ink); }
.glossary-live > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.glossary-live > div span { color: var(--ink-soft); font: 700 9px/1.3 var(--utility); letter-spacing: .08em; }
.glossary-live > div strong { color: var(--accent); font: 800 22px/1 var(--display); }
.glossary-live ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin: 12px 0 0; padding: 0; list-style: none; }
.glossary-live li { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 7px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 11px; }
.glossary-live li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glossary-live li i { color: var(--accent); font-style: normal; }
.glossary-live li span { overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.workspace-glossary { margin: 0; border-bottom: 1px solid var(--line-dark); background: var(--paper); }
.workspace-glossary summary { min-height: 58px; display: grid; grid-template-columns: auto 42px 1fr; gap: 12px; align-items: center; padding: 0 clamp(20px,3vw,46px); cursor: pointer; list-style: none; }
.workspace-glossary summary::-webkit-details-marker { display: none; }
.workspace-glossary summary > span { font-family: var(--display); font-size: 15px; font-weight: 800; }
.workspace-glossary summary strong { display: grid; place-items: center; width: 34px; height: 24px; background: var(--accent-pale); color: var(--accent); font: 800 11px/1 var(--utility); }
.workspace-glossary summary small { color: var(--ink-soft); font-size: 11px; }
#workspaceGlossaryList { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-top: 1px solid var(--line); padding: 0 clamp(20px,3vw,46px) 18px; }
.workspace-term { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 13px 18px 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.workspace-term:nth-child(3n+2), .workspace-term:nth-child(3n+3) { padding-left: 18px; border-left: 1px solid var(--line); }
.workspace-term b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-term i { color: var(--accent); font-style: normal; }
.workspace-term span { overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.workspace { background: #ece8df; }
.page-rail { max-height: calc(100dvh - 188px); overflow-y: auto; background: #201f1b; }
.translation-binding span { background: #9ea7f7; }
.translation-binding span::after { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-pale); }

@media (max-width: 1080px) {
  .hero-primary { grid-template-columns: minmax(260px,.72fr) minmax(460px,1.28fr); gap: 40px; }
  .hero-copy h1 { font-size: clamp(44px,5.8vw,64px); }
  .upload-sheet { padding-left: 96px; }
}

@media (max-width: 900px) {
  .hero-primary { grid-template-columns: 1fr; padding-inline: 0; }
  .hero-copy { max-width: 760px; }
  .breadcrumb { margin-bottom: 48px; }
  .hero-copy h1 { max-width: 720px; }
  .hero-intro { max-width: 640px; }
  .upload-stage { width: min(760px,100%); margin: 0 auto; }
  .step-card { padding-inline: 24px; }
  .step-card > svg { left: 24px; }
  .format-card { grid-template-columns: minmax(120px,.42fr) 40px minmax(220px,1.55fr); gap: 20px; }
  .format-specs { grid-column: 3; grid-row: 2; padding: 18px 0 0; border-top: 1px solid var(--line); border-inline-start: 0; }
}

@media (max-width: 799px) {
  .landing { padding-top: 18px; }
  .hero-primary { padding-top: 48px; padding-bottom: 46px; }
  .hero-primary::after { right: 8px; }
  .upload-sheet { min-height: 500px; padding: 20px 22px 16px 86px; }
  .upload-sheet::before { width: 58px; }
  .sheet-ruler { left: 57px; width: 22px; }
  .drop-zone { min-height: 336px; }
  .landing-lower { margin-top: 104px; }
  .landing-lower .section-heading { margin-bottom: 36px; }
  .steps-grid { grid-template-columns: 1fr; }
  .steps-grid::before { top: 0; right: auto; bottom: 0; left: 33px; width: 2px; height: auto; background: linear-gradient(var(--primary) 0 33.333%,var(--accent) 33.333% 66.666%,var(--ink) 66.666%); }
  .step-card { min-height: 0; padding: 30px 24px 30px 78px; }
  .step-card + .step-card { border-top: 1px solid var(--line); border-left: 0; }
  .step-card > span { position: absolute; top: 26px; left: 20px; margin: 0; padding: 4px; font-size: 17px; }
  .step-card > svg { position: static; width: 26px; height: 26px; margin-bottom: 20px; }
  .formats-section { margin-top: 104px; }
  .formats-section .section-heading.compact { padding-right: 80px; }
  .format-card { grid-template-columns: minmax(105px,.45fr) 36px minmax(0,1fr); gap: 17px; padding: 24px 22px; }
  .format-card::before { width: 5px; }
  .glossary-live ul { grid-template-columns: 1fr; }
  #workspaceGlossaryList { grid-template-columns: 1fr 1fr; }
  .workspace-term:nth-child(3n+2), .workspace-term:nth-child(3n+3) { padding-left: 0; border-left: 0; }
  .workspace-term:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .hero-copy::before { font-size: 9px; }
  .breadcrumb { margin-bottom: 38px; }
  .upload-stage { padding-right: 8px; }
  .upload-sheet { min-height: 490px; padding: 16px 14px 14px 60px; border-radius: 2px 9px 9px 2px; }
  .upload-sheet::before { width: 40px; content: "LINGOBOUND"; }
  .sheet-ruler { left: 39px; width: 16px; }
  .sheet-ruler span { display: none; }
  .drop-zone { min-height: 330px; padding: 32px 14px 24px; }
  .drop-zone h2 { font-size: 22px; }
  .parse-status strong { font-size: 23px; }
  .file-ticket { grid-template-columns: 62px 1fr; }
  .file-metrics dd { font-size: 17px; }
  .upload-sheet-title { font-size: 8px; letter-spacing: .04em; }
  .book-progress b { width: 10px; }
  .below-upload { padding-inline: 4px; }
  .landing-lower .section-heading { text-align: left; }
  .formats-section::before { width: 56px; }
  .formats-section .section-heading.compact { padding-right: 0; padding-top: 38px; }
  .format-card { grid-template-columns: 78px 28px minmax(0,1fr); gap: 12px; padding: 22px 16px; }
  .format-card > span { font-size: 18px; }
  .format-card > svg { width: 25px; height: 25px; }
  .format-card h3 { font-size: 17px; }
  .format-card p { font-size: 12px; line-height: 1.6; }
  .format-specs { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 1fr 1.55fr; padding-top: 15px; }
  .format-specs > div { padding-inline: 9px; }
  .format-specs dt { font-size: 8px; }
  .format-specs dd { font-size: 11px; }
  .format-limit-note { align-items: flex-start; font-size: 11px; }
  .workspace-glossary summary { grid-template-columns: auto 36px; }
  .workspace-glossary summary small { display: none; }
  #workspaceGlossaryList { grid-template-columns: 1fr; }
  .workspace-term:nth-child(even) { padding-left: 0; border-left: 0; }
}

html[dir="rtl"] .hero-copy { text-align: right; }
html[dir="rtl"] .hero-copy::before { margin-right: 0; margin-left: auto; }
html[dir="rtl"] .hero-primary::after { right: auto; left: 0; padding-right: 12px; padding-left: 0; }
html[dir="rtl"] .upload-sheet { padding-right: 106px; padding-left: 32px; border-radius: 13px 2px 2px 13px; }
html[dir="rtl"] .upload-sheet::before { right: -1px; left: auto; border-right: 1px solid #25231f; border-left: 0; writing-mode: vertical-lr; }
html[dir="rtl"] .upload-sheet::after { right: auto; left: -8px; border-right: 0; border-left: 1px solid #cfc6b7; transform: skewY(-12deg); }
html[dir="rtl"] .sheet-ruler { right: 69px; left: auto; }
html[dir="rtl"] .below-upload-copy { padding-right: 20px; padding-left: 0; border-right: 3px solid var(--primary); border-left: 0; }
html[dir="rtl"] .landing-lower .section-heading { text-align: right; }
html[dir="rtl"] .formats-section .section-heading.compact { padding-right: 0; padding-left: clamp(90px,12vw,150px); }
html[dir="rtl"] .step-card + .step-card { border-right: 1px solid var(--line); border-left: 0; }
html[dir="rtl"] .step-card > svg { right: 34px; left: auto; }
html[dir="rtl"] .format-card { padding-right: 28px; padding-left: 28px; }
html[dir="rtl"] .format-card::before { right: 0; left: auto; }
html[dir="rtl"] .format-limit-note::before { box-shadow: -28px 0 0 var(--accent); }

@media (max-width: 799px) {
  html[dir="rtl"] .upload-sheet { padding-right: 86px; padding-left: 22px; }
  html[dir="rtl"] .sheet-ruler { right: 57px; }
  html[dir="rtl"] .steps-grid::before { right: 33px; left: auto; }
  html[dir="rtl"] .step-card { padding-right: 78px; padding-left: 24px; }
  html[dir="rtl"] .step-card + .step-card { border-top: 1px solid var(--line); border-right: 0; }
  html[dir="rtl"] .step-card > span { right: 20px; left: auto; }
  html[dir="rtl"] .step-card > svg { right: auto; }
  html[dir="rtl"] .formats-section .section-heading.compact { padding-left: 80px; }
  html[dir="rtl"] .format-card { padding-right: 22px; padding-left: 22px; }
}

@media (max-width: 520px) {
  html[dir="rtl"] .upload-sheet { padding-right: 60px; padding-left: 14px; }
  html[dir="rtl"] .sheet-ruler { right: 39px; }
  html[dir="rtl"] .formats-section .section-heading.compact { padding-left: 0; }
  html[dir="rtl"] .format-card { padding-right: 16px; padding-left: 16px; }
}

@media print {
  body { background: white; }
  .app-header, .workspace-bar, .prototype-notice, .mobile-page-toggle, .page-rail, .source-page, .translation-binding, .toast { display: none !important; }
  .workspace, .workspace-body, .document-stage, .document-stage.translated-mode { display: block !important; background: white; padding: 0; }
  .translated-page { display: block !important; width: 100%; min-height: auto; padding: 18mm; box-shadow: none; }
  .translated-page::before { display: none; }
  .page-content { padding-top: 12mm; }
  @page { size: A4; margin: 0; }
}
