/* =========================================================================
   PokéSpread, Guides stylesheet
   -------------------------------------------------------------------------
   Shared by every article page (one <link> per article, nothing else).
   To restyle the whole article series, edit ONLY this file. No article
   page should ever carry its own <style> block.

   Palette mirrors the main PokéSpread app (style.css) so the guides read as
   the same product, not a bolted-on blog. If you rename/replace a token in
   the app's style.css, mirror the change here too; the two files are
   intentionally kept independent (no @import) so the articles folder can be
   deployed on its own subpath without dragging the app's CSS with it.
   ========================================================================= */

:root {
  /* ---- brand palette (copied from the app's style.css) ---- */
  --ink-950: #0d0f14;
  --ink-900: #191d29;
  --ink-800: #232837;
  --ink-700: #2e3446;
  --ink-600: #454d66;
  --ink-500: #5b6480;
  --line: #313852;
  --text-hi: #f1f3fb;
  --text-mid: #aab0c4;
  --text-low: #6b7288;

  --accent: #fc0944;
  --accent-strong: #d1073a;
  --accent-soft: rgba(252, 9, 68, 0.14);
  --accent-contrast: var(--ink-950);

  --warn: #e6b325;
  --warn-soft: rgba(230, 179, 37, 0.14);
  --success: #7fd894;
  --success-soft: rgba(120, 200, 120, 0.14);

  /* Used only for the small "compare" callouts (worked examples pitting two
     Pokémon / builds against each other), kept distinct from --accent so a
     comparison box never reads as a warning or a key-takeaway box. */
  --compare: #4f6fd9;
  --compare-soft: rgba(79, 111, 217, 0.14);

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;

  /* ---- type ---- */
  --font-display: ui-sans-serif, "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: ui-sans-serif, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  /* Header / footer zone backgrounds (same values as the app's style.css). */
  --zone-header-bg: #120c0f;
  --zone-tabs-bg: var(--ink-900);
  /* Wordmark face, loaded by the @font-face below (same file the app uses). */
  --font-brand: "Chakra Petch", ui-sans-serif, "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* ---- article measure ---- */
  --content-width: 700px;
  --wide-width: 920px;
}

/* Same self-hosted face as the app. The url() is resolved relative to THIS file
   (articles/articles.css), hence ../assets. */
@font-face {
  font-family: "Chakra Petch";
  src: url("../assets/fonts/ChakraPetch-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink-950);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

body {
  background-image:
    radial-gradient(circle at 12% -10%, rgba(252, 9, 68, 0.07), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(79, 111, 217, 0.05), transparent 35%);
}

::selection { background: var(--accent-soft); color: var(--text-hi); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

img, svg { max-width: 100%; }

/* ---------- site header + footer (shared with the calculator, see markers) ---------- */
/* ===== SHARED SITE HEADER : START =====
   Identical in style.css (calculator) and articles/articles.css (guides).
   Edit one, copy to the other. Needs tokens: --zone-header-bg, --font-brand,
   --font-display, --accent, --line, --ink-*, --text-* (defined in both :root). */
.app-header {
  padding: 20px 24px 16px;
  background: var(--zone-header-bg);
}
.app-header-inner {
  max-width: 1180px;
  margin: 0 auto;
}
.header-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 12px;          /* row-gap > underline overhang, so a wrapped pill never touches it */
  padding-bottom: 12px;    /* room for the brand underline, which hangs below the row */
}
.brand {
  position: relative;
  margin: 0;
  font-family: var(--font-brand);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text-hi);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
a.brand:hover { color: var(--text-hi); }
.brand::after {            /* accent underline, drawn outside the box so it never shifts the row's centering */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -12px;
  height: 2px;
  background: var(--accent);
}
.logo-mark {
  height: 30px;
  width: auto;
  display: block;
  transform: translateY(-1px);
}
/* Small outlined label next to the wordmark (guides pages only). */
.brand-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-low);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
a.brand-tag:hover { color: var(--text-mid); border-color: var(--ink-500); }
.brand-tag[aria-current="page"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
/* Cross-site navigation pill (right side): "Guides ->" on the calculator, "<- Calculator" on guides. */
.nav-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  text-decoration: none;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.nav-pill:hover { color: var(--text-hi); border-color: var(--accent); background: var(--accent-soft); }
.nav-arrow { display: inline-block; transition: transform 0.12s ease; }
.nav-pill:hover .nav-arrow--fwd { transform: translateX(2px); }
.nav-pill:hover .nav-arrow--back { transform: translateX(-2px); }
.brand:focus-visible, .brand-tag:focus-visible, .nav-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Tagline (calculator page only). */
.subtitle {
  margin: 6px 0 0;
  color: var(--text-low);
  font-size: 12.5px;
  max-width: 640px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 520px) {
  .brand { font-size: 20px; gap: 8px; }
  .logo-mark { height: 26px; }
  .nav-pill { font-size: 12.5px; padding: 5px 11px; }
}
/* ===== SHARED SITE HEADER : END ===== */

/* ===== SHARED SITE FOOTER : START =====
   Identical in style.css (calculator) and articles/articles.css (guides).
   Needs tokens: --zone-tabs-bg, --ink-600, --ink-900, --line, --accent*, --text-*,
   --radius-m, --font-display.
   The footer is deliberately set in small type so it stays secondary to the page body.
   Layout: phone = stacked, tablet = title row + 2 columns, desktop (>= 1200px) = one row. */
.app-footer {
  background: var(--zone-tabs-bg);
  border-top: 1px solid var(--ink-600);
  padding: 22px 24px 24px;
}
.app-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 30px;                       /* space between the actions and the disclaimer */
}
/* Base (tablet): the title spans a row above two equal columns; captions may wrap. */
.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  row-gap: 14px;
  align-items: stretch;
}
/* Brand lockup: logo + title on two lines, same idea as the header brand. */
.footer-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.footer-logo {
  display: block;
  flex: none;
  width: 56px;
  height: 56px;
}
.footer-title-text {
  margin: 0;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  color: var(--text-hi);
}
/* The title breaks onto two lines only in the desktop single-row layout (see media query below). */
.footer-br { display: none; }
.footer-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 0 24px;
  border-left: 1px solid var(--line);
}
.footer-title + .footer-block { border-left: 0; padding-left: 0; }
.footer-block:last-child { padding-right: 0; }
.footer-block-title {
  margin: 0;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-hi);
}
.footer-block-text {
  margin: 0;
  color: var(--text-mid);
  font-size: 12px;
  line-height: 1.5;
}
/* Pushes the action to the bottom so both blocks line up. */
.share-row, .footer-block .support-link { margin-top: auto; }
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.share-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-mid);
  text-decoration: none;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.share-pill:hover { color: var(--text-hi); border-color: var(--accent); background: var(--accent-soft); }
.share-pill:focus-visible, .support-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.support-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 15px;
  border-radius: var(--radius-m);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  font-size: 12.5px;
  text-decoration: none;
  transition: background 0.12s ease, transform 0.12s ease;
}
.support-link:hover { background: var(--accent-strong); color: var(--accent-contrast); transform: translateY(-1px); }
.support-icon { font-size: 14px; line-height: 1; }
.app-disclaimer {
  margin: 0;
  text-align: center;
  color: var(--text-low);
  font-size: 11px;
  line-height: 1.6;
}
/* Desktop: title | spread the word | support on a single row.
   The title column is sized to its lockup (logo + two short lines); the two action columns
   share the rest equally and their captions may wrap (balanced) onto two lines. */
@media (min-width: 1200px) {
  .footer-main { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); row-gap: 0; }
  .footer-title { grid-column: auto; align-self: center; padding-right: 24px; }
  .footer-title + .footer-block { border-left: 1px solid var(--line); padding-left: 24px; }
  .footer-br { display: inline; }
  .footer-block-text { text-wrap: balance; }
}
/* Phone: everything stacked. */
@media (max-width: 680px) {
  .footer-main { grid-template-columns: 1fr; row-gap: 12px; }
  .footer-logo { width: 44px; height: 44px; }
  .footer-block, .footer-title + .footer-block { border-left: 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
}
/* ===== SHARED SITE FOOTER : END ===== */

/* ---------- page shell ---------- */
.article-shell {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* Breadcrumb + reading metadata: functional wayfinding, not decoration. */
.article-crumbs {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--text-low);
}
.article-crumbs a { color: var(--text-low); }
.article-crumbs a:hover { color: var(--text-mid); }

.article-header { margin-bottom: 36px; }
.article-header .category {
  display: inline-block;
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}
.article-header h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-hi);
}
.article-dek {
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-mid);
}
.article-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-low);
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- prose ---------- */
.article-body h2 {
  margin: 48px 0 16px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text-hi);
  scroll-margin-top: 24px;
}
.article-body h2:first-child { margin-top: 0; }
.article-body h3 {
  margin: 30px 0 12px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-hi);
  scroll-margin-top: 24px;
}
.article-body p {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-mid);
}
.article-body p strong, .article-body li strong { color: var(--text-hi); font-weight: 600; }
.article-body ul, .article-body ol {
  margin: 0 0 20px;
  padding-left: 22px;
  color: var(--text-mid);
}
.article-body li { margin-bottom: 9px; line-height: 1.65; }
.article-body li::marker { color: var(--accent); }
.article-body ol li::marker { color: var(--text-low); font-weight: 600; }

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-hi);
  white-space: nowrap;
}

/* ---------- formula display ---------- */
.formula-block {
  margin: 22px 0 26px;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 20px 22px;
  overflow-x: auto;
}
.formula-block .formula {
  font-family: var(--font-mono);
  font-size: 15.5px;
  color: var(--text-hi);
  white-space: pre;
}
.formula-block .formula-label {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-low);
}
.formula-block .formula-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-low);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* Simple two-line formula: a main line, and an indented "where ..." line
   underneath it defining a sub-term. */
.formula-lines { display: flex; flex-direction: column; gap: 8px; }
.formula-lines .formula-line {
  font-family: var(--font-mono);
  font-size: 16.5px;
  color: var(--text-hi);
  white-space: pre-wrap;
}
.formula-lines .formula-sub {
  font-size: 14px;
  color: var(--text-mid);
  padding-left: 20px;
}

/* Multi-step formula (the full pipeline): one named intermediate value per
   line, each optionally annotated with a short right-hand-side note. */
.formula-pipeline { display: flex; flex-direction: column; gap: 14px; }
.formula-pipeline .formula-step {
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-hi);
}
.formula-pipeline .formula-step-note {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-low);
  margin-top: 2px;
  white-space: normal;
}

/* The fully substituted single-equation version of the pipeline, shown as
   one nested expression rather than named steps. Real <pre> so the manual
   indentation used to show nesting depth survives. */
.formula-nested {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-hi);
  white-space: pre;
  overflow-x: auto;
}

/* Underbrace-style callout used inside a formula to flag that a term was
   already defined elsewhere (e.g. "BaseDamage" pointing back at the base
   damage box above). A small chevron under an underlined word stands in
   for a proper math brace. */
.term-brace {
  position: relative;
  display: inline-block;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
}
.term-brace::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 6px;
  height: 6px;
  border-left: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  transform: translateX(-50%) rotate(-45deg);
}

/* Inline stat/number badge, e.g. a computed Attack stat or damage value
   referenced mid-sentence. */
.stat {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-weight: 600;
  color: var(--text-hi);
  background: var(--ink-800);
  border-radius: 4px;
  padding: 0 5px;
}

/* ---------- callouts ---------- */
.callout {
  margin: 24px 0 26px;
  padding: 16px 18px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--ink-900);
}
.callout p:last-child { margin-bottom: 0; }
.callout-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-hi);
}
.callout-takeaway { border-color: var(--accent); background: var(--accent-soft); }
.callout-takeaway .callout-title { color: var(--accent); }
.callout-compare { border-color: var(--compare); background: var(--compare-soft); }
.callout-compare .callout-title { color: var(--compare); }
.callout-note { border-style: dashed; }

/* ---------- comparison tables ---------- */
.table-wrap {
  margin: 22px 0 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: auto;
}
table.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 560px;
}
.compare-table th, .compare-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.compare-table thead th {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-low);
  background: var(--ink-800);
  white-space: nowrap;
}
.compare-table tbody th {
  font-weight: 600;
  color: var(--text-hi);
  white-space: nowrap;
}
.compare-table td { color: var(--text-mid); font-family: var(--font-mono); font-size: 13.5px; }
.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody tr:nth-child(odd) { background: rgba(255,255,255,0.015); }
.compare-table .highlight-cell { color: var(--accent); font-weight: 700; }

/* Small print under a table or figure: footnotes, sourcing, assumptions. */
.footnote {
  margin: -14px 0 22px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-low);
}
.footnote:first-of-type { margin-top: -6px; }

/* ---------- related reading ---------- */
.related-articles {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.related-articles h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-low);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.related-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--ink-900);
  text-decoration: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.related-card:hover { border-color: var(--ink-500); background: var(--ink-800); }
.related-card .related-kicker {
  display: block;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}
.related-card .related-title {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-hi);
  line-height: 1.4;
}
.related-card.related-pending { opacity: 0.55; }
.related-card.related-pending:hover { border-color: var(--line); background: var(--ink-900); }
.related-card .related-soon {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-low);
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .article-header h1 { font-size: 27px; }
  .article-dek { font-size: 16px; }
  .related-grid { grid-template-columns: 1fr; }
  .formula-block .formula { font-size: 13.5px; }
}

/* =========================================================================
   Interactive tools (used by guides that embed a calculator)
   -------------------------------------------------------------------------
   Kept here, with the rest of the guides' styling, so that no article page
   needs its own <style> block. Everything is namespaced under .tool.
   ========================================================================= */
.tool {
  margin: 28px 0 34px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tool-card {
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: var(--radius-m);
  padding: 16px 18px 18px;
}
.tool-card-analyzed { border-top-color: var(--accent); }
.tool-card-target { border-top-color: var(--ink-500); }
.tool-card-compare { border-top-color: var(--compare); }
.tool-card h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-hi);
}
.tool-card-analyzed h3 { color: var(--accent); }
.tool-card-compare h3 { color: var(--compare); }
.tool-card .tool-card-hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-low);
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.tool-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tool-field.tool-wide { grid-column: 1 / -1; }
.tool-field label, .tool-field .tool-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-mid);
}
.tool input[type="text"],
.tool input[type="number"],
.tool select {
  width: 100%;
  background: var(--ink-800);
  border: 1px solid var(--line);
  color: var(--text-hi);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
}
.tool input:focus, .tool select:focus { border-color: var(--accent); background: var(--ink-700); }
.tool-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-mid);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  cursor: pointer;
}
.tool-check input { accent-color: var(--accent); width: 15px; height: 15px; }
.tool-modes { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; }
.tool-more { margin-top: 12px; }
.tool-more summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
}
.tool-more[open] summary { margin-bottom: 12px; }
.tool-actions { display: flex; justify-content: flex-end; }
.tool-reset {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 7px 14px;
  cursor: pointer;
}
.tool-reset:hover { color: var(--text-hi); border-color: var(--ink-500); }
.tool-output {
  background: var(--ink-800);
  border: 1px solid var(--compare);
  border-radius: var(--radius-m);
  padding: 18px 20px;
}
.tool-output p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.6; color: var(--text-mid); }
.tool-output p:last-child { margin-bottom: 0; }
.tool-output .tool-headline { font-size: 17px; color: var(--text-hi); }
.tool-output .tool-big {
  font-family: var(--font-mono);
  font-size: 1.35em;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.tool-output .tool-hint, .tool-output .tool-examples { font-size: 13px; color: var(--text-low); }
.tool-output .table-wrap { margin: 14px 0; }
.tool-message {
  border: 1px dashed var(--warn);
  background: var(--warn-soft);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-hi);
}
.tool .hidden { display: none; }

@media (max-width: 640px) {
  .tool-grid { grid-template-columns: 1fr; }
}

/* ---------- Additions for the HP vs. Defense guide (append-only) ---------- */
/* Key line of a formula block: much more visible than the intermediate steps,
   with one factor highlighted in the accent colour. */
.formula-block .formula-key {
  margin: 14px 0 6px;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-s);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-hi);
}
.formula-block .formula-hl { color: var(--accent); font-weight: 700; }
.formula-block .formula-key-sub { margin: 0; font-size: 13px; color: var(--text-mid); }
/* Intermediate steps: smaller and dimmer than the key line. */
.formula-pipeline.formula-steps-dim .formula-step { font-size: 13.5px; color: var(--text-mid); }
/* Warning-coloured callout, used to flag an approximation. */
.callout-approx { border-color: var(--warn); background: var(--warn-soft); }
.callout-approx .callout-title { color: var(--warn); }
@media (max-width: 640px) {
  .formula-block .formula-key { font-size: 15px; padding: 12px; }
}


/* ---------- additions: wayfinding, index page, previously-missing classes ---------- */
.article-meta a { color: inherit; text-decoration: underline; text-decoration-color: var(--ink-500); text-underline-offset: 3px; }
.article-meta a:hover { color: var(--text-mid); }

.related-all { margin: 16px 0 0; font-size: 13.5px; }
.related-all a { color: var(--text-mid); font-weight: 600; text-decoration: none; }
.related-all a:hover { color: var(--text-hi); }

/* Secondary line inside a formula block (e.g. a simplified recap under the main formula). */
.formula-lines .formula-line.formula-minor { font-size: 13.5px; color: var(--text-mid); }

/* Calculator output helpers (emitted by the equivalence tool scripts). */
.tool-ref { margin: 0 0 6px; font-size: 13px; line-height: 1.5; color: var(--text-low); }
.tool-scenario { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 6px; }

/* Guides index */
.guide-list { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.guide-card {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius-m);
  background: var(--ink-900); text-decoration: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.guide-card:hover { border-color: var(--ink-500); background: var(--ink-800); }
.guide-num {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft);
}
.guide-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.guide-card .related-kicker { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--accent); }
.guide-badge { font-size: 10px; color: var(--accent-contrast); background: var(--accent); border-radius: 999px; padding: 1px 8px; }
.guide-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; line-height: 1.35; color: var(--text-hi); }
.guide-blurb { font-size: 14.5px; line-height: 1.55; color: var(--text-mid); }
.guide-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-low); }
@media (max-width: 640px) { .guide-card { padding: 16px; gap: 12px; } }


/* ---------- Opinion series ---------- */
/* Blue "Opinion" pill in the header (same blue as --compare, the blue of the app's charter),
   replacing the "Guides" pill on opinion articles. */
.brand-tag.brand-tag-opinion,
a.brand-tag.brand-tag-opinion:hover {
  color: var(--compare);
  border-color: var(--compare);
  background: var(--compare-soft);
}
a.brand-tag.brand-tag-opinion:hover { border-color: var(--compare); filter: brightness(1.15); }
.article-header .category.category-opinion { color: var(--compare); }

/* Photos */
.article-hero { margin: 0 0 32px; }
.article-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
}
.article-figure { margin: 26px 0 28px; }
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
}
.article-figure figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-low);
}

/* Closing signature of an opinion article */
.article-body p.article-signature {
  margin: 34px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-low);
}
.article-body p.article-signature strong { color: var(--text-hi); font-size: 17px; }

/* ---------- Cheat Sheet carousel (opinion article on the MC team) : append to articles.css ---------- */
.cs-carousel { margin: 0 0 36px; }
.cs-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-500) transparent;
}
.cs-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius-m); }
.cs-scroll::-webkit-scrollbar { height: 8px; }
.cs-scroll::-webkit-scrollbar-track { background: transparent; }
.cs-scroll::-webkit-scrollbar-thumb { background: var(--ink-500); border-radius: 4px; }
.cs-scroll figure {
  flex: 0 0 min(72%, 390px);
  margin: 0;
  scroll-snap-align: start;
}
.cs-scroll a { display: block; }
.cs-scroll img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
}
.cs-scroll figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-low);
}
.cs-carousel-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--text-low); }

/* ---------- Articles hub: guides + opinion (append-only) ---------- */
/* In-page jump links under the intro of the articles index. */
.article-jump { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.article-jump a {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 13px;
  transition: filter 0.12s ease;
}
.article-jump a:hover { filter: brightness(1.15); color: var(--accent); }
.article-jump a.article-jump-opinion { color: var(--compare); border-color: var(--compare); background: var(--compare-soft); }
.article-jump a.article-jump-opinion:hover { color: var(--compare); }
.article-jump a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.article-jump a.article-jump-opinion:focus-visible { outline-color: var(--compare); }

/* Red "Guides" pill of the guide pages (they carry a plain .brand-tag, no extra class): same behaviour as the blue
   Opinion pill, in the accent colour. The hub page (.brand-tag-hub) and the opinion pages are excluded. */
.brand-tag:not(.brand-tag-opinion):not(.brand-tag-hub),
a.brand-tag:not(.brand-tag-opinion):not(.brand-tag-hub):hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
a.brand-tag:not(.brand-tag-opinion):not(.brand-tag-hub):hover { filter: brightness(1.15); }

/* Neutral grey "Articles" pill of the hub page: red belongs to the guides, blue to the opinion pieces. */
.brand-tag.brand-tag-hub[aria-current="page"] { color: var(--text-mid); border-color: var(--ink-500); background: var(--ink-800); }

/* Opinion cards reuse .guide-card (no number: opinion pieces are not a series to read in order),
   with the blue of the "Opinion" pill instead of the guides' red. */
.article-body h2 { scroll-margin-top: 24px; }
.guide-card-opinion .related-kicker { color: var(--compare); }
.guide-card-opinion:hover { border-color: var(--compare); }
.guide-kicker-sub {
  font-size: 10px;
  color: var(--compare);
  background: var(--compare-soft);
  border: 1px solid var(--compare);
  border-radius: 999px;
  padding: 0 8px;
}
