:root {
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #59636e;
  --line: #d1d9e0;
  --surface: #f6f8fa;
  --accent: #0b5cd5;
  --accent-fg: #ffffff;
  --error: #c62828;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --fg: #e6edf3;
    --muted: #9198a1;
    --line: #3d444d;
    --surface: #161b22;
    --accent: #4493f8;
    --accent-fg: #0d1117;
    --error: #ff7b72;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.7 system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  word-break: keep-all;
}
.site-header, main, .site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}
a { color: var(--accent); }
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-top: 12px;
  padding-bottom: 12px;
  position: relative;
}
.site-name { font-weight: 700; color: var(--fg); text-decoration: none; }
.menu summary { cursor: pointer; list-style: none; padding: 4px 8px; }
.menu nav {
  position: absolute;
  right: 16px;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 16px;
}
.menu ul { list-style: none; margin: 0; padding: 0; }
h1 { font-size: 1.5rem; line-height: 1.4; }
.summary { color: var(--muted); }
form.calc {
  display: grid;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
form.calc label { display: grid; gap: 4px; }
form.calc input, form.calc select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  width: 100%;
}
form.calc label.check { display: flex; align-items: center; gap: 8px; }
form.calc input[type="checkbox"] { width: auto; }
form.calc button {
  font: inherit;
  font-weight: 700;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
}
.amount-hint { color: var(--muted); font-size: 0.875rem; }
#provisional-notice { margin-top: 12px; padding: 8px 12px; border-left: 4px solid var(--accent); background: var(--surface); }
#result { margin-top: 16px; }
#result .error { color: var(--error); }
#result .result-main { font-size: 1.75rem; margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
td:last-child { text-align: right; }
.ad-slot { min-height: 280px; margin: 24px 0; }
.disclaimer { color: var(--muted); font-size: 0.875rem; }
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 16px; }
.calc-list { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.calc-list a {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
}
.calc-list a:hover, .calc-list a:focus-visible { border-color: var(--accent); }
.calc-list strong { color: var(--accent); }
.calc-list span { color: var(--muted); font-size: 0.875rem; }
.rates-year { margin-top: 32px; }
.rates-year table { margin-bottom: 8px; }
.rates-year td, .table-scroll th { white-space: nowrap; }
.notice { padding: 8px 12px; border-left: 4px solid var(--accent); background: var(--surface); }
.table-scroll { overflow-x: auto; }
