:root {
  --ink: #17221d;
  --muted: #68726c;
  --paper: #f4f1e9;
  --card: #fffdf8;
  --line: #dedbd1;
  --forest: #183f32;
  --forest-2: #245b47;
  --lime: #c8f25a;
  --lime-soft: #ecf8c9;
  --amber: #d88737;
  --red: #b4453e;
  --shadow: 0 18px 45px rgba(28, 45, 36, 0.09);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.hero {
  color: #fff;
  background:
    radial-gradient(circle at 78% 22%, rgba(200, 242, 90, .16), transparent 25%),
    linear-gradient(135deg, #102b23 0%, #183f32 55%, #245b47 100%);
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
}
.topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: var(--lime); font-weight: 900; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.law-year { color: rgba(255,255,255,.7); font-size: 13px; }
.law-year strong { color: #fff; }
.hero-content { min-height: 390px; padding: 72px 0 76px; display: grid; grid-template-columns: 1.55fr .7fr; gap: 80px; align-items: end; }
.hero-content > * { min-width: 0; }
.eyebrow, .section-kicker { margin: 0 0 10px; color: var(--lime); font-size: 12px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { max-width: 800px; margin: 0; overflow-wrap: anywhere; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 6vw, 72px); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
.hero-copy { max-width: 760px; margin: 28px 0 0; color: rgba(255,255,255,.76); font-size: 18px; line-height: 1.65; }
.hero-note { min-width: 0; display: flex; gap: 14px; padding: 20px; border: 1px solid rgba(255,255,255,.17); border-radius: 18px; background: rgba(255,255,255,.07); backdrop-filter: blur(10px); }
.note-icon { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: var(--lime); font-family: Georgia, serif; font-weight: 800; }
.hero-note p { margin: 5px 0 0; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.55; }

.step-nav { position: sticky; z-index: 20; top: 0; min-height: 62px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 20px; background: rgba(244,241,233,.91); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.step-nav { scrollbar-width: none; }
.step-nav::-webkit-scrollbar { display: none; }
.step-nav a { display: flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; transition: .2s ease; }
.step-nav a:hover { color: var(--forest); background: #fff; }
.step-nav span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #e3e0d7; font-size: 11px; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.intro-card { margin: 54px 0 20px; padding: 30px; display: grid; grid-template-columns: .55fr 1.7fr; gap: 45px; align-items: center; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.section-kicker { color: var(--forest-2); }
.intro-card h2, .section-heading h2, .modal h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 32px; font-weight: 500; letter-spacing: -.025em; }
.mini-steps { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; list-style: none; }
.mini-steps li { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: #f4f2ec; }
.mini-steps li > span { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: var(--lime); font-size: 12px; font-weight: 850; }
.mini-steps strong, .mini-steps small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-steps strong { font-size: 12px; }
.mini-steps small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.calculator-section { scroll-margin-top: 82px; padding: 72px 0 0; }
.section-heading { margin-bottom: 24px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.section-heading p:not(.section-kicker) { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.step-badge { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: var(--forest); background: var(--lime); font-size: 12px; font-weight: 900; }
.form-card, .results-card { padding: 32px; border: 1px solid rgba(28,45,36,.07); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.field { min-width: 0; display: grid; gap: 9px; }
.field-wide { grid-column: 1 / -1; }
.field-label { display: flex; align-items: center; gap: 7px; color: #354039; font-size: 13px; font-weight: 750; }
.tip { width: 20px; height: 20px; padding: 0; display: inline-grid; place-items: center; border: 1px solid #ccd1c8; border-radius: 50%; color: var(--forest-2); background: transparent; cursor: help; font-size: 11px; font-weight: 850; }
.money-control, .percent-control { height: 52px; display: flex; align-items: center; border: 1px solid #d6d5ce; border-radius: 13px; background: #fff; transition: .2s ease; }
.money-control:focus-within, .percent-control:focus-within { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36,91,71,.1); }
.money-control input, .percent-control input { width: 100%; min-width: 0; max-width: 100%; padding: 0 16px; border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 750; }
.money-control span, .percent-control span { padding-right: 16px; color: var(--muted); }
.percent-control input { text-align: right; }
.segmented { width: fit-content; display: inline-grid; grid-template-columns: repeat(2, minmax(105px, 1fr)); padding: 4px; border-radius: 13px; background: #ebe9e2; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 10px 25px; border-radius: 10px; color: var(--muted); text-align: center; cursor: pointer; font-weight: 750; }
.segmented input:checked + label { color: #fff; background: var(--forest); box-shadow: 0 4px 10px rgba(24,63,50,.2); }
.form-hint { margin-top: 28px; padding-top: 20px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.form-hint span { color: var(--forest-2); font-size: 18px; }

.employee-head, .employee-row { display: grid; grid-template-columns: minmax(150px, 1fr) 120px minmax(210px, 1fr) 42px; gap: 14px; align-items: center; }
.employee-head { padding: 0 4px 10px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.employee-list { display: grid; gap: 10px; }
.employee-row input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #d6d5ce; border-radius: 12px; outline: 0; background: #fff; font-weight: 650; }
.employee-row .employee-count { text-align: center; }
.employee-row input:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36,91,71,.1); }
.remove-employee { width: 40px; height: 40px; border: 0; border-radius: 10px; color: var(--red); background: #faece9; cursor: pointer; font-size: 18px; }
.subtotal-row { margin-top: 22px; padding-top: 20px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
.subtotal-row span { color: var(--muted); }
.subtotal-row strong { font-size: 20px; }

.button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 11px; cursor: pointer; font-size: 13px; font-weight: 800; transition: transform .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: var(--forest); background: var(--lime); }
.button-secondary { margin-top: 15px; color: var(--forest); background: var(--lime-soft); }
.button-ghost { color: #fff; border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.08); }
.button-ghost-dark { color: var(--forest); border: 1px solid #c8cec9; background: transparent; }
.button-full { width: 100%; }

.it-card { overflow: hidden; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; cursor: pointer; }
.switch-row strong, .switch-row small { display: block; }
.switch-row small { margin-top: 5px; color: var(--muted); }
.switch-row input { position: absolute; opacity: 0; }
.switch { position: relative; flex: 0 0 auto; width: 54px; height: 30px; border-radius: 999px; background: #d7d8d2; transition: .2s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.15); transition: .2s; }
.switch-row input:checked + .switch { background: var(--forest); }
.switch-row input:checked + .switch::after { transform: translateX(24px); background: var(--lime); }
.it-fields { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.eligibility-note { margin-bottom: 24px; padding: 16px; display: flex; align-items: flex-start; gap: 12px; border-radius: 14px; background: var(--lime-soft); }
.eligibility-note > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--forest); font-size: 12px; }
.eligibility-note p { margin: 0; font-size: 13px; line-height: 1.55; }
.check-field { display: flex; gap: 11px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.check-field input { width: 18px; height: 18px; accent-color: var(--forest); }
.check-field strong, .check-field small { display: block; }
.check-field small { margin-top: 4px; color: var(--muted); }
.metric-box { display: grid; align-content: center; min-height: 82px; padding: 13px 16px; border-radius: 14px; color: #fff; background: var(--forest); }
.metric-box span { color: rgba(255,255,255,.68); font-size: 11px; }
.metric-box strong { margin-top: 2px; color: var(--lime); font-size: 24px; }
.metric-box small { color: rgba(255,255,255,.78); }
.metric-box.is-error { background: #7b302c; }

.results-section { padding-bottom: 90px; }
.results-heading { grid-template-columns: auto 1fr auto; align-items: center; }
.summary-grid { margin-bottom: 18px; display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 14px; }
.summary-card { min-height: 150px; padding: 23px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.summary-card span, .summary-card small { color: var(--muted); font-size: 12px; }
.summary-card strong { margin: 9px 0 5px; font-family: Georgia, serif; font-size: clamp(23px, 3vw, 34px); font-weight: 500; }
.summary-best { color: #fff; border: 0; background: var(--forest); }
.summary-best span, .summary-best small { color: rgba(255,255,255,.65); }
.summary-best strong { color: var(--lime); }
.table-toolbar { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.table-toolbar strong, .table-toolbar span { display: block; }
.table-toolbar span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.compact-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.compact-check input { accent-color: var(--forest); }
.table-scroll { overflow-x: auto; }
.results-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.results-table th { padding: 11px 13px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: right; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.results-table th:first-child, .results-table td:first-child, .results-table th:nth-child(2), .results-table td:nth-child(2) { text-align: left; }
.results-table td { padding: 16px 13px; border-bottom: 1px solid #ebe8df; text-align: right; font-size: 13px; }
.results-table tr.best-row td { background: #f1f8dd; }
.results-table tr.unavailable { opacity: .52; }
.results-table tr:last-child td { border-bottom: 0; }
.mode-cell strong, .mode-cell small { display: block; }
.mode-cell small { margin-top: 3px; color: var(--muted); }
.profit-cell { font-weight: 850; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; }
.badge-green { color: var(--forest); background: var(--lime-soft); }
.badge-gray { color: #606963; background: #ecece8; }
.badge-amber { color: #79481b; background: #f8e6d0; }
.detail-button { min-height: 34px; padding: 0 11px; color: var(--forest); border: 1px solid #cbd1cc; border-radius: 9px; background: #fff; cursor: pointer; font-size: 11px; font-weight: 800; }
.messages { display: grid; gap: 8px; margin-bottom: 15px; }
.message { padding: 12px 15px; border-radius: 12px; font-size: 12px; line-height: 1.45; }
.message-warning { color: #734419; background: #f8e6d0; }
.message-error { color: #7b302c; background: #fae8e6; }
.disclaimer { margin: 18px auto 0; max-width: 850px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.55; }

footer { min-height: 125px; padding: 30px max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.76); background: #102b23; }
footer strong, footer span { display: block; }
footer span { margin-top: 6px; font-size: 12px; }
footer a { color: var(--lime); text-decoration: none; font-weight: 800; }

.tooltip-popover { position: fixed; z-index: 100; width: min(300px, calc(100vw - 30px)); padding: 12px 14px; color: #fff; border-radius: 10px; background: #132a22; box-shadow: 0 10px 25px rgba(0,0,0,.25); font-size: 12px; line-height: 1.5; pointer-events: none; }
.modal { width: min(720px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 32px; overflow: auto; border: 0; border-radius: 22px; color: var(--ink); background: var(--card); box-shadow: 0 30px 90px rgba(0,0,0,.32); }
.modal::backdrop { background: rgba(9,28,21,.7); backdrop-filter: blur(5px); }
.password-modal { width: min(440px, calc(100% - 30px)); }
.modal-close { position: absolute; top: 17px; right: 17px; width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: #efede7; cursor: pointer; font-size: 22px; }
.modal-icon { width: 48px; height: 48px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 14px; background: var(--lime-soft); }
.modal p:not(.section-kicker) { color: var(--muted); line-height: 1.55; }
.password-modal .field { margin: 22px 0 12px; }
.password-modal input { height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; outline: 0; }
.error-text { color: var(--red) !important; font-size: 12px; }
.law-grid { margin-top: 25px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.law-field { display: grid; gap: 6px; }
.law-field span { color: var(--muted); font-size: 11px; }
.law-field input { height: 45px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 750; }
.modal-actions { position: sticky; bottom: -32px; margin: 28px -32px -32px; padding: 18px 32px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); background: var(--card); }
.detail-modal { width: min(800px, calc(100% - 30px)); }
.detail-title { padding-right: 45px; }
.detail-meta { margin: 10px 0 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.detail-line { padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-radius: 11px; background: #f2f0ea; }
.detail-line span { color: var(--muted); font-size: 12px; }
.detail-line strong { text-align: right; }
.detail-line.total { color: #fff; background: var(--forest); }
.detail-line.total span { color: rgba(255,255,255,.7); }
.detail-explanation { margin-top: 18px; padding: 16px; border-left: 4px solid var(--lime); background: var(--lime-soft); font-size: 12px; line-height: 1.6; }

@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; gap: 35px; }
  .hero-note { max-width: 520px; }
  .intro-card { grid-template-columns: 1fr; }
  .mini-steps { grid-template-columns: repeat(2, 1fr); }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-best { grid-column: 1 / -1; }
}

@media (max-width: 650px) {
  .hero { padding-inline: 20px; }
  .topbar { align-items: flex-start; padding: 18px 0; }
  .brand { font-size: 14px; }
  .law-year { display: none; }
  .button-ghost { width: 42px; padding: 0; overflow: hidden; color: transparent; }
  .button-ghost span { color: #fff; }
  .hero-content { min-height: 430px; padding: 54px 0 60px; }
  .hero h1 { font-size: 44px; }
  .hero-copy { overflow-wrap: anywhere; font-size: 15px; }
  .step-nav { justify-content: flex-start; overflow-x: auto; }
  .step-nav a { flex: 0 0 auto; }
  .page-shell { width: min(100% - 24px, 1180px); }
  .intro-card, .form-card, .results-card { padding: 20px; }
  .mini-steps { grid-template-columns: 1fr; }
  .calculator-section { padding-top: 55px; }
  .section-heading, .results-heading { grid-template-columns: auto 1fr; }
  .results-heading .button { grid-column: 1 / -1; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .employee-head { display: none; }
  .employee-row { grid-template-columns: 90px 1fr 40px; padding: 12px; border-radius: 14px; background: #f1efe9; }
  .employee-row input:first-child { grid-column: 1 / -1; }
  .employee-row .employee-pay { grid-column: 2; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-best { grid-column: auto; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .law-grid, .detail-grid { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column-reverse; }
  footer { align-items: flex-start; flex-direction: column; gap: 20px; }
}

@media print {
  .hero, .step-nav, .intro-card, #business, #team, #it-benefit, footer, .results-heading .button, .detail-button, .table-toolbar label { display: none !important; }
  body { background: #fff; }
  .page-shell { width: 100%; }
  .calculator-section { padding: 0; }
  .results-card, .summary-card { box-shadow: none; }
}
