:root {
  color-scheme: light dark;
  --bg: #fff;
  --fg: #222;
  --muted: #666;
  --line: #e2e2e2;
  --accent: #0b6bcb;
  --panel: #fafafa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --fg: #e6e6e6;
    --muted: #9aa0a6;
    --line: #2a2f36;
    --accent: #6fb3ff;
    --panel: #1b1e23;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.75;
}

a {
  color: var(--accent);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.site-header a {
  text-decoration: none;
  color: inherit;
}

.brand {
  font-family: "Times New Roman", Times, serif;
  font-size: 1.25rem;
}

.site-header nav a {
  margin-left: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

h1 {
  margin: 0 0 0.75rem;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.75rem;
  font-weight: normal;
  line-height: 1.35;
}

h2 {
  margin: 2rem 0 0.5rem;
  font-size: 1.1rem;
}

.lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.hero {
  text-align: center;
  padding: 1rem 0 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero img {
  display: block;
  width: 284px;
  height: auto;
  margin: 0 auto;
  border-radius: 4px;
}

.calc {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.calc .row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}

.calc label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

input,
select {
  min-width: 8rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}

output,
.result {
  display: block;
  margin-top: 1rem;
  font-size: 1.05rem;
}

.result strong {
  font-size: 1.35rem;
}

table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead th {
  color: var(--muted);
  font-weight: normal;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 90px;
  margin: 1.5rem 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}

.tool-list {
  padding-left: 1.25rem;
}

.tool-list li {
  margin: 0.4rem 0;
}

.tool-list small {
  color: var(--muted);
}

footer {
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

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