:root {
  color-scheme: light;
  --ink: #172b43;
  --muted: #68798e;
  --soft: #f4f7fb;
  --line: #dce3eb;
  --blue: #1454a0;
  --blue-dark: #103f78;
  --teal: #17847f;
  --green: #19815d;
  --red: #bd4149;
  --shadow: 0 12px 34px rgba(19, 42, 70, .055);
  font-family: "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f5f7fa; color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1180px, calc(100% - 56px)); margin: 0 auto; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e4e9ef; }
.brand { display: flex; align-items: center; gap: 16px; color: #77869a; font-size: 12px; letter-spacing: .02em; }
.brand img { width: 124px; height: auto; display: block; }
.brand-rule { height: 24px; width: 1px; background: #d9e0e8; }
.local-status { display: inline-flex; align-items: center; gap: 8px; color: #62758b; font-size: 12px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #25a171; box-shadow: 0 0 0 4px rgba(37,161,113,.12); }
main { padding: 38px 0 22px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin: 4px 0 26px; }
.eyebrow { color: #73869b; font-size: 11px; font-weight: 700; letter-spacing: .13em; margin: 0 0 10px; }
h1 { font-size: clamp(27px, 3vw, 36px); line-height: 1.12; letter-spacing: -.035em; margin: 0; font-weight: 690; color: #142c49; }
.intro-copy { margin: 10px 0 0; color: #667a91; font-size: 14px; line-height: 1.55; max-width: 605px; }
.step-track { display: flex; align-items: center; gap: 11px; padding-bottom: 3px; flex-shrink: 0; }
.step { display: flex; align-items: center; gap: 7px; color: #8c9aac; }
.step span { border: 1px solid #d2dbe5; border-radius: 50%; width: 23px; height: 23px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: #fff; }
.step small { font-size: 11px; font-weight: 600; }
.step.active { color: var(--blue); }
.step.active span { border-color: #b7cbe4; background: #e8f0fa; color: var(--blue); }
.step-line { width: 24px; height: 1px; background: #d5dee7; }
.privacy-banner { min-height: 67px; background: #edf6f2; border: 1px solid #d9ebe3; border-radius: 9px; display: flex; align-items: center; gap: 13px; padding: 12px 16px; margin-bottom: 31px; }
.privacy-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: #d8eee4; color: #257e5e; font-size: 17px; }
.privacy-banner > div { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.privacy-banner strong { color: #245b47; font-size: 12px; font-weight: 700; }
.privacy-banner > div span { color: #567666; font-size: 11px; }
.ocr-pill { border: 1px solid #e6d7b0; background: #fffaf0; border-radius: 30px; padding: 6px 10px; font-size: 10px; font-weight: 700; color: #8c6b28; white-space: nowrap; }
.ocr-pill.ready { border-color: #b8dfcc; background: #f4fcf7; color: #277550; }
.ocr-pill.error { border-color: #f0c9ca; background: #fff6f6; color: #9d3e43; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 17px; font-weight: 680; letter-spacing: -.015em; }
.section-heading p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; color: #738398; }
.text-button { border: 0; background: transparent; color: #476785; font-size: 12px; font-weight: 650; padding: 7px 4px; }
.text-button:hover { color: var(--blue); text-decoration: underline; }
.uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.upload-card { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 17px; box-shadow: var(--shadow); min-width: 0; }
.card-top { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.file-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: 10px; letter-spacing: .015em; font-weight: 800; }
.ticket-icon { background: #e8eff9; color: #306198; }
.invoice-icon { background: #f0edf9; color: #7563a3; font-size: 9px; }
.card-top h3 { margin: 0; font-size: 13px; font-weight: 700; }
.card-top p { margin: 4px 0 0; font-size: 10px; color: #8190a2; }
.count-badge { margin-left: auto; border: 1px solid #e4e9ef; border-radius: 20px; color: #74849a; padding: 5px 8px; font-size: 10px; font-weight: 650; }
.dropzone { min-height: 122px; border: 1px dashed #bdcbd9; border-radius: 8px; background: #fbfcfd; display: flex; align-items: center; justify-content: center; flex-direction: column; transition: border-color .15s, background .15s; cursor: pointer; position: relative; }
.dropzone:hover, .dropzone.dragging { border-color: #4382bf; background: #f5f9fd; }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-glyph { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #edf3f8; color: #597894; font-size: 18px; margin-bottom: 7px; }
.drop-title { color: #40566f; font-size: 11px; font-weight: 680; }
.drop-subtitle { color: #8794a4; font-size: 10px; margin-top: 4px; }
.browse-link { color: #1761a9; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.file-list { display: grid; gap: 7px; margin-top: 9px; }
.file-row { display: flex; align-items: center; gap: 9px; border: 1px solid #e5eaf0; border-radius: 7px; background: #fbfcfd; min-height: 45px; padding: 5px 8px; }
.file-preview { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 4px; flex: 0 0 auto; overflow: hidden; background: transparent; }
.file-preview:hover { box-shadow: 0 0 0 2px #8baecf; }
.file-thumb { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; background: #eef2f6; flex: 0 0 auto; }
.pdf-thumb { display: grid; place-items: center; color: #a1434a; background: #f7e8e9; font-size: 8px; font-weight: 800; }
.file-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.file-meta strong { font-size: 10px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta span { color: #8492a2; font-size: 9px; }
.remove-file { border: 0; color: #8795a5; background: transparent; width: 26px; height: 26px; border-radius: 5px; font-size: 16px; }
.remove-file:hover { color: #a13e42; background: #faeeee; }
.upload-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 14px 0 33px; }
.file-help { display: flex; align-items: center; gap: 8px; color: #7b899a; font-size: 10px; }
.help-mark { border: 1px solid #c8d1db; border-radius: 50%; width: 15px; height: 15px; display: grid; place-items: center; font-size: 9px; font-weight: 700; color: #6c7d90; }
.button { border: 0; border-radius: 7px; padding: 10px 15px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; transition: .15s ease; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { background: var(--blue); color: white; box-shadow: 0 4px 9px rgba(20,84,160,.17); }
.button-primary:not(:disabled):hover { background: var(--blue-dark); transform: translateY(-1px); }
.review-heading { margin-top: 0; margin-bottom: 13px; }
.review-summary { border: 1px solid #e1e7ee; background: #fff; color: #728298; padding: 6px 9px; border-radius: 20px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.review-summary.complete { background: #eff9f3; border-color: #cfe9d9; color: #27764f; }
.review-empty { border: 1px dashed #d0d9e3; border-radius: 10px; min-height: 132px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; background: rgba(255,255,255,.56); color: #738398; text-align: center; margin-bottom: 26px; }
.empty-mark { color: #91a1b3; font-size: 20px; margin-bottom: 1px; }
.review-empty strong { color: #50647b; font-size: 12px; }
.review-empty span { font-size: 10px; }
.review-panel { margin-bottom: 25px; border: 1px solid var(--line); background: #fff; border-radius: 11px; box-shadow: var(--shadow); overflow: hidden; }
.review-toolbar { padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e8edf2; }
.review-kicker { color: #8392a4; letter-spacing: .11em; font-size: 9px; font-weight: 750; }
.review-toolbar h3 { margin: 4px 0 0; font-size: 14px; }
.review-tools { display: flex; align-items: center; gap: 9px; }
.select-label { color: #77879a; font-size: 10px; font-weight: 650; }
.review-tools select { color: #344b64; border: 1px solid #d6dfe8; border-radius: 6px; background: #fff; padding: 8px 29px 8px 9px; font-size: 10px; min-width: 202px; }
.customer-note { display: flex; align-items: flex-start; gap: 9px; background: #fff8e9; border-bottom: 1px solid #f2e2bd; color: #7d622e; padding: 9px 17px; font-size: 10px; line-height: 1.45; }
.customer-note > span:first-child { border: 1px solid #cfb16d; border-radius: 50%; width: 14px; height: 14px; text-align: center; line-height: 13px; font-weight: 700; font-size: 9px; flex: 0 0 auto; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 15px; padding: 18px; }
.field { min-width: 0; }
.field-label { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: #68798e; font-size: 10px; font-weight: 700; }
.field-color { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 auto; }
.field .field-source { font-size: 8px; color: #95a2b1; font-weight: 550; margin-left: auto; }
.field-value { width: 100%; min-height: 35px; border: 1px solid #d9e1e9; border-radius: 6px; color: #2a4058; background: #fff; padding: 9px 10px; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.field-value.empty-value { color: #a8b2bf; background: #fafbfd; }
.field input { width: 100%; min-width: 0; height: 35px; border: 1px solid #d9e1e9; border-radius: 6px; color: #2a4058; background: #fff; padding: 0 10px; font-size: 11px; outline: 0; }
.field input:focus { border-color: #76a3d1; box-shadow: 0 0 0 3px rgba(58,125,190,.1); }
.field input::placeholder { color: #a8b2bf; }
.field input.attention { border-color: #e1bc72; background: #fffaf0; }
.field input.confirmed { border-color: #b8dcc8; background: #f9fdfb; }
.field-hint { margin-top: 5px; min-height: 12px; font-size: 8px; color: #a17832; }
.manual-note { margin: 0 18px 16px; padding: 11px 12px; border-radius: 7px; background: #f5f7fa; display: flex; gap: 10px; align-items: flex-start; }
.manual-icon { width: 21px; height: 21px; border-radius: 5px; display: grid; place-items: center; color: #71839a; background: #e5ebf2; font-size: 12px; flex: 0 0 auto; }
.manual-note div { display: flex; flex-direction: column; gap: 3px; }
.manual-note strong { color: #52677f; font-size: 10px; }
.manual-note span { color: #78889a; font-size: 9px; line-height: 1.45; }
.export-bar { border: 1px solid #d6e0ea; border-radius: 10px; background: #eef3f8; padding: 14px 15px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.export-copy { display: flex; align-items: center; gap: 11px; }
.export-icon { border: 1px solid #d2dce6; border-radius: 6px; background: #fff; color: #b4444c; display: grid; place-items: center; width: 35px; height: 35px; font-size: 8px; font-weight: 800; }
.export-icon.docx-icon { color: #245c98; font-size: 7px; }
.export-copy > div { display: flex; flex-direction: column; gap: 4px; }
.export-copy strong { font-size: 11px; color: #314a64; }
.export-copy span { font-size: 9px; color: #75869a; }
.button-dark { background: #173b62; color: #fff; }
.button-dark:hover { background: #102c4b; transform: translateY(-1px); }
footer { display: flex; justify-content: space-between; color: #9aa6b4; font-size: 9px; padding: 18px 2px 4px; }
.progress-panel { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #d7e2ed; border-radius: 8px; margin: -20px 0 28px; background: #fff; }
.spinner { border: 2px solid #d7e4f0; border-top-color: #2769a9; border-radius: 50%; width: 19px; height: 19px; animation: spin .8s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-text { display: flex; flex-direction: column; gap: 3px; min-width: 150px; }
.progress-text strong { font-size: 10px; }
.progress-text span { color: #75869a; font-size: 9px; }
.progress-track { height: 5px; background: #e8eef4; border-radius: 9px; overflow: hidden; flex: 1; }
.progress-track div { height: 100%; width: 0; background: #2a8a74; transition: width .2s; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; background: #173b62; color: #fff; padding: 10px 14px; border-radius: 7px; box-shadow: 0 8px 22px rgba(13,35,60,.2); font-size: 11px; transition: .2s ease; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
dialog { border: 0; border-radius: 10px; padding: 0; width: min(900px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 36px); box-shadow: 0 25px 80px rgba(11, 29, 49, .3); color: var(--ink); }
dialog::backdrop { background: rgba(16, 32, 50, .58); }
.preview-dialog-head { height: 48px; border-bottom: 1px solid #e4eaf0; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }
.preview-dialog-head strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-content { min-height: 270px; max-height: calc(100vh - 84px); overflow: auto; background: #edf1f5; display: flex; align-items: center; justify-content: center; }
.preview-content img { display: block; max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; }
.preview-content iframe { display: block; width: 100%; height: calc(100vh - 92px); border: 0; background: white; }
.hidden { display: none !important; }

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 580px); }
  main { padding-top: 26px; }
  .intro { align-items: flex-start; flex-direction: column; gap: 20px; }
  .step-track { width: 100%; }
  .step-line { flex: 1; }
  .uploads { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .privacy-banner { flex-wrap: wrap; }
  .ocr-pill { margin-left: 45px; }
}
@media (max-width: 500px) {
  .brand img { width: 106px; }
  .brand { gap: 10px; }
  .brand > span { display: none; }
  .local-status { font-size: 10px; }
  .section-heading h2 { font-size: 15px; }
  .upload-actions, .export-bar { align-items: stretch; flex-direction: column; }
  .upload-actions .button, .export-bar .button { justify-content: center; }
  .review-toolbar { align-items: flex-start; flex-direction: column; }
  .review-tools { width: 100%; align-items: flex-start; flex-direction: column; }
  .review-tools select { width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .progress-panel { flex-wrap: wrap; }
  .progress-track { flex-basis: 100%; order: 3; }
}
