:root {
  --ink: #172235;
  --muted: #69758a;
  --soft: #f4f6f9;
  --line: #e2e7ee;
  --navy: #101b2c;
  --navy-2: #16243a;
  --accent: #e76532;
  --accent-dark: #c94d20;
  --green: #28b589;
  --white: #fff;
  --shadow: 0 18px 55px rgba(22, 34, 53, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f5f7fa;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f5f7fa; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 22px; display: flex; flex-direction: column; color: #dfe7f3; background: var(--navy); overflow: hidden; }
.sidebar::before { content: ""; position: absolute; width: 280px; height: 280px; left: -150px; top: -130px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,255,255,.02), 0 0 0 90px rgba(255,255,255,.015); }
.brand { position: relative; display: flex; gap: 12px; align-items: center; color: white; text-decoration: none; padding: 2px 8px 30px; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; color: white; background: var(--accent); box-shadow: 0 8px 22px rgba(231, 101, 50, .28); }
.brand-mark svg { width: 25px; fill: currentColor; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.2px; }
.brand small { margin-top: 1px; color: #8997ad; font-size: 10px; letter-spacing: 1.7px; text-transform: uppercase; }
.side-nav { display: grid; gap: 7px; }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 13px; border-radius: 9px; color: #8f9db2; font-size: 13px; font-weight: 600; text-decoration: none; transition: .2s ease; }
.side-nav a:hover { color: white; background: rgba(255,255,255,.045); }
.side-nav a.active { color: white; background: rgba(255,255,255,.08); box-shadow: inset 3px 0 var(--accent); }
.side-nav svg, .privacy-note svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-spacer { flex: 1; }
.system-card { padding: 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.035); }
.system-card-head, .system-row { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { color: #8290a5; font-size: 9px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.eyebrow.accent { color: var(--accent); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #78859a; box-shadow: 0 0 0 4px rgba(120,133,154,.12); }
.status-dot.ready { background: var(--green); box-shadow: 0 0 0 4px rgba(40,181,137,.12); }
.status-dot.error { background: #ef5b64; box-shadow: 0 0 0 4px rgba(239,91,100,.12); }
.status-dot.checking { animation: pulse 1.5s infinite; }
.system-card > strong { display: block; margin-top: 13px; color: #f4f7fb; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.system-card > span { display: block; margin-top: 4px; color: #7e8ca1; font-size: 10px; }
.memory-track { height: 3px; margin: 13px 0; overflow: hidden; border-radius: 4px; background: #26354b; }
.memory-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .5s ease; }
.system-row { color: #718096; font-size: 10px; }
.system-row b { color: #aeb9c9; font-weight: 600; text-transform: capitalize; }
.privacy-note { display: flex; gap: 10px; padding: 18px 7px 0; color: #6f7d92; }
.privacy-note svg { flex: 0 0 auto; width: 17px; color: #79889d; }
.privacy-note strong, .privacy-note span { display: block; }
.privacy-note strong { margin-bottom: 3px; color: #a9b5c5; font-size: 10px; }
.privacy-note span { font-size: 9px; line-height: 1.5; }

main { min-width: 0; }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 4vw, 56px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
.breadcrumbs { display: flex; gap: 10px; color: #9aa3b1; font-size: 11px; }
.breadcrumbs i { color: #c7cdd6; font-style: normal; }
.breadcrumbs strong { color: #536076; }
.mobile-brand { display: none; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #dceee8; border-radius: 99px; color: #39836d; background: #f2faf7; font-size: 10px; font-weight: 700; }
.local-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; }
.icon-button svg { width: 16px; fill: none; stroke: #667287; stroke-width: 1.8; stroke-linecap: round; }

.workspace { max-width: 1480px; margin: 0 auto; padding: 44px clamp(24px, 4vw, 58px) 64px; }
.intro { max-width: 700px; margin-bottom: 34px; }
.intro h1 { margin: 9px 0 8px; color: #162237; font-family: Georgia, "Times New Roman", serif; font-size: clamp(32px, 4vw, 48px); font-weight: 500; letter-spacing: -1.8px; line-height: 1.1; }
.intro p { max-width: 660px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.work-grid { display: grid; grid-template-columns: minmax(460px, .9fr) minmax(480px, 1.1fr); gap: 24px; align-items: start; }
.card { border: 1px solid #e2e6ed; border-radius: 15px; background: white; box-shadow: var(--shadow); }
.composer { padding: 28px; }
.card-heading, .card-heading > div, .result-header, .result-header > div { display: flex; align-items: center; }
.card-heading { justify-content: space-between; margin-bottom: 18px; }
.card-heading > div, .result-header > div { gap: 10px; }
.card h2 { margin: 0; color: #202c3f; font-size: 13px; font-weight: 750; letter-spacing: -.1px; }
.step { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--accent); background: #fff1eb; font-size: 9px; font-weight: 800; }
.support-copy, .optional { color: #9ba4b2; font-size: 9px; letter-spacing: .5px; }
.optional { padding: 4px 8px; border-radius: 4px; background: #f3f5f8; text-transform: uppercase; }
.dropzone { width: 100%; min-height: 178px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; padding: 24px; border: 1.5px dashed #cfd6df; border-radius: 11px; color: inherit; background: #fbfcfd; cursor: pointer; transition: .2s ease; }
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: #fff8f5; transform: translateY(-1px); }
.upload-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #e8d8d1; border-radius: 10px; color: var(--accent); background: white; box-shadow: 0 7px 18px rgba(35,44,59,.06); }
.upload-icon svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dropzone span > strong, .dropzone span > small { display: block; text-align: center; }
.dropzone span > strong { color: #303c4e; font-size: 12px; }
.dropzone span > small { margin-top: 5px; color: #8a95a6; font-size: 10px; }
.dropzone em { color: #afb6c1; font-size: 8px; font-style: normal; text-transform: uppercase; letter-spacing: .7px; }
.file-card { min-height: 72px; display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid #dfe5ec; border-radius: 10px; background: #fafbfd; }
.file-type { display: grid; place-items: center; width: 40px; height: 44px; border-radius: 7px; color: white; background: var(--accent); font-size: 9px; font-weight: 800; }
.file-details { flex: 1; min-width: 0; }
.file-details strong, .file-details small { display: block; }
.file-details strong { overflow: hidden; color: #2c384b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.file-details small { margin-top: 5px; color: #929cab; font-size: 9px; }
.file-card button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 7px; color: #8e98a7; background: transparent; cursor: pointer; }
.file-card button:hover { color: #c84b4b; background: #fff0f0; }
.file-card svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.section-divider { height: 1px; margin: 26px -28px; background: #edf0f4; }
.prompt-heading, .output-heading { margin-bottom: 13px; }
.prompt-box { position: relative; display: block; }
.document-type-field { margin-bottom: 10px; }
.document-type-field > label { display: block; margin-bottom: 5px; color: #657186; font-size: 9px; font-weight: 700; }
.document-type-field > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.document-type-field select, .document-type-field input { width: 100%; height: 37px; padding: 0 11px; border: 1px solid #dce2ea; border-radius: 8px; outline: none; color: #39465a; background: #fbfcfd; font-size: 10px; }
.document-type-field select:focus, .document-type-field input:focus { border-color: #e58a67; background: white; box-shadow: 0 0 0 3px rgba(231,101,50,.08); }
.document-type-field small { display: block; margin-top: 5px; color: #9aa3b1; font-size: 8px; }
.configured-profile { margin: 10px 0 12px; padding: 11px 12px; border: 1px solid #d8ebe4; border-radius: 9px; background: linear-gradient(120deg,#f3faf7,#fbfdfc); }
.configured-profile > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.configured-profile > div:first-child span { color: #318065; font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.configured-profile > div:first-child b { color: #3f6659; font-size: 9px; }
.configured-profile > small { display: block; margin-top: 8px; color: #789487; font-size: 7px; }
.configured-fields { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.configured-fields span { padding: 4px 6px; border-radius: 5px; color: #4c7466; background: #e4f3ed; font: 7px "SFMono-Regular",Consolas,monospace; }
.prompt-box textarea { width: 100%; min-height: 128px; resize: vertical; padding: 14px 16px 27px; border: 1px solid #dce2ea; border-radius: 9px; outline: none; color: #2e3a4d; background: #fbfcfd; font-size: 11px; line-height: 1.65; transition: .2s ease; }
.prompt-box textarea:focus { border-color: #e58a67; background: white; box-shadow: 0 0 0 3px rgba(231,101,50,.08); }
.prompt-box textarea::placeholder { color: #a4adba; }
.char-count { position: absolute; right: 11px; bottom: 9px; color: #a9b1bd; font-size: 8px; }
.char-count b { font-weight: 500; }
.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.preset-row > span { margin-right: 2px; color: #9ba4b2; font-size: 8px; text-transform: uppercase; letter-spacing: .5px; }
.preset-row button { padding: 5px 9px; border: 1px solid #e1e5eb; border-radius: 99px; color: #677286; background: white; font-size: 8px; cursor: pointer; }
.preset-row button:hover { border-color: #efb39b; color: var(--accent-dark); background: #fff7f3; }
.format-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.format-switch input { position: absolute; opacity: 0; pointer-events: none; }
.format-switch label > span { min-height: 83px; display: grid; grid-template-columns: 25px 1fr; grid-template-rows: auto auto; column-gap: 9px; align-content: center; padding: 12px; border: 1px solid #dfe4eb; border-radius: 9px; cursor: pointer; transition: .18s ease; }
.format-switch svg { grid-row: 1 / 3; align-self: center; width: 22px; fill: none; stroke: #8691a3; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.format-switch b { align-self: end; color: #465267; font-size: 10px; }
.format-switch small { margin-top: 3px; color: #9aa3b1; font-size: 7.5px; line-height: 1.3; }
.format-switch input:checked + span { border-color: #eb9c7e; background: #fff7f3; box-shadow: inset 0 0 0 1px rgba(231,101,50,.12); }
.format-switch input:checked + span svg, .format-switch input:checked + span b { color: var(--accent); stroke: var(--accent); }
.advanced { margin-top: 17px; border-top: 1px solid #edf0f4; }
.advanced summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 2px 3px; color: #6f7b8e; font-size: 9px; font-weight: 700; cursor: pointer; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .2s; }
.advanced[open] summary svg { transform: rotate(180deg); }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; }
.advanced-grid label span { display: block; margin-bottom: 5px; color: #8c96a6; font-size: 8px; }
.advanced-grid select { width: 100%; height: 35px; padding: 0 9px; border: 1px solid #dfe4eb; border-radius: 7px; color: #566276; outline: none; background: white; font-size: 9px; }
.primary-button { width: 100%; height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; border: 0; border-radius: 9px; color: white; background: var(--accent); box-shadow: 0 10px 25px rgba(231,101,50,.22); font-size: 11px; font-weight: 750; cursor: pointer; transition: .2s ease; }
.primary-button:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 13px 29px rgba(201,77,32,.26); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.primary-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.result { min-height: 680px; overflow: hidden; }
.result-header { min-height: 79px; justify-content: space-between; padding: 0 23px; border-bottom: 1px solid #e9edf2; }
.result-actions { display: flex; gap: 7px; }
.result-actions button, .result-actions a { height: 31px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid #dfe4ea; border-radius: 7px; color: #667287; background: white; font-size: 8px; font-weight: 700; text-decoration: none; cursor: pointer; }
.result-actions button:hover, .result-actions a:hover { color: var(--accent-dark); border-color: #ebb29c; }
.result-actions svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.result-tabs { height: 45px; display: flex; gap: 20px; align-items: end; padding: 0 23px; border-bottom: 1px solid #edf0f4; background: #fbfcfd; }
.result-tabs button { position: relative; height: 100%; padding: 0; border: 0; color: #9aa3b1; background: transparent; font-size: 9px; font-weight: 650; cursor: pointer; }
.result-tabs button::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; }
.result-tabs button.active { color: #384558; }
.result-tabs button.active::after { background: var(--accent); }
.result-body { position: relative; min-height: 500px; height: min(60vh, 650px); overflow: auto; background: white; }
.empty-state, .processing-state { min-height: 500px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 45px; text-align: center; }
.empty-visual { position: relative; width: 88px; height: 88px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid #e8ebef; border-radius: 50%; background: #f8f9fb; }
.empty-visual svg { width: 42px; fill: none; stroke: #b6bec9; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.empty-visual i, .empty-visual b { position: absolute; width: 7px; height: 7px; border: 1px solid #edb7a2; transform: rotate(45deg); }
.empty-visual i { left: 2px; top: 17px; }.empty-visual b { right: 2px; bottom: 16px; }
.empty-state h3, .processing-state h3 { margin: 0 0 8px; color: #3d495c; font-size: 13px; }
.empty-state p, .processing-state p { max-width: 310px; margin: 0; color: #929cab; font-size: 10px; line-height: 1.6; }
.scan-document { position: relative; width: 76px; height: 94px; margin-bottom: 25px; border: 1px solid #cfd6df; border-radius: 7px; background: #fff; box-shadow: 0 12px 30px rgba(27,39,57,.1); overflow: hidden; }
.scan-document::before, .scan-document::after, .scan-document span, .scan-document b, .scan-document em { content: ""; position: absolute; left: 14px; height: 3px; border-radius: 3px; background: #e2e6ec; }
.scan-document::before { top: 22px; width: 45px; }.scan-document::after { top: 31px; width: 34px; }
.scan-document span { top: 48px; width: 45px; }.scan-document b { top: 57px; width: 40px; }.scan-document em { top: 66px; width: 29px; }
.scan-document i { position: absolute; z-index: 2; left: 0; width: 100%; height: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: scan 1.8s ease-in-out infinite alternate; }
.progress-track { width: 220px; height: 4px; margin: 22px 0 9px; overflow: hidden; border-radius: 6px; background: #edf0f4; }
.progress-track i { display: block; width: 8%; height: 100%; border-radius: inherit; background: var(--accent); transition: width 1s ease; }
.elapsed { color: #9fa7b4; font-size: 8px; font-variant-numeric: tabular-nums; }
.content-view, .raw-view { min-height: 100%; }
.content-view pre, .raw-view pre { min-height: 500px; margin: 0; padding: 25px; color: #354155; font: 11px/1.75 "SFMono-Regular", Consolas, "Liberation Mono", monospace; white-space: pre-wrap; word-break: break-word; }
#textResult.json { color: #26364b; }
#htmlResult { width: 100%; min-height: 500px; height: 100%; border: 0; background: white; }
.source-view { height: 100%; min-height: 500px; display: grid; place-items: center; padding: 20px; background: #f2f4f7; }
.source-view img { max-width: 100%; max-height: 600px; object-fit: contain; border-radius: 5px; box-shadow: 0 10px 35px rgba(22,34,53,.15); }
.source-view iframe { width: 100%; height: 600px; border: 0; border-radius: 5px; background: white; }
.result-footer { min-height: 62px; display: grid; grid-template-columns: 1.6fr .6fr .7fr .8fr; align-items: center; padding: 0 23px; border-top: 1px solid #e9edf2; background: #fbfcfd; }
.result-footer div { min-width: 0; padding-right: 10px; }
.result-footer span, .result-footer strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-footer span { margin-bottom: 4px; color: #a0a8b5; font-size: 7px; text-transform: uppercase; letter-spacing: .5px; }
.result-footer strong { color: #566276; font-size: 8px; }
.feedback-card { margin: 0; padding: 17px 22px; border-top: 1px solid #e7ebf0; background: linear-gradient(105deg,#fbfcfd,#f7faf9); }
.feedback-copy { display: flex; align-items: center; gap: 11px; }
.feedback-mark { display: grid; flex: 0 0 auto; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: #287b5d; background: #e5f4ed; font-size: 13px; }
.feedback-copy h3 { margin: 0 0 3px; color: #354256; font-size: 10px; }
.feedback-copy p { margin: 0; color: #8b96a5; font-size: 8px; line-height: 1.45; }
.feedback-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 12px; }
.feedback-actions button { height: 34px; border: 1px solid #dfe4ea; border-radius: 7px; background: white; font-size: 8px; font-weight: 750; cursor: pointer; }
.feedback-actions button:disabled { opacity: .5; cursor: wait; }
.feedback-actions .accept { color: #267b5b; border-color: #cae5da; background: #f1faf6; }
.feedback-actions .correct { color: #986027; border-color: #ecd9bf; background: #fff9ef; }
.feedback-actions .reject { color: #a4494e; border-color: #ecd1d3; background: #fff5f5; }
.feedback-state { margin-top: 12px; padding: 10px 12px; border-radius: 7px; color: #526274; background: #eef2f5; font-size: 8px; line-height: 1.5; }
.feedback-state.accepted { color: #2d745b; background: #eaf7f1; }.feedback-state.corrected { color: #87602d; background: #fff5e6; }.feedback-state.rejected { color: #91454a; background: #f9e9ea; }
.correction-dialog { width: min(720px,calc(100% - 28px)); padding: 0; border: 0; border-radius: 15px; box-shadow: 0 30px 90px rgba(15,27,45,.32); }
.correction-dialog::backdrop { background: rgba(13,23,38,.65); backdrop-filter: blur(4px); }
.correction-dialog form { padding: 25px; }
.correction-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.correction-head h2 { margin: 5px 0 6px; color: #263348; font-size: 18px; }.correction-head p { margin: 0; color: #818d9d; font-size: 9px; }
.correction-head button { width: 31px; height: 31px; border: 1px solid #e0e5eb; border-radius: 8px; color: #8993a2; background: white; font-size: 18px; cursor: pointer; }
.correction-dialog label { display: block; margin-top: 12px; }.correction-dialog label > span { display: block; margin-bottom: 6px; color: #657186; font-size: 9px; font-weight: 700; }.correction-dialog label em { float: right; color: #a5adba; font-style: normal; font-weight: 400; }
.correction-dialog textarea { width: 100%; min-height: 300px; resize: vertical; padding: 13px; border: 1px solid #dce2e9; border-radius: 9px; outline: 0; color: #334156; background: #fafbfd; font: 10px/1.65 "SFMono-Regular",Consolas,monospace; }.correction-dialog textarea:focus { border-color: #e58a67; box-shadow: 0 0 0 3px rgba(231,101,50,.08); background: white; }.correction-dialog textarea.feedback-note { min-height: 70px; font-family: inherit; }
.correction-error { min-height: 18px; padding-top: 5px; color: #ae454a; font-size: 8px; }
.correction-actions { display: flex; justify-content: flex-end; gap: 8px; }.correction-actions button { height: 36px; padding: 0 14px; border: 1px solid #dfe4ea; border-radius: 7px; color: #687487; background: white; font-size: 9px; font-weight: 700; }.correction-actions button:last-child { border-color: var(--accent); color: white; background: var(--accent); }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: 360px; padding: 12px 16px; border-radius: 9px; color: white; background: #243248; box-shadow: 0 12px 35px rgba(10,20,34,.25); font-size: 10px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a53b3f; }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes scan { from { top: 9px; } to { top: 82px; } }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > span:last-child, .side-nav a:not(.active)::after, .side-nav a { font-size: 0; }
  .side-nav a { justify-content: center; padding: 0; }
  .side-nav svg { width: 21px; }
  .system-card, .privacy-note { display: none; }
  .work-grid { grid-template-columns: 1fr; }
  .result { min-height: 620px; }
}

@media (max-width: 680px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 58px; padding: 0 18px; }
  .mobile-brand { display: block; color: #243147; font-size: 12px; font-weight: 800; }
  .breadcrumbs { display: none; }
  .local-badge { font-size: 8px; }
  .workspace { padding: 30px 14px 45px; }
  .intro { margin-bottom: 25px; padding: 0 5px; }
  .intro h1 { font-size: 34px; }
  .intro p { font-size: 12px; }
  .composer { padding: 20px; }
  .section-divider { margin-inline: -20px; }
  .support-copy { display: none; }
  .format-switch { grid-template-columns: 1fr; }
  .format-switch label > span { min-height: 65px; }
  .advanced-grid { grid-template-columns: 1fr; }
  .result-header { padding: 0 16px; }
  .result-actions button, .result-actions a { padding: 0 8px; font-size: 0; }
  .result-actions svg { width: 15px; }
  .result-tabs { gap: 15px; padding: 0 16px; }
  .result-footer { grid-template-columns: 1fr 1fr; gap: 12px; padding-block: 13px; }
  .feedback-actions { grid-template-columns: 1fr; }
  .correction-dialog form { padding: 19px; }.correction-dialog textarea { min-height: 240px; }
}

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

/* Token gate shown only when the workspace is served over a public address. */
.login-layer{position:fixed;inset:0;z-index:20;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 30% 20%,#273650 0,#111b2c 42%,#0a1220 100%)}
.login-card{width:min(430px,100%);padding:42px;border:1px solid rgba(255,255,255,.12);border-radius:18px;color:#fff;background:rgba(22,34,54,.92);box-shadow:0 30px 80px rgba(0,0,0,.35)}
.login-mark{display:grid;place-items:center;width:46px;height:46px;margin-bottom:28px;border-radius:13px;color:#fff;background:var(--accent);font:700 22px Manrope,sans-serif}
.login-card .eyebrow{display:block;color:#8895a9;font-size:10px;font-weight:700;letter-spacing:.16em}
.login-card h1{margin:8px 0 10px;font:700 25px Manrope,sans-serif}
.login-card p{margin:0 0 25px;color:#aeb8c8;line-height:1.6;font-size:13px}
.login-card label span{display:block;margin-bottom:6px;color:#8895a9;font-size:10px;font-weight:600}
.login-card input{width:100%;height:45px;padding:0 13px;border:1px solid #40506a;border-radius:9px;outline:0;color:#fff;background:#101b2d}
.login-card input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(231,101,50,.15)}
.login-card button{width:100%;height:44px;margin-top:12px;border:0;border-radius:9px;color:#fff;background:var(--accent);font-weight:700;cursor:pointer}
.login-card a{display:block;margin-top:18px;color:#aab5c5;text-align:center;text-decoration:none;font-size:12px}
.login-error{min-height:18px;margin-top:12px;color:#ff9f87;text-align:center;font-size:11px}
