:root {
  color-scheme: light;
  --ink: #17263b;
  --muted: #50637a;
  --line: #dbe3ee;
  --soft: #f5f8fc;
  --blue: #1b58cd;
  --blue-dark: #1546a6;
  --navy: #122a55;
  --warning-text: #74450b;
  --warning-bg: #fff6e5;
  --radius: 16px;
  font-family: Inter, 'Segoe UI', 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans CJK TC', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: #fff;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--blue-dark); text-underline-offset: .22em; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h2 { font-size: 1.3rem; letter-spacing: -.025em; }
h3 { font-size: 1.075rem; }
small, .subtle { color: var(--muted); font-size: .83rem; }
strong, dd, td { font-variant-numeric: tabular-nums; }
.wrap { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 70px; display: flex; align-items: center; gap: 44px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--navy); text-decoration: none; font-size: 1.56rem; font-weight: 750; letter-spacing: -.05em; }
.wordmark-dot { color: var(--blue); margin-left: -8px; }
.logo { display: inline-flex; align-items: end; justify-content: center; gap: 2px; width: 30px; height: 30px; padding: 7px; border-radius: 8px; background: var(--blue); }
.logo i { width: 3px; background: white; border-radius: 1px; height: 6px; }
.logo i:nth-child(2) { height: 10px; }
.logo i:nth-child(3) { height: 15px; }
nav { display: flex; align-items: center; gap: 25px; font-size: .89rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--blue); text-decoration: underline; }
.header-year { margin-left: auto; font-size: .83rem; color: var(--muted); }
.intro { margin: 43px 0 25px; }
.eyebrow { margin-bottom: 8px; font-size: .84rem; font-weight: 700; letter-spacing: .08em; color: var(--blue-dark); }
h1 { font-size: clamp(2rem, 4vw, 3.45rem); line-height: 1.13; letter-spacing: -.05em; color: var(--navy); }
.intro-copy { margin-top: 13px; font-size: 1.025rem; color: var(--muted); }
.law-note { display: flex; align-items: center; gap: 13px; padding: 13px 16px; border-radius: 12px; background: var(--warning-bg); border: 1px solid #eedbbc; color: #6e4819; }
.law-note strong { font-size: .89rem; color: #694010; }
.law-note p { font-size: .83rem; }
.law-note a { color: #6e4819; white-space: nowrap; margin-left: auto; font-size: .83rem; font-weight: 650; }
.law-symbol { flex: 0 0 23px; text-align: center; border: 1px solid #926527; border-radius: 50%; font: 700 .83rem/21px Georgia, serif; }
.workspace { display: grid; grid-template-columns: minmax(295px, 0.92fr) minmax(0, 1.9fr); align-items: start; gap: 23px; margin-top: 24px; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 2px 6px #1b325807; }
.inputs, .comparison, .result-details, .settlement, .lower-card { padding: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.text-button { color: var(--blue-dark); background: none; border: 0; font-size: .82rem; font-weight: 650; padding: 8px 0 8px 8px; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.field { display: grid; gap: 5px; margin-top: 14px; }
.field label { font-size: .87rem; font-weight: 650; }
.field small, .pair-help { line-height: 1.45; font-size: .77rem; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pair-help { display: block; margin-top: 5px; }
input, select { min-width: 0; width: 100%; height: 41px; padding: 5px 9px; color: var(--ink); background: white; border: 1px solid #bac8db; border-radius: 7px; font-size: .925rem; font-variant-numeric: tabular-nums; }
input[aria-invalid="true"] { border-color: #ae2d29; background-color: #fff4f4; }
.currency { position: relative; }
.currency input { padding-right: 34px; }
.currency span { position: absolute; right: 12px; top: 8px; pointer-events: none; color: var(--muted); }
.per-field input { border-color: #7298e9; background: #f4f8ff; color: #1749a9; font-weight: 700; }
.input-error { color: #982524; margin-top: 12px; font-size: .83rem; }
.mobile-results { display: none; }
.results { display: grid; gap: 14px; min-width: 0; }
.results-head { min-height: 35px; }
.status-pill { display: inline-block; padding: 3px 8px; background: #ebf2ff; color: var(--blue-dark); border-radius: 6px; font-size: .75rem; font-weight: 700; text-align: center; }
.status-pill.draft { background: var(--warning-bg); color: var(--warning-text); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric { display: grid; gap: 3px; padding: 15px; }
.metric span { font-size: .83rem; color: var(--muted); font-weight: 650; }
.metric strong { font-size: clamp(1.22rem, 3vw, 2.22rem); line-height: 1.2; letter-spacing: -.045em; overflow-wrap: anywhere; }
.metric small { font-size: .76rem; }
.metric-saving { background: var(--navy); color: white; border-radius: var(--radius); }
.metric-saving span, .metric-saving small { color: #d9e7ff; }
.comparison { background: var(--soft); }
.comparison figcaption { font-weight: 700; font-size: 1.075rem; }
.chart-row { margin-top: 12px; }
.chart-row > div:first-child { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: .86rem; margin-bottom: 5px; }
.track { height: 12px; border-radius: 4px; background: #e1e9f5; overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 4px; width: 0; transition: width .18s ease-out; }
.bar-before { background: #546a86; }
.bar-after { background: var(--blue); }
.chart-note, .note { margin-top: 9px; }
.chart-note { color: var(--blue-dark); font-weight: 650; font-size: .83rem; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 11px; font-size: .87rem; }
.data-table th, .data-table td { padding: 8px; text-align: right; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.data-table tr > :first-child { text-align: left; }
.data-table thead th { color: var(--muted); background: var(--soft); font-weight: 650; }
.data-table tbody th { font-weight: 600; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tfoot { border-top: 1px solid var(--line); }
.data-table tfoot td { font-weight: 650; }
.data-table tbody th small { margin-left: 6px; }
.settlement-grid, .allowance-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.settlement-grid > div, .allowance-totals > div { padding: 10px; background: var(--soft); border-radius: 8px; overflow-wrap: anywhere; }
.settlement-grid dt, .allowance-totals dt { color: var(--muted); font-size: .77rem; }
.settlement-grid dd, .allowance-totals dd { font-size: 1.15rem; font-weight: 700; }
.settlement-grid > div:last-child { background: #ebf2ff; color: var(--blue-dark); }
.lower-card { margin-top: 22px; }
.allowance-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.allowance-totals > div:nth-child(3) { background: var(--warning-bg); color: var(--warning-text); }
.per-table input { width: min(100%, 135px); text-align: right; }
.per-table tr.expiring > :last-child { color: var(--warning-text); font-weight: 700; }
.per-message { border-radius: 8px; padding: 9px 11px; margin-top: 9px; background: var(--warning-bg); color: var(--warning-text); font-size: .85rem; }
.bracket-select { flex-shrink: 0; }
.bracket-table th:first-child { width: 36%; }
.bracket-table th:nth-child(2) { width: 12%; }
.active-bracket { background: #ebf2ff; color: #1546a6; }
.sources { margin: 28px 0 33px; }
.sources p, .sources li, .sources details { color: var(--muted); font-size: .88rem; }
.sources p { margin-top: 8px; }
.sources ul { padding-left: 1.35rem; }
.sources li { margin-bottom: 5px; }
.sources summary { width: fit-content; color: var(--blue-dark); }
.site-footer { border-top: 1px solid var(--line); padding: 16px 0; }
.site-footer .wrap { display: flex; gap: 13px; align-items: baseline; justify-content: space-between; }
.site-footer span { color: var(--muted); font-size: .8rem; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: absolute; top: 5px; left: 5px; z-index: 1; padding: 8px; background: white; }

@media (max-width: 990px) {
  .wrap { width: calc(100% - 50px); }
  .workspace { gap: 14px; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.7fr); }
  .inputs, .comparison, .result-details, .settlement, .lower-card { padding: 16px; }
  .metrics { gap: 8px; }
  .metric { padding: 11px; }
}

@media (max-width: 725px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { min-height: 58px; justify-content: space-between; gap: 9px; }
  .header-year { display: none; }
  nav { gap: 12px; font-size: .8rem; }
  .intro { margin-top: 26px; }
  .law-note { flex-wrap: wrap; align-items: start; gap: 7px; padding: 11px; }
  .law-note div { flex: 1 1 calc(100% - 35px); }
  .workspace { grid-template-columns: 1fr; gap: 20px; margin-top: 17px; }
  .mobile-results { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; margin-top: 6px; font-size: .88rem; font-weight: 700; }
  input, select { min-height: 44px; font-size: 1rem; }
  .metric span, .metric small { font-size: .72rem; }
  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: 7px 4px; }
  .data-table tbody th small { display: block; margin-left: 0; font-size: .68rem; }
  .per-table input { padding-inline: 3px; }
  .allowance-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bracket-heading { flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .wrap { width: calc(100% - 22px); }
  nav { gap: 8px; }
  .metric { padding: 8px; }
  .settlement-grid > div { padding: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .bar { transition: none; }
}
