:root {
  color-scheme: light;
  --bg: #f7f6f1; --surface: #fffefa; --soft: #eeeee7;
  --ink: #202820; --muted: #525d52; --line: #d9ded3;
  --emerald: #166249; --primary: #145a43; --primary-ink: #fff;
  --green-soft: #e4efe6; --gold: #915b19; --gold-soft: #fbefda;
  --focus: #207759; --shadow: 0 20px 60px #23392915;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151916; --surface: #1c231e; --soft: #202923;
  --ink: #eef1e9; --muted: #b1bcaf; --line: #37473b;
  --emerald: #90d5b2; --primary: #9cddba; --primary-ink: #14291e;
  --green-soft: #253d31; --gold: #f0bf7b; --gold-soft: #392c1d;
  --focus: #8cdbb0; --shadow: 0 20px 60px #080d09a0;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; background: var(--bg); color: var(--ink); line-height: 1.55; overflow-wrap: anywhere; }
h1, h2, h3, h4, p, figure, dl { margin: 0; }
h1, h2, h3, h4 { line-height: 1.15; }
a { color: var(--emerald); text-underline-offset: .21em; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
button:disabled { cursor: default; opacity: .52; }
.shell { width: min(100% - 96px, 1200px); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { color: var(--ink); font-size: 1.05rem; font-weight: 730; letter-spacing: -.035em; display: inline-flex; gap: 10px; align-items: center; white-space: nowrap; text-decoration: none; }
.brand-icon { position: relative; display: inline-grid; place-items: center; width: 33px; height: 33px; flex: 0 0 33px; border-radius: 9px; color: var(--primary-ink); background: var(--primary); }
.brand-icon::before { content: ""; width: 16px; height: 14px; border: 1.6px solid currentColor; border-radius: 3px; }
.brand-icon::after { content: ""; position: absolute; width: 6px; height: 6px; border: 1.4px solid currentColor; border-radius: 50%; }
nav { display: flex; gap: 19px; align-items: center; }
nav > a:not(.button) { color: var(--muted); text-decoration: none; font-size: .9rem; }
nav > a:hover, .text-button:hover:not(:disabled) { text-decoration: underline; }
.theme-toggle { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 1.15rem; }
.button { min-height: 43px; border: 1px solid transparent; border-radius: 8px; padding: .58rem .9rem; display: inline-flex; justify-content: center; align-items: center; gap: .6rem; font-size: .88rem; font-weight: 680; text-align: center; text-decoration: none; }
.button:hover:not(:disabled) { filter: brightness(.93); }
.primary { background: var(--primary); color: var(--primary-ink); }
.secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.text-button { color: var(--emerald); border: 0; padding: 0; background: transparent; font-weight: 650; font-size: .87rem; }
.muted { color: var(--muted); }
.local-mark { display: inline-flex; align-items: center; gap: 8px; font-size: .83rem; color: var(--emerald); font-weight: 650; }
.local-mark i { background: currentColor; border-radius: 50%; width: .5rem; height: .5rem; flex-shrink: 0; box-shadow: 0 0 0 4px var(--green-soft); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.footer-inner > div { display: flex; flex-wrap: wrap; gap: 8px 18px; }

.vault-main { padding-block: 44px 74px; }
.vault-intro { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 25px; }
.vault-intro h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.055em; }
.vault-intro p { color: var(--muted); margin-top: 7px; }
.drop-zone { display: flex; align-items: center; gap: 18px; padding: 24px; background: var(--surface); border: 1px dashed var(--focus); border-radius: 14px; }
.drop-zone.dragging { background: var(--green-soft); outline: 2px solid var(--focus); outline-offset: 3px; }
.upload-icon, .empty-icon { display: grid; place-items: center; color: var(--emerald); background: var(--green-soft); border-radius: 10px; width: 49px; height: 49px; flex: 0 0 49px; font-size: 1.65rem; line-height: 1; }
.drop-text { flex: 1; }
.drop-text h2 { font-size: 1.21rem; }
.drop-text p { font-size: .87rem; color: var(--muted); margin-top: 5px; }
.file-picker { position: relative; cursor: pointer; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; padding: 0; }
.file-picker:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.sample-actions { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 14px 0 23px; }
.vault-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 19px; align-items: start; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.panel-heading { min-height: 74px; padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 1.15rem; letter-spacing: -.025em; }
.panel-heading p { margin-top: 5px; color: var(--muted); font-size: .81rem; }
.panel-heading p:empty { display: none; }
.panel-footer { padding: 14px 19px; border-top: 1px solid var(--line); }
.empty { display: grid; place-items: center; gap: 10px; min-height: 113px; padding: 20px; text-align: center; color: var(--muted); font-size: .9rem; }
.empty-icon { width: 38px; height: 38px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.stack-table { table-layout: fixed; }
th, td { text-align: left; padding: 10px 8px; vertical-align: middle; }
th { font-size: .74rem; color: var(--muted); }
th:first-child, td:first-child { width: 43px; padding-left: 15px; }
th:nth-child(3) { width: 25%; }
th:nth-child(4) { width: 26%; }
td { border-top: 1px solid var(--line); font-size: .86rem; }
td small, .line-item small { display: block; color: var(--muted); }
.active-row { background: var(--green-soft); }
.doc-link { text-align: left; overflow-wrap: anywhere; }
.amount, .preview-row b, .preview-total strong { font-variant-numeric: tabular-nums; font-weight: 680; }
.status-chip { display: inline-block; padding: 2px 7px; border-radius: 6px; color: var(--emerald); background: var(--green-soft); font-size: .72rem; font-weight: 650; }
.status-chip.warn, .warning, .is-error { color: var(--gold); background: var(--gold-soft); }
.payment-form, .contact-form { display: grid; gap: 12px; padding: 17px 19px 19px; }
label:not(.file-picker) { min-width: 0; display: grid; gap: 4px; font-size: .83rem; font-weight: 650; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
input:not([type="checkbox"], [type="file"]), textarea, select {
  width: 100%; min-width: 0; min-height: 41px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 7px; color: var(--ink); background: var(--bg); font-size: .91rem;
}
textarea { resize: vertical; }
input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; vertical-align: middle; }
label.check-label { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.report { margin: 0 0 12px; padding: 8px 11px; border-radius: 6px; color: var(--emerald); background: var(--green-soft); font-size: .85rem; }
.report.is-error { color: var(--gold); background: var(--gold-soft); }
form .report { margin: 0; }
.error-list { padding-left: 20px; color: var(--gold); }
.inspector { grid-column: 1 / -1; }
#invoice-sheet { padding: clamp(15px, 4vw, 35px); display: grid; gap: 18px; }
.invoice-title h3 { font-size: clamp(1.3rem, 4vw, 2rem); }
.invoice-title p, .party p { color: var(--muted); }
.parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.party, .detail-report { padding: 13px; border: 1px solid var(--line); border-radius: 8px; }
.party p { white-space: pre-line; }
.party h4, .detail-report h4, .positions h4 { margin-bottom: 6px; }
.line-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 24%); gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.line-item b { text-align: right; }
.invoice-bank, .invoice-totals { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 5px 14px; }
.invoice-bank dd, .invoice-totals dd { margin: 0; white-space: pre-line; }
.invoice-totals { justify-self: end; width: min(100%, 325px); }
.invoice-totals dd { text-align: right; }
.invoice-totals dt:last-of-type, .invoice-totals dd:last-of-type { font-weight: 750; border-top: 1px solid var(--line); padding-top: 5px; }
.detail-report .error-list { margin-block: 5px 0; }

.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 45px; align-items: center; padding-block: 89px 92px; }
.hero h1 { font-size: clamp(2.3rem, 4.5vw, 4rem); letter-spacing: -.066em; font-weight: 735; }
.hero h1 em { color: var(--emerald); font-style: normal; }
.hero-copy > p:not(.hero-local) { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 46ch; margin-top: 19px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.hero-local { margin: 15px 0 0 4px; }
.preview { min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.preview-top, .preview-total { display: flex; align-items: center; gap: 10px; padding: 13px 17px; }
.preview-top { border-bottom: 1px solid var(--line); }
.preview-tag { margin-left: auto; color: var(--muted); font-size: .77rem; }
.preview-content { padding: 5px 17px; }
.preview-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, auto); align-items: center; gap: 8px; padding: 10px 0; font-size: .88rem; }
.preview-row + .preview-row { border-top: 1px solid var(--line); }
.preview-row small { display: block; color: var(--muted); }
.preview-row b { text-align: right; }
.preview-icon { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 7px; background: var(--green-soft); color: var(--emerald); font-weight: 750; }
.preview-icon.warning { color: var(--gold); background: var(--gold-soft); }
.preview-total { justify-content: space-between; border-top: 1px solid var(--line); color: var(--emerald); font-size: .9rem; }
.landing-section { padding-block: 55px; }
.landing-section h2 { margin-bottom: 21px; font-size: clamp(1.7rem, 3.5vw, 2.7rem); letter-spacing: -.045em; }
.section-tint { background: var(--soft); border-block: 1px solid var(--line); }
.steps { padding: 0; margin: 0; list-style: none; counter-reset: steps; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.steps li, .price-card { padding: 21px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.steps li::before { counter-increment: steps; content: counter(steps); display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; color: var(--emerald); background: var(--green-soft); font-weight: 700; margin-bottom: 13px; }
.steps li p, .price-card > p:not(.price), .contact-layout p, .faq p { color: var(--muted); margin-top: 7px; }
.prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.price { margin-top: 11px; font-size: 2.35rem; font-weight: 740; letter-spacing: -.05em; }
.price small { color: var(--muted); font-size: .85rem; letter-spacing: 0; font-weight: 560; }
.price-card .button { margin-top: 13px; }
.faq-layout, .contact-layout { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 22px; }
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 650; }
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.contact-form .button { justify-self: start; }
.contact-form .form-note { font-size: .8rem; margin-top: 0; }

@media (max-width: 1020px) {
  .shell { width: calc(100% - 48px); }
  .hero { gap: 24px; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .nav-cta { display: none; }
  .header-inner, .footer-inner { min-height: 58px; }
  nav { gap: 12px; }
  .vault-main { padding-block: 28px 45px; }
  .vault-intro { display: grid; gap: 11px; }
  .drop-zone { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 15px; }
  .file-picker { grid-column: 1 / -1; }
  .vault-grid, .hero, .faq-layout, .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .inspector { grid-column: 1; grid-row: 2; }
  .hero { padding-block: 46px; }
  .hero h1 { font-size: clamp(2.05rem, 7.5vw, 3.15rem); }
  .landing-section { padding-block: 37px; }
  .steps, .prices { grid-template-columns: minmax(0, 1fr); }
  .faq-layout, .contact-layout { gap: 10px; }
}
@media (max-width: 410px) {
  .brand { gap: 6px; }
  .header-inner { gap: 8px; }
  nav { gap: 8px; }
  nav > a:not(.button) { font-size: .81rem; }
  th, td { padding-inline: 4px; }
  th:first-child, td:first-child { width: 31px; padding-left: 8px; }
  .status-chip { font-size: .68rem; }
  .footer-inner { align-items: start; flex-direction: column; padding-block: 12px; gap: 4px; }
}
@media print {
  :root, :root[data-theme="dark"] { color-scheme: light; --ink: #000; --muted: #333; --line: #bbb; --surface: #fff; }
  body { background: #fff; font-size: 10pt; }
  .vault .site-header, .vault .site-footer, .vault-main > :not(.vault-grid), .vault-grid > :not(.inspector), .inspector > :not(#invoice-sheet) { display: none !important; }
  .vault-main, .vault-grid, .inspector, #invoice-sheet { display: block; width: auto; border: 0; padding: 0; margin: 0; }
  #invoice-sheet > * { margin-bottom: 14px; }
  .party, .line-item, .invoice-totals, .detail-report { break-inside: avoid; }
}
