.intro {padding-block:clamp(24px,4vw,52px)}
.intro h1 {font-size:clamp(2.2rem,4.6vw,3.8rem)}
.invoice-grid {display:grid;grid-template-columns:minmax(0,0.93fr) minmax(0,1.07fr);gap:clamp(18px,3vw,38px);align-items:start;padding-block:30px}
fieldset {min-width:0;border:0;border-top:1px solid var(--line);margin:1.4rem 0 0;padding:1rem 0 0}
legend {padding:0 .75rem 0 0;font-weight:750;font-size:1.03rem}
.editor-title {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem}
.editor-title h2,.preview-label {font-size:1.4rem;letter-spacing:-.04em}
.editor-title select {width:auto}
label {display:block;color:#3d5752;font-size:.79rem;font-weight:630;margin:.55rem 0 .24rem}
.row2 {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px}
.lookup-row,.actions {display:flex;gap:7px}
.lookup-row button {flex:none}
.actions {flex-wrap:wrap;margin-top:16px}
#aresStatus {font-size:.83rem;color:var(--muted);margin-top:.6rem}
#aresStatus:empty {display:none}
.preview {
  position:sticky;
  top:12px;
  min-width:0;
  container-type:inline-size;
}
.preview-label { margin:0 0 12px; }
.sheet {
  background:#fff;
  color:#203432;
  border:1px solid #cdd8d0;
  border-radius:8px;
  box-shadow:0 3px 14px #18392b0b;
  padding:clamp(18px,5cqi,38px);
  font-size:1rem;
  line-height:1.48;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}
.sheet [hidden] { display:none; }
.sheet-head { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:14px 24px; padding-bottom:22px; border-bottom:1px solid var(--line); }
.sheet-head h3 { margin:0 0 3px; font-size:clamp(1.9rem,6cqi,2.55rem); font-weight:690; letter-spacing:-.055em; }
.sheet-number,.sheet-dates { font-size:.875rem; color:var(--muted); }
.sheet-number strong,.sheet-dates dd { color:var(--ink); font-weight:650; }
.sheet-dates { display:grid; grid-template-columns:auto auto; gap:4px 13px; margin-top:4px; }
.sheet-dates > div { display:contents; }
.sheet-dates dd { text-align:end; }
.sheet-parties { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 25px; padding-block:23px 26px; }
.sheet-parties h4 { color:var(--muted); font-size:.8rem; font-weight:600; margin:0 0 4px; }
.party-name { display:block; font-size:1.05rem; font-weight:680; }
.party-id,.vat-note { font-size:.84rem; color:var(--muted); }
.vat-note:empty,.sheet-payment:not(:has(.payment-lines > div:not([hidden]), figure:not([hidden]))) { display:none; }
.unsupported-supplier .vat-note { color:#8a351f; }
.invoice-items { width:100%; border-collapse:collapse; table-layout:fixed; }
.invoice-items th,.invoice-items td { padding:8px 0; vertical-align:top; text-align:left; }
.invoice-items th { border-bottom:1px solid var(--line); font-size:.8rem; color:var(--muted); font-weight:600; }
.invoice-items td { padding-block:12px 17px; }
.invoice-items :is(th,td):last-child { width:36%; text-align:end; padding-left:10px; }
.invoice-total { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:2px 16px; background:var(--tint); padding:14px 17px; border-radius:5px; }
#lblTotal { font-weight:620; }
#pTotal { font-size:clamp(1.45rem,4.5cqi,1.9rem); color:var(--dark); font-weight:700; letter-spacing:-.045em; }
#pCnbEq { font-size:.83rem; color:var(--muted); }
#pCnbEq:not(:empty) { margin-top:8px; }
.sheet-payment { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:15px; margin-top:18px; }
.payment-lines { display:grid; grid-template-columns:auto minmax(0,1fr); gap:3px 14px; min-width:0; font-size:.85rem; }
.payment-lines > div { display:contents; }
.payment-lines dt { color:var(--muted); }
.payment-lines dd { font-weight:590; }
#sheetQr { margin:0; width:135px; max-width:100%; justify-self:end; text-align:center; }
#invQr { display:block; width:135px; max-width:min(135px,100%); height:auto!important; margin:auto; }
#lblQrType { color:var(--muted); font-size:.73rem; }
.sheet-foot { display:flex; flex-wrap:wrap; justify-content:space-between; gap:3px 15px; margin-top:22px; border-top:1px solid var(--line); padding-top:10px; font-size:.73rem; color:var(--muted); }
.sheet-foot a { color:inherit; text-decoration:none; }
.sheet-foot a:hover,.sheet-foot a:focus-visible { text-decoration:underline; }
#editorQrHint { margin-top:7px; font-size:.8rem; }
@container (max-width:500px) {
  .sheet-dates { font-size:.8rem; gap:3px 8px; }
  .sheet-parties { gap:14px; }
  .invoice-items :is(th,td):last-child { width:42%; }
  .payment-lines { column-gap:8px; }
}
@container (max-width:365px) {
  .sheet-dates { margin-top:0; }
  .sheet-head { gap:10px; }
  .sheet-parties { grid-template-columns:1fr; padding-block:18px; }
  .sheet { padding:16px; }
}
.banner {display:flex;justify-content:space-between;align-items:center;gap:18px;border-top:1px solid var(--line);padding:22px 0;color:var(--muted);font-size:.9rem}
.banner canvas {max-width:90px;height:auto!important}
#printWarning {display:none}
.unsupported-supplier #printWarning {display:block;padding:12px;background:#fff2cd;color:#462a00}
@media(max-width:950px){.invoice-grid{grid-template-columns:minmax(0,1fr)}.preview{position:static;width:min(100%,780px);margin-inline:auto}}
@media(max-width:570px){.row2{grid-template-columns:minmax(0,1fr)}.row2.dates{grid-template-columns:1fr 1fr}.editor-title h2{width:100%}.banner{flex-wrap:wrap}.nav{width:100%}}
@media print {
  @page { size:A4; margin:15mm; }
  body,.preview { background:white; }
  .no-print { display:none!important; }
  .wrap,.invoice-grid,.preview,.sheet { display:block; width:100%; max-width:none; margin:0; padding:0; border:0; box-shadow:none; }
  .preview { position:static; container-type:normal; }
  .sheet { font-size:11pt; }
  .sheet-head h3 { font-size:26pt; }
  .sheet-parties { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .invoice-total { background:white; border-block:1px solid #6f8b7c; border-radius:0; padding-inline:0; }
  #pTotal { font-size:20pt; }
  #invQr { width:34mm; }
  .sheet-head,.sheet-parties,.invoice-total,.sheet-payment,tr { break-inside:avoid; }
  .unsupported-supplier main { display:none; }
}

.preview-toolbar {display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.preview-toolbar .preview-label {margin:0}
.sample-note {margin:0 0 7px;color:var(--pine);font-size:.8rem;font-weight:650}
#accountHint {font-size:.83rem;margin:5px 0 9px}
#bankOptions summary {width:fit-content;color:var(--pine);font-size:.86rem;font-weight:600;cursor:pointer}
#editorQrHint {color:#884024}
@media screen and (max-width:950px){.showing-sample .preview{order:-1}}

#editor {container-type:inline-size}
.invoice-metadata {display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:0 10px}
.invoice-metadata>div {min-width:0}
@container (max-width:510px) {
  .invoice-metadata {grid-template-columns:repeat(2,minmax(0,1fr))}
  .invoice-metadata>div:first-child {grid-column:1/-1}
}
.editor-preview-link {display:none}
@media screen and (max-width:950px) {
  .editor-preview-link {display:inline-block;margin-top:14px;font-weight:650;font-size:.9rem}
}
#copyStatus {align-self:center;font-size:.85rem;color:var(--pine)}

@container (max-width:450px) {
  .sheet-payment {grid-template-columns:minmax(0,1fr)}
  #sheetQr {justify-self:center}
}
