[hidden] { display: none !important; }
:root {
  --ink: #1c2430;
  --muted: #5b6676;
  --line: #d9dee6;
  --soft: #f4f6f9;
  --accent: #1f5c7a;
  --accent-ink: #ffffff;
  --warn: #8a5a00;
  --warn-bg: #fff6e0;
  --ok-bg: #eef6f1;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: #fff; line-height: 1.6; font-size: 17px; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #8ec5e0; outline-offset: 2px; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); letter-spacing: -0.01em; }
nav.site a { margin-left: 18px; text-decoration: none; color: var(--muted); font-size: 15px; }
nav.site a:hover { color: var(--ink); }
main { padding: 32px 0 56px; }
h1 { font-size: 34px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
h2 { font-size: 24px; line-height: 1.3; margin: 40px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 19px; margin: 28px 0 8px; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 24px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff; }
.calc fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.calc legend { font-weight: 700; font-size: 18px; margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 14px; margin-top: 4px; }
input, select { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #b9c2cf; border-radius: 8px; background: #fff; color: var(--ink); }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-row label { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.radio-row input { width: auto; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: auto; }
.member { display: grid; grid-template-columns: 1.6fr 1fr auto; gap: 10px; align-items: end; padding: 12px; background: var(--soft); border-radius: 8px; margin-bottom: 10px; }
@media (max-width: 620px) { .member { grid-template-columns: 1fr; } }
button { font: inherit; cursor: pointer; border-radius: 8px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; padding: 12px 20px; font-weight: 700; font-size: 17px; }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1px solid #b9c2cf; padding: 9px 14px; color: var(--ink); }
.btn-remove { background: transparent; border: 1px solid #c9cfd8; padding: 9px 12px; color: var(--muted); }
.errors { color: #9b1c1c; background: #fdeeee; border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
.errors:empty { display: none; }
#results:empty { display: none; }
#results { margin-top: 28px; }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.person { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.person .who { color: var(--muted); font-size: 14px; }
.person .amt { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0; }
.person ul { margin: 8px 0 0; padding-left: 18px; font-size: 15px; color: var(--muted); }
.total { margin: 16px 0; padding: 14px 18px; background: var(--ok-bg); border-radius: var(--radius); }
.note { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 14px; margin: 8px 0; font-size: 15px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
details { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
details summary { cursor: pointer; font-weight: 700; }
ol.math li { margin: 6px 0; }
.faq h3 { margin-top: 22px; }
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 22px 0 40px; }
footer.site p { margin: 6px 0; }
.small { font-size: 14px; color: var(--muted); }
