:root {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-2: #e9eeea;
  --text: #14201b;
  --muted: #56625c;
  --border: #d9e1dc;
  --accent: #0b6e55;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ea;
  --accent-text: #0a5c47;
  --focus: #c98a1b;
  --shadow: 0 1px 2px rgb(20 32 27 / 6%), 0 10px 30px rgb(20 32 27 / 7%);
  --radius: 20px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b110f; --surface: #131b18; --surface-2: #1b2522; --text: #e7eeea; --muted: #9aa8a1; --border: #26332e;
    --accent: #45c79c; --accent-ink: #06140f; --accent-soft: #123128; --accent-text: #6fdcb5; --focus: #e8b04b;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 30px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b110f; --surface: #131b18; --surface-2: #1b2522; --text: #e7eeea; --muted: #9aa8a1; --border: #26332e;
  --accent: #45c79c; --accent-ink: #06140f; --accent-soft: #123128; --accent-text: #6fdcb5; --focus: #e8b04b;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 30px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* Header */
.site-header { padding: 18px 0 8px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1.05rem; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 0.95rem; }
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
/* Mobile menu */
.site-header { position: relative; z-index: 10; }
.menu { display: none; }
.menu-button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; list-style: none; user-select: none;
}
.menu-button::-webkit-details-marker { display: none; }
.menu-button svg { width: 18px; height: 18px; flex: none; }
.menu .icon-close, .menu[open] .icon-open { display: none; }
.menu[open] .icon-close { display: block; }
.menu[open] .menu-button { background: var(--surface-2); }
.menu-panel {
  position: absolute; top: calc(100% + 4px); left: 16px; right: 16px; max-height: calc(100vh - 90px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 12px 14px;
}
.menu-title { margin: 12px 8px 4px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a { display: block; padding: 11px 10px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: 1rem; }
.menu-panel a:hover { background: var(--surface-2); }
.menu-panel a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.site-header .wrap { position: static; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.88rem;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 17px; height: 17px; flex: none; }

/* Intro */
.intro { padding: clamp(18px, 4vw, 40px) 0 clamp(16px, 3vw, 26px); }
.intro h1 { margin: 0; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; }
.intro p { margin: 12px 0 0; color: var(--muted); font-size: 1.08rem; max-width: 62ch; }
.intro p strong { color: var(--text); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
main > section + section { margin-top: 24px; }

/* Simulator */
.sim { overflow: hidden; }
.sim-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.sim-inputs { padding: clamp(16px, 3vw, 26px); display: grid; gap: 18px; align-content: start; }
.sim-hint { margin: 0; color: var(--muted); font-size: 0.92rem; }

.amounts { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.amounts-head { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding-left: 4px; }
.amounts-label { font-size: 0.92rem; color: var(--muted); padding-right: 4px; }
.money { position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.money:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.money input { width: 100%; min-width: 0; border: 0; background: transparent; outline: none; padding: 10px 4px 10px 12px; font-size: 1.05rem; font-variant-numeric: tabular-nums; text-align: right; }
.money > span { padding-right: 12px; color: var(--muted); }
.money-main { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.money-main input { font-size: 1.35rem; font-weight: 700; padding-block: 12px; }

.field { display: grid; gap: 6px; align-content: start; }
.field-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.field-label small { font-weight: 400; }
.field small, .field-help { color: var(--muted); font-size: 0.82rem; margin: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.input-unit { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px 0 0; }
.input-unit:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-unit input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; padding: 9px 4px 9px 12px; font-variant-numeric: tabular-nums; }
.input-unit span { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
select:focus-visible { border-color: var(--accent); }

.segmented { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border-radius: 14px; padding: 3px; gap: 2px; justify-self: start; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 7px 13px; border-radius: 11px; font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 12%); font-weight: 600; }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); }
.tax-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tax-row .input-unit { width: 120px; }

.advanced { border: 1px solid var(--border); border-radius: 14px; }
.advanced summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 0.92rem; }
.advanced-body { display: grid; gap: 14px; padding: 4px 14px 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--accent); }

.sim-result { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); border-left: 1px solid var(--border); padding: clamp(16px, 3vw, 26px); display: grid; gap: 10px; align-content: start; }
.result-block { display: grid; gap: 2px; padding: 10px 0; }
.result-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.result-value { font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.result-main { background: var(--accent); color: var(--accent-ink); border-radius: 14px; padding: 14px 16px; }
.result-main .result-label { color: inherit; opacity: 0.85; }
.result-line { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; color: var(--muted); border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.result-line > span:last-child { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-note { margin: 0; font-size: 0.88rem; color: var(--muted); }
.result-note:empty { display: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: 0.92rem; font-weight: 500; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn-ghost { justify-self: start; margin-top: 4px; }

.breakdown { border-top: 1px solid var(--border); }
.breakdown summary { cursor: pointer; padding: 14px clamp(16px, 3vw, 26px); font-weight: 600; }
.breakdown .table-scroll { padding: 0 clamp(16px, 3vw, 26px) 20px; }

/* Paid leave tools */
.tool-head { padding: clamp(16px, 3vw, 26px) clamp(16px, 3vw, 26px) 0; }
.tool-head h2 { margin: 0; font-size: 1.3rem; letter-spacing: -0.01em; }
.tool-head p { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }
.tool-head + .sim-main { margin-top: 10px; border-top: 1px solid var(--border); }
.input-date { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-height: 40px; }
.input-date:focus-visible { border-color: var(--accent); }
.result-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-pair .result-value { font-size: clamp(1.4rem, 3.5vw, 1.8rem); }
.result-alt { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.result-alt .result-label { color: var(--muted); opacity: 1; }
.result-sub { font-size: 0.78rem; opacity: 0.85; }
.days { width: auto; font-size: 0.82rem; }
.days th, .days td { text-align: center; padding: 6px 7px; white-space: nowrap; }
.days thead th { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text); font-size: 0.78rem; }
.days thead th span { display: block; color: var(--muted); font-weight: 500; }
.days thead th.weekend { background: var(--surface-2); }
.days tbody th { text-align: left; font-weight: 600; color: var(--muted); }
.days .dot { color: var(--accent-text); }
.days .muted { color: var(--muted); }
.days td.holiday { background: color-mix(in srgb, var(--focus) 14%, transparent); }
.week { width: 100%; }
.week td, .week th { text-align: center; }
.week .yes { color: var(--accent-text); font-weight: 700; }
.week .no { color: var(--muted); }

/* Tables */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 700; padding-bottom: 10px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
tbody th { font-weight: 500; }
tfoot th, tfoot td { font-weight: 700; border-bottom: 0; }
.lines td:nth-child(2), .lines td:nth-child(3) { color: var(--muted); }
.compact th, .compact td { padding: 7px 10px; }
.table-note { font-size: 0.85rem; color: var(--muted); }

/* Content */
.content { padding: clamp(18px, 3vw, 30px); }
.prose h2 { margin: 28px 0 10px; font-size: 1.35rem; letter-spacing: -0.01em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 20px 0 8px; font-size: 1.05rem; }
.prose p, .prose li { color: var(--muted); }
.prose p strong, .prose li strong { color: var(--text); }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 4px; }
.prose-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.prose .summary { margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0 !important; margin: 0; }
.chips li { margin: 0 !important; }
.chips a { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); font-size: 0.9rem; font-variant-numeric: tabular-nums; background: var(--surface); }
.chips a:hover { border-color: var(--accent); color: var(--accent-text); }
.columns { columns: 3 220px; }
.columns li { break-inside: avoid; }
.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--text); }
.faq details p { margin: 0 0 14px; }

/* Footer */
.site-footer { margin: 56px 0 32px; color: var(--muted); font-size: 0.9rem; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; border-top: 1px solid var(--border); padding-top: 24px; }
.footer-title { margin: 0 0 8px; font-weight: 700; color: var(--text); }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.footer-bottom p { margin: 0; }
.footer-bottom nav { display: flex; gap: 18px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .sim-main { grid-template-columns: 1fr; }
  .sim-result { border-left: 0; border-top: 1px solid var(--border); }
  .prose-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .site-nav { display: none; }
  .menu { display: block; }
}
@media (max-width: 680px) {
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .result-pair { grid-template-columns: 1fr; }
  .theme-toggle .theme-label { display: none; }
  .theme-toggle { padding: 6px 9px; }
  .amounts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .amounts > span:first-child { display: none; }
  .amounts-label { grid-column: 1 / -1; margin-top: 4px; }
  .field-row { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; }
  th, td { padding: 8px 6px; }
}
@media print {
  .site-header, .site-footer, .advanced, #reset, .chips { display: none !important; }
  .card { box-shadow: none; }
  .breakdown[open] summary, .breakdown summary { pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .money, .input-unit { transition: none; } }
