:root {
  --bg: #f6f5f1; --card: #ffffff; --fg: #1a1a18; --muted: #6b6a64; --line: #e4e2da;
  --accent: #1e40af; --accent-soft: #e8eefc; --good: #15803d; --cost: #9a3412;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141413; --card: #1d1d1b; --fg: #ecebe6; --muted: #9c9b94; --line: #2e2e2b;
          --accent: #8fb0ff; --accent-soft: #1f2a44; --good: #4ade80; --cost: #fdba74; --shadow: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; }
.langs { display: flex; gap: 4px; flex-wrap: wrap; }
.langs a { padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 14px; }
.langs a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; margin: 28px 0 8px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
.intro { color: var(--muted); margin: 0 0 24px; max-width: 70ch; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.layout { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.inputs { position: sticky; top: 16px; display: grid; gap: 18px; }
@media (max-width: 820px) { .layout { grid-template-columns: minmax(0, 1fr); } .inputs { position: static; } }

fieldset.mode { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
fieldset.mode legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
fieldset.mode label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
fieldset.mode label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
fieldset.mode input { accent-color: var(--accent); margin: 0; }

.field { display: grid; gap: 6px; }
.field > span:first-child { font-weight: 600; }
.field small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.money { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; }
.money:focus-within, select:focus, input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.money input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: 20px; font-weight: 600; padding: 10px 12px; outline: none; font-variant-numeric: tabular-nums; }
.money.short input { font-size: 16px; font-weight: 500; }
.unit { color: var(--muted); padding-right: 12px; font-size: 14px; }
select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); }
.slider { display: flex; align-items: center; gap: 12px; }
.slider input { flex: 1; accent-color: var(--accent); }
.slider output { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.headline { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .headline { background: var(--accent-soft); color: var(--fg); border-color: var(--line); } }
.headline-label { font-size: 14px; opacity: .85; }
.headline-value { font-size: clamp(34px, 6vw, 48px); font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; margin: 4px 0; }
.headline-value .unit { color: inherit; opacity: .7; font-size: 18px; font-weight: 600; }
.headline-sub { font-size: 14px; opacity: .85; }

table.rows { width: 100%; border-collapse: collapse; }
table.rows td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.rows td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
table.rows tr.sub td { color: var(--muted); font-size: 14px; padding: 4px 0 4px 14px; }
table.rows tr.sub td.n { padding-left: 12px; }
table.rows tr.minus td.n::before { content: "− "; }
table.rows tr.total td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--fg); padding-top: 10px; }
#employee tr.total td.n { color: var(--good); }
#employer tr.total td.n { color: var(--cost); }
.note { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.note:empty { display: none; }

.glossary { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 24px; }
.glossary dt { font-weight: 700; }
.glossary dd { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.notes { margin: 0; padding-left: 20px; color: var(--muted); }
.notes li + li { margin-top: 6px; }

.cta { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-color: var(--accent); }
.cta h2 { margin-bottom: 4px; }
.cta p { margin: 0; color: var(--muted); max-width: 60ch; }
.button { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; padding: 11px 20px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .button { color: #0b1020; } }

.foot { color: var(--muted); font-size: 13px; padding-top: 8px; padding-bottom: 32px; }
