:root {
  --paper: #f3f6fb; --surface: #fff; --ink: #152942; --muted: #52647c; --line: #d8e0ec;
  --blue: #2353db; --blue-dark: #193fae; --blue-soft: #eef3ff;
  --green: #216450; --green-soft: #eef8f3; --red: #a52c38; --red-soft: #fff1f2;
  --amber: #805315; --amber-soft: #fff8e9;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Avenir Next", "Segoe UI", -apple-system, sans-serif;
  --font-data: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); line-height: 1.55; min-width: 320px; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-underline-offset: .2em; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
svg { display: block; flex: 0 0 auto; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { font-family: var(--font-heading); letter-spacing: -.025em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 10; top: 10px; left: 16px; padding: 12px 18px; color: white; background: var(--ink); transform: translateY(-180%); border-radius: 6px; }
.skip-link:focus { transform: none; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1184px; margin: auto; padding: 21px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; letter-spacing: -.025em; }
.brand-connector { color: var(--muted); font-weight: 500; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 10px; }
.brand-mark svg { width: 27px; height: 27px; }
.header-context { color: var(--muted); font-size: .85rem; }
.page-shell { max-width: 1184px; margin: auto; padding: 48px 32px 68px; }
.page-heading { max-width: 760px; }
.eyebrow { color: var(--muted); font-size: .77rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
h1 { font-size: clamp(1.95rem, 3.2vw, 2.8rem); line-height: 1.17; font-weight: 650; }
.lead { color: var(--muted); margin-top: 15px; font-size: 1.04rem; line-height: 1.7; max-width: 680px; }
.workflow { margin: 34px 0 28px; }
.workflow ol { display: flex; align-items: center; list-style: none; padding: 0; margin: 0; max-width: 550px; }
.workflow li { flex: 1; display: flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 600; color: var(--muted); position: relative; }
.workflow li:not(:last-child)::after { content: ""; height: 1px; background: var(--line); flex: 1; margin: 0 17px 0 7px; }
.step-number { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid #becadd; font-size: .8rem; color: var(--muted); background: var(--paper); }
.workflow .is-current { color: var(--ink); }
.is-current .step-number { color: white; border-color: var(--blue); background: var(--blue); }
.is-complete .step-number { color: var(--green); border-color: #bcdccc; background: var(--green-soft); }
.upload-panel, .preview-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 24px #15294205; overflow: hidden; }
.panel-heading { padding: 28px 32px 0; }
h2 { font-size: 1.25rem; font-weight: 650; line-height: 1.4; }
.panel-heading p { color: var(--muted); margin-top: 6px; font-size: .92rem; }
.upload-fields { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 40px; padding: 27px 32px 31px; }
.field-label { display: block; margin-bottom: 10px; font-weight: 650; font-size: .94rem; }
.drop-zone { padding: 27px 24px 25px; text-align: center; border: 1.5px dashed #a8b9d1; border-radius: 10px; background: #f8faff; transition: background .15s ease, border-color .15s ease; }
.drop-zone.is-dragging { border-color: var(--blue); background: var(--blue-soft); }
.upload-icon { width: 43px; height: 43px; margin: 0 auto 13px; color: var(--blue); }
.drop-title { font-size: .95rem; font-weight: 650; }
.drop-hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
input[type="file"] { max-width: 100%; display: block; margin: 17px auto 0; color: var(--muted); font-size: .84rem; cursor: pointer; }
input[type="file"]::file-selector-button { padding: 9px 14px; margin-right: 10px; border: 1px solid #bfcee4; border-radius: 6px; color: var(--ink); background: white; font-family: var(--font-body); font-weight: 600; cursor: pointer; min-height: 42px; }
input[type="file"]::file-selector-button:hover { border-color: var(--blue); background: var(--blue-soft); }
.selected-file { margin-top: 12px; display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 8px; border: 1px solid #bfd3ed; background: #f8faff; }
.file-mark { font-family: var(--font-data); font-size: .68rem; color: var(--blue); font-weight: 700; border: 1px solid #bdcef8; padding: 7px 5px; border-radius: 4px; }
.selected-file-text { flex: 1; min-width: 0; font-size: .81rem; }
.selected-file-text strong { display: block; overflow-wrap: anywhere; font-weight: 600; }
.selected-file-text span { display: block; color: var(--muted); margin-top: 2px; }
.text-button { border: 0; background: transparent; color: var(--blue); padding: 10px 5px; text-decoration: underline; text-underline-offset: 3px; }
.remove-file { font-size: .8rem; min-height: 44px; }
.field-help { color: var(--muted); font-size: .82rem; line-height: 1.6; margin-top: 10px; }
.field-error { color: var(--red); font-size: .84rem; display: block; margin-top: 7px; }
.field-error:empty { display: none; }
.number-input { width: 100%; height: 51px; padding: 10px 14px; border: 1px solid #a9b9cf; border-radius: 7px; background: white; color: var(--ink); font-size: 1.15rem; font-family: var(--font-data); }
.number-input::placeholder { color: #78869a; font-family: var(--font-body); font-size: .95rem; }
.number-input:focus { border-color: var(--blue); }
.input-validation-error { border-color: var(--red) !important; }
.number-example { margin-top: 25px; border-top: 1px solid var(--line); padding-top: 20px; }
.number-example > span { font-size: .73rem; color: var(--muted); }
.number-example > div { display: flex; align-items: center; gap: 11px; margin-top: 10px; }
.number-example strong { font-size: .85rem; font-weight: 600; }
.example-lines { display: flex; flex-direction: column; gap: 5px; width: 31px; }
.example-lines i { display: block; height: 7px; border-radius: 2px; background: #d5e2fd; border-left: 3px solid var(--blue); }
.number-example p { color: var(--muted); font-size: .79rem; margin: 8px 0 0 42px; }
.panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 23px 32px; border-top: 1px solid var(--line); background: #fbfcfe; }
.privacy-note { display: flex; align-items: flex-start; gap: 9px; max-width: 370px; font-size: .79rem; color: var(--muted); line-height: 1.6; }
.privacy-note svg { width: 18px; height: 18px; margin-top: 1px; }
.button { min-height: 49px; border: 1px solid transparent; border-radius: 7px; padding: 12px 19px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; text-decoration: none; font-size: .91rem; font-weight: 650; white-space: nowrap; transition: background .15s ease; }
.button svg { width: 20px; height: 20px; }
.button-primary { background: var(--blue); color: white; box-shadow: 0 2px 2px #15294208; }
.button-primary:hover { background: var(--blue-dark); }
.button-primary:disabled { opacity: .72; }
.button-secondary { color: var(--blue); background: white; border-color: #bdcbed; }
.button-secondary:hover { background: var(--blue-soft); border-color: var(--blue); }
.after-panel-note { display: flex; align-items: flex-start; justify-content: center; gap: 8px; color: var(--muted); font-size: .8rem; margin-top: 20px; }
.small-check { color: var(--green); font-weight: 700; }
.notice { border: 1px solid; border-radius: 9px; padding: 18px 22px; margin: 0 0 24px; font-size: .9rem; }
.notice-error { background: var(--red-soft); border-color: #ebc1c6; color: var(--red); }
.notice-title, .notice h3 { font-weight: 700; font-size: .98rem; margin-bottom: 6px; }
.notice ul { margin: 6px 0 0; padding-left: 21px; }
.notice li + li { margin-top: 5px; }
.notice p { margin-top: 8px; }
.validation-summary-valid { display: none; }
.notice-warning { background: var(--amber-soft); color: var(--amber); border-color: #ecd4a5; margin: 0 28px 25px; }
.preview-heading { padding: 27px 28px 23px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.preview-heading .eyebrow { margin-bottom: 5px; }
.source-name { max-width: 650px; font-family: var(--font-data); font-size: .85rem; line-height: 1.8; overflow-wrap: anywhere; letter-spacing: -.015em; }
.status-positive { display: inline-flex; align-items: center; gap: 7px; font-size: .77rem; font-weight: 600; line-height: 1.5; color: var(--green); background: var(--green-soft); padding: 7px 10px; border-radius: 5px; margin-top: 5px; flex-shrink: 0; }
.summary-grid { margin: 0 28px; display: grid; grid-template-columns: 1.3fr 1fr 1fr; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.summary-grid > div { padding: 18px 23px; }
.summary-grid > div + div { border-left: 1px solid var(--line); }
.summary-grid dt { color: var(--muted); font-size: .76rem; margin-bottom: 6px; }
.summary-grid dd { margin: 0; font-size: 1.12rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.8; }
.summary-grid > div:first-child dd { font-size: .94rem; padding-top: 2px; }
.summary-detail { display: block; font-weight: 400; font-size: .74rem; color: var(--muted); line-height: 1.5; }
.date-separator { color: #8090a5; margin: 0 7px; font-weight: 400; }
.number-range { font-family: var(--font-data); }
.numbering-note { display: flex; align-items: flex-start; gap: 9px; margin: 19px 29px 19px; color: var(--muted); font-size: .8rem; max-width: 850px; }
.numbering-note svg { width: 18px; height: 18px; margin-top: 1px; }
.renumber-form { padding: 0 28px 26px; }
.renumber-form .field-label { font-size: .78rem; color: var(--muted); font-weight: 500; margin-bottom: 7px; }
.renumber-controls { display: flex; align-items: center; gap: 10px; }
.renumber-controls .number-input { width: 150px; height: 44px; font-size: .95rem; }
.renumber-controls .button { min-height: 44px; padding: 9px 13px; font-size: .79rem; }
.table-heading { padding: 0 28px 13px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.table-heading h3 { font-size: 1rem; font-weight: 650; }
.table-heading > span { font-size: .76rem; color: var(--muted); }
.table-scroll-hint { display: none; }
.table-scroll { overflow: auto; max-height: 520px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overscroll-behavior: contain; }
.preview-table { border-collapse: separate; border-spacing: 0; text-align: left; font-size: .79rem; width: 100%; min-width: 900px; }
.preview-table th { font-size: .71rem; color: var(--muted); font-weight: 650; padding: 12px 13px; white-space: nowrap; background: #f4f7fc; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.preview-table td { padding: 10px 13px; border-bottom: 1px solid #edf1f6; vertical-align: top; line-height: 1.7; }
.preview-table th:first-child, .preview-table td:first-child { padding-left: 28px; }
.preview-table th:last-child, .preview-table td:last-child { padding-right: 28px; }
.preview-table tr:last-child td { border-bottom: 0; }
.preview-table .transaction-start td { border-top: 1px solid #cbd6e5; }
.preview-table .voucher-column { background: #f3f6ff; color: #234caf; }
.preview-table th.voucher-column { background: #e9efff; }
.preview-table td.voucher-column { font-weight: 650; }
.preview-table .description-column { min-width: 260px; }
.preview-table .amount-column { text-align: right; min-width: 130px; white-space: nowrap; }
.mono { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.balance-strip { padding: 17px 28px; display: flex; justify-content: flex-end; gap: 26px; background: #fbfcfe; font-size: .75rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.balance-strip strong { font-weight: 600; font-family: var(--font-data); color: var(--ink); margin-left: 7px; }
.balance-strip .balance-result, .balance-strip .balance-result strong { color: var(--green); }
.download-area { padding: 26px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.download-area h3 { font-size: 1.12rem; }
.download-area p { font-size: .83rem; color: var(--muted); margin-top: 4px; }
.file-extension { font-size: .74rem; color: #d7e1ff; font-weight: 400; border-left: 1px solid #ffffff50; padding-left: 12px; }
.preview-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 25px; margin-top: 21px; }
.back-link { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.preview-footer p { font-size: .77rem; color: var(--muted); padding-top: 12px; text-align: right; }
.site-footer { max-width: 1184px; margin: auto; padding: 0 32px 30px; display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: .73rem; color: var(--muted); }
.site-footer span:first-child { font-weight: 600; }
@media (max-width: 900px) {
  .upload-fields { gap: 27px; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); }
  .preview-heading { flex-direction: column; gap: 9px; }
  .status-positive { margin-top: 0; }
  .summary-grid { grid-template-columns: 1.35fr 1fr 1fr; }
  .summary-grid > div { padding: 16px; }
  .summary-grid > div:first-child dd { font-size: .82rem; }
  .summary-grid .date-separator { margin: 0 4px; }
  .download-area { align-items: flex-start; }
}
@media (max-width: 680px) {
  .header-inner { padding: 17px 20px; }
  .header-context { font-size: .74rem; }
  .brand { font-size: 1.02rem; gap: 9px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 8px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .page-shell { padding: 31px 18px 42px; }
  h1 { font-size: 2rem; }
  .lead { font-size: .95rem; margin-top: 12px; }
  .workflow { margin: 26px 0 23px; }
  .workflow li { font-size: .79rem; gap: 7px; }
  .workflow li:not(:last-child)::after { margin: 0 10px; min-width: 6px; }
  .step-number { width: 27px; height: 27px; font-size: .73rem; flex-shrink: 0; }
  .panel-heading { padding: 23px 22px 0; }
  .panel-heading h2 { font-size: 1.1rem; }
  .panel-heading p { font-size: .84rem; }
  .upload-fields { grid-template-columns: minmax(0,1fr); padding: 23px 22px 26px; gap: 25px; }
  .drop-zone { padding: 24px 16px 21px; }
  .drop-title { font-size: .86rem; }
  .number-example { margin-top: 17px; padding-top: 15px; }
  .panel-actions { flex-direction: column-reverse; align-items: stretch; padding: 21px 22px; gap: 18px; }
  .button { width: 100%; }
  .privacy-note { max-width: none; font-size: .76rem; }
  .after-panel-note { justify-content: flex-start; font-size: .76rem; padding: 0 3px; }
  .preview-heading { padding: 22px 20px 18px; }
  .source-name { font-size: .77rem; }
  .summary-grid { margin: 0 20px; grid-template-columns: 1fr 1fr; }
  .summary-grid > div { padding: 13px 15px; }
  .summary-grid > div:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .summary-grid > div:first-child dd { font-size: .95rem; }
  .summary-grid > div:nth-child(2) { border-left: 0; }
  .summary-grid dd { font-size: 1.03rem; }
  .numbering-note { margin: 16px 20px 18px; font-size: .76rem; }
  .renumber-form { padding: 0 20px 23px; }
  .renumber-controls { align-items: stretch; gap: 8px; }
  .renumber-controls .number-input { width: 115px; flex: 0 0 115px; }
  .renumber-controls .button { width: auto; flex: 1; white-space: normal; line-height: 1.4; font-size: .75rem; }
  .table-heading { padding: 0 20px 12px; flex-direction: column; align-items: flex-start; gap: 3px; }
  .table-scroll-hint { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: .75rem; color: var(--blue); }
  .table-scroll { max-height: 430px; }
  .preview-table th:first-child, .preview-table td:first-child { padding-left: 20px; }
  .balance-strip { padding: 15px 20px; flex-wrap: wrap; justify-content: flex-start; gap: 9px 23px; }
  .balance-strip > span { display: flex; justify-content: space-between; gap: 15px; width: 100%; }
  .download-area { padding: 22px 20px; flex-direction: column; gap: 18px; }
  .download-area form { width: 100%; }
  .preview-footer { flex-direction: column; gap: 2px; margin-top: 14px; }
  .preview-footer p { text-align: left; padding-top: 0; font-size: .75rem; }
  .notice { padding: 16px 18px; font-size: .83rem; }
  .notice-warning { margin: 0 20px 22px; }
  .site-footer { padding: 0 21px 24px; font-size: .69rem; }
}
@media (max-width: 380px) {
  .header-context { display: none; }
  h1 { font-size: 1.8rem; }
  .page-shell { padding-left: 13px; padding-right: 13px; }
  .workflow li { font-size: .73rem; gap: 5px; }
  .workflow li:not(:last-child)::after { margin: 0 7px; }
  .file-extension { padding-left: 8px; }
  .download-area .button { gap: 9px; font-size: .84rem; padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
