:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --plane: #f1f2f5;
  --ink: #1d2433;
  --ink-2: #4b5363;
  --muted: #7a8292;
  --grid: #e4e6eb;
  --axis: #c3c7cf;
  --hair: rgba(29, 36, 51, 0.13);
  --track: #d3d7de;
  --s-lg: #2a78d6;   /* larger stars: hotter, bluer */
  --s-rd: #eb6834;   /* red dwarfs */
  --s-col: #1baf7a;  /* colonists */
  --settled: rgba(122, 130, 146, 0.16);
  --hostile: rgba(29, 36, 51, 0.10);
  --warn: #b42b2b;
  --warn-wash: rgba(208, 59, 59, 0.07);
  --focus: #2a78d6;
  --shadow: 0 6px 22px rgba(20, 26, 40, 0.14);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface: #141821;
    --plane: #1b2030;
    --ink: #eef1f7;
    --ink-2: #b7bfcc;
    --muted: #8a93a3;
    --grid: #262c38;
    --axis: #3b4251;
    --hair: rgba(238, 241, 247, 0.13);
    --track: #384052;
    --s-lg: #3987e5;
    --s-rd: #d95926;
    --s-col: #199e70;
    --settled: rgba(138, 147, 163, 0.14);
    --hostile: rgba(0, 0, 0, 0.35);
    --warn: #ff8f87;
    --warn-wash: rgba(255, 120, 110, 0.08);
    --focus: #6aa5ee;
    --shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #141821;
  --plane: #1b2030;
  --ink: #eef1f7;
  --ink-2: #b7bfcc;
  --muted: #8a93a3;
  --grid: #262c38;
  --axis: #3b4251;
  --hair: rgba(238, 241, 247, 0.13);
  --track: #384052;
  --s-lg: #3987e5;
  --s-rd: #d95926;
  --s-col: #199e70;
  --settled: rgba(138, 147, 163, 0.14);
    --hostile: rgba(0, 0, 0, 0.35);
  --warn: #ff8f87;
  --warn-wash: rgba(255, 120, 110, 0.08);
  --focus: #6aa5ee;
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface); }
body {
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, output { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
sup { font-size: 0.6em; line-height: 0; }

.mw { max-width: 1200px; margin: 0 auto; padding: 20px 16px 28px; }

/* compact verdict that follows the reader on narrow screens */
.mini {
  position: sticky; top: 0; z-index: 6; display: none;
  margin: -20px -16px 12px; padding: 8px 16px;
  background: var(--surface); border-bottom: 1px solid var(--hair);
  font-size: 14px;
}
.mini strong { font-weight: 650; }

.mw-head { margin-bottom: 18px; }
.mw-head h1 { font-size: 27px; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 6px; font-weight: 680; }
.lede { margin: 0; color: var(--ink-2); max-width: 68ch; }

.mw-grid { display: grid; grid-template-columns: minmax(0, 1fr) 368px; grid-template-rows: auto 1fr; grid-template-areas: "results controls" "mc controls"; column-gap: 28px; align-items: start; }
.mw-results { grid-area: results; min-width: 0; }
.mw-controls { grid-area: controls; }
.mc { grid-area: mc; min-width: 0; }

/* ---------- verdict ---------- */
.verdict { margin-bottom: 10px; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--hair); border-radius: 9px; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--surface); }
.hero { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 16px; row-gap: 2px; margin: 14px 0 6px; }
.hero-fig { font-size: clamp(46px, 6.4vw, 68px); line-height: 1; font-weight: 680; letter-spacing: -0.025em; white-space: nowrap; }
.hero-text { font-size: 19px; line-height: 1.35; max-width: 30ch; }
.hero-verdict { font-size: 16px; margin: 6px 0 0; max-width: 72ch; }
.hero-verdict strong { font-weight: 650; }
.hero-why { color: var(--ink-2); margin: 2px 0 0; max-width: 72ch; }

/* ---------- chart ---------- */
.fig { margin: 16px 0 0; position: relative; }
.fig-cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-bottom: 4px; }
.fig-title { font-size: 14px; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); list-style: none; margin: 0; padding: 0; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 10px; border-radius: 2px; display: inline-block; }
.linkish { border: 0; background: none; padding: 2px 0; color: var(--ink-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--ink); }
.chart { position: relative; width: 100%; outline-offset: 4px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: inherit; }
.tip {
  position: absolute; z-index: 4; pointer-events: none; min-width: 190px; max-width: 260px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: 8px; box-shadow: var(--shadow);
  padding: 8px 10px; font-size: 13px; line-height: 1.35;
}
.tip-h { color: var(--ink-2); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row b { font-weight: 650; font-variant-numeric: tabular-nums; min-width: 4.5em; }
.tip-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.tip-foot { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--hair); }
.empty { padding: 60px 12px; text-align: center; color: var(--ink-2); }

table.tv { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.tv th, table.tv td { text-align: right; padding: 5px 6px; border-bottom: 1px solid var(--hair); font-variant-numeric: tabular-nums; }
table.tv th:first-child, table.tv td:first-child { text-align: left; }
table.tv thead th { font-weight: 600; color: var(--ink-2); }
table.tv tr.now-row td { border-bottom: 2px solid var(--ink); }

/* ---------- ledger ---------- */
.ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.stat { padding: 12px 14px 14px; border-left: 1px solid var(--hair); min-width: 0; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-label { font-size: 13px; color: var(--ink-2); }
.stat-value { font-size: 23px; line-height: 1.2; font-weight: 650; margin: 2px 0 2px; overflow-wrap: anywhere; }
.stat-sub { font-size: 13px; color: var(--ink-2); }
.stat-sub.flag { color: var(--warn); }
.split { display: flex; height: 10px; margin: 9px 0 6px; gap: 2px; }
.split span { display: block; height: 100%; min-width: 0; }
.split span:first-child { border-radius: 2px 0 0 2px; }
.split span:last-child { border-radius: 0 2px 2px 0; }
.split span:only-child { border-radius: 2px; }

/* ---------- controls ---------- */
.mw-controls { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; background: var(--plane); border-radius: 12px; padding: 14px 16px 10px; overscroll-behavior: contain; }
.ctl-h { font-size: 13px; color: var(--ink-2); margin: 0 0 7px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button { font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--hair); background: var(--surface); cursor: pointer; }
.presets button:hover { border-color: var(--muted); }
.presets button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.preset-desc { font-size: 13px; color: var(--ink-2); margin: 8px 0 0; min-height: 1.5em; }
.tabs { display: flex; margin: 14px -4px 2px; border-bottom: 1px solid var(--hair); }
.tabs button { flex: 1 1 auto; padding: 8px 4px 7px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--ink-2); font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.panel-intro { font-size: 13px; color: var(--ink-2); margin: 10px 0 2px; }
.ctl { padding: 11px 0 10px; border-bottom: 1px solid var(--hair); }
.ctl:last-child { border-bottom: 0; }
.ctl-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ctl-row label { font-size: 13.5px; font-weight: 560; }
.ctl-row output { font-size: 13.5px; text-align: right; white-space: nowrap; }
.ctl-val { display: inline-flex; align-items: baseline; flex: none; }
.b-info { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; margin: 0 0 0 7px; padding: 0; align-self: center;
  border: 1px solid var(--muted); border-radius: 50%; background: none; color: var(--ink-2); font-size: 11px; font-weight: 600; font-style: italic; line-height: 1; cursor: pointer; }
.b-info:hover, .b-info[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--plane); }
.ctl-track { position: relative; height: 24px; margin-top: 3px; }
.notch { position: absolute; top: 17px; width: 2px; height: 6px; margin-left: -1px; background: var(--muted); border-radius: 1px; pointer-events: none; }
.ctl-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.derived { font-size: 12.5px; color: var(--ink-2); }
.b-reset { flex: none; border: 0; background: none; padding: 0; font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.b-reset:hover { color: var(--ink); }
.help { font-size: 13px; color: var(--ink-2); margin: 6px 0 2px; }
.callout { font-size: 13px; background: var(--surface); border-radius: 8px; padding: 9px 11px; margin: 10px 0 4px; }
.callout b { font-weight: 650; }
.controls-foot { display: flex; justify-content: flex-end; padding-top: 8px; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; outline: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--track); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--ink); border: 2px solid var(--plane); box-sizing: border-box; }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 2px solid var(--plane); box-sizing: border-box; }
input[type="range"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 4px; }

/* ---------- uncertainty ---------- */
.mc { margin-top: 28px; }
.mc h2, .notes h2 { font-size: 18px; margin: 0 0 4px; font-weight: 650; }
.mc > p { margin: 0; color: var(--ink-2); max-width: 70ch; }
.mc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; }
.mc-spread { display: flex; align-items: center; gap: 10px; min-width: 260px; flex: 1 1 260px; max-width: 420px; }
.mc-spread label { font-size: 13.5px; white-space: nowrap; }
.mc-spread output { font-size: 13px; color: var(--ink-2); white-space: nowrap; min-width: 9.5em; }
.btn { border: 1px solid var(--ink); background: var(--ink); color: var(--surface); border-radius: 8px; padding: 7px 14px; font-size: 14px; cursor: pointer; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.mc-status { font-size: 13px; color: var(--ink-2); }
.mc-out { margin-top: 10px; }
.mc-out.stale { opacity: 0.45; }
.mc-sum { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 14px; }
.mc-sum b { font-weight: 650; }

/* ---------- notes ---------- */
.notes { margin-top: 30px; border-top: 1px solid var(--hair); }
.notes details { border-bottom: 1px solid var(--hair); }
.notes summary { cursor: pointer; padding: 11px 0; font-weight: 600; font-size: 15px; }
.notes .body { padding: 0 0 14px; max-width: 76ch; color: var(--ink-2); font-size: 14px; }
.notes .body p { margin: 0 0 9px; }
.notes .body ul { margin: 0 0 9px; padding-left: 20px; }
.notes .body li { margin: 0 0 5px; }
.notes a { color: inherit; text-underline-offset: 2px; }
.credit { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

@media (max-width: 960px) {
  .mw-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "results" "controls" "mc"; }
  .mw-controls { margin-top: 24px; }
  .mw-controls { position: static; max-height: none; overflow: visible; }
  .mini.show { display: block; }
}
@media (max-width: 680px) {
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--hair); }
  .hero-text { font-size: 17px; }
  .mw-head h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: no-preference) {
  .seg button, .presets button, .tabs button { transition: background-color 120ms, color 120ms; }
}
/* Above is widget CSS */


@media (prefers-color-scheme: dark) {
  /* Links: brighter blue, lighter on hover, soft violet once visited */
  body a,
  body .entry-content a,
  body .wp-block-post-content a {
    color: #8ab4f8 !important;
  }
  body a:hover,
  body a:focus {
    color: #b9d3ff !important;
  }
  body a:visited {
    color: #c3a6f5 !important;
  }

  /* Comment form and likes row (Jetpack iframes): invert them to dark */
  iframe#jetpack_remote_comment,
  iframe[src*="jetpack-comment"],
  iframe.post-likes-widget,
  iframe[name^="like-post-frame"], iframe[name^="like-comment-frame"] {
    filter: invert(0.9) hue-rotate(180deg);
    background: transparent;
  }

  /* Theme wrappers that sometimes add their own white box */
  .comment-respond,
  #respond,
  .sharedaddy,
  .jetpack-likes-widget-wrapper {
    background: transparent !important;
  }
}
html {
  scroll-behavior: smooth;
}
:target {
  animation: flashHighlight 2s ease-out;
  scroll-margin-top: 100px; /* Prevents sticky headers from covering the text */
}

@keyframes flashHighlight {
  0% {
    background-color: rgba(255, 235, 59, 0.7); /* Bright yellow highlight */
  }
  100% {
    background-color: rgba(255, 235, 59, 0); /* Fades back to transparent */
  }
}
@media (prefers-color-scheme: dark) {
  /* Backdrop */
  .jetpack-subscribe-overlay.open {
    background-color: #141821 !important;
  }

  /* Everything inside the overlay: light text, no white panels */
  .jetpack-subscribe-overlay__content,
  .jetpack-subscribe-overlay__content * {
    color: #eef1f7 !important;
    background-color: transparent !important;
  }

  /* Email field */
  .jetpack-subscribe-overlay input[type="email"],
  .jetpack-subscribe-overlay input[type="text"] {
    background-color: #1b2030 !important;
    color: #eef1f7 !important;
    border: 1px solid #3b4251 !important;
  }
  .jetpack-subscribe-overlay input::placeholder {
    color: #8a93a3 !important;
  }

  /* Subscribe button */
  .jetpack-subscribe-overlay button,
  .jetpack-subscribe-overlay .wp-block-button__link {
    background-color: #8ab4f8 !important;
    color: #141821 !important;
    border: 0 !important;
  }

  /* Close button and "continue reading" link */
  .jetpack-subscribe-overlay__close,
  .jetpack-subscribe-overlay__close svg {
    color: #eef1f7 !important;
    fill: #eef1f7 !important;
  }
  .jetpack-subscribe-overlay__to-content,
  .jetpack-subscribe-overlay__tao-content a {
    color: #8ab4f8 !important;
  }
}

/* Indent post paragraphs:*/
.entry-content p {
    text-indent: 2em;
}