:root {
  --ink: #1d2733;
  --muted: #5b6b7c;
  --accent: #0b6e4f;
  --accent-dark: #08543c;
  --bg: #f6f8f9;
  --card: #ffffff;
  --border: #dde4ea;
  --warn-bg: #fff7e6;
  --warn-border: #f0d9a6;
}

* { box-sizing: border-box; }

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

header.site {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
}

header.site .inner,
main,
footer.site .inner {
  max-width: 860px;
  margin: 0 auto;
}

header.site .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent-dark);
  text-decoration: none;
}

nav.tools a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-right: 1rem;
}

nav.tools a:hover { color: var(--accent); }

main { padding: 1.25rem 1rem 3rem; }

h1 { font-size: 1.7rem; line-height: 1.25; margin: 0.75rem 0 0.25rem; }
.subtitle { color: var(--muted); margin-top: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin: 1.25rem 0;
}

form.calc .field { margin-bottom: 0.9rem; }

form.calc label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

form.calc input,
form.calc select {
  width: 100%;
  max-width: 320px;
  padding: 0.55rem 0.7rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

form.calc .hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0.65rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button.primary:hover { background: var(--accent-dark); }

.result {
  display: none;
  border-left: 4px solid var(--accent);
  background: #eef7f2;
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin-top: 1.25rem;
}

.result.show { display: block; }

.result .big {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.result table { border-collapse: collapse; margin-top: 0.5rem; }
.result td { padding: 0.2rem 1rem 0.2rem 0; color: var(--muted); }
.result td:last-child { color: var(--ink); font-weight: 600; }

.disclaimer {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #6b5714;
  margin: 1.5rem 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.tool-grid a.tool {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem;
  text-decoration: none;
  color: var(--ink);
}

.tool-grid a.tool:hover { border-color: var(--accent); }
.tool-grid a.tool h3 { margin: 0 0 0.35rem; color: var(--accent-dark); }
.tool-grid a.tool p { margin: 0; font-size: 0.9rem; color: var(--muted); }

.sitemap-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.25rem 1rem;
  padding-left: 0;
  list-style: none;
  margin: 0.75rem 0 1.5rem;
}

.sitemap-list li { font-size: 0.92rem; }

.ad-slot {
  /* Reserve the dominant mobile fill size (300x250) so async ad injection
     doesn't shift content — 90px matches only desktop leaderboards. */
  min-height: 250px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 1.5rem 0;
}

article.guide h2 { font-size: 1.25rem; margin-top: 2rem; }
article.guide details { margin: 0.5rem 0; }
article.guide summary { font-weight: 600; cursor: pointer; }

footer.site {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 1.25rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

footer.site a { color: var(--muted); }

.trustbar {
  font-size: 0.8rem;
  color: var(--accent-dark);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0.25rem 0 0;
}

table.data {
  border-collapse: collapse;
  width: 100%;
  max-width: 640px;
  margin: 0.75rem 0 1rem;
  font-size: 0.9rem;
  background: var(--card);
}

table.data th, table.data td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: right;
}

table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { background: var(--bg); }

.amort details { margin: 0.4rem 0; }
.amort summary {
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.related {
  margin: 2rem 0 1rem;
}
.related h2 { font-size: 1.15rem; }
.related ul { padding-left: 1.2rem; }
.related li { margin: 0.3rem 0; font-size: 0.92rem; }
