:root {
  --text: #111111;
  --muted: #6b7280;
  --border: #e5e7eb;
  --dash: #cfcfcf;
  --nav: #6b7280;
  --bg: #ffffff;
  --btn-border: #d1d5db;
  --focus: #111111;
  --home-width: 64rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.75rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.logo-mark {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--text);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.4rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--nav);
  font: inherit;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}

.nav-btn:hover {
  color: var(--text);
  background: #f4f4f5;
}

.nav-btn:focus-visible,
.brand:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.nav-btn.is-active {
  color: var(--text);
  font-weight: 600;
}

.page {
  flex: 1;
  padding: 1.5rem 1.25rem 3rem;
}

.hero {
  max-width: var(--home-width);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 4.75rem;
  border: 1.5px dashed var(--dash);
  border-radius: 1.35rem;
  text-align: center;
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.65rem, 3vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero .lede {
  margin: 0 auto 1.6rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

.home-browse {
  max-width: var(--home-width);
  margin: 2.5rem auto 0;
}

.browse-section + .browse-section {
  margin-top: 1.75rem;
}

.browse-section h2 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.topics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.topic-card {
  display: flex;
  text-decoration: none;
  border: 1px solid var(--btn-border);
  border-radius: 1rem;
  background: #ffffff;
  color: var(--text);
}

.topic-card:hover {
  background: #f9fafb;
  border-color: #c4c9d1;
}

.topic-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.topic-card-featured {
  flex-direction: column;
  align-items: flex-start;
  min-height: 8.5rem;
  padding: 0.95rem 1rem 1.05rem;
}

.topic-card-featured h3 {
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}

.topic-card-featured p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.topic-card-compact {
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.15rem;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.article-page {
  max-width: 42rem;
  margin: 0 auto;
}

.article-page h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 3vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.article-lede,
.article-source {
  color: var(--muted);
  font-size: 0.95rem;
}

.article-page h2 {
  margin: 0 0 0.7rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.article-lede {
  margin: 0 0 1.5rem;
}

.article-source {
  margin: 0 0 1.75rem;
}

.article-source a {
  color: var(--text);
}

.qa-list {
  display: grid;
  gap: 1.25rem;
  margin: 0 0 2rem;
}

.qa-item h2 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.qa-item p,
.qa-item ul {
  margin: 0;
  color: var(--text);
}

.qa-item p + p,
.qa-item p + ul {
  margin-top: 0.7rem;
}

.qa-item ul {
  padding-left: 1.15rem;
}

.qa-item li + li {
  margin-top: 0.35rem;
}

.article-checklist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-checklist li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.55rem;
}

.article-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 0.7rem;
  height: 0.7rem;
  border: 1.5px solid var(--btn-border);
  border-radius: 0.2rem;
}

.guides-page {
  max-width: 40rem;
  margin: 0 auto;
}

.guides-page h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.55rem, 3vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.guides-lede {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.article-meta p {
  margin: 0;
}

.estimate-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  background: #f9fafb;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}

.article-body p,
.article-body ul,
.article-body ol {
  margin: 0 0 0.9rem;
}

.article-body h2 {
  margin: 1.35rem 0 0.5rem;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body ul,
.article-body ol {
  padding-left: 1.15rem;
}

.article-body li + li {
  margin-top: 0.35rem;
}

.article-body table {
  width: 100%;
  margin: 0 0 1.15rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article-body th,
.article-body td {
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--btn-border);
  text-align: left;
}

.article-body pre {
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--btn-border);
  border-radius: 0.75rem;
  background: #f9fafb;
  font-size: 0.9rem;
}

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.article-sources {
  margin-top: 2rem;
}

.article-sources ol {
  margin: 0;
  padding-left: 1.2rem;
}

.article-sources li + li {
  margin-top: 0.4rem;
}

.article-sources a {
  color: var(--text);
}

.calculator-cta {
  margin-top: 1.75rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--btn-border);
  border-radius: 1rem;
}

.calculator-cta p {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.follow-up {
  margin-top: 1.5rem;
}

.guide-topic-group {
  margin: 0 0 1.75rem;
}

.guide-topic-group h2 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.guide-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-rows li + li {
  margin-top: 0.7rem;
}

.guide-row {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--btn-border);
  border-radius: 1rem;
  text-decoration: none;
}

.guide-row:hover {
  background: #f9fafb;
  border-color: #c4c9d1;
}

.guide-row:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.guide-row-title {
  font-weight: 600;
}

.guide-row-description,
.guide-row-updated {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.2rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: #111111;
  color: #ffffff;
  border: 1px solid #111111;
}

.btn-primary:hover {
  background: #2a2a2a;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--btn-border);
}

.btn-secondary:hover {
  background: #f9fafb;
}

.coming-soon {
  max-width: 40rem;
  margin: 5rem auto 0;
  text-align: center;
}

.coming-soon h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.coming-soon p {
  margin: 0;
  color: var(--muted);
}

.calculator-page {
  max-width: 68rem;
  margin: 0 auto;
}

.calculator-page h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 3vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.calculator-meta {
  margin: 0 0 1rem;
}

.step-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

.step-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 0.88rem;
}

.step-chip.is-current {
  background: #ffffff;
  color: var(--text);
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
  gap: 1.25rem;
  align-items: start;
}

.estimator-card,
.result-card {
  border: 1px solid var(--btn-border);
  border-radius: 1.1rem;
  background: #ffffff;
}

.estimator-card {
  padding: 1.5rem 1.4rem 1.25rem;
}

.estimator-fieldset {
  border: 0;
  margin: 0 0 1.35rem;
  padding: 0;
  min-width: 0;
}

.estimator-fieldset legend {
  padding: 0;
  margin-bottom: 0.7rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.choice-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.55rem 1.05rem;
  border: 1.5px solid var(--btn-border);
  border-radius: 0.85rem;
  background: #f9fafb;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.choice-chip:has(input) {
  position: relative;
}

.choice-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-chip:hover,
.choice-chip:has(input:focus-visible),
.choice-chip:focus-visible {
  border-color: #9ca3af;
}

.choice-chip:has(input:checked),
.choice-chip.is-selected {
  background: #ffffff;
  border-color: #111111;
  border-width: 2px;
}

.earlier-year-wrap {
  margin-top: 0.75rem;
}

.earlier-year-wrap label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.earlier-year-wrap input,
.dollar-field input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--btn-border);
  border-radius: 0.85rem;
  font: inherit;
  font-size: 1.05rem;
}

.dollar-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
  padding: 0.15rem 0.9rem;
  border: 1.5px solid var(--btn-border);
  border-radius: 0.85rem;
}

.dollar-field span {
  color: var(--muted);
  font-weight: 600;
}

.dollar-field input {
  border: 0;
  padding: 0.7rem 0;
  border-radius: 0;
}

.earlier-year-wrap input:focus,
.dollar-field:focus-within,
.choice-chip:has(input:focus-visible),
.estimate-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.dollar-field input:focus {
  outline: none;
}

.helper,
.estimator-footnote,
.disclaimer {
  color: var(--muted);
  font-size: 0.9rem;
}

.helper {
  margin: 0.85rem 0 0;
}

.estimate-btn {
  width: 100%;
  padding: 0.95rem 1.2rem;
  border-radius: 0.85rem;
  font-size: 1.05rem;
}

.estimator-footnote {
  margin: 1rem 0 0;
  font-style: italic;
  text-align: center;
}

.estimator-results {
  display: grid;
  gap: 0.9rem;
}

.estimator-results[hidden] {
  display: none;
}

.result-card {
  padding: 1.15rem 1.2rem;
}

.result-card h2 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.result-value {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.disclaimer {
  margin: 0.15rem 0 0;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.15rem;
}

.footer-link {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.footer-link:hover {
  color: var(--text);
}

.footer-link:focus-visible,
.dialog-close:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.footer-copy {
  flex-shrink: 0;
}

.legal-dialog {
  width: min(28rem, calc(100% - 2rem));
  padding: 1.35rem 1.3rem 1.2rem;
  border: 1px solid var(--btn-border);
  border-radius: 1.1rem;
  box-shadow: 0 18px 40px rgba(17, 17, 17, 0.12);
}

.legal-dialog::backdrop {
  background: rgba(17, 17, 17, 0.35);
}

.legal-dialog h2 {
  margin: 0 1.75rem 0.7rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.legal-dialog ul {
  margin: 0 0 1.15rem;
  padding-left: 1.15rem;
  color: var(--muted);
}

.legal-dialog li + li {
  margin-top: 0.4rem;
}

.dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.dialog-close:hover {
  background: #f9fafb;
}

@media (max-width: 800px) {
  .calculator-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer {
    padding: 0.9rem 1rem;
    flex-wrap: wrap;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hero {
    padding: 3rem 1rem 3.25rem;
  }

  .start-grid,
  .topics-grid {
    grid-template-columns: 1fr;
  }

  .topic-card-featured {
    min-height: 0;
  }
}

/* ── Article reading comfort (guide pages) ────────────────── */

.article-body {
  font-size: 1.02rem;
  line-height: 1.7;
}

.article-body > p:first-of-type {
  font-size: 1.1rem;
  color: var(--muted);
}

.article-body h2 {
  margin-top: 2.25rem;
}

.article-body h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.article-body a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: var(--dash);
}

.article-body a:hover {
  text-decoration-color: var(--text);
}

.article-body blockquote {
  margin: 0 0 1.15rem;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--text);
  border-radius: 0 0.6rem 0.6rem 0;
  background: #f9fafb;
  color: var(--muted);
  font-size: 0.95rem;
}

.article-body blockquote p {
  margin: 0;
}

.article-body li.task {
  list-style: none;
  padding-left: 0.1rem;
}

.article-body li.task label {
  cursor: pointer;
}

.article-body li.task label :not(input) {
  cursor: auto;
}

.article-body li.task input {
  margin-right: 0.5rem;
  accent-color: var(--text);
  transform: translateY(0.1rem);
}

.article-body li.task input:checked + * {
  color: var(--muted);
  text-decoration: line-through;
}

.article-body .table-wrap {
  overflow-x: auto;
  margin: 0 0 1.15rem;
  border: 1px solid var(--btn-border);
  border-radius: 0.75rem;
}

.article-body .table-wrap table {
  margin: 0;
  border: 0;
  font-size: 0.92rem;
  min-width: 100%;
}

.article-body .table-wrap th,
.article-body .table-wrap td {
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  white-space: nowrap;
}

.article-body .table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.article-body .table-wrap thead th {
  position: sticky;
  top: 0;
  background: #f3f4f6;
  font-weight: 600;
  text-align: left;
}

.article-body .table-wrap tbody tr:nth-child(even) td {
  background: #fafafa;
}

.toc {
  margin: 0 0 1.5rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fafafa;
  font-size: 0.92rem;
}

.toc summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}

.toc ul {
  margin: 0.6rem 0 0;
  padding-left: 1.15rem;
}

.toc li + li {
  margin-top: 0.3rem;
}

.toc a {
  color: var(--text);
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}
