/* Lekkal — design system */
:root {
  --bg: #fafaf6;
  --surface: #ffffff;
  --surface-2: #f3f2ec;
  --surface-3: #e8e7e0;
  --border: rgba(0, 0, 0, 0.08);
  --border-2: rgba(0, 0, 0, 0.14);
  --text: #14181a;
  --text-muted: #5e6764;
  --text-soft: #94998d;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-soft: #ccfbf1;
  --accent-tint: #f0fdfa;
  --success: #0e8a5f;
  --success-soft: #e3f4ec;
  --warning: #b96b00;
  --warning-soft: #fbf0dc;
  --danger: #c93434;
  --danger-soft: #fbe9e9;
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.05);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --maxw: 1100px;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Apple Garamond", serif;
}
[data-theme="dark"] {
  --bg: #0d1513;
  --surface: #131c1a;
  --surface-2: #1b2624;
  --surface-3: #25312e;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.16);
  --text: #ecf3f1;
  --text-muted: #9ca8a5;
  --text-soft: #6c7773;
  --accent: #2dd4bf;
  --accent-2: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --accent-tint: rgba(45, 212, 191, 0.08);
  --success: #4dc999;
  --success-soft: rgba(77, 201, 153, 0.14);
  --warning: #e6a857;
  --warning-soft: rgba(230, 168, 87, 0.14);
  --danger: #ee6464;
  --danger-soft: rgba(238, 100, 100, 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* ====== Top nav ====== */
nav.top {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
nav.top .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
nav.top .brand { display: flex; align-items: center; gap: 10px; }
nav.top .brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 15px;
  font-family: var(--serif);
  letter-spacing: 0;
}
nav.top .brand .name {
  font-weight: 600; letter-spacing: -0.01em; font-size: 18px;
  color: var(--text);
  font-family: var(--serif);
}
nav.top .links { display: flex; align-items: center; gap: 4px; }
nav.top .links a {
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}
nav.top .links a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
nav.top .links a.active { color: var(--text); background: var(--surface-2); }
nav.top .right { display: flex; align-items: center; gap: 8px; }

/* Dropdown menus in the top nav */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown summary {
  list-style: none; cursor: pointer;
  padding: 6px 12px; color: var(--text-muted);
  font-size: 14px; font-weight: 500; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  user-select: none;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary:hover { background: var(--surface-2); color: var(--text); }
.nav-dropdown summary.active,
.nav-dropdown[open] summary { background: var(--surface-2); color: var(--text); }
.nav-dropdown summary .caret {
  width: 10px; height: 10px;
  transition: transform 0.15s ease;
  display: inline-block;
}
.nav-dropdown[open] summary .caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 6px;
  min-width: 240px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  z-index: 20;
}
.nav-dropdown-menu a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: 6px;
  color: var(--text); font-size: 14px; font-weight: 500;
  text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--surface-2); text-decoration: none; }
.nav-dropdown-menu a.disabled {
  color: var(--text-soft); pointer-events: none; cursor: default;
}
.nav-dropdown-menu .meta {
  display: block; font-size: 12px; color: var(--text-soft);
  font-weight: 400; margin-top: 2px;
}
.nav-dropdown-menu .pill {
  font-size: 10px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 7px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: 0.06em;
  flex-shrink: 0;
}
.nav-dropdown-menu .pill.soon {
  background: var(--surface-2); color: var(--text-soft);
}
.nav-dropdown-menu .divider {
  height: 1px; background: var(--border);
  margin: 4px 0;
}
.nav-dropdown-menu .footer {
  font-size: 11px; color: var(--text-soft);
  padding: 6px 12px 4px;
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 500;
}
@media (max-width: 720px) {
  .nav-dropdown-menu { min-width: 200px; }
  .nav-dropdown summary { padding: 6px 8px; font-size: 13px; }
}

/* ====== Mega-menu (All tools) ====== */
.nav-mega-menu {
  left: auto; right: 0;
  min-width: 1040px; padding: 10px;
}
.nav-mega-menu .mega-cols { display: flex; gap: 8px; }
.nav-mega-menu .mega-col { flex: 1; display: flex; flex-direction: column; }
.nav-mega-menu .mega-section {
  font-size: 11px; color: var(--text-soft);
  padding: 4px 12px 8px; text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 600;
}
.nav-mega-menu .mega-all {
  justify-content: flex-start; color: var(--accent);
  font-weight: 600; font-size: 13px; margin-top: 2px;
}
.nav-mega-menu .mega-all:hover { color: var(--accent); }
@media (max-width: 1080px) {
  .nav-mega-menu { min-width: 240px; max-height: 70vh; overflow-y: auto; }
  .nav-mega-menu .mega-cols { flex-direction: column; gap: 0; }
}

.iconbtn {
  height: 32px; width: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s;
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn svg { width: 16px; height: 16px; }

@media (max-width: 720px) {
  nav.top .links a { padding: 6px 8px; font-size: 13px; }
  nav.top .links { gap: 0; }
}

/* ====== Hero ====== */
.tool-hero { padding: 36px 22px 24px; }
.tool-hero h1 {
  margin: 0 0 8px;
  font-size: 30px; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.2;
  font-family: var(--serif);
}
.tool-hero p { margin: 0; color: var(--text-muted); max-width: 640px; font-size: 16px; }

.landing-hero { padding: 72px 0 32px; text-align: center; }
.landing-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 5px 12px; border-radius: 99px;
  margin-bottom: 22px;
}
.landing-hero h1 {
  margin: 0 0 16px;
  font-size: 52px; font-weight: 600;
  letter-spacing: -0.03em; line-height: 1.05;
  font-family: var(--serif);
}
.landing-hero h1 em { font-style: italic; color: var(--accent); }
.landing-hero p {
  margin: 0 auto;
  color: var(--text-muted);
  max-width: 580px; font-size: 18px;
  line-height: 1.55;
}
.landing-hero .meaning {
  margin: 20px auto 0;
  font-size: 13px;
  color: var(--text-soft);
  font-style: italic;
  max-width: 480px;
}
.landing-hero .cta-row { margin-top: 28px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  .landing-hero { padding: 48px 0 24px; }
  .landing-hero h1 { font-size: 36px; }
  .landing-hero p { font-size: 16px; }
}

/* ====== Cards ====== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.card-flat {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.card h2 {
  margin: 0 0 16px;
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } }

/* ====== Tool cards ====== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  padding: 16px 0 56px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  position: relative;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.tool-card .ic {
  width: 44px; height: 44px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.tool-card .ic svg { width: 22px; height: 22px; }
.tool-card h3 {
  margin: 0 0 6px;
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  font-family: var(--serif);
}
.tool-card p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; }
.tool-card .badge {
  position: absolute; top: 18px; right: 18px;
  font-size: 11px; font-weight: 500;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 3px 9px; border-radius: 99px;
}
.tool-card.new .badge { background: var(--success-soft); color: var(--success); }
.tool-card.live .badge { background: var(--accent-soft); color: var(--accent); }

/* ====== Forms ====== */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 6px;
}
.field label .hint { font-size: 12px; color: var(--text-soft); }
.field input[type="number"],
.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input[type="number"],
.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="date"],
.field select { height: 38px; }
.field textarea { padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .row3 { grid-template-columns: 1fr 1fr; } .row2 { grid-template-columns: 1fr; } }

.field input[type="range"] { width: 100%; accent-color: var(--accent); }

/* Shared input look for dynamically-built rows (expense splitter, NPV cash
   flows, invoice line items) whose inputs aren't wrapped in .field. Mirrors
   the .field input styling so every tool stays consistent. */
.tool-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-input[type="number"] { padding: 0 30px 0 12px; } /* room for +/- buttons */
.tool-input:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Number inputs — custom +/- spin buttons (replaces native browser spinners) */
.num-wrap { position: relative; display: block; }
.num-wrap input[type="number"] {
  -moz-appearance: textfield;
  padding-right: 30px;
}
.num-wrap input[type="number"]::-webkit-outer-spin-button,
.num-wrap input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.num-btn {
  position: absolute;
  right: 6px;
  width: 18px; height: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
  padding: 0; line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.num-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.num-btn:active { transform: translateY(1px); }
.num-plus { top: 4px; }
.num-minus { bottom: 4px; }

/* Compact variant for tight grid columns (cap table rows, invoice line items) */
.num-wrap--tight input[type="number"] { padding-right: 22px; }
.num-wrap--tight .num-btn { width: 14px; height: 11px; right: 4px; font-size: 10px; border-radius: 3px; }
.num-wrap--tight .num-plus { top: 3px; }
.num-wrap--tight .num-minus { bottom: 3px; }

.seg {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  background: transparent; border: 0;
  padding: 6px 12px;
  font-size: 13px; color: var(--text-muted);
  border-radius: 6px; cursor: pointer;
  font-family: inherit;
}
.seg button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ====== Buttons ====== */
.btn {
  background: var(--accent);
  color: white;
  border: 0;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  transition: opacity 0.15s, background 0.15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { opacity: 0.92; text-decoration: none; color: white; }
.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover { background: var(--surface-3); color: var(--text); }
.btn.copied { background: var(--success); }
.btn-large { padding: 12px 24px; font-size: 15px; }

/* ====== Stat cards ====== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.stat {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat .value { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.stat .sub { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* ====== Verdict banners ====== */
.verdict {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px;
}
.verdict.success { background: var(--success-soft); color: var(--success); }
.verdict.warning { background: var(--warning-soft); color: var(--warning); }
.verdict.danger { background: var(--danger-soft); color: var(--danger); }
.verdict.neutral { background: var(--surface-2); color: var(--text-muted); }
.verdict .icon { width: 22px; height: 22px; flex-shrink: 0; }
.verdict .text strong { font-weight: 600; display: block; }
.verdict .text span { font-size: 13px; opacity: 0.85; }

/* ====== Lead capture (above footer) ====== */
.lead-capture {
  margin: 56px auto 0;
  max-width: var(--maxw);
  padding: 0 24px;
}
.lead-capture .lc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.lead-capture .lc-card::before {
  content: "";
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.lead-capture .lc-text { min-width: 0; }
.lead-capture .lc-eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.lead-capture h3 {
  font-family: var(--serif);
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  line-height: 1.2;
  color: var(--text);
}
.lead-capture p {
  color: var(--text-muted);
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.lead-capture .lc-form {
  display: flex; gap: 8px;
  min-width: 300px;
}
.lead-capture .lc-form input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.lead-capture .lc-form input:focus {
  outline: 0;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.lead-capture .lc-form button {
  background: var(--accent);
  color: white;
  border: 0;
  padding: 0 18px;
  height: 40px;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.lead-capture .lc-form button:hover { opacity: 0.92; }
.lead-capture .lc-fine {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-soft);
}
.lead-capture .lc-thanks { display: none; }
.lead-capture .lc-card.sent .lc-form { display: none; }
.lead-capture .lc-card.sent .lc-thanks {
  display: flex; align-items: center; gap: 10px;
  color: var(--success);
  font-size: 14px; font-weight: 500;
}
@media (max-width: 720px) {
  .lead-capture .lc-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px;
  }
  .lead-capture .lc-form { min-width: 0; width: 100%; }
}

/* ====== Footer ====== */
footer.bottom {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  margin-top: 64px;
  background: var(--surface);
}
footer.bottom .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 28px;
}
footer.bottom .col h4 {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 10px;
}
footer.bottom .col a {
  display: block;
  font-size: 14px; color: var(--text-muted);
  padding: 3px 0;
}
footer.bottom .col a:hover { color: var(--text); text-decoration: none; }
footer.bottom .meta {
  flex: 1; min-width: 240px;
}
footer.bottom .meta .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
footer.bottom .meta .brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: white;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600;
}
footer.bottom .meta .brand .name { font-family: var(--serif); font-weight: 600; font-size: 16px; }
footer.bottom .meta p { font-size: 13px; color: var(--text-soft); margin: 0; max-width: 320px; }

/* ====== Misc ====== */
.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.section-title {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* ====== FAQ ====== */
.faq-section { padding: 36px 0 16px; }
.faq-section h2 {
  font-size: 26px; font-weight: 600;
  letter-spacing: -0.02em; font-family: var(--serif);
  margin: 0 0 24px; text-align: center;
}
.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--text-soft); transition: transform 0.15s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 14px 0 0; color: var(--text-muted); line-height: 1.7; }

/* ====== Invoice generator ====== */
.invoice-preview {
  background: white;
  color: #111;
  padding: 40px 36px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid var(--border);
}
[data-theme="dark"] .invoice-preview { background: #fff; color: #111; }
.invoice-preview h1 {
  margin: 0; font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.invoice-preview .meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin: 24px 0;
}
.invoice-preview .meta-block .label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #888; margin-bottom: 4px; font-weight: 600;
}
.invoice-preview table {
  width: 100%; border-collapse: collapse; margin: 18px 0;
}
.invoice-preview table th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: #666; padding: 8px 6px;
  border-bottom: 2px solid #111;
}
.invoice-preview table th:last-child, .invoice-preview table td:last-child { text-align: right; }
.invoice-preview table th:nth-child(2), .invoice-preview table td:nth-child(2),
.invoice-preview table th:nth-child(3), .invoice-preview table td:nth-child(3) { text-align: right; width: 80px; }
.invoice-preview table td {
  padding: 10px 6px; border-bottom: 1px solid #eee;
  font-variant-numeric: tabular-nums;
}
.invoice-preview .totals {
  margin-left: auto; width: 240px;
  font-size: 13px;
}
.invoice-preview .totals .row {
  display: flex; justify-content: space-between; padding: 4px 6px;
  font-variant-numeric: tabular-nums;
}
.invoice-preview .totals .grand {
  border-top: 2px solid #111; margin-top: 6px; padding-top: 8px;
  font-weight: 700; font-size: 16px;
}
.invoice-preview .footer-note {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid #eee;
  font-size: 12px; color: #555;
}

.line-row {
  display: grid; grid-template-columns: 1fr 80px 90px 28px; gap: 8px;
  margin-bottom: 8px; align-items: center;
}
.line-row input { height: 34px !important; }
.line-row .x {
  background: transparent; border: 0; color: var(--text-soft);
  cursor: pointer; font-size: 18px;
}
.line-row .x:hover { color: var(--danger); }

/* ====== Blog: listing ====== */
.blog-hero { padding: 56px 24px 8px; }
.blog-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.blog-hero h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em;
  font-size: 40px; line-height: 1.1; margin: 0 0 12px;
}
.blog-hero p { color: var(--text-muted); font-size: 17px; max-width: 620px; margin: 0; }

.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px; margin: 28px 0 8px;
}
.post-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 22px 18px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
a.post-card { color: inherit; text-decoration: none; }
a.post-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: var(--shadow-lg); text-decoration: none;
}
.post-card .post-tag {
  align-self: flex-start; font-size: 11px; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-tint);
  border: 1px solid var(--accent-soft); padding: 3px 9px; border-radius: 999px;
  margin-bottom: 12px;
}
.post-card h3 {
  font-family: var(--serif); font-weight: 600; font-size: 21px;
  line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.01em;
}
.post-card p { color: var(--text-muted); font-size: 14px; margin: 0 0 14px; flex: 1; }
.post-card .read {
  font-size: 13px; font-weight: 600; color: var(--accent);
  display: inline-flex; align-items: center; gap: 5px;
}

/* ====== Blog: article ====== */
.post {
  max-width: 720px; margin: 0 auto; padding: 0 24px 24px;
}
.post-head { padding: 48px 24px 8px; max-width: 720px; margin: 0 auto; }
.post-breadcrumb {
  font-size: 13px; color: var(--text-soft); margin-bottom: 18px;
}
.post-breadcrumb a { color: var(--text-muted); }
.post-tagline {
  display: inline-block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}
.post-head h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em;
  font-size: 38px; line-height: 1.12; margin: 0 0 14px;
}
.post-meta { font-size: 13px; color: var(--text-soft); }
.post-meta .dot { margin: 0 7px; opacity: 0.5; }

.post .lead {
  font-size: 19px; line-height: 1.6; color: var(--text-muted);
  margin: 24px 0 28px;
}
.post h2 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em;
  font-size: 26px; line-height: 1.2; margin: 38px 0 12px;
}
.post h3 {
  font-weight: 650; font-size: 18px; margin: 28px 0 8px;
}
.post p { font-size: 16px; line-height: 1.72; margin: 0 0 18px; }
.post ul, .post ol { font-size: 16px; line-height: 1.72; padding-left: 22px; margin: 0 0 18px; }
.post li { margin-bottom: 8px; }
.post strong { font-weight: 650; }
.post a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
/* Buttons inside articles keep their own styling, not the prose-link styling */
.post a.btn, .post a.btn:hover { color: #fff; text-decoration: none; }
.post a.btn.secondary { color: var(--text); }

.post .formula {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; font-size: 15px;
  margin: 0 0 20px; overflow-x: auto; line-height: 1.5;
}
.post blockquote {
  margin: 0 0 22px; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif); font-size: 19px; font-style: italic;
  color: var(--text);
}
.post .callout {
  background: var(--accent-tint); border: 1px solid var(--accent-soft);
  border-radius: var(--radius-lg); padding: 18px 20px; margin: 0 0 22px;
  font-size: 15px; line-height: 1.6;
}
.post .callout strong { color: var(--accent); }
.post table {
  width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 22px;
}
.post table th, .post table td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border);
}
.post table th { border-bottom: 2px solid var(--border-2); font-weight: 600; }

.post-cta {
  margin: 32px 0; padding: 24px 26px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); display: flex; gap: 18px;
  align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.post-cta .pc-text strong {
  font-family: var(--serif); font-size: 19px; font-weight: 600; display: block; margin-bottom: 4px;
}
.post-cta .pc-text span { color: var(--text-muted); font-size: 14px; }

.post-related {
  max-width: 720px; margin: 8px auto 0; padding: 28px 24px;
  border-top: 1px solid var(--border);
}
.post-related h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0 0 14px; }

@media (max-width: 640px) {
  .blog-hero h1 { font-size: 32px; }
  .post-head h1 { font-size: 30px; }
  .post h2 { font-size: 22px; }
}
