/* ============================================================
   GST Invoice Generator - Trebots
   Dark app chrome  +  clean white printable invoice document
   ============================================================ */

/* Self-hosted fonts - nothing is fetched from third-party CDNs */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900;
  font-display: swap; src: url("fonts/inter.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 100 900;
  font-display: swap; src: url("fonts/fraunces.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces"; font-style: italic; font-weight: 100 900;
  font-display: swap; src: url("fonts/fraunces-italic.woff2") format("woff2");
}

:root {
  --bg:        #07080d;
  --bg-2:      #0b0d15;
  --card:      #11141f;
  --card-2:    #171b29;
  --border:    #1e2435;
  --border-2:  #2b3450;
  --text:      #eef1f8;
  --muted:     #9aa3bd;
  --faint:     #687293;
  --accent:    #2fd6a6;          /* emerald - the signature */
  --accent-2:  #15b487;
  --accent-ink:#04332a;
  --gold:      #f3c177;          /* warm secondary */
  --good:      #2fd6a6;
  --warn:      #f0a93b;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --radius:    14px;
  --shadow:    0 18px 50px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;            /* never allow sideways scroll on mobile */
  width: 100%;
}
html { scroll-behavior: smooth; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(47,214,166,.28); color: #fff; }

/* Visible keyboard-focus ring for all interactive controls (accessibility).
   :focus-visible keeps it to keyboard/AT use, not mouse clicks. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.btn-remove:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
summary:focus-visible { outline-offset: 3px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(7,8,13,.72);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav__inner {
  max-width: 1240px; margin: 0 auto; padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__mark { display: inline-flex; filter: drop-shadow(0 4px 14px rgba(47,214,166,.4)); }
.brand__text strong { display: block; font-size: 16px; letter-spacing: .2px; line-height: 1.05; }
.brand__sub { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.nav__right { display: flex; align-items: center; gap: 12px; }
@media (max-width: 560px) { .nav__right .pill { display: none; } }

/* Floating share button (FAB) - fixed bottom-right, round, works on mobile & desktop */
.share-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 54px; height: 54px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(47,214,166,.55);
  background: linear-gradient(135deg, #6ee7c7, #0fae7e);
  color: #04140f; cursor: pointer;
  box-shadow: 0 10px 26px rgba(4,6,10,.42), 0 0 0 5px rgba(47,214,166,.10);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.share-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(4,6,10,.5), 0 0 0 6px rgba(47,214,166,.14); }
.share-fab:active { transform: translateY(0); }
.share-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.share-fab .ico { width: 23px; height: 23px; }
.share-fab__check { display: none; }
/* copied state: swap share glyph for a check + show the tooltip */
.share-fab.is-copied .share-fab__ico { display: none; }
.share-fab.is-copied .share-fab__check { display: block; }
/* tooltip bubble that appears after copy */
.share-fab__tip {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; padding: 7px 11px; border-radius: 9px;
  background: #0d1017; color: #eaf2ff; border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; box-shadow: 0 8px 20px rgba(4,6,10,.4);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.share-fab.is-copied .share-fab__tip { opacity: 1; }
@media (max-width: 560px) {
  .share-fab { right: 16px; bottom: 16px; width: 50px; height: 50px; }
}
@media print { .share-fab { display: none !important; } }

/* Social icon links (footers) */
.social { display: inline-flex; align-items: center; gap: 10px; }
.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--muted);
  transition: color .15s ease, border-color .15s ease, background .15s ease, transform .12s ease;
}
.social a:hover { color: var(--accent); border-color: rgba(47,214,166,.5); background: rgba(47,214,166,.08); transform: translateY(-2px); }
.social .ico { width: 19px; height: 19px; }

/* footer row: text links left, social icons right (stack on mobile) */
.foot-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 22px; margin-bottom: 18px; }
.foot-row .appfoot__links, .foot-row nav { margin-bottom: 0; }
.foot-row .social { margin-left: auto; }
@media (max-width: 640px) {
  .foot-row { gap: 16px; }
  .foot-row .social { margin-left: 0; }
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--card); color: var(--muted);
}
.pill--privacy { color: #aef0d2; border-color: rgba(47,214,166,.32); background: rgba(47,214,166,.08); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero__decor { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__decor .orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
}
.orb--a { width: 520px; height: 520px; left: -120px; top: -160px;
  background: radial-gradient(circle, rgba(47,214,166,.55), transparent 65%); }
.orb--b { width: 460px; height: 460px; right: -120px; top: 40px;
  background: radial-gradient(circle, rgba(243,193,119,.32), transparent 65%);
  animation: drift 16s ease-in-out infinite; }
.hero__grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
}

.hero__inner {
  max-width: 1240px; margin: 0 auto; padding: 64px 24px 56px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center;
}
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; padding: 44px 24px 40px; gap: 28px; text-align: center; }
  .hero__cta, .hero__trust { justify-content: center; }
  .eyebrow { margin-left: auto; margin-right: auto; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  color: #bfe6d6; padding: 6px 13px 6px 10px; border-radius: 999px;
  border: 1px solid rgba(47,214,166,.28); background: rgba(47,214,166,.07);
  margin-bottom: 22px;
}
.eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(47,214,166,.18); }

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(38px, 5.4vw, 60px);
  line-height: 1.04; letter-spacing: -.015em;
  margin: 0 0 20px; color: #fbfdff;
}
.hero__title em {
  font-style: italic; font-weight: 500;
  background: linear-gradient(105deg, var(--accent) 10%, var(--gold) 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__sub {
  font-size: clamp(15.5px, 1.7vw, 18px); color: #c2cadf; line-height: 1.6;
  max-width: 56ch; margin: 0 0 30px;
}
.hero__sub strong { color: #eaf6f0; font-weight: 600; }
@media (max-width: 900px) { .hero__sub { margin-left: auto; margin-right: auto; } }

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.hero__trust {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px;
  color: var(--muted); font-size: 13.5px; font-weight: 500;
}
.hero__trust li { display: inline-flex; align-items: center; gap: 8px; }
.hero__trust .ico { color: var(--accent); }

/* shared minimal line-icon - scales with surrounding text */
.ico { width: 1.05em; height: 1.05em; flex: none; vertical-align: -.16em; }

/* Hero illustration */
.hero__art { display: flex; justify-content: center; }
.art { width: 100%; max-width: 560px; height: auto; }
.art text { letter-spacing: .2px; }
.floaty { transform-box: fill-box; transform-origin: center; }
.art .f1 { animation: float 6.5s ease-in-out infinite; }
.art .f2 { animation: float 7.5s ease-in-out infinite -1.2s; }
.art .f3 { animation: float 6.8s ease-in-out infinite -.6s; }
.art .f4 { animation: float 8s ease-in-out infinite -2s; }
.art .f5 { animation: float 5.8s ease-in-out infinite -.3s; }
.art .spark { transform-box: fill-box; transform-origin: center; animation: twinkle 4s ease-in-out infinite; }
.art .s2 { animation-delay: -1.3s; } .art .s3 { animation-delay: -2.5s; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes drift { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-26px,20px); } }
@keyframes twinkle { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .art .floaty, .art .spark, .orb--b { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  gap: 30px;
  align-items: start;
}
/* Go single-column early so the form (and item rows) never get squeezed */
@media (max-width: 1240px) {
  .layout { grid-template-columns: 1fr; max-width: 880px; }
  .preview-pane { position: static !important; }
  .preview-scroll { max-height: none; }
}

.page-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: 30px; margin: 0 0 8px; letter-spacing: -.01em; color: #fafdff;
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.page-title__kicker {
  font-family: "Inter", sans-serif; font-size: 11.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
  border: 1px solid rgba(47,214,166,.3); background: rgba(47,214,166,.08);
  padding: 4px 10px; border-radius: 999px;
}
.page-lede { color: var(--muted); margin: 0 0 24px; max-width: 60ch; }
.page-lede strong { color: var(--text); }

/* ---------- Cards / fieldsets ---------- */
.card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  margin: 0 0 18px;
  min-width: 0;          /* fieldsets default to min-content width - this lets them shrink on mobile */
}
.form-pane { min-width: 0; }

/* Restored-draft banner (localStorage) */
.draft-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-2);
  background: linear-gradient(180deg, rgba(47,214,166,.10), rgba(47,214,166,.04));
  border-radius: var(--radius);
  padding: 11px 13px;
  margin: 0 0 16px;
  color: var(--text);
  font-size: 13.5px;
}
.draft-banner .ico { width: 18px; height: 18px; color: var(--accent); flex: 0 0 auto; }
.draft-banner__text { flex: 1 1 auto; min-width: 0; }
.draft-banner #clearDraft { flex: 0 0 auto; }
.card > legend {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  padding: 0 8px;
}
.card legend em { color: var(--faint); font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ---------- Fields ---------- */
.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.grid--3 { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); }
@media (max-width: 560px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field em { color: var(--faint); font-style: italic; }

input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-2);
  color: var(--text);
  border-radius: 9px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47,214,166,.16);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--muted) 50%),
  linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input[type="file"] { padding: 8px; color: var(--muted); }
.logo-row { display: flex; align-items: center; gap: 10px; }

.tax-mode {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  display: none;
}
.tax-mode.intra { display: block; color: #bfe6cf; background: rgba(47,191,113,.1); border: 1px solid rgba(47,191,113,.3); }
.tax-mode.inter { display: block; color: #ffd9a8; background: rgba(240,169,59,.1); border: 1px solid rgba(240,169,59,.3); }

/* ---------- Items (card-per-line, fully responsive) ----------
   Row 1: Description (full width).  Row 2: the six short fields in a roomy grid. */
.items-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.item-row {
  position: relative;
  display: grid;
  /* minmax(0,…) lets cells shrink below their content so the row never overflows */
  grid-template-columns: minmax(0,1.3fr) minmax(0,.7fr) minmax(0,1fr) minmax(0,.7fr) minmax(0,1fr) minmax(0,1.1fr);
  gap: 14px 14px;
  align-items: end;
  padding: 18px 46px 18px 18px;     /* right room for the remove button */
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border-radius: 13px;
}
.item-row .f-desc { grid-column: 1 / -1; }                /* Description on its own full row */
.item-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.item-field label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--faint); font-weight: 600; white-space: nowrap;
}
.item-field input, .item-field select { width: 100%; padding: 10px 11px; }
.item-field .i-gst-custom { margin-top: 6px; }
.f-amt .cell-amt {
  display: flex; align-items: center; min-height: 40px; padding: 0 2px;
  color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap;
}
.btn-remove {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: 1px solid var(--border-2); color: var(--faint);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.btn-remove:hover { color: #ff8585; border-color: #6a2b2b; background: rgba(255,80,80,.08); }

@media (max-width: 760px) {
  .item-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* desc full, 6 fields → 2 rows of 3 */
}
@media (max-width: 440px) {
  .item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* desc full, 6 fields → 3 rows of 2 */
  .item-field label { font-size: 10px; }
  .item-row { padding: 16px 42px 16px 14px; gap: 12px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  border-radius: 11px; padding: 11px 17px; border: 1px solid transparent;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .2s ease, background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.btn--lg { padding: 15px 26px; font-size: 16px; }
.btn--primary {
  color: var(--accent-ink); border: none;
  background: linear-gradient(180deg, #4ee3b8, var(--accent) 55%, var(--accent-2));
  box-shadow: 0 10px 26px rgba(47,214,166,.32), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(47,214,166,.42), inset 0 1px 0 rgba(255,255,255,.5); }
.btn--glass {
  color: var(--text); border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.05); backdrop-filter: blur(8px);
}
.btn--glass:hover { border-color: rgba(47,214,166,.5); background: rgba(47,214,166,.08); transform: translateY(-2px); }
.btn--secondary { background: var(--card-2); color: var(--text); border-color: var(--border-2); }
.btn--secondary:hover { border-color: var(--accent); color: #fff; }
.btn--ghost { background: transparent; color: var(--muted); border-color: var(--border-2); }
.btn--ghost:hover { color: var(--text); border-color: var(--accent); }

.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.form-actions .btn { padding: 13px 22px; }
.use-note { margin: 14px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--faint); max-width: 70ch; }
.use-note a { color: var(--muted); text-decoration: underline; }
.use-note a:hover { color: var(--accent); }

/* ---------- Preview pane ---------- */
.preview-pane { position: sticky; top: 80px; min-width: 0; max-width: 100%; }
.preview-toolbar {
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--muted); font-size: 13px; margin-bottom: 10px; padding: 0 2px;
}
.preview-hint { color: var(--faint); font-size: 12px; }
.preview-scroll {
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  overflow-x: hidden;          /* doc is scaled to fit - never scroll sideways */
  border-radius: 14px;
  padding: 18px;
  background: #222a3b;
  border: 1px solid var(--border);
  max-width: 100%;
}
/* Frame holds the scaled document; its height is set by JS so the layout below it stays correct */
.invoice-frame { width: 100%; position: relative; max-width: 100%; overflow: hidden; }

/* ============================================================
   THE INVOICE DOCUMENT  (always light - it's a printable doc)
   ============================================================ */
.invoice {
  background: #ffffff;
  color: #1c2230;
  width: 794px;            /* ~A4 @96dpi - kept fixed; scaled to fit the pane via transform */
  margin: 0;
  padding: 40px 42px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  border-radius: 6px;
  transform-origin: top left;
}
.invoice * { box-sizing: border-box; }

.inv-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.inv-head__seller { max-width: 60%; }
.inv-logo { max-height: 64px; max-width: 200px; object-fit: contain; margin-bottom: 10px; display: block; }
.inv-seller-name { font-size: 19px; font-weight: 800; color: #0b1020; margin: 0 0 4px; }
.inv-seller-meta { color: #50596b; white-space: pre-line; }
.inv-seller-meta .gstin { color: #1c2230; font-weight: 600; }

.inv-title-block { text-align: right; }
.inv-title { font-size: 22px; font-weight: 800; letter-spacing: 1px; color: #0b1020; margin: 0 0 8px; }
.inv-meta-table {
  display: inline-grid; grid-template-columns: auto auto; gap: 5px 16px;
  font-size: 12.5px; text-align: right;
}
.inv-meta-table b { color: #6b7688; font-weight: 600; white-space: nowrap; }
.inv-meta-table span { color: #1c2230; font-weight: 600; white-space: nowrap; }

.inv-rule { height: 2px; background: #0b1020; margin: 18px 0; }

.inv-parties { display: flex; gap: 28px; margin-bottom: 18px; }
.inv-party { flex: 1; }
.inv-party h4 {
  margin: 0 0 5px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: #8a93a6;
}
.inv-party .pname { font-weight: 700; font-size: 14px; color: #0b1020; }
.inv-party .pmeta { color: #50596b; white-space: pre-line; }
.inv-pos {
  margin-bottom: 16px; font-size: 12.5px; color: #50596b;
  background: #f4f6fb; border: 1px solid #e6eaf2; border-radius: 6px; padding: 8px 12px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.inv-pos b { color: #1c2230; }

/* line items table - fixed layout so it can never overflow the A4 width */
table.inv-items {
  width: 100%; border-collapse: collapse; margin-bottom: 4px;
  table-layout: fixed; font-size: 11px;
}
table.inv-items th, table.inv-items td {
  padding: 6px 5px; border-bottom: 1px solid #e6eaf2; overflow: hidden;
}
table.inv-items td { word-break: break-word; }        /* long descriptions wrap; headers do not */
table.inv-items thead th {
  background: #0b1020; color: #fff; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .01em; font-weight: 600; border-bottom: none; white-space: nowrap;
}
table.inv-items thead th.sub { font-size: 9px; opacity: .82; font-weight: 500; }
table.inv-items .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.inv-items .cen { text-align: center; }
table.inv-items tbody tr:nth-child(even) { background: #fafbfe; }
table.inv-items td .desc-main { font-weight: 600; color: #1c2230; }
table.inv-items .tax-grp { border-left: 1px solid rgba(255,255,255,.18); }
table.inv-items tbody .tax-grp { border-left-color: #e6eaf2; }

/* totals */
.inv-bottom { display: flex; justify-content: space-between; gap: 28px; margin-top: 18px; }
.inv-bottom__left { flex: 1; }
.inv-words {
  font-size: 12.5px; color: #1c2230; background: #f4f6fb; border: 1px solid #e6eaf2;
  border-radius: 6px; padding: 10px 12px; margin-bottom: 14px;
}
.inv-words span { color: #8a93a6; display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.inv-bank, .inv-notes { font-size: 12px; color: #50596b; margin-bottom: 12px; }
.inv-bank h5, .inv-notes h5 { margin: 0 0 3px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #8a93a6; }
.inv-bank table td { padding: 1px 0; }
.inv-bank table td:first-child { color: #8a93a6; padding-right: 14px; }

.inv-totals { width: 300px; flex-shrink: 0; }
.inv-totals table { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv-totals td { padding: 6px 4px; }
.inv-totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.inv-totals .lbl { color: #50596b; }
.inv-totals .sep td { border-top: 1px solid #e6eaf2; }
.inv-totals .grand td {
  border-top: 2px solid #0b1020; font-size: 16px; font-weight: 800; color: #0b1020; padding-top: 10px;
}

.inv-sign { margin-top: 30px; display: flex; justify-content: flex-end; text-align: center; }
.inv-sign .box { width: 220px; }
.inv-sign .line { border-top: 1px solid #b7bfce; margin-top: 46px; padding-top: 6px; font-size: 12px; color: #50596b; }

.inv-foot {
  margin-top: 26px; padding-top: 14px; border-top: 1px dashed #d7dce6;
  text-align: center; font-size: 11.5px; color: #8a93a6;
}
.inv-foot a { color: #0f9b73; font-weight: 600; }
.inv-foot strong { color: #1c2230; }

.inv-empty { text-align: center; color: #aab2c2; padding: 30px 0; font-style: italic; }

/* ---------- Section title (FAQ etc.) ---------- */
.section-title {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(26px, 3.5vw, 36px);
  letter-spacing: -.01em; color: #fafdff; margin: 0 0 24px; text-align: center;
}

/* ---------- Custom / white-label CTA ---------- */
.promo { border-top: 1px solid var(--border); background: var(--bg-2); position: relative; overflow: hidden; isolation: isolate; }
.promo::before {
  content: ""; position: absolute; z-index: -1; width: 600px; height: 600px;
  right: -160px; top: -220px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(47,214,166,.18), transparent 62%); filter: blur(20px);
}
.promo__inner {
  max-width: 1100px; margin: 0 auto; padding: 60px 24px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 44px; align-items: center;
  position: relative;
}
.promo__title {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(27px, 3.5vw, 40px);
  line-height: 1.1; letter-spacing: -.015em; color: #fafdff; margin: 12px 0 16px;
}
.promo__title em {
  font-style: italic; font-weight: 500;
  background: linear-gradient(105deg, var(--accent) 10%, var(--gold) 95%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.promo__lede { color: #c2cadf; font-size: 16px; line-height: 1.7; margin: 0 0 26px; max-width: 54ch; }
.promo__lede strong { color: var(--text); }
.promo__cta { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.promo__price { font-size: 15px; color: var(--muted); }
.promo__price strong { color: var(--text); font-size: 18px; font-weight: 700; }
.promo__price span { color: var(--faint); font-size: 13px; }
.promo__btns { display: flex; gap: 12px; flex-wrap: wrap; }
.promo__note { font-size: 12.5px; color: var(--faint); }
.promo__features {
  list-style: none; margin: 0; padding: 24px; display: grid; gap: 16px;
  border: 1px solid var(--border-2); border-radius: 16px;
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  box-shadow: var(--shadow);
}
.promo__features li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.promo__features .ico { color: var(--accent); margin-top: 2px; }
.promo__features strong { color: var(--text); font-weight: 600; }
@media (max-width: 860px) {
  .promo__inner { grid-template-columns: 1fr; gap: 28px; padding: 46px 22px; }
}

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--border); background: linear-gradient(180deg, var(--bg), var(--bg-2)); }
.faq__inner { max-width: 800px; margin: 0 auto; padding: 64px 24px 56px; }
.faq__list { display: flex; flex-direction: column; gap: 12px; }
.faq__item {
  border: 1px solid var(--border); background: var(--card); border-radius: 12px;
  padding: 4px 18px; transition: border-color .15s;
}
.faq__item[open] { border-color: var(--border-2); }
.faq__item summary {
  cursor: pointer; list-style: none; padding: 14px 0; font-weight: 600; font-size: 15.5px;
  color: var(--text); display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; color: var(--accent); font-size: 22px; font-weight: 400; line-height: 1; flex: none;
}
.faq__item[open] summary::after { content: "−"; }
.faq__item p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; font-size: 14.5px; }
.faq__item p strong { color: var(--text); }
.faq__item p em { color: var(--muted); }
.faq__item code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em;
  background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text);
}

/* ---------- App footer ---------- */
.appfoot { border-top: 1px solid var(--border); background: var(--bg-2); }
.appfoot__inner { max-width: 1240px; margin: 0 auto; padding: 30px 24px 44px; }
.appfoot__cta { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.appfoot__cta strong { color: var(--text); }
.appfoot__quote { display: inline-block; margin-left: 4px; color: var(--accent); font-weight: 600; }
.appfoot__links { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
.appfoot__links a { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.appfoot__links a:hover { color: var(--accent); text-decoration: none; }
.appfoot__fine { color: var(--faint); font-size: 12px; line-height: 1.6; margin: 0; max-width: 90ch; }
.appfoot__fine strong { color: var(--muted); }

/* ---------- Legal modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4,6,10,.74); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 16px;
  width: 100%; max-width: 620px; max-height: 86vh; overflow: auto; box-shadow: var(--shadow);
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0;
  padding: 18px 22px; border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.modal__head h3 { margin: 0; font-size: 18px; font-family: var(--font-display); font-weight: 500; }
.modal__close {
  background: transparent; border: none; color: var(--muted); font-size: 26px; cursor: pointer;
  line-height: 1; width: 36px; height: 36px; border-radius: 9px;
}
.modal__close:hover { color: var(--text); background: var(--card-2); }
.modal__body { padding: 8px 22px 24px; }
.modal__body p { color: var(--muted); line-height: 1.65; font-size: 14px; }
.modal__body p strong { color: var(--text); }
.modal__body a { color: var(--accent); }

/* ---------- Standalone legal / content pages ---------- */
.legal-wrap { max-width: 820px; margin: 0 auto; padding: 52px 24px 80px; }
.legal-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; font-weight: 600; margin-bottom: 22px; }
.legal-back:hover { color: var(--accent); text-decoration: none; }
.legal-wrap h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.01em; color: #fafdff; margin: 0 0 8px; }
.legal-updated { color: var(--faint); font-size: 13px; margin: 0 0 10px; }
.legal-lede { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0 0 26px; }
.legal-lede strong { color: var(--text); }
.legal-wrap h2 { font-size: 18px; color: var(--text); margin: 32px 0 10px; }
.legal-wrap p, .legal-wrap li { color: var(--muted); line-height: 1.7; font-size: 15px; }
.legal-wrap p { margin: 0 0 14px; }
.legal-wrap strong { color: var(--text); }
.legal-wrap ul { padding-left: 20px; margin: 0 0 14px; }
.legal-wrap li { margin-bottom: 7px; }
.legal-wrap a { color: var(--accent); }
.legal-note {
  border: 1px solid rgba(47,214,166,.28); background: rgba(47,214,166,.07); color: #bfe6d6;
  border-radius: 12px; padding: 14px 18px; font-size: 14px; line-height: 1.6; margin: 0 0 26px;
}
/* ---------- Pricing page ---------- */
.price-wrap { max-width: 1100px; margin: 0 auto; padding: 44px 24px 72px; }
.price-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.price-head .eyebrow { margin: 0 auto 16px; }
.price-head h1 {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 4.4vw, 46px);
  letter-spacing: -.015em; color: #fafdff; margin: 0 0 14px;
}
.price-sub { color: var(--muted); font-size: 16px; line-height: 1.65; margin: 0; }
.price-sub strong { color: var(--text); }
.price-anchor {
  display: inline-block; margin: 20px auto 0; padding: 11px 20px; border-radius: 999px;
  border: 1px solid rgba(47,214,166,.32); background: rgba(47,214,166,.07);
  font-size: 14.5px; color: var(--muted);
}
.price-anchor strong { color: #fafdff; font-size: 17px; font-weight: 700; }
.price-anchor span { color: var(--faint); }
.price-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; align-items: start; max-width: 760px; margin: 0 auto; }
.price-card {
  position: relative; border: 1px solid var(--border); border-radius: 16px;
  background: linear-gradient(180deg, var(--card), var(--bg-2)); padding: 26px 22px;
  display: flex; flex-direction: column;
}
.price-card--featured {
  border-color: rgba(47,214,166,.5);
  box-shadow: 0 0 0 1px rgba(47,214,166,.25), 0 20px 50px rgba(47,214,166,.10);
}
.price-card__badge {
  position: absolute; top: -11px; left: 22px;
  background: linear-gradient(180deg, #4ee3b8, var(--accent)); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px;
}
.price-card__name { font-size: 19px; margin: 0 0 6px; color: #fafdff; }
.price-card__for { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 16px; min-height: 40px; }
.price-card__price { font-size: 30px; font-weight: 800; color: #fafdff; font-family: var(--font-display); letter-spacing: -.01em; margin: 0 0 14px; }
.price-card__price span { font-family: "Inter", sans-serif; font-size: 12.5px; font-weight: 500; color: var(--faint); margin-left: 8px; letter-spacing: 0; }
.price-card__meta { color: var(--accent); font-size: 13.5px; font-weight: 600; margin: 2px 0 18px; }
.btn--block { width: 100%; }
.price-card__list { list-style: none; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 11px; }
.price-card__list li { position: relative; padding-left: 24px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.price-card__list li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 9px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.price-card__list li:first-child { color: var(--text); font-weight: 600; }

.price-after-title {
  font-family: var(--font-display); font-weight: 500; font-size: 24px; color: #fafdff;
  text-align: center; margin: 48px 0 18px;
}
.price-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 0; }
.price-extra__item { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); padding: 18px 20px; }
.price-extra__item h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.price-extra__item p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.price-extra__item p + p { margin-top: 12px; }
.price-extra__item strong { color: var(--text); }

.price-note { text-align: center; max-width: 70ch; margin: 16px auto 0; font-size: 12.5px; line-height: 1.6; color: var(--faint); }
.price-note strong { color: var(--muted); }

.price-cta { text-align: center; margin: 44px auto 0; max-width: 560px; }
.price-cta h2 { font-family: var(--font-display); font-weight: 500; font-size: 28px; color: #fafdff; margin: 0 0 8px; }
.price-cta p { color: var(--muted); margin: 0 0 20px; }

@media (max-width: 920px) {
  .price-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .price-card__for { min-height: 0; }
  .price-extra { grid-template-columns: 1fr; }
}

/* ---------- Contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: start; margin-top: 8px; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; gap: 22px; } }
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.cf-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
@media (max-width: 480px) { .cf-grid { grid-template-columns: 1fr; } }
.cf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-field span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.cf-field em { color: var(--faint); font-style: italic; }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cf-status { margin: 0; padding: 11px 14px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.cf-status:empty { display: none; padding: 0; }
.cf-status--ok { background: rgba(47,214,166,.1); border: 1px solid rgba(47,214,166,.35); color: #bfe6d6; }
.cf-status--warn { background: rgba(240,169,59,.1); border: 1px solid rgba(240,169,59,.35); color: #ffd9a8; }
.cf-status--warn a { color: #ffd9a8; text-decoration: underline; }
.cf-fine { font-size: 12px; color: var(--faint); margin: 0; }
.cf-fine a { color: var(--muted); }
.contact-aside { display: flex; flex-direction: column; gap: 16px; }
.contact-card { border: 1px solid var(--border); background: var(--bg-2); border-radius: 14px; padding: 18px 20px; }
.contact-card h3 { margin: 0 0 8px; font-size: 15px; color: #fafdff; }
.contact-card > p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.contact-card--accent { border-color: rgba(47,214,166,.32); background: rgba(47,214,166,.06); }
.contact-line { display: flex; flex-direction: column; gap: 1px; }
.contact-line span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.contact-line a { color: var(--accent); font-weight: 600; }
.contact-list { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.contact-list li { margin-bottom: 5px; }

.legal-foot { border-top: 1px solid var(--border); background: var(--bg-2); }
.legal-foot__inner { max-width: 820px; margin: 0 auto; padding: 26px 24px 40px; color: var(--faint); font-size: 12.5px; line-height: 1.6; }
.legal-foot__inner nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; }
.legal-foot__inner nav a { color: var(--muted); font-weight: 500; }
.legal-foot__inner nav a:hover { color: var(--accent); text-decoration: none; }

/* ============================================================
   MOBILE  - small-screen refinements
   ============================================================ */
@media (max-width: 640px) {
  body { font-size: 14.5px; }

  /* nav */
  .nav__inner { padding: 11px 16px; }
  .nav__cta { display: none; }                    /* "Create invoice" already lives in the hero on mobile */

  /* hero */
  .hero__inner { padding: 34px 18px 30px; }
  .hero__title { font-size: clamp(30px, 8vw, 40px); }
  .hero__cta { gap: 10px; }
  .hero__cta .btn { flex: 1 1 100%; }            /* full-width stacked CTAs */
  .hero__trust { gap: 8px 16px; font-size: 13px; }
  .art { max-width: 420px; }

  /* layout / cards */
  .layout { padding: 12px 14px 56px; gap: 22px; }
  .page-title { font-size: 25px; }
  .card { padding: 15px 14px 17px; }
  .grid { gap: 12px; }

  /* form action buttons: Download full-width, Print/Reset share a row */
  .form-actions { gap: 10px; }
  .form-actions .btn { padding: 13px 16px; }
  .form-actions .btn--primary { flex: 1 1 100%; }
  .form-actions .btn--secondary,
  .form-actions .btn--ghost { flex: 1 1 calc(50% - 5px); }

  /* preview */
  .preview-scroll { padding: 12px; max-height: none; }

  /* FAQ / footer / legal */
  .faq__inner { padding: 44px 18px 38px; }
  .faq__item summary { font-size: 14.5px; }
  .appfoot__inner { padding: 26px 18px 38px; }
  .appfoot__links { gap: 14px 18px; }
  .legal-wrap { padding: 38px 18px 56px; }
  .legal-foot__inner { padding: 24px 18px 36px; }
}

@media (max-width: 380px) {
  .hero__title { font-size: 27px; }
}

/* ============================================================
   PRINT  - show only the invoice, full white page
   ============================================================ */
@media print {
  .no-print, .modal-backdrop, .toast, .form-pane, .preview-toolbar { display: none !important; }
  html, body { background: #fff; margin: 0; }
  .layout { display: block; padding: 0; margin: 0; max-width: none; gap: 0; }
  .preview-pane { position: static; }
  .preview-scroll { max-height: none; overflow: visible; padding: 0; background: #fff; border: none; }
  .invoice-frame { height: auto !important; width: auto !important; overflow: visible !important; }
  .invoice { box-shadow: none; border-radius: 0; width: 100%; padding: 0; transform: none !important; }
  @page { size: A4; margin: 14mm; }
}
