:root {
  color-scheme: light;
  --ink: #172321;
  --ink-soft: #45514d;
  --muted: #808680;
  --line: #e5e3dc;
  --paper: #fffefa;
  --canvas: #f4f1e9;
  --canvas-deep: #ebe7dd;
  --green: #244b3b;
  --green-deep: #193428;
  --coral: #e58b64;
  --coral-pale: #f5e0d4;
  --sage: #e8ede6;
  --shadow: 0 14px 42px rgba(34, 40, 34, .065), 0 2px 8px rgba(34, 40, 34, .035);
  font-family: 'DM Sans', 'Avenir Next', 'Helvetica Neue', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); min-width: 320px; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, .dropzone:focus-visible, summary:focus-visible { outline: 3px solid #b7613b; outline-offset: 3px; }
.page-shell { max-width: 1600px; margin: 0 auto; padding: 0 clamp(22px, 5.2vw, 86px); }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(23, 35, 33, .11); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; width: 62px; height: 45px; flex: none; object-fit: contain; }
.brand-copy { display: flex; align-items: baseline; gap: 11px; }
.brand-copy strong { font-size: 16px; font-weight: 700; letter-spacing: -.5px; }
.brand-copy small { color: #8b918b; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 8px; color: #66716a; font-size: 12px; font-weight: 600; }
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: #6f9d7c; box-shadow: 0 0 0 4px rgba(111, 157, 124, .12); }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 18px; padding: 0 19px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .01em; text-decoration: none; transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out, scale 150ms ease-out; -webkit-tap-highlight-color: transparent; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button:not(:disabled):active { scale: .96; }
.button-dark { color: #fffefa; background: var(--ink); }
.button-primary { color: #fffefa; background: #b95f3b; }
.button-light { color: var(--ink); background: #f6f5f0; border-color: #e5e3dc; }
.button-arrow { font-size: 16px; line-height: 1; font-weight: 500; }
.button-small { min-height: 36px; padding: 0 12px; gap: 6px; font-size: 11px; }
.plus { color: #b95f3b; font-size: 18px; line-height: .8; }
.hero { min-height: 390px; display: grid; grid-template-columns: 1fr .8fr; align-items: center; gap: 35px; padding: 56px clamp(0px, 4.2vw, 60px) 58px; position: relative; overflow: hidden; }
.hero-copy { position: relative; z-index: 1; padding-bottom: 5px; }
.eyebrow, .section-kicker { color: #8a8172; font-size: 10px; font-weight: 700; letter-spacing: 1.7px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 21px; }
.eyebrow-rule { width: 24px; height: 1px; background: #c46d49; }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { margin: 0; font-size: clamp(42px, 5vw, 68px); line-height: 1.045; letter-spacing: -3.6px; font-weight: 600; }
.hero h1 em { color: #b85f3b; font-family: 'Playfair Display', Georgia, serif; font-weight: 500; }
.hero-description { max-width: 500px; margin: 18px 0 24px; color: #69716b; font-size: 14px; line-height: 1.75; }
.hero-meta { display: flex; align-items: center; gap: 16px; color: #67746d; font-size: 11px; font-weight: 600; }
.meta-item { display: inline-flex; align-items: center; gap: 7px; }
.meta-check { color: #47715b; font-size: 13px; font-weight: 700; }
.meta-divider { width: 1px; height: 13px; background: #d3d0c6; }
.hero-art { height: 290px; position: relative; display: grid; place-items: center; isolation: isolate; }
.hero-art::before { content: ''; position: absolute; width: 310px; height: 250px; border-radius: 48% 52% 56% 44%; background: #e5e9df; transform: rotate(-13deg); z-index: -2; }
.art-orbit { position: absolute; border: 1px solid rgba(61, 90, 73, .2); border-radius: 50%; transform: rotate(-28deg); }
.orbit-one { width: 410px; height: 135px; }
.orbit-two { width: 375px; height: 100px; transform: rotate(35deg); }
.art-sheet { position: absolute; width: 244px; height: 250px; border-radius: 5px; background: var(--paper); box-shadow: 0 16px 38px rgba(35, 52, 41, .12); }
.art-sheet-back { transform: translate(27px, -4px) rotate(9deg); background: #efe2d7; }
.art-sheet-back i { display: block; height: 1px; margin: 24px 25px; background: rgba(104, 77, 60, .14); }
.art-sheet-front { padding: 23px 23px 18px; transform: translate(-8px, 0) rotate(-5deg); }
.art-sheet-top { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e7e3d9; padding-bottom: 12px; color: #597260; font-size: 9px; letter-spacing: 1px; }
.art-sheet-top span { display: grid; place-items: center; width: 25px; height: 25px; background: var(--ink); color: #f3ab84; font-family: Georgia, serif; font-size: 10px; }
.art-sheet-top b { color: #34443a; letter-spacing: 2px; }
.art-skeleton { height: 5px; border-radius: 8px; background: #d9ded5; margin-top: 17px; }
.skeleton-wide { width: 80%; }
.skeleton-short { width: 53%; margin-top: 8px; }
.art-lines { margin-top: 28px; border-top: 1px solid #dcded7; }
.art-lines i { display: block; height: 21px; border-bottom: 1px solid #e7e8e2; }
.art-total { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; color: #7c827d; font-size: 8px; letter-spacing: 1px; }
.art-total b { color: #ab5938; font-size: 12px; letter-spacing: 0; }
.art-stamp { position: absolute; right: 8%; top: 12%; z-index: 2; display: grid; place-items: center; width: 67px; height: 67px; border: 1px solid #b96644; border-radius: 50%; color: #a75231; font-size: 8px; font-weight: 700; line-height: 1.55; text-align: center; letter-spacing: .7px; transform: rotate(12deg); }
.art-orbit-dot { position: absolute; left: 10%; bottom: 14%; width: 9px; height: 9px; border-radius: 50%; background: #bf754f; box-shadow: 0 0 0 7px rgba(191, 117, 79, .12); }

.workspace { padding: 27px 0 74px; border-top: 1px solid rgba(23, 35, 33, .11); }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin: 0 0 23px; }
.workspace-heading h2 { margin: 7px 0 0; font-size: 25px; letter-spacing: -.9px; }
.steps { display: flex; align-items: center; gap: 14px; margin: 0 0 4px; padding: 0; list-style: none; }
.steps > i { width: 31px; height: 1px; background: #d6d5cd; }
.step { display: flex; align-items: center; gap: 8px; color: #a0a49d; font-size: 10px; }
.step span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #d4d6cf; border-radius: 50%; font-size: 9px; font-weight: 700; }
.step b { font-weight: 600; }
.step.active { color: var(--ink); }
.step.active span { color: #fff; border-color: var(--green); background: var(--green); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); align-items: start; gap: 23px; }
.editor-column { min-width: 0; display: grid; gap: 14px; }
.panel { min-width: 0; padding: 22px; border: 1px solid rgba(40, 47, 39, .08); border-radius: 14px; background: rgba(255, 254, 250, .9); box-shadow: 0 3px 11px rgba(34, 40, 34, .025); }
.panel-heading { display: flex; align-items: center; gap: 12px; margin: 0 0 17px; }
.panel-heading-spread { justify-content: space-between; }
.panel-heading-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.step-badge { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; background: #edf0e9; color: #3b6550; font-size: 10px; font-weight: 700; }
.panel-heading h3 { margin: 0 0 3px; font-size: 14px; letter-spacing: -.25px; }
.panel-heading p { margin: 0; color: #858b84; font-size: 10px; line-height: 1.45; }
.dropzone { min-height: 125px; display: flex; align-items: center; justify-content: center; gap: 17px; position: relative; border: 1px dashed #bdc8bc; border-radius: 10px; background: #f7f8f3; cursor: pointer; transition: background-color 150ms ease-out, border-color 150ms ease-out; }
.dropzone.dragover { background: #eef3ec; border-color: #62816c; }
.dropzone.dragover { box-shadow: inset 0 0 0 1px #62816c; }
.upload-icon { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid #dfe5dc; border-radius: 13px; background: #fffefa; color: #406b54; }
.upload-icon svg { width: 23px; height: 23px; }
.drop-copy { display: flex; flex-direction: column; gap: 5px; color: #777f77; font-size: 11px; }
.drop-copy strong { color: #26332d; font-size: 12px; }
.drop-copy u { color: #af5e3c; text-underline-offset: 2px; }
.file-types { position: absolute; right: 12px; bottom: 10px; color: #a1a59e; font-size: 8px; font-weight: 700; letter-spacing: .6px; }
.file-card { display: flex; align-items: center; gap: 11px; min-height: 56px; margin-top: 10px; padding: 9px 12px; border: 1px solid #e8e6df; border-radius: 9px; background: #fffefa; }
.file-card[hidden] { display: none; }
.file-type-icon { display: grid; place-items: center; width: 32px; height: 36px; border-radius: 5px; background: #f3e4da; color: #9e5639; font-size: 8px; font-weight: 800; letter-spacing: .3px; }
.file-info { display: grid; gap: 3px; flex: 1; min-width: 0; }
.file-info strong { overflow: hidden; color: #334139; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.file-info span { color: #929890; font-size: 9px; }
.icon-button { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #7c857e; cursor: pointer; font-size: 21px; }
.privacy-note { display: flex; align-items: center; gap: 7px; margin: 11px 1px 0; color: #838a83; font-size: 9px; line-height: 1.5; }
.lock-icon { display: grid; place-items: center; width: 15px; height: 16px; border: 1px solid #97a395; border-radius: 4px; color: #54715c; font-size: 12px; }
.ocr-status { margin: 10px 1px 0; }
.ocr-status-top { display: flex; align-items: center; gap: 8px; color: #52715c; font-size: 10px; font-weight: 600; }
.ocr-status-top > span:last-child { margin-left: auto; color: #879188; font-variant-numeric: tabular-nums; }
.status-spinner { width: 11px; height: 11px; border: 1.5px solid #c9d5c8; border-top-color: #4f7a5b; border-radius: 50%; animation: spin .8s linear infinite; }
.progress-track { height: 3px; margin-top: 7px; overflow: hidden; border-radius: 4px; background: #e7ebe4; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #5c8667; transition: width 150ms ease-out; }
@keyframes spin { to { transform: rotate(360deg); } }
.review-badge { flex: 0 0 auto; padding: 6px 8px; border: 1px solid #e8d6bf; border-radius: 20px; background: #fcf2e4; color: #986a32; font-size: 8px; font-weight: 700; letter-spacing: .7px; }
.review-badge-ready { border-color: #cbdcc9; background: #edf5ed; color: #4b7756; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 12px; }
.field { display: grid; align-content: start; gap: 7px; color: #6d756e; font-size: 10px; font-weight: 700; }
.field > span { display: flex; align-items: center; gap: 4px; }
.field > span b { color: #bd6541; }
.field > span small { margin-left: auto; color: #9ca29b; font-size: 7px; letter-spacing: .8px; }
.field input, .row-input { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid #e2e2db; border-radius: 7px; background: #fffefa; color: #28332e; font-size: 11px; font-weight: 500; outline: none; transition: border-color 120ms ease-out, box-shadow 120ms ease-out; }
.field input::placeholder, .row-input::placeholder { color: #b2b5ae; }
.field input:focus, .row-input:focus { border-color: #7c9c83; box-shadow: 0 0 0 3px rgba(95, 135, 105, .12); }
.field input[aria-invalid="true"], .row-input[aria-invalid="true"] { border-color: #c4523c; box-shadow: 0 0 0 3px rgba(196, 82, 60, .1); }
.field small { color: #929890; font-size: 9px; font-weight: 400; line-height: 1.45; }
.field-wide { grid-column: 1 / -1; }
.line-items-panel { padding-bottom: 17px; }
.items-heading { margin-bottom: 15px; }
.table-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-color: #cad1c7 transparent; scrollbar-width: thin; }
.entry-table { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.entry-table th { padding: 0 5px 8px; color: #8a9089; font-size: 7px; font-weight: 700; letter-spacing: .45px; line-height: 1.35; text-align: left; text-transform: uppercase; vertical-align: bottom; }
.entry-table th:nth-child(1) { width: 78px; }
.entry-table th:nth-child(2) { width: 75px; }
.entry-table th:nth-child(3) { width: 70px; }
.entry-table th:nth-child(4) { width: 118px; }
.entry-table th:nth-child(5) { width: 130px; }
.entry-table th:nth-child(6), .entry-table th:nth-child(9), .entry-table th:nth-child(13) { width: 86px; }
.entry-table th:nth-child(7), .entry-table th:nth-child(8), .entry-table th:nth-child(10), .entry-table th:nth-child(11) { width: 65px; }
.entry-table th:nth-child(12) { width: 120px; }
.entry-table th:last-child { width: 62px; }
.entry-table td { padding: 3px 3px; border-top: 1px solid #eeece6; }
.row-input { height: 34px; padding: 0 6px; border-color: #ebe9e3; border-radius: 5px; font-size: 9px; }
.row-input.money-input { text-align: right; font-variant-numeric: tabular-nums; }
.transaction-type-select { width: 100%; height: 34px; padding: 0 4px; border: 1px solid #ebe9e3; border-radius: 5px; background: #fffefa; color: #42584a; font: 700 9px 'DM Sans', sans-serif; }
.transaction-type-select:focus { border-color: #7c9c83; outline: 2px solid rgba(95, 135, 105, .12); }
.commission-editor { display: grid; min-width: 0; gap: 3px; }
.commission-mode { width: 100%; height: 23px; padding: 0 3px; border: 1px solid #ebe9e3; border-radius: 5px; background: #fffefa; color: #526056; font-family: inherit; font-size: 8px; font-weight: 700; }
.row-grand-total { display: block; overflow: hidden; padding: 0 4px; color: #314b3a; font-size: 9px; font-weight: 700; line-height: 34px; text-align: right; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.remove-row { display: inline-flex; width: 58px; min-height: 29px; align-items: center; justify-content: center; padding: 0 5px; border: 1px solid #efdcd3; border-radius: 5px; background: #fff9f5; color: #a65036; cursor: pointer; font-size: 8px; font-weight: 700; }
.entry-table .empty-entry-row td { padding: 16px 10px; border: 1px dashed #deded5; border-radius: 7px; color: #81877f; font-size: 10px; text-align: center; }
.commission-help { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 11px 12px; border-radius: 8px; background: #f5f5ef; }
.commission-symbol { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: #e8ede5; color: #426750; font-size: 13px; font-weight: 700; }
.commission-help div { display: grid; gap: 3px; }
.commission-help strong { color: #455047; font-size: 9px; }
.commission-help span:not(.commission-symbol) { color: #868d85; font-size: 8px; line-height: 1.45; }
.source-text-details { margin-top: 13px; border-top: 1px solid #eeece6; padding-top: 11px; }
.source-text-details summary { color: #68766b; cursor: pointer; font-size: 9px; font-weight: 700; }
.source-text-details textarea { display: block; width: 100%; margin-top: 9px; padding: 10px; resize: vertical; border: 1px solid #e3e3dc; border-radius: 7px; background: #fbfaf6; color: #526056; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; line-height: 1.6; }
.source-text-details p { margin: 6px 0 0; color: #969b94; font-size: 8px; }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 4px 2px 0; }
.footer-lock { display: flex; align-items: center; gap: 9px; color: #4e7258; }
.footer-lock > span { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #d4dfd1; border-radius: 8px; font-size: 17px; }
.footer-lock div { display: grid; gap: 3px; }
.footer-lock strong { color: #526257; font-size: 9px; }
.footer-lock small { color: #91978f; font-size: 8px; }
.footer-actions { display: flex; gap: 8px; }
.footer-actions .button { min-height: 42px; padding: 0 13px; gap: 12px; font-size: 10px; }

.preview-column { position: sticky; top: 16px; min-width: 0; padding: 19px; border: 1px solid rgba(40, 47, 39, .07); border-radius: 14px; background: #eae8df; box-shadow: var(--shadow); }
.preview-header { display: flex; align-items: center; justify-content: space-between; margin: 1px 0 14px; }
.preview-header .section-kicker { font-size: 8px; }
.preview-header h3 { margin: 4px 0 0; font-size: 14px; letter-spacing: -.3px; }
.live-indicator { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid #d7ddd3; border-radius: 20px; background: #f7f7f2; color: #69806c; font-size: 7px; font-weight: 800; letter-spacing: .8px; }
.live-indicator i { width: 5px; height: 5px; border-radius: 50%; background: #6b9a71; }
.preview-frame { position: relative; overflow: hidden; width: 100%; border: 1px solid rgba(65, 70, 62, .12); border-radius: 4px; background: #fffefa; box-shadow: 0 9px 22px rgba(33, 39, 34, .1); }
.invoice-paper { width: 1100px; min-height: 770px; padding: 55px 58px 35px; overflow: hidden; color: #1d2a24; background: #fffefa; font-family: 'DM Sans', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', Meiryo, sans-serif; transform-origin: top left; }
.invoice-topline { display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1.5px solid #25362b; }
.invoice-brand { display: flex; align-items: center; gap: 12px; }
.invoice-brand-logo { display: block; width: 142px; height: auto; }
.invoice-title-block { text-align: right; }
.invoice-title-block > span { color: #9a654a; font-size: 8px; font-weight: 700; letter-spacing: 2px; }
.invoice-title-block h4 { margin: 2px 0 0; color: #1c2e24; font-family: 'Playfair Display', Georgia, serif; font-size: 29px; font-weight: 600; letter-spacing: 1.4px; }
.invoice-company-grid { display: flex; align-items: start; justify-content: space-between; padding: 18px 0 14px; }
.company-address, .company-contact { display: grid; gap: 3px; color: #535e56; font-size: 9px; line-height: 1.4; }
.company-address strong { margin-bottom: 2px; color: #26362d; font-size: 10px; }
.company-reg { margin-top: 3px; color: #596b5e; font-size: 8px; font-weight: 700; letter-spacing: .2px; }
.company-contact { min-width: 190px; grid-template-columns: 1fr; text-align: right; }
.company-contact span:nth-child(4) { margin-top: 7px; color: #879087; font-size: 7px; font-weight: 700; letter-spacing: .6px; }
.company-contact span:nth-child(5) { color: #879087; font-size: 7px; font-weight: 700; letter-spacing: .6px; }
.company-contact b { color: #43554a; font-size: 8px; letter-spacing: 0; }
.invoice-billto-row { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin: 4px 0 20px; padding: 13px 15px; border-left: 3px solid #c16a46; background: #f5f4ee; }
.invoice-billto-row > div { display: grid; gap: 5px; min-width: 0; }
.mini-label { color: #98978d; font-size: 7px; font-weight: 800; letter-spacing: 1.25px; }
.invoice-billto-row strong { overflow: hidden; color: #29392f; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.preview-table-wrap { width: 100%; }
.invoice-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.invoice-table th { height: 35px; padding: 4px 4px; border-top: 1px solid #cdd2c9; border-bottom: 1px solid #cdd2c9; background: #edf0e9; color: #526456; font-size: 6.2px; font-weight: 800; letter-spacing: .35px; line-height: 1.35; text-align: right; vertical-align: middle; }
.invoice-table th:first-child, .invoice-table th:nth-child(2), .invoice-table th:nth-child(3) { text-align: left; }
.invoice-table.has-vehicle-name th:nth-child(4) { text-align: left; }
.invoice-table th:nth-child(1) { width: 9%; }
.invoice-table th:nth-child(2) { width: 8%; }
.invoice-table th:nth-child(3) { width: 15%; }
.invoice-table:not(.has-vehicle-name) th:nth-child(5) { width: 9.5%; }
.invoice-table:not(.has-vehicle-name) th:nth-child(6), .invoice-table:not(.has-vehicle-name) th:nth-child(7) { width: 6.5%; }
.invoice-table:not(.has-vehicle-name) th:nth-child(8) { width: 8.5%; }
.invoice-table:not(.has-vehicle-name) th:nth-child(9), .invoice-table:not(.has-vehicle-name) th:nth-child(10), .invoice-table:not(.has-vehicle-name) th:nth-child(11) { width: 8%; }
.invoice-table:not(.has-vehicle-name) th:nth-child(12) { width: 13%; }
.invoice-table.has-vehicle-name th:nth-child(1) { width: 8%; }
.invoice-table.has-vehicle-name th:nth-child(2) { width: 7%; }
.invoice-table.has-vehicle-name th:nth-child(3), .invoice-table.has-vehicle-name th:nth-child(4) { width: 13%; }
.invoice-table.has-vehicle-name th:nth-child(5) { width: 9%; }
.invoice-table.has-vehicle-name th:nth-child(6), .invoice-table.has-vehicle-name th:nth-child(7) { width: 6%; }
.invoice-table.has-vehicle-name th:nth-child(8) { width: 8%; }
.invoice-table.has-vehicle-name th:nth-child(9), .invoice-table.has-vehicle-name th:nth-child(10) { width: 7%; }
.invoice-table.has-vehicle-name th:nth-child(11), .invoice-table.has-vehicle-name th:nth-child(12) { width: 8%; }
.invoice-table [hidden] { display: none; }
.invoice-table td { height: 30px; padding: 5px 4px; border-bottom: 1px solid #e8e9e3; color: #38443c; font-size: 7.4px; line-height: 1.35; text-align: right; vertical-align: middle; font-variant-numeric: tabular-nums; }
.invoice-table td:first-child, .invoice-table td:nth-child(2), .invoice-table td:nth-child(3) { text-align: left; }
.invoice-table.has-vehicle-name td:nth-child(4) { text-align: left; overflow-wrap: anywhere; font-size: 7px; }
.invoice-date-type { display: grid; gap: 3px; justify-items: start; }
.invoice-type-chip { display: inline-block; padding: 2px 4px; border-radius: 3px; font-size: 5.5px; font-weight: 800; letter-spacing: .5px; }
.invoice-type-chip.bought { background: #eef0e8; color: #526b56; }
.invoice-type-chip.sold { background: #f5e8dc; color: #975f3b; }
.invoice-type-chip.shortfall, .invoice-type-chip.credit { background: #f5e8dc; color: #975f3b; }
.invoice-commission-cell { font-size: 6.2px !important; white-space: nowrap; }
.invoice-table td:nth-child(3) { overflow-wrap: anywhere; font-size: 7px; }
.invoice-table td.empty-cell { color: #b3b7af; }
.invoice-total-row { display: flex; align-items: baseline; justify-content: flex-end; gap: 21px; padding: 14px 4px 15px; border-bottom: 1px solid #d8dcd4; color: #586b5d; font-size: 8px; font-weight: 800; letter-spacing: 1.2px; }
.invoice-total-row strong { color: #b75c3b; font-size: 18px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.invoice-bottom { display: grid; grid-template-columns: 1.3fr .7fr; gap: 30px; padding: 17px 0 16px; }
.payment-block { display: grid; gap: 9px; }
.payment-grid { display: grid; grid-template-columns: 85px 1fr; gap: 5px 10px; color: #747d74; font-size: 7.5px; }
.payment-grid b { color: #48574c; font-size: 7.5px; font-weight: 600; }
.invoice-note { display: flex; align-items: flex-end; flex-direction: column; justify-content: end; gap: 7px; color: #778176; font-family: 'Playfair Display', Georgia, serif; font-size: 12px; font-style: italic; text-align: right; }
.invoice-note i { width: 55px; height: 1px; background: #c77b58; }
.invoice-note small { color: #9ba097; font-family: 'DM Sans', sans-serif; font-size: 7px; font-style: normal; }
.invoice-footer-line { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid #e5e6df; color: #9a9e95; font-size: 6.5px; }
.preview-caption { display: flex; align-items: center; gap: 7px; margin: 12px 1px 0; color: #84897f; font-size: 9px; }
.caption-spark { color: #bb6d48; font-size: 13px; }
.preview-short-actions { display: none; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 62px; border-top: 1px solid rgba(23, 35, 33, .11); color: #91968e; font-size: 9px; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; color: #59655c; font-weight: 700; }
.footer-logo { display: block; width: 34px; height: 25px; flex: none; object-fit: contain; }
.site-footer a { color: #657469; text-decoration: none; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(420px, calc(100vw - 44px)); padding: 13px 16px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 9px; background: #1b2d23; color: #fffefa; box-shadow: 0 10px 30px rgba(22, 36, 27, .2); font-size: 11px; line-height: 1.5; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 150ms ease-out, transform 150ms ease-out; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: #7c3225; }
.mobile-action-bar { display: none; }
.row-grand-total { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; clip-path: inset(50%) !important; }

@media (hover: hover) {
  .button-dark:hover:not(:disabled) { background: #294139; }
  .button-primary:hover:not(:disabled) { background: #9f4e2f; }
  .button-light:hover:not(:disabled) { background: #eeede5; border-color: #cfcec5; }
  .dropzone:hover { background: #eef3ec; border-color: #62816c; }
  .icon-button:hover { border-color: #ebe8e0; background: #f5f3ed; }
  .remove-row:hover { border-color: #d6b0a0; background: #fff1e9; }
  .site-footer a:hover { color: #a65334; }
}

@media (max-width: 1060px) {
  .page-shell { padding-right: 28px; padding-left: 28px; }
  .hero { grid-template-columns: 1.15fr .85fr; padding-right: 10px; padding-left: 10px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) minmax(330px, .82fr); gap: 15px; }
  .panel { padding: 18px; }
  .preview-column { padding: 15px; }
  .invoice-paper { min-height: 750px; }
  .steps { gap: 9px; }
  .steps > i { width: 21px; }
}
@media (max-width: 820px) {
  .hero { min-height: 350px; grid-template-columns: 1fr .65fr; padding-top: 45px; }
  .hero-art { transform: scale(.8); transform-origin: center right; margin-right: -30px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .preview-column { position: static; order: 2; padding: 19px; }
  .invoice-paper { min-height: 730px; }
  .preview-short-actions { display: flex; gap: 8px; margin-top: 14px; }
  .preview-short-actions .button { flex: 1; }
  .editor-footer .footer-actions { display: none; }
}
@media (max-width: 600px) {
  html { scroll-behavior: auto; }
  .page-shell { padding: 0 16px; }
  .topbar { height: 65px; }
  .brand-logo { width: 50px; height: 36px; }
  .brand-copy { display: grid; gap: 1px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small { font-size: 7px; letter-spacing: 1.25px; }
  .topbar-right { gap: 0; }
  .privacy-pill { padding: 7px 9px; border: 1px solid #e0e1d9; border-radius: 20px; font-size: 8px; }
  .privacy-dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(111, 157, 124, .12); }
  .top-share { display: none; }
  .hero { min-height: 0; grid-template-columns: 1fr; gap: 2px; padding: 39px 1px 34px; }
  .eyebrow { margin-bottom: 16px; font-size: 8px; letter-spacing: 1.45px; }
  .hero h1 { font-size: clamp(40px, 11.5vw, 55px); letter-spacing: -2.5px; }
  .hero-description { max-width: 450px; margin: 14px 0 18px; font-size: 12px; line-height: 1.65; }
  .hero-meta { gap: 10px; font-size: 9px; }
  .meta-divider { height: 11px; }
  .hero-art { height: 195px; margin: 0; transform: scale(.68); transform-origin: top center; }
  .workspace { padding: 24px 0 50px; }
  .workspace-heading { display: block; margin-bottom: 18px; }
  .workspace-heading h2 { margin-top: 5px; font-size: 22px; }
  .steps { justify-content: flex-start; margin-top: 16px; gap: 8px; }
  .steps > i { flex: 1; max-width: 38px; }
  .step { gap: 6px; font-size: 9px; }
  .step span { width: 21px; height: 21px; font-size: 8px; }
  .editor-column { gap: 11px; }
  .panel { padding: 15px; border-radius: 12px; }
  .panel-heading { align-items: flex-start; gap: 9px; margin-bottom: 13px; }
  .panel-heading-left { gap: 9px; }
  .step-badge { flex-basis: 28px; width: 28px; height: 28px; border-radius: 8px; font-size: 9px; }
  .panel-heading h3 { font-size: 12px; }
  .panel-heading p { max-width: 235px; font-size: 9px; }
  .dropzone { min-height: 114px; flex-direction: column; gap: 8px; padding: 12px 8px 23px; text-align: center; }
  .upload-icon { width: 34px; height: 34px; border-radius: 10px; }
  .upload-icon svg { width: 18px; height: 18px; }
  .drop-copy { gap: 3px; font-size: 9px; }
  .drop-copy strong { font-size: 10px; }
  .file-types { right: 0; left: 0; bottom: 7px; font-size: 7px; }
  .privacy-note { align-items: flex-start; font-size: 8px; }
  .form-grid { gap: 11px 8px; }
  .field { gap: 5px; font-size: 9px; }
  .field input { height: 36px; padding: 0 8px; font-size: 10px; }
  .field small { font-size: 8px; }
  .review-badge { margin-top: 2px; padding: 5px 6px; font-size: 6.5px; }
  .items-heading { align-items: center; }
  .items-heading .panel-heading-left { align-items: flex-start; }
  .items-heading .panel-heading p { max-width: 210px; }
  .items-heading .button-small { flex: 0 0 auto; min-height: 31px; padding: 0 8px; font-size: 8px; }
  .entry-table { min-width: 0; display: block; }
  .entry-table thead { display: none; }
  .entry-table tbody { display: grid; gap: 9px; }
  .entry-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; border: 1px solid #e9e7e0; border-radius: 9px; background: #fffefa; }
  .entry-table td { display: grid; grid-template-columns: minmax(62px, .8fr) minmax(0, 1.2fr); align-items: center; gap: 5px; padding: 4px 3px; border-top: 0; }
  .entry-table td::before { content: attr(data-label); color: #8b9089; font-size: 7px; font-weight: 700; line-height: 1.25; }
  .entry-table td:nth-child(3) { grid-column: 1 / -1; }
  .entry-table td:nth-child(3) .row-input { max-width: none; }
  .entry-table td:nth-child(12) { grid-column: 1 / -1; border-top: 1px solid #eeece6; margin-top: 3px; padding-top: 8px; }
  .entry-table td:nth-child(12)::before { color: #4a6651; font-weight: 800; }
  .commission-mode { height: 27px; font-size: 8px; }
  .entry-table td:last-child { grid-column: 1 / -1; justify-content: end; min-height: 25px; padding: 0; }
  .entry-table td:last-child::before { content: none; }
  .entry-table td:last-child .remove-row { width: auto; min-width: 74px; min-height: 32px; padding: 0 10px; font-size: 9px; }
  .entry-table tbody .empty-entry-row { display: block; padding: 8px; border: 1px dashed #deded5; border-radius: 9px; background: #fffefa; }
  .entry-table .empty-entry-row td { display: block; padding: 10px 5px; border: 0; font-size: 9px; line-height: 1.5; }
  .entry-table .empty-entry-row td::before { content: none; }
  .row-input { height: 31px; font-size: 9px; }
  .row-grand-total { font-size: 10px; line-height: 30px; }
  .commission-help { align-items: flex-start; padding: 9px; }
  .commission-help strong { font-size: 8px; }
  .commission-help span:not(.commission-symbol) { font-size: 7px; }
  .editor-footer { align-items: flex-start; padding: 3px 1px 0; }
  .footer-lock { align-items: flex-start; }
  .footer-lock > span { width: 22px; height: 22px; }
  .footer-lock strong { font-size: 8px; }
  .footer-lock small { max-width: 180px; font-size: 7px; line-height: 1.5; }
  .preview-column { padding: 13px; border-radius: 12px; }
  .preview-header { margin-bottom: 10px; }
  .preview-frame { border-radius: 3px; }
  .invoice-paper { min-height: 690px; }
  .preview-caption { font-size: 8px; }
  .preview-short-actions { gap: 6px; }
  .preview-short-actions .button { min-height: 40px; gap: 8px; padding: 0 10px; font-size: 9px; }
  .site-footer { min-height: 68px; flex-wrap: wrap; justify-content: center; gap: 5px 13px; padding: 12px 0 82px; font-size: 8px; }
  .site-footer > span { display: none; }
  .mobile-action-bar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 12; display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid #dfded6; background: rgba(248, 246, 239, .95); backdrop-filter: blur(12px); }
  .mobile-action-bar .button { flex: 1; min-height: 43px; gap: 8px; font-size: 10px; }
  .toast { right: 13px; bottom: calc(70px + env(safe-area-inset-bottom)); left: 13px; max-width: none; text-align: center; }
}

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

@media print {
  @page { size: A4 landscape; margin: 7mm; }
  html, body { width: 100%; margin: 0; background: #fff; }
  .invoice-paper { width: 100%; min-height: 0; padding: 9mm 10mm 7mm; box-shadow: none; transform: none !important; }
  .invoice-bottom { grid-template-columns: 1.3fr .7fr; gap: 6mm; }
  .invoice-table tr, .invoice-bottom, .invoice-total-row { break-inside: avoid; }
}
