:root {
  --bg: #f6f4ee; --surface: #fff; --ink: #1b1a21; --muted: #5c5966; --line: #e2ded4;
  --accent: #2b3a8c; --accent-ink: #fff; --accent-soft: #e9ecfa;
  --net: #1f7a5a; --tax: #c2452d; --social: #d6952a;
  --radius: 14px; --shadow: 0 1px 2px rgb(20 20 40 / .05), 0 8px 24px rgb(20 20 40 / .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131318; --surface: #1c1c25; --ink: #eceaf3; --muted: #a29fb1; --line: #2d2d3a;
    --accent: #93a3ff; --accent-ink: #11121c; --accent-soft: #23263d;
    --net: #5fd0a5; --tax: #f08a72; --social: #efbf66; --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Hiragino Sans", "Noto Sans CJK SC", sans-serif;
}
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.5rem); margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; margin: 2.2rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 .3rem; }
small { color: var(--muted); font-weight: 400; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.site-header, main, .site-footer { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.site-header { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 16px; }
.main-nav { display: flex; gap: 4px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; order: 3; width: 100%; }
.main-nav a { white-space: nowrap; padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .93rem; }
.main-nav a:hover, .main-nav a[aria-current] { background: var(--accent-soft); color: var(--accent); }
.lang-menu { position: relative; margin-left: auto; font-size: .93rem; }
.lang-menu summary { cursor: pointer; list-style: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: " ▾"; color: var(--muted); }
.lang-menu div { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; min-width: 170px; z-index: 5; }
.lang-menu div a { padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.lang-menu div a:hover, .lang-menu div a[aria-current] { background: var(--accent-soft); color: var(--accent); }
@media (min-width: 760px) { .main-nav { order: 0; width: auto; } }

.lang-hint { background: var(--accent); color: var(--accent-ink); display: flex; justify-content: center; align-items: center; gap: 14px; padding: 8px 16px; }
.lang-hint a { color: inherit; font-weight: 600; }
.lang-hint button { background: none; border: 0; color: inherit; font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 4px 8px; }

.hero { padding: 26px 0 18px; max-width: 760px; }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0; }
.crumbs { font-size: .88rem; color: var(--muted); padding-top: 14px; }
.crumbs a { color: var(--muted); }
.muted { color: var(--muted); font-size: .93rem; }

.calculator { display: grid; gap: 16px; align-items: start; }
@media (min-width: 860px) { .calculator { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.field { margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 6px; padding: 0; }
input[type="text"], input[type="number"], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; min-height: 46px;
}
input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.money { position: relative; }
.money span { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--muted); }
.money input { padding-left: 28px; font-size: 1.15rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.help { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.segs { display: flex; flex-wrap: wrap; gap: 8px; }
.segs legend { width: 100%; }
.seg { flex: 1 1 120px; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--bg); }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.more { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.more summary { cursor: pointer; font-weight: 600; color: var(--accent); margin-bottom: 12px; }
.field.inline { display: grid; grid-template-columns: 1fr 84px; gap: 12px; align-items: center; }
.field.inline label { margin: 0; font-weight: 400; }

.big-label { margin: 0; color: var(--muted); font-size: .93rem; font-weight: 600; }
.big { margin: 0 0 10px; font-size: clamp(2.1rem, 8vw, 3rem); font-weight: 750; letter-spacing: -.02em; color: var(--net); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0 0 14px; }
.kv div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.kv dt { font-size: .8rem; color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.alert { background: color-mix(in srgb, var(--tax) 12%, transparent); border-left: 3px solid var(--tax); padding: 10px 12px; border-radius: 8px; margin: 0 0 12px; font-size: .93rem; }
.bars { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line); margin: 4px 0 8px; }
.bars span { transition: width .25s ease; }
.bar-net { background: var(--net); } .bar-tax { background: var(--tax); } .bar-social { background: var(--social); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin: 0 0 12px; font-size: .82rem; color: var(--muted); }
.legend li::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.l-net::before { background: var(--net); } .l-tax::before { background: var(--tax); } .l-social::before { background: var(--social); }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; font-size: .93rem; }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: .8rem; color: var(--muted); font-weight: 600; }
tbody th { font-weight: 400; }
td { white-space: nowrap; }
tr.strong th, tr.strong td { font-weight: 700; }
tr.sum th, tr.sum td { color: var(--tax); font-weight: 600; }
tr.net td, tr.net th { color: var(--net); border-bottom: 0; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px; margin: 12px 0; }
.grid th, .grid td { padding: 10px 6px; white-space: nowrap; }
.grid tbody tr:last-child th, .grid tbody tr:last-child td { border-bottom: 0; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin: 26px 0 6px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0; } .card p { margin: 0; color: var(--muted); flex: 1; } .card span { color: var(--accent); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: .9rem; font-variant-numeric: tabular-nums; }
.chips a:hover { border-color: var(--accent); }
.why { display: grid; gap: 4px 24px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.prose { max-width: 720px; }
.prose.wide { max-width: none; }
.prose p { margin: .5rem 0 1rem; }
.notes { max-width: 720px; color: var(--muted); font-size: .9rem; padding-left: 1.1rem; margin: 16px 0 0; }
.notes li { margin-bottom: 6px; }

.partner { display: grid; gap: 10px; align-items: center; background: var(--accent-soft); border-radius: var(--radius); padding: 18px; margin: 20px 0; }
@media (min-width: 700px) { .partner { grid-template-columns: 1fr auto; } .partner small { grid-column: 1 / -1; } }
.partner h2 { margin: 0 0 4px; font-size: 1.1rem; } .partner p { margin: 0; }
.button { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 11px 18px; border-radius: 10px; text-decoration: none; font-weight: 600; text-align: center; }

.site-footer { margin-top: 48px; padding-top: 20px; padding-bottom: 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.site-footer a { color: var(--muted); }
.badge { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 3px 12px; font-weight: 600; margin: 0; }
@media (prefers-reduced-motion: reduce) { .bars span { transition: none; } }
