:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #ccfbf1;
  --accent: #f59e0b;
  --text: #0f172a;
  --text-light: #475569;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --border: #e2e8f0;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.03);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* Header */
header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 960px;
  margin: 0 auto;
}
.logo {
  font-weight: 800;
  font-size: 18px;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--primary); }
@media (max-width: 600px) {
  .nav-links { display: none; }
}

/* Hero */
.hero {
  padding: 56px 20px 32px;
  text-align: center;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%);
}
.hero h1 {
  font-size: 36px;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.hero p {
  font-size: 18px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 8px;
}
.hero .meta {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 16px;
}
@media (max-width: 600px) {
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .hero { padding: 36px 20px 24px; }
}

/* Calculator card */
.calc-wrap {
  margin: 32px auto;
  max-width: 720px;
  padding: 0 20px;
}
.calc {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.calc h2 {
  font-size: 20px;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.field .hint {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
}
.toggle input { width: auto; }

/* Results */
.results {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}
.results h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text);
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) { .result-grid { grid-template-columns: 1fr; } }
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.result-row:last-child { border-bottom: none; }
.result-row .label { color: var(--text-light); }
.result-row .value { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.result-total {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
}
.result-total .label { opacity: 0.9; }
.result-total .value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.quarterly-list {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 480px) { .quarterly-list { grid-template-columns: 1fr; } }
.quarterly-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.quarterly-item .q { font-size: 12px; color: var(--text-light); font-weight: 600; }
.quarterly-item .due { font-size: 13px; color: var(--text); margin-top: 2px; }
.quarterly-item .amt { font-size: 18px; font-weight: 700; color: var(--primary); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Sections */
section { padding: 40px 0; }
section h2 {
  font-size: 24px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
section h3 {
  font-size: 18px;
  margin: 22px 0 10px;
}
section p { margin-bottom: 14px; color: var(--text); }
section ul { margin: 12px 0 14px 22px; }
section li { margin-bottom: 6px; }
section a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* Cards (affiliates / state list) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--bg);
  transition: border-color 0.15s, transform 0.15s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.card .card-title { font-weight: 700; margin-bottom: 4px; font-size: 15px; }
.card .card-desc { color: var(--text-light); font-size: 13px; }

/* Affiliate panel */
.affiliate-panel {
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 28px 0;
}
.affiliate-panel h3 { font-size: 17px; margin-bottom: 8px; }
.affiliate-panel p { font-size: 14px; color: var(--text-light); margin-bottom: 14px; }

/* AdSense placeholder */
.ad-slot {
  margin: 28px auto;
  max-width: 720px;
  min-height: 90px;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* FAQ */
.faq details {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.faq summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--text-light);
  transition: transform 0.15s;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 10px; color: var(--text-light); font-size: 14px; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 36px 20px;
  margin-top: 60px;
  font-size: 13px;
  color: var(--text-light);
}
footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
footer a { color: var(--text-light); text-decoration: underline; }
footer .disclaimer { font-size: 12px; margin-top: 12px; max-width: 700px; }

/* State badge */
.state-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  list-style: none;
  margin: 10px 0;
}
.state-list a {
  display: block;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}
.state-list a:hover { border-color: var(--primary); color: var(--primary); }

/* Article body */
article { padding: 30px 0; }
article h1 { font-size: 32px; line-height: 1.2; margin-bottom: 10px; letter-spacing: -0.02em; }
article .meta-line { font-size: 13px; color: var(--text-light); margin-bottom: 24px; }
article p, article li { font-size: 17px; line-height: 1.7; }
article h2 { margin-top: 28px; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { background: var(--bg-soft); font-weight: 600; }
