:root {
  --accent: #2b6cb0;
  --accent-dark: #1a4971;
  --on-accent: #ffffff;
  --text: #1a1a1a;
  --muted: #4a5568;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --unconfirmed: #a0522d;
  --radius: 8px;
  --max-width: 760px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #5b9bd9;
    --accent-dark: #86b8e6;
    --on-accent: #0b1220;
    --text: #edf2f7;
    --muted: #a0aec0;
    --bg: #14181f;
    --bg-alt: #1c222c;
    --bg-card: #1c222c;
    --border: #2d3748;
    --unconfirmed: #f0a066;
  }
}

:root[data-theme="dark"] {
  --accent: #5b9bd9;
  --accent-dark: #86b8e6;
  --on-accent: #0b1220;
  --text: #edf2f7;
  --muted: #a0aec0;
  --bg: #14181f;
  --bg-alt: #1c222c;
  --bg-card: #1c222c;
  --border: #2d3748;
  --unconfirmed: #f0a066;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  overflow-x: hidden;
}

a {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent-dark);
  outline-offset: 2px;
}

header.site-header {
  padding: 24px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

header.site-header .container {
  max-width: var(--max-width);
  margin: 0 auto;
}

header.site-header h1 {
  font-size: 1.6rem;
  margin: 0 0 8px;
}

.site-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 8px;
}

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

.site-title a:hover {
  text-decoration: underline;
}

header.site-header p.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

nav.site-nav {
  max-width: var(--max-width);
  margin: 16px auto 0;
  padding: 0 10px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

nav.site-nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  padding: 12px 6px;
  min-height: 44px;
  box-sizing: border-box;
}

nav.site-nav a:hover {
  text-decoration: underline;
}

nav.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

nav.breadcrumb {
  max-width: var(--max-width);
  margin: 12px auto 0;
  padding: 0 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

nav.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

nav.breadcrumb li {
  display: flex;
  align-items: center;
}

nav.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin: 0 6px;
  color: var(--muted);
}

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

nav.breadcrumb a:hover {
  text-decoration: underline;
}

nav.breadcrumb li[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 16px 64px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.3rem;
  margin-top: 40px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

h3 {
  font-size: 1.1rem;
  margin-top: 28px;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9rem;
}

.table-scroll table {
  margin: 0;
}

th, td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--bg-alt);
}

blockquote {
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
  margin: 16px 0;
  padding: 12px 16px;
  font-size: 0.95rem;
}

.source-note {
  font-size: 0.82rem;
  color: var(--muted);
}

.disclaimer {
  display: block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin: 24px 0;
  font-size: 0.9rem;
}

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.card h3 {
  margin-top: 0;
}

.card a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

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

footer.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 48px;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

footer.site-footer a {
  color: var(--muted);
}

.unconfirmed {
  color: var(--unconfirmed);
}

.sim-form {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}

.sim-form label {
  display: block;
  font-size: 0.9rem;
  margin: 12px 0 4px;
  font-weight: 600;
}

.sim-form select {
  width: 100%;
  padding: 12px 8px;
  min-height: 44px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text);
}

.sim-form button {
  margin-top: 16px;
  padding: 12px 20px;
  min-height: 44px;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.sim-form button:hover {
  background: var(--accent-dark);
}

.sim-result {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  display: none;
}

.sim-result .amount {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

.sim-breakdown {
  font-size: 0.9rem;
  color: var(--muted);
}

.sim-note {
  font-size: 0.82rem;
  color: var(--unconfirmed);
}

@media (min-width: 420px) {
  .sim-form button {
    width: auto;
  }
}

.sim-chart {
  margin-top: 14px;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.chart-label {
  flex: 0 0 108px;
  text-align: right;
}

.chart-bar-wrap {
  flex: 1 1 auto;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  height: 14px;
  overflow: hidden;
}

.chart-bar {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}

.chart-value {
  flex: 0 0 auto;
  min-width: 76px;
  text-align: left;
}

.btn-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent) !important;
  text-decoration: none !important;
  font-weight: 700;
  padding: 12px 20px;
  min-height: 44px;
  line-height: 20px;
  border-radius: 6px;
  margin: 4px 0;
}

.btn-cta:hover {
  background: var(--accent-dark);
}

.faq-list {
  margin-top: 16px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
}

.faq-item h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1rem;
}

.faq-item p {
  margin: 0;
}

dl {
  margin: 16px 0;
}

dl dt {
  margin-top: 16px;
}

dl dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.last-updated {
  margin: 4px 0 0;
}

@media print {
  header.site-header,
  nav.site-nav,
  nav.breadcrumb,
  footer.site-footer,
  .disclaimer,
  .btn-cta {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  main {
    max-width: 100%;
    padding: 0;
  }

  table {
    font-size: 11pt;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #333;
  }
}
