:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #f0fdfa;
  --accent: #b45309;
  --accent-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-badge {
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}
nav.main { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.94rem; font-weight: 500; }
nav.main a { color: var(--muted); }
nav.main a:hover, nav.main a.active { color: var(--brand); text-decoration: none; }

/* Disclaimer Banner */
.disclaimer-bar {
  background: var(--accent-soft);
  border-bottom: 1px solid #fde68a;
  color: #78350f;
  font-size: 0.84rem;
  padding: 8px 0;
}

/* Hero & Cards */
.hero { padding: 34px 0 20px; }
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #99f6e4;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
h1 { font-size: clamp(1.65rem, 3vw, 2.35rem); line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.02em; }
.lead { color: var(--muted); font-size: 1.04rem; margin: 0 0 18px; max-width: 760px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 22px;
}
.card h2 { margin-top: 0; font-size: 1.25rem; }

/* Calculator Layout */
.calc-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 820px) { .calc-grid { grid-template-columns: 1fr; } }

.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

label { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.96rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.25);
  border-color: var(--brand);
}
.hint { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

/* Result Panel */
.result-panel {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.status-overdue { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }
.status-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bbf7d0; }
.status-pending { background: var(--accent-soft); color: var(--accent); border: 1px solid #fde68a; }

.big-total {
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  margin: 4px 0 6px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.kpi-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-val { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin-top: 2px; }
.breakdown-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}
.breakdown-list li {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
  gap: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }
.btn-block { width: 100%; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { background: #f1f5f9; font-weight: 700; color: var(--ink); white-space: nowrap; }
tr:hover td { background: #f8fafc; }
.tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.tag-yes { background: var(--ok-soft); color: var(--ok); }
.tag-no { background: #f1f5f9; color: var(--muted); }

/* Letter Preview + Paywall */
.letter-box {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.96rem;
  line-height: 1.7;
  white-space: pre-wrap;
  position: relative;
}
.letter-blur {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  margin-top: 12px;
}
.paywall-box {
  background: linear-gradient(135deg, #f0fdfa 0%, #fff 100%);
  border: 2px solid var(--brand);
  border-radius: 10px;
  padding: 20px;
  margin-top: 16px;
}
.price-row { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 12px; }
.price-now { font-size: 1.7rem; font-weight: 800; color: var(--brand-dark); }
.price-note { font-size: 0.85rem; color: var(--muted); }

/* Breadcrumb & Footer */
.crumb { font-size: 0.84rem; color: var(--muted); margin-bottom: 8px; }
footer.site {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 28px 0;
  font-size: 0.86rem;
  color: var(--muted);
}
.footer-grid { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }

@media print {
  header.site, .disclaimer-bar, .no-print, footer.site { display: none !important; }
  body { background: #fff; }
  .letter-box { border: none; padding: 0; }
  .letter-blur { filter: none !important; }
}
