/* Invoices (/invoices/) and the customer's invoice page (/i/). Spec: netlify/specs/invoicing-phase-1.md.
   The look (Ram, 2026-11-10): clean, light and high-tech. Thin borders, crisp numbers that line up,
   small status chips with a dot, a live total that follows what you type. Colours keep their fixed
   meanings from ui/kit.css: blue = the main action, green = paid, amber = waiting, red = a problem. */
.iv-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "cv11" 1; letter-spacing: -0.01em; }
a.k-tab { display: inline-flex; align-items: center; text-decoration: none; }
.k-tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--blue); font-weight: 650; }
.iv-hero-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.iv-back { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: 0.95rem; text-decoration: none; color: var(--muted); }
.iv-back:hover { color: var(--ink); }

/* Status chips */
.iv-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.1rem 0.6rem 0.1rem 0.5rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600; border: 1px solid var(--line); color: var(--ink); background: var(--surface); white-space: nowrap; }
.iv-chip::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--muted); }
.iv-chip.ok { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.iv-chip.ok::before { background: var(--green); }
.iv-chip.wait { color: var(--amber); border-color: var(--amber); background: var(--amber-bg); }
.iv-chip.wait::before { background: var(--amber); }
.iv-chip.bad { color: var(--red); border-color: var(--red); background: var(--red-bg); }
.iv-chip.bad::before { background: var(--red); }

/* Number tiles on Overview */
.iv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.iv-stat { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem 1.2rem; background: var(--surface); overflow: hidden; }
.iv-stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--blue); opacity: 0.85; }
.iv-stat.ok::before { background: var(--green); }
.iv-stat.bad::before { background: var(--red); }
.iv-stat.wait::before { background: var(--amber); }
.iv-stat.calm::before { background: var(--line); }
.iv-stat-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.iv-stat-value { font-size: 1.85rem; font-weight: 650; line-height: 1.2; margin-top: 0.25rem; letter-spacing: -0.025em; }
.iv-stat.bad .iv-stat-value { color: var(--red); }
.iv-stat-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }

/* Who owes how late */
.iv-aging-bar { display: flex; height: 0.7rem; border-radius: 999px; overflow: hidden; background: var(--soft); margin-top: 1rem; gap: 2px; }
.iv-aging-bar span { display: block; min-width: 4px; }
.iv-age-current { background: var(--blue); } .iv-age-d30 { background: #d97706; } .iv-age-d60 { background: #c2410c; } .iv-age-d90 { background: #b91c1c; } .iv-age-older { background: #7f1d1d; }
.iv-aging { list-style: none; padding: 0; margin: 0.9rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 0.6rem 1.25rem; }
.iv-aging li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 0.5rem; align-items: baseline; }
.iv-aging i { width: 0.65rem; height: 0.65rem; border-radius: 3px; display: inline-block; }
.iv-aging b { grid-column: 2; font-weight: 650; }
.iv-aging .small { color: var(--muted); }

/* Tables that turn into stacked cards on a phone */
.iv-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.95rem; }
.iv-table th { text-align: left; font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); background: var(--side); white-space: nowrap; }
.iv-table td { padding: 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.iv-table tr:last-child td { border-bottom: 0; }
.iv-table tbody tr:hover { background: var(--side); }
.iv-table .r { text-align: right; }
.iv-table a { font-weight: 600; text-decoration: none; }
.iv-table a:hover { text-decoration: underline; }
.iv-table-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 1rem; background: var(--surface); }
.iv-table-box .iv-table { margin-top: 0; }
.iv-gone td { color: var(--muted); text-decoration: line-through; }
.iv-gone td:last-child { text-decoration: none; }
.iv-empty { text-align: center; padding: 2.5rem 1rem; border: 1px dashed var(--line); border-radius: 12px; margin-top: 1rem; }
.iv-empty h2 { font-size: 1.1rem; }
.iv-empty .k-btn { margin-top: 1rem; }
.iv-tools { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; margin-top: 1.25rem; }
.iv-tools .k-input { max-width: 20rem; min-height: 2.75rem; }
.iv-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.iv-filter { font: inherit; font-size: 0.9rem; font-weight: 550; min-height: 2.75rem; padding: 0.3rem 0.9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.iv-filter[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
@media (max-width: 44rem) {
  .iv-table thead { position: absolute; left: -9999px; }
  .iv-table, .iv-table tbody, .iv-table tr, .iv-table td { display: block; width: 100%; }
  .iv-table tr { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); }
  .iv-table tr:last-child { border-bottom: 0; }
  .iv-table td { border: 0; padding: 0.15rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .iv-table td::before { content: attr(data-label); color: var(--muted); font-size: 0.85rem; text-align: left; flex: none; white-space: nowrap; }
  .iv-table td:first-child { font-size: 1.05rem; }
}

/* The editor: the form on the left, a live total that stays in view on the right */
.iv-edit { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 1.5rem; align-items: start; margin-top: 1.25rem; }
.iv-edit .k-card { margin-top: 0; }
.iv-edit-main { display: grid; gap: 1.25rem; }
.iv-side { position: sticky; top: 5rem; display: grid; gap: 1rem; }
.iv-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.9rem 1rem; margin-top: 1rem; }
.iv-fields .wide { grid-column: 1 / -1; }
.iv-f { display: grid; gap: 0.25rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); min-width: 0; align-content: start; }
.iv-f .k-input, .iv-f .k-select { min-height: 2.75rem; padding: 0.45rem 0.7rem; font-size: 1rem; color: var(--ink); }
.iv-f textarea.k-input { min-height: 4.5rem; resize: vertical; line-height: 1.45; }
.iv-f .k-hint { font-weight: 400; }
.iv-f input.r { text-align: right; }
.iv-line { display: grid; gap: 0.6rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.iv-line:first-child { border-top: 0; }
.iv-line-desc textarea.k-input { min-height: 2.75rem; height: 2.75rem; }
.iv-line-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.6rem 0.75rem; align-items: start; }
.iv-line-end { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.5rem; }
.iv-line-amt { font-weight: 650; font-size: 1.05rem; min-height: 2.75rem; display: flex; align-items: center; color: var(--ink); white-space: nowrap; }
.iv-x { font: inherit; width: 2.75rem; height: 2.75rem; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.iv-x:hover { color: var(--red); border-color: var(--line); }
.iv-pair { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.4rem; }
.iv-sum { display: grid; gap: 0.5rem; margin: 0.9rem 0 0; }
.iv-sum div { display: flex; justify-content: space-between; gap: 1rem; }
.iv-sum dt { color: var(--muted); } .iv-sum dd { margin: 0; font-weight: 550; }
.iv-sum .total { border-top: 1px solid var(--ink); padding-top: 0.7rem; margin-top: 0.2rem; }
.iv-sum .total dt { color: var(--ink); font-weight: 650; } .iv-sum .total dd { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.iv-saved { font-size: 0.9rem; color: var(--muted); min-height: 1.4rem; display: flex; align-items: center; gap: 0.4rem; }
.iv-saved.ok::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--green); }
.iv-saved.err { color: var(--red); }
.iv-stack { display: grid; gap: 0.6rem; }
@media (max-width: 64rem) { .iv-edit { grid-template-columns: minmax(0, 1fr); } .iv-side { position: static; } }

/* The invoice as the customer sees it. It is a document, so it stays white in dark mode too. */
.iv-paper { background: #fff; color: #111827; border: 1px solid #c3c9d4; border-radius: 12px; padding: 2.25rem 2.25rem 2rem; position: relative; overflow: hidden; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 12px 32px rgba(17, 24, 39, 0.07); font-size: 0.95rem; }
.iv-paper::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--iv-brand, #1d4ed8); }
.iv-paper-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem 2rem; }
.iv-paper-logo { max-height: 3.5rem; max-width: 11rem; display: block; margin-bottom: 1rem; }
.iv-paper h2 { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 0.75rem; color: #111827; }
.iv-stamp { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; color: #166534; border: 2px solid #166534; border-radius: 6px; padding: 0.1rem 0.5rem; }
.iv-stamp.void { color: #4b5563; border-color: #4b5563; }
.iv-facts { display: grid; grid-template-columns: auto auto; gap: 0.2rem 1rem; margin: 0; font-size: 0.9rem; }
.iv-facts dt { color: #4b5563; text-align: right; } .iv-facts dd { margin: 0; font-weight: 600; text-align: right; }
.iv-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.25rem 2rem; margin-top: 1.75rem; }
.iv-cap { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; color: #4b5563; text-transform: uppercase; margin: 0 0 0.3rem; }
.iv-parties b { display: block; font-size: 1.05rem; }
.iv-pre { white-space: pre-line; color: #4b5563; margin: 0.1rem 0 0; }
.iv-plines { width: 100%; border-collapse: collapse; margin-top: 1.75rem; }
.iv-plines th { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; color: #4b5563; text-transform: uppercase; text-align: left; padding: 0.5rem 0.6rem; background: #f4f6f9; }
.iv-plines td { padding: 0.7rem 0.6rem; border-bottom: 1px solid #d1d5db; vertical-align: top; }
.iv-plines .r { text-align: right; white-space: nowrap; }
.iv-plines th:first-child { width: 42%; }
.iv-plines small { display: block; color: #4b5563; font-size: 0.85rem; }
.iv-ptotals { margin: 1.25rem 0 0 auto; max-width: 20rem; display: grid; gap: 0.4rem; }
.iv-ptotals div { display: flex; justify-content: space-between; gap: 1.5rem; }
.iv-ptotals dt { color: #4b5563; } .iv-ptotals dd { margin: 0; }
.iv-ptotals .total { border-top: 1.5px solid #111827; padding-top: 0.6rem; margin-top: 0.3rem; }
.iv-ptotals .total dt { color: #111827; font-weight: 700; } .iv-ptotals .total dd { font-weight: 700; font-size: 1.25rem; }
.iv-pblock { margin-top: 1.5rem; }
.iv-pblock .iv-pre { color: #111827; }
.iv-paper-foot { margin-top: 2rem; padding-top: 0.9rem; border-top: 1px solid #d1d5db; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; color: #4b5563; font-size: 0.8rem; }
@media (max-width: 40rem) {
  .iv-paper { padding: 1.5rem 1.1rem 1.25rem; }
  .iv-facts dt, .iv-facts dd { text-align: left; }
  .iv-plines thead { position: absolute; left: -9999px; }
  .iv-plines, .iv-plines tbody, .iv-plines tr, .iv-plines td { display: block; }
  .iv-plines tr { padding: 0.7rem 0; border-bottom: 1px solid #d1d5db; }
  .iv-plines td { border: 0; padding: 0.1rem 0; }
  .iv-plines td.r { text-align: left; display: flex; justify-content: space-between; gap: 1rem; }
  .iv-plines td.r { flex-wrap: wrap; white-space: normal; text-align: right; gap: 0 1rem; }
  .iv-plines td.r::before { content: attr(data-label); color: #4b5563; font-size: 0.85rem; }
  .iv-plines td.r small { flex-basis: 100%; text-align: right; }
}

/* Two columns: the document, and what you can do with it */
.iv-two { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.5rem; align-items: start; margin-top: 1.25rem; }
.iv-two .k-card { margin-top: 0; }
.iv-two-side { display: grid; gap: 1rem; position: sticky; top: 5rem; }
@media (max-width: 68rem) { .iv-two { grid-template-columns: minmax(0, 1fr); } .iv-two-side { position: static; order: -1; } }
.iv-count { display: grid; gap: 0.75rem; justify-items: start; }
.iv-count-ring { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.iv-count-bar { height: 0.4rem; width: 100%; border-radius: 999px; background: var(--soft); overflow: hidden; }
.iv-count-bar span { display: block; height: 100%; width: 100%; background: var(--blue); transform-origin: left; }
@media (prefers-reduced-motion: no-preference) { .iv-count-bar span { transition: transform 1s linear; } }
.iv-hist { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.7rem; }
.iv-hist li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 0.7rem; }
.iv-hist li::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--line); margin-top: 0.5rem; }
.iv-hist .small { grid-column: 2; color: var(--muted); }
.iv-pays { list-style: none; margin: 0.75rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.iv-pays li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.iv-pays .gone { text-decoration: line-through; color: var(--muted); }
.iv-linkbox { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem; margin-top: 0.6rem; }
.iv-linkbox .k-input { font-family: var(--mono); font-size: 0.8rem; min-height: 2.75rem; }
.iv-logo-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.iv-logo-prev { max-height: 3.5rem; max-width: 11rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0.3rem; }
.iv-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.iv-plan { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin-top: 1.5rem; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 12px; font-size: 0.92rem; }
.iv-plan .k-progress { flex: 1 1 10rem; margin: 0; max-width: 16rem; }
.iv-plan.near { border-color: var(--amber); background: var(--amber-bg); color: var(--amber); }
.iv-setup-skip { grid-column: 2; justify-self: start; min-height: 2rem; padding: 0; font-size: 0.9rem; }
.k-step.skipped b { color: var(--muted); }

/* Dialogs and the small message at the bottom of the screen */
.iv-dialog { border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; width: min(30rem, calc(100vw - 2rem)); background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(8, 12, 22, 0.3); }
.iv-dialog::backdrop { background: rgba(8, 12, 22, 0.45); }
.iv-dialog h2 { font-size: 1.2rem; }
.iv-dialog .k-form { margin-top: 0.9rem; gap: 0.8rem; }
.iv-dialog-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; margin-top: 1.25rem; }
.iv-quick { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.iv-quick .iv-filter { min-height: 2.25rem; font-size: 0.85rem; }
.iv-toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--surface); padding: 0.75rem 1.1rem; border-radius: 10px; font-weight: 550; box-shadow: 0 12px 32px rgba(8, 12, 22, 0.3); max-width: calc(100vw - 2rem); }

/* The customer's page */
.iv-public { background: var(--bg); min-height: 100vh; }
.iv-public-wrap { max-width: 56rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; display: grid; gap: 1.25rem; }
.iv-paybox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.iv-paybox .iv-stat-value { font-size: 2rem; }
.iv-public-foot { text-align: center; color: var(--muted); font-size: 0.85rem; }
@media print {
  .iv-paybox, .iv-public-foot, .k-tabs, .k-hero, .iv-two-side, .iv-back { display: none !important; }
  .iv-paper { border: 0; box-shadow: none; padding: 0; } .iv-two { display: block; }
}
.iv-public-wrap { grid-template-columns: minmax(0, 1fr); }
.iv-two-side .k-card > .k-btn { margin-top: 1rem; }
.iv-two-side .k-card > .k-choices { margin-top: 0.75rem; }

/* ---------- step 2: early-pay, credits, reminders, files, statements, the demo ---------- */
.iv-ptotals .early dt, .iv-ptotals .early dd { color: #166534; font-weight: 600; }
.iv-early { margin-top: 0.4rem; color: var(--green); font-weight: 600; }
.iv-pair.iv-early { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin: 0; color: inherit; font-weight: inherit; }
.iv-pair.iv-early .k-input { width: 5.5rem; flex: 0 0 auto; }
.iv-pair.iv-early span { color: var(--muted); font-size: 0.95rem; font-weight: 400; }
.iv-alert { border-color: var(--red); background: var(--red-bg); }
.iv-alert h2 { color: var(--red); }
.iv-files { display: grid; gap: 0.6rem; justify-items: start; margin-top: 0.5rem; }
.iv-files .iv-pays { width: 100%; margin-top: 0; }
.iv-files .k-msg { width: 100%; }
.iv-range { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.iv-range .iv-f { min-width: 10rem; }
.iv-stat-inline { text-align: right; border: 0; background: none; padding: 0; min-width: 0; }
.iv-total-row td { font-weight: 700; border-top: 1.5px solid var(--ink); }
.iv-demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem; padding: 0.85rem 1.1rem; margin-bottom: 1.25rem;
  border: 1px solid var(--blue, #1d4ed8); border-radius: 12px; background: linear-gradient(180deg, rgba(29, 78, 216, 0.07), rgba(29, 78, 216, 0.03)); }
.iv-demo-bar > div:first-child { flex: 1 1 16rem; }
.iv-demo-bar span { color: var(--muted); }
.iv-demo-as { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.iv-demo-as > span { font-size: 0.9rem; font-weight: 600; margin-right: 0.2rem; }
@media (max-width: 640px) {
  .iv-demo-bar .k-btn { width: 100%; }
  .iv-stat-inline { text-align: left; }
}
.k-card > .iv-stack { margin-top: 0.75rem; }
.iv-stat-inline::before, .iv-stat-inline::after { display: none; }

/* Score fixes (2026-11-11): History sits under the invoice; a statement row is two short lines on a phone. */
.iv-two-main { min-width: 0; display: grid; gap: 1rem; }
.iv-two-main .k-card { margin-top: 0; }
@media (max-width: 44rem) {
  .iv-statement .iv-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 1rem; }
  .iv-statement .iv-table td { display: block; width: auto; padding: 0; }
  .iv-statement .iv-table td::before { content: none; }
  .iv-statement .iv-table td:nth-child(2) { grid-row: 1; grid-column: 1; text-align: left; font-weight: 550; }
  .iv-statement .iv-table td:nth-child(3) { grid-row: 1; grid-column: 2; text-align: right; font-weight: 550; }
  .iv-statement .iv-table td:nth-child(1) { grid-row: 2; grid-column: 1; text-align: left; font-size: 0.85rem; color: var(--muted); }
  .iv-statement .iv-table td:nth-child(4) { grid-row: 2; grid-column: 2; text-align: right; font-size: 0.85rem; color: var(--muted); }
  .iv-statement .iv-table td:nth-child(4)::before { content: "Balance "; display: inline; font-size: inherit; }
  .iv-statement .iv-table tr.iv-total-row td { border: 0; }
  .iv-statement .iv-table tr.iv-total-row td:nth-child(4) { color: var(--ink); font-weight: 650; font-size: 1rem; }
}
@media print { .iv-hist-card { display: none !important; } }

/* Reminders tab: one row per reminder, three starting points, and the email preview. */
.iv-rem-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 0.5rem; }
.iv-rem-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.iv-preset { display: inline-flex; flex-direction: column; align-items: flex-start; border-radius: 0.6rem; padding: 0.45rem 0.9rem; text-align: left; }
.iv-preset span { font-size: 0.8rem; font-weight: 400; opacity: 0.8; }
.iv-rem-rows { display: grid; gap: 0.5rem; }
.iv-rem-row { display: grid; grid-template-columns: 6.5rem 5rem minmax(0, 16rem) auto; gap: 0.6rem; align-items: center; }
.iv-rem-no { font-size: 0.9rem; color: var(--muted); }
.iv-word { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.iv-word .iv-word-edit { margin-top: 1rem; }
.iv-pv { margin-top: 1rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--bg, transparent); overflow: hidden; }
.iv-pv-top { font-size: 0.8rem; font-weight: 600; color: var(--muted); padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); }
.iv-pv-subj { font-weight: 650; padding: 0.9rem 1rem 0; overflow-wrap: anywhere; }
.iv-pv-body { padding: 0.25rem 1rem 1rem; overflow-wrap: anywhere; }
.iv-pv-body p { margin: 0.7rem 0 0; white-space: pre-line; }
.iv-pv-btn { display: inline-block; background: var(--blue); color: var(--on-blue); font-weight: 600; border-radius: 0.5rem; padding: 0.55rem 1rem; }
@media (max-width: 56rem) { .iv-word { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 34rem) {
  .iv-rem-row { grid-template-columns: 3.75rem minmax(0, 1fr); gap: 0.4rem 0.5rem; }
  .iv-rem-no { grid-column: 1; grid-row: 1; white-space: nowrap; }
  .iv-rem-row .k-link { grid-column: 2; grid-row: 1; justify-self: end; }
  .iv-rem-row input { grid-row: 2; grid-column: 1; }
  .iv-rem-row select { grid-row: 2; grid-column: 2; }
}

/* Import old invoices (#/import) */
.iv-imported { margin-left: 0.25rem; white-space: nowrap; }
.iv-center { justify-items: center; }
.iv-imp-step { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem; scroll-margin-top: 5rem; }
.iv-imp-step[hidden] { display: none; }
.iv-imp-h { display: flex; align-items: center; gap: 0.6rem; margin: 0; }
.iv-imp-h:focus { outline: none; }
.iv-imp-done { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.iv-imp-intro h2 { margin-top: 0; }
.iv-imp-promise { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.iv-imp-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.iv-imp-drop { display: grid; gap: 0.25rem; justify-items: center; text-align: center; padding: 1.6rem 1rem; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; background: var(--bg-soft, transparent); }
.iv-imp-drop b { color: var(--blue); font-size: 1.1rem; }
.iv-imp-drop:hover, .iv-imp-drop.over { border-color: var(--blue); }
.iv-imp-file:focus-visible + .iv-imp-drop { outline: 3px solid var(--blue); outline-offset: 2px; }
.iv-imp-details summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.iv-imp-details[open] { display: grid; gap: 0.6rem; }
.iv-imp-details summary { list-style: none; gap: 0.5rem; color: var(--blue); }
.iv-imp-details summary::-webkit-details-marker { display: none; }
.iv-imp-details summary::before { content: ""; width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; flex: none; }
.iv-imp-details[open] > summary::before { transform: rotate(45deg); }
.iv-imp-needs { display: grid; gap: 0.3rem; }
.iv-imp-needs h3 { margin: 0; font-size: 1rem; }
.iv-imp-needs p { margin: 0; }
.iv-imp-map { display: grid; gap: 0.5rem; }
.iv-imp-row { display: grid; grid-template-columns: minmax(11rem, 1fr) minmax(12rem, 1.2fr) minmax(8rem, 1fr); gap: 0.4rem 0.9rem; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.iv-imp-row.need .k-select { border-color: var(--red); }
.iv-imp-name { font-weight: 600; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.iv-imp-eg { overflow-wrap: anywhere; }
.iv-imp-problems { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.iv-imp-notes { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
@media (max-width: 700px) {
  .iv-imp-row { grid-template-columns: 1fr; }
  .iv-imp-templates .k-btn { width: 100%; }
}
.iv-table td.r.iv-num { white-space: nowrap; }
.iv-imp-folded { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; }
.iv-imp-more { align-items: center; }

/* ---------- Step 3: pay online ---------- */
/* Short notes under a number: a payment on its way, one that failed, "can pay online". */
.iv-note { margin: 0.6rem 0 0; padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.9rem; border: 1px solid var(--line); background: var(--bg); }
.iv-note.ok { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.iv-note.wait { color: var(--amber); border-color: var(--amber); background: var(--amber-bg); }
.iv-note.bad { color: var(--red); border-color: var(--red); background: var(--red-bg); }
.iv-sub { display: block; font-size: 0.85rem; color: var(--muted); }
.iv-sub.bad { color: var(--red); font-weight: 600; }
.iv-pay-acts { display: inline-flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; }
.iv-pay-acts .k-link, .iv-pays .k-link { min-height: 2.75rem; }
.iv-refunds { margin-top: 0; border-top: 0; }
.iv-refunds li { color: var(--muted); font-size: 0.92rem; }
/* Settings: the Online payments card */
.iv-online { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent); }
.iv-online .iv-fields { margin-top: 0.75rem; }
.iv-points { margin: 0.5rem 0 1rem; padding: 0; list-style: none; display: grid; gap: 0.45rem; }
.iv-points li { position: relative; padding-left: 1.6rem; }
.iv-points li::before { content: ""; position: absolute; left: 0.15rem; top: 0.42rem; width: 0.75rem; height: 0.4rem; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }
/* The customer's page: the line after coming back from Stripe, and the Pay now card */
.iv-banner { margin: 0; padding: 0.9rem 1.1rem; border-radius: 12px; border: 1px solid var(--green); background: var(--green-bg); color: var(--green); font-weight: 600; }
.iv-banner.wait { border-color: var(--amber); background: var(--amber-bg); color: var(--amber); }
.iv-banner.bad { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.iv-paynow { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent); display: grid; gap: 0.9rem; }
.iv-choices { display: grid; gap: 0.5rem; }
.iv-choice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.25rem 0.75rem; align-items: center; min-height: 3.25rem; padding: 0.6rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); }
.iv-choice:has(input:checked) { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, var(--surface)); box-shadow: inset 0 0 0 1px var(--blue); }
.iv-choice input[type="radio"] { width: 1.25rem; height: 1.25rem; accent-color: var(--blue); margin: 0; }
.iv-choice-text { display: grid; }
.iv-choice-note { font-size: 0.85rem; color: var(--muted); }
.iv-choice-amount { font-weight: 700; font-size: 1.1rem; }
.iv-choice-input { width: 8rem; min-height: 2.75rem; }
.iv-paybtn { min-height: 3.25rem; font-size: 1.1rem; padding-inline: 1.75rem; justify-self: start; }
.iv-secure { margin: 0; font-size: 0.85rem; color: var(--muted); padding-left: 1.4rem; position: relative; }
.iv-secure::before { content: ""; position: absolute; left: 0.1rem; top: 0.5rem; width: 0.8rem; height: 0.6rem; border-radius: 2px; background: var(--muted); box-shadow: 0 -0.38rem 0 -0.16rem var(--surface), 0 -0.38rem 0 0 var(--muted); }
@media (max-width: 34rem) {
  .iv-paybtn { width: 100%; justify-self: stretch; }
  .iv-choice { grid-template-columns: auto minmax(0, 1fr); }
  .iv-choice-amount, .iv-choice-input { grid-column: 2; }
  .iv-choice-input { width: 100%; }
}
/* The pay-all page */
.iv-all { max-width: 44rem; }
.iv-all-head { display: flex; gap: 1rem; align-items: center; }
.iv-all-head p { margin: 0.2rem 0 0; }
.iv-all-logo { max-height: 3.5rem; max-width: 9rem; object-fit: contain; }
.iv-all-card { padding: 0; overflow: hidden; }
.iv-all-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.25rem 0.9rem; align-items: center; min-height: 3.75rem; padding: 0.8rem 1.25rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.iv-all-row input[type="checkbox"] { width: 1.35rem; height: 1.35rem; accent-color: var(--blue); margin: 0; }
.iv-all-row:has(input[hidden]) { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.iv-all-main { display: grid; gap: 0.1rem; }
.iv-all-no { font-weight: 650; }
.iv-all-due { font-size: 0.88rem; color: var(--muted); }
.iv-all-due.bad { color: var(--red); font-weight: 600; }
.iv-all-due.wait { color: var(--amber); }
.iv-all-amount { font-weight: 700; font-size: 1.05rem; }
.iv-all-total { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; padding: 1.25rem; background: color-mix(in srgb, var(--blue) 5%, var(--surface)); }
.iv-all-total .iv-stat-value { font-size: 2rem; }
.iv-all-pay { display: grid; gap: 0.6rem; justify-items: end; }
.iv-all-pay .iv-secure { max-width: 22rem; }
.iv-pre { white-space: pre-wrap; margin: 0.5rem 0 0; }
@media (max-width: 34rem) { .iv-all-pay { justify-items: stretch; width: 100%; } .iv-all-row { padding-inline: 1rem; } }
@media print { .iv-paynow, .iv-banner, .iv-all-pay { display: none !important; } }
/* The invoice paper follows the room it has, not the window: beside the side column on a laptop it
   is narrow, so its lines stack the same way they do on a phone. Amounts never break in two. */
.iv-two-main, #paper { container-type: inline-size; }
.iv-ptotals dd { white-space: nowrap; }
@container (max-width: 34rem) {
  .iv-paper { padding: 1.5rem 1.1rem 1.25rem; }
  .iv-facts dt, .iv-facts dd { text-align: left; }
  .iv-plines thead { position: absolute; left: -9999px; }
  .iv-plines, .iv-plines tbody, .iv-plines tr, .iv-plines td { display: block; }
  .iv-plines tr { padding: 0.7rem 0; border-bottom: 1px solid #d1d5db; }
  .iv-plines td { border: 0; padding: 0.1rem 0; }
  .iv-plines td.r { display: flex; justify-content: space-between; flex-wrap: wrap; white-space: normal; text-align: right; gap: 0 1rem; }
  .iv-plines td.r::before { content: attr(data-label); color: #4b5563; font-size: 0.85rem; }
  .iv-plines td.r small { flex-basis: 100%; text-align: right; }
}
.iv-all-due.ok { color: var(--green, #166534); }
.iv-all-note { margin: 0 0 10px; font-size: 0.9rem; color: var(--muted); }
.iv-online .iv-hero-actions { margin: 1rem 0 0.75rem; }
.iv-choice input[type="radio"]:not(:checked) { border-radius: 50%; box-shadow: 0 0 0 1.5px var(--muted); }

/* Step 4a: the three designs, the brand colour, custom fields and the signature line. The colours
   arrive as --iv-brand (as picked), --iv-on (text that reads on it) and --iv-ink (dark enough for
   white text), set by invoices/look.js from a 6-digit hex only. */
.iv-custom { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.9rem 2rem; margin: 1.5rem 0 0; }
.iv-custom dd { margin: 0; overflow-wrap: anywhere; }
.iv-custom .iv-cap { margin-bottom: 0.15rem; }
.iv-sign { margin-top: 2rem; break-inside: avoid; }
.iv-sign-cells { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 1.25rem; margin-top: 2.25rem; }
.iv-sign-cells span { border-top: 1.5px solid #111827; padding-top: 0.3rem; color: #4b5563; font-size: 0.8rem; }
/* India GST (specs/invoicing-country-india-gst.md): GSTINs under the parties, HSN/SAC under a line, the signatory line. */
.iv-gstin { margin: 0.35rem 0 0; color: #111827; font-size: 0.9rem; font-weight: 600; letter-spacing: 0.02em; }
.iv-plines .iv-hsn { margin-top: 0.2rem; font-variant-numeric: tabular-nums; }
.iv-upper { text-transform: uppercase; }
.iv-upper::placeholder { text-transform: none; }
.iv-gst-sign { margin-left: auto; max-width: 18rem; text-align: right; }
.iv-gst-sign .iv-sign-cells { grid-template-columns: 1fr; }
.iv-gst-words { display: flex; flex-direction: column; align-items: flex-end; text-align: right; margin: 0.4rem 0 1rem auto; max-width: 26rem; }
.iv-gst-words .iv-cap { margin: 0; }
.iv-d-modern::before { display: none; }
.iv-d-modern .iv-paper-top { background: var(--iv-brand, #1d4ed8); color: var(--iv-on, #fff); margin: -2.25rem -2.25rem 0; padding: 1.75rem 2.25rem 1.5rem; align-items: center; }
.iv-d-modern .iv-paper-top h2, .iv-d-modern .iv-facts dt, .iv-d-modern .iv-facts dd { color: inherit; }
.iv-d-modern .iv-paper-top .iv-stamp { color: inherit; border-color: currentColor; }
.iv-d-modern .iv-paper-logo { background: #fff; padding: 0.35rem; border-radius: 6px; box-sizing: content-box; }
.iv-d-modern .iv-ptotals .total { border-top-color: var(--iv-ink, #1d4ed8); }
.iv-d-modern .iv-ptotals .total dd { font-size: 1.6rem; color: var(--iv-ink, #1d4ed8); }
.iv-d-compact { font-size: 0.86rem; padding: 1.6rem 1.75rem 1.4rem; }
.iv-d-compact h2 { font-size: 1.4rem; }
.iv-d-compact .iv-parties, .iv-d-compact .iv-plines, .iv-d-compact .iv-custom { margin-top: 1.1rem; }
.iv-d-compact .iv-plines td { padding: 0.35rem 0.6rem; }
.iv-d-compact .iv-plines th { padding: 0.3rem 0.6rem; }
.iv-d-compact .iv-ptotals { gap: 0.2rem; margin-top: 0.8rem; }
.iv-d-compact .iv-pblock { margin-top: 1rem; }
.iv-d-compact .iv-paper-foot { margin-top: 1.25rem; }
@media (max-width: 640px) {
  .iv-d-modern .iv-paper-top { margin: -1.5rem -1.1rem 0; padding: 1.25rem 1.1rem; }
  .iv-d-compact { padding: 1.25rem 1rem 1.1rem; }
  .iv-sign-cells { grid-template-columns: 1fr 1fr; }
}
@media print { .iv-d-modern .iv-paper-top { margin: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Step 4a: Settings, "The look of your invoices". */
.iv-look-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.5rem; align-items: start; margin-top: 1rem; }
.iv-look-form { display: grid; gap: 1.4rem; }
.iv-look-part { min-width: 0; }
.iv-designs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
.iv-look-save { margin-top: 1.25rem; }
.iv-design { position: relative; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); column-gap: 0.9rem; row-gap: 0.15rem; align-content: start; padding: 0.7rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--field, var(--surface)); cursor: pointer; }
.iv-design input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.iv-design:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.iv-design:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.iv-design .k-hint { font-size: 0.8rem; }
.iv-design-art { grid-row: span 2; display: grid; gap: 4px; align-content: start; height: 3.6rem; padding: 6px; border: 1px solid #c3c9d4; border-radius: 4px; background: #fff; overflow: hidden; }
.iv-design-art i { display: block; height: 5px; border-radius: 2px; background: #c3c9d4; }
.iv-design-art i:first-child { background: #4b5563; width: 55%; }
.iv-art-classic { border-top: 3px solid #4b5563; }
.iv-art-modern i:first-child { width: auto; height: 16px; margin: -6px -6px 2px; border-radius: 0; }
.iv-art-compact { gap: 2px; } .iv-art-compact i { height: 3px; } .iv-art-compact::after { content: ""; height: 3px; border-radius: 2px; background: #c3c9d4; box-shadow: 0 5px 0 #c3c9d4, 0 10px 0 #c3c9d4, 0 15px 0 #c3c9d4; }
.iv-swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.iv-swatch { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 2px solid var(--surface); background: var(--sw); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.iv-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); }
.iv-color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; margin-top: 0.75rem; }
.iv-color-pick { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; min-height: 2.75rem; }
.iv-color { width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.iv-hex { width: 7.5rem; min-height: 2.75rem; font-variant-numeric: tabular-nums; }
.iv-cf-rows { display: grid; gap: 0.5rem; margin-top: 0.6rem; }
.iv-cf-row { display: flex; gap: 0.6rem; align-items: center; }
.iv-cf-row .k-input { flex: 1; min-width: 0; min-height: 2.75rem; }
.iv-cf-row .k-link, .iv-look .k-link { min-height: 2.75rem; }
.iv-look .iv-quick { margin-top: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.iv-sig-label { max-width: 16rem; margin: 0.4rem 0; }
.iv-cf-tip { margin-top: 0.75rem; }
.iv-look-pv { border: 1px solid var(--line); border-radius: 0.75rem; background: var(--bg, transparent); overflow: hidden; position: sticky; top: 1rem; }
.iv-look-paper { padding: 1rem; zoom: 0.62; }
.iv-look-paper .iv-paper { box-shadow: none; }
.iv-look-btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-top: 1px solid var(--line); }
.iv-look-btn { display: inline-block; background: var(--iv-ink, #1d4ed8); color: #fff; font-weight: 600; border-radius: 0.5rem; padding: 0.55rem 1.1rem; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28); }
@media (max-width: 62rem) { .iv-look-grid { grid-template-columns: minmax(0, 1fr); } .iv-look-pv { position: static; } }
@media (max-width: 640px) { .iv-look-paper { zoom: 0.5; padding: 0.6rem; } }

/* Step 4a: the Repeats tab and its dialog. */
.iv-reps { list-style: none; margin: 0.75rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.iv-rep { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1.5rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.iv-rep-main { flex: 1 1 18rem; min-width: 0; display: grid; gap: 0.2rem; }
.iv-rep-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.iv-rep-side { text-align: right; display: grid; gap: 0.15rem; align-content: start; justify-items: end; }
.iv-rep-amt { font-size: 1.15rem; font-weight: 650; }
.iv-rep-acts { display: flex; flex-wrap: wrap; gap: 0 1rem; justify-content: flex-end; }
.iv-rep-acts .k-link { min-height: 2.75rem; }
.iv-rep.iv-gone .iv-rep-main b, .iv-rep.iv-gone .iv-rep-amt { color: var(--muted); }
.iv-steps { text-align: left; max-width: 30rem; margin: 1rem auto 0; padding-left: 1.25rem; display: grid; gap: 0.35rem; color: var(--muted); }
.iv-dialog .k-choices { margin-top: 1rem; grid-template-columns: minmax(0, 1fr); }
.iv-dialog .k-choice small { font-weight: 400; color: var(--muted); }
.iv-rep-field { display: grid; grid-template-columns: minmax(6rem, 0.6fr) minmax(0, 1.4fr); gap: 0.3rem 0.75rem; align-items: center; padding: 0.35rem 0; }
.iv-rep-field b { font-weight: 550; } .iv-rep-field span { display: grid; min-width: 0; overflow-wrap: anywhere; } .iv-rep-field span small { color: var(--muted); }
.iv-rep-field .iv-warn { grid-column: 1 / -1; color: var(--amber); }
.iv-rep-preview { margin-top: 0.75rem; }
.iv-rep-prints { list-style: none; margin: 0.3rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.iv-rep-prints li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.25rem 0.75rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.iv-rep-prints span { overflow-wrap: anywhere; color: var(--muted); }
@media (max-width: 480px) { .iv-rep-field, .iv-rep-prints li { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .iv-rep-side { text-align: left; justify-items: start; } .iv-rep-acts { justify-content: flex-start; } }

/* The customer's pages take the business's colour on their main button (white text on a shade dark enough to read). */
.iv-branded .k-btn.primary, .iv-branded .k-btn.primary:hover { background: var(--iv-ink); border-color: var(--iv-ink); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28); }
.iv-branded .k-btn.primary:hover { filter: brightness(0.92); }
.iv-branded .iv-paybox { border-top: 3px solid var(--iv-brand); }

/* Step 4b: reports. */
.iv-report-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.iv-report-card { display: grid; gap: 0.35rem; height: 100%; margin-top: 0 !important; text-decoration: none; color: inherit; align-content: start; }
.iv-report-card b { font-size: 1.08rem; font-weight: 650; }
.iv-report-card:hover, .iv-report-card:focus-visible { border-color: var(--blue); }
.iv-report-open { margin-top: 0.5rem; color: var(--blue); font-weight: 600; }
.iv-rep-bar { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; margin-top: 1.5rem; }
.iv-rep-bar .iv-f { min-width: 11rem; }
.iv-rep-dates { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }
.iv-rep-dates[hidden] { display: none; }
.iv-rep-none { margin-top: 1.5rem; padding: 1.5rem; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.iv-rep-printhead { display: none; }
.iv-rep-body .iv-table-box { overflow-x: auto; }
.iv-rep-body .iv-table th { white-space: normal; word-break: normal; overflow-wrap: normal; vertical-align: bottom; line-height: 1.25; }
.iv-rep-body .iv-table th.r { text-align: right; }
.iv-rep-body .iv-table td:first-child { min-width: 9rem; }
#tabs .k-tab { padding-left: 0.8rem; padding-right: 0.8rem; }
.iv-table tr.iv-total td { font-weight: 650; border-top: 2px solid var(--line); background: var(--side); }
.iv-table tr.iv-less td { color: var(--muted); }
.iv-rep-body .k-hint { display: block; margin-top: 0.75rem; }
.iv-bars-box { margin-top: 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 1.1rem 1.25rem 0.9rem; }
.iv-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.5rem; height: 11rem; align-items: end; }
.iv-bar-col { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; gap: 0.3rem; text-align: center; min-width: 0; }
.iv-bar-pair { display: flex; gap: 2px; align-items: flex-end; justify-content: center; height: 100%; border-bottom: 1px solid var(--line); }
.iv-bar-pair i { display: block; width: 42%; max-width: 1.6rem; border-radius: 3px 3px 0 0; }
.iv-bars i.b, .iv-bars-key i.b { background: var(--blue); } .iv-bars i.c, .iv-bars-key i.c { background: var(--green); }
.iv-bar-col small { color: var(--muted); font-size: 0.75rem; overflow: hidden; }
.iv-bars-key { margin: 0.6rem 0 0; display: flex; gap: 0.4rem; align-items: center; }
.iv-bars-key i { width: 0.7rem; height: 0.7rem; border-radius: 3px; display: inline-block; margin-left: 0.6rem; } .iv-bars-key i:first-child { margin-left: 0; }
@media (max-width: 44rem) { .iv-table td:has(> .iv-zero) { display: none; } }
@media (max-width: 640px) { .iv-bars { gap: 0.2rem; } .iv-bar-col small { font-size: 0.6rem; white-space: nowrap; letter-spacing: -0.02em; } .iv-table tr.iv-total td:empty, .iv-table tr.iv-less td:empty { display: none; } .iv-rep-bar .iv-f { flex: 1 1 100%; } }
@media print {
  .iv-rep-bar, #flash, .iv-toast, #demo-bar { display: none !important; }
  .iv-rep-printhead { display: grid; gap: 0.2rem; margin-bottom: 1rem; font-size: 1.1rem; }
  .iv-rep-body .iv-stats { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
  .iv-table thead { position: static !important; } .iv-table { display: table !important; } .iv-table tbody { display: table-row-group !important; } .iv-table tr { display: table-row !important; padding: 0 !important; }
  .iv-table td, .iv-table th { display: table-cell !important; width: auto !important; padding: 0.35rem 0.5rem !important; border-bottom: 1px solid #ccc !important; font-size: 0.85rem; }
  .iv-table td::before { content: none !important; }
  .iv-table a { color: inherit; text-decoration: none; }
  .iv-table-box { border: 0; }
  .iv-bars i, .iv-aging-bar span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Step 5: expenses to bill */
.iv-exp-body { display: grid; gap: 1.1rem; margin-top: 1rem; }
.iv-exp-note { margin: 0; flex: 1 1 16rem; align-self: end; }
.iv-exp-group { display: grid; gap: 0.75rem; }
.iv-exp-head { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: baseline; justify-content: space-between; }
.iv-exp-head h2 { margin: 0; font-size: 1.05rem; }
.iv-exp-group .iv-table-box { margin: 0; }
.iv-exp-group .iv-table td:first-child, .iv-exp-group .iv-table th:first-child { width: 2.2rem; }
.iv-exp-tick { width: 1.15rem; height: 1.15rem; accent-color: var(--blue); }
.iv-exp-vendor { display: block; }
.iv-exp-what { min-width: 8rem; overflow-wrap: break-word; }
.iv-exp-group .iv-table-box { overflow-x: auto; }
.iv-exp-group .iv-table td, .iv-exp-group .iv-table th { padding-left: 0.5rem; padding-right: 0.5rem; }
.iv-exp-done td { color: var(--muted); }
.iv-exp-acts { justify-content: flex-end; flex-wrap: nowrap; gap: 0.4rem; align-items: center; }
.iv-exp-acts .k-btn, .iv-exp-acts .k-badge { white-space: nowrap; }
.iv-exp-group .iv-table td { vertical-align: middle; }
.iv-exp-acts .k-btn { padding: 0.25rem 0.7rem; min-height: 2rem; font-size: 0.85rem; }
a.k-badge { text-decoration: none; }
.iv-exp-bar { display: flex; flex-wrap: wrap; gap: 0.6rem 1.1rem; align-items: center; justify-content: flex-end; }
.iv-exp-bar:empty { display: none; }
.iv-exp-count { margin-right: auto; color: var(--muted); font-size: 0.9rem; }
.iv-exp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 1rem; }
.iv-exp-form .wide, .iv-exp-will { grid-column: 1 / -1; }
.iv-exp-taxnote { margin: 0; }
.iv-exp-form .iv-f { min-width: 0; }
.iv-exp-form .k-input, .iv-exp-form .k-select { width: 100%; box-sizing: border-box; }
.iv-dialog:has(.iv-exp-form) { max-height: calc(100dvh - 2rem); overflow-y: auto; }
.iv-exp-will { margin: 0; font-weight: 600; min-height: 1.4rem; }
.iv-exp-receipt { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; margin-top: 0.3rem; }
@media (max-width: 44rem) {
  .iv-exp-form { grid-template-columns: 1fr; }
  .iv-exp-group .iv-table td:first-child { width: 100%; }
  .iv-exp-group .iv-table td:first-child::before { content: "Put on the invoice"; }
  .iv-exp-group .iv-table td:empty { display: none; }
  .iv-exp-bar { justify-content: stretch; } .iv-exp-bar .k-btn { width: 100%; }
  .iv-exp-acts { flex-wrap: wrap; }
  .iv-exp-what { min-width: 0; text-align: right; }
}

/* Tighter Invoices screens (Ram, 2026-11-13: "oversized, white space wasted"; numbers agreed with the
   competitor check). Same parts, less air: the title and its button share one row, the demo bar is one
   slim line, rows are one line tall, cards and gaps are smaller. Tap targets stay 44px on phones. */
.iv-table td.iv-num, .iv-table td a, .iv-table td time, .iv-table .k-badge { white-space: nowrap; }
@media (min-width: 44.01rem) {
  .k-hero { flex-wrap: nowrap; align-items: center; }
  .k-hero > :first-child { flex: 1 1 auto; min-width: 0; }
  .k-hero > :last-child:not(:first-child) { flex: none; }
  .k-hero h1 { font-size: 1.5rem; }
  .k-hero p { margin-top: 0.15rem; font-size: 0.95rem; }
  .iv-back { min-height: 1.5rem; font-size: 0.85rem; }
  .k-tabs { margin-top: 0.6rem; scrollbar-width: none; }
  .k-tab { min-height: 2.6rem; padding: 0.3rem 0.8rem; }
  .iv-demo-bar { flex-wrap: nowrap; padding: 0.3rem 0.4rem 0.3rem 0.8rem; margin-bottom: 0.75rem; font-size: 0.85rem; gap: 0.75rem; border-radius: 10px; }
  .iv-demo-bar > div:first-child { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .iv-demo-as { flex: none; flex-wrap: nowrap; }
  .iv-demo-as > span { font-size: 0.8rem; }
  .iv-demo-bar .iv-filter { min-height: 2rem; padding: 0.1rem 0.7rem; font-size: 0.82rem; white-space: nowrap; }
  .iv-demo-bar .k-btn { min-height: 2rem; padding: 0.2rem 0.8rem; font-size: 0.85rem; flex: none; }
  .iv-filter { min-height: 2.25rem; }
  .iv-table th { padding: 0.5rem 0.6rem; }
  .iv-table td { padding: 0.6rem; }
  .iv-stats { margin-top: 0.9rem; gap: 0.75rem; }
  .iv-stat { padding: 0.65rem 1rem 0.7rem; }
  .iv-stat-value { font-size: 1.5rem; margin-top: 0; }
  .iv-tools { margin-top: 0.9rem; }
  .iv-exp-note { font-size: 0.9rem; }
  .iv-exp-body { gap: 0.9rem; margin-top: 0.9rem; }
  .iv-exp-group.k-card { padding: 0.9rem 1.1rem; margin-top: 0; }
  .iv-exp-acts { display: flex; }
  .iv-exp-vendor .k-link { min-height: 0; padding: 0; font-size: inherit; }
}
@media (min-width: 44.01rem) and (max-width: 72rem) {
  .iv-table th, .iv-table td { padding-left: 0.4rem; padding-right: 0.4rem; }
  .iv-table th:first-child, .iv-table td:first-child { padding-left: 0.7rem; }
}
/* Expenses on a phone: what and the amount to bill on the first line, date and what was paid on the second. */
@media (max-width: 44rem) {
  .iv-exp-group .iv-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.15rem 0.7rem; align-items: start; padding: 0.7rem 0.8rem; }
  .iv-exp-group .iv-table td { display: block; width: auto; padding: 0; text-align: left; }
  .iv-exp-group .iv-table td::before, .iv-exp-group .iv-table td:first-child::before { content: none; }
  .iv-exp-group .iv-table td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; width: auto; padding-top: 0.15rem; }
  .iv-exp-group .iv-table td:nth-child(1):empty { display: block; width: 0; }
  .iv-exp-group .iv-table td:nth-child(3) { grid-area: 1 / 2; }
  .iv-exp-group .iv-table td:nth-child(5) { grid-area: 1 / 3; font-weight: 650; text-align: right; }
  .iv-exp-group .iv-table td:nth-child(2) { grid-area: 2 / 2 / 3 / 3; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
  .iv-exp-group .iv-table td:nth-child(4) { grid-area: 2 / 3 / 3 / 4; color: var(--muted); font-size: 0.85rem; text-align: right; white-space: nowrap; }
  .iv-exp-group .iv-table td:nth-child(3) { grid-column: 2 / 4 !important; padding-right: 5.5rem; }
  .iv-exp-group .iv-table td:nth-child(5) { z-index: 1; }
  .iv-exp-group .iv-table td:nth-child(4)::before { content: "Paid " !important; }
  .iv-exp-group .iv-table td:nth-child(4) > div { display: inline; } .iv-exp-group .iv-table td:nth-child(4) .iv-exp-vendor { display: inline; margin-left: 0.25rem; }
  .iv-exp-group .iv-table td:nth-child(6) { grid-area: 3 / 2 / 4 / 4; padding-top: 0.35rem; }
  .iv-exp-what { text-align: left; }
  .iv-exp-acts { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-start; }
  .iv-exp-tick { width: 1.4rem; height: 1.4rem; }
}
@media (max-width: 44rem) {
  .iv-demo-bar { padding: 0.5rem 0.7rem; gap: 0.4rem 0.6rem; margin-bottom: 0.8rem; font-size: 0.9rem; }
  .iv-demo-bar > div:first-child { flex: 1 1 100%; }
  .iv-demo-bar > div:first-child span { display: none; }
  .iv-demo-as > span { display: none; }
  .iv-demo-bar .iv-filter { min-height: 2.25rem; padding: 0.15rem 0.65rem; font-size: 0.82rem; }
  .iv-demo-bar .k-btn { width: auto; min-height: 2.25rem; padding: 0.2rem 0.8rem; font-size: 0.85rem; margin-left: auto; }
  .k-hero h1 { font-size: 1.45rem; }
  .k-hero p { font-size: 0.95rem; margin-top: 0.2rem; }
  .iv-stats { grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 0.9rem; }
  .iv-stat { padding: 0.6rem 0.75rem; }
  .iv-stat-value { font-size: 1.3rem; }
}
/* Expenses: the filter label sits beside its box, and the two summary cards are one line each. */
.iv-exp-top .iv-stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.7rem; }
.iv-exp-top .iv-stat-label { flex: 1 1 100%; }
.iv-exp-top .iv-stat-note { margin: 0; }
.iv-tools .iv-exp-show { display: flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
.iv-exp-what, .iv-exp-vendor { overflow-wrap: normal; word-break: normal; }
@media (max-width: 44rem) {
  .iv-demo-bar { position: relative; padding-right: 0.6rem; }
  .iv-demo-bar > div:first-child { flex: 1 1 auto; padding-right: 5.5rem; }
  .iv-demo-bar > .k-btn { position: absolute; top: 0.4rem; right: 0.5rem; min-height: 2rem; }
  .iv-demo-as { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; gap: 0.3rem; }
  .iv-demo-bar .iv-filter { white-space: nowrap; padding: 0.15rem 0.55rem; font-size: 0.78rem; flex: none; }
  .iv-exp-group .iv-table td:nth-child(3) { padding-right: 4.75rem; }
}
/* Overview: less air between the cards and the latest invoices. */
@media (min-width: 44.01rem) {
  .k-app .k-section-title { margin-top: 1.25rem; }
  .iv-tools:has(> .k-section-title) { margin-top: 0.4rem; align-items: baseline; }
}
.iv-ph { display: none; }
/* Invoice lists on a phone: one short card each. Number and status, customer, then dates and the total. */
@media (max-width: 44rem) {
  .iv-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.1rem; }
  .iv-filters .iv-filter { flex: none; }
  .iv-tools .k-input { max-width: none; width: 100%; }
  .iv-table.iv-inv tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.1rem 0.4rem; padding: 0.6rem 0.8rem; align-items: baseline; }
  .iv-table.iv-inv td { display: block; width: auto; padding: 0; text-align: left; }
  .iv-table.iv-inv td::before { content: none; }
  .iv-table.iv-inv td:nth-child(1) { grid-area: 1 / 1 / 2 / 3; font-size: 1rem; }
  .iv-table.iv-inv td:nth-child(7) { grid-area: 1 / 3; text-align: right; }
  .iv-table.iv-inv td:nth-child(2) { grid-area: 2 / 1 / 3 / 4; }
  .iv-table.iv-inv td:nth-child(3) { grid-area: 3 / 1; color: var(--muted); font-size: 0.85rem; }
  .iv-table.iv-inv td:nth-child(4) { grid-area: 3 / 2; color: var(--muted); font-size: 0.85rem; }
  .iv-table.iv-inv td:nth-child(4)::before { content: "· due "; color: inherit; font-size: inherit; }
  .iv-table.iv-inv td:nth-child(5) { grid-area: 3 / 3; font-weight: 650; text-align: right; }
  .iv-table.iv-inv td:nth-child(6) { grid-area: 4 / 1 / 5 / 4; text-align: right; color: var(--muted); font-size: 0.85rem; }
  .iv-table.iv-inv td:nth-child(6)::before { content: "Still owed "; color: inherit; font-size: inherit; }
  .iv-table.iv-inv td:nth-child(6):empty { display: none; }
  /* The quotes list: number and status, customer, then what it is for, valid until and the total. */
  .iv-table.iv-quo tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 0.5rem; padding: 0.6rem 0.8rem; align-items: baseline; }
  .iv-table.iv-quo td { display: block; width: auto; padding: 0; text-align: left; }
  .iv-table.iv-quo td::before { content: none; }
  .iv-table.iv-quo td:nth-child(1) { grid-area: 1 / 1; font-size: 1rem; }
  .iv-table.iv-quo td:nth-child(7) { grid-area: 1 / 2; text-align: right; }
  .iv-table.iv-quo td:nth-child(2) { grid-area: 2 / 1; }
  .iv-table.iv-quo td:nth-child(6) { grid-area: 2 / 2; font-weight: 650; text-align: right; }
  .iv-table.iv-quo td:nth-child(3) { grid-area: 3 / 1 / 4 / 3; color: var(--muted); font-size: 0.85rem; }
  .iv-table.iv-quo td:nth-child(3):empty { display: none; }
  .iv-table.iv-quo td:nth-child(4) { display: none; }
  .iv-table.iv-quo .iv-ph { display: inline; }
  .iv-table.iv-quo td:nth-child(5) { grid-area: 4 / 1 / 5 / 3; color: var(--muted); font-size: 0.85rem; }
}


/* Quotes (netlify/specs/quotes.md): the list's three numbers, the status card, the customer's answer forms. */
.iv-stats.iv-stats3 { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.iv-q-status.ok { border-top: 3px solid var(--green); }
.iv-q-status.wait { border-top: 3px solid var(--amber); }
.iv-q-status.bad { border-top: 3px solid var(--red); }
.iv-q-answer { display: grid; gap: 0.75rem; }
.iv-q-answer h2 { margin: 0; }
.iv-q-answer p { margin: 0; }
.iv-q-answer .iv-f { max-width: 30rem; }
.iv-q-answer .k-input { font-size: 1.05rem; }
.iv-q-box .iv-stat-label { max-width: 32rem; }
@media (max-width: 640px) {
  .iv-q-box .iv-hero-actions { width: 100%; }
  .iv-q-box .iv-hero-actions .k-btn { flex: 1 1 auto; }
  .iv-q-box #accept { flex-basis: 100%; }
}
@media print { .iv-q-answer, .iv-q-box .iv-hero-actions { display: none !important; } }
/* Step 3 (netlify/specs/quotes.md): the customer's "ask for a change" words, on their page and on the business's quote. */
.iv-q-words { margin: 0.4rem 0 0.6rem; padding: 0.1rem 0 0.1rem 0.75rem; border-left: 3px solid var(--amber); white-space: pre-wrap; overflow-wrap: anywhere; }
.iv-q-change .k-btn { margin-top: 0.25rem; }
.iv-q-answer textarea.k-input { max-width: 100%; }
/* Settings, Quotes card: each help line sits right under its switch, and Save has room above it. */
#quotes-settings .iv-fields { row-gap: 0.6rem; margin-bottom: 1rem; }
#quotes-settings .k-check.wide { min-height: 0; padding-bottom: 0; }
#quotes-settings .k-check.wide + p { margin: -0.35rem 0 0.4rem 1.9rem; }

/* Settings cards opened by a link (?at=look, ?at=quotes) stop below the sticky top bar. */
#look, #quotes-settings { scroll-margin-top: 5.5rem; }

/* Ten tabs do not fit below 1440px: the row scrolls, and a fade at the right edge says there is more. */
@media (max-width: 90rem) { .k-tabs.iv-more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); } }

/* "Made from quote Q-1001" (netlify/specs/quotes.md, step 2): on top of the invoice editor, and inside the status card of a sent invoice. */
p.iv-from-quote:first-child { margin: 0.5rem 0 0.75rem; }
.iv-q-inv a, .iv-from-quote a { font-weight: 600; }
/* Quotes list (netlify/specs/quotes.md, step 2 follow-up): search stays on the row with the eight filter chips,
   and on a phone the three numbers are one slim strip so the first quotes show without scrolling. */
@media (min-width: 900px) { .iv-tools-q { flex-wrap: nowrap; align-items: flex-start; } .iv-tools-q .k-input { flex: 0 1 13rem; min-width: 11rem; } .iv-tools-q .iv-filters { flex: 1 1 auto; } }
@media (max-width: 640px) {
  .iv-stats.iv-stats-q { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
  .iv-stats-q .iv-stat { padding: 0.45rem 0.55rem 0.5rem; }
  .iv-stats-q .iv-stat { display: flex; flex-direction: column; justify-content: space-between; }
  .iv-stats-q .iv-stat-label { font-size: 0.72rem; line-height: 1.25; }
  .iv-stats-q .iv-stat-value { font-size: 1rem; letter-spacing: -0.02em; }
  .iv-stats-q .iv-stat-note { display: none; }
}

/* Quotes, step 4: Good / Better / Best options (netlify/specs/quotes.md). */
/* On the paper (a document, so it stays white): the shared items once, then one bordered card per option. */
.iv-opt-cap { margin-top: 1.75rem; margin-bottom: 0; }
.iv-opts { display: grid; gap: 1rem; margin-top: 1.25rem; }
.iv-opt { border: 1px solid #c3c9d4; border-radius: 10px; padding: 0.85rem 1rem 1rem; background: #fff; }
.iv-opt.chosen { border: 2px solid var(--iv-ink, #1d4ed8); padding: calc(0.85rem - 1px) calc(1rem - 1px) calc(1rem - 1px); }
.iv-opt.other { background: #f4f6f9; }
.iv-opt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.iv-opt-head h3 { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; color: #111827; }
.iv-opt-badge { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--iv-ink, #1d4ed8); border: 1.5px solid currentColor; border-radius: 6px; padding: 0.05rem 0.4rem; }
.iv-opt-badge.quiet { color: #4b5563; }
.iv-opt-sum { margin: 0.25rem 0 0; color: #4b5563; }
.iv-opt .iv-plines { margin-top: 0.75rem; }
.iv-opt .iv-ptotals { margin-top: 0.9rem; }
.iv-opt-note { margin: 0.6rem 0 0; color: #4b5563; font-size: 0.85rem; }
/* The customer's box says how many options and the form asks for one. */
.iv-q-pick { display: grid; gap: 0.5rem; border: 0; padding: 0; margin: 0; }
.iv-q-pick legend { font-size: 0.85rem; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 0.25rem; }
.iv-q-pick label { display: flex; align-items: center; gap: 0.7rem; min-height: 2.75rem; padding: 0.4rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--ink); }
.iv-q-pick label:has(input:checked) { border-color: var(--iv-ink, var(--blue, #1d4ed8)); box-shadow: inset 0 0 0 1px var(--iv-ink, var(--blue, #1d4ed8)); }
.iv-q-pick input { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }
.iv-q-pick .iv-q-pick-price { margin-left: auto; font-variant-numeric: tabular-nums; }
.iv-q-pick small { display: block; font-weight: 400; color: var(--muted); }
/* In the editor. */
.iv-ob { display: grid; gap: 0.75rem; }
.iv-ob-head { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: 0.6rem 0.9rem; align-items: start; }
.iv-ob-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.iv-ob-top h2 { margin: 0; }
.iv-ob-sum { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; }
.iv-ob-sum strong { font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) { .iv-ob-head { grid-template-columns: minmax(0, 1fr); } }
.iv-optsum { display: grid; gap: 0.35rem; margin: 0; }
.iv-optsum div { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.iv-optsum dt { color: var(--muted); } .iv-optsum dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.iv-optsum small { display: block; color: var(--muted); font-weight: 400; }
/* Templates on the new quote page. */
.iv-tpl { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0; }
.iv-tpl li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.iv-tpl li:first-child { border-top: 0; }
.iv-tpl-name { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; font-weight: 600; color: var(--ink); }
.iv-tpl-name small { display: block; font-weight: 400; color: var(--muted); }
.iv-tpl-acts { display: flex; gap: 0.5rem; }
@media (max-width: 34rem) { .iv-tpl-acts { width: 100%; } .iv-tpl-acts .k-btn { flex: 1 1 auto; } }
@media print { .iv-q-pick { display: none !important; } }
.iv-sum dd { white-space: nowrap; }
.iv-sum dt { min-width: 0; overflow-wrap: anywhere; }

.iv-q-pick label { flex-wrap: wrap; }
.iv-q-pick .iv-q-pick-name { flex: 1 1 8rem; min-width: 0; }
.iv-q-pick .iv-q-pick-name .iv-opt-badge { margin-left: 0.5rem; vertical-align: middle; }
.iv-q-pick .iv-q-pick-price { white-space: nowrap; flex: 0 0 auto; }
.iv-sum dt .iv-opt-badge, .iv-optsum dt .iv-opt-badge { margin-left: 0.4rem; font-size: 0.65rem; vertical-align: middle; }
.iv-optsum dd { white-space: nowrap; }

/* ---------- E-signature on a quote (netlify/specs/e-sign.md): invoices/sign.js ---------- */
/* A signature is always ink on white paper, in light and dark mode, like the quote it sits on. */
.sg-mark { display: flex; align-items: flex-end; min-height: 4.5rem; max-width: 22rem; color: #111827; }
.sg-mark svg { width: 100%; height: auto; max-height: 6.5rem; display: block; }
.sg-mark polyline { fill: none; stroke: #111827; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.sg-typed { font-family: "Segoe Script", "Bradley Hand", "Snell Roundhand", "Apple Chancery", "Brush Script MT", cursive; font-size: 2rem; line-height: 1.25; font-style: italic; overflow-wrap: anywhere; }
.sg-block { margin-top: 1.75rem; break-inside: avoid; color: #111827; }
.sg-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; max-width: 34rem; }
.sg-cells div { border-top: 1.5px solid #111827; padding-top: 0.3rem; display: grid; }
.sg-cells b { font-weight: 600; overflow-wrap: anywhere; }
.sg-cells span { color: #4b5563; font-size: 0.8rem; }
/* The customer's sign box. */
.sg-agree { align-items: flex-start; max-width: 40rem; }
.sg-agree input { margin-top: 0.2rem; flex: none; }
.sg-how { border: 0; padding: 0; margin: 0; display: grid; gap: 0.6rem; max-width: 34rem; min-width: 0; }
.sg-how legend { font-weight: 600; padding: 0; margin-bottom: 0.35rem; }
.sg-tabs { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; width: max-content; }
.sg-tabs button { font: inherit; font-weight: 650; min-height: 2.75rem; min-width: 5.5rem; padding: 0.4rem 1rem; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; }
.sg-tabs button + button { border-left: 1.5px solid var(--line); }
.sg-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.sg-tabs button:focus-visible { outline: 3px solid #1d4ed8; outline-offset: -3px; }
.sg-preview { background: #ffffff; border: 1.5px solid var(--line); border-radius: 12px; padding: 0.75rem 1rem; min-height: 6.5rem; display: flex; align-items: flex-end; }
.sg-preview .sg-mark { border-bottom: 1.5px solid #111827; width: 100%; max-width: none; padding-bottom: 0.2rem; }
.sg-preview .sg-empty { color: #4b5563; font-size: 0.95rem; align-self: center; }
.sg-pad { position: relative; background: #ffffff; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.sg-pad canvas { display: block; width: 100%; aspect-ratio: 10 / 3; touch-action: none; cursor: crosshair; }
.sg-pad-line { position: absolute; left: 6%; right: 6%; bottom: 22%; border-bottom: 1.5px dashed #9ca3af; pointer-events: none; }
.sg-pad:not(.used)::after { content: "Sign here"; position: absolute; left: 6%; bottom: 26%; color: #4b5563; font-size: 0.95rem; pointer-events: none; }
.sg-pad-tools { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.sg-pad-tools .k-link { min-height: 2.75rem; }
/* The business's signing record. */
.sg-record { display: grid; gap: 0.6rem; }
.sg-record h2, .sg-record p { margin: 0; }
.sg-facts { display: grid; gap: 0.3rem; margin: 0; }
.sg-facts div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.5rem; }
.sg-facts dt { color: var(--muted); font-size: 0.9rem; }
.sg-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sg-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.sg-steps li span { display: block; }
.sg-steps .small { color: var(--muted); }
.sg-prints summary { cursor: pointer; font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; }
.sg-hash { display: block; font-size: 0.8rem; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.5rem; }
.sg-side-mark { background: #ffffff; border: 1px solid var(--line); border-radius: 10px; padding: 0.4rem 0.75rem; }
@media print { .sg-record { display: none !important; } }
.sg-pad-tools .k-link { flex: none; white-space: nowrap; }
.iv-gst-card > .k-msg { margin-bottom: 0.9rem; }
.iv-gst-box .k-msg { margin-bottom: 0.9rem; }
