:root{--ink:#191b18;--paper:#fff;--cream:#fffaf0;--line:#c9c8c0;--green:#16785d;--green-soft:#ddf3e7;--yellow:#ffd754;--blue:#255bea;--muted:#5d635d}
*{box-sizing:border-box}
body{margin:0;background:var(--cream);color:var(--ink)}
button,input,select,textarea{font:inherit}
.invoice-hero{padding-bottom:46px}
.invoice-workspace{padding:0 0 88px}
.invoice-layout{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(420px,.92fr);gap:26px;align-items:start}
.invoice-editor{overflow:hidden;border:2px solid var(--ink);border-radius:26px;background:#fff;box-shadow:8px 9px 0 var(--ink)}
.editor-section{padding:26px;border-bottom:1.5px solid var(--ink)}
.section-heading{display:grid;grid-template-columns:38px 1fr;gap:12px;align-items:start;margin-bottom:20px}
.section-heading>span{display:grid;width:36px;height:34px;place-items:center;border:1.5px solid var(--ink);border-radius:50%;background:var(--yellow);font-size:11px;font-weight:950}
.section-heading h2{margin:0;font-size:25px;letter-spacing:-.04em}
.section-heading p{margin:3px 0 0;color:var(--muted);font-size:14px}
.item-heading{grid-template-columns:38px 1fr auto;align-items:center}
.field-grid{display:grid;gap:15px}
.two-columns{grid-template-columns:1fr 1fr}
.full-field{grid-column:1/-1}
.field{display:grid;gap:7px;color:var(--ink);font-size:14px;font-weight:850}
.field>span{display:flex;align-items:baseline;gap:5px}
.field small{color:var(--muted);font-size:11px;font-weight:600}
.field input,.field select,.field textarea{width:100%;border:1.5px solid var(--ink);border-radius:10px;background:#fff;padding:11px 12px;color:var(--ink);outline:none}
.field input,.field select{min-height:45px}
.field textarea{resize:vertical;line-height:1.45}
.field input:focus,.field select:focus,.field textarea:focus,.line-item input:focus{box-shadow:0 0 0 3px rgba(37,91,234,.18);border-color:var(--blue)}
.file-field input{padding:7px}
.file-field>small{margin-top:-3px}
.compact-button,.secondary-action,.text-action,.primary-action{border:1.5px solid var(--ink);font-weight:900;cursor:pointer}
.compact-button:focus-visible,.secondary-action:focus-visible,.text-action:focus-visible,.primary-action:focus-visible,.remove-line:focus-visible{outline:3px solid rgba(37,91,234,.35);outline-offset:3px}
.compact-button{min-height:42px;padding:8px 15px;border-radius:999px;background:#fff}
.compact-button:hover,.secondary-action:hover{background:#f1f1ed}
.item-labels,.line-item{display:grid;grid-template-columns:minmax(150px,1fr) 74px 110px 110px 36px;gap:8px;align-items:center}
.item-labels{padding:0 2px 7px;color:var(--muted);font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.06em}
.line-item{padding:9px 0;border-top:1px solid #e1e0da}
.line-item label{display:block}
.line-item label>span{display:none}
.line-item input{width:100%;min-height:43px;border:1.5px solid var(--ink);border-radius:9px;padding:9px;background:#fff;outline:none}
.item-amount{font-weight:850;text-align:right;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.remove-line{display:grid;width:34px;height:34px;place-items:center;border:1.5px solid var(--ink);border-radius:50%;background:#fff;color:var(--ink);font-size:21px;line-height:1;cursor:pointer}
.remove-line:hover{background:#ffe7df}
.totals-fields{grid-template-columns:1fr 1fr}
.input-suffix{display:flex;align-items:center;border:1.5px solid var(--ink);border-radius:10px;overflow:hidden;background:#fff}
.input-suffix input{border:0!important;border-radius:0!important}
.input-suffix span{padding:0 13px;color:var(--muted);font-weight:900}
.tax-note{margin:15px 0 0;padding:11px 13px;border-radius:10px;background:#f3f2ed;color:#4f554f;font-size:12px;line-height:1.5}
.editor-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:25px;background:var(--green-soft)}
.live-balance{grid-column:1/-1;display:flex;align-items:end;justify-content:space-between;padding-bottom:12px;border-bottom:1.5px solid var(--ink)}
.live-balance span{font-size:14px;font-weight:900;text-transform:uppercase;letter-spacing:.06em}
.live-balance strong{font-size:34px;letter-spacing:-.05em;font-variant-numeric:tabular-nums}
.primary-action,.secondary-action{min-height:52px;padding:11px 16px;border-radius:11px}
.primary-action{background:var(--ink);color:#fff}
.primary-action:hover{background:#2a2e29}
.secondary-action{background:#fff;color:var(--ink)}
.text-action{justify-self:start;border:0;border-bottom:1px solid var(--ink);background:transparent;padding:4px 0;font-size:12px}
.action-help,.status-line{grid-column:1/-1;margin:0;color:#4d554f;font-size:12px;line-height:1.5}
.status-line{min-height:18px;font-weight:800;color:var(--green)}
.status-line.error{color:#a13026}
.preview-column{position:sticky;top:96px;width:100%;min-width:0;max-width:100%}
.preview-label{display:flex;justify-content:space-between;align-items:baseline;margin:0 3px 9px;font-weight:900}
.preview-label span{text-transform:uppercase;letter-spacing:.08em;font-size:12px}
.preview-label small{color:var(--muted);font-weight:600}
.invoice-document{width:100%;min-width:0;max-width:100%;min-height:760px;overflow:hidden;padding:40px 38px;border:1.5px solid var(--ink);background:#fff;box-shadow:7px 8px 0 rgba(25,27,24,.2);font-family:Arial,Helvetica,sans-serif;color:#151715}
.document-header{display:flex;justify-content:space-between;gap:30px;padding-bottom:26px;border-bottom:4px solid #151715}
.seller-block{display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.seller-block img{display:block;max-width:150px;max-height:70px;margin-bottom:13px;object-fit:contain;object-position:left center}
.seller-block strong{font-size:22px;overflow-wrap:anywhere}
.seller-block p,.document-parties p{margin:5px 0 0;color:#4f554f;font-size:12px;line-height:1.5;white-space:pre-line;overflow-wrap:anywhere}
.document-title{text-align:right;flex:0 0 auto}
.document-title h2{margin:0 0 7px;font-size:38px;letter-spacing:.06em}
.document-title strong{font-size:14px}
.document-parties{display:grid;grid-template-columns:1fr 220px;gap:28px;padding:27px 0}
.document-parties>div{display:grid;align-content:start}
.document-parties>div>strong{font-size:16px;margin-top:5px}
.document-label{font-size:10px;font-weight:900;letter-spacing:.12em;color:#555b55}
.document-meta{display:grid;gap:7px;margin:0}
.document-meta div{display:flex;justify-content:space-between;gap:15px}
.document-meta dt{color:#5b615b;font-size:11px}
.document-meta dd{margin:0;font-size:11px;font-weight:800;text-align:right}
.invoice-document .document-items{display:table;width:100%;min-width:0!important;max-width:100%;border:1px solid #aeb1aa;border-collapse:collapse;table-layout:fixed;font-size:11px}
.document-items th{padding:10px 8px;border:1px solid #aeb1aa;background:#171917;color:#fff;text-align:left;text-transform:uppercase;letter-spacing:.05em}
.document-items th:first-child{width:49%}
.document-items th:nth-child(2){width:11%;text-align:center}
.document-items th:nth-child(3),.document-items th:nth-child(4){width:20%;text-align:right}
.document-items td{padding:11px 8px;border:1px solid #aeb1aa;overflow-wrap:anywhere;vertical-align:top}
.document-items td:nth-child(2){text-align:center}
.document-items td:nth-child(3),.document-items td:nth-child(4){text-align:right;font-variant-numeric:tabular-nums}
.document-summary{display:block;margin-top:0;padding-top:10px}
.document-summary dl{width:100%;margin:0;border:1px solid #aeb1aa}
.document-summary dl>div{display:flex;justify-content:space-between;gap:20px;padding:8px 10px;border-bottom:1px solid #aeb1aa;font-size:12px}
.document-summary dl>div:last-child{border-bottom:0}
.document-summary dt{color:#555b55}
.document-summary dd{margin:0;font-weight:800;font-variant-numeric:tabular-nums}
.document-summary .document-total{margin-top:0;padding:11px 10px;border-top:0;font-size:16px}
.document-summary .document-balance{margin-top:0;padding:12px 10px;background:#e0f3e9;font-size:16px}
.document-summary .document-balance dt,.document-summary .document-balance dd{color:#0b6047;font-weight:900}
.document-notes{margin-top:28px;padding-top:14px;border-top:1px solid #c9cbc6;break-inside:avoid}
.document-notes p{margin:6px 0 0;font-size:11px;line-height:1.5;white-space:pre-line;overflow-wrap:anywhere}

@media(max-width:1060px){.invoice-layout{grid-template-columns:1fr}.preview-column{position:static}.invoice-document{min-height:0}.preview-column{max-width:760px;margin:0 auto;width:100%}}
@media(max-width:680px){.invoice-layout{gap:20px}.invoice-editor{border-radius:20px;box-shadow:5px 6px 0 var(--ink)}.editor-section{padding:20px 16px}.section-heading{grid-template-columns:34px 1fr}.section-heading h2{font-size:22px}.item-heading{grid-template-columns:34px 1fr}.item-heading .compact-button{grid-column:2;justify-self:start;margin-top:6px}.two-columns,.totals-fields,.editor-actions{grid-template-columns:1fr}.item-labels{display:none}.line-item{grid-template-columns:1fr 1fr 40px;padding:14px 0}.line-item label:first-child{grid-column:1/-1}.line-item label>span{display:block;margin-bottom:5px;color:var(--muted);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.06em}.item-amount{grid-column:1/3;text-align:left}.remove-line{grid-column:3;grid-row:2;align-self:end}.live-balance{grid-column:1}.action-help,.status-line{grid-column:1}.invoice-document{padding:25px 18px}.document-header{gap:14px}.document-title h2{font-size:28px}.document-parties{grid-template-columns:1fr;gap:20px}.document-meta{max-width:250px}.document-items{font-size:10px}.document-items th,.document-items td{padding-left:5px;padding-right:5px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

@page{size:Letter portrait;margin:.48in}
@media print{
  html,body{width:auto!important;min-width:0!important;margin:0!important;padding:0!important;background:#fff!important}
  body>*:not(main),main>*:not(.invoice-workspace){display:none!important}
  .invoice-workspace{display:block!important;width:auto!important;max-width:none!important;margin:0!important;padding:0!important}
  .privacy-strip,.invoice-editor,.preview-label{display:none!important}
  .invoice-layout,.preview-column{display:block!important;width:auto!important;max-width:none!important;margin:0!important;padding:0!important}
  .preview-column{position:static!important}
  .invoice-document{display:block!important;width:100%!important;min-height:0!important;overflow:visible!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;color:#000!important}
  .document-header{padding-bottom:.2in;border-bottom:3px solid #000}
  .document-items{font-size:9.5pt}
  .document-items thead{display:table-header-group}
  .document-items tr{break-inside:avoid;page-break-inside:avoid}
  .document-summary,.document-notes{break-inside:avoid;page-break-inside:avoid}
  .document-summary .document-balance{background:#eef5f1!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .document-items th{background:#171917!important;color:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
