*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f3f4f6;
  --text: #111827;
  --text-body: #374151;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;
  --heading: #0f172a;
  --card-bg: #fff;
  --header-bg: #0f172a;
  --border-subtle: #f1f5f9;
  --footer-color: #9ca3af;
  --code-badge-bg: #0f172a;
  --code-badge-color: #38bdf8;
  --breadcrumb-color: #9ca3af;
  --breadcrumb-link: #6b7280;
  --cost-row-border: #f1f5f9;
  --cost-range-color: #0f172a;
  --cta-bg: #f0f9ff;
  --cta-border: #bae6fd;
  --cta-heading: #0c4a6e;
  --cta-body: #374151;
  --also-see-bg: #f8fafc;
  --also-see-border: #e2e8f0;
  --also-see-color: #64748b;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --text: #e2e8f0;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --heading: #e2e8f0;
  --card-bg: #1e293b;
  --header-bg: #020617;
  --border-subtle: #1e293b;
  --footer-color: #64748b;
  --code-badge-bg: #1e293b;
  --code-badge-color: #38bdf8;
  --breadcrumb-color: #475569;
  --breadcrumb-link: #64748b;
  --cost-row-border: #1e293b;
  --cost-range-color: #e2e8f0;
  --cta-bg: #082f49;
  --cta-border: #0369a1;
  --cta-heading: #bae6fd;
  --cta-body: #cbd5e1;
  --also-see-bg: #1e293b;
  --also-see-border: #334155;
  --also-see-color: #94a3b8;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background-color 0.2s, color 0.2s;
}

/* Header */
header {
  background: var(--header-bg);
  color: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
}
header a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}
.logo span { color: #38bdf8; }
.beta-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(56,189,248,.15);
  color: #38bdf8;
  border: 1px solid rgba(56,189,248,.3);
  border-radius: 4px;
  padding: 2px 6px;
  vertical-align: middle;
  margin-left: 8px;
  position: relative;
  top: -2px;
}
.tagline {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}
.theme-toggle {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover { color: #e2e8f0; background: rgba(255,255,255,.08); }
.theme-toggle svg { width: 20px; height: 20px; }

/* Main layout */
main {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 16px 60px;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 12px;
  color: var(--breadcrumb-color);
  margin-bottom: 24px;
}
.breadcrumb a {
  color: var(--breadcrumb-link);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* Article */
article {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.code-badge {
  display: inline-block;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--code-badge-bg);
  color: var(--code-badge-color);
  border-radius: 6px;
  padding: 4px 10px;
  width: fit-content;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.25;
  letter-spacing: -0.3px;
  margin-top: 8px;
}

.subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Urgency bars */
.urgency-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}
.urgency-label {
  font-weight: 700;
  flex-shrink: 0;
}
.urgency-note {
  font-size: 13px;
  line-height: 1.4;
}
.urgency-high   { background: #fee2e2; color: #b91c1c; }
.urgency-medium { background: #fef9c3; color: #854d0e; }
.urgency-low    { background: #dcfce7; color: #15803d; }
[data-theme="dark"] .urgency-high   { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .urgency-medium { background: #713f12; color: #fde68a; }
[data-theme="dark"] .urgency-low    { background: #14532d; color: #86efac; }

/* Sections */
section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--heading);
}
section p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-body);
}

/* Causes list */
.causes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.causes li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-body);
  padding-left: 16px;
  position: relative;
}
.causes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
}
.causes li strong {
  color: var(--heading);
}

/* Cost table */
.cost-table {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  font-size: 14px;
  border-bottom: 1.5px solid var(--border-subtle);
}
.cost-row:last-child { border-bottom: none; }
.cost-row:nth-child(odd) { background: var(--card-bg); }
.cost-item { color: var(--text-body); }
.cost-range {
  font-weight: 700;
  color: var(--cost-range-color);
  white-space: nowrap;
  flex-shrink: 0;
}
.cost-note {
  font-size: 12px;
  color: var(--text-subtle);
  line-height: 1.5;
}

/* CTA box */
.cta-box {
  background: var(--cta-bg);
  border: 1.5px solid var(--cta-border);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cta-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--cta-heading);
}
.cta-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--cta-body);
}
.btn-cta {
  display: inline-block;
  padding: 11px 20px;
  background: #38bdf8;
  color: #0f172a;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  width: fit-content;
  transition: background 0.15s;
}
.btn-cta:hover { background: #7dd3fc; }

/* Also see */
.also-see {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 14px 16px;
  background: var(--also-see-bg);
  border: 1.5px solid var(--also-see-border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--also-see-color);
}
.also-see span { font-weight: 600; }
.also-see a {
  color: #0369a1;
  text-decoration: none;
}
.also-see a:hover { text-decoration: underline; }
[data-theme="dark"] .also-see a { color: #7dd3fc; }

/* Footer */
footer {
  text-align: center;
  font-size: 12px;
  color: var(--footer-color);
  line-height: 1.6;
  padding: 24px 16px 36px;
  max-width: 720px;
  margin: 0 auto;
}
footer a { color: var(--footer-color); }

@media (max-width: 480px) {
  h1 { font-size: 22px; }
  .cost-row { flex-direction: column; align-items: flex-start; gap: 4px; }
}
