:root {
  --ink: #13202d;
  --navy: #162b3d;
  --navy-2: #203a50;
  --paper: #f5f3ee;
  --white: #fff;
  --copper: #bd7b4f;
  --copper-light: #e7cdbb;
  --line: #d8d8d2;
  --muted: #68737d;
  --green: #487564;
  --shadow: 0 18px 55px rgba(17, 31, 43, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.embedded .topbar, .embedded > footer { display: none; }
.single-tool .hero, .single-tool .calculator-tabs, .single-tool .tool-nav { display: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.topbar { height: 84px; padding: 0 max(28px, calc((100vw - 1280px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: white; }
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.45); color: var(--copper-light); font: 25px/1 Georgia, serif; }
.brand b, .brand small { display: block; }
.brand b { font-size: 15px; letter-spacing: .02em; }
.brand small { color: #aebbc5; font-size: 12px; margin-top: 1px; }
.status { font-size: 13px; color: #c8d1d8; display: flex; align-items: center; gap: 8px; }
.status span { width: 7px; height: 7px; border-radius: 50%; background: #82bea4; box-shadow: 0 0 0 4px rgba(130,190,164,.12); }

main { max-width: 1280px; margin: 0 auto; padding: 0 28px 80px; }
.hero { display: grid; grid-template-columns: 1fr 320px; gap: 70px; align-items: end; padding: 78px 0 58px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 12px; color: var(--copper); font-size: 12px; line-height: 1.2; font-weight: 800; letter-spacing: .16em; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { font-size: clamp(42px, 5vw, 66px); line-height: 1.02; letter-spacing: -.035em; margin: 0; }
h1 em { color: var(--copper); font-weight: 400; }
.lead { max-width: 700px; margin: 24px 0 0; font-size: 18px; color: var(--muted); }
.hero-note { border-left: 2px solid var(--copper); padding: 4px 0 4px 22px; color: var(--muted); font-size: 14px; }
.hero-note b { color: var(--ink); }
.hero-note p { margin: 7px 0 0; }

.calculator-tabs { display: grid; grid-template-columns: repeat(5, 1fr); margin: 42px 0 0; border: 1px solid var(--line); background: rgba(255,255,255,.36); }
.tab { min-height: 76px; padding: 13px 16px; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: transparent; text-align: left; font-size: 14px; font-weight: 700; transition: .2s ease; }
.tab:last-child { border-right: 0; }
.tab span { display: block; margin-bottom: 4px; color: #a7a49e; font: 12px/1 Georgia, serif; }
.tab:hover { background: white; color: var(--ink); }
.tab.active { background: var(--navy); color: white; box-shadow: inset 0 -3px var(--copper); }
.tab.active span { color: var(--copper-light); }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; margin-top: 28px; }
.forms { min-height: 520px; }
.calculator-panel { display: none; padding: 42px; background: var(--white); border: 1px solid #e2e1dc; box-shadow: var(--shadow); animation: enter .22s ease; }
.calculator-panel.active { display: block; }
.tool-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; margin: -8px 0 26px; padding-bottom: 18px; border-bottom: 1px solid #ecebe7; }
.tool-nav a { color: var(--navy-2); text-decoration: none; font-size: 12px; font-weight: 800; letter-spacing: .035em; }
.tool-nav a::before { content: "←"; margin-right: 7px; color: var(--copper); }
.tool-nav a:last-child::before { content: "↗"; }
.tool-nav a:hover { color: var(--copper); }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.panel-heading { padding-bottom: 28px; margin-bottom: 30px; border-bottom: 1px solid #e8e7e2; }
.panel-heading h2, .roadmap h2 { margin: 0 0 10px; font-size: 37px; line-height: 1.1; }
.panel-heading > p:last-child { max-width: 650px; margin: 0; color: var(--muted); }
.section-title { display: flex; align-items: center; gap: 11px; margin: 0 0 20px; color: var(--ink); font: 700 15px/1.3 Inter, ui-sans-serif, sans-serif; }
.section-title span { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--copper); color: var(--copper); font: 15px/1 Georgia, serif; }
.section-title-second { margin-top: 40px; padding-top: 32px; border-top: 1px solid #e8e7e2; }
.auto-match-note { margin: -8px 0 20px; color: var(--muted); font-size: 13px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 8px; color: #46525c; font-size: 14px; font-weight: 700; }
.field input, .field select { width: 100%; min-height: 53px; border: 1px solid #cfd2d2; border-radius: 0; padding: 0 15px; color: var(--ink); background: white; outline: none; transition: border .15s, box-shadow .15s; }
.field input:focus, .field select:focus { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(189,123,79,.12); }
.field select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, #6f777d 50%), linear-gradient(135deg, #6f777d 50%, transparent 50%); background-position: calc(100% - 19px) 22px, calc(100% - 14px) 22px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.tax-summary { min-height: 53px; justify-content: center; padding: 14px 16px; border: 1px solid #d8d8d2; background: #f7f7f4; color: var(--ink); font-weight: 700; }
.field-note { margin: -8px 0 0; color: var(--muted); font-size: 12.5px; }
.money-input { position: relative; display: block; }
.money-input input { padding-right: 52px; }
.money-input i { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: #8a9196; font-style: normal; font-weight: 500; }
.check { position: relative; display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; padding: 18px; border: 1px solid #d8d8d2; cursor: pointer; }
.check input { position: absolute; opacity: 0; }
.check > span { grid-row: span 2; width: 21px; height: 21px; margin-top: 2px; border: 1px solid #9da4a8; background: white; }
.check input:checked + span { border-color: var(--copper); background: var(--copper); box-shadow: inset 0 0 0 5px white; }
.check b { font-size: 14px; }
.check small { margin-top: 3px; color: var(--muted); font-weight: 400; }
.toggle-field { gap: 9px; }
.switch { min-height: 23px; display: flex; align-items: center; gap: 9px; color: var(--muted); font-weight: 500; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; min-height: 1px; }
.switch span { width: 36px; height: 20px; border-radius: 20px; background: #c5c9c8; position: relative; transition: .2s; }
.switch span::after { content: ""; width: 14px; height: 14px; border-radius: 50%; position: absolute; left: 3px; top: 3px; background: white; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }
.hidden { display: none !important; }
.panel-disclaimer { margin-top: 34px; padding: 19px 21px; border-left: 3px solid var(--copper); background: #f7f4ef; color: var(--muted); font-size: 13px; }
.panel-disclaimer b { display: block; margin-bottom: 5px; color: var(--ink); font-size: 13px; }
.panel-disclaimer p { margin: 0; }

.breakdown-wrap { margin-top: 30px; border: 1px solid var(--line); }
.breakdown-heading { display: flex; justify-content: space-between; gap: 20px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: #f7f7f4; font-size: 13px; }
.breakdown-heading span { color: var(--muted); }
.table-scroll { overflow-x: auto; }
.breakdown-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.breakdown-table th, .breakdown-table td { padding: 11px 14px; border-bottom: 1px solid #ecebe7; text-align: right; white-space: nowrap; }
.breakdown-table th:first-child, .breakdown-table td:first-child { text-align: left; }
.breakdown-table th { color: var(--muted); background: white; font-size: 12px; }
.breakdown-table tbody tr:last-child td { border-bottom: 0; }
.breakdown-table td:last-child { color: var(--ink); font-weight: 700; }

.expense-list { border: 1px solid var(--line); }
.expense-head, .expense-row { display: grid; grid-template-columns: minmax(200px, 1fr) 160px 135px; gap: 12px; align-items: center; }
.expense-head { padding: 11px 14px; color: var(--muted); background: #f7f7f4; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.expense-row { padding: 10px 14px; border-bottom: 1px solid #ecebe7; }
.expense-row:last-child { border-bottom: 0; }
.expense-row label { color: #46525c; font-size: 13px; font-weight: 700; }
.expense-row input, .expense-row select { min-height: 42px; width: 100%; border: 1px solid #cfd2d2; padding: 0 11px; color: var(--ink); background: white; outline: none; }
.expense-row select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, #6f777d 50%), linear-gradient(135deg, #6f777d 50%, transparent 50%); background-position: calc(100% - 15px) 18px, calc(100% - 10px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.expense-row input:focus, .expense-row select:focus { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(189,123,79,.1); }
.expense-row .money-input input { padding-right: 38px; }
.expense-name { font-weight: 700; }

.result-card { position: sticky; top: 22px; min-height: 490px; padding: 34px; color: white; background: var(--navy); box-shadow: 0 25px 60px rgba(13,28,40,.2); }
.result-card .eyebrow { color: var(--copper-light); }
.result-total { padding: 18px 0 30px; border-bottom: 1px solid rgba(255,255,255,.16); }
.result-total span { display: block; font: 42px/1.05 Georgia, serif; letter-spacing: -.025em; }
.result-total small { display: block; margin-top: 9px; color: #b8c4cd; }
.result-lines { padding: 20px 0 14px; }
.result-line { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; color: #d5dde3; font-size: 14px; }
.result-line b { color: white; white-space: nowrap; }
.legal-basis { padding: 20px 0; border-top: 1px solid rgba(255,255,255,.16); color: #b8c4cd; font-size: 12.5px; }
.legal-basis b { display: block; margin-bottom: 6px; color: white; font-size: 13px; }
.legal-basis p { margin: 0; }
.copy-button { width: 100%; min-height: 48px; margin-top: 8px; border: 1px solid rgba(255,255,255,.35); color: white; background: transparent; font-weight: 700; transition: .2s; }
.copy-button:hover:not(:disabled) { border-color: var(--copper-light); color: var(--copper-light); }
.copy-button:disabled { cursor: default; opacity: .55; }
.copy-preview { margin: 10px 0 0; color: #d5dde3; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.copy-status { min-height: 18px; margin: 8px 0 0; color: #9fd4bd; text-align: center; font-size: 12px; }

.roadmap { display: grid; grid-template-columns: 360px 1fr; gap: 55px; padding: 72px 0; margin-top: 70px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.roadmap h2 { font-size: 36px; }
.roadmap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.roadmap-grid span { padding: 14px 17px; border: 1px solid var(--line); background: rgba(255,255,255,.42); color: #53606a; font-weight: 650; font-size: 14px; }
.roadmap-grid span::before { content: "+"; margin-right: 9px; color: var(--copper); }
.sources { display: grid; grid-template-columns: 250px 1fr; gap: 60px; padding: 50px 0 0; color: var(--muted); font-size: 13px; }
.sources p { margin-top: 0; }
footer { max-width: 1280px; margin: 0 auto; padding: 25px 28px 34px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: #8a8f91; font-size: 12px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 35px; }
  .hero-note { max-width: 650px; }
  .calculator-tabs { grid-template-columns: repeat(3, 1fr); }
  .tab:nth-child(3) { border-right: 0; }
  .tab:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .workspace { grid-template-columns: 1fr; }
  .result-card { position: static; min-height: auto; }
  .roadmap { grid-template-columns: 1fr; gap: 25px; }
}

@media (max-width: 650px) {
  .topbar { height: auto; padding: 17px 20px; }
  .status { display: none; }
  main { padding: 0 16px 60px; }
  .hero { padding: 48px 4px 38px; }
  h1 { font-size: 40px; }
  .lead { font-size: 16px; }
  .calculator-tabs { display: flex; overflow-x: auto; margin-top: 25px; }
  .tab { min-width: 145px; border-bottom: 0 !important; }
  .calculator-panel { padding: 28px 20px; }
  .tool-nav { justify-content: flex-start; margin-top: -2px; }
  .panel-heading h2 { font-size: 31px; }
  .field-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .expense-list { border: 0; }
  .expense-head { display: none; }
  .expense-row { grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 0; }
  .expense-row label, .expense-row .expense-name { grid-column: span 2; }
  .result-card { padding: 28px 22px; }
  .result-total span { font-size: 38px; }
  .roadmap { padding: 52px 0; margin-top: 45px; }
  .roadmap-grid { grid-template-columns: 1fr; }
  .sources { grid-template-columns: 1fr; gap: 12px; }
}
