:root {
  --bg: #ffffff;
  --surface: #f5f6f4;
  --text: #1d2321;
  --muted: #5b6662;
  --line: #d9ddda;
  --accent: #0f6b5c;
  --accent-soft: #e3f1ee;
  --warn: #8a5a00;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816;
    --surface: #1d2321;
    --text: #e8ece9;
    --muted: #a3aea9;
    --line: #333b38;
    --accent: #4fc2ad;
    --accent-soft: #1c302c;
    --warn: #e0b45a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
nav.main a { margin-left: 16px; text-decoration: none; font-weight: 600; }
nav.main a:first-child { margin-left: 0; }
nav.main a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); }
main { padding: 8px 0 40px; }
h1 { font-size: 1.9rem; line-height: 1.25; margin: 20px 0 8px; }
h2 { font-size: 1.4rem; margin: 40px 0 12px; }
h3 { font-size: 1.1rem; margin: 24px 0 8px; }
.lead { color: var(--muted); margin: 0 0 16px; max-width: 760px; }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tool form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.tool label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.tool select, .tool input[type="text"] {
  width: 100%; font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.tool .check { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: .9rem; }
.tool .hint { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.result { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.stat .k { color: var(--muted); font-size: .85rem; }
.stat .v { font-size: 1.35rem; font-weight: 700; }
.stat.total { border-color: var(--accent); background: var(--accent-soft); }
.note { color: var(--muted); font-size: .9rem; }
.warn { color: var(--warn); }
.result-note { margin: 12px 0 0; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 10px 12px; font-weight: 700; }
th, td { padding: 6px 10px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
thead th { background: var(--surface); font-weight: 600; }
th[scope="row"] { text-align: left; position: sticky; left: 0; background: var(--bg); }
thead th:first-child { text-align: left; position: sticky; left: 0; z-index: 1; }
td.empty { color: var(--muted); }
td.hl, th.hl { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.text-left td, .text-left th { text-align: left; white-space: normal; }
.src { font-size: .85rem; color: var(--muted); margin: 4px 0 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.tabs button {
  font: inherit; font-size: .9rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.js .pay-table[hidden] { display: none; }
.faq dt { font-weight: 700; margin-top: 16px; }
.faq dd { margin: 4px 0 0; }
.cta { display: inline-block; margin-top: 8px; font-weight: 600; }
footer.site { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: .85rem; }
footer.site p { margin: 6px 0; }
@media print {
  header.site nav, .tool, .tabs, footer.site .nav { display: none !important; }
  .pay-table[hidden] { display: block !important; }
  .tbl { overflow: visible; border: 0; }
  body { font-size: 11px; }
}
