:root {
  --ink: #1b1233;
  --muted: #43365c;
  --paper: #fff6ec;
  --card: #fffdf8;
  --line: #ecdcc8;
  --plum: #2a0a4a;
  --teal: #0f6e62;
  --coral: #9d174d;
  --sun: #ffe14a;
  --lime: #d6ff4a;
  --focus: #1b1233;
  --radius: 18px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "Avenir Next", system-ui, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  background:
    radial-gradient(circle at 0% -8%, #ffe14a66, transparent 32%),
    radial-gradient(circle at 100% 0%, #ff4d8d33, transparent 28%),
    radial-gradient(circle at 90% 42%, #5eead433, transparent 26%),
    var(--paper);
}
a { color: #5b21b6; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button, a.button { cursor: pointer; }
button, .button {
  border: 2px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 750;
  min-height: 44px;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
}
button:hover, a.button:hover { background: #fff1c9; }
button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.shell { max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, .takehome-amount, .comparison-card h3 {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
h1 { font-size: clamp(2.35rem, 9vw, 4.6rem); margin-bottom: 16px; }
/* Route changes focus the h1. The browser's automatic ring follows each line and looks like a broken border. */
h1:focus,
h1:focus-visible { outline: none; }
h1 em {
  font-style: normal;
  color: inherit;
  padding: 0 .08em;
  background-color: transparent;
  background-image: linear-gradient(#ffe14a, #ffe14a);
  background-repeat: no-repeat;
  background-size: 100% .42em;
  background-position: 0 88%;
  border-radius: 0;
}
h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin-bottom: 14px; }
.eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--coral); margin-bottom: 10px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px #0f6e6233; margin-right: 8px; }
.button-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.primary, button.primary, a.button.primary {
  background: linear-gradient(120deg, #9d174d, #9a3412);
  color: #fff;
  border-color: var(--ink);
}
.primary:hover, button.primary:hover, a.button.primary:hover { background: linear-gradient(120deg, #7f123d, #9a3412); color: #fff; }
.text-link { font-weight: 800; text-decoration: none; padding: 10px 0; min-height: 44px; color: var(--plum); }
.skip-link { position: fixed; left: 12px; top: -80px; background: var(--sun); color: var(--ink); padding: 10px 14px; z-index: 100; border-radius: 8px; border: 2px solid var(--ink); }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.site-header { background: linear-gradient(100deg, #2a0a4a 0%, #12315c 48%, #0f6e62 100%); color: #fff8ee; }
.nav-shell { max-width: 1120px; margin: 0 auto; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.brand { color: inherit; font-size: 1.25rem; letter-spacing: -0.04em; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.brand span { font-weight: 800; }
.brand small { font-size: .7rem; margin-left: 2px; opacity: .85; }
.brand-mark { background: var(--lime); color: var(--plum); border-radius: 10px; padding: 2px 7px 4px; margin-right: 8px; font-weight: 800; border: 2px solid #fff8ee; }
.brand-mark span { color: var(--coral); }
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.site-header nav a { color: #fff8ee; font-size: .92rem; font-weight: 750; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-header a:focus-visible { outline-color: var(--sun); }
.site-header .nav-cta { background: var(--sun); color: var(--ink); border-radius: 999px; padding: 8px 14px; border: 2px solid #fff8ee; }
.site-header .support-link { color: var(--lime); }

.hero { display: grid; gap: 28px; padding-top: 36px; padding-bottom: 28px; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 42rem; }
.hero-note, .hero-caption { color: var(--muted); font-size: .85rem; }
.hero-visual { background: var(--card); border: 2px solid var(--ink); border-radius: 22px; padding: 18px; margin: 0; box-shadow: 8px 8px 0 #ff8fab; }
.mini-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--coral); margin-bottom: 12px; }
.example-receipt > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.example-receipt strong { font-variant-numeric: tabular-nums; }
.receipt-total { border-bottom: 0 !important; align-items: baseline; }
.receipt-total strong { font-size: 1.9rem; letter-spacing: -0.04em; }
.receipt-total strong span { font-size: .85rem; margin-left: 4px; font-weight: 650; }
.journey { background: #1b1233; color: #fff8ee; }
.journey-inner { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding-top: 14px; padding-bottom: 14px; font-size: .9rem; font-weight: 750; }
.journey b { display: inline-block; background: var(--sun); color: var(--ink); border-radius: 999px; padding: 0 6px; margin-right: 6px; font-size: .68rem; }
.journey-inner > span:nth-child(even) { color: var(--lime); }

.calculator-section { padding: 28px 0 12px; scroll-margin-top: 12px; }
.section-title { display: grid; gap: 16px; margin-bottom: 16px; }
.section-title h2 { display: inline; background: linear-gradient(#ffe14a, #ffe14a) left 88% / 100% 0.35em no-repeat; }
.section-title p:not(.eyebrow) { color: var(--muted); margin: 0; }
.tax-year { background: var(--card); border: 2px solid var(--ink); border-radius: 16px; padding: 8px 12px; box-shadow: 4px 4px 0 var(--sun); }
.tax-year label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; }
.tax-year select { width: 100%; border: 0; background: transparent; min-height: 40px; font-weight: 750; padding: 0; }
.calculator-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.calculator-tabs button { border-radius: 999px; background: #fff; }
.calculator-tabs button.active { background: var(--plum); color: #fff8ee; border-color: var(--ink); box-shadow: 3px 3px 0 var(--lime); }
.calculator-grid, .guide-section, .comparison-grid, .insight-grid, .footer-grid, .recommend { display: grid; gap: 16px; }
.input-panel, .flow-card, .comparison-card, .portfolio-dashboard, .property-files {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px; box-shadow: 5px 5px 0 #d6c4ff;
}
.panel-heading, .property-file-toolbar, .result-top, .retained { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-heading h3, .flow-card h3 { margin: 0 0 4px; }
.count { font-size: .75rem; background: var(--sun); border-radius: 999px; padding: 4px 8px; border: 1px solid var(--ink); }
.group-label { font-size: .72rem; letter-spacing: .1em; color: var(--coral); font-weight: 800; }
.property-editor { border: 2px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 12px; background: #fff; }
.property-editor > .property-toggle, .property-toggle { width: 100%; border: 0; background: transparent; text-align: left; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; box-shadow: none; }
.property-icon { width: 36px; height: 36px; display: grid; place-items: center; background: #d6ff4a; border-radius: 10px; flex: 0 0 36px; border: 2px solid var(--ink); }
.property-summary { flex: 1; min-width: 0; }
.property-summary strong, .property-heading h3 { display: block; overflow-wrap: anywhere; }
.property-summary small, .property-heading small { color: var(--muted); }
.property-toggle-label { color: var(--coral); font-size: .85rem; }
.property-fields[hidden] { display: none; }
.property-list-tools, .property-actions, .action-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.property-list-tools .field-hint { margin: 0; flex: 1; }
.fields { display: grid; gap: 14px; margin: 14px 0; }
.fields > *, .number-field { min-width: 0; }
label, .number-field label { display: block; font-size: .92rem; font-weight: 700; }
label input:not([type=checkbox]), label select, .number-field input { display: block; width: 100%; margin-top: 6px; }
input:not([type=checkbox]):not([type=range]), select {
  background: #fff; border: 2px solid #c4b4d8; border-radius: 12px; min-height: 44px; padding: 8px 10px; width: 100%;
}
input:not([type=checkbox]):not([type=range]):hover, select:hover { border-color: var(--plum); }
.unit { font-weight: 500; color: var(--muted); font-size: .8rem; }
.range { width: 100%; accent-color: var(--coral); margin-top: 8px; }
.field-error { color: #9f1239; display: block; margin-top: 4px; }
.field-hint, .muted, .result-footer { color: var(--muted); font-size: .85rem; }
.takehome-card .result-note { color: #ffe9c2; }
.check-label { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; margin: 10px 0; }
.check-label input { width: 1.1rem; height: 1.1rem; margin-top: 3px; accent-color: var(--coral); flex: 0 0 auto; }
.add-property { width: 100%; border-style: dashed; background: #fffbe8; color: var(--plum); }
details { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 8px; }
summary { cursor: pointer; font-weight: 750; min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
summary > span { color: var(--muted); font-weight: 500; font-size: .85rem; margin-left: auto; }
.action-row { margin-top: 16px; }
.action-row .primary { flex: 1; }

.takehome-card {
  background: linear-gradient(145deg, #2a0a4a 0%, #12315c 46%, #0f6e62 100%);
  color: #fff8ee;
  border: 2px solid var(--ink);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 8px 8px 0 var(--sun);
}
.takehome-card .eyebrow { color: var(--lime); }
.takehome-card .result-note, .annual-takehome span, .retained small { color: #ffe9c2; }
.result-badge { background: var(--lime); color: var(--ink); border: 2px solid #fff8ee; border-radius: 999px; padding: 2px 8px; font-size: .75rem; font-weight: 800; }
.takehome-amount { font-size: clamp(2.4rem, 10vw, 3.6rem); margin-top: 12px; font-variant-numeric: tabular-nums; }
.takehome-amount > span { font-size: 1rem; margin-left: 6px; font-weight: 650; color: #ffe9c2; }
.annual-takehome { color: var(--sun); font-size: 1.05rem; font-weight: 750; }
.takehome-rule { border-top: 1px solid #ffffff33; margin: 16px 0; }
.retained strong { font-variant-numeric: tabular-nums; }
.flow-card { margin-top: 12px; }
.money-flow { margin: 8px 0 0; }
.money-flow > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.money-flow dt { color: var(--muted); font-weight: 500; }
.money-flow dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.subtotal { border-top: 2px solid var(--ink); }
.flow-total { background: #fff1c9; border-radius: 12px; padding: 10px !important; margin-top: 8px; }
.flow-total dt { color: var(--plum); font-weight: 800; }
.per-hundred { font-size: .85rem; padding-top: 12px; }
.tax-bar, .split-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: #f3e4d4; margin: 8px 0; border: 2px solid var(--ink); }
.tax-bar span, .seg-tax { background: #c2410c; }
.seg-personal { background: #0f6e62; }
.seg-company { background: #7c3aed; }
.seg-cost { background: #1b1233; }
.split-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; list-style: none; padding: 0; margin: 8px 0 0; font-size: .82rem; }
.split-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.notice, .law-notice, .law-banner { border: 2px solid var(--ink); background: #fffbe8; border-radius: 16px; padding: 14px; margin: 0 0 14px; box-shadow: 4px 4px 0 #ffd0dc; }
.law-notice { padding-top: 0; }
.law-notice summary { color: var(--plum); }
.law-notice ul, .source-notes { margin: 8px 0 0; padding-left: 1.1rem; }
.law-notice li, .source-notes li { margin: 8px 0; }
.error { border-color: #9f1239; background: #fff5f5; box-shadow: 4px 4px 0 #fecdd3; }
.portfolio-dashboard { margin-top: 16px; }
.portfolio-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.portfolio-totals span { color: var(--muted); font-size: .8rem; }
.portfolio-totals b { display: block; font-size: 1.15rem; color: var(--ink); }
.table-scroll { overflow: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
caption { text-align: left; color: var(--muted); margin-bottom: 8px; }
th, td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
thead th { background: #fff1c9; }
td, .money-flow dd { font-variant-numeric: tabular-nums; }
.comparison-card h3 { font-size: 2rem; margin: 8px 0; }
.comparison-card h3 small { display: block; font-size: .85rem; font-weight: 550; letter-spacing: 0; }
.comparison-card:nth-child(1) { box-shadow: 6px 6px 0 var(--lime); }
.comparison-card:nth-child(2) { box-shadow: 6px 6px 0 #ff8fab; }
.comparison-card:nth-child(3) { box-shadow: 6px 6px 0 #7dd3fc; }
.comparison-card button, .share-row button { width: 100%; }
.insight-grid article { background: #fff1c9; border: 2px solid var(--ink); border-radius: 16px; padding: 16px; }
.insight-grid p { color: var(--muted); font-size: .9rem; margin: 0; }
.share-row { display: grid; gap: 12px; margin: 18px 0; }
.share-link, .share-link input { width: 100%; }
.page-intro { padding-top: 28px; padding-bottom: 8px; }
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.guide-section { padding-top: 28px; padding-bottom: 12px; }
.guide-copy p, .example-box p { color: var(--muted); }
.example-box { border-left: 6px solid var(--coral); background: #fff1c9; padding: 14px 16px; margin: 16px 0; border-radius: 0 16px 16px 0; }
.related { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px; box-shadow: 5px 5px 0 var(--sun); }
.related a { display: flex; justify-content: space-between; gap: 8px; padding: 12px 0; border-top: 1px dashed var(--line); text-decoration: none; font-weight: 750; color: var(--plum); }
.tool-directory { padding-top: 8px; }
.tool-directory ul { display: grid; gap: 8px; padding-left: 1.1rem; }
.disclaimer { color: var(--muted); font-size: .85rem; padding-bottom: 28px; }
.site-footer { background: #1b1233; color: #fff8ee; padding: 28px 16px 16px; }
.site-footer .brand { color: #fff8ee; }
.site-footer a { color: var(--lime); }
.site-footer p, .footer-bottom p { color: #f3e8ff; font-size: .8rem; }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer nav a { text-decoration: none; font-weight: 700; }
.footer-bottom { border-top: 1px solid #ffffff33; margin-top: 18px; padding-top: 12px; }
.cookie-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; background: #fffdf8; border: 2px solid var(--ink); border-radius: 18px; padding: 14px; z-index: 20; box-shadow: 6px 6px 0 var(--sun); }
.cookie-banner[hidden] { display: none; }
.cookie-banner p { font-size: .85rem; color: var(--muted); }
.ad-slot { margin: 8px auto 20px; border: 2px dashed var(--plum); border-radius: 16px; padding: 16px; text-align: center; background: repeating-linear-gradient(135deg, #fffdf8, #fffdf8 8px, #fff1c9 8px, #fff1c9 10px); }
.ad-label { letter-spacing: .14em; text-transform: uppercase; font-size: .72rem; font-weight: 800; color: var(--coral); margin: 0 0 4px; }
.ad-slot p:last-child { margin: 0; color: var(--muted); font-size: .85rem; }
.recommend { margin-bottom: 12px; }
.recommend ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.recommend li { background: var(--card); border: 2px dashed var(--plum); border-radius: 16px; padding: 14px; display: flex; justify-content: space-between; gap: 8px; }
.recommend li span { color: var(--coral); font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.property-files { margin-bottom: 16px; }
.export-reminder { position: fixed; right: 12px; left: 12px; bottom: 12px; z-index: 15; background: #fffdf8; border: 2px solid var(--ink); border-radius: 18px; padding: 14px; box-shadow: 6px 6px 0 #d6ff4a; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff6df; border-top: 2px solid var(--ink); padding: 12px; text-align: center; z-index: 30; }
.valid.modified:not([type=checkbox]) { outline: 2px solid #0f6e62; }
.invalid { outline: 2px solid #9f1239; }

@media (prefers-reduced-motion: no-preference) {
  .primary, button.primary, a.button.primary, .nav-cta, .takehome-card, .hero-visual, .comparison-card, .insight-grid article {
    transition: transform .18s ease, box-shadow .18s ease;
  }
  .primary:hover, button.primary:hover, a.button.primary:hover, .site-header .nav-cta:hover { transform: translateY(-2px); }
  .comparison-card:hover, .insight-grid article:hover { transform: translateY(-3px); }
  .takehome-card:hover { transform: rotate(-0.4deg); }
}
@media (min-width: 720px) {
  .shell { padding-left: 28px; padding-right: 28px; }
  .hero { grid-template-columns: 1.15fr .85fr; align-items: center; padding-top: 56px; padding-bottom: 40px; }
  .hero-visual { transform: rotate(1.1deg); }
  .fields.two, .portfolio-totals, .recommend ul { grid-template-columns: 1fr 1fr; }
  .section-title { grid-template-columns: 1fr auto; align-items: end; }
  .tax-year { min-width: 240px; }
  .journey-inner { justify-content: space-between; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .cookie-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; left: 50%; right: auto; transform: translateX(-50%); width: min(920px, calc(100% - 32px)); }
  .export-reminder { left: auto; width: min(420px, calc(100% - 24px)); }
}
@media (min-width: 980px) {
  .calculator-grid { grid-template-columns: 1.05fr .95fr; align-items: start; }
  .output-panel { position: sticky; top: 16px; }
  .guide-section { grid-template-columns: 1.7fr .9fr; gap: 40px; align-items: start; }
  .comparison-grid, .insight-grid { grid-template-columns: repeat(3, 1fr); }
  .recommend { grid-template-columns: .8fr 1.2fr; align-items: center; }
  .recommend ul { grid-template-columns: repeat(3, 1fr); }
  .comparison-card button, .share-row button { width: auto; }
  .share-row { grid-template-columns: 1fr auto; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-visual { transform: none; }
  * { animation: none !important; transition: none !important; }
}
