/* Plain words (js/explain.js, /glossary) and the News pages. Colours come from the theme's own tokens, so light and dark both work. */
.jw-term { cursor: help; border-bottom: 1.5px dotted var(--accent-teal, #0e7490); text-decoration: none; }
.jw-term:hover, .jw-term:focus-visible, .jw-term[aria-expanded="true"] { background: rgba(14, 116, 144, 0.14); outline: none; border-radius: 3px; }
.jw-expl { position: fixed; z-index: 9000; padding: 12px 14px; font-size: 14px; line-height: 1.5; color: var(--text-primary); background: var(--bg-card, #fff); border: 1px solid var(--border-card, #d7dee8); border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22); }
.jw-expl[hidden] { display: none; }
.jw-expl b { display: block; margin-bottom: 3px; font-size: 15px; }
.jw-expl p { margin: 0 0 6px; font-size: 14px !important; color: var(--text-primary); }
.jw-expl .jw-expl-sum { padding: 6px 8px; font-weight: 700; background: rgba(14, 116, 144, 0.12); border-radius: 8px; }
.jw-expl a { font-size: 13px; font-weight: 600; color: var(--accent-teal, #0e7490); }
.jw-term-tip { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 8999; max-width: calc(100vw - 32px); padding: 8px 14px; font-size: 13.5px; color: #fff; background: #0f3a4a; border-radius: 999px; transform: translateX(-50%); box-shadow: 0 6px 20px rgba(15, 23, 42, 0.3); }

/* Numbers in plain words (simple.py). Chart colours are the checked categorical order, stepped for each theme; words stay in text colours. */
.sw-box, .sw-step { --sw-1: #2a78d6; --sw-2: #eb6834; --sw-3: #1baf7a; --sw-4: #eda100; --sw-0: #98a2b3; --sw-empty: rgba(100, 116, 139, 0.2); }
:root:not([data-theme="light"]) .sw-box, :root:not([data-theme="light"]) .sw-step { --sw-1: #3987e5; --sw-2: #d95926; --sw-3: #199e70; --sw-4: #c98500; --sw-0: #667085; }
.sw-lines { margin: 0 0 14px !important; padding-left: 20px !important; font-size: 16px; line-height: 1.6; }
.sw-lines li { margin-bottom: 4px; }
.sw-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px 28px; margin-bottom: 10px; }
.sw-fig { margin: 0 0 8px; }
.sw-fig figcaption { margin-bottom: 8px; font-weight: 700; color: var(--text-primary); }
.sw-stack { display: flex; gap: 2px; height: 22px; }
.sw-seg { flex: 0 1 0; min-width: 3px; }
.sw-seg:first-child { border-radius: 4px 0 0 4px; }
.sw-seg:last-child { border-radius: 0 4px 4px 0; }
.sw-c0 { background: var(--sw-0); } .sw-c1 { background: var(--sw-1); } .sw-c2 { background: var(--sw-2); } .sw-c3 { background: var(--sw-3); } .sw-c4 { background: var(--sw-4); }
.sw-legend { display: grid; gap: 6px; margin: 10px 0 0 !important; padding: 0 !important; list-style: none; font-size: 14.5px; line-height: 1.35; }
.sw-legend li { display: grid; grid-template-columns: 12px 50px 1fr auto; align-items: start; gap: 8px; margin: 0; }
.sw-legend i { width: 12px; height: 12px; margin-top: 4px; border-radius: 3px; }
.sw-legend b { color: var(--text-primary); }
.sw-legend small { display: block; font-size: 12.5px; color: var(--text-muted); }
.sw-legend em { font-style: normal; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.sw-meterbox { margin: 0 0 8px; }
.sw-meter-words { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px !important; font-size: 14.5px !important; color: var(--text-secondary); }
.sw-meter-words b { color: var(--text-primary); }
.sw-meter { height: 14px; margin: 2px 0 10px; background: var(--sw-empty); border-radius: 4px; overflow: hidden; }
.sw-meter span { display: block; height: 100%; background: var(--sw-1); border-radius: 4px; }
.sw-go { margin: 10px 0 2px; font-weight: 600; }
.sw-step h2 { display: flex; align-items: center; margin: 0 0 10px; }
.sw-step p { margin: 0 0 10px; }
.sw-step { position: relative; }
.sw-step + .sw-step::before { content: ""; position: absolute; left: 36px; top: -27px; width: 2px; height: 26px; background: var(--border-card); }
.sw-step-two { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 18px 40px; align-items: start; }
.sw-step-text, .sw-step-fig { min-width: 0; }
.sw-step-fig { padding: 16px 18px; background: var(--bg-card-highlight, transparent); border: 1px solid var(--border-card); border-radius: 12px; }
.sw-step-fig .sw-fig { margin: 0; }
.sw-figtitle { margin: 0 0 8px !important; font-weight: 700; color: var(--text-primary); font-size: 15px !important; }
.sw-pick { margin-top: 4px; }
.sw-pick select { min-width: 200px; }
.sw-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; margin: 8px 0 0; }
.sw-hero div { padding: 16px 18px; background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 14px; }
.sw-hero div > span { display: block; font-size: 13.5px; color: var(--text-secondary); }
.sw-hero strong { display: block; margin: 5px 0 3px; font-family: var(--font-display); font-size: clamp(23px, 2.6vw, 30px); line-height: 1.15; color: var(--text-primary); }
.sw-hero small { font-size: 12.5px; color: var(--text-muted); }
.sw-next { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.lp .sw-next a { display: block; padding: 12px 14px; text-decoration: none; background: var(--bg-card-highlight, transparent); border: 1px solid var(--border-card); border-radius: 12px; }
.lp .sw-next a:hover { border-color: var(--accent-teal, #0e7490); }
.sw-next b { display: block; color: var(--text-primary); font-size: 15px; }
.sw-next a > span { font-size: 13px; color: var(--text-muted); }
@media (max-width: 640px) {
  .sw-hero { gap: 8px; }
  .sw-hero div { padding: 11px 14px; }
  .sw-hero strong { font-size: 21px; margin: 2px 0; }
}
@media (max-width: 900px) { .sw-step-two { grid-template-columns: minmax(0, 1fr); } }
.sw-num { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 10px; font-size: 15px; color: #fff; background: #0e7490; border-radius: 50%; vertical-align: 2px; }
.sw-step p { font-size: 16px !important; line-height: 1.6; }
.sw-rank { display: grid; gap: 5px; margin: 12px 0 !important; padding: 0 !important; list-style: none; }
.sw-rank li { display: grid; grid-template-columns: minmax(96px, 150px) 1fr 92px; align-items: center; gap: 10px; margin: 0; font-size: 14px; }
.sw-track { display: block; height: 10px; }
.sw-track span { display: block; height: 100%; background: var(--sw-1); border-radius: 0 4px 4px 0; }
.sw-rank b { text-align: right; color: var(--text-primary); white-space: nowrap; }
@media (max-width: 480px) { .sw-legend li { grid-template-columns: 12px 46px 1fr; } .sw-legend em { grid-column: 3; } .sw-rank li { grid-template-columns: 96px 1fr 76px; gap: 6px; font-size: 13px; } }

/* on a phone the plain words come first, not a menu of the page */
@media (max-width: 640px) { main:has(.sw-box) .lp-toc { display: none; } }

/* /glossary */
.gl-head { margin-bottom: 18px; }
.gl-search { width: 100%; max-width: 620px; height: 46px; margin-top: 6px; padding: 0 14px; font-size: 16px; color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 12px; }
.gl-none { margin: 10px 0 0; font-weight: 600; }
.gl-group { margin: 0 0 18px; padding: 18px 20px; background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 16px; }
.gl-group[hidden], .gl-term[hidden] { display: none; }
.gl-group h2 { margin: 0 0 12px; font-size: 20px; }
.gl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; margin: 0; }
.gl-term { padding: 10px 12px; background: var(--bg-card-highlight, transparent); border-radius: 10px; scroll-margin-top: 90px; }
.gl-term:target { outline: 2px solid var(--accent-teal, #0e7490); }
.gl-term dt { margin: 0 0 3px; font-weight: 700; color: var(--text-primary); }
.gl-term dd { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--text-secondary); }

/* /news */
.nw-head { margin-bottom: 14px; }
.nw-fresh { margin: 0 0 12px; font-size: 13.5px !important; color: var(--text-muted); }
.nw-filters { display: flex; flex-direction: column; gap: 10px; }
.nw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lp a.nw-chip { padding: 6px 13px; font-size: 13.5px; font-weight: 600; color: var(--text-primary); text-decoration: none; background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 999px; }
.lp a.nw-chip:hover { border-color: var(--accent-teal, #0e7490); }
.lp a.nw-chip.on { color: #fff !important; background: #0e7490 !important; border-color: #0e7490; }
.lp h2.nw-h { margin: 0 0 10px; font-size: 19px; }
.nw-pick { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; font-size: 13.5px; color: var(--text-muted); }
.nw-pick select { min-width: 0; max-width: 100%; min-height: 38px; padding: 4px 10px; font-size: 14px; color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 10px; }
.nw-next { margin: 0 0 12px; }
.nw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; margin-bottom: 20px; }
.nw-item { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 14px; }
.lp .nw-item h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.lp .nw-item h3 a { color: var(--text-primary); text-decoration: none; }
.lp .nw-item h3 a:hover { color: var(--accent-teal, #0e7490); text-decoration: underline; }
.nw-sum { margin: 0; font-size: 14px !important; line-height: 1.45; color: var(--text-secondary); }
.nw-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: auto 0 0; font-size: 12.5px !important; color: var(--text-muted); }
.nw-src { padding: 1px 8px; font-weight: 600; color: var(--text-primary); background: var(--bg-card-highlight, transparent); border: 1px solid var(--border-card); border-radius: 999px; }
.nw-src-g { color: #06603b; background: rgba(16, 185, 129, 0.14); border-color: rgba(16, 185, 129, 0.4); }
:root:not([data-theme="light"]) .nw-src-g { color: #6ee7b7; }
.nw-states { margin: 0 0 16px; padding: 16px 18px; background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 14px; }
.nw-states h2 { margin: 0 0 10px; font-size: 18px; }
.nw-statelist { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
