:root {
  color-scheme: light;
  --background: #f5f4ef;
  --paper: #fffefa;
  --white: #fff;
  --ink: #20342f;
  --muted: #67746e;
  --green: #315c4f;
  --green-deep: #234638;
  --green-light: #eaf1eb;
  --line: #e0e3da;
  --line-strong: #cbd3c8;
  --error: #963c32;
  --error-background: #fcf0ec;
  --warning: #86641e;
  --warning-background: #f8f0dc;
  --shadow: 0 4px 20px rgb(31 51 42 / 3%);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
html { min-width: 320px; }
body { margin: 0; background: var(--background); color: var(--ink); font: 14px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, a { touch-action: manipulation; }
a { color: var(--green); }
h1, h2, h3, p { margin: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; flex: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #8caf9c; outline-offset: 4px; }
input:focus, textarea:focus, select:focus { border-color: #799987; outline: none; box-shadow: 0 0 0 3px rgb(86 131 105 / 12%); }
::selection { color: #173e2c; background: #d9e8d9; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 18px; top: -70px; padding: 9px 16px; z-index: 100; background: var(--green); color: white; border-radius: 6px; }
.skip-link:focus { top: 12px; }
.muted, .field-note { color: var(--muted); }
.eyebrow { display: block; font-size: 11px; font-weight: 600; letter-spacing: .12em; line-height: 1.6; }
.optional { margin-left: 5px; color: #6b776e; font-size: 11px; font-weight: 400; }
.field-note { margin-top: 7px; font-size: 11px; line-height: 1.75; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; white-space: nowrap; letter-spacing: .015em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 35px; border: 1px solid #9eac9d; border-radius: 8px 8px 8px 2px; color: var(--green); font: 22px/1 var(--serif); font-weight: 600; }
.preview-badge { display: inline-flex; align-items: center; padding: 2px 6px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); font-size: 9px; font-weight: 400; letter-spacing: .05em; }
.brand-light { color: #f7faf4; }
.brand-light .brand-mark { color: #e5eee4; border-color: #759487; }
.brand-light .preview-badge { color: #c4d5ca; border-color: #607d6f; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 10px 19px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 500; line-height: 1.4; text-align: center; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.button-primary { background: var(--green); color: white; border-color: var(--green); }
.button-primary:hover { background: var(--green-deep); border-color: var(--green-deep); box-shadow: 0 2px 6px rgb(24 58 40 / 12%); }
.button-secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.button-secondary:hover { background: #f1f4ed; border-color: #a9b8a8; }
.button-small { min-height: 34px; padding: 7px 14px; font-size: 12px; }
.button-full { width: 100%; }
.button:disabled, button:disabled { cursor: wait; opacity: .55; box-shadow: none; }
.text-button { padding: 5px 0 5px 8px; border: 0; background: none; color: var(--muted); font-size: 12px; }
.text-button:hover { color: var(--green); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label, .provider-form > label { display: block; font-size: 12px; font-weight: 500; }
input, textarea, select { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); line-height: 1.55; transition: border-color .15s, box-shadow .15s; }
input, select { min-height: 43px; }
textarea { display: block; resize: vertical; }
input::placeholder, textarea::placeholder { color: #909990; opacity: 1; font-size: 12px; }
select { padding-right: 28px; font-size: 12px; }
input[type="number"] { appearance: textfield; }
.error-message { margin: 12px 0; padding: 10px 12px; border: 1px solid #efd0c6; border-radius: 6px; background: var(--error-background); color: var(--error); font-size: 12px; }
.error-message:empty, .upload-status:empty, .settings-status:empty, .global-notice:empty { display: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Employee sign-in. */
.login-view { display: flex; align-items: center; justify-content: center; min-height: 100svh; padding: 44px 24px; }
.login-shell { display: grid; grid-template-columns: 1.12fr 1fr; width: 100%; max-width: 1000px; min-height: 590px; border: 1px solid #d9ded3; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 70px rgb(36 59 41 / 7%); }
.login-story { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 35px 42px 27px; background: #254a3e; color: #d9e6db; }
.login-story-copy { position: relative; z-index: 1; margin-top: 63px; }
.login-story-copy > .eyebrow { color: #b9cebc; }
.login-story h1 { margin-top: 15px; color: #f4f6ec; font: 35px/1.55 var(--serif); font-weight: 500; letter-spacing: .03em; }
.login-story-copy > p { max-width: 330px; margin-top: 19px; color: #c2d3c5; font-size: 12px; line-height: 1.95; }
.login-story-footer { margin-top: auto; padding-top: 190px; font-size: 10px; color: #b6caba; letter-spacing: .12em; }
.login-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 50px 48px; background: var(--paper); }
.login-heading .eyebrow { color: var(--green); }
.login-heading h2 { margin-top: 9px; font: 25px/1.5 var(--serif); font-weight: 600; }
.login-heading p { margin-top: 10px; font-size: 12px; color: var(--muted); }
.login-form { display: grid; gap: 20px; margin-top: 33px; }
.login-form .error-message { margin: 0; }
.login-form .button { margin-top: 5px; justify-content: space-between; min-height: 46px; }
.login-help { display: flex; align-items: flex-start; gap: 9px; margin-top: 27px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); }
.login-help svg { width: 14px; height: 14px; margin-top: 3px; }
.login-help p { font-size: 11px; line-height: 1.8; }
.paper-illustration { position: absolute; bottom: 67px; left: 52px; width: 300px; height: 135px; transform: rotate(-4deg); }
.illustration-sheet { position: absolute; top: 0; left: 7px; width: 225px; height: 140px; padding: 23px 24px; border: 1px solid rgb(224 239 220 / 30%); border-radius: 4px; background: #315748; }
.illustration-sheet-back { top: -7px; left: 21px; transform: rotate(8deg); background: #3b5f4f; }
.illustration-sheet span { display: block; height: 2px; margin-bottom: 7px; background: #91ac97; opacity: .55; }
.illustration-sheet .illustration-heading { width: 48%; height: 4px; margin-bottom: 14px; background: #cad7ba; }
.illustration-sheet .short-line { width: 64%; }
.illustration-sheet .middle-line { width: 82%; }
.illustration-sheet i { display: block; height: 5px; }
.illustration-note { position: absolute; right: -12px; bottom: -7px; padding: 7px 12px; border-radius: 3px; background: #d8e3c8; color: #355440; font-size: 10px; letter-spacing: .03em; transform: rotate(7deg); box-shadow: 0 4px 16px rgb(12 30 18 / 10%); }

/* Workspace structure. */
.app-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgb(255 254 250 / 95%); backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 1320px; min-height: 73px; margin: auto; padding: 0 38px; }
.main-nav { display: flex; align-items: center; gap: 7px; height: 73px; }
.nav-button { position: relative; height: 100%; padding: 0 16px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.nav-button:hover { color: var(--green); }
.nav-button.active, .nav-button[aria-current="page"] { color: var(--green); font-weight: 600; }
.nav-button.active::after, .nav-button[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; right: 16px; left: 16px; height: 2px; background: var(--green); }
.account-menu { display: flex; align-items: center; gap: 8px; color: #506458; font-size: 12px; white-space: nowrap; }
.account-dot { width: 6px; height: 6px; border-radius: 50%; background: #73937a; }
.app-main { max-width: 1256px; margin: auto; padding: 35px 38px 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading .eyebrow { color: #77867a; }
.page-heading h1 { margin-top: 6px; font: 29px/1.5 var(--serif); font-weight: 600; letter-spacing: .02em; }
.page-heading p { margin-top: 7px; color: var(--muted); font-size: 12px; }
.rules-label { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; margin-bottom: 6px; border: 1px solid #dce3d6; border-radius: 5px; color: #64765f; background: #f0f3e9; font-size: 10px; white-space: nowrap; }
.rules-label > span, .small-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #8aa376; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 25px; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); }
.input-card { padding: 26px; }
.title-field { margin-bottom: 26px; }
.title-field input { border-color: transparent; border-bottom-color: var(--line); border-radius: 0; padding-left: 0; padding-right: 0; background: transparent; font-size: 14px; }
.title-field input:focus { border-bottom-color: #799987; box-shadow: none; }
.title-field label { color: var(--muted); font-size: 11px; }
.form-section + .form-section { margin-top: 25px; }
.section-heading { display: flex; align-items: center; gap: 9px; min-height: 26px; margin-bottom: 11px; }
.section-heading h2 { font-size: 13px; font-weight: 600; }
.section-number { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 23px; height: 23px; border: 1px solid #dce3d8; border-radius: 5px; color: #75876e; background: #f1f5ec; font-size: 9px; font-weight: 500; font-variant-numeric: tabular-nums; }
.section-aside { margin-left: auto; color: var(--muted); font-size: 10px; }
.upload-area { position: relative; display: flex; align-items: center; gap: 12px; min-height: 77px; margin-bottom: 11px; padding: 16px; border: 1px dashed #bfcdbc; border-radius: 7px; background: #f8faf4; cursor: pointer; transition: background .15s, border-color .15s; }
.upload-area:hover, .upload-area:focus-within { background: #f0f5e9; border-color: #7b9a76; }
.upload-area:focus-within { outline: 3px solid rgb(86 131 105 / 15%); outline-offset: 1px; }
.upload-area input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-icon { display: grid; place-items: center; flex: none; width: 33px; height: 38px; border: 1px solid #d4ddcb; border-radius: 5px; background: #fffefa; color: #66815d; }
.upload-icon svg { width: 21px; height: 21px; }
.upload-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upload-copy strong { font-size: 12px; font-weight: 500; }
.upload-copy > span { color: #64745f; font-size: 10px; }
.upload-action { margin-left: auto; color: var(--green); font-size: 10px; white-space: nowrap; }
.upload-status { margin: -2px 0 10px; overflow-wrap: anywhere; }
.source-text { min-height: 235px; padding: 15px; background: #fff; font-size: 13px; line-height: 1.9; }
.instruction-section textarea { background: #fbfcf7; border-color: #d9e2d2; }
.primary-options { margin-top: 25px; }
.document-options { margin-top: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.document-options summary { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 14px 0; color: var(--muted); font-size: 11px; list-style: none; cursor: pointer; }
.document-options summary::-webkit-details-marker { display: none; }
.document-options summary span { color: #8d9b88; font-size: 15px; transition: transform .15s; }
.document-options[open] summary span { transform: rotate(45deg); }
.options-content { display: grid; gap: 16px; padding: 2px 0 19px; }
.submit-area { padding-top: 21px; }
.submit-area .button { min-height: 46px; }
.submit-area .button svg { width: 18px; height: 18px; }
.submit-area > p { margin-top: 10px; color: var(--muted); font-size: 10px; text-align: center; }
.output-column { position: sticky; top: 96px; min-width: 0; }
.output-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 1px 12px; }
.output-heading .eyebrow { color: #7b8c7a; font-size: 10px; }
.output-heading > span:last-child { font-size: 10px; color: #6b7765; }
.empty-state { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 540px; padding: 50px 45px; text-align: center; background: #fbfbf6; }
.empty-state h2 { margin-top: 30px; font: 21px/1.5 var(--serif); font-weight: 600; }
.empty-state > p { max-width: 285px; margin-top: 11px; color: var(--muted); font-size: 12px; line-height: 1.85; }
.empty-state-caption { display: inline-flex; align-items: center; gap: 7px; margin-top: 32px; padding: 7px 12px; border: 1px solid #e1e7d9; border-radius: 4px; color: #65765d; font-size: 10px; }
.empty-paper { position: relative; display: flex; flex-direction: column; gap: 8px; width: 105px; height: 131px; padding: 27px 17px; border: 1px solid #d8dfd1; border-radius: 5px; background: #fffefa; box-shadow: 8px 7px 0 -1px #edf1e5, 8px 7px 0 #dfe5d6; transform: rotate(-5deg); }
.empty-paper > span { width: 43%; height: 5px; margin-bottom: 6px; border-radius: 1px; background: #bdcbb2; }
.empty-paper > i { height: 2px; border-radius: 1px; background: #d6ddce; }
.empty-paper > i:nth-child(4) { width: 78%; }
.empty-paper > i:last-of-type { width: 60%; }
.empty-paper > b { position: absolute; width: 20px; height: 29px; bottom: -7px; right: -9px; border: 1px solid #bccdb5; border-radius: 3px; background: #e1ead8; transform: rotate(14deg); }

/* Progress and output. */
.progress-panel { padding: 28px; }
.progress-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; color: #758b6c; }
.spinner { display: inline-block; flex: none; width: 15px; height: 15px; border: 1.5px solid #d6e0cd; border-top-color: #5a8057; border-radius: 50%; animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-panel h2 { font: 22px/1.6 var(--serif); font-weight: 600; }
.progress-panel > p { margin-top: 9px; font-size: 12px; line-height: 1.9; }
.progress-list { display: grid; gap: 0; margin: 25px 0 0; padding: 0; list-style: none; }
.progress-list > li { position: relative; padding: 12px 0 12px 24px; border-top: 1px solid #edf0e7; font-size: 12px; color: #6d7d66; overflow-wrap: anywhere; }
.progress-list > li::before { content: ""; position: absolute; top: 20px; left: 2px; width: 5px; height: 5px; border: 1px solid #a9bca0; border-radius: 50%; }
.progress-list > li.done::before, .progress-list > li[data-status="complete"]::before { background: #7a9c70; }
.progress-list time, .progress-list .step-time { display: block; color: #99a38f; font-size: 10px; }
.result-panel { overflow: hidden; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 24px 25px 11px; }
.result-heading .eyebrow { color: #819077; font-size: 10px; }
.result-heading h2 { margin-top: 4px; font: 22px/1.5 var(--serif); font-weight: 600; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; margin-top: 4px; padding: 4px 8px; border-radius: 4px; background: var(--warning-background); color: var(--warning); font-size: 10px; white-space: nowrap; }
.status-badge.success, .status-badge[data-state="ready-for-human-review"] { color: var(--green); background: var(--green-light); }
.status-badge.error, .status-badge[data-state="needs-rework"] { color: var(--error); background: var(--error-background); }
.result-meta { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 6px 15px; padding: 0 25px 19px; color: #65715f; font-size: 10px; }
.result-tabs { display: flex; gap: 0; padding: 0 21px; border-top: 1px solid #edf0e7; border-bottom: 1px solid var(--line); background: #fbfcf7; }
.result-tab { position: relative; flex: 1; min-height: 44px; padding: 10px; border: 0; background: none; color: #7d8b73; font-size: 12px; }
.result-tab.active, .result-tab[aria-selected="true"] { color: var(--green); font-weight: 600; }
.result-tab.active::after, .result-tab[aria-selected="true"]::after { content: ""; position: absolute; bottom: -1px; height: 2px; left: 12px; right: 12px; background: var(--green); }
.result-body { min-height: 290px; }
.draft-content, .review-content, .changes-content { max-height: 535px; margin: 0; padding: 25px; overflow-y: auto; overflow-wrap: anywhere; }
.draft-content { white-space: pre-wrap; color: #344234; font: 16px/1.9 var(--serif); }
.review-content, .changes-content { font-size: 12px; line-height: 1.95; white-space: pre-wrap; }
.review-content h3, .changes-content h3 { margin: 18px 0 7px; color: var(--ink); font-size: 13px; font-weight: 600; }
.review-content h3:first-child, .changes-content h3:first-child { margin-top: 0; }
.review-content p + p, .changes-content p + p { margin-top: 9px; }
.review-content ul, .changes-content ul { padding-left: 19px; }
.review-content li + li, .changes-content li + li { margin-top: 8px; }
.review-item, .change-item { padding: 13px 0; border-bottom: 1px solid #edf0e7; }
.result-actions { display: flex; align-items: center; gap: 10px; padding: 20px 24px 12px; border-top: 1px solid var(--line); }
.result-actions .button { min-height: 38px; font-size: 11px; }
.result-actions .button svg { width: 15px; height: 15px; }
.result-footnote { padding: 0 24px 21px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1256px; margin: 0 auto; padding: 0 38px 25px; color: #9aA18f; font-size: 10px; letter-spacing: .02em; }

/* History and administration. */
.secondary-view { min-height: 65vh; }
.history-list { display: grid; gap: 13px; }
.history-item, .job-item, .record-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); box-shadow: var(--shadow); }
.history-item h2, .history-item h3, .job-item h3, .record-card h3 { font-size: 14px; font-weight: 600; }
.history-item p, .job-item p, .record-card p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.history-list:empty { min-height: 200px; border: 1px dashed var(--line-strong); border-radius: 9px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 25px; }
.settings-card { padding: 27px; }
.card-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 24px; }
.card-heading .section-number { margin-top: 1px; }
.card-heading h2 { font-size: 16px; font-weight: 600; }
.card-heading p { margin-top: 6px; color: var(--muted); font-size: 11px; }
.settings-status { margin: -8px 0 20px; padding: 11px 14px; border: 1px solid #dce5d2; border-radius: 6px; background: #eff5e8; color: #4c7146; font-size: 12px; }
.provider-list { color: var(--muted); font-size: 11px; }
.provider-list:not(:empty) { margin-bottom: 20px; padding: 11px 13px; border: 1px solid #e1e6d8; border-radius: 6px; background: #f7f9f2; }
.provider-form { padding: 21px 0; border-top: 1px solid var(--line); }
.provider-form:last-child { padding-bottom: 0; }
.provider-form-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 16px; }
.provider-form-heading h3 { font-size: 13px; font-weight: 600; }
.provider-caption { color: #68775f; font-size: 10px; }
.provider-form > input { margin-top: 7px; }
.provider-actions { display: flex; gap: 9px; margin-top: 12px; }
.staff-form { display: grid; gap: 17px; }
.staff-form > .button { justify-self: start; margin-top: 1px; }
.staff-list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 29px; padding-top: 22px; border-top: 1px solid var(--line); }
.staff-list-heading h3 { font-size: 12px; font-weight: 600; }
.staff-list-heading .field-note { margin: 0; font-size: 10px; }
.staff-list { margin-top: 8px; }
.staff-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid #edf0e7; font-size: 12px; }
.staff-row small { display: block; color: var(--muted); font-size: 10px; }
.global-notice { position: fixed; z-index: 60; left: 50%; bottom: 24px; max-width: min(520px, calc(100vw - 32px)); transform: translateX(-50%); padding: 12px 18px; border: 1px solid #cad6c3; border-radius: 7px; background: #f9fcf2; color: #3a6037; font-size: 12px; box-shadow: 0 8px 30px rgb(33 54 35 / 12%); }

@media (min-width: 1440px) {
  .app-main { padding-top: 43px; }
  .page-heading { margin-bottom: 29px; }
  .source-text { min-height: 260px; }
}

@media (max-width: 1000px) {
  .header-inner { padding: 0 24px; gap: 16px; }
  .app-main { padding-right: 24px; padding-left: 24px; }
  .workspace-grid, .settings-grid { gap: 19px; }
  .input-card, .settings-card { padding: 21px; }
  .nav-button { padding-right: 10px; padding-left: 10px; }
  .nav-button.active::after, .nav-button[aria-current="page"]::after { right: 10px; left: 10px; }
  .brand { gap: 7px; font-size: 14px; }
  .brand-mark { width: 28px; height: 31px; font-size: 20px; }
  .empty-state { min-height: 485px; padding: 35px 25px; }
  .upload-area { gap: 10px; padding: 13px; }
  .upload-action { display: none; }
  .app-footer { padding-right: 24px; padding-left: 24px; }
}

@media (max-width: 760px) {
  .login-view { align-items: stretch; padding: 24px 18px; }
  .login-shell { grid-template-columns: 1fr; max-width: 480px; min-height: auto; }
  .login-story { min-height: 228px; padding: 26px 29px; }
  .login-story-copy { margin-top: 30px; }
  .login-story h1 { margin-top: 9px; font-size: 27px; line-height: 1.5; }
  .login-story h1 br { display: none; }
  .login-story-copy > p { margin-top: 12px; font-size: 11px; max-width: 350px; }
  .login-story-footer, .paper-illustration { display: none; }
  .login-form-panel { padding: 30px 29px 32px; }
  .login-heading h2 { font-size: 23px; }
  .login-form { margin-top: 25px; }
  .header-inner { flex-wrap: wrap; gap: 0 16px; min-height: 100px; padding: 13px 20px 0; }
  .header-inner > .brand { flex: 1; }
  .brand-name { font-size: 14px; }
  .account-menu { gap: 6px; font-size: 11px; }
  .account-menu .account-dot { display: none; }
  .main-nav { order: 3; width: 100%; height: 44px; gap: 8px; margin-top: 9px; }
  .nav-button { padding: 0 10px; font-size: 11px; }
  .nav-button:first-child { padding-left: 0; }
  .nav-button:first-child::after { left: 0; }
  .app-main { padding: 25px 18px 40px; }
  .page-heading { align-items: flex-start; margin-bottom: 22px; gap: 12px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { font-size: 11px; }
  .page-heading > .rules-label { display: none; }
  .workspace-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .input-card, .settings-card { padding: 21px; }
  .output-column { position: static; }
  .empty-state { min-height: 330px; padding: 30px; }
  .empty-paper { width: 80px; height: 98px; padding: 18px 13px; gap: 5px; }
  .empty-paper > span { height: 4px; margin-bottom: 4px; }
  .empty-state h2 { margin-top: 25px; font-size: 20px; }
  .empty-state > p { font-size: 11px; }
  .empty-state-caption { margin-top: 20px; }
  .result-body { min-height: 250px; }
  .draft-content, .review-content, .changes-content { max-height: 520px; padding: 21px; }
  .draft-content { font-size: 16px; }
  .result-heading { padding: 21px 21px 10px; }
  .result-meta { padding: 0 21px 17px; }
  .result-actions { padding: 18px 20px 12px; }
  .result-footnote { padding-right: 21px; padding-left: 21px; }
  .history-item, .job-item, .record-card { padding: 18px 20px; }
  .app-footer { padding: 0 19px 20px; font-size: 9px; }
  .global-notice { bottom: 16px; }
}

@media (max-width: 380px) {
  .preview-badge { display: none; }
  .account-menu { gap: 3px; }
  .input-card, .settings-card { padding: 18px; }
  .form-row { gap: 10px; }
  .section-aside { font-size: 9px; }
  .upload-area { padding: 12px 10px; }
  .result-actions { flex-wrap: wrap; }
  .app-footer > span:last-child { display: none; }
}

@media (max-width: 440px) {
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 15px; }
}

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