:root {
  color-scheme: light;
  --navy: #0f172a;
  --navy-mid: #3a7eb0;
  --navy-light: #7eb6d6;
  --ink: #0f172a;
  --slate: #334155;
  --muted: #64748b;
  --paper: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --line-mid: #cbd5e1;
  --copper: #b45309;
  --copper-mid: #c9844a;
  --copper-deep: #92400e;
  --copper-wash: #fff7ed;
  --copper-wash-ink: var(--copper-deep);
  --copper-line: #fdba74;
  --copper-pulse: var(--copper);
  --fire-point-border: var(--copper-wash);
  --blue: #2563eb;
  --ss: #4ade80;
  --ss-ink: #16a34a;
  --rule: #7c3aed;
  --rule-ink: #6d28d8;
  --red: #dc2626;
  --gold: #ca8a04;
  --coast: #eab308;
  --coast-ink: #a16207;
  --coast-wash: #fefce8;
  --topbar-fg: #e2e8f0;
  --topbar-heading: #f8fafc;
  --topbar-lede: #94a3b8;
  --switch-border: #334155;
  --switch-bg: #1e293b;
  --switch-fg: #94a3b8;
  --switch-on-fg: #fff7ed;
  --overlay-fg: #e2e8f0;
  --overlay-strong: #fff;
  --tooltip-title: #fff7ed;
  --row-hover: #f1f5f9;
  --switch-paper-bg: var(--paper);
  --switch-paper-border: var(--line);
  --switch-paper-fg: var(--muted);
  --switch-paper-on-bg: var(--navy);
  --switch-paper-on-fg: var(--topbar-heading);
  --shadow: 0 10px 30px color-mix(in srgb, var(--navy) 12%, transparent);
  --sans: "Nunito", ui-sans-serif, system-ui, sans-serif;
  --stage-gap: 1.1rem;
  --stage-columns: repeat(3, minmax(0, 1fr));
}

[data-theme="night"] {
  color-scheme: dark;
  --ink: #e2e8f0;
  --slate: #cbd5e1;
  --muted: #94a3b8;
  --paper: #0f172a;
  --card: #1e293b;
  --line: #334155;
  --line-mid: #475569;
  --copper-wash: #431407;
  --copper-wash-ink: #fff7ed;
  --copper-line: #c9844a;
  --copper-pulse: var(--copper-mid);
  --fire-point-border: #fff;
  --tooltip-title: #f8fafc;
  --coast-wash: #422006;
  --row-hover: #334155;
  --switch-paper-bg: #0b1220;
  --switch-paper-border: var(--line-mid);
  --switch-paper-fg: #64748b;
  --switch-paper-on-bg: #475569;
  --switch-paper-on-fg: #f8fafc;
  --shadow: 0 10px 30px color-mix(in srgb, #000 35%, transparent);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
  background: var(--paper);
  overflow-x: clip;
}

body {
  margin: 0 auto;
  width: 100%;
  max-width: 1120px;
  padding: 0 1.25rem 4rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: clip;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  align-items: center;
  margin: 0 -1.25rem 1.5rem;
  padding: 1.35rem 1.5rem 1.4rem;
  background: var(--navy);
  color: var(--topbar-fg);
}

.brand {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.mark-btn {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  line-height: 0;
  flex-shrink: 0;
}

.mark-btn:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

.mark {
  display: block;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  background: var(--copper);
  overflow: hidden;
}

.mark-threshold,
.mark-portfolio,
.mark-spark {
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark-threshold {
  stroke-width: 1.55;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.mark-portfolio {
  stroke-width: 1.6;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.mark-spark {
  stroke-width: 1.25;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.mark-fire {
  fill: #fff;
  stroke: var(--copper-deep);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
}

.mark-btn.is-playing .mark-fire {
  opacity: 0;
  visibility: hidden;
  transform: scale(0);
}

.mark-sparks {
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .mark-btn.is-playing {
    --mark-draw: 0.66s;
    --mark-handoff: 0.44s;
    --mark-fire-at: calc(var(--mark-handoff) + var(--mark-draw));
  }

  .mark-btn.is-playing .mark-threshold,
  .mark-btn.is-playing .mark-portfolio {
    stroke-linecap: butt;
  }

  .mark-btn.is-playing .mark-threshold {
    stroke-dashoffset: 1;
    animation: mark-line-draw var(--mark-draw) cubic-bezier(0.45, 0, 1, 1) forwards;
  }

  .mark-btn.is-playing .mark-portfolio {
    stroke-dashoffset: 1;
    animation: mark-line-draw var(--mark-draw) cubic-bezier(0.45, 0, 1, 1) var(--mark-handoff) forwards;
  }

  .mark-btn.is-playing .mark-fire {
    animation: mark-fire-pop 0.3s var(--mark-fire-at) cubic-bezier(0.34, 1.45, 0.64, 1) forwards;
  }

  .mark-btn.is-playing .mark-spark {
    animation: mark-spark-ray 0.34s var(--mark-fire-at) ease-out forwards;
  }

  .mark-btn.is-playing .mark-spark:nth-child(2),
  .mark-btn.is-playing .mark-spark:nth-child(6) {
    animation-delay: calc(var(--mark-fire-at) + 0.02s);
  }

  .mark-btn.is-playing .mark-spark:nth-child(4),
  .mark-btn.is-playing .mark-spark:nth-child(8) {
    animation-delay: calc(var(--mark-fire-at) + 0.03s);
  }
}

@keyframes mark-line-draw {
  from {
    stroke-dashoffset: 1;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes mark-fire-pop {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
  }

  50% {
    opacity: 1;
    visibility: visible;
    transform: scale(1.38);
  }

  100% {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }
}

@keyframes mark-spark-ray {
  0% {
    opacity: 0;
    stroke-dashoffset: 1;
  }

  28% {
    opacity: 1;
    stroke-dashoffset: 0;
  }

  100% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
}

h1 {
  margin: 0;
  color: var(--topbar-heading);
  font-family: var(--sans);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.15;
}

h2 {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
}

.lede {
  margin: 0;
  color: var(--topbar-lede);
  font-size: 0.92rem;
  line-height: 1.2;
}

.footbar {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin: 2rem -1.25rem 0;
  padding: 1.15rem 1.5rem 1.3rem;
  background: var(--navy);
  color: #e2e8f0;
}

.footbar-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem 1.5rem;
}

.footbar-copyright {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0;
  color: var(--topbar-heading);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.footbar-copy {
  color: var(--topbar-heading);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1;
}

#footbar-year {
  color: var(--topbar-heading);
  font-variant-numeric: tabular-nums;
}

.footbar-copyright-sep {
  color: #64748b;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

.footbar-author {
  color: #64748b;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.footbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem 1rem;
}

.footbar-coffee {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.4rem 0.85rem 0.34rem;
  border: 1px solid rgba(13, 12, 34, 0.08);
  border-radius: 999px;
  background: #ffdd00;
  color: #0d0c22;
  font-family: "Cookie", cursive;
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s ease;
}

.footbar-coffee-mark {
  width: 0.95rem;
  height: auto;
  flex-shrink: 0;
}

.footbar-coffee:hover,
.footbar-coffee:focus-visible {
  background: #f5d400;
  color: #0d0c22;
}

.footbar-coffee:focus-visible {
  outline: 2px solid #ffdd00;
  outline-offset: 2px;
}

.footbar-social {
  display: flex;
  gap: 0.45rem;
}

.footbar-social-link {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.footbar-social-link svg {
  width: 0.95rem;
  height: 0.95rem;
}

.footbar-social-link:hover,
.footbar-social-link:focus-visible {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.14);
}

.footbar-social-link:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.footbar-disclaimer {
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.footbar-disclaimer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.footbar-disclaimer-heading {
  margin: 0;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footbar-disclaimer-toggle {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.footbar-disclaimer-toggle svg {
  width: 0.95rem;
  height: 0.95rem;
  transition: transform 0.15s ease;
}

.footbar-disclaimer-toggle.is-expanded svg {
  transform: rotate(180deg);
}

.footbar-disclaimer-toggle:hover,
.footbar-disclaimer-toggle:focus-visible {
  color: #cbd5e1;
}

.footbar-disclaimer-toggle:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.footbar-disclaimer-intro,
.footbar-disclaimer-more p {
  margin: 0 0 0.65rem;
  color: #94a3b8;
  font-size: 0.76rem;
  line-height: 1.55;
}

.footbar-disclaimer-intro {
  padding-top: 0.55rem;
}

.footbar-disclaimer-more {
  padding-top: 0.1rem;
}

.footbar-disclaimer-more p:last-child {
  margin-bottom: 0;
}

.share-dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.share-dialog[hidden] {
  display: none;
}

html.share-dialog-open {
  overflow: hidden;
}

.share-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  border: 0;
  background: color-mix(in srgb, var(--navy) 68%, transparent);
  backdrop-filter: blur(2px);
}

.share-dialog-panel {
  position: relative;
  width: min(100%, 28rem);
  max-height: min(92vh, 40rem);
  overflow: auto;
  padding: 1.15rem 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.share-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.share-dialog-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.share-dialog-close {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.share-dialog-close svg {
  width: 1rem;
  height: 1rem;
}

.share-dialog-close:hover,
.share-dialog-close:focus-visible {
  color: var(--ink);
  background: var(--row-hover);
}

.share-dialog-close:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.share-social-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem 0.45rem;
  margin-bottom: 1.1rem;
}

.share-social-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.2rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.share-social-btn:hover,
.share-social-btn:focus-visible {
  background: var(--row-hover);
}

.share-social-btn:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.share-social-btn[disabled],
.share-social-btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.share-social-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  color: #fff;
}

.share-social-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.share-social-icon--whatsapp {
  background: #25d366;
}

.share-social-icon--messenger {
  background: linear-gradient(135deg, #00b2ff, #a033ff, #ff5280, #ff7061);
}

.share-social-icon--telegram {
  background: #229ed9;
}

.share-social-icon--email {
  background: var(--navy);
  color: #f8fafc;
}

.share-social-label {
  color: var(--slate);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.share-link-block {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.share-link-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.share-link-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.share-link-input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--line-mid);
  border-radius: 0.65rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
}

.share-link-copy {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.62rem 0.95rem;
  border: 1px solid var(--copper-line);
  border-radius: 0.65rem;
  background: var(--copper-wash);
  color: var(--copper-wash-ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.share-link-copy:hover,
.share-link-copy:focus-visible {
  border-color: var(--copper);
  background: var(--copper-deep);
  color: #fff7ed;
}

.share-link-copy:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.share-link-copy:disabled {
  opacity: 0.55;
  cursor: wait;
}

.share-copy-feedback {
  margin: 0.55rem 0 0;
  color: var(--ss-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.share-copy-feedback[hidden] {
  display: none;
}

.chrome {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.chrome-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.chrome-action-btn {
  display: grid;
  place-items: center;
  width: calc(1.7rem + 0.36rem + 2px);
  height: calc(1.7rem + 0.36rem + 2px);
  margin: 0;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.chrome-action-btn svg {
  width: 0.95rem;
  height: 0.95rem;
}

.chrome-action-btn:hover,
.chrome-action-btn:focus-visible {
  border-color: #b45309;
  background: #431407;
  color: #fff7ed;
}

.chrome-action-btn:focus-visible {
  outline: 2px solid #b45309;
  outline-offset: 2px;
}

.chrome-action-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.switch {
  display: flex;
  padding: 0.18rem;
  border: 1px solid var(--switch-border);
  border-radius: 999px;
  background: var(--switch-bg);
}

.switch-btn {
  display: grid;
  place-items: center;
  min-width: 2rem;
  height: 1.7rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--switch-fg);
  font: 700 0.72rem/1 var(--sans);
  letter-spacing: 0.04em;
}

.switch-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

.switch-btn.is-on {
  background: var(--copper);
  color: var(--switch-on-fg);
}

.switch-btn:not(:disabled) {
  cursor: pointer;
}

.switch-btn:disabled {
  cursor: default;
  opacity: 1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.panel-head h2 {
  margin: 0;
}

.table-expand-wrap[hidden] {
  display: none;
}

.table-expand-wrap .table-expand {
  display: grid;
  place-items: center;
  width: calc(1.7rem + 0.36rem + 2px);
  height: calc(1.7rem + 0.36rem + 2px);
  border: 1px solid var(--line-mid);
  background: var(--paper);
  color: var(--muted);
  box-shadow: none;
  cursor: pointer;
}

.table-expand-wrap .table-expand svg {
  width: 0.95rem;
  height: 0.95rem;
  transition: transform 0.15s ease;
}

.table-expand-wrap .table-expand.is-expanded svg {
  transform: rotate(180deg);
}

.table-expand-wrap .table-expand:hover,
.table-expand-wrap .table-expand:focus-visible {
  border-color: var(--copper);
  background: var(--copper-wash);
  color: var(--copper-wash-ink);
}

.projection-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.projection-compares {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tool-pair,
.units-control {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.projection-tools .switch-btn {
  cursor: pointer;
}

.switch-paper {
  border-color: var(--switch-paper-border);
  background: var(--switch-paper-bg);
}

.switch-paper .switch-btn {
  color: var(--switch-paper-fg);
  cursor: pointer;
}

.switch-paper .switch-btn.is-on {
  background: var(--switch-paper-on-bg);
  color: var(--switch-paper-on-fg);
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hint {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  z-index: 1;
}

.hint-btn {
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font: 700 0.68rem/1 var(--sans);
  cursor: help;
}

.units-control .hint-btn {
  width: calc(1.7rem + 0.36rem + 2px);
  height: calc(1.7rem + 0.36rem + 2px);
  font-size: 1rem;
  border-color: var(--copper);
  background: var(--copper-wash);
  color: var(--copper-wash-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--copper-pulse) 22%, transparent);
  animation: units-hint-pulse 2.6s ease-in-out infinite;
}

@keyframes units-hint-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--copper-pulse) 18%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--copper-pulse) 30%, transparent);
  }
}

.units-control .hint-btn:hover,
.units-control .hint-btn:focus-visible {
  border-color: var(--copper-mid);
  color: var(--copper-wash-ink);
}

.units-control .hint-btn.is-seen {
  animation: none;
  border-color: var(--line-mid);
  background: var(--paper);
  color: var(--muted);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .units-control .hint-btn {
    animation: none;
  }
}

.hint-btn:hover,
.hint-btn:focus-visible {
  border-color: var(--copper);
  color: var(--copper-deep);
}

.hint-pop {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  width: 16.75rem;
  max-width: calc(100vw - 1.5rem);
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: var(--navy);
  color: var(--overlay-fg);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.hint-pop strong {
  font-weight: 800;
  color: var(--overlay-strong);
}

.field > span label {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.hint:has(.hint-pop.is-open) {
  z-index: 42;
}

.hint-pop.is-open {
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: var(--stage-columns);
  gap: var(--stage-gap);
  margin-bottom: 1.1rem;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--copper);
  border-radius: 12px;
  padding: 0.95rem 1.1rem 1.05rem;
  box-shadow: var(--shadow);
}

.stat-label {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--ink);
}

.stat-unit {
  margin-left: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.stat-note {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--muted);
}

.stat-note + .stat-note {
  margin-top: 0.2rem;
}

.stat-note-value {
  font-weight: 800;
  color: var(--ink);
}

.stat-coast {
  border-top-color: var(--coast);
}

.stat-ss {
  border-top-color: var(--ss);
}

.stat-rule {
  border-top-color: var(--rule);
}

.stat[hidden] {
  display: none;
}

.compare-slider {
  margin-top: 0.7rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem 1.3rem 1.3rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
}

.plan-split {
  display: grid;
  grid-template-columns: var(--stage-columns);
  gap: var(--stage-gap);
  margin-bottom: 1.1rem;
  align-items: stretch;
}

.plan-split > .panel {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.plan-split > .panel:first-child {
  grid-column: span 2;
}

.market-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 0.85rem;
}

.plan-warning {
  margin: 0 0 1.1rem;
  padding: 0.85rem 1.1rem 0.95rem;
  border: 1px solid var(--copper-line);
  border-left-width: 4px;
  border-left-color: var(--copper);
  border-radius: 12px;
  background: var(--copper-wash);
  color: var(--copper-wash-ink);
  box-shadow: var(--shadow);
}

.plan-warning[hidden] {
  display: none;
}

.plan-warning strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.plan-warning ul {
  margin: 0;
  padding-left: 1.15rem;
}

.plan-warning li {
  margin: 0.18rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.field.is-invalid input {
  border-color: var(--copper);
  background: var(--copper-wash);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "age life"
    "pension balance"
    "contribution raise";
  gap: 1.15rem 1.25rem;
  align-items: start;
}

.plan-age { grid-area: age; }
.plan-life { grid-area: life; }
.plan-pension { grid-area: pension; }
.plan-balance { grid-area: balance; }
.plan-contribution { grid-area: contribution; }
.plan-raise { grid-area: raise; }

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--slate);
}

.field > span {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
}

.field em {
  font-style: normal;
  color: var(--copper);
  font-variant-numeric: tabular-nums;
}

input,
select {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.58rem 0.7rem;
}

input:focus,
select:focus {
  outline: 2px solid color-mix(in srgb, var(--copper) 35%, transparent);
  border-color: var(--copper);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 1.15rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--copper);
}

input[type="range"]:focus {
  outline: none;
  border-color: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 0 2px var(--card);
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--line);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 0 2px var(--card);
  cursor: pointer;
}

.chart-panel {
  padding-bottom: 1.1rem;
}

.chart-wrap {
  position: relative;
  height: 400px;
  overflow: visible;
}

.table-note {
  margin: -0.35rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  min-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: right;
  padding: 0.62rem 0.7rem;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

th:nth-child(1),
th:nth-child(2),
td:nth-child(1),
td:nth-child(2) {
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: var(--row-hover);
}

tr.fire-row,
tr.fire-row:hover {
  background: var(--copper-wash);
  color: var(--copper-wash-ink);
  font-weight: 700;
}

tbody tr:has(+ tr.fire-row) td,
tr.fire-row td {
  border-bottom-color: var(--copper-line);
}

tr.fire-row td {
  border-top: 1px solid var(--copper-line);
}

tr.table-gap td {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  border-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  min-width: 12rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: var(--navy);
  color: var(--overlay-fg);
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(14px, -110%);
  transition: opacity 0.08s ease;
}

.chart-tooltip.is-open {
  opacity: 1;
}

.chart-tooltip.is-compact {
  min-width: 0;
  width: max-content;
  max-width: min(13.5rem, calc(100% - 0.75rem));
  padding: 0.4rem 0.5rem;
  font-size: 0.7rem;
  line-height: 1.3;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
}

.chart-tooltip.is-compact .title {
  font-size: 0.74rem;
}

.chart-tooltip.is-compact .status {
  margin: 0.12rem 0 0.22rem;
  font-size: 0.7rem;
}

.chart-tooltip.is-compact .row {
  margin: 0.06rem 0 0;
  gap: 0.35rem;
  font-size: 0.7rem;
}

.chart-tooltip.is-compact .swatch {
  flex: 0 0 0.5rem;
  width: 0.5rem;
  height: 0.5rem;
}

.chart-tooltip.is-fire {
  background: var(--copper-mid);
  color: #fff;
}

.chart-tooltip .title {
  margin: 0;
  color: var(--tooltip-title);
  font-size: 0.88rem;
  font-weight: 800;
}

.chart-tooltip.is-fire .title {
  color: #fff;
}

.chart-tooltip .status {
  margin: 0.3rem 0 0.45rem;
}

.chart-tooltip.is-fire .status {
  font-weight: 800;
  color: #fff;
}

.chart-tooltip .row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.15rem 0 0;
  font-weight: 500;
}

.chart-tooltip .row.focus {
  font-weight: 800;
  color: #fff;
}

.chart-tooltip .swatch {
  flex: 0 0 0.65rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}

@media (max-width: 960px) {
  .plan-split,
  .stats {
    grid-template-columns: 1fr;
  }

  .plan-split > .panel:first-child {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .topbar {
    align-items: stretch;
    gap: 0.85rem;
    margin-inline: -1rem;
    padding: 1rem 1rem 1.05rem;
  }

  .brand {
    min-width: 0;
  }

  h1 {
    font-size: 1.35rem;
  }

  .lede {
    font-size: 0.82rem;
  }

  .chrome {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    width: 100%;
    gap: 0.45rem;
  }

  .chrome-actions {
    justify-self: start;
  }

  .footbar-top {
    align-items: flex-start;
  }

  .footbar-meta {
    width: 100%;
    justify-content: space-between;
  }

  .footbar-social {
    flex-wrap: wrap;
  }

  .plan-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "age"
      "life"
      "pension"
      "balance"
      "contribution"
      "raise";
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .chart-panel .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .projection-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .units-control {
    order: -1;
    justify-content: center;
  }

  .projection-compares {
    justify-content: center;
    gap: 0.45rem;
  }

  .chart-panel {
    padding-bottom: 0.75rem;
  }

  .chart-wrap {
    height: min(22rem, 72vw);
  }

  .table-wrap:not(.is-expanded) th:nth-child(3),
  .table-wrap:not(.is-expanded) td:nth-child(3),
  .table-wrap:not(.is-expanded) th:nth-child(4),
  .table-wrap:not(.is-expanded) td:nth-child(4) {
    display: none;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 0.55rem 0.5rem;
    font-size: 0.82rem;
  }

  .share-social-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share-link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .share-link-copy {
    width: 100%;
  }
}

/* Off-screen stage for the PDF chart. It must keep real layout (no
   display:none), otherwise Chart.js cannot measure it and renders at 0x0. */
.chart-capture-stage {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 720px;
  height: 400px;
  visibility: hidden;
  pointer-events: none;
}

.chart-capture-stage canvas {
  display: block;
}

.chart-capture-probe {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  --navy: #0f172a;
  --navy-mid: #3a7eb0;
  --navy-light: #7eb6d6;
  --slate: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-mid: #cbd5e1;
  --copper: #b45309;
  --copper-mid: #c9844a;
  --copper-deep: #92400e;
  --copper-wash: #fff7ed;
  --fire-point-border: #fff7ed;
  --blue: #2563eb;
  --ss: #4ade80;
  --ss-ink: #16a34a;
  --coast: #eab308;
  --coast-ink: #a16207;
  --coast-wash: #fefce8;
  --rule: #7c3aed;
  --rule-ink: #6d28d8;
}

#print-report {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 794px;
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
}

#print-report.is-capturing {
  visibility: visible;
}

.print-report-inner {
  color: #0f172a;
  background: #fff;
  font-family: var(--sans);
  font-size: 10pt;
  line-height: 1.45;
  /* Mobile browsers inflate long text blocks that are wider than the viewport
     (font boosting). The report is always laid out at A4 width, so opt out. */
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.print-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 0.55rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

.print-report-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.print-report-mark {
  display: block;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
}

.print-report-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.print-report-brand-text h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #f8fafc;
}

.print-report-lede {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #94a3b8;
}

.print-report-meta {
  margin: 0;
  flex-shrink: 0;
  text-align: right;
  color: #94a3b8;
  font-size: 0.85rem;
  white-space: nowrap;
}

.print-report-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.print-report-input-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
}

.print-report-input-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 3rem;
}

.print-report-dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
}

.print-report-dl dt {
  margin: 0;
  color: #64748b;
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.25;
}

.print-report-dl dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.print-report-input-block h2,
.print-report-section h2 {
  margin: 0 0 0.65rem;
  padding-left: 0;
  border-left: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.print-report-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.print-report-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: 3px solid #b45309;
  border-radius: 12px;
  padding: 0.75rem 0.9rem 0.85rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.print-report-stat-ss {
  border-top-color: #4ade80;
}

.print-report-stat-coast {
  border-top-color: #eab308;
}

.print-report-stat-rule {
  border-top-color: #7c3aed;
}

.print-report-stat-label {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.print-report-stat-value {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  color: #0f172a;
}

.print-report-stat-unit {
  margin-left: 0.2rem;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #64748b;
  white-space: nowrap;
}

.print-report-stat-note {
  margin: 0.45rem 0 0;
  font-size: 0.62rem;
  font-weight: 400;
  line-height: 1.25;
  color: #64748b;
}

.print-report-stat-note + .print-report-stat-note {
  margin-top: 0.15rem;
}

.print-report-stat-note-label {
  font-weight: 400;
}

.print-report-stat-note-value {
  font-weight: 800;
  color: #0f172a;
}

.print-report-section {
  margin-bottom: 1.25rem;
}

.print-report-chart {
  margin-bottom: 1rem;
}

.print-report-chart-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 400;
}

.print-report-table {
  break-before: page;
  page-break-before: always;
  padding-top: 2px;
  background: #fff;
}

.print-report-table-note {
  margin: 0 0 0.65rem;
  color: #64748b;
  font-size: 0.8rem;
}

.print-report-table-wrap {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.print-report-table-wrap table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.print-report-table-wrap th,
.print-report-table-wrap td {
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid #edf2f7;
  text-align: right;
}

.print-report-table-wrap th:first-child,
.print-report-table-wrap td:first-child,
.print-report-table-wrap th:nth-child(2),
.print-report-table-wrap td:nth-child(2) {
  text-align: left;
}

.print-report-table-wrap thead th {
  background: #0f172a;
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: none;
  border-bottom: none;
  padding-top: 0.68rem;
  padding-bottom: 0.68rem;
}

.print-report-table-wrap thead th:first-child {
  border-top-left-radius: 13px;
}

.print-report-table-wrap thead th:last-child {
  border-top-right-radius: 13px;
}

.print-report-table-wrap tbody tr:last-child td {
  border-bottom: none;
}

.print-report-table-wrap tbody tr:last-child td:first-child {
  border-bottom-left-radius: 13px;
}

.print-report-table-wrap tbody tr:last-child td:last-child {
  border-bottom-right-radius: 13px;
}

.print-report-table-wrap tbody tr.fire-row-before td {
  border-bottom: none;
}

.print-report-table-wrap tr.fire-row td {
  border-top: 1px solid #fdba74;
  border-bottom-color: #fdba74;
}

.print-report-table-wrap tr.fire-row {
  background: #fff7ed;
  color: #92400e;
  font-weight: 700;
}

.print-report-table-wrap tr.table-gap td {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  border-top: none;
  border-bottom: none;
  text-align: center;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.35em;
}

.print-report-disclaimer {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.print-report-disclaimer p {
  margin: 0;
  color: #64748b;
  font-size: 8pt;
  line-height: 1.45;
}
