/* ============================================================
   flexinvoice — Frontend Stylesheet
   Preserved design, reverse-engineered from existing HTML.
   ============================================================ */

:root {
  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --ink: #0f172a;
  --ink-muted: #64748b;

  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334159;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  --success: #16a34a;
  --success-bg: #dcfce7;
  --green: #16a34a;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --violet: #7c3aed;
  --violet-bg: #ede9fe;
  --cyan: #0891b2;
  --cyan-bg: #cffcff;

  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --transition: 0.25s ease;
}

/* ============================================================
   Reset & Base
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  -webkit-font-optimize: auto;
}

a {
  color: var(--primary);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a:hover, a:focus {
  text-decoration: underline;
}

button, input, select, textarea {
  font: inherit;
}

ul, ol {
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.75em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 4vw + 1rem, 3.5rem); }
h2 { font-size: clamp(1.5rem, 2.5vw + 1rem, 2.25rem); }
h3 { font-size: clamp(1.125rem, 1.5vw + 0.9rem, 1.4rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
strong { font-weight: 600; }

svg { display: block; }

/* ============================================================
   Layout Helpers
   ============================================================ */

.container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1rem;
  padding-block: 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-block: .9rem;
}

.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.grid-center { display: grid; place-items: center; }

.grid-2 {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(3, 1fr);
}

.split {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr 1.2fr;
  align-items: center;
}

.stats {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 2rem;
  font-family: var(--font-display);
  font-weight: 800;
}

.stat small {
  color: var(--ink-muted);
  font-size: .85rem;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: none;
  border-radius: 10px;
  padding: .6rem 1.15rem;
  font-family: var(--font-base);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 20px rgba(79, 70, 161, .25);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover {
  background: rgba(0, 0, 0, .04);
}

.btn-light {
  background: var(--slate-50);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-light:hover {
  background: var(--slate-100);
}

.btn-sm { padding: .4rem .85rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }
.btn-block { display: block; width: 100%; }

.grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.dot {
  display: inline-block;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--success);
  margin-right: .35rem;
}

.dot-sep {
  display: inline-block;
  width: .35rem;
  height: .35rem;
  border-radius: 50%;
  background: var(--slate-400);
  margin: 0 .5rem;
}

/* ============================================================
   Header / Navigation
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
}

.site-header .logo span { color: var(--primary); }
.site-header .logo .logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-weight: 500;
  font-size: .92rem;
}

.nav-links a {
  color: var(--ink);
  padding: .3rem 0;
  position: relative;
}

.nav-links a:hover { color: var(--primary); }
.nav-links a.active,
.nav-links a.active:hover {
  color: var(--primary);
}

.nav-links a.active::after,
.nav-links a.active::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--primary);
}

.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 3.5px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: .25rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: var(--transition);
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  padding-block: 4.5rem 3rem;
}

.hero-inner {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr .95fr;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--slate-100);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .25rem .8rem;
  font-size: .8rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.hero-badge .dot {
  width: .6rem; height: .6rem;
  margin-right: .15rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw + 1rem, 3.2rem);
  margin-bottom: 1rem;
}

.hero .grad { font-size: inherit; }

.hero .lead {
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 36rem;
  margin-bottom: 1.75rem;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-proof {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.hero-avatars {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-right: auto;
}

.hero-avatars img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
}

.hero-proof p {
  font-size: .9rem;
  color: var(--ink);
}

.hero-proof strong { font-weight: 700; }

.mockup-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.mockup {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
}

.mockup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .75rem;
}

.mockup-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.mockup-tag {
  font-size: .7rem;
  font-weight: 600;
  color: var(--success);
  background: var(--success-bg);
  padding: .15rem .5rem;
  border-radius: 5px;
}

.mockup-row {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  padding: .35rem 0;
  border-bottom: 1px dashed var(--slate-200);
}

.mockup-row:last-of-type { border-bottom: none; }
.mockup-row strong { font-weight: 600; }

.mockup-total {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  padding: .7rem 0;
  border-top: 2px solid var(--primary);
  margin-top: .5rem;
}

.float-chip {
  position: absolute;
  top: 0;
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .45rem .7rem;
  font-size: .78rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  box-shadow: var(--shadow-sm);
  animation: float 3s ease-in-out infinite;
}

.float-chip .ic {
  display: flex;
  align-items: center;
  justify-content: center;
}

.float-chip div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.float-chip small {
  font-size: .62rem;
  color: var(--ink-muted);
}

.chip-1 { top: -10px; left: -12px; animation-delay: 0s; }
.chip-2 { top: -20px; right: -12px; animation-delay: .5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

/* ============================================================
   Trust Strip
   ============================================================ */

.trust-strip {
  background: var(--slate-50);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.trust-strip p {
  font-size: .85rem;
  color: var(--ink-muted);
  text-align: center;
  margin-bottom: .75rem;
}

.trust-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-500);
}

/* ============================================================
   Sections
   ============================================================ */

.section {
  padding-block: 4rem 3rem;
}

.section-alt {
  background: var(--slate-50);
  padding-block: 4rem 3rem;
}

.sec-head {
  text-align: center;
  margin-bottom: 3rem;
}

.sec-eyebrow {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--primary);
  margin-bottom: .75rem;
  display: block;
}

.sec-head h2 { margin-bottom: .75rem; }
.sec-head p {
  color: var(--ink-muted);
  font-size: 1.05rem;
  max-width: 44rem;
  margin-inline: auto;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--slate-200);
}

.card.service-card { position: relative; }
.card.service-card .num {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--slate-200);
}

.card .card-ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.card .card-ic.violet { background: var(--violet-bg); color: var(--violet); }
.card .card-ic.cyan { background: var(--cyan-bg); color: var(--cyan); }
.card .card-ic.green { background: #dcfce7; color: var(--green); }
.card .card-ic.amber { background: var(--amber-bg); color: var(--amber); }

.card h3 { margin: .5rem 0; font-size: 1.15rem; }
.card p { color: var(--ink-muted); font-size: .92rem; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--primary);
  font-weight: 500;
  font-size: .85rem;
  margin-top: auto;
}

.card-link svg { width: 16px; }

.testimonial {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.testimonial .stars {
  font-size: 1.1rem;
  color: #eab308;
  letter-spacing: .05em;
}

.testimonial blockquote {
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  quotes: "\u201C" "\u201D" "\u2018" "\u2019";
}

.testimonial blockquote::before { content: open-quote; font-size: 2rem; color: var(--slate-300); position: absolute; }
.testimonial blockquote::after { content: close-quote; }

.testimonial .testimonial-person {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: auto;
}

.testimonial .testimonial-person img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial .testimonial-person strong { font-size: .95rem; }
.testimonial .testimonial-person small {
  color: var(--ink-muted);
  font-size: .8rem;
}

/* ============================================================
   Page Hero
   ============================================================ */

.page-hero {
  padding-block: 4.5rem 3rem;
  text-align: center;
}

.breadcrumb {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-muted);
  margin-bottom: 1.25rem;
}

.page-hero h1 {
  font-size: clamp(1.8rem, 3.5vw + 1rem, 2.7rem);
  margin-bottom: 1rem;
}

.page-hero p {
  color: var(--ink-muted);
  font-size: 1.05rem;
  max-width: 42rem;
  margin-inline: auto;
}

/* ============================================================
   About Preview
   ============================================================ */

.about-preview {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.about-preview img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* ============================================================
   Featured Post
   ============================================================ */

.featured-post {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.featured-post img {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
}

.featured-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--ink-muted);
}

.post-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.article-tag {
  background: var(--slate-100);
  color: var(--ink-muted);
  font-size: .72rem;
  font-weight: 500;
  padding: .25rem .6rem;
  border-radius: 999px;
}

.tool-card {
  flex-direction: column;
}

.tool-card img,
.tool-card .card-ic {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}

.tool-card .tool-body {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.tool-tag {
  align-self: flex-start;
  background: var(--slate-100);
  color: var(--ink-muted);
  font-size: .72rem;
  padding: .2rem .6rem;
  border-radius: 5px;
}

/* ============================================================
   Newsletter
   ============================================================ */

.newsletter {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr 1fr;
  background: var(--slate-50);
  border-radius: var(--radius);
  padding: 3rem;
  border: 1px solid var(--border);
}

.newsletter div:first-child { text-align: left; }
.newsletter h3 { font-size: 1.4rem; margin-bottom: .5rem; }
.newsletter-form {
  display: flex;
  gap: .5rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}

.newsletter-form input {
  border: none;
  padding: .85rem 1rem;
  flex-grow: 1;
  outline: none;
  font-size: .9rem;
}

.newsletter-form button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 0 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.newsletter-form button:hover { background: var(--primary-dark); }
.newsletter-note { font-size: .82rem; margin-top: .5rem; }

/* ============================================================
   CTA Band
   ============================================================ */

.cta-band {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
}

.cta-band h2 {
  font-size: clamp(1.3rem, 2vw + .9rem, 1.8rem);
  margin-bottom: .75rem;
}

.cta-band p {
  color: rgba(255, 255, 255, .85);
  max-width: 36rem;
  margin-inline: auto;
  margin-bottom: 1.5rem;
}

/* ============================================================
   Reveal Animation (Intersection Observer)
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 650ms ease, transform 650ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.delay-1 { transition-delay: 100ms; }
.reveal.delay-2 { transition-delay: 200ms; }
.reveal.delay-3 { transition-delay: 300ms; }

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  background: var(--slate-900);
  color: var(--slate-300);
  padding: 3rem 0 1.5rem;
  font-size: .88rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(4, 1fr);
}

.footer-about .logo {
  color: #fff;
}

.footer-about .logo span { color: var(--primary-light); }

.site-footer h4 {
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: .5rem; }
.site-footer a {
  color: var(--slate-300);
  transition: color var(--transition);
}

.site-footer a:hover { color: var(--primary-light); }

.footer-contact {
  display: grid;
  gap: .75rem;
}

.footer-contact li {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--slate-300);
}

.socials {
  display: flex;
  gap: .7rem;
  margin-top: 1rem;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--slate-800);
  color: var(--slate-300);
  transition: var(--transition);
}

.socials a:hover {
  background: var(--primary);
  color: #fff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  margin-top: 2rem;
  border-top: 1px solid var(--slate-700);
  font-size: .8rem;
  color: var(--slate-500);
}

/* ============================================================
   Tools page specific
   ============================================================ */

.invoice-gen-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 1.2fr;
  align-items: start;
}

.invoice-form,
.invoice-preview-wrap {
  max-width: 600px;
}

.invoice-form {
  max-width: none;
}

.field {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.field label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink);
}

.field input,
.field select,
.field textarea {
  padding: .6rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  background: #fff;
  transition: var(--transition);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 161, .12);
}

.form-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

.form-row .field { margin-bottom: 0; }

.items-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  font-weight: 500;
  margin: 1rem 0;
  color: var(--ink-muted);
}

.item-row {
  display: grid;
  gap: .5rem;
  grid-template-columns: 1.5fr 4rem 6rem auto;
  align-items: end;
  margin-bottom: .75rem;
}

.item-row input { padding: .5rem .6rem; font-size: .85rem; }
.row-remove {
  background: var(--slate-100);
  color: var(--slate-600);
  border: none;
  border-radius: 6px;
  padding: .4rem;
  cursor: pointer;
  transition: var(--transition);
}
.row-remove:hover { background: var(--slate-200); color: var(--primary); }

.add-item-btn {
  background: var(--slate-100);
  color: var(--primary);
  border: 1px dashed var(--slate-300);
  border-radius: 8px;
  padding: .6rem 1rem;
  font-size: .85rem;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1rem;
  width: fit-content;
}

.add-item-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.invoice-actions {
  display: flex;
  gap: .75rem;
  margin-top: 1.5rem;
}

.invoice-preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  font-family: var(--font-base);
  font-size: .8rem;
  line-height: 1.5;
}

.inv-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.inv-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.inv-brand img {
  max-height: 44px;
  max-width: 120px;
  display: none;
}

.inv-brand div strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.inv-brand div small { color: var(--ink-muted); }

.inv-title h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
}

.inv-title p { color: var(--ink-muted); font-size: .8rem; }

.inv-billto { margin-bottom: 1.5rem; }
.inv-billto span { font-size: .65rem; font-weight: 600; text-transform: uppercase; color: var(--ink-muted); }
.inv-billto strong { font-size: .95rem; }

.inv-items {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.inv-items th {
  text-align: left;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: .5rem;
  border-bottom: 2px solid var(--slate-200);
}

.inv-items td {
  padding: .5rem;
  border-bottom: 1px solid var(--slate-200);
}

.inv-items tbody tr:last-child td { border-bottom: none; }

.inv-totals {
  margin-left: auto;
  max-width: 280px;
  display: grid;
  gap: .4rem;
}

.inv-totals div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  border-bottom: 1px solid var(--slate-200);
  padding: .3rem 0;
}

.inv-totals .total {
  font-weight: 700;
  font-size: 1rem;
  border-top: 2px solid var(--slate-200);
  border-bottom: 2px solid var(--slate-200);
  padding: .6rem 0;
}

.inv-notes {
  margin-top: 1.5rem;
  font-size: .8rem;
  color: var(--ink-muted);
  padding-top: 1rem;
  border-top: 1px solid var(--slate-200);
}

.inv-sign {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.inv-sig {
  display: block;
  border-bottom: 2px solid var(--ink);
  padding: 0 .3rem;
  font-size: 1rem;
  min-height: 24px;
  min-width: 120px;
}

.inv-sign-line {
  font-size: .65rem;
  color: var(--ink-muted);
  text-align: right;
  margin-top: 2px;
}

.inv-brand small { display: block; }

.inv-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.inv-reg > span {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-muted);
}

[data-out-reg] {
  display: grid;
  gap: .15rem 1rem;
  grid-template-columns: auto 1fr;
  font-size: .8rem;
  margin-top: .25rem;
}

[data-out-reg] > div {
  display: flex;
  gap: .5rem;
}

[data-out-reg] span {
  min-width: 2.75rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-muted);
}

[data-out-reg] strong { font-weight: 600; color: var(--ink); }

.inv-words {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-200);
  font-size: .78rem;
  font-style: italic;
  color: var(--ink);
}

.inv-payment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .8rem;
}

.inv-payment div span {
  display: block;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-muted);
  margin-bottom: .1rem;
}

.inv-payment div strong { font-weight: 600; word-break: break-word; }

.inv-payment-sub { grid-column: 1 / -1; }

.calc-wrap {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(2, 1fr);
}

.calc {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.calc-result {
  text-align: center;
  padding: 1.25rem;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.result-label { color: var(--ink-muted); font-size: .8rem; }
.result-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }

/* ============================================================
   Contact page
   ============================================================ */

.contact-grid {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.info-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.info-card .ic {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--slate-100);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-card div strong { font-size: .95rem; display: block; margin-bottom: .2rem; }
.info-card div p { color: var(--ink-muted); font-size: .88rem; }

.contact-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-form h2 { font-family: var(--font-display); font-size: 1.3rem; }

.form-status {
  font-size: .85rem;
  padding: .5rem;
  border-radius: 6px;
  min-height: 1.5rem;
  text-align: center;
}

/* ============================================================
   Article / Blog Post
   ============================================================ */

.article-header {
  padding-block: 4.5rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.article-header .breadcrumb { font-size: .8rem; }
.article-header h1 {
  font-size: clamp(1.8rem, 3vw + 1rem, 2.6rem);
  margin: 1rem 0;
}

.article-header .sub {
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 36rem;
  margin: 0 auto;
}

.prose {
  max-width: 48rem;
  margin-inline: auto;
  font-size: 1.05rem;
  line-height: 1.7;
}

.prose h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: var(--ink);
}

.prose h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 .75rem;
  color: var(--ink);
}

.prose p { margin-bottom: 1.25rem; }
.prose ul, .prose ol { margin: 1rem 0; padding-left: 1.5rem; }
.prose li { margin-bottom: .4rem; }
.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose a:hover { color: var(--primary-dark); }
.prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--slate-50);
  border-left: 3px solid var(--primary);
  font-style: italic;
  quotes: "\u201C" "\u201D" "\u2018" "\u2019";
  position: relative;
}
.prose blockquote::before {
  content: open-quote;
  font-size: 3rem;
  position: absolute;
  top: -.5rem;
  left: .5rem;
  color: var(--slate-300);
}
.prose code {
  background: var(--slate-100);
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .85em;
  color: #e11d48;
}
.prose pre {
  background: var(--slate-900);
  color: var(--slate-100);
  padding: 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.2rem 0;
}
.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .9rem;
}
.prose th, .prose td {
  border: 1px solid var(--slate-200);
  padding: .6rem .8rem;
  text-align: left;
}
.prose th {
  background: var(--slate-50);
  font-weight: 600;
  color: var(--ink);
}

.tip {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--slate-50);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  font-size: .95rem;
}

.tip strong { color: var(--primary-dark); }

.author-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-top: 2.5rem;
}

.author-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.author-card strong { font-size: 1.05rem; display: block; }
.author-card small { color: var(--ink-muted); font-size: .85rem; }

.article-cover {
  width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  aspect-ratio: 16/7;
  object-fit: cover;
  margin-top: 2rem;
}

/* ============================================================
   Related Articles
   ============================================================ */

.related {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 2rem;
}

/* ============================================================
   FAQ
   ============================================================ */

.faq { border-top: 1px solid var(--border); }
.faq-item + .faq-item { border-top: 1px solid var(--slate-200); }
.faq-q {
  width: 100%;
  text-align: left;
  padding: 1rem 0;
  background: transparent;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}
.faq-q:hover { color: var(--primary); }
.faq-q svg {
  transition: transform 300ms ease;
  width: 20px;
  height: 20px;
}
.faq-q[aria-expanded="true"] svg { transform: rotate(180deg); }
.faq-a {
  overflow: hidden;
  max-height: 0;
  transition: max-height 300ms ease;
}
.faq-a p {
  padding: 1rem 0;
  color: var(--ink-muted);
  font-size: .92rem;
}
.faq-a.expanded { max-height: 500px; }

/* ============================================================
   Tool Library Filter
   ============================================================ */

.filter-bar {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--slate-100);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .5rem 1.15rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover { color: var(--primary); }
.filter-btn.active {
  background: var(--primary);
  color: #fff;
}

/* ============================================================
   Services grid (index preview + services page)
   ============================================================ */

.services-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
}

/* ============================================================
   Steps (services page "How it works")
   ============================================================ */

.steps {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(3, 1fr);
}

.step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.step:hover {
  border-color: var(--slate-200);
  box-shadow: var(--shadow-md);
}

.step h3 { font-size: 1.15rem; margin: 0 0 .5rem; }
.step p { color: var(--ink-muted); font-size: .92rem; margin: 0; }

/* ============================================================
   Suffix input (tools page unit labels)
   ============================================================ */

.suffix {
  display: flex;
  align-items: stretch;
}

.suffix input {
  flex: 1 1 auto;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.suffix span {
  display: flex;
  align-items: center;
  padding: 0 .8rem;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  background: var(--slate-50);
  color: var(--ink-muted);
  font-size: .82rem;
  white-space: nowrap;
}

/* ============================================================
   Blog search & pagination
   ============================================================ */

.blog-search-wrap {
  position: relative;
  max-width: 420px;
  margin: 1.5rem auto 0;
}

.blog-search-wrap input {
  width: 100%;
  padding: .75rem 2.75rem .75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .9rem;
  background: #fff;
  outline: none;
  transition: var(--transition);
}

.blog-search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 161, .12);
}

.blog-search-wrap svg {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 .75rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-dots { color: var(--ink-muted); padding: 0 .25rem; }

/* ============================================================
   Article share row
   ============================================================ */

.share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* ============================================================
   CMS-injected ad containers
   ============================================================ */

.cms-ad { margin: 1.5rem 0; }
.cms-ad img, .cms-ad iframe { max-width: 100%; }
.cms-ad-header, .cms-ad-footer { text-align: center; }

.tools-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  .grid-3, .grid-2,
  .tools-grid, .related,
  .services-grid, .steps,
  .newsletter, .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-inner { grid-template-columns: 1fr; }
  .hero { padding-block: 3rem 2rem; }
  .hero-ctas { flex-wrap: wrap; }
  .about-preview { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .featured-post { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }

  .invoice-gen-grid { grid-template-columns: 1fr; }
  .calc-wrap { grid-template-columns: 1fr; }

  .nav-cta .btn-sm { display: none; }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(280px, 80vw);
    background: #fff;
    flex-direction: column;
    gap: 1.5rem;
    padding: 5rem 2rem 2rem;
    transform: translateX(100%);
    transition: transform 350ms ease;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    border: 1px solid var(--border);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav-links.open { transform: translateX(0); }
  .nav-links a { padding: .5rem 0; border-bottom: 1px solid var(--slate-200); }

  .nav-toggle { display: flex; }

  .socials { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .sec-head { margin-bottom: 2rem; }

  .section, .section-alt { padding-block: 3rem 2rem; }
  .page-hero { padding-block: 3rem 2rem; }
  .article-header { padding-block: 3rem 2rem; }

  .newsletter { padding: 1.5rem; }
  .cta-band { padding: 2rem 1.25rem; }
  .contact-form { padding: 1.5rem; }
  .featured-body { padding: 1.25rem; }
  .invoice-preview { padding: 1.25rem; }

  .footer-bottom {
    flex-direction: column;
    gap: .5rem;
    text-align: center;
  }

  .item-row {
    grid-template-columns: 1fr 1fr auto;
  }
  .item-row .item-desc { grid-column: 1 / -1; }

  .inv-totals { max-width: 100%; }
  .inv-meta { grid-template-columns: 1fr; }

  .tool-card img { height: 140px; }

  .field input, .field select, .field textarea,
  .newsletter-form input,
  .blog-search-wrap input { font-size: 16px; }

  .float-chip { display: none; }
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }

  .invoice-actions { flex-direction: column; }
  .invoice-actions .btn { width: 100%; }

  .inv-head { flex-direction: column; align-items: flex-start; }

  .newsletter-form { flex-direction: column; }
  .newsletter-form input { width: 100%; }
  .newsletter-form button { width: 100%; padding: .85rem; }

  .inv-payment { grid-template-columns: 1fr; }
  .invoice-preview .inv-items { font-size: .75rem; }
  .invoice-preview .inv-items th,
  .invoice-preview .inv-items td { padding: .35rem .4rem; }
}

/* ============================================================
   Utility classes
   ============================================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Print / PDF — A4 invoice only
   The button clones the live preview into a dedicated print
   container appended to <body>. Only that container is visible
   in the print output; all website UI is hidden.
   ============================================================ */

#print-invoice { display: none; }

@media print {
  @page {
    size: A4;
    margin: 12mm 14mm;
  }

  html, body {
    background: #fff !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Hide everything on the page except the print invoice */
  body > *:not(#print-invoice) {
    display: none !important;
  }

  #print-invoice {
    display: block !important;
    margin: 0;
    padding: 0;
  }

  /* Fallback: Ctrl+P / "Save as PDF" without using the button.
     Print only the on-screen invoice preview, hide the rest of the page. */
  body:not(:has(> #print-invoice)) main > * { display: none !important; }
  body:not(:has(> #print-invoice)) #invoice-generator { display: block !important; }
  body:not(:has(> #print-invoice)) #invoice-generator .container { display: block !important; }
  body:not(:has(> #print-invoice)) #invoice-generator .invoice-gen-grid { display: block !important; }
  body:not(:has(> #print-invoice)) #invoice-generator .sec-head,
  body:not(:has(> #print-invoice)) #invoice-generator .invoice-form { display: none !important; }
  body:not(:has(> #print-invoice)) #invoice-generator .invoice-preview-wrap {
    display: block !important;
    max-width: 100%;
  }
  body:not(:has(> #print-invoice)) #invoice-generator .invoice-preview {
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
  }
  body:not(:has(> #print-invoice)) .inv-items thead { display: table-header-group; }
  body:not(:has(> #print-invoice)) tr,
  body:not(:has(> #print-invoice)) .inv-head,
  body:not(:has(> #print-invoice)) .inv-meta,
  body:not(:has(> #print-invoice)) .inv-totals,
  body:not(:has(> #print-invoice)) .inv-payment,
  body:not(:has(> #print-invoice)) .inv-notes,
  body:not(:has(> #print-invoice)) .inv-sign {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Reset animated/revealed states so nothing is clipped */
  .reveal, .reveal.visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  #print-invoice .invoice-preview {
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: #fff;
    color: #000;
    padding: 0;
    width: 100%;
    max-width: 100%;
    font-size: 11px;
    line-height: 1.45;
  }

  /* Header */
  #print-invoice .inv-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid #111;
  }
  #print-invoice .inv-brand { display: flex; align-items: center; gap: .75rem; }
  #print-invoice .inv-brand img {
    max-height: 50px;
    max-width: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
  }
  #print-invoice .inv-brand div strong { font-size: 1.1rem; }
  #print-invoice .inv-brand div small { display: block; font-size: .72rem; color: #333; }
  #print-invoice .inv-title { text-align: right; }
  #print-invoice .inv-title h3 { font-size: 1.3rem; margin: 0 0 .3rem; letter-spacing: .04em; }
  #print-invoice .inv-title p { margin: .1rem 0; font-size: .75rem; color: #333; }

  /* Client + company registration block */
  #print-invoice .inv-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
  }
  #print-invoice .inv-billto span,
  #print-invoice .inv-reg > span {
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #555;
    font-weight: 700;
  }
  #print-invoice .inv-billto strong { font-size: .95rem; }
  #print-invoice [data-out-reg] { font-size: .78rem; color: #222; }
  #print-invoice [data-out-reg] span { color: #555; }
  #print-invoice [data-out-reg] strong { color: #111; }

  /* Items table */
  #print-invoice .inv-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
  }
  #print-invoice .inv-items th {
    border-bottom: 2px solid #111;
    padding: 6px 8px;
    text-align: left;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #111;
    background: #fff;
  }
  #print-invoice .inv-items td {
    border-bottom: 1px solid #ddd;
    padding: 6px 8px;
  }
  #print-invoice .inv-items th:nth-child(2),
  #print-invoice .inv-items th:nth-child(3),
  #print-invoice .inv-items th:nth-child(4),
  #print-invoice .inv-items td:nth-child(2),
  #print-invoice .inv-items td:nth-child(3),
  #print-invoice .inv-items td:nth-child(4) {
    text-align: right;
  }

  /* Totals */
  #print-invoice .inv-totals {
    margin-left: auto;
    max-width: 260px;
  }
  #print-invoice .inv-totals div {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
    font-size: .8rem;
  }
  #print-invoice .inv-totals .total {
    border-top: 2px solid #111;
    border-bottom: 2px solid #111;
    font-weight: 700;
    font-size: .95rem;
    padding: 8px 0;
    margin-top: 4px;
  }

  /* Amount in words, payment, notes, signature */
  #print-invoice .inv-words {
    margin-top: 1rem;
    font-size: .8rem;
    font-style: italic;
    color: #111;
  }
  #print-invoice .inv-payment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
    padding: .75rem 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: .8rem;
  }
  #print-invoice .inv-payment div span {
    display: block;
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #555;
    font-weight: 700;
  }
  #print-invoice .inv-payment div strong { color: #111; word-break: break-word; }
  #print-invoice .inv-notes {
    margin-top: 1.25rem;
    font-size: .8rem;
    border-top: 1px solid #ddd;
    padding-top: .75rem;
  }
  #print-invoice .inv-sign {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
  }
  #print-invoice .inv-sig {
    border-bottom: 2px solid #000;
    min-width: 120px;
    min-height: 24px;
    font-size: .9rem;
  }
  #print-invoice .inv-sign-line { font-size: .62rem; color: #555; text-align: right; margin-top: 2px; }

  /* Multi-page safety: never split a row or a key block across pages */
  #print-invoice thead { display: table-header-group; }
  #print-invoice tr,
  #print-invoice .inv-head,
  #print-invoice .inv-meta,
  #print-invoice .inv-totals,
  #print-invoice .inv-words,
  #print-invoice .inv-payment,
  #print-invoice .inv-notes,
  #print-invoice .inv-sign {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
