:root {
  --primary: #1a365d;
  --primary-light: #2c5282;
  --accent: #2b6cb0;
  --text: #1a202c;
  --text-light: #4a5568;
  --bg: #ffffff;
  --bg-alt: #f7fafc;
  --border: #e2e8f0;
  --success: #276749;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: var(--bg);
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

header {
  background: var(--primary);
  color: white;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header .container { display: flex; justify-content: space-between; align-items: center; }

.logo { color: white; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px; }
.logo span { color: #90cdf4; }

nav a {
  color: white;
  text-decoration: none;
  margin-left: 28px;
  font-weight: 500;
  font-size: 0.95rem;
}
nav a:hover { color: #90cdf4; }

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 80px 0;
  text-align: center;
}

.hero h1 { font-size: 2.8rem; margin-bottom: 16px; font-weight: 700; }
.hero p { font-size: 1.25rem; max-width: 700px; margin: 0 auto 32px; opacity: 0.95; }

.btn {
  display: inline-block;
  background: white;
  color: var(--primary);
  padding: 14px 32px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.section { padding: 70px 0; }
.section h2 { font-size: 2rem; margin-bottom: 12px; color: var(--primary); }
.section .subtitle { color: var(--text-light); margin-bottom: 40px; font-size: 1.1rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-3px); }

.card-body { padding: 24px; }
.card h3 { font-size: 1.2rem; margin-bottom: 10px; color: var(--primary); }
.card p { color: var(--text-light); font-size: 0.95rem; margin-bottom: 16px; }
.card a { color: var(--accent); font-weight: 600; text-decoration: none; }
.card a:hover { text-decoration: underline; }

.post-meta { font-size: 0.85rem; color: #4a5568; margin-bottom: 8px; }

footer {
  background: var(--primary);
  color: white;
  padding: 40px 0 20px;
  margin-top: 60px;
}
footer .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; }
footer .footer-heading { font-weight: 700; color: inherit; margin-bottom: 12px; font-size: 1.05rem; }
footer a { color: #cbd5e0; text-decoration: none; display: block; margin-bottom: 8px; font-size: 0.9rem; }
footer a:hover { color: white; }
.copyright { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 30px; font-size: 0.85rem; opacity: 0.8; }

.article { max-width: 760px; margin: 40px auto; }
.article h1 { font-size: 2.2rem; margin-bottom: 12px; color: var(--primary); line-height: 1.3; }
.article .meta { color: #4a5568; margin-bottom: 28px; font-size: 0.95rem; }
.article h2 { font-size: 1.5rem; margin: 32px 0 12px; color: var(--primary); }
.article h3 { font-size: 1.2rem; margin: 24px 0 10px; }
.article p { margin-bottom: 16px; }
.article ul, .article ol { margin: 16px 0 16px 24px; }
.article li { margin-bottom: 8px; }
.article blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--bg-alt);
  font-style: italic;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  nav a { margin-left: 16px; font-size: 0.85rem; }
  .section { padding: 50px 0; }
}
.article .meta a { color: inherit; }
.author-box { margin: 40px 0 24px; padding: 20px 24px; background: var(--bg-alt); border-radius: 8px; border-left: 4px solid var(--accent); }
.author-box h3 { margin: 0 0 8px; font-size: 1.05rem; }
.author-box p { margin: 0; }
.related h2 { font-size: 1.3rem; }
.related ul { margin-left: 20px; }

/* images */
.hero-img { margin: 0 0 28px; }
.hero-img img, .card-img { display: block; width: 100%; height: auto; border-radius: 8px; }
.hero-photo { margin-top: 40px; max-width: 900px; }
.card-img { border-radius: 8px 8px 0 0; aspect-ratio: 3 / 2; object-fit: cover; }
.credit { font-size: 0.8rem; color: #4a5568; margin-top: 6px; }
.credit a { color: inherit; }
.card h3 a { color: inherit; text-decoration: none; }

header nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 0; }
@media (max-width: 760px) { header .container { flex-direction: column; gap: 8px; } nav a { margin: 0 10px; } }

/* tools */
.tool-form { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; padding: 24px; margin: 24px 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tool-form .field { display: flex; flex-direction: column; gap: 6px; }
.tool-form label { font-weight: 600; font-size: 0.95rem; }
.tool-form input, .tool-form select { font: inherit; padding: 10px 12px; border: 1px solid #a0aec0; border-radius: 6px; background: #fff; width: 100%; }
.tool-form input:focus, .tool-form select:focus, .btn-primary:focus { outline: 3px solid #90cdf4; outline-offset: 1px; }
.tool-form .inline { display: flex; gap: 8px; }
.tool-form small { color: var(--text-light); font-size: 0.85rem; }
.btn-primary { grid-column: 1 / -1; justify-self: start; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 12px 28px; font: inherit; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--primary-light); }
.tool-result { margin: 0 0 32px; }
.tool-summary { font-size: 1.15rem; font-weight: 600; color: var(--success); }
.tool-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.tool-table caption { text-align: left; font-weight: 600; margin-bottom: 8px; color: var(--text-light); }
.tool-table th, .tool-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.tool-table td { text-align: right; font-variant-numeric: tabular-nums; }
.tool-table thead th:not(:first-child) { text-align: right; }
.tool-table tr.total th, .tool-table tr.total td { font-weight: 700; border-top: 2px solid var(--primary); }
.tool-note, .tool-disclaimer { background: var(--bg-alt); border-left: 4px solid var(--accent); padding: 12px 16px; font-size: 0.95rem; }
[hidden] { display: none !important; }
/* tools v2 */
.tool-grid{display:grid;gap:1.5rem;margin:1.5rem 0}
@media(min-width:900px){.tool-grid{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr)}.tool-results{position:sticky;top:1rem;align-self:start}}
.tool-results{border:1px solid #e2e8f0;border-radius:10px;padding:1rem 1.25rem;background:#fff}
.tool-form fieldset{border:1px solid #e2e8f0;border-radius:8px;padding:.75rem 1rem;margin:0 0 1rem}
.tool-form legend{font-weight:600;padding:0 .25rem}
.tool-form label{display:block;margin:.6rem 0 .2rem;font-weight:500}
.tool-form input[type=number],.tool-form select{width:100%;padding:.5rem;border:1px solid #cbd5e1;border-radius:6px;font:inherit}
.tool-form .toggle label{display:inline-flex;gap:.35rem;margin-right:1rem;font-weight:400}
.btn-secondary{background:#fff;border:1px solid #1e40af;color:#1e40af;padding:.45rem .9rem;border-radius:6px;cursor:pointer;font:inherit}
.small{font-size:.875rem;color:#475569}
.rates{margin:.5rem 0 1rem}
.tool-summary output{font-size:1.6rem;font-weight:700;color:#1e40af}
.accordion{border:1px solid #e2e8f0;border-radius:8px;padding:.5rem .9rem;margin:.75rem 0}
.accordion summary{cursor:pointer;font-weight:600}
.donut{display:flex;gap:1rem;align-items:center;flex-wrap:wrap;margin:1rem 0}
.donut ul{list-style:none;padding:0;margin:0;font-size:.875rem}
.donut li{display:flex;align-items:center;gap:.4rem}
.hbars ul{list-style:none;padding:0;margin:.5rem 0}
.hbars li{display:grid;grid-template-columns:6rem 1fr 6rem;gap:.5rem;align-items:center;margin:.25rem 0}
.hbars .bar{display:block;height:.9rem;background:#3b82f6;border-radius:3px}
.hbars .val{text-align:right;font-variant-numeric:tabular-nums}
.tool-table td{font-variant-numeric:tabular-nums}
.tool-table tr.total{font-weight:700}
.breadcrumbs{font-size:.875rem;margin-bottom:.5rem}
.state-list{columns:3 10rem;padding-left:1.1rem}
.tool-cards li{margin:.5rem 0}
.donut .sw{display:inline-block;width:.8rem;height:.8rem;border-radius:2px}
