/* GSTInvoiceFree — invoice theme styles (live preview + print) and the design picker.
   Accent colours arrive as CSS variables on .iv: --ac, --ac-l (light), --ac-s (soft), --ac-b (border), --ac-on (text on accent). */

/* ============ design picker (app UI) ============ */
.design-picker { background: #fff; border: 1px solid #E2E8F0; border-radius: 14px; padding: 14px 14px 12px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.dp-row + .dp-row { margin-top: 12px; }
.dp-label { font-size: 12.5px; font-weight: 600; color: #475569; margin: 0 0 8px; text-transform: none; letter-spacing: 0; }
.dp-label b { color: #0F172A; }
.dp-themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dp-theme { display: flex; flex-direction: column; align-items: stretch; gap: 1px; padding: 6px 6px 7px; border: 1px solid #E2E8F0; border-radius: 10px; background: #fff; cursor: pointer; text-align: left; font-family: inherit; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.dp-theme:hover { border-color: #94A3B8; }
.dp-theme[aria-checked="true"] { border-color: #2563EB; box-shadow: 0 0 0 2px #2563EB; }
.dp-theme:focus-visible, .dp-swatch:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }
.dp-name { font-size: 12px; font-weight: 700; color: #0F172A; line-height: 1.25; margin-top: 5px; }
.dp-desc { font-size: 10.5px; color: #475569; line-height: 1.3; }
.dp-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.dp-swatch { width: 34px; height: 34px; padding: 3px; border-radius: 50%; border: 2px solid transparent; background: #fff; cursor: pointer; }
.dp-swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(15,23,42,.15); }
.dp-swatch[aria-checked="true"] { border-color: #0F172A; }
.dp-swatch:hover span { transform: scale(1.06); }

/* mini thumbnails */
.dp-thumb { --a: var(--thumb-ac, #2563EB); position: relative; display: block; height: 58px; border-radius: 5px; background: #fff; border: 1px solid #E5E7EB; overflow: hidden; }
.dp-thumb i { position: absolute; display: block; }
.dp-thumb .a { left: 0; right: 0; top: 0; height: 13px; background: var(--a); }
.dp-thumb .b { left: 6px; top: 18px; width: 38%; height: 3px; background: #CBD5E1; border-radius: 2px; }
.dp-thumb .c { right: 6px; top: 18px; width: 26%; height: 8px; background: #EEF2F7; border-radius: 2px; }
.dp-thumb .d { left: 6px; right: 6px; top: 30px; height: 5px; background: var(--a); }
.dp-thumb .e { left: 6px; right: 6px; top: 38px; height: 7px; background: repeating-linear-gradient(#E5E7EB 0 1px, transparent 1px 3.5px); }
.dp-thumb .f { right: 6px; bottom: 5px; width: 34%; height: 5px; background: var(--a); }
.dp-thumb--classic { border: 1.5px solid #374151; }
.dp-thumb--classic .a { left: 30%; right: 30%; top: 4px; height: 4px; background: #374151; }
.dp-thumb--classic .b { top: 12px; left: 4px; right: 4px; width: auto; height: 11px; background: none; border: 1px solid #374151; }
.dp-thumb--classic .c { display: none; }
.dp-thumb--classic .d { background: color-mix(in srgb, var(--a) 22%, #fff); border: 1px solid #374151; top: 28px; }
.dp-thumb--classic .f { background: none; border: 1px solid #374151; height: 6px; }
.dp-thumb--minimal .a { display: none; }
.dp-thumb--minimal .b { top: 7px; background: #475569; }
.dp-thumb--minimal .c { top: 6px; background: none; border-bottom: 2px solid var(--a); height: 4px; }
.dp-thumb--minimal .d { background: none; border-bottom: 1.5px solid var(--a); height: 3px; }
.dp-thumb--minimal .f { background: none; border-top: 1.5px solid var(--a); height: 0; }
.dp-thumb--corporate .a { background: #0F172A; height: 14px; border-bottom: 2px solid var(--a); }
.dp-thumb--corporate .c { left: 6px; right: 6px; width: auto; top: 20px; height: 6px; background: color-mix(in srgb, var(--a) 15%, #fff); }
.dp-thumb--corporate .b { display: none; }
.dp-thumb--corporate .d { background: #0F172A; }
.dp-thumb--elegant .a { background: none; border-top: 1.5px solid var(--a); border-bottom: 1px solid var(--a); height: 2px; top: 4px; left: 6px; right: 6px; }
.dp-thumb--elegant .b { left: 30%; width: 40%; top: 10px; background: #475569; }
.dp-thumb--elegant .c { display: none; }
.dp-thumb--elegant .d { background: none; border-bottom: 1px solid var(--a); height: 3px; }
.dp-thumb--elegant .f { background: none; border-top: 1px solid var(--a); height: 0; }
.dp-thumb--bold .a { height: 20px; }
.dp-thumb--bold .b { top: 23px; }
.dp-thumb--bold .c { display: none; }
.dp-thumb--bold .d { top: 30px; }
.dp-thumb--bold .f { height: 9px; bottom: 3px; width: 40%; }
.dp-thumb--compact .a { height: 3px; top: 9px; }
.dp-thumb--compact .b { top: 3px; height: 4px; background: #475569; }
.dp-thumb--compact .c { top: 3px; height: 4px; background: var(--a); }
.dp-thumb--compact .d { top: 16px; height: 4px; }
.dp-thumb--compact .e { top: 21px; height: 26px; background: repeating-linear-gradient(#E5E7EB 0 1px, transparent 1px 2.6px); }
.dp-thumb--compact .f { height: 4px; }
.dp-thumb--retail .a { left: 32%; right: 32%; top: 4px; height: 4px; background: #475569; border-radius: 2px; }
.dp-thumb--retail .b { left: 6px; right: 6px; width: auto; top: 12px; height: 1.5px; background: var(--a); }
.dp-thumb--retail .c { left: 36%; right: 36%; width: auto; top: 10px; height: 5px; background: var(--a); border-radius: 3px; }
.dp-thumb--retail .f { left: 6px; right: 6px; width: auto; height: 6px; }
@media (max-width: 1100px) { .dp-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) { .dp-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 520px) and (max-width: 768px) { .dp-themes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ============ invoice base ============ */
.invoice-preview { padding: 0 !important; overflow: hidden; }
.iv { --ink: #374151; --rule: #D1D5DB; --tx: #111827; --mu: #4B5563; font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; color: var(--tx); font-size: 10.5px; line-height: 1.5; padding: 30px; min-height: 600px; background: #fff; position: relative; }
.iv p { margin: 0; }
.iv b { font-weight: 700; }
.iv-label { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ac); margin-bottom: 4px !important; }
.iv-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 10px; }
.iv-brand { min-width: 0; flex: 1 1 auto; }
.iv-logo { max-height: 52px; max-width: 150px; object-fit: contain; display: block; }
.iv-name { font-size: 18px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.iv-sub { font-size: 9.5px; color: var(--mu); margin-top: 3px !important; display: none; overflow-wrap: anywhere; }
.iv-titlebox { text-align: right; flex: none; max-width: 50%; }
.iv-title { font-size: 20px; font-weight: 700; letter-spacing: .02em; line-height: 1.15; }
.iv-rc { font-size: 9.5px; color: var(--mu); margin-bottom: 10px !important; }
.iv-meta { display: grid; grid-template-columns: auto auto; gap: 3px 14px; margin: 0 0 14px auto; width: max-content; max-width: 100%; }
.iv-meta > div { display: contents; }
.iv-meta dt { color: var(--mu); text-align: right; margin: 0; }
.iv-meta dd { font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.iv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.iv-party { min-width: 0; overflow-wrap: anywhere; }
.iv-pname { font-weight: 700; font-size: 11.5px; }
.iv-tablewrap { overflow-x: auto; margin-bottom: 12px; }
.iv-table { width: 100%; border-collapse: collapse; font-size: 10px; min-width: 460px; }
.iv-table th { font-size: 9px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 6px; font-weight: 700; }
.iv-table td { padding: 5px 6px; vertical-align: top; }
.iv-table .c { text-align: center; } .iv-table .r { text-align: right; white-space: nowrap; } .iv-table .d { text-align: left; overflow-wrap: anywhere; }
.iv-sum { display: grid; grid-template-columns: 1fr minmax(210px, 42%); gap: 16px; align-items: start; margin-bottom: 14px; }
.iv-words { order: 0; }
.iv-totals { order: 1; width: 100%; border-collapse: collapse; font-size: 10.5px; }
.iv-totals td { padding: 3px 8px; }
.iv-totals td:first-child { color: var(--mu); }
.iv-totals td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.iv-totals .iv-disc td:last-child { color: #DC2626; }
.iv-grand td { font-size: 13px; font-weight: 800 !important; color: var(--ac) !important; border-top: 2px solid var(--ac); padding-top: 6px; }
.iv-foot { display: grid; grid-template-columns: 1fr 190px; gap: 20px; align-items: end; padding-top: 12px; border-top: 1px solid var(--rule); }
.iv-left > * + * { margin-top: 8px; }
.iv-bank p, .iv-notes p { font-size: 10px; }
.iv-notes { color: var(--mu); }
.iv-sign { text-align: center; }
.iv-for { font-weight: 700; font-size: 10.5px; overflow-wrap: anywhere; }
.iv-sign-line { border-top: 1px solid var(--tx); margin: 30px 0 4px; }
.iv-sign p:last-child { font-size: 9.5px; color: var(--mu); }

/* ============ 1. Classic GST ============ */
.iv--classic { border: 1.5px solid var(--ink); margin: 12px; padding: 0; min-height: 0; }
.iv--classic .iv-head { flex-direction: column-reverse; align-items: stretch; gap: 0; margin: 0; border-bottom: 1px solid var(--ink); }
.iv--classic .iv-titlebox { max-width: none; text-align: center; padding: 8px 10px 2px; border-bottom: 3px solid var(--ac); }
.iv--classic .iv-title { font-size: 16px; letter-spacing: .14em; }
.iv--classic .iv-brand { padding: 10px; }
.iv--classic .iv-name { font-size: 15px; }
.iv--classic .iv-sub { display: block; }
.iv--classic .iv-rc { text-align: center; margin: 0 !important; padding: 2px 0 6px; order: -1; }
.iv--classic .iv-meta { width: auto; margin: 0; border-bottom: 1px solid var(--ink); grid-template-columns: repeat(4, auto); padding: 6px 10px; justify-content: start; }
.iv--classic .iv-meta dt { text-align: left; }
.iv--classic .iv-parties { gap: 0; margin: 0; border-bottom: 1px solid var(--ink); }
.iv--classic .iv-party { padding: 0 10px 8px; }
.iv--classic .iv-party + .iv-party { border-left: 1px solid var(--ink); }
.iv--classic .iv-party .iv-label { color: var(--tx); background: var(--ac-l); margin: 0 -10px 6px !important; padding: 4px 10px; border-bottom: 1px solid var(--ink); }
.iv--classic .iv-tablewrap { margin: 0; }
.iv--classic .iv-table th { background: var(--ac-l); color: var(--tx); border: 1px solid var(--ink); border-top: 0; }
.iv--classic .iv-table td { border: 1px solid #9CA3AF; }
.iv--classic .iv-table th:first-child, .iv--classic .iv-table td:first-child { border-left: 0; }
.iv--classic .iv-table th:last-child, .iv--classic .iv-table td:last-child { border-right: 0; }
.iv--classic .iv-sum { margin: 0; gap: 0; border-bottom: 1px solid var(--ink); }
.iv--classic .iv-words { padding: 8px 10px; }
.iv--classic .iv-words .iv-label { color: var(--tx); }
.iv--classic .iv-totals { border-left: 1px solid var(--ink); }
.iv--classic .iv-totals td { border-bottom: 1px solid #E5E7EB; }
.iv--classic .iv-grand td { color: var(--tx) !important; border-top: 1px solid var(--ink); background: var(--ac-l); }
.iv--classic .iv-foot { border-top: 0; padding: 10px; }

/* ============ 2. Modern ============ */
.iv--modern { padding-top: 0; }
.iv--modern .iv-head { background: var(--ac); color: var(--ac-on); margin: 0 -30px 6px; padding: 22px 30px; }
.iv--modern .iv-name, .iv--modern .iv-title { color: var(--ac-on); }
.iv--modern .iv-rc { text-align: right; }
.iv--modern .iv-sub { display: block; color: var(--mu); }
.iv--modern .iv-head .iv-sub { display: none; }
.iv--modern .iv-meta { background: var(--ac-l); border: 1px solid var(--ac-b); border-radius: 6px; padding: 8px 12px; }
.iv--modern .iv-party .iv-label { background: var(--ac); color: var(--ac-on); padding: 4px 8px; margin-bottom: 6px !important; }
.iv--modern .iv-party { border: 1px solid var(--ac-b); padding: 0 0 8px; }
.iv--modern .iv-party > p { padding: 0 8px; }
.iv--modern .iv-parties { gap: 0; }
.iv--modern .iv-table th { background: var(--ac); color: var(--ac-on); }
.iv--modern .iv-table tbody tr:nth-child(even) td { background: var(--ac-s); }
.iv--modern .iv-totals { background: var(--ac-l); border: 1px solid var(--ac-b); }
.iv--modern .iv-words { background: var(--ac-l); border: 1px solid var(--ac-b); border-radius: 6px; padding: 8px 10px; }

/* ============ 3. Minimal ============ */
.iv--minimal { padding: 36px; }
.iv--minimal .iv-head { border-bottom: 1px solid var(--rule); padding-bottom: 14px; margin-bottom: 14px; }
.iv--minimal .iv-name { font-size: 16px; font-weight: 600; }
.iv--minimal .iv-title { color: var(--ac); font-weight: 400; letter-spacing: .25em; text-transform: uppercase; font-size: 16px; }
.iv--minimal .iv-party .iv-label { border-bottom: 1px solid var(--rule); padding-bottom: 4px; margin-bottom: 6px !important; }
.iv--minimal .iv-table th { color: var(--ac); border-bottom: 1.5px solid var(--ac); text-align: inherit; }
.iv--minimal .iv-table td { border-bottom: 1px solid #EEF0F3; }
.iv--minimal .iv-words { border-top: 1px solid var(--rule); padding-top: 8px; }
.iv--minimal .iv-grand td { border-top-width: 1px; }
.iv--minimal .iv-foot { border-top-color: #EEF0F3; }

/* ============ 4. Corporate ============ */
.iv--corporate { padding-top: 0; }
.iv--corporate .iv-head { background: #0F172A; margin: 0 -30px 0; padding: 20px 30px 16px; border-bottom: 4px solid var(--ac); }
.iv--corporate .iv-name, .iv--corporate .iv-title { color: #fff; }
.iv--corporate .iv-title { letter-spacing: .08em; }
.iv--corporate .iv-sub { display: block; color: #CBD5E1; }
.iv--corporate .iv-rc { text-align: right; margin-top: 6px !important; }
.iv--corporate .iv-meta { width: auto; margin: 0 0 16px; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--ac-l); border: 1px solid var(--ac-b); }
.iv--corporate .iv-meta > div { display: block; padding: 6px 10px; }
.iv--corporate .iv-meta > div + div { border-left: 1px solid var(--ac-b); }
.iv--corporate .iv-meta dt { text-align: left; font-size: 8.5px; text-transform: uppercase; letter-spacing: .05em; }
.iv--corporate .iv-meta dd { font-size: 11px; }
.iv--corporate .iv-party .iv-label { border-bottom: 2px solid var(--ac); padding-bottom: 3px; margin-bottom: 6px !important; color: #0F172A; }
.iv--corporate .iv-table th { background: #0F172A; color: #fff; border-bottom: 3px solid var(--ac); }
.iv--corporate .iv-table tbody tr:nth-child(even) td { background: var(--ac-s); }
.iv--corporate .iv-totals { background: var(--ac-l); border: 1px solid var(--ac-b); }
.iv--corporate .iv-words { background: var(--ac-l); border: 1px solid var(--ac-b); padding: 8px 10px; }

/* ============ 5. Elegant ============ */
.iv--elegant { font-family: Georgia, 'Times New Roman', serif; padding: 36px 40px; }
.iv--elegant .iv-head { flex-direction: column; text-align: center; gap: 4px; border-top: 3px double var(--ac); border-bottom: 3px double var(--ac); padding: 14px 0; margin-bottom: 14px; }
.iv--elegant .iv-brand, .iv--elegant .iv-titlebox { text-align: center; max-width: none; }
.iv--elegant .iv-logo { margin: 0 auto; }
.iv--elegant .iv-name { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; font-size: 22px; }
.iv--elegant .iv-sub { display: block; }
.iv--elegant .iv-title { color: var(--ac); font-weight: 400; letter-spacing: .4em; font-size: 15px; text-transform: uppercase; margin-top: 6px; }
.iv--elegant .iv-rc { text-align: center; font-style: italic; }
.iv--elegant .iv-label { font-family: 'DM Sans', sans-serif; letter-spacing: .12em; }
.iv--elegant .iv-party .iv-label { border-bottom: 1px solid var(--rule); padding-bottom: 4px; margin-bottom: 6px !important; }
.iv--elegant .iv-table th { color: var(--ac); border-bottom: 1px solid var(--ac); border-top: 1px solid var(--ac); font-family: 'DM Sans', sans-serif; }
.iv--elegant .iv-table td { border-bottom: 1px solid #EEF0F3; }
.iv--elegant .iv-words p { font-style: italic; }
.iv--elegant .iv-grand td { border-top: 1px double var(--ac); border-top-width: 3px; border-top-style: double; }

/* ============ 6. Bold ============ */
.iv--bold { padding-top: 0; }
.iv--bold .iv-head { background: var(--ac); margin: 0 -30px 6px; padding: 32px 30px; align-items: flex-end; }
.iv--bold .iv-name, .iv--bold .iv-title { color: var(--ac-on); }
.iv--bold .iv-name { font-size: 20px; }
.iv--bold .iv-title { font-size: 30px; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; }
.iv--bold .iv-rc { text-align: right; }
.iv--bold .iv-meta { width: auto; margin: 4px 0 18px; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: 6px; }
.iv--bold .iv-meta > div { display: block; padding: 6px 10px; }
.iv--bold .iv-meta > div + div { border-left: 1px solid var(--rule); }
.iv--bold .iv-meta dt { text-align: left; font-size: 8.5px; text-transform: uppercase; }
.iv--bold .iv-meta dd { font-size: 12px; }
.iv--bold .iv-party .iv-label { background: var(--ac); color: var(--ac-on); padding: 4px 8px; }
.iv--bold .iv-pname { font-size: 13px; }
.iv--bold .iv-table th { background: var(--ac); color: var(--ac-on); font-size: 9.5px; }
.iv--bold .iv-table tbody tr:nth-child(even) td { background: var(--ac-s); }
.iv--bold .iv-grand td { background: var(--ac); color: var(--ac-on) !important; border: 0; font-size: 18px; padding: 10px 8px; }
.iv--bold .iv-words { background: var(--ac-l); border-radius: 6px; padding: 8px 10px; }

/* ============ 7. Compact ============ */
.iv--compact { padding: 18px; font-size: 9px; line-height: 1.35; }
.iv--compact .iv-head { border-bottom: 2px solid var(--ac); padding-bottom: 6px; margin-bottom: 4px; }
.iv--compact .iv-name { font-size: 13px; }
.iv--compact .iv-title { font-size: 14px; color: var(--ac); }
.iv--compact .iv-logo { max-height: 30px; }
.iv--compact .iv-rc { font-size: 8.5px; margin-bottom: 6px !important; }
.iv--compact .iv-meta { width: auto; grid-template-columns: repeat(8, auto); justify-content: end; gap: 2px 6px; margin: 0 0 8px; font-size: 8.5px; }
.iv--compact .iv-parties { gap: 8px; margin-bottom: 8px; }
.iv--compact .iv-party { border: 1px solid var(--ac-b); padding: 4px 6px; font-size: 8.5px; }
.iv--compact .iv-pname { font-size: 9.5px; }
.iv--compact .iv-label { font-size: 8px; margin-bottom: 2px !important; }
.iv--compact .iv-table { font-size: 8.5px; }
.iv--compact .iv-table th { background: var(--ac); color: var(--ac-on); padding: 3px 4px; font-size: 8px; }
.iv--compact .iv-table td { padding: 2px 4px; border: 1px solid var(--ac-b); }
.iv--compact .iv-table tbody tr:nth-child(even) td { background: var(--ac-s); }
.iv--compact .iv-sum { margin-bottom: 8px; gap: 10px; }
.iv--compact .iv-totals { font-size: 9px; background: var(--ac-l); border: 1px solid var(--ac-b); }
.iv--compact .iv-totals td { padding: 1px 6px; }
.iv--compact .iv-grand td { font-size: 11px; }
.iv--compact .iv-foot { padding-top: 6px; grid-template-columns: 1fr 150px; }
.iv--compact .iv-sign-line { margin-top: 20px; }

/* ============ 8. Retail & Services ============ */
.iv--retail .iv-head { flex-direction: column; text-align: center; gap: 6px; margin-bottom: 4px; padding-bottom: 12px; border-bottom: 2px solid var(--ac); position: relative; }
.iv--retail .iv-brand { text-align: center; }
.iv--retail .iv-logo { margin: 0 auto; }
.iv--retail .iv-name { font-size: 20px; }
.iv--retail .iv-sub { display: block; }
.iv--retail .iv-titlebox { max-width: none; text-align: center; position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 50%); }
.iv--retail .iv-title { background: var(--ac); color: var(--ac-on); font-size: 11px; letter-spacing: .1em; padding: 4px 16px; border-radius: 99px; white-space: nowrap; }
.iv--retail .iv-rc { text-align: center; margin-top: 16px !important; }
.iv--retail .iv-meta { width: auto; margin: 0 0 14px; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--rule); }
.iv--retail .iv-meta > div { display: block; padding: 5px 10px; }
.iv--retail .iv-meta > div + div { border-left: 1px solid var(--rule); }
.iv--retail .iv-meta dt { text-align: left; font-size: 8.5px; text-transform: uppercase; }
.iv--retail .iv-party .iv-label { background: var(--ac); color: var(--ac-on); padding: 4px 8px; }
.iv--retail .iv-party { border: 1px solid var(--ac-b); padding: 0 0 8px; }
.iv--retail .iv-party > p { padding: 0 8px; }
.iv--retail .iv-parties { gap: 0; }
.iv--retail .iv-table th { background: var(--ac); color: var(--ac-on); }
.iv--retail .iv-table tbody tr:nth-child(even) td { background: var(--ac-s); }
.iv--retail .iv-sum { grid-template-columns: 1fr minmax(210px, 42%); }
.iv--retail .iv-grand td { background: var(--ac); color: var(--ac-on) !important; border: 0; font-size: 14px; padding: 8px; }
.iv--retail .iv-words { background: var(--ac-l); border: 1px solid var(--ac-b); padding: 8px 10px; }

/* ============ narrow preview (phones) ============ */
@media (max-width: 560px) {
  .iv { padding: 18px; }
  .iv--modern .iv-head, .iv--bold .iv-head, .iv--corporate .iv-head { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
  .iv-parties, .iv-sum, .iv-foot { grid-template-columns: 1fr; }
  .iv--classic .iv-party + .iv-party { border-left: 0; border-top: 1px solid var(--ink); }
  .iv--classic .iv-totals { border-left: 0; border-top: 1px solid var(--ink); }
  .iv--corporate .iv-meta, .iv--bold .iv-meta, .iv--retail .iv-meta, .iv--classic .iv-meta { grid-template-columns: 1fr 1fr; }
  .iv--compact .iv-meta { grid-template-columns: repeat(4, auto); justify-content: start; }
  .iv-head { flex-wrap: wrap; }
  .iv-title { font-size: 16px; }
  .iv--bold .iv-title { font-size: 22px; }
}

/* ============ print: only the invoice, A4 ============ */
@media print {
  @page { size: A4; margin: 10mm; }
  html.is-printing-invoice, html.is-printing-invoice body { background: #fff !important; overflow: visible !important; }
  html.is-printing-invoice body > *:not(main) { display: none !important; }
  html.is-printing-invoice main > *:not(.main) { display: none !important; }
  html.is-printing-invoice .main { display: block !important; min-height: 0 !important; }
  html.is-printing-invoice .form-panel, html.is-printing-invoice #designPicker, html.is-printing-invoice .preview-label, html.is-printing-invoice .preview-close { display: none !important; }
  html.is-printing-invoice #previewPanel { display: block !important; position: static !important; height: auto !important; overflow: visible !important; padding: 0 !important; background: #fff !important; box-shadow: none !important; }
  html.is-printing-invoice #invoicePreview { box-shadow: none !important; border-radius: 0 !important; overflow: visible !important; min-height: 0 !important; }
  html.is-printing-invoice .iv { -webkit-print-color-adjust: exact; print-color-adjust: exact; min-height: 0; }
  html.is-printing-invoice .iv-tablewrap { overflow: visible; }
  html.is-printing-invoice .iv-table { min-width: 0; }
  html.is-printing-invoice .iv-table thead { display: table-header-group; }
  html.is-printing-invoice .iv-table tr, html.is-printing-invoice .iv-sum, html.is-printing-invoice .iv-foot { break-inside: avoid; }
  html.is-printing-invoice .iv-sum { break-before: avoid; page-break-before: avoid; }
}
