:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 8px 0;
}
.brand {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-links a {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--surface-2);
  color: var(--accent);
  text-decoration: none;
}
.page-main { padding: 24px 16px 56px; }
.hero-compact {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px 24px;
  margin-bottom: 22px;
}
.hero-compact h1 { margin: 8px 0 8px; font-size: 24px; line-height: 1.3; }
.hero-compact p { margin: 0; font-size: 14px; color: #cbd5e1; }
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: #dbeafe;
  color: #1e40af;
}
.pill-red { background: #fee2e2; color: #991b1b; }
.pill-blue { background: #dbeafe; color: #1e40af; }
.pill-green { background: #dcfce7; color: #166534; }
.pill-amber { background: #fef3c7; color: #92400e; }
.pill-slate { background: var(--surface-2); color: #334155; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
}
.section-title h2 { margin: 0; font-size: 18px; }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.12s, border-color 0.12s;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none;
}
.tool-card h2, .tool-card h3 { margin: 2px 0 0; font-size: 16.5px; }
.tool-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.tool-cta { margin-top: auto; font-size: 13px; font-weight: 700; color: var(--accent); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 16px;
}
.cat-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cat-tab.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.search-input {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  min-width: 190px;
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.post-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.12s;
}
.post-card:hover { border-color: var(--accent); text-decoration: none; }
.post-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.post-card h3 { margin: 0; font-size: 15.5px; line-height: 1.4; color: var(--text); }
.post-card p { margin: 0; font-size: 13px; color: var(--muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.tag {
  font-size: 11.5px;
  background: var(--surface-2);
  color: #475569;
  padding: 2px 7px;
  border-radius: 6px;
}

.article-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}
.article-meta {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 22px;
}
.article-meta h1 { margin: 10px 0 8px; font-size: 24px; line-height: 1.35; }
.article-sub { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.article-body { overflow-x: auto; }
.article-body table { max-width: 100%; }
.cta-strip {
  margin-top: 28px;
  padding: 18px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.cta-strip h3 { margin: 0 0 8px; font-size: 15.5px; }
.cta-links { display: flex; flex-wrap: wrap; gap: 8px; }
.cta-btn {
  display: inline-block;
  padding: 8px 13px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.cta-btn:hover { background: var(--accent-dark); text-decoration: none; }

/* Calculators */
.calc-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
.calc-head h1 { margin: 10px 0 6px; font-size: 23px; }
.calc-head p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.calc-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  background: var(--surface-2);
}
.calc-box h2 { margin: 0 0 14px; font-size: 16px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.field input, .select-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
}
.field small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chip-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.chip-btn:hover, .chip-btn.active-chip { border-color: var(--accent); color: var(--accent); background: #eff6ff; }
.calc-result { background: var(--surface); }
.kpi-main {
  padding: 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  margin-bottom: 14px;
}
.kpi-main span { display: block; font-size: 12.5px; opacity: 0.9; }
.kpi-main strong { display: block; font-size: 28px; margin-top: 4px; }
.res-list { margin: 0; }
.res-list div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.res-list dt { color: var(--muted); }
.res-list dd { margin: 0; font-weight: 700; }
.saving-banner {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #dcfce7;
  color: #166534;
  font-size: 13.5px;
}
.guide-box {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.guide-box h2 { margin: 0 0 12px; font-size: 18px; }
.guide-box h3 { margin: 16px 0 6px; font-size: 15px; }
.guide-box p { margin: 0 0 10px; font-size: 14px; color: #334155; }
.table-wrap { overflow-x: auto; margin-bottom: 16px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap th, .table-wrap td {
  padding: 9px 10px;
  border: 1px solid var(--border);
  text-align: right;
}
.table-wrap th:first-child, .table-wrap td:first-child { text-align: left; }
.table-wrap th { background: var(--surface-2); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 32px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.footer-links a { color: #475569; font-weight: 600; }
