:root {
  color-scheme: light;
  --ink: #252b31;
  --navy: #2b3945;
  --navy-deep: #1e2a33;
  --paper: #f5f2ea;
  --paper-deep: #ebe6dc;
  --white: #ffffff;
  --line: #cbc8c0;
  --muted: #666b6f;
  --orange: #c45d3b;
  --orange-soft: #f3e1da;
  --blue: #536979;
  --success: #49604e;
  --success-soft: #edf2eb;
  --danger: #9a433b;
  --danger-soft: #f8eae6;
  --shadow: none;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(196, 93, 59, 0.28); outline-offset: 2px; }

.app-shell { min-height: 100vh; overflow: hidden; }
.site-header { height: 76px; padding: 0 max(28px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--paper); border-bottom: 1px solid rgba(37, 42, 60, 0.14); }
.brand { display: flex; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; }
.brand > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.brand b { font-size: 16px; letter-spacing: 0.08em; }
.brand small { color: var(--muted); font: 600 9px/1 Arial, sans-serif; letter-spacing: 0.18em; }
.brand-symbol { width: 36px; height: 36px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; transform: rotate(2deg); }
.brand-symbol i { display: block; background: var(--navy); border-radius: 1px; }
.brand-symbol i:nth-child(2), .brand-symbol i:nth-child(3) { background: var(--orange); }
.demo-label { border: 1px solid var(--navy); padding: 7px 13px; color: var(--navy); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; }

main { min-height: calc(100vh - 76px); }
.intro { position: relative; min-height: 300px; padding: 72px max(32px, calc((100vw - 1180px) / 2)) 64px; background: var(--paper); color: var(--ink); isolation: isolate; }
.intro::before { content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: max(31vw, calc((100vw - 1180px) / 2 + 330px)); background: var(--navy); }
.intro::after { content: ""; position: absolute; left: max(32px, calc((100vw - 1180px) / 2)); top: 72px; width: 46px; height: 4px; background: var(--orange); }
.intro-copy { max-width: 720px; padding-top: 28px; }
.intro-index { display: inline-block; color: var(--navy); font: 700 10px/1 Arial, sans-serif; letter-spacing: 0.2em; }
.intro-kicker { margin: 30px 0 14px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.09em; }
.intro h1 { max-width: 680px; margin: 0; font-size: clamp(40px, 4.6vw, 60px); line-height: 1.25; letter-spacing: 0.01em; }
.intro h1 em { color: var(--ink); font-style: normal; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 4px; text-underline-offset: 9px; }
.intro-copy > p:last-child { max-width: 620px; margin: 30px 0 0; padding-left: 20px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 2; }
.intro-note { align-self: center; padding: 8px 0 8px 26px; border-left: 1px solid rgba(255,255,255,.3); color: white; }
.intro-note > span { color: #bfc7cc; font: 700 9px/1 Arial, sans-serif; letter-spacing: .2em; }
.intro-note dl { margin: 15px 0 0; }
.intro-note dl div { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: baseline; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.13); }
.intro-note dt { color: #e49a7f; font: 700 11px Arial, sans-serif; }
.intro-note dd { margin: 0; font-size: 13px; font-weight: 700; }

.workflow { position: relative; z-index: 2; width: min(1180px, calc(100% - 48px)); min-height: 66px; display: flex; align-items: center; justify-content: flex-start; margin: 0 auto; padding: 0 2px; border-bottom: 1px solid var(--line); background: var(--paper); }
.workflow-step { display: flex; align-items: center; gap: 10px; color: #9a9ca4; white-space: nowrap; }
.workflow-step > span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #b8b9b7; font: 700 9px Arial, sans-serif; }
.workflow-step b { font-size: 12px; letter-spacing: .06em; }
.workflow-step.active { color: var(--navy); }
.workflow-step.active > span { background: var(--navy); border-color: var(--navy); color: white; }
.workflow-step.done { color: var(--success); }
.workflow-step.done > span { background: var(--success); border-color: var(--success); color: white; }
.workflow > i { width: 82px; height: 1px; margin: 0 22px; background: #cbc8c0; }

.workspace { width: min(1180px, calc(100% - 48px)); margin: 48px auto 90px; }
.work-card { background: white; border: 1px solid var(--line); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 34px 38px 30px; border-bottom: 1px solid var(--line); }
.section-heading > div:first-child > span { color: var(--orange); font: 700 10px Arial, sans-serif; letter-spacing: .2em; }
.section-heading h2 { margin: 0; font-size: 25px; letter-spacing: .04em; }
.section-heading h2 + p { margin-top: 9px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.mode-tabs { display: flex; border: 1px solid var(--line); background: var(--paper-deep); }
.mode-tabs button { min-width: 160px; padding: 13px 20px; border: 0; background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; text-align: center; }
.mode-tabs button small { display: block; margin-bottom: 4px; color: #898b91; font: 700 8px Arial, sans-serif; letter-spacing: .14em; }
.mode-tabs button + button { border-left: 1px solid var(--line); }
.mode-tabs button.active { background: var(--navy); color: white; }
.mode-tabs button.active small { color: #c4c8d5; }

.selection-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); min-height: 505px; }
.selection-grid > div:first-child { padding: 38px; border-right: 1px solid var(--line); }
.field-label { margin: 0 0 14px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.sample-list { display: grid; gap: 10px; }
.sample-card { position: relative; width: 100%; min-height: 96px; display: grid; grid-template-columns: 42px 1fr auto 22px; gap: 14px; align-items: center; padding: 18px; border: 1px solid var(--line); background: white; cursor: pointer; text-align: left; transition: border-color .18s, background .18s, box-shadow .18s; }
.sample-card:hover { border-color: #929692; background: #fbfaf7; }
.sample-card.selected { border-color: var(--navy); background: #f5f4f0; box-shadow: inset 4px 0 0 var(--orange); }
.sample-number { align-self: start; color: var(--orange); font: 700 11px Arial, sans-serif; }
.sample-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sample-copy b { font-size: 14px; }
.sample-copy small { overflow: hidden; color: #5d606b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sample-copy em { color: #909198; font-size: 10px; font-style: normal; }
.sample-filetype { padding: 5px 7px; border: 1px solid #d4d2cc; background: #f3f1ec; color: #74767d; font: 700 9px/1 Arial, sans-serif; letter-spacing: .1em; }
.radio-mark { width: 18px; height: 18px; border: 1px solid #b8b7b3; border-radius: 50%; }
.selected .radio-mark { border: 5px solid var(--orange); }

.document-stage { min-width: 0; display: grid; place-items: center; padding: 30px; overflow: hidden; background: #dedbd3; }
.empty-document { max-width: 250px; color: #74767d; text-align: left; }
.empty-sheet { position: relative; width: 92px; height: 118px; display: flex; flex-direction: column; gap: 10px; margin: 0 0 20px; padding: 31px 17px; background: rgba(255,255,255,.66); border: 1px solid #bdbbb4; }
.empty-sheet::after { content: "+"; position: absolute; right: -12px; bottom: -12px; width: 28px; height: 28px; display: grid; place-items: center; background: var(--orange); color: white; font-size: 20px; }
.empty-sheet i { height: 2px; background: #c8c6c1; }
.empty-document b { display: block; color: #555860; font-size: 14px; }
.empty-document p { margin: 8px 0 0; font-size: 11px; line-height: 1.8; }

.action-row { display: flex; align-items: center; justify-content: space-between; padding: 18px 38px; border-bottom: 1px solid var(--line); background: #faf9f6; transition: background .18s, box-shadow .18s; }
.action-row.is-ready { background: #fff9f5; box-shadow: inset 4px 0 0 var(--orange); }
.action-row p { margin: 0; color: var(--muted); font-size: 12px; }
.action-row p b { color: var(--ink); }
.ready-dot { width: 7px; height: 7px; display: inline-block; margin-right: 8px; background: var(--success); }
.primary-button, .download-button { border: 0; background: var(--orange); color: white; cursor: pointer; font-size: 13px; font-weight: 700; letter-spacing: .05em; }
.primary-button { min-width: 230px; min-height: 58px; display: inline-flex; align-items: center; justify-content: center; gap: 11px; padding: 15px 22px; border-radius: 10px; box-shadow: 0 8px 22px rgba(196,93,59,.3); text-align: center; transition: background .18s, box-shadow .18s, transform .18s; }
.primary-button span { padding: 0; }
.primary-button .analyze-icon { width: 25px; height: 25px; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.82); border-radius: 50%; font-size: 0; }
.primary-button .analyze-icon::after { content: ""; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; }
.primary-button i { display: inline; margin-left: 2px; font: normal 18px/1 Arial, sans-serif; transition: transform .18s; }
.primary-button:hover:not(:disabled), .download-button:hover { background: #ad4827; }
.primary-button:hover:not(:disabled) { box-shadow: 0 10px 26px rgba(173,72,39,.35); transform: translateY(-2px); }
.primary-button:hover:not(:disabled) i { transform: translateX(3px); }
.primary-button:active:not(:disabled) { box-shadow: 0 4px 12px rgba(173,72,39,.28); transform: translateY(0); }
.primary-button:focus-visible { outline: 4px solid rgba(196,93,59,.3); outline-offset: 4px; }
.primary-button:disabled { background: #b8b6b1; box-shadow: none; cursor: not-allowed; opacity: .72; transform: none; }
.spotlight-overlay { position: fixed; z-index: 1000; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(19, 23, 34, .66); cursor: pointer; animation: spotlight-fade-in .24s ease-out both; }
.spotlight-overlay[data-guide-step="1"] { cursor: default; }
.sample-list.spotlight-target, .primary-button.spotlight-target { position: relative; z-index: 1001; }
.guide-callout { position: fixed; z-index: 1002; width: min(360px, calc(100vw - 32px)); padding: 20px; border-top: 4px solid var(--orange); background: white; color: var(--ink); box-shadow: 0 18px 48px rgba(2,8,20,.38); animation: guide-in .18s ease-out both; }
.guide-callout::before { content: ""; position: absolute; left: calc(50% - 8px); width: 16px; height: 16px; background: white; transform: rotate(45deg); }
.guide-callout[data-position="below"]::before { top: -8px; }
.guide-callout[data-position="above"]::before { bottom: -8px; }
.guide-step { display: block; margin-bottom: 7px; color: var(--orange); font: 700 10px Arial, sans-serif; letter-spacing: .14em; }
.guide-callout strong { display: block; font-size: 17px; }
.guide-callout p { margin: 8px 0 0; color: #626b6f; font-size: 12px; line-height: 1.7; }
.guide-callout button { display: block; min-width: 92px; height: 38px; margin: 16px 0 0 auto; border: 0; background: var(--orange); color: white; cursor: pointer; font-size: 12px; font-weight: 700; }
.guide-callout button:hover:not(:disabled) { background: #ad4827; }
.guide-callout button:focus-visible { outline: 3px solid rgba(196,93,59,.3); outline-offset: 2px; }
.guide-callout button:disabled { background: #b8b6b1; cursor: not-allowed; opacity: .72; }
@keyframes spotlight-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes guide-in { from { opacity: 0; transform: translateY(5px); } }

.paper { position: relative; width: 100%; overflow: hidden; background: #fffefa; color: #22262f; box-shadow: 0 12px 28px rgba(28,31,44,.17); font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; }
.paper-mark { position: absolute; right: 13px; bottom: 10px; z-index: 2; padding: 3px 7px; border: 2px solid rgba(180,55,47,.32); color: rgba(180,55,47,.38); font: 700 12px Arial, sans-serif; letter-spacing: .18em; transform: rotate(-7deg); }
.paper.unread { filter: saturate(.72) contrast(.94); }
.unread-label { position: absolute; z-index: 4; top: 50%; left: 50%; display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid rgba(45,52,69,.18); background: rgba(255,255,255,.94); color: #626670; box-shadow: 0 4px 14px rgba(30,34,45,.1); font: 700 8px Arial, sans-serif; letter-spacing: .1em; transform: translate(-50%, -50%); white-space: nowrap; }
.unread-label span { padding: 4px 5px; background: var(--navy); color: white; font-size: 7px; }
.invoice-paper { max-width: 430px; aspect-ratio: .73; padding: 8% 8%; }
.invoice-heading { display: flex; flex-direction: column; align-items: center; padding-bottom: 5%; border-bottom: 2px solid #343946; }
.invoice-heading span { font: 700 7px Arial, sans-serif; letter-spacing: .35em; }
.invoice-heading strong { margin-top: 5px; font-size: 19px; letter-spacing: .4em; }
.invoice-meta { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 7% 0 5%; font-size: 7px; }
.invoice-meta > div { display: flex; flex-direction: column; gap: 5px; }
.invoice-meta b { font-size: 8px; border-bottom: 1px solid #454a55; padding-bottom: 5px; }
.invoice-meta > div:last-child { color: #5d616a; text-align: right; }
.invoice-total { display: flex; align-items: baseline; gap: 9px; padding: 4% 5%; background: #f0ede6; border-left: 3px solid var(--navy); }
.invoice-total span { font-size: 8px; }
.invoice-total strong { margin-left: auto; font: 700 17px Arial, sans-serif; }
.invoice-total small { font-size: 6px; }
.paper-table { width: 100%; margin-top: 7%; border-collapse: collapse; font-size: 7px; }
.paper-table th, .paper-table td { padding: 7px 5px; border: 1px solid #bab9b4; text-align: left; }
.paper-table th { background: #41495e; color: white; font-weight: 400; }
.paper-table th:nth-child(n+2), .paper-table td:nth-child(n+2) { text-align: right; }
.masked-row i { display: inline-block; width: 68%; height: 5px; border-radius: 4px; background: #d4d2cc; }
.masked-row td:nth-child(n+2) i { width: 74%; }
.invoice-footer { position: absolute; left: 8%; right: 8%; bottom: 8%; display: flex; justify-content: space-between; padding-top: 6px; border-top: 1px solid #c7c5bf; font-size: 7px; }
.invoice-footer span:first-child { font-weight: 700; }
.receipt-paper { max-width: 430px; min-height: 490px; padding: 7%; background: #fdfbf3; }
.receipt-heading { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 10px; border-bottom: 2px solid #333844; }
.receipt-heading b { font-size: 16px; letter-spacing: .1em; }
.receipt-heading span { font: 700 7px Arial, sans-serif; }
.receipt-slip { width: 85%; margin: 13px auto 0; padding: 12px 16px; background: white; border: 1px dashed #9e9c96; transform: rotate(-.5deg); }
.receipt-slip:nth-child(2n) { transform: rotate(.7deg); }
.receipt-slip > div { display: flex; justify-content: space-between; }
.receipt-slip b { font-size: 9px; }
.receipt-slip small, .receipt-slip p, .receipt-slip span { color: #6d6b66; font-size: 7px; }
.receipt-slip p { margin: 5px 0; }
.receipt-slip strong { display: block; padding-top: 7px; border-top: 1px dotted #aaa7a0; font: 700 12px Arial, sans-serif; text-align: right; }
.receipt-slip > span { display: block; margin-top: 3px; text-align: right; }
.masked-slip p { min-height: 7px; }
.masked-slip p i { display: block; width: 62%; height: 5px; border-radius: 4px; background: #d2d0c9; }
.masked-slip p:nth-of-type(2) i { width: 82%; }
.masked-slip.secondary-slip { margin-top: 18px; transform: rotate(1.4deg); }
.receipt-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; padding: 11px 13px; background: #343b50; color: white; }
.receipt-total span { font-size: 8px; }
.receipt-total b { font: 700 15px Arial, sans-serif; }
.paper.compact { max-width: 320px; min-height: 0; }
.invoice-paper.compact { aspect-ratio: .73; }
.receipt-paper.compact { padding: 6%; }
.receipt-paper.compact .receipt-slip { margin-top: 8px; padding: 8px 12px; }
.receipt-paper.compact .receipt-total { margin-top: 10px; }

.analysis-card { min-height: 590px; }
.compact-heading { align-items: center; }
.analysis-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 440px; }
.scan-preview { position: relative; display: grid; place-items: center; overflow: hidden; padding: 30px; background: #e5e3dd; border-right: 1px solid var(--line); }
.scan-preview::after { content: ""; position: absolute; inset: 0; background: rgba(41,49,79,.11); }
.scan-line { position: absolute; z-index: 3; left: 18%; right: 18%; height: 2px; background: #f1a06f; box-shadow: 0 0 18px 5px rgba(220,107,50,.35); animation: scan 2.25s ease-in-out infinite; }
.scan-frame { position: absolute; z-index: 2; inset: 8%; border: 1px solid rgba(255,255,255,.55); pointer-events: none; }
.scan-frame::before, .scan-frame::after { content: ""; position: absolute; width: 22px; height: 22px; border-color: var(--orange); }
.scan-frame::before { top: -1px; left: -1px; border-top: 2px solid var(--orange); border-left: 2px solid var(--orange); }
.scan-frame::after { right: -1px; bottom: -1px; border-right: 2px solid var(--orange); border-bottom: 2px solid var(--orange); }
@keyframes scan { 0%,100% { top: 18%; } 50% { top: 82%; } }
.analysis-status { align-self: center; padding: 55px 65px; }
.analysis-kicker { color: var(--orange); font: 700 9px Arial, sans-serif; letter-spacing: .2em; }
.progress-copy { display: flex; justify-content: flex-end; align-items: baseline; }
.progress-copy span { color: var(--orange); font: 700 10px Arial, sans-serif; letter-spacing: .2em; }
.progress-copy strong { color: var(--navy); font: 700 32px Arial, sans-serif; }
.progress-track { height: 5px; margin: 14px 0 30px; overflow: hidden; background: #e5e3de; }
.progress-track i { display: block; height: 100%; background: var(--orange); transition: width .08s linear; }
.analysis-status .current-status { min-height: 21px; margin: -14px 0 18px; color: var(--navy); font-size: 12px; font-weight: 700; }
.analysis-status ul { margin: 0; padding: 0; list-style: none; }
.analysis-status li { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #e4e2dc; color: #a1a2a6; font-size: 13px; }
.analysis-status li span { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #c8c8c5; border-radius: 50%; color: white; font-size: 10px; }
.analysis-status li.complete { color: var(--ink); font-weight: 700; }
.analysis-status li.complete span { background: var(--success); border-color: var(--success); }
.analysis-status > p { margin: 24px 0 0; color: var(--muted); font-size: 10px; }

.results-section { scroll-margin-top: 20px; }
.result-heading { padding: 10px 0 26px; border: 0; }
.complete-tag { padding: 9px 13px; background: var(--success-soft); color: var(--success); font-size: 11px; font-weight: 700; }
.complete-tag i { margin-right: 5px; font-style: normal; }
.result-document-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); background: white; border: 1px solid var(--line); }
.source-card { padding: 22px; background: #e5e3dd; border-right: 1px solid var(--line); }
.source-card > div:first-child { display: flex; justify-content: space-between; margin-bottom: 16px; color: #555860; font-size: 10px; }
.source-card > div:first-child span { font-weight: 700; letter-spacing: .1em; }
.source-card .paper { box-shadow: 0 8px 20px rgba(20,22,30,.16); }
.source-card .invoice-paper { aspect-ratio: .73; }
.source-card .receipt-paper { min-height: 420px; padding: 5%; }
.source-card .receipt-slip { margin-top: 8px; padding: 8px 10px; }
.source-card .receipt-total { margin-top: 10px; }
.result-data-card { min-width: 0; background: white; }
.table-toolbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); }
.table-toolbar > div { display: flex; align-items: center; gap: 10px; }
.table-toolbar b { font-size: 14px; }
.table-toolbar span { padding: 3px 7px; background: var(--paper-deep); color: var(--muted); font-size: 10px; }
.table-toolbar p { margin: 0; color: var(--muted); font-size: 10px; }
.table-toolbar p i { color: var(--orange); font-style: normal; }
.result-table-wrap { overflow-x: auto; }
.result-table { width: 100%; min-width: 810px; border-collapse: collapse; }
.result-table th { height: 44px; padding: 0 9px; background: #f5f3ee; border-right: 1px solid #e1dfda; color: #686a72; font-size: 10px; text-align: left; white-space: nowrap; }
.result-table th:first-child { width: 42px; text-align: center; }
.result-table th:nth-child(2) { width: 126px; }
.result-table th:nth-child(3) { width: 170px; }
.result-table th:nth-child(4) { width: 190px; }
.result-table th:nth-child(5) { width: 115px; }
.result-table th:nth-child(6) { width: 68px; }
.result-table th:last-child { width: 120px; }
.result-table td { height: 66px; padding: 7px 6px; border-right: 1px solid #eceae5; border-bottom: 1px solid #dedcd6; }
.result-table td:first-child { text-align: center; }
.row-number { color: #9b9b9b; font: 700 9px Arial, sans-serif; }
.input-shell { position: relative; }
.input-shell input { width: 100%; min-width: 0; padding: 9px 8px; border: 1px solid transparent; background: transparent; color: var(--ink); font-size: 11px; }
.input-shell input:hover { border-color: #d9d6ce; background: #faf9f6; }
.input-shell input:focus { border-color: var(--orange); outline: 0; background: white; box-shadow: 0 0 0 2px var(--orange-soft); }
.numeric-cell input { text-align: right; }
.money-input::before { content: "¥"; position: absolute; z-index: 1; left: 8px; top: 50%; color: #8c8d91; font: 11px Arial, sans-serif; transform: translateY(-50%); }
.money-input input { padding-left: 19px; }
.tax-input::after { content: "%"; position: absolute; right: 8px; top: 50%; color: #8c8d91; font: 10px Arial, sans-serif; transform: translateY(-50%); }
.tax-input input { padding-right: 18px; }
.result-table tfoot td { height: 58px; padding: 0 14px; background: var(--navy); border: 0; color: white; font-size: 11px; font-weight: 700; text-align: right; }
.result-table tfoot td:last-child { color: #f3ad82; font: 700 18px Arial, sans-serif; }

.validation-panel { display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; margin-top: 18px; padding: 27px 32px; border: 1px solid; }
.validation-panel.match { background: var(--success-soft); border-color: #c7d3c6; }
.validation-panel.mismatch { background: var(--danger-soft); border-color: #e0b9b1; }
.validation-title { display: flex; align-items: center; gap: 14px; }
.validation-title > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--success); color: white; font-weight: 700; }
.mismatch .validation-title > span { background: var(--danger); }
.validation-title small { color: var(--muted); font: 700 8px Arial, sans-serif; letter-spacing: .17em; }
.validation-title h3 { margin: 0; font-size: 17px; }
.validation-title > b { margin-left: 8px; padding: 5px 8px; background: white; color: var(--success); font-size: 9px; letter-spacing: .08em; }
.mismatch .validation-title > b { color: var(--danger); }
.validation-numbers { display: grid; grid-template-columns: 1fr 30px 1fr .75fr; align-items: center; }
.validation-numbers > div { padding: 0 20px; border-left: 1px solid rgba(73,96,78,.2); }
.validation-numbers span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; }
.validation-numbers strong { font: 700 19px Arial, sans-serif; }
.validation-numbers > i { text-align: center; font: normal 19px serif; }
.validation-numbers .difference strong { color: var(--success); }
.mismatch .validation-numbers .difference strong { color: var(--danger); }

.result-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.export-panel { width: min(420px, 100%); padding: 31px 34px; background: white; border: 1px solid var(--line); }
.export-panel small { color: var(--orange); font: 700 9px Arial, sans-serif; letter-spacing: .18em; }
.export-panel h3 { margin: 0; font-size: 19px; }
.export-panel p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.export-panel { display: flex; flex-direction: column; }
.export-panel dl { margin: 18px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.export-panel dl div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 10px; }
.export-panel dt { color: var(--muted); }
.export-panel dd { margin: 0; font-weight: 700; }
.download-button { width: 100%; padding: 14px 17px; text-align: center; }
.download-button span { padding: 0; }
.download-button i { display: none; }
.text-button { align-self: center; margin-top: 13px; padding: 4px; border: 0; border-bottom: 1px solid #aaa9a5; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }

footer { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 24px max(28px, calc((100vw - 1180px) / 2)); background: var(--navy-deep); color: white; }
footer > div { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.brand-symbol.small { width: 24px; height: 24px; }
.brand-symbol.small i { background: white; }
.brand-symbol.small i:nth-child(2), .brand-symbol.small i:nth-child(3) { background: #f3a274; }
footer p { margin: 0; color: #bfc3cf; font-size: 10px; line-height: 1.6; text-align: right; }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 10px; padding: 13px 18px; background: var(--navy-deep); color: white; box-shadow: 0 10px 30px rgba(22,25,37,.25); font-size: 12px; font-weight: 700; opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast span { color: #f2a374; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 960px) {
  .intro { min-height: 250px; padding-top: 62px; padding-bottom: 54px; }
  .intro::before { width: 24%; }
  .intro::after { top: 62px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .mode-tabs { width: 100%; }
  .mode-tabs button { flex: 1; min-width: 0; }
  .selection-grid { grid-template-columns: 1fr; }
  .selection-grid > div:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .document-stage { min-height: 460px; }
  .analysis-layout { grid-template-columns: 1fr; }
  .scan-preview { min-height: 430px; border-right: 0; border-bottom: 1px solid var(--line); }
  .result-document-grid { grid-template-columns: 1fr; }
  .source-card { display: none; }
  .validation-panel { grid-template-columns: 1fr; gap: 22px; }
  .result-actions { display: block; }
  .export-panel { width: 100%; }
}

@media (max-width: 640px) {
  .site-header { height: 66px; padding: 0 18px; }
  .brand-symbol { width: 30px; height: 30px; }
  .brand b { font-size: 13px; }
  .demo-label { padding: 6px 8px; font-size: 9px; }
  .intro { min-height: 220px; padding: 52px 22px 44px; }
  .intro::after { left: 22px; top: 52px; width: 38px; }
  .intro-copy { padding-top: 25px; }
  .intro h1 { font-size: 36px; }
  .intro-copy > p:last-child { font-size: 12px; }
  .workflow { width: calc(100% - 28px); padding: 0 13px; }
  .workflow-step { gap: 6px; }
  .workflow-step b { display: none; }
  .workflow > i { width: 45px; margin: 0 10px; }
  .workspace { width: calc(100% - 24px); margin-top: 30px; }
  .section-heading { padding: 25px 20px; }
  .section-heading h2 { font-size: 21px; }
  .mode-tabs { flex-direction: column; }
  .mode-tabs button + button { border-top: 1px solid var(--line); border-left: 0; }
  .selection-grid > div:first-child { padding: 24px 20px; }
  .sample-card { grid-template-columns: 28px 1fr 20px; padding: 14px; }
  .sample-filetype { grid-column: 2; justify-self: start; }
  .radio-mark { grid-column: 3; grid-row: 1 / 3; }
  .document-stage { min-height: 390px; padding: 24px; }
  .action-row { align-items: stretch; flex-direction: column; gap: 16px; padding: 20px; }
  .primary-button { width: 100%; }
  .analysis-status { padding: 40px 26px; }
  .scan-preview { min-height: 380px; padding: 24px; }
  .result-heading { padding-left: 6px; padding-right: 6px; }
  .complete-tag { align-self: flex-start; }
  .validation-panel { padding: 24px 20px; }
  .validation-title { flex-wrap: wrap; }
  .validation-title > b { margin-left: 0; }
  .validation-numbers { grid-template-columns: 1fr 24px 1fr; }
  .validation-numbers > div { padding: 0 9px; }
  .validation-numbers .difference { grid-column: 1 / -1; margin-top: 18px; padding-top: 15px; border-top: 1px solid rgba(73,96,78,.2); border-left: 0; text-align: center; }
  .validation-numbers strong { font-size: 15px; }
  .export-panel { padding: 26px 20px; }
  footer { align-items: flex-start; flex-direction: column; padding: 26px 22px; }
  footer p { text-align: left; }
}

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