:root {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #213c48;
  background: #f7f9fa;
  font-size: 17px;
  line-height: 1.55;
  --ink: #183e50;
  --muted: #526873;
  --line: #d4dfe4;
  --blue: #285f91;
  --green: #28735f;
  --soft: #eaf1f5;
  --lgsk-link: #285f91;
  --lgsk-background: #fff;
  --lgsk-text: #213c48;
  --lgsk-border: #c4d2db;
  --lgsk-secondary: #526873;
  --lgsk-focus: #285f91;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--blue);
  text-underline-offset: 4px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
select,
input[type="range"],
summary {
  cursor: pointer;
}
button {
  background: var(--ink);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 16px;
  min-height: 46px;
  font-weight: 600;
}
button:hover {
  background: #28576c;
}
button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
button.secondary:hover {
  background: var(--soft);
}
button.text-button {
  background: transparent;
  color: var(--blue);
  border: 0;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 0.88rem;
  white-space: nowrap;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
input,
select,
textarea {
  color: var(--ink);
  background: #fff;
  border: 1px solid #9baeb9;
  border-radius: 6px;
  min-height: 46px;
  max-width: 100%;
  padding: 9px 11px;
  accent-color: var(--blue);
  caret-color: var(--blue);
}
input[type="number"] {
  width: 100%;
  font-variant-numeric: tabular-nums;
}
input[type="range"] {
  padding: 0;
  width: 100%;
  border: 0;
  min-height: 32px;
  background: transparent;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
}
input[aria-invalid="true"] {
  border: 2px solid #a32d32;
}
select {
  width: 100%;
}
label {
  display: block;
  font-size: 0.87rem;
  font-weight: 600;
  margin: 14px 0 0;
}
#share-link-field[hidden] {
  display: none;
}
label input,
label select {
  display: block;
  margin-top: 6px;
}
label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
}
.unit {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--ink);
  font-weight: 650;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
}
h3 {
  font-size: 1rem;
  margin-top: 24px;
}
p {
  max-width: 72ch;
}
p + p {
  margin-top: 12px;
}
.field-note {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 10px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.site-header {
  max-width: 1280px;
  margin: auto;
  min-height: 84px;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 750;
  text-decoration: none;
  color: var(--ink);
}
.brand svg {
  flex-shrink: 0;
}
.site-header > span {
  font-size: 0.82rem;
  color: var(--muted);
}
.site-header > a:last-child {
  margin-left: auto;
  font-size: 0.86rem;
}
main {
  max-width: 1280px;
  margin: auto;
  padding: 44px 32px 0;
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.page-heading p {
  color: var(--muted);
  margin-top: 14px;
}
.local-note {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  color: var(--muted);
  padding-bottom: 4px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.inputs {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.inputs h2 {
  font-size: 1.15rem;
}
.inputs > .section-heading {
  gap: 8px;
  margin-bottom: 0;
}
.inputs .field-note:first-of-type {
  margin-top: 6px;
}
fieldset {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
  margin: 0;
  min-width: 0;
}
legend {
  float: left;
  width: 100%;
  font-weight: 650;
  font-size: 0.98rem;
  margin: 0 0 4px;
  padding: 0;
}
legend + * {
  clear: both;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.inputs details {
  margin-top: 20px;
}
.inputs details label {
  font-size: 0.85rem;
}
.inputs summary {
  font-size: 0.86rem;
}
.inputs .advanced {
  margin-top: 24px;
}
.results {
  min-width: 0;
}
.results > section + section {
  margin-top: 32px;
}
.lead {
  font-size: 1.04rem;
  color: var(--ink);
  margin: 18px 0 22px;
}
.comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.comparison th {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
  padding: 12px 8px;
}
.comparison th:first-child {
  text-align: left;
  padding-left: 0;
}
.comparison td {
  padding: 14px 8px;
  text-align: right;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}
.comparison td:first-child {
  text-align: left;
  padding-left: 0;
  white-space: normal;
  font-weight: 500;
}
.comparison td:nth-child(2) {
  color: var(--green);
  font-weight: 700;
}
.comparison-scroll {
  overflow-x: auto;
}
.comparison th:nth-child(2) {
  color: var(--green);
}
.chart-section {
  padding-top: 4px;
}
.chart-section .section-heading {
  align-items: flex-start;
}
.chart-section select {
  font-size: 0.88rem;
  max-width: 170px;
  min-height: 38px;
  padding: 6px;
}
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--muted);
  margin: 18px 0 10px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legend i {
  width: 22px;
  height: 0;
  border-top: 3px solid var(--blue);
}
.legend .roth {
  border-color: var(--green);
}
.legend .baseline {
  border-color: #6b7986;
  border-top-style: dashed;
}
.chart-wrap {
  width: 100%;
  margin-top: 10px;
}
#chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
#chart text {
  font-family: inherit;
  fill: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.year-control {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.year-control label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 400;
  font-size: 0.83rem;
  margin: 0 0 4px;
}
.year-control strong {
  color: var(--blue);
  font-weight: 650;
}
.year-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.year-panel {
  background: var(--soft);
  border-radius: 12px;
  padding: 24px;
}
.status-label {
  font-size: 0.84rem;
  color: var(--muted);
}
.year-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 20px 0 24px;
}
.year-numbers dt {
  color: var(--muted);
  font-size: 0.88rem;
}
.year-numbers dd {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 5px 0 0;
  font-variant-numeric: tabular-nums;
}
.year-panel h3 {
  margin-top: 24px;
}
.actions {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  font-size: 0.86rem;
}
.actions li {
  position: relative;
  padding: 10px 0 10px 25px;
}
.actions li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: 10px;
  height: 10px;
  border: 1.5px solid #738e9b;
  border-radius: 2px;
}
.year-panel details {
  border-block: 1px solid #c5d5de;
}
.detail-list {
  font-size: 0.82rem;
  margin: 12px 0;
}
.detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
}
.detail-list dt {
  color: var(--muted);
}
.detail-list dd {
  margin: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.year-panel details .field-note {
  margin-bottom: 16px;
}
summary {
  min-height: 46px;
  padding: 12px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
summary:hover {
  color: var(--blue);
}
details[open] > summary {
  margin-bottom: 8px;
}
.notice {
  padding: 22px 24px;
  background: #edf1ee;
  border-radius: 10px;
  color: #344f42;
  font-size: 0.82rem;
}
.notice h3 {
  margin: 0 0 10px;
}
.notice p {
  max-width: 74ch;
}
.notice p:empty {
  display: none;
}
.schedule-section {
  margin-top: 56px;
}
.schedule-section .section-heading p {
  font-size: 0.87rem;
  color: var(--muted);
  margin-top: 8px;
}
.table-scroll {
  overflow: auto;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.schedule {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.schedule th {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: #edf2f5;
  padding: 16px;
}
.schedule td {
  padding: 14px 16px;
  border-top: 1px solid #e3e9ec;
  height: 52px;
}
.schedule th:first-child,
.schedule td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
}
.schedule th:first-child {
  background: #edf2f5;
}
.schedule tr.selected td {
  background: #eaf2f8;
}
.schedule td:nth-child(2) {
  color: var(--green);
  font-weight: 650;
}
.schedule button {
  min-height: 28px;
  padding: 0;
  background: transparent;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: inherit;
}
.schedule caption {
  caption-side: bottom;
  text-align: left;
  font-size: 0.84rem;
  color: var(--muted);
  padding: 16px;
  white-space: normal;
}
.rules-section {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 40px;
  padding: 48px 0 40px;
  margin-top: 48px;
  border-top: 1px solid var(--line);
}
.rules-section h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  max-width: 20ch;
}
.rules-section > div > p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 16px;
}
.rule-content details {
  border-bottom: 1px solid var(--line);
  padding: 0 0 8px;
}
.rule-content summary {
  font-size: 0.95rem;
}
.rule-content p,
.source-list {
  font-size: 0.86rem;
  margin-bottom: 16px;
  max-width: 70ch;
}
.source-list {
  padding-left: 20px;
}
.source-list li {
  padding-block: 6px;
}
footer {
  border-top: 1px solid var(--line);
  max-width: 1280px;
  padding: 24px 32px 40px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 30px;
  font-size: 0.86rem;
  color: var(--muted);
}
.footer-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-right: auto;
}
dialog {
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 28px;
  width: min(540px, calc(100% - 32px));
  max-height: 90dvh;
  overflow: auto;
  box-shadow: 0 12px 60px #17344633;
}
dialog::backdrop {
  background: #183e5077;
}
dialog p {
  font-size: 0.9rem;
}
textarea {
  width: 100%;
  resize: vertical;
  margin: 8px 0 0;
}
dialog button {
  margin-top: 12px;
}
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
#feedback-check {
  margin-top: 16px;
}
.error {
  color: #9a252e;
  font-size: 0.85rem;
  margin-top: 16px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: fixed;
  top: -100px;
  left: 16px;
  background: white;
  padding: 10px;
  z-index: 5;
}
.skip:focus {
  top: 10px;
}
:focus-visible {
  outline: 3px solid #c16c20;
  outline-offset: 3px;
}
::selection {
  background: #cde3f1;
  color: #14384b;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  scrollbar-color: #a1b4bf #f0f4f6;
}
input::-webkit-inner-spin-button {
  opacity: 1;
}
.year-panel {
  transition: background-color 0.18s ease-out;
}
@media (min-width: 1500px) {
  main {
    padding-top: 52px;
  }
}
@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
  }
  .inputs {
    padding: 20px;
  }
  .year-numbers {
    grid-template-columns: 1fr 1fr;
  }
  .rules-section {
    grid-template-columns: 300px 1fr;
    gap: 24px;
  }
  .comparison {
    font-size: 0.8rem;
  }
  .chart-section .section-heading {
    flex-wrap: wrap;
  }
  .local-note {
    max-width: 200px;
  }
}
@media (max-width: 760px) {
  :root {
    font-size: 17px;
  }
  .site-header {
    padding: 16px 20px;
    gap: 12px;
    min-height: 72px;
    flex-wrap: wrap;
  }
  .site-header > span {
    display: none;
  }
  .site-header > a:last-child {
    font-size: 0.88rem;
  }
  .brand {
    font-size: 1.15rem;
  }
  main {
    padding: 28px 20px 0;
  }
  .page-heading {
    display: block;
    margin-bottom: 28px;
  }
  .page-heading p {
    font-size: 0.94rem;
  }
  .local-note {
    margin-top: 16px;
    max-width: none;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .inputs {
    padding: 22px;
  }
  .results > .section-heading {
    flex-wrap: wrap;
  }
  .section-heading {
    gap: 12px;
  }
  .results .section-heading h2 {
    font-size: 1.1rem;
  }
  .results .section-heading button {
    font-size: 0.85rem;
    padding: 8px 12px;
  }
  .comparison {
    font-size: 0.88rem;
  }
  .comparison th {
    font-size: 0.82rem;
  }
  .comparison td {
    padding: 13px 6px;
  }
  .year-panel {
    padding: 20px;
  }
  .year-numbers {
    grid-template-columns: 1fr 1fr;
  }
  .year-numbers dd {
    font-size: 1.25rem;
  }
  .rules-section {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 32px;
    margin-top: 32px;
  }
  .rules-section h2 {
    max-width: 26ch;
  }
  .schedule-section {
    margin-top: 36px;
  }
  .schedule-section > .section-heading {
    align-items: flex-start;
  }
  .schedule-section button {
    font-size: 0.84rem;
    padding: 9px;
    white-space: nowrap;
  }
  .schedule-section h2 {
    font-size: 1.1rem;
  }
  .schedule-section .section-heading p {
    font-size: 0.8rem;
  }
  .notice {
    padding: 20px;
  }
  .legend {
    gap: 12px;
    font-size: 0.82rem;
  }
  .chart-section .section-heading {
    gap: 8px;
  }
  .chart-section select {
    max-width: 100%;
    width: auto;
  }
  footer {
    padding: 24px 20px;
    gap: 10px 20px;
  }
  #site-footer {
    width: 100%;
    order: 3;
  }
  .detail-list {
    font-size: 0.86rem;
  }
  .detail-list > div {
    gap: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
@media print {
  .site-header,
  .inputs,
  .local-note,
  footer,
  button,
  #chart-mode,
  .year-control {
    display: none !important;
  }
  body {
    background: white;
    font-size: 14px;
  }
  main {
    padding: 0;
    max-width: none;
  }
  .workspace {
    display: block;
  }
  .results {
    width: 100%;
  }
  .rules-section {
    display: block;
  }
  .chart-wrap {
    max-width: 650px;
  }
  .schedule {
    font-size: 12px;
  }
  .schedule td,
  .schedule th {
    padding: 7px;
  }
  .table-scroll {
    overflow: visible;
  }
  details {
    display: block;
  }
  .page-heading {
    margin-bottom: 20px;
  }
  .schedule-section {
    break-before: page;
  }
  .year-panel {
    break-inside: avoid;
  }
}
