/* Global styles for the tool site */
:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #1f2a37;
  --muted: #667085;
  --line: #e4e9f2;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --ok: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand { font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -0.3px; }
.brand span { color: var(--accent); }
.site-nav a { margin-left: 20px; color: var(--muted); font-size: 14px; font-weight: 500; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }

/* Hero */
.hero { padding: 48px 0 32px; text-align: center; }
.hero h1 { font-size: 34px; line-height: 1.25; margin: 0 0 12px; letter-spacing: -0.5px; }
.hero p { font-size: 17px; color: var(--muted); max-width: 640px; margin: 0 auto; }

/* Cards grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px 0 48px;
}
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-2px); border-color: #c9d3e5; text-decoration: none; }
.card .icon { font-size: 26px; margin-bottom: 10px; }
.card h2 { font-size: 17px; margin: 0 0 6px; }
.card p { margin: 0; font-size: 14px; color: var(--muted); }

/* Page content */
main.page { padding: 40px 0 64px; }
.page h1 { font-size: 30px; letter-spacing: -0.4px; margin: 0 0 8px; }
.lede { color: var(--muted); font-size: 16px; margin: 0 0 28px; }

/* Calculator card */
.calc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 28px;
}
.calc .fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid #bfd6ff; border-color: var(--accent); }

.btn {
  display: inline-block;
  margin-top: 18px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }

.result {
  display: none;
  margin-top: 20px;
  background: #eff6ff;
  border: 1px solid #d7e5ff;
  border-radius: 10px;
  padding: 16px 18px;
}
.result.show { display: block; }
.result .big { font-size: 26px; font-weight: 800; color: var(--accent-dark); letter-spacing: -0.3px; }
.result .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #d7e5ff; font-size: 14px; }
.result .row:last-child { border-bottom: 0; }
.result .hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* Article text */
.prose { font-size: 15px; color: #344054; max-width: 760px; }
.prose h2 { font-size: 21px; margin: 36px 0 10px; }
.prose h3 { font-size: 17px; margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }

/* FAQ */
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* Related */
.related { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.related h2 { font-size: 18px; margin: 0 0 12px; }
.related a { display: inline-block; margin-right: 18px; font-size: 14px; }

/* Ad slot placeholder */
.ad-slot {
  border: 2px dashed #d0d9e8;
  border-radius: 10px;
  padding: 18px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer .links a { margin-right: 18px; color: var(--muted); }
.site-footer .meta { margin-top: 8px; }

@media (max-width: 720px) {
  .hero { padding: 32px 0 20px; }
  .hero h1 { font-size: 26px; }
  .grid, .calc .fields { grid-template-columns: 1fr; }
  .site-nav a { margin-left: 14px; }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}
