/* ==========================================================================
   ToolGuest Invoice Generator — shared stylesheet for the invoicing cluster
   Used by /invoice-generator and its six dedicated sub-tool pages.
   Light is the default; dark mode follows html.dark, html[data-theme="dark"]
   and body.dark so it works with every theme convention on the site.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --fg: #0a0b0d;
  --muted: #646b78;
  --card: #ffffff;
  --border: #e5e7eb;
  --glass: rgba(255, 255, 255, 0.78);
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.09);
  --accent-2: #0891b2;
  --ok: #059669;
  --danger: #dc2626;
  --shadow: 0 24px 60px -30px rgba(15, 23, 42, 0.35);
  --radius: 18px;
  color-scheme: light;
}

html.dark,
html[data-theme="dark"],
body.dark {
  --bg: #07080a;
  --bg-soft: #0b0d10;
  --fg: #f4f5f7;
  --muted: #8d95a3;
  --card: #101216;
  --border: #1e2228;
  --glass: rgba(12, 14, 18, 0.75);
  --accent: #818cf8;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --accent-2: #22d3ee;
  --ok: #34d399;
  --danger: #f87171;
  --shadow: 0 28px 70px -34px rgba(0, 0, 0, 0.85);
  color-scheme: dark;
}

html { scroll-behavior: smooth; }

body.inv-page {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.inv-wrap { max-width: 1240px; margin: 0 auto; padding: 0 18px; }
.tabnum { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------- header --------------------------------- */
.inv-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.inv-header-in {
  display: flex; align-items: center; gap: 12px;
  height: 56px; max-width: 1240px; margin: 0 auto; padding: 0 18px;
}
.inv-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--fg); }
.inv-brand img { height: 28px; width: auto; }
.inv-brand span { font-size: 0.875rem; font-weight: 800; letter-spacing: -0.01em; }
.inv-nav { display: none; align-items: center; gap: 2px; margin-left: 14px; }
.inv-nav a {
  border-radius: 9px; padding: 6px 10px; font-size: 13px; font-weight: 500;
  color: var(--muted); text-decoration: none; transition: background 0.15s, color 0.15s;
}
.inv-nav a:hover { background: var(--bg-soft); color: var(--fg); }
.inv-header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.inv-pill {
  display: none; align-items: center; gap: 6px; border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 600;
  color: var(--muted); white-space: nowrap;
}
.inv-icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; background: transparent;
  color: var(--muted); transition: color 0.15s, background 0.15s;
}
.inv-icon-btn:hover { color: var(--fg); background: var(--bg-soft); }
.inv-cta {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 10px;
  background: var(--fg); color: var(--bg); padding: 8px 14px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  transition: opacity 0.15s;
}
.inv-cta:hover { opacity: 0.88; }
@media (min-width: 860px) { .inv-nav { display: flex; } .inv-pill { display: inline-flex; } }

/* -------------------------------- hero ---------------------------------- */
.inv-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.inv-hero::before,
.inv-hero::after {
  content: ""; position: absolute; border-radius: 999px; filter: blur(90px);
  opacity: 0.42; pointer-events: none;
}
.inv-hero::before {
  width: 420px; height: 420px; top: -170px; left: -90px;
  background: radial-gradient(circle, #6366f1, transparent 65%);
}
.inv-hero::after {
  width: 380px; height: 380px; top: -140px; right: -70px;
  background: radial-gradient(circle, #22d3ee, transparent 65%);
}
html.dark .inv-hero::before, html[data-theme="dark"] .inv-hero::before, body.dark .inv-hero::before { opacity: 0.32; }
html.dark .inv-hero::after, html[data-theme="dark"] .inv-hero::after, body.dark .inv-hero::after { opacity: 0.24; }
.inv-hero-in { position: relative; z-index: 1; padding: 30px 0 34px; }
.inv-crumbs {
  display: flex; align-items: center; gap: 6px; margin-bottom: 22px;
  font-size: 12px; color: var(--muted);
}
.inv-crumbs a { color: inherit; text-decoration: none; }
.inv-crumbs a:hover { color: var(--fg); }
.inv-crumbs svg { width: 12px; height: 12px; opacity: 0.7; }
.inv-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  border: 1px solid var(--border); background: var(--card); border-radius: 999px;
  padding: 4px 12px; font-size: 11px; font-weight: 700; color: var(--muted);
}
.inv-dot { position: relative; display: flex; width: 6px; height: 6px; }
.inv-dot::before {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: #34d399; opacity: 0.75; animation: invPing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.inv-dot::after { content: ""; width: 6px; height: 6px; border-radius: 999px; background: #10b981; }
@keyframes invPing { 75%, 100% { transform: scale(2.2); opacity: 0; } }

.inv-hero h1 {
  margin: 0; max-width: 21ch;
  font-size: clamp(2rem, 5.2vw, 3.15rem); font-weight: 900;
  line-height: 1.04; letter-spacing: -0.035em; text-wrap: balance;
}
.inv-hero h1 .inv-grad {
  display: block;
  background: linear-gradient(90deg, #6366f1, #8b5cf6 45%, #06b6d4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* The site-wide .tg-hero shimmer in fonts.css paints the gradient with
   !important, so the fallback above only matters where background-clip on
   text is unsupported. Keeping the lead-in on its own span is what stops the
   whole headline turning into one long gradient. */
.inv-lede {
  margin: 18px 0 0; max-width: 60ch;
  font-size: 15px; line-height: 1.7; color: var(--muted);
}
.inv-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.inv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; padding: 11px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; border: 1px solid transparent;
  transition: transform 0.12s, background 0.15s, opacity 0.15s;
}
.inv-btn:active { transform: translateY(1px); }
.inv-btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff; box-shadow: 0 16px 34px -18px rgba(79, 70, 229, 0.85);
}
.inv-btn-primary:hover { opacity: 0.94; }
.inv-btn-ghost { border-color: var(--border); color: var(--fg); background: transparent; }
.inv-btn-ghost:hover { background: var(--bg-soft); }
.inv-btn svg { width: 16px; height: 16px; }

.inv-chips {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px; margin: 26px 0 0; padding: 0; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--muted); max-width: 640px;
}
.inv-chips li { display: flex; align-items: center; gap: 8px; }
.inv-chips svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
@media (min-width: 640px) { .inv-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* --------------------------------- tool --------------------------------- */
.inv-tool { padding: 26px 0 8px; }
.inv-tool-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.inv-tool-head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.inv-tool-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.inv-kbd {
  font-family: ui-monospace, "JetBrains Mono", monospace; font-size: 10px;
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px;
  background: var(--card);
}
.inv-kbd-hint { display: none; font-size: 11px; color: var(--muted); }
@media (min-width: 640px) { .inv-kbd-hint { display: block; } }

/* action bar */
.inv-bar {
  position: sticky; top: 62px; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 18px; padding: 9px;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--glass); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.inv-seg { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); }
.inv-seg button {
  border: 0; background: transparent; cursor: pointer; border-radius: 8px;
  padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--muted);
  font-family: inherit; transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.inv-seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.inv-seg-currency { flex-wrap: wrap; }
.inv-bar-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.inv-save {
  display: none; align-items: center; gap: 6px; padding: 4px 8px;
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.inv-save svg { width: 14px; height: 14px; color: var(--ok); }
@media (min-width: 720px) { .inv-save { display: inline-flex; } }
.inv-action {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; background: transparent;
  padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--fg);
  font-family: inherit; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.inv-action:hover { background: var(--fg); color: var(--bg); }
.inv-action svg { width: 15px; height: 15px; }
.inv-action.is-primary {
  border-color: transparent; background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff; font-weight: 700; box-shadow: 0 14px 30px -18px rgba(79, 70, 229, 0.9);
}
.inv-action.is-primary:hover { opacity: 0.94; background: linear-gradient(135deg, #4f46e5, #6366f1); color: #fff; }
.inv-action.is-icon { padding: 8px; }
.inv-action.is-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* layout */
.inv-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 1024px) {
  .inv-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); align-items: start; }
  .inv-preview-col { position: sticky; top: 128px; }
}
.inv-form { display: grid; gap: 14px; min-width: 0; }

.inv-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 16px; }
.inv-card h3 {
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font-size: 13px; font-weight: 800; letter-spacing: -0.005em;
}
.inv-card h3 svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.inv-card h3 .inv-opt { font-weight: 500; color: var(--muted); }

.inv-field { display: block; min-width: 0; }
.inv-field > span {
  display: block; margin-bottom: 6px; font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.inv-inp {
  width: 100%; box-sizing: border-box; border-radius: 9px;
  border: 1px solid var(--border); background: var(--card); color: var(--fg);
  padding: 8px 11px; font-size: 13px; line-height: 1.35; font-family: inherit;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.inv-inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inv-inp::placeholder { color: var(--muted); opacity: 0.8; }
textarea.inv-inp { resize: vertical; min-height: 58px; }
select.inv-inp { appearance: none; cursor: pointer; }
.inv-fields { display: grid; gap: 12px; }
.inv-fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inv-fields .span-2 { grid-column: 1 / -1; }
@media (max-width: 420px) { .inv-fields.two { grid-template-columns: minmax(0, 1fr); } }

/* logo row */
.inv-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.inv-logo-thumb {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none;
  overflow: hidden; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted);
}
.inv-logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.inv-logo-thumb svg { width: 16px; height: 16px; }
.inv-logo-actions { display: flex; align-items: center; gap: 8px; }
.inv-mini {
  cursor: pointer; border: 1px solid var(--border); border-radius: 9px;
  background: transparent; color: var(--fg); padding: 6px 11px;
  font-size: 12px; font-weight: 700; font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.inv-mini:hover { background: var(--bg-soft); }
.inv-mini.is-quiet { border-color: transparent; color: var(--muted); font-weight: 600; }
.inv-mini.is-quiet:hover { color: var(--danger); background: transparent; }

/* line items */
.inv-item-head {
  display: none; gap: 8px; padding: 0 2px; margin-bottom: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.inv-items { display: grid; gap: 8px; }
.inv-item { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: center; }
.inv-item .inv-item-desc { grid-column: span 12; }
.inv-item .inv-item-qty { grid-column: span 3; }
.inv-item .inv-item-rate { grid-column: span 4; }
.inv-item .inv-item-amt {
  grid-column: span 3; text-align: right; font-size: 12px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inv-item .inv-item-tools { grid-column: span 2; display: flex; justify-content: flex-end; gap: 2px; }
/* Fixed tracks rather than a 12-column split: the amount needs enough room
   for a four-figure total with decimals, and the row tools need 2 x 28px. */
@media (min-width: 640px) {
  .inv-item,
  .inv-item-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px 76px 94px 60px;
    gap: 8px;
  }
  .inv-item-head .h-num { text-align: right; }
  .inv-item .inv-item-desc,
  .inv-item .inv-item-qty,
  .inv-item .inv-item-rate,
  .inv-item .inv-item-amt,
  .inv-item .inv-item-tools { grid-column: auto; }
}
.inv-row-btn {
  display: grid; place-items: center; width: 28px; height: 28px; cursor: pointer;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.inv-row-btn:hover { background: var(--bg-soft); color: var(--fg); }
.inv-row-btn.is-danger:hover { background: rgba(220, 38, 38, 0.12); color: var(--danger); }
.inv-row-btn svg { width: 14px; height: 14px; }
.inv-add {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  margin-top: 12px; padding: 8px 12px; border-radius: 9px;
  border: 1px dashed var(--border); background: transparent;
  font-size: 12px; font-weight: 700; color: var(--muted); font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.inv-add:hover { border-color: var(--accent); color: var(--accent); }
.inv-add svg { width: 14px; height: 14px; }

/* totals */
.inv-total-box { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--bg-soft); font-size: 12px; }
.inv-total-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.inv-total-row span:first-child { color: var(--muted); }
.inv-total-row.is-disc span:last-child { color: var(--ok); }
.inv-total-row.is-grand {
  margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 13px; font-weight: 800;
}
.inv-total-row.is-grand span:last-child { color: var(--accent); font-weight: 900; }

/* discount toggle */
.inv-disc { display: flex; align-items: center; gap: 8px; }
.inv-disc .inv-inp { min-width: 0; flex: 1 1 auto; width: auto; max-width: 160px; }
.inv-disc-toggle { display: flex; flex: none; padding: 3px; border: 1px solid var(--border); border-radius: 9px; }
.inv-disc-toggle button {
  border: 0; background: transparent; cursor: pointer; border-radius: 6px;
  padding: 2px 9px; font-size: 12px; font-weight: 800; color: var(--muted); font-family: inherit;
}
.inv-disc-toggle button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* preview */
.inv-preview-col { min-width: 0; }
.inv-paper {
  width: 100%; max-width: 760px; margin: 0 auto; overflow: hidden;
  border-radius: 16px; box-shadow: var(--shadow); outline: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff; color: #111827;
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
.inv-paper-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; font-size: 11px; color: var(--muted);
}
.inv-paper-note svg { width: 14px; height: 14px; color: var(--ok); }
.inv-tip {
  margin: 18px 2px 0; font-size: 11px; line-height: 1.65; color: var(--muted);
}
.inv-tip strong { color: var(--fg); }

/* paper internals */
.inv-p-band { height: 6px; width: 100%; }
.inv-p-body { padding: 26px; }
@media (min-width: 640px) { .inv-p-body { padding: 34px; } }
.inv-p-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 22px; }
.inv-p-logo { max-height: 40px; max-width: 150px; object-fit: contain; margin-bottom: 8px; display: block; }
.inv-p-co { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.inv-p-meta { font-size: 11.5px; line-height: 1.55; white-space: pre-line; }
.inv-p-doc { text-align: right; }
.inv-p-doc-type { font-size: 25px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.inv-p-num { margin-top: 5px; font-size: 11.5px; font-weight: 700; }
.inv-p-status {
  display: inline-block; margin-top: 8px; border-radius: 999px; padding: 2px 8px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
}
.inv-p-dates { margin-top: 10px; font-size: 11.5px; }
.inv-p-dates b { font-weight: 700; }
.inv-p-split {
  display: grid; gap: 16px; margin-top: 24px; padding-top: 18px;
  border-top: 1px solid currentColor; border-color: rgba(17, 24, 39, 0.12);
}
@media (min-width: 560px) { .inv-p-split { grid-template-columns: 1fr 1fr; } }
.inv-p-label { font-size: 9px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.62; }
.inv-p-client { margin-top: 6px; font-size: 13.5px; font-weight: 700; }
.inv-p-small { font-size: 11.5px; line-height: 1.55; }
.inv-p-due { text-align: right; }
.inv-p-due-amt { margin-top: 4px; font-size: 24px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.inv-p-table { width: 100%; margin-top: 22px; border-collapse: collapse; font-size: 11.5px; }
.inv-p-table th {
  padding: 8px; font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  text-align: left; text-transform: uppercase;
}
.inv-p-table td { padding: 9px 8px; border-bottom: 1px solid rgba(17, 24, 39, 0.1); vertical-align: top; }
.inv-p-table .num { text-align: right; }
.inv-p-table .amt { text-align: right; font-weight: 700; }
.inv-p-totals { display: flex; justify-content: flex-end; margin-top: 16px; }
.inv-p-totals-in { width: 100%; max-width: 300px; font-size: 11.5px; }
.inv-p-trow { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.inv-p-trow.is-grand {
  margin-top: 8px; padding-top: 9px; border-top: 1px solid rgba(17, 24, 39, 0.14);
  font-size: 13px; font-weight: 800;
}
.inv-p-trow.is-grand span:last-child { font-size: 16px; font-weight: 900; }
.inv-p-pay { margin-top: 22px; border: 1px solid rgba(17, 24, 39, 0.12); border-radius: 9px; padding: 11px; }
.inv-p-pay-grid { display: grid; gap: 3px 22px; margin-top: 7px; font-size: 11.5px; }
@media (min-width: 560px) { .inv-p-pay-grid { grid-template-columns: 1fr 1fr; } }
.inv-p-pay-row { display: flex; justify-content: space-between; gap: 12px; }
.inv-p-foot {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-top: 22px; padding-top: 16px;
  border-top: 1px solid rgba(17, 24, 39, 0.12); font-size: 10.5px; line-height: 1.6;
}
.inv-p-notes { max-width: 62%; }
.inv-p-notes b { text-transform: uppercase; letter-spacing: 0.06em; font-size: 9.5px; }
.inv-p-sign { text-align: right; }
.inv-p-sign-line { height: 32px; width: 160px; margin-bottom: 4px; border-bottom: 1px solid rgba(17, 24, 39, 0.25); }
.inv-p-sign span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.18em; opacity: 0.62; }

/* paper colour themes */
.inv-paper.t-minimal { background: #fff; color: #111827; }
.inv-paper.t-minimal .inv-p-band { background: #111827; }
.inv-paper.t-minimal .inv-p-table th { background: #f3f4f6; color: #4b5563; }
.inv-paper.t-corporate { background: #fff; color: #0f172a; }
.inv-paper.t-corporate .inv-p-band { background: #1d4ed8; }
.inv-paper.t-corporate .inv-p-doc-type { color: #1d4ed8; }
.inv-paper.t-corporate .inv-p-table th { background: #eff6ff; color: #1e40af; }
.inv-paper.t-corporate .inv-p-due-amt,
.inv-paper.t-corporate .inv-p-trow.is-grand span:last-child { color: #1d4ed8; }
.inv-paper.t-dark { background: #0b0d10; color: #f3f4f6; }
.inv-paper.t-dark .inv-p-band { background: #6366f1; }
.inv-paper.t-dark .inv-p-doc-type { color: #a5b4fc; }
.inv-paper.t-dark .inv-p-table th { background: rgba(255, 255, 255, 0.06); color: #d4d4d8; }
.inv-paper.t-dark .inv-p-table td { border-bottom-color: rgba(255, 255, 255, 0.1); }
.inv-paper.t-dark .inv-p-split,
.inv-paper.t-dark .inv-p-foot { border-top-color: rgba(255, 255, 255, 0.12); }
.inv-paper.t-dark .inv-p-pay { border-color: rgba(255, 255, 255, 0.14); }
.inv-paper.t-dark .inv-p-due-amt,
.inv-paper.t-dark .inv-p-trow.is-grand span:last-child { color: #a5b4fc; }
.inv-paper.t-dark .inv-p-sign-line { border-bottom-color: rgba(255, 255, 255, 0.3); }
.inv-paper .st-paid { background: rgba(16, 185, 129, 0.14); color: #047857; }
.inv-paper .st-unpaid { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.inv-paper .st-draft { background: rgba(107, 114, 128, 0.16); color: #4b5563; }
.inv-paper.t-dark .st-paid { color: #6ee7b7; }
.inv-paper.t-dark .st-unpaid { color: #fcd34d; }
.inv-paper.t-dark .st-draft { color: #d4d4d8; }

/* toasts */
.inv-toasts {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.inv-toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card);
  color: var(--fg); font-size: 12.5px; font-weight: 700;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.4);
  animation: invToast 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.inv-toast svg { width: 16px; height: 16px; color: var(--ok); }
.inv-toast.is-error svg { color: var(--danger); }
@keyframes invToast {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ------------------------- answer-engine summary ------------------------ */
.inv-summary { padding: 30px 0 0; }
.inv-aeo {
  border: 1px solid rgba(99, 102, 241, 0.32); border-radius: var(--radius);
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(34, 211, 238, 0.06));
}
.inv-aeo-label {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px;
  font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.inv-aeo-label svg { width: 13px; height: 13px; }
.inv-aeo p { margin: 8px 0 0; font-size: 15.5px; line-height: 1.7; color: var(--fg); }

/* ------------------------------- content -------------------------------- */
.inv-content { max-width: 1120px; margin: 0 auto; padding: 8px 18px 64px; }
.inv-sec { margin-top: 52px; }
.inv-eyebrow {
  display: inline-block; margin-bottom: 8px; font-size: 11px; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
}
.inv-sec h2 {
  margin: 0; font-size: clamp(1.35rem, 3vw, 1.85rem); font-weight: 900;
  letter-spacing: -0.03em; line-height: 1.15; text-wrap: balance;
}
.inv-sec h3 { margin: 0; font-size: 1rem; font-weight: 800; letter-spacing: -0.015em; }
.inv-sec p { margin: 12px 0 0; font-size: 15px; line-height: 1.78; color: var(--muted); }
.inv-sec p strong { color: var(--fg); font-weight: 700; }
.inv-sec ul, .inv-sec ol { margin: 14px 0 0; padding-left: 22px; color: var(--muted); font-size: 15px; line-height: 1.75; }
.inv-sec li { margin-top: 6px; }
.inv-sec a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(99, 102, 241, 0.35); }
.inv-sec a:hover { border-bottom-color: currentColor; }
.inv-cards { display: grid; gap: 14px; margin-top: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .inv-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .inv-cards.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.inv-card-soft {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  background: var(--card); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.inv-card-soft:hover {
  transform: translateY(-3px); border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 20px 44px -26px rgba(79, 70, 229, 0.5);
}
.inv-card-soft h3 { margin: 0; }
.inv-card-soft p { margin-top: 8px; font-size: 14px; }
.inv-city { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); }

.inv-tablewrap {
  margin-top: 22px; overflow-x: auto; max-width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
}
.inv-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; text-align: left; }
.inv-table th, .inv-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.inv-table tbody tr:last-child th, .inv-table tbody tr:last-child td { border-bottom: 0; }
.inv-table thead th {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted);
}
.inv-table th[scope="row"] { font-weight: 700; color: var(--fg); }
.inv-table td { color: var(--muted); }
.inv-table .yes { color: var(--ok); font-weight: 700; }
.inv-table .no { color: var(--muted); }
.inv-table .tg { color: var(--accent); font-weight: 700; }
.inv-table caption { padding: 14px 16px 0; text-align: left; font-size: 12px; color: var(--muted); }

.inv-steps { display: grid; gap: 14px; margin: 22px 0 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .inv-steps { grid-template-columns: repeat(3, 1fr); } }
.inv-steps li { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 18px; }
.inv-steps .num {
  display: block; font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 800; color: var(--accent);
}
.inv-steps h3 { margin-top: 6px; }
.inv-steps p { margin-top: 6px; font-size: 14px; }

/* faq */
.inv-faq { display: grid; gap: 10px; margin-top: 20px; }
.inv-faq details {
  border: 1px solid var(--border); border-radius: 14px; background: var(--card);
  padding: 0 18px;
}
.inv-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 0; cursor: pointer; list-style: none; font-size: 14.5px; font-weight: 700;
}
.inv-faq summary::-webkit-details-marker { display: none; }
.inv-faq summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; color: var(--muted); }
.inv-faq details[open] summary::after { content: "\2013"; }
.inv-faq p { margin: 0; padding-bottom: 15px; font-size: 14.5px; line-height: 1.75; }

/* cluster grid */
.inv-cluster { margin-top: 52px; }
.inv-cluster-grid { display: grid; gap: 12px; margin-top: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .inv-cluster-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .inv-cluster-grid { grid-template-columns: repeat(3, 1fr); } }
.inv-cluster-card {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card);
  text-decoration: none; color: var(--fg);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.inv-cluster-card:hover {
  transform: translateY(-2px); border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 18px 40px -26px rgba(79, 70, 229, 0.55);
}
.inv-cluster-card .name { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; }
.inv-cluster-card .desc { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.inv-cluster-card .tag {
  align-self: flex-start; margin-top: 4px; font-size: 10px; font-weight: 800;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent-2);
}
.inv-cluster-card[aria-current="page"] { border-color: rgba(99, 102, 241, 0.55); background: var(--accent-soft); }

/* --------------------------------- print -------------------------------- */
#print-area { display: none; }

@media print {
  @page { size: A4; margin: 12mm; }
  html, body { background: #fff !important; }
  /* `visibility: hidden` keeps every hidden element in the layout, so the
     site chrome still paginated the job into a dozen blank sheets. Removing
     the siblings from the box tree is what makes the export exactly one
     invoice page. */
  body > *:not(#print-area) { display: none !important; }
  #print-area {
    display: block !important; position: static; width: 100%;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  #print-area > * {
    max-width: none !important; width: 100% !important;
    border-radius: 0 !important; box-shadow: none !important; outline: none !important;
  }
  #print-area .no-print { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
