:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e2ddd3;
  --brand: #0b5f4b;
  --brand-dark: #084536;
  --accent: #c45c26;
  --ok: #0b5f4b;
  --warn-bg: #fff8e8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26, 26, 26, 0.06), 0 8px 24px rgba(26, 26, 26, 0.06);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  --max: 70rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #f0c674;
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner, .footer-inner, .wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}
.logo {
  font-weight: 750;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--brand); }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  font-size: 0.95rem;
}
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.nav a:hover { color: var(--brand); }

.hero {
  padding: 2.5rem 0 1.5rem;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
}
.hero p, .lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 42rem;
  margin: 0;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
a.card:hover {
  transform: translateY(-2px);
  border-color: #cfc7b8;
}
.card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.category-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand);
  margin-bottom: 0.35rem;
}

.layout-calc {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
  margin: 1.25rem 0 2rem;
}
@media (max-width: 860px) {
  .layout-calc { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 1rem; font-size: 1.15rem; }

.form-grid {
  display: grid;
  gap: 0.9rem;
}
.form-row {
  display: grid;
  gap: 0.35rem;
}
.form-row.two {
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 560px) {
  .form-row.two { grid-template-columns: 1fr; }
}
label {
  font-weight: 650;
  font-size: 0.92rem;
}
.hint {
  color: var(--muted);
  font-size: 0.82rem;
}
input[type="number"], input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid #cfc7b8;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
input[type="checkbox"], input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--brand);
}
.check-list {
  display: grid;
  gap: 0.45rem;
}
.check-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: var(--brand-dark); }
.btn-secondary {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.results {
  background: #f0f7f4;
  border: 1px solid #c5ddd3;
  border-radius: var(--radius);
  padding: 1.25rem;
}
.results h2 { margin-top: 0; }
.result-main {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--brand-dark);
  margin: 0.25rem 0 0.75rem;
}
.result-rows {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.result-rows li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dashed #c5ddd3;
  padding: 0.35rem 0;
  font-size: 0.95rem;
}
.result-rows li:last-child { border-bottom: 0; }
.result-rows .val { font-variant-numeric: tabular-nums; font-weight: 650; }

.content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem clamp(1rem, 3vw, 2rem);
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.content h2 { margin-top: 1.75rem; font-size: 1.25rem; }
.content h2:first-child { margin-top: 0; }
.content h3 { font-size: 1.05rem; }
.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1rem 0;
}
.content th, .content td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  text-align: left;
}
.content th { background: #f3f0ea; }
.content ul, .content ol { padding-left: 1.2rem; }
.meta-line {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.5rem 0 1rem;
}
.related {
  margin: 1.5rem 0 2.5rem;
}
.related ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
  padding: 0;
}
.disclaimer, .sources {
  font-size: 0.9rem;
  color: var(--muted);
}
.disclaimer {
  background: var(--warn-bg);
  border: 1px solid #efd9a8;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 1.25rem 0;
}

.ad-slot {
  border: 1px dashed #cfc7b8;
  border-radius: 8px;
  min-height: 90px;
  display: grid;
  place-items: center;
  color: #9a9285;
  font-size: 0.8rem;
  margin: 1rem 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(0,0,0,0.015) 8px,
    rgba(0,0,0,0.015) 16px
  );
}
/* ANALYTICS_PLACEHOLDER: insert analytics snippet in layout before </body> */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 2rem 0;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner {
  display: grid;
  gap: 1rem;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--brand); }

.breadcrumbs {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 1rem 0 0;
}
.breadcrumbs a { color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
