:root {
  --paper: #f6f5ef; --surface: #fdfcf8; --ink: #263b32; --green: #244e3e;
  --green-hover: #173c2d; --green-wash: #edf2e9; --muted: #697168; --line: #dfe2d6;
  --amber: #85521d; --amber-wash: #fcf3e1; --red: #9a3831; --red-wash: #fff0e9;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
button, a, input, .mode-option { transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; }
:focus-visible { outline: 3px solid #8aab71; outline-offset: 4px; }
svg { width: 22px; height: 22px; flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -.035em; }
h3 { font-size: 14px; font-weight: 600; }
code { font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -90px; left: 24px; z-index: 10; padding: 10px 18px; border-radius: 5px; background: var(--green); color: white; }
.skip-link:focus { top: 12px; }
.site-shell { width: min(1240px, calc(100% - 96px)); margin: auto; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 96px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 14px; font-weight: 650; letter-spacing: .07em; }
.brand-icon { width: 32px; height: 32px; color: var(--green); }
.brand-divider { margin: 0 9px; color: #a5aa9b; font-weight: 400; }
.brand-label { font-size: 13px; font-weight: 500; letter-spacing: .03em; }
.service-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; background: #f9f8f2; color: var(--muted); font-size: 12px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #858c7b; }
.service-pill[data-state="ready"] { color: var(--green); background: var(--green-wash); border-color: #d6dfca; }
.service-pill[data-state="ready"] .status-dot { background: #47734a; }
.service-pill[data-state="offline"] { color: var(--amber); background: var(--amber-wash); border-color: #e7d8b8; }
.service-pill[data-state="offline"] .status-dot { background: #b67f39; }
.intro { display: flex; justify-content: space-between; align-items: center; gap: 36px; padding: 54px 0 43px; }
.eyebrow { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .14em; color: var(--muted); }
.intro .eyebrow { font-size: 11px; color: var(--green); }
.intro .eyebrow span { margin: 0 9px; }
h1 { margin-top: 15px; font-family: var(--serif); font-size: clamp(34px, 3.5vw, 49px); line-height: 1.35; font-weight: 500; letter-spacing: -.065em; }
h1 span { color: var(--green); }
.intro-copy { margin-top: 18px; color: var(--muted); line-height: 1.9; font-size: 14px; }
.intro-note { display: grid; gap: 5px; border-left: 1px solid #cbd2c0; padding-left: 24px; min-width: 163px; font-size: 12px; }
.note-number { margin-bottom: 7px; font-family: var(--serif); font-size: 32px; line-height: 1.2; color: var(--green); }
.muted, .field-help { color: var(--muted); }
.service-notice { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding: 20px 22px; border: 1px solid #e0cfaa; border-radius: 8px; background: var(--amber-wash); color: var(--amber); }
.service-notice > svg { width: 28px; height: 28px; }
.service-notice > div { flex: 1; }
.service-notice h2 { font-size: 15px; letter-spacing: 0; }
.service-notice p { margin-top: 5px; font-size: 12px; line-height: 1.8; }
.service-notice code { padding: 3px 5px; border-radius: 3px; background: #eee1c6; color: #694019; white-space: nowrap; }
.service-notice .service-detail { color: #8b6a42; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 26px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 3px 8px #263b3203; }
.panel-heading { display: flex; align-items: center; gap: 16px; padding: 25px 28px; border-bottom: 1px solid var(--line); }
.section-number { font-family: var(--mono); font-size: 11px; color: #778570; border: 1px solid #dce2d4; padding: 6px 7px; border-radius: 4px; line-height: 1; }
.panel-heading h2 { margin-top: 3px; }
.panel-aside { margin-left: auto; color: #7d8578; font-size: 11px; }
form { padding: 26px 28px 28px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .mode-fieldset legend, .limit-field > label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.required-mark { color: #74856b; }
#reference, input[type="url"], input[type="number"] { min-width: 0; width: 100%; border: 1px solid #cdd3c4; border-radius: 5px; background: #fffefa; color: var(--ink); outline-offset: 2px; }
#reference, input[type="url"] { height: 48px; padding: 0 13px; font-family: var(--mono); font-size: 12px; }
input::placeholder { color: #8a9084; opacity: 1; }
input:hover { border-color: #8a9b7e; }
input:focus-visible { border-color: #52774d; outline: 2px solid #a7bc91; outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--red); }
input:disabled { background: #f1f1e9; color: #818879; }
.field-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; align-items: baseline; flex-wrap: wrap; }
.field-help { font-size: 11px; line-height: 1.8; font-weight: 400; }
.examples { display: flex; gap: 7px; align-items: center; color: #9ba28f; white-space: nowrap; }
.text-button { display: inline; padding: 0; border: 0; border-radius: 2px; background: transparent; color: var(--green); font-size: 11px; text-decoration: underline; text-decoration-color: #a7b59a; text-underline-offset: 4px; }
.text-button:hover { color: #496e31; text-decoration-color: currentColor; }
.mode-fieldset { margin-top: 27px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.mode-option { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 13px 11px 10px; border: 1px solid #dce0d4; border-radius: 6px; cursor: pointer; }
.mode-option:hover { border-color: #94a883; background: #f7f9f1; }
.mode-option:has(input:checked) { border-color: #547449; background: var(--green-wash); box-shadow: inset 0 0 0 1px #547449; }
.mode-option:has(input:focus-visible) { outline: 3px solid #8aab71; outline-offset: 3px; }
.mode-option input { position: absolute; right: 10px; bottom: 12px; width: 12px; height: 12px; margin: 0; accent-color: var(--green); }
.mode-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.mode-heading svg { width: 17px; height: 17px; }
.mode-description { font-size: 10px; color: var(--muted); }
.mode-code { font-size: 10px; font-family: var(--mono); color: #758367; }
.mode-help { min-height: 39px; margin-top: 10px; }
.upload-section { margin: 14px 0 24px; }
.upload-section h3 { margin-bottom: 10px; font-size: 13px; }
.drop-zone { position: relative; padding: 23px 14px; border: 1px dashed #9aa98c; border-radius: 6px; background: #f6f8f0; text-align: center; }
.drop-zone:hover, .drop-zone.is-dragging, .drop-zone:focus-within { background: #e8efdd; border-color: var(--green); }
.drop-zone:focus-within { outline: 3px solid #8aab71; outline-offset: 3px; }
.drop-label { display: grid; justify-items: center; gap: 7px; cursor: pointer; font-size: 12px; }
.drop-label > svg { margin-bottom: 4px; color: #647e53; }
.upload-section > .field-help { margin-top: 10px; }
.file-summary { margin-top: 12px; font-size: 11px; color: var(--muted); }
.file-list { padding: 0; margin: 7px 0 0; list-style: none; max-height: 220px; overflow: auto; }
.file-list li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.file-list .text-button { min-height: 28px; }
.advanced-options { display: grid; grid-template-columns: 1fr 1.7fr; gap: 24px; align-items: center; margin-top: 15px; padding: 20px 0 23px; border-top: 1px solid var(--line); }
.limit-field > label { margin-bottom: 7px; }
.number-input { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.number-input input { width: 84px; height: 37px; padding: 0 10px; font-family: var(--mono); }
.limit-field .field-help { margin-top: 5px; }
.checkbox-option { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.checkbox-option input { width: 15px; height: 15px; margin: 4px 0 0; flex: 0 0 auto; accent-color: var(--green); }
.checkbox-option strong { font-size: 12px; font-weight: 500; }
.checkbox-option .field-help { display: block; margin-top: 4px; }
.submit-row { display: flex; align-items: center; gap: 18px; padding-top: 21px; border-top: 1px solid var(--line); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 15px; min-height: 42px; padding: 10px 18px; border: 1px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.button-primary { min-width: 188px; background: var(--green); color: #fffef8; }
.button-primary:hover:enabled { background: var(--green-hover); box-shadow: 0 3px 8px #244e3e1c; }
.button-primary:disabled { background: #dce2d4; color: #6d7965; cursor: not-allowed; }
.button-primary svg { width: 18px; height: 18px; }
.button-secondary { background: #fffaf0; color: var(--amber); border-color: #dbc59e; }
.button-secondary:hover:enabled { background: #f1e5cb; border-color: #b79761; }
.button-secondary:disabled { opacity: .65; }
.submit-row p { color: var(--muted); font-size: 11px; }
.inline-error { margin: 0 0 16px; padding: 11px 13px; border: 1px solid #e4bdb0; border-radius: 5px; background: var(--red-wash); color: var(--red); font-size: 12px; overflow-wrap: anywhere; }
.side-column { display: grid; gap: 23px; }
.progress-panel { padding: 24px; }
.small-panel-heading { display: flex; align-items: center; gap: 11px; }
.small-panel-heading h2 { font-size: 16px; letter-spacing: 0; }
.job-state { margin-left: auto; border-radius: 4px; padding: 3px 7px; background: #f0f2e9; color: #617354; font-size: 10px; white-space: nowrap; }
.job-state[data-state="failed"] { background: var(--red-wash); color: var(--red); }
.progress-lead { margin-top: 25px; font-family: var(--serif); font-size: 20px; letter-spacing: -.04em; }
.progress-panel > .muted { margin-top: 5px; font-size: 11px; }
.progress-meter { margin-top: 19px; }
.progress-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 10px; color: var(--muted); }
progress { display: block; width: 100%; height: 5px; margin-top: 9px; border: 0; border-radius: 4px; background: #e5e9db; color: var(--green); accent-color: var(--green); }
progress::-webkit-progress-bar { background: #e5e9db; border-radius: 4px; }
progress::-webkit-progress-value { background: #567748; border-radius: 4px; }
progress::-moz-progress-bar { background: #567748; border-radius: 4px; }
.stage-list { margin: 26px 0 0; padding: 0; list-style: none; }
.stage-list li { position: relative; display: flex; gap: 12px; padding-bottom: 21px; color: #777f70; font-size: 12px; }
.stage-list li::before { content: ""; position: absolute; top: 24px; bottom: 2px; left: 10px; width: 1px; background: #e0e4d6; }
.stage-list li:last-child { padding-bottom: 0; }
.stage-list li:last-child::before { display: none; }
.stage-marker { position: relative; display: inline-grid; flex: 0 0 22px; place-items: center; width: 22px; height: 22px; border: 1px solid #d7decc; border-radius: 50%; background: var(--surface); font-size: 9px; font-family: var(--mono); color: #7b876f; }
.stage-list small { display: block; margin-top: 3px; font-size: 10px; color: #808779; }
.stage-list li.is-current { color: var(--green); font-weight: 600; }
.stage-list li.is-current .stage-marker { border-color: #597c4b; background: #e5eddc; box-shadow: 0 0 0 3px #f0f4e9; }
.stage-list li.is-done .stage-marker { border-color: var(--green); background: var(--green); color: #fffef8; }
.stage-list li.is-done::before { background: #9daf8e; }
.current-problem { margin-top: 19px; padding: 10px 12px; border-left: 2px solid #899e72; background: #f2f5eb; font-size: 11px; overflow-wrap: anywhere; }
.job-id { margin-top: 12px; color: #7d8673; font-family: var(--mono); font-size: 9px; overflow-wrap: anywhere; }
.task-error { margin-top: 19px; padding: 13px; border: 1px solid #e6c7b8; border-radius: 5px; background: var(--red-wash); color: var(--red); }
.task-error h3 { font-size: 12px; }
.task-error p { margin-top: 5px; font-size: 11px; overflow-wrap: anywhere; }
.task-error .field-help { color: #885d4f; }
.task-error button { margin-top: 10px; min-height: 26px; }
.help-panel { padding: 0 5px; }
.help-panel h2 { margin-top: 7px; font-family: var(--serif); font-size: 20px; }
.help-panel dl { margin: 17px 0 0; }
.help-panel dl > div { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 12px; margin-top: 13px; font-size: 11px; }
.help-panel dt { color: #4f6346; }
.help-panel dd { margin: 0; color: var(--muted); line-height: 1.9; }
.help-footnote { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: #747c6b; font-size: 10px; }
.output-empty { display: flex; align-items: center; gap: 20px; margin: 32px 0 0; padding: 25px 28px; border: 1px dashed #cdd4c0; border-radius: 9px; }
.empty-mark { color: #9cae8a; font-size: 32px; font-family: var(--serif); line-height: 1; }
.output-empty h2 { font-family: var(--serif); font-size: 18px; font-weight: 400; }
.output-empty p { margin-top: 5px; color: #7b8373; font-size: 11px; }
.empty-formats { margin-left: auto; font-family: var(--mono); font-size: 10px; color: #8c957f; white-space: nowrap; }
.results-section { margin-top: 35px; padding: 29px; border: 1px solid #cbd7bd; border-radius: 10px; background: var(--surface); scroll-margin-top: 22px; }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.results-heading h2 { margin-top: 8px; font-family: var(--serif); font-size: 30px; line-height: 1.4; overflow-wrap: anywhere; }
.results-heading .muted { margin-top: 9px; font-size: 11px; }
.result-seal { flex: 0 0 auto; padding: 5px 11px; border: 1px solid #a8bc97; border-radius: 4px; background: #edf3e5; color: #476d37; font-size: 11px; }
.download-grid { display: grid; grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.download-card { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 17px 13px; border: 1px solid #dce2d3; border-radius: 6px; background: #f8f9f2; text-decoration: none; }
.download-card:hover { background: #eaf0e1; border-color: #7e9a68; }
.download-card strong { display: block; font-size: 12px; font-weight: 550; }
.download-card small { display: block; margin-top: 3px; font-size: 9px; font-family: var(--mono); color: #78856c; overflow-wrap: anywhere; }
.download-action { margin-left: auto; color: #6d8060; font-size: 10px; white-space: nowrap; }
.file-extension { font-family: var(--mono); font-size: 9px; color: #8b9c7c; }
.primary-download { background: var(--green); border-color: var(--green); color: #fffef7; }
.primary-download:hover { background: var(--green-hover); border-color: var(--green-hover); }
.primary-download small, .primary-download .download-action { color: #c5d1b9; }
.download-card[aria-disabled="true"] { background: #eeefe7; color: #818776; border-color: var(--line); cursor: not-allowed; }
.warnings-box { margin-top: 21px; padding: 15px 18px; border: 1px solid #e3d3b2; border-radius: 5px; background: var(--amber-wash); color: var(--amber); }
.warnings-box h3 { font-size: 12px; }
.warnings-box ul { margin: 7px 0 0; padding-left: 17px; font-size: 11px; overflow-wrap: anywhere; }
.problem-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.problem-heading h3 { font-size: 15px; }
.problem-heading .muted { font-size: 11px; }
.problem-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.problem-card { display: flex; align-items: flex-start; gap: 14px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 6px; }
.problem-index { display: inline-grid; flex: 0 0 auto; min-width: 32px; min-height: 32px; padding: 3px 7px; place-items: center; border-radius: 4px; background: #edf1e5; color: #4e6f3b; font-family: var(--serif); font-size: 20px; }
.problem-content { min-width: 0; flex: 1; }
.problem-card h4 { margin: 0; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.problem-details { display: flex; flex-wrap: wrap; gap: 6px 13px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.problem-pid { font-family: var(--mono); }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 0; padding: 0; list-style: none; }
.tag-list li { padding: 2px 7px; border-radius: 3px; background: #f0f2e9; color: #697b5b; font-size: 10px; overflow-wrap: anywhere; }
.no-tags { color: #8a9280; font-size: 10px; }
.result-footnote { margin-top: 20px; padding: 11px 14px; border-left: 2px solid #b68437; background: var(--amber-wash); color: var(--amber); font-size: 11px; overflow-wrap: anywhere; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 43px; padding: 22px 0 28px; border-top: 1px solid var(--line); color: #7e8774; font-size: 10px; }
.footer-divider { margin: 0 10px; color: #b2b9a6; }
.final-download-grid { grid-template-columns: minmax(0, 1fr); }
.ai-settings-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.ai-settings-section > legend { padding: 0 10px 10px 0; font-size: 14px; font-weight: 600; }
.ai-settings-section .ai-config-grid { gap: 20px; }
.ai-config-lower { margin-top: 20px; }
.ai-config-lower .ai-key-field { margin-top: 0; }
#ai-fields input[type="url"], #ai-fields input[type="text"], #ai-fields input[type="password"], #ai-fields input[type="number"], #ai-fields textarea { width: 100%; min-width: 0; border: 1px solid #cdd3c4; border-radius: 5px; background: #fffefa; color: var(--ink); }
#ai-fields input[type="url"], #ai-fields input[type="text"], #ai-fields input[type="password"] { height: 48px; padding: 0 13px; font-family: var(--mono); font-size: 12px; }
#ai-fields input[type="number"] { height: 42px; padding: 0 11px; font-family: var(--mono); }
#ai-fields textarea { display: block; padding: 13px; font-family: var(--sans); font-size: 12px; line-height: 1.9; resize: vertical; min-height: 145px; }
#ai-fields :is(input, textarea):hover { border-color: #8a9b7e; }
#ai-fields :is(input, textarea):focus-visible { outline: 2px solid #a7bc91; outline-offset: 2px; border-color: #52774d; }
#ai-fields :is(input, textarea):disabled { color: #7b8472; background: #f2f3eb; }
.ai-settings-section .ai-template { margin-top: 24px; }
.prompt-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 15px; }
.pipeline-note { margin-top: 20px; padding: 12px 14px; border-left: 2px solid #6f8b5d; background: #f0f4e8; color: #4f6346; font-size: 11px; line-height: 1.9; }
@media (min-width: 1500px) { .intro { padding-top: 67px; padding-bottom: 52px; } }
@media (max-width: 1100px) {
  .site-shell { width: calc(100% - 56px); }
  .workspace { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 20px; }
  .panel-heading, form { padding-left: 22px; padding-right: 22px; }
  .mode-grid { gap: 7px; } .mode-option { padding: 11px 8px; }
  .mode-heading { gap: 5px; font-size: 11px; } .mode-description { font-size: 9px; }
  .submit-row { flex-wrap: wrap; gap: 10px; } .download-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prompt-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 780px) {
  .site-shell { width: calc(100% - 36px); } .masthead { min-height: 77px; }
  .intro { padding: 34px 0 30px; } .intro-note { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .side-column { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .progress-panel { padding: 23px; } .help-panel { padding: 3px 7px; }
  .service-notice { flex-wrap: wrap; gap: 12px; padding: 17px; }
  .service-notice > div { flex-basis: calc(100% - 48px); } .service-notice .button { margin-left: 40px; }
  .problem-list { grid-template-columns: minmax(0, 1fr); }
  .output-empty { margin-top: 25px; padding: 23px; gap: 13px; } .empty-formats { display: none; }
  .results-section { padding: 23px; } .site-footer { margin-top: 32px; }
  .ai-config-grid, .ai-config-lower { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 460px) {
  .site-shell { width: calc(100% - 28px); } .brand { gap: 8px; font-size: 12px; }
  .brand-divider { margin: 0 4px; } .brand-label { font-size: 11px; } .brand-icon { width: 28px; height: 28px; }
  .service-pill { font-size: 10px; padding: 5px 7px; gap: 5px; }
  h1 { font-size: 33px; letter-spacing: -.055em; } .intro-copy { font-size: 12px; } .desktop-break { display: none; }
  .panel-heading { padding: 21px 18px; gap: 12px; } .panel-aside { display: none; }
  form { padding: 23px 18px; } .panel-heading h2 { font-size: 19px; }
  .mode-option { gap: 7px; padding: 11px 8px; }
  .mode-heading { flex-direction: column; align-items: flex-start; gap: 8px; font-size: 12px; }
  .mode-description { font-size: 9px; line-height: 1.7; min-height: 30px; } .mode-option input { right: 8px; bottom: 13px; }
  .advanced-options { grid-template-columns: 1fr; gap: 17px; padding-top: 17px; }
  .limit-field { display: grid; grid-template-columns: auto 90px; gap: 6px 20px; justify-content: start; align-items: center; }
  .limit-field > label { margin: 0; } .limit-field .field-help { grid-column: 1 / -1; margin: 0; }
  .submit-row { align-items: stretch; flex-direction: column; } .submit-row .button { width: 100%; } .submit-row p { text-align: center; }
  .progress-panel { padding: 20px; } .help-panel dl > div { grid-template-columns: 82px minmax(0, 1fr); }
  .output-empty { padding: 20px 16px; } .output-empty h2 { font-size: 16px; }
  .results-section { padding: 19px 16px; } .results-heading h2 { font-size: 25px; }
  .download-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; } .download-card { padding: 14px; }
  .problem-card { padding: 15px; gap: 10px; } .site-footer { flex-direction: column; gap: 7px; }
  .ai-settings-section { margin-top: 24px; padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Keep the optional assistant visually continuous with the conversion workspace. */
.ai-section { margin-top: 26px; }
.ai-body { padding: 25px 28px 28px; }
.ai-intro { color: var(--muted); font-size: 13px; line-height: 1.9; }
.ai-presets-note { margin-top: 11px; color: #6c7d5c; font-size: 11px; overflow-wrap: anywhere; }
.ai-body > .text-button { margin-top: 7px; }
.ai-form { padding: 23px 0 0; }
.ai-form select, .ai-form input[type="text"], .ai-form input[type="password"], .ai-form textarea {
  width: 100%; min-width: 0; border: 1px solid #cdd3c4; border-radius: 5px; background: #fffefa; color: var(--ink);
}
.ai-form select { min-height: 45px; padding: 9px 12px; font-size: 13px; }
.ai-form input[type="text"], .ai-form input[type="password"] { height: 48px; padding: 0 13px; font-size: 12px; font-family: var(--mono); }
.ai-form textarea { display: block; padding: 13px; font-family: var(--sans); font-size: 12px; line-height: 1.9; resize: vertical; min-height: 145px; }
.ai-form :is(select, textarea):hover { border-color: #8a9b7e; }
.ai-form :is(select, textarea):focus-visible { outline: 2px solid #a7bc91; outline-offset: 2px; border-color: #52774d; }
.ai-form :is(select, textarea)[aria-invalid="true"] { border-color: var(--red); }
.ai-form :is(select, textarea, input):disabled { color: #7b8472; background: #f2f3eb; }
.ai-form .field > .field-help { margin-top: 7px; }
.ai-action-fieldset { margin: 23px 0; }
.ai-action-fieldset > legend { margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.ai-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ai-action-option { position: relative; padding: 14px 37px 14px 14px; border: 1px solid #dce0d4; border-radius: 5px; cursor: pointer; }
.ai-action-option:hover { border-color: #94a883; background: #f7f9f1; }
.ai-action-option:has(input:checked) { border-color: #547449; background: var(--green-wash); box-shadow: inset 0 0 0 1px #547449; }
.ai-action-option:has(input:focus-visible) { outline: 3px solid #8aab71; outline-offset: 3px; }
.ai-action-option input { position: absolute; top: 18px; right: 14px; margin: 0; width: 13px; height: 13px; accent-color: var(--green); }
.ai-action-option span { display: block; font-size: 13px; font-weight: 550; }
.ai-action-option small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.ai-config-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.ai-export-config { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(130px, .7fr); align-items: start; }
.field-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.ai-fixed-mode { min-height: 44px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--green); font-size: 12px; font-weight: 550; }
.ai-concurrency-field input { width: min(100%, 120px); height: 44px; padding: 0 11px; font-family: var(--mono); }
.ai-concurrency-field .field-help { margin-top: 5px; }
.ai-key-field { margin-top: 20px; }
.ai-prompt-field { margin-top: 23px; }
.ai-prompt-label { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 10px; }
.ai-prompt-label label { font-size: 13px; font-weight: 600; }
.ai-template { margin-top: 10px; color: var(--muted); font-size: 11px; }
.ai-template summary { width: fit-content; padding: 3px 0; cursor: pointer; text-underline-offset: 4px; }
.ai-template summary:hover { color: var(--green); }
.ai-template pre { max-height: 220px; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: #f4f5ed; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
.ai-target { margin-top: 22px; padding: 13px 16px; border-left: 2px solid #6f8b5d; background: #f0f4e8; }
.ai-target > p:first-of-type { margin-top: 5px; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; color: var(--green); }
.ai-target > .field-help { margin-top: 7px; }
.ai-candidate-note { margin-top: 14px; padding: 12px 14px; border: 1px solid #e4d3b0; border-radius: 5px; background: var(--amber-wash); color: var(--amber); font-size: 12px; }
.ai-form > .inline-error { margin-top: 18px; }
.ai-submit-row { margin-top: 22px; }
.ai-result { margin-top: 25px; padding-top: 24px; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.ai-result-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 13px; }
.ai-result-heading h3 { font-size: 16px; }
.ai-result-heading .field-help { margin-top: 5px; overflow-wrap: anywhere; }
.ai-download-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.ai-result .button-secondary { color: var(--green); background: #f5f7ee; border-color: #c7d5b9; }
.ai-result .button-secondary:hover { background: #e8efdd; border-color: #8da778; }
.ai-verification { margin-top: 17px; padding: 11px 14px; border: 1px solid #ddc9a4; border-radius: 5px; background: var(--amber-wash); color: var(--amber); font-size: 12px; font-weight: 550; }
.ai-result-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.ai-result-tags li { max-width: 100%; padding: 3px 8px; border: 1px solid #d5dfc8; border-radius: 3px; background: #edf2e9; color: #355c40; font-size: 11px; overflow-wrap: anywhere; }
.ai-warnings { margin: 14px 0; padding-left: 20px; color: var(--amber); font-size: 12px; overflow-wrap: anywhere; }
.ai-content { max-height: 460px; overflow: auto; margin: 16px 0 0; padding: 19px; border: 1px solid #d7dece; border-radius: 5px; background: #f2f4ec; font-family: var(--mono); font-size: 12px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
@media (max-width: 780px) {
  .ai-body { padding: 23px; } .ai-config-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ai-action-option { padding-right: 29px; } .ai-action-option input { right: 10px; }
  .ai-action-option small { font-size: 10px; }
}
@media (max-width: 460px) {
  .ai-body { padding: 20px 18px; } .ai-action-grid { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .ai-action-option { padding: 11px 35px 11px 13px; } .ai-action-option input { top: 15px; }
  .ai-action-option small { margin-top: 3px; } .ai-prompt-label { align-items: start; flex-direction: column; gap: 7px; }
  .ai-submit-row p { text-align: left; } .ai-content { padding: 13px; font-size: 11px; }
}

/* Export controls share the assistant's field styles and stay usable on narrow screens. */
.ai-export { margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--line); }
.ai-export h3 { font-size: 17px; }
.ai-export > .field-help { margin-top: 9px; }
.ai-export-form { padding-top: 20px; }
.ai-export-check { display: flex; align-items: center; gap: 9px; margin-top: 18px; font-size: 13px; cursor: pointer; }
.ai-export-check input { accent-color: var(--green); }
.ai-export-form > .field-help { margin-top: 14px; overflow-wrap: anywhere; }
.ai-export-saved { margin: 12px 0; padding-left: 21px; font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.ai-export-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 20px; }
.ai-export-result { margin-top: 23px; padding: 20px; border: 1px solid #c7d5b9; border-radius: 5px; background: #f5f7ee; }
.ai-export-result h4 { font-size: 15px; }
.ai-export-result > .field-help { margin-top: 8px; }
@media (max-width: 460px) {
  .ai-export-actions { flex-direction: column; }
  .ai-export-result { padding: 15px; }
}
