/* =========================================================================
   RIQ Portal - portal.css (P199, 2026-09-27; MOBILE_APP_UI_BLUEPRINT.md)

   One responsive stylesheet, mobile-first. No frameworks, no CDNs, no web
   fonts - self-contained for the VPS and the service worker.

   TOKENS are the desktop app's (web/static/theme.css section 1, dark, and its
   html[data-theme="light"] palette), so the phone and the desktop stop
   drifting: amber accent, green/red only for direction, tabular numerals.

   DENSITY RULES (blueprint 4.1) live here as numbers: 44 px tap targets,
   56 px list rows, 56 px tab bar, 16 px page gutter, and NO horizontal page
   scroll - every wide thing (chip bars, tables) scrolls inside itself.
   ======================================================================= */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-0: #0a0d12;  --bg-1: #10141c;  --bg-2: #161c27;  --bg-3: #1e2533;  --bg-4: #262f40;
  --fg: #e6ebf2;  --fg-strong: #ffffff;  --fg-mid: #a4adbf;  --muted: #6b7385;  --muted-2: #4a5163;
  --border: #232a38;  --border-soft: #1a202b;  --border-hard: #384357;
  --accent: #ffb020;  --accent-hi: #ffd070;  --accent-soft: rgba(255, 176, 32, 0.12);  --accent-ink: #12161f;
  --pos: #4fd1a1;  --pos-soft: rgba(79, 209, 161, 0.14);
  --neg: #ff6b6b;  --neg-soft: rgba(255, 107, 107, 0.14);
  --warn: #f5b849; --warn-soft: rgba(245, 184, 73, 0.15);
  --info: #6aa6ff; --info-soft: rgba(106, 166, 255, 0.15);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, "Cascadia Mono", monospace;
  --num-feat: "tnum" 1, "lnum" 1;

  --top-h: 48px;
  --stamp-h: 22px;
  --tabbar-h: 58px;
  --gutter: 16px;
  --radius: 12px;
  --row-h: 56px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f5f7fa;  --bg-1: #ffffff;  --bg-2: #f2f4f7;  --bg-3: #e7ebf0;  --bg-4: #dce2ea;
  --fg: #1c2330;  --fg-strong: #0a0e14;  --fg-mid: #465063;  --muted: #667085;  --muted-2: #8a93a3;
  --border: #d5dbe3;  --border-soft: #e5e9ef;  --border-hard: #b6c0cd;
  --accent: #b86e00;  --accent-hi: #d98200;  --accent-soft: rgba(184, 110, 0, 0.10);  --accent-ink: #ffffff;
  --pos: #137a55;  --pos-soft: rgba(19, 122, 85, 0.11);
  --neg: #c23434;  --neg-soft: rgba(194, 52, 52, 0.10);
  --warn: #8f6200; --warn-soft: rgba(143, 98, 0, 0.12);
  --info: #2563c9; --info-soft: rgba(37, 99, 201, 0.10);
}

/* ---------- 2. Base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-0); color: var(--fg);
  font: 15px/1.45 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  overflow-wrap: break-word;
}
body.has-sheet { overflow: hidden; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { margin: 0; font-size: 1.3rem; font-weight: 650; letter-spacing: -0.01em; color: var(--fg-strong); }
h2, h3 { color: var(--fg-strong); }
p { margin: 0 0 10px; }
small { color: var(--muted); font-size: .8em; }
code { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: var(--num-feat); }
.pos, .tone-pos { color: var(--pos); }
.neg, .tone-neg { color: var(--neg); }
.tone-flat { color: var(--muted); }
.m-dim { color: var(--muted-2); }
.m-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.m-skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }
.m-skip:focus { left: 8px; }
.m-ico { width: 22px; height: 22px; display: block; }

/* ---------- 3. Shell: top bar, stamp, tab bar ---------------------------- */
.m-top {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border-soft);
  padding-top: env(safe-area-inset-top);
}
@supports (backdrop-filter: blur(8px)) {
  .m-top { background: color-mix(in srgb, var(--bg-0) 88%, transparent); backdrop-filter: saturate(1.2) blur(10px); }
}
.m-top__bar {
  display: flex; align-items: center; gap: 12px;
  height: var(--top-h); max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter);
}
.m-brand { display: inline-flex; align-items: center; gap: 7px; color: var(--fg-strong); font-weight: 750; letter-spacing: .03em; white-space: nowrap; }
.m-brand:hover { text-decoration: none; }
.m-brand small { color: var(--muted); font-weight: 600; font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; margin-left: 2px; }
.m-brand__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.m-brand--big { justify-content: center; font-size: 1.5rem; margin-bottom: 14px; }
.m-tabs-top { display: none; }
.m-iconbtn {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent;
  color: var(--fg-mid); cursor: pointer; font-size: 1.5rem; line-height: 1;
}
.m-iconbtn:hover { background: var(--bg-2); color: var(--fg); text-decoration: none; }
.m-stamp {
  max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 6px;
  height: var(--stamp-h); line-height: 16px;
  font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.m-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-1); border-top: 1px solid var(--border);
}
.m-tabbar__a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 44px; color: var(--muted); font-size: .66rem; font-weight: 650; letter-spacing: .02em;
}
.m-tabbar__a:hover { text-decoration: none; color: var(--fg-mid); }
.m-tabbar__a.is-on { color: var(--accent); }

.m-main { max-width: 1180px; margin: 0 auto; padding: 12px var(--gutter) 28px; min-width: 0; }

/* ---------- 4. Page furniture ------------------------------------------- */
.m-subnav, .m-chipbar {
  display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--gutter)) 12px; padding: 2px var(--gutter);
}
.m-subnav::-webkit-scrollbar, .m-chipbar::-webkit-scrollbar { display: none; }
.m-subnav__a {
  flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 36px;
  padding: 0 15px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border);
  color: var(--fg-mid); font-size: .82rem; font-weight: 650;
}
.m-subnav__a:hover { text-decoration: none; color: var(--fg); }
.m-subnav__a.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.m-pagehead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 10px; min-width: 0; }
.m-pagehead h1 { min-width: 0; }
.m-pagehead__meta { color: var(--muted); font-size: .76rem; }
.m-pagehead__chg { font-size: 1rem; font-weight: 700; }
.m-back {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; margin-left: -10px; border-radius: 12px;
  color: var(--fg-mid); font-size: 1.9rem; line-height: 1;
}
.m-back:hover { background: var(--bg-2); text-decoration: none; }
.m-lede { color: var(--fg-mid); font-size: .86rem; margin: 0 0 12px; }
.m-foot { color: var(--muted); font-size: .74rem; margin: 16px 0 0; }
.m-note { color: var(--muted); font-size: .74rem; margin: 8px 0 0; }
.m-empty { color: var(--muted); font-size: .85rem; margin: 0; padding: 12px 0; }
.m-prose p { font-size: .88rem; color: var(--fg-mid); }
.m-prose p:last-child { margin-bottom: 0; }

.m-sec { margin: 0 0 20px; min-width: 0; }
.m-sec__head { display: flex; align-items: center; gap: 8px; min-height: 30px; margin: 0 0 6px; }
.m-sec__title { margin: 0; font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.m-count { font-family: var(--font-mono); color: var(--fg-mid); letter-spacing: 0; font-weight: 600; }
.m-sec__more { margin-left: auto; display: inline-flex; align-items: center; min-height: 36px; font-size: .8rem; font-weight: 600; color: var(--accent); white-space: nowrap; }
.m-info {
  flex: 0 0 auto; width: 26px; height: 26px; margin: -4px 0; border-radius: 50%;
  border: 1px solid var(--border-hard); background: transparent; color: var(--muted);
  font: italic 700 .72rem/1 Georgia, "Times New Roman", serif; cursor: pointer; padding: 0;
}
.m-info:hover { color: var(--fg); border-color: var(--fg-mid); }
.m-panel { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 14px; }

/* ---------- 5. Lists: rows and cards ------------------------------------ */
.m-list {
  list-style: none; margin: 0; padding: 0; min-width: 0;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.m-list > li + li { border-top: 1px solid var(--border-soft); }
.m-list--tight > li { padding: 0; }

.m-row__link {
  display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(64px, auto);
  align-items: center; gap: 10px; min-height: var(--row-h); padding: 8px 14px; color: inherit;
}
.m-row__link:hover { text-decoration: none; background: var(--bg-2); }
.m-row--static .m-row__link:hover { background: transparent; }
.m-row__id { min-width: 0; display: flex; flex-direction: column; }
.m-row__sym { font-weight: 750; color: var(--fg-strong); font-size: .92rem; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row__name { color: var(--fg-mid); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row__name--strong { color: var(--fg); font-weight: 600; font-size: .84rem; white-space: normal; }
.m-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; color: var(--muted); font-size: .7rem; min-width: 0; }
.m-row__meta .c-chip { font-size: .64rem; padding: 0 6px; }
.m-row__spark { display: block; width: 76px; height: 28px; }
.m-row__nums { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.m-row__val { font-size: .86rem; color: var(--fg); white-space: nowrap; }
.m-row__val small { font-family: var(--font-sans); }
.m-row__chg { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.m-row__rm { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; width: 44px; height: 44px; cursor: pointer; }
.m-row--editable { display: flex; align-items: center; }
.m-row--editable > .m-row__link { flex: 1; min-width: 0; }

.m-spark { width: 100%; height: 100%; display: block; overflow: visible; }
.m-spark__tick { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }

.m-card { padding: 12px 14px; min-width: 0; }
.m-card__link { display: block; margin: -12px -14px; padding: 12px 14px; color: inherit; }
.m-card__link:hover { text-decoration: none; background: var(--bg-2); }
.m-card__top { display: flex; align-items: center; gap: 8px; margin: 0 0 5px; min-width: 0; }
.m-card__kicker { color: var(--fg-mid); font-size: .74rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-card__time { margin-left: auto; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.m-card__sym { font-weight: 750; color: var(--fg-strong); }
.m-card__title { display: block; margin: 0; color: var(--fg); font-size: .9rem; font-weight: 600; line-height: 1.35; }
.m-card__body {
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin: 4px 0 0; color: var(--fg-mid); font-size: .82rem; line-height: 1.4; cursor: pointer;
}
.m-card.is-open .m-card__body { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.m-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; color: var(--muted); font-size: .72rem; min-width: 0; }
.m-card__note { display: block; margin: 6px 0 0; color: var(--muted); font-size: .72rem; font-style: italic; }
.m-card__note--clamp { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.m-card.is-open .m-card__note--clamp { display: block; overflow: visible; }
.m-card__src { font-size: .74rem; font-weight: 600; }
.m-card--sev-critical { box-shadow: inset 3px 0 0 var(--neg); }
.m-card--sev-high { box-shadow: inset 3px 0 0 var(--warn); }
.m-card--cal .m-card__title a { color: var(--fg); }

.m-cal { display: flex; gap: 12px; min-width: 0; }
.m-cal__date { flex: 0 0 76px; font-size: .74rem; color: var(--fg-mid); padding-top: 2px; }
.m-cal__main { flex: 1; min-width: 0; }
.m-daygroup { margin: 0 0 14px; }
.m-daygroup__h { margin: 0 0 6px; font-size: .74rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-mid); }
.m-past { margin: 18px 0 0; }
.m-past > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--fg-mid); font-size: .85rem; font-weight: 600; }

/* "Show more" and filtering */
.is-more:not(.is-shown) { display: none; }
.is-filtered-out { display: none !important; }
.m-morebtn {
  display: block; width: 100%; min-height: 44px; margin: 8px 0 0; padding: 10px;
  border: 1px dashed var(--border-hard); border-radius: 10px; background: transparent;
  color: var(--fg-mid); font: 650 .82rem var(--font-sans); cursor: pointer;
}
.m-morebtn:hover { color: var(--fg); border-style: solid; }

/* ---------- 6. Chips, stats, verdicts, meters, key/value ---------------- */
.c-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px;
  font: 600 .7rem/1.6 var(--font-sans); white-space: nowrap;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--fg-mid);
}
a.c-chip:hover { text-decoration: none; filter: brightness(1.15); }
.c-chip--ok   { background: var(--pos-soft);  border-color: transparent; color: var(--pos); }
.c-chip--warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.c-chip--bad  { background: var(--neg-soft);  border-color: transparent; color: var(--neg); }
.c-chip--info { background: var(--info-soft); border-color: transparent; color: var(--info); }
.c-chip--muted { color: var(--muted); background: transparent; }
.m-chipbtn { flex: 0 0 auto; min-height: 36px; padding: 0 13px; font-size: .78rem; cursor: pointer; }
.m-chipbtn:hover { text-decoration: none; color: var(--fg); }
.m-chipbtn.is-on { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.m-chipbtn__n { font-family: var(--font-mono); opacity: .72; }

.c-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 6px; margin: 0 0 12px; }
.c-stat {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
}
.c-stat__value { font-size: 1rem; font-weight: 650; color: var(--fg-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-stat__label { font-size: .66rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.c-stat--ok  .c-stat__value { color: var(--pos); }
.c-stat--bad .c-stat__value { color: var(--neg); }

.c-verdict {
  display: flex; gap: 10px; margin: 0 0 12px; padding: 10px 14px;
  border: 1px solid var(--border); border-left-width: 3px; border-radius: 10px; background: var(--bg-1);
}
.c-verdict--ok   { border-left-color: var(--pos);  background: var(--pos-soft); }
.c-verdict--bad  { border-left-color: var(--neg);  background: var(--neg-soft); }
.c-verdict--warn { border-left-color: var(--warn); background: var(--warn-soft); }
.c-verdict--info { border-left-color: var(--info); background: var(--info-soft); }
.c-verdict__body { min-width: 0; flex: 1; }
.c-verdict__label { margin: 0; font-weight: 650; font-size: .88rem; color: var(--fg-strong); }
.c-verdict__value { margin-left: 4px; font-weight: 700; }
.c-verdict__note { margin: 3px 0 0; font-size: .8rem; color: var(--fg-mid); }

.m-conv { display: inline-flex; align-items: center; }
.c-meter { position: relative; display: inline-block; width: 56px; height: 5px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.c-meter__fill { display: block; height: 100%; background: var(--fg-mid); border-radius: 3px; }

.c-kv { margin: 0; }
.c-kv__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); min-width: 0; }
.c-kv__row:last-child { border-bottom: 0; }
.c-kv__k { margin: 0; flex: 0 1 46%; color: var(--muted); font-size: .8rem; }
.c-kv__v { margin: 0; min-width: 0; text-align: right; font-family: var(--font-mono); font-feature-settings: var(--num-feat); font-size: .84rem; color: var(--fg); }
.c-kv__v--text { font-family: var(--font-sans); font-size: .8rem; color: var(--fg-mid); }
.c-kv__v small { font-family: var(--font-sans); }
.c-kv__asof { display: block; color: var(--muted-2); font: 500 .64rem var(--font-sans); }
.c-kv__link { font-family: var(--font-sans); }
/* P208: a one-line note under a reading; a news tag; grey 'weak' parts */
.c-kv__sub { display: block; margin-top: 3px; color: var(--muted); font: 500 .68rem/1.35 var(--font-sans); }
.c-kv__tag { padding: 0 6px; font-size: .62rem; margin-right: 4px; vertical-align: 1px; }
.c-kv__v .m-dim { color: var(--muted); }
html[data-theme="light"] .c-kv__v .m-dim { color: var(--muted-2); }

/* ---------- 7. Direction ladder (from theme.css section 21) ------------- */
.c-dirladder { margin: 0 0 14px; }
.c-dirladder__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 6px; }
.c-dirladder__title { font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.c-dirladder__link { font-size: .74rem; color: var(--muted); margin-left: auto; }
.c-dirladder__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin: 0; padding: 0; list-style: none; }
.c-dirladder__cell { min-width: 0; padding: 7px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-1); }
.c-dirladder__h { display: block; font-size: .64rem; color: var(--muted); white-space: nowrap; }
.c-dirladder__v { display: block; font-size: .72rem; font-weight: 650; color: var(--fg); line-height: 1.25; margin-top: 2px; }
.c-dirladder__cell--up   { border-color: var(--pos); background: var(--pos-soft); }
.c-dirladder__cell--up .c-dirladder__v { color: var(--pos); }
.c-dirladder__cell--down { border-color: var(--neg); background: var(--neg-soft); }
.c-dirladder__cell--down .c-dirladder__v { color: var(--neg); }
.c-dirladder__cell--noedge .c-dirladder__v { color: var(--fg-mid); font-weight: 500; }
.c-dirladder__cell--ungraded { border-style: dashed; background: transparent; }
.c-dirladder__cell--ungraded .c-dirladder__v { color: var(--muted); font-weight: 500; }
.c-dirladder__more { margin: 6px 0 0; font-size: .78rem; color: var(--fg-mid); }
.c-dirladder__more summary { cursor: pointer; color: var(--muted); min-height: 36px; display: flex; align-items: center; }
.c-dirladder__more ul { margin: 4px 0 0; padding-left: 1.1rem; }
.c-dirladder__more li { margin: 3px 0; }

/* ---------- 8. Tables: cards on a phone, a table from 480 px ------------ */
.m-tbl__table { display: none; }
.m-tbl.is-table .m-tbl__table { display: block; }
.m-tbl.is-table .m-tbl__cards { display: none; }
.m-viewtoggle { background: none; border: 0; color: var(--accent); font: 650 .78rem var(--font-sans); min-height: 40px; padding: 0; cursor: pointer; }
.c-tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); }
.c-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.c-table th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: .66rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.c-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.c-table tr:last-child td { border-bottom: 0; }
.c-table .num { text-align: right; white-space: nowrap; font-family: var(--font-mono); font-feature-settings: var(--num-feat); }
.m-tcard { padding: 10px 14px; }
.m-tcard__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; }
.m-tcard__title { font-weight: 700; color: var(--fg-strong); min-width: 0; }
.m-tcard__num { font-weight: 700; white-space: nowrap; text-align: right; }
.m-tcard__numlbl { display: block; font-family: var(--font-sans, inherit); font-weight: 500; font-size: .66rem; color: var(--muted); }
.m-tcard__text { margin: 4px 0 0; color: var(--fg-mid); font-size: .8rem; }
.m-tcard__kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; margin: 6px 0 0; }
.m-tcard__kv div { display: flex; justify-content: space-between; gap: 8px; min-width: 0; font-size: .76rem; }
.m-tcard__kv dt { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-tcard__kv dd { margin: 0; text-align: right; font-family: var(--font-mono); font-feature-settings: var(--num-feat); min-width: 0; }

/* ---------- 9. Verticals ------------------------------------------------ */
.m-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.m-tiles > li { display: flex; min-width: 0; }
.m-tiles > li > .m-tile { flex: 1; min-width: 0; }
.m-tile {
  display: flex; flex-direction: column; gap: 6px; min-height: 118px; padding: 12px;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); color: inherit;
}
.m-tile:hover { text-decoration: none; border-color: var(--border-hard); }
.m-tile__top { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.m-tile__name {
  font-weight: 700; color: var(--fg-strong); font-size: .9rem; line-height: 1.25; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.m-tile__chg { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.m-tile__spark { display: block; height: 34px; margin-top: auto; }
.m-tile__meta { font-size: .68rem; color: var(--muted); }

/* ---------- 10. Symbol page --------------------------------------------- */
.m-symhead { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 6px; min-width: 0; }
.m-symhead__id { flex: 1; min-width: 0; }
.m-symhead__sym { font-size: 1.45rem; line-height: 1.2; }
.m-symhead__name { margin: 0; color: var(--fg-mid); font-size: .88rem; }
.m-symhead__meta { margin: 2px 0 0; color: var(--muted); font-size: .72rem; }
.m-star {
  flex: 0 0 auto; min-height: 36px; margin-top: 4px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-hard); background: transparent; color: var(--fg-mid);
  font: 650 .8rem var(--font-sans); cursor: pointer;
}
.m-star::before { content: "\2606"; margin-right: 5px; }
.m-star[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.m-star[aria-pressed="true"]::before { content: "\2605"; }
.m-quote { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 10px; }
.m-quote__last { font-size: 1.95rem; font-weight: 650; color: var(--fg-strong); letter-spacing: -0.01em; }
.m-quote__chg { font-size: 1rem; font-weight: 700; }
.m-quote__asof { color: var(--muted); font-size: .74rem; }

.m-chartbox { margin: 0 0 12px; padding: 8px 8px 8px; background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); }
.m-chart { position: relative; height: 220px; }
.m-chart--mini { height: 90px; }
.m-chart__fallback { position: absolute; inset: 4px; }
.m-chart__legend { min-height: 18px; padding: 0 4px 4px; font-size: .76rem; color: var(--fg-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-chart__note { margin: 6px 4px 0; font-size: .68rem; color: var(--muted); }
.m-rangebar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 8px 0 0; }
.m-rangebtn {
  min-height: 36px; border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: var(--fg-mid); font: 650 .8rem var(--font-mono); cursor: pointer;
}
.m-rangebtn.is-on { background: var(--bg-3); border-color: var(--border-hard); color: var(--fg-strong); }

.m-subtabs {
  position: sticky; top: calc(var(--top-h) + var(--stamp-h) + env(safe-area-inset-top)); z-index: 30;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)) 12px; padding: 0 var(--gutter);
  background: var(--bg-0); border-bottom: 1px solid var(--border);
}
.m-subtabs::-webkit-scrollbar { display: none; }
.m-subtabs__b {
  flex: 0 0 auto; min-height: 44px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--fg-mid); font: 650 .86rem var(--font-sans); cursor: pointer;
}
.m-subtabs__b.is-on { color: var(--fg-strong); border-bottom-color: var(--accent); }

/* ---------- 11. Search, forms, buttons, sheets -------------------------- */
.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font: 700 .9rem var(--font-sans); cursor: pointer; white-space: nowrap;
}
.m-btn:hover { text-decoration: none; filter: brightness(1.08); }
.m-btn--ghost { background: transparent; color: var(--fg); border-color: var(--border-hard); }
.m-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.m-actions form { margin: 0; }

input[type="search"], input[type="text"], input[type="email"], textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border-hard); background: var(--bg-1); color: var(--fg);
  font: 400 1rem var(--font-sans);  /* 16 px: iOS does not zoom a 16 px field */
}
textarea { min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }

.m-searchform { display: flex; gap: 8px; align-items: center; }
.m-searchform input { flex: 1; min-width: 0; }
.m-searchform--page { margin: 0 0 16px; }
.m-searchres { margin-top: 10px; }
.m-sgroup { margin: 14px 0 6px; font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.m-sres a { display: flex; flex-direction: column; min-height: 48px; justify-content: center; padding: 8px 14px; color: inherit; }
.m-sres a:hover { background: var(--bg-2); text-decoration: none; }
.m-sres b { color: var(--fg-strong); font-weight: 700; }
.m-sres span { color: var(--fg-mid); font-size: .78rem; }

.m-form { display: flex; flex-direction: column; gap: 14px; max-width: 34rem; }
.m-form label { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; color: var(--fg-mid); }
.m-form .m-btn { align-self: flex-start; }
.m-alert { margin: 10px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--neg); background: var(--neg-soft); color: var(--fg); font-size: .88rem; }
.m-ok { margin: 10px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--pos); background: var(--pos-soft); color: var(--fg); font-size: .88rem; }

.m-prefs { padding: 12px 14px; }
.m-pref { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 0; }
.m-pref__k { color: var(--fg-mid); font-size: .86rem; }
.m-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--bg-3); }
.m-seg button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--fg-mid); font: 650 .8rem var(--font-sans); cursor: pointer; }
.m-seg button.is-on { background: var(--bg-1); color: var(--fg-strong); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }

.m-sheet { position: fixed; inset: 0; z-index: 60; }
.m-sheet__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .18s ease-out; }
.m-sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto;
  padding: 6px var(--gutter) calc(18px + env(safe-area-inset-bottom));
  background: var(--bg-1); border-top: 1px solid var(--border-hard); border-radius: 18px 18px 0 0;
  transform: translateY(100%); transition: transform .2s ease-out;
}
.m-sheet.is-open .m-sheet__scrim { opacity: 1; }
.m-sheet.is-open .m-sheet__panel { transform: none; }
.m-sheet__grip { width: 38px; height: 4px; margin: 6px auto 10px; border-radius: 2px; background: var(--border-hard); }
.m-sheet__head { display: flex; align-items: center; gap: 8px; }
.m-sheet__title { margin: 0; font-size: 1rem; }
.m-sheet__body { padding: 4px 0; color: var(--fg-mid); font-size: .88rem; line-height: 1.5; white-space: pre-line; }
.m-sheet--search .m-sheet__panel {
  top: 0; bottom: auto; max-height: 92vh; border-top: 0; border-bottom: 1px solid var(--border-hard);
  border-radius: 0 0 18px 18px; padding-top: calc(10px + env(safe-area-inset-top));
  transform: translateY(-100%);
}

.m-skel {
  min-height: var(--row-h);
  background: linear-gradient(90deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-1) 100%);
  background-size: 200% 100%; animation: m-shimmer 1.3s linear infinite;
}
@keyframes m-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- 12. Sign-in ------------------------------------------------- */
.m-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.m-login__card { width: 100%; max-width: 24rem; padding: 26px 22px; text-align: center; background: var(--bg-1); border: 1px solid var(--border); border-radius: 16px; }
.m-login__blurb { color: var(--fg-mid); font-size: .92rem; }
.m-login__form { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 0; }
.m-login__again { margin: 14px 0 0; font-size: .84rem; }
.m-login__foot { margin: 16px 0 0; color: var(--muted); font-size: .76rem; }
.m-code { text-align: center; letter-spacing: .4em; font-family: var(--font-mono); font-size: 1.3rem; }
.m-devhint { margin: 10px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--warn); background: var(--warn-soft); font-size: .84rem; }
.m-devhint code { display: inline-block; margin-top: 4px; font-size: 1.25rem; letter-spacing: .2em; }

/* ---------- 13. Density: compact --------------------------------------- */
html[data-density="compact"] { --row-h: 46px; }
html[data-density="compact"] body { font-size: 14px; }
html[data-density="compact"] .m-row__link { padding-top: 5px; padding-bottom: 5px; }
html[data-density="compact"] .m-card { padding: 9px 12px; }
html[data-density="compact"] .m-card__link { margin: -9px -12px; padding: 9px 12px; }
html[data-density="compact"] .m-sec { margin-bottom: 14px; }

/* ---------- 14. Breakpoints -------------------------------------------- */
@media (max-width: 359px) {
  .m-brand small { display: none; }
  .m-row__link { grid-template-columns: minmax(0, 1fr) minmax(60px, auto); }
  .m-row__spark { display: none; }
  .c-dirladder__row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 480px) {
  .c-stats { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
  .c-stat { padding: 9px 12px; }
  .c-stat__value { font-size: 1.15rem; }
  .m-tbl__cards { display: none; }
  .m-tbl__table { display: block; }
  .m-viewtoggle { display: none; }
  .m-row__link { grid-template-columns: minmax(0, 1fr) 96px minmax(70px, auto); }
  .m-row__spark { width: 96px; }
}
@media (min-width: 600px) {
  .m-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .m-chart { height: 280px; }
}
/* Desktop: the tab bar moves into the top bar and screens get two columns. */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .m-tabbar { display: none; }
  .m-tabs-top { display: flex; gap: 2px; margin-left: 20px; }
  .m-tabs-top a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 8px; color: var(--fg-mid); font-weight: 650; font-size: .88rem; }
  .m-tabs-top a:hover { background: var(--bg-2); color: var(--fg); text-decoration: none; }
  .m-tabs-top a.is-on { color: var(--fg-strong); background: var(--bg-2); box-shadow: inset 0 -2px 0 var(--accent); }
  .m-main { padding: 18px 24px 48px; }
  .m-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
  .m-grid2--flow > .m-sec { min-width: 0; }
  /* A table of five or more columns needs the whole width (P200: the
     Catalyst evidence verdicts wrapped a word per line in half a screen). */
  .m-grid2--flow > .m-sec--wide { grid-column: 1 / -1; }
  .m-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .m-chart { height: 340px; }
  .m-sheet__panel { left: 50%; right: auto; width: min(560px, 100%); transform: translate(-50%, 100%); }
  .m-sheet.is-open .m-sheet__panel { transform: translate(-50%, 0); }
  .m-sheet--search .m-sheet__panel { transform: translate(-50%, -100%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 15. News (P209, 2 Oct) -------------------------------------- */
/* One row per story. Long headlines, outlet names and company names must
   wrap or clip inside the card - never widen the page (the grid-item
   min-width incident: one un-wrappable row sized a 375 px page to 1626 px). */
.m-news { min-width: 0; }
.m-news .m-card__title { overflow-wrap: anywhere; }
.m-news .m-card__meta > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.m-news .m-card .c-chip, .m-news__chips .c-chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.m-news__rank { display: inline-block; min-width: 1.6em; color: var(--muted); font-weight: 600; font-size: .82rem; }
.m-news__kick { display: block; margin: 0 0 4px; color: var(--muted); font-size: .66rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.m-news__hero .m-card__title { font-size: 1.04rem; line-height: 1.3; }
.m-news__rx { display: block; margin-top: 6px; color: var(--fg-mid); font-size: .74rem; overflow-wrap: anywhere; }
.m-news__h1 { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.3; overflow-wrap: anywhere; color: var(--fg-strong); }
.m-news__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; min-width: 0; }
.m-news__touch { margin: 0 0 8px; color: var(--fg-mid); font-size: .8rem; }
.m-news__lead { margin: 0 0 12px; font-size: .86rem; font-weight: 600; overflow-wrap: anywhere; }
/* P210: the summary - the articles' own sentences (story page in full, Today's cards clipped) */
.m-news__sum { margin: 0 0 12px; min-width: 0; }
.m-news__q { margin: 0 0 6px; color: var(--fg); font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.m-news__sum .m-note { margin-top: 2px; }
.m-news__nosum { margin: 0 0 10px; }
.m-news__sum1 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; color: var(--fg-mid); font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; }
.m-news__hero .m-news__sum1 { -webkit-line-clamp: 3; }
.m-news__sum1 .m-news__q { font-size: inherit; color: inherit; }
.m-news__src { color: var(--muted); font-weight: 600; }
.m-newsgroup { margin: 0 0 14px; min-width: 0; }
.m-newsgroup__h { margin: 0 0 6px; font-size: .82rem; font-weight: 700; color: var(--fg); }
.m-newsgroup__h small { font-weight: 500; margin-left: 4px; }
.m-news__co .m-row__link { grid-template-columns: minmax(0, 1fr) auto; }
.m-news__vs { color: var(--muted); font-size: .68rem; white-space: nowrap; }
.m-news__arts > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--fg-mid); font-size: .85rem; font-weight: 600; }
.m-news__arts[open] > summary { margin-bottom: 6px; }
.m-news .c-kv__k a { font-weight: 650; }

/* ---------- 15b. Themes this week + the vertical filter (P212, 5 Oct) ---- */
/* A theme is a <details>: the name, its counts and an articles-a-day strip;
   a tap opens its stories. Names wrap; nothing here may widen a 375 px page. */
.m-theme { padding: 0 14px; min-width: 0; }
.m-theme > details > summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px;
  min-height: 44px; padding: 12px 0; cursor: pointer; list-style: none;
}
.m-theme > details > summary::-webkit-details-marker { display: none; }
.m-theme__name { grid-column: 1 / -1; min-width: 0; color: var(--fg); font-size: .9rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.m-theme__name::after { content: " \25BE"; color: var(--muted); font-size: .72rem; }
.m-theme > details[open] .m-theme__name::after { content: " \25B4"; }
.m-theme .m-card__meta { margin-top: 0; }
.m-theme .m-card__meta > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.m-theme > details > .m-list { margin: 0 0 12px; }
.m-theme > details > .m-note, .m-theme > details > .m-empty { margin: 0 0 8px; }
/* P213: span.m-spark only - the theme's bar strip. Unscoped, this rule also
   shrank every svg.m-spark sparkline (list rows, tiles) to 56 x 22 px. */
span.m-spark { display: flex; align-items: flex-end; gap: 2px; width: 56px; height: 22px; }
span.m-spark i { flex: 1 1 0; min-width: 0; background: var(--fg-mid); opacity: .55; border-radius: 1px 1px 0 0; }
.m-news__vbar a.m-chipbtn { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- 16. Following news on this device (P210, 3 Oct) -------------- */
/* Follow buttons and the "you follow" chips: 44 px tap targets, amber when
   on (amber = selected, as the Watch star), labels clip inside the button so
   a long company name never widens a 375 px page. */
.m-follow { scroll-margin-top: calc(var(--top-h) + var(--stamp-h) + env(safe-area-inset-top) + 8px); }
.m-follow__opts, .m-follow__mine { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; min-width: 0; }
.m-fbtn, .m-fchip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; max-width: 100%; min-width: 0;
  padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-hard);
  background: transparent; color: var(--fg-mid); font: 650 .8rem var(--font-sans);
  cursor: pointer; text-align: left;
}
.m-fbtn::before { content: "\2606"; flex: 0 0 auto; }
.m-fbtn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.m-fbtn[aria-pressed="true"]::before { content: "\2605"; }
.m-fbtn:disabled { opacity: .5; cursor: not-allowed; }
.m-fbtn:hover:not(:disabled), .m-fchip:hover { color: var(--fg); }
.m-fbtn[aria-pressed="true"]:hover:not(:disabled) { color: var(--accent); }
.m-fbtn__k, .m-fchip__k { flex: 0 0 auto; color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.m-fbtn__l, .m-fchip__l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-fbtn__sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 500; font-size: .72rem; }
.m-fbtn__n { flex: 0 0 auto; color: var(--muted); font-size: .7rem; font-weight: 600; }
.m-fchip { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.m-fchip:hover { color: var(--accent); filter: brightness(1.1); }
.m-fchip__x { flex: 0 0 auto; font-size: 1.15rem; line-height: 1; margin-left: 2px; }
.m-follow__lane { margin: 0 0 6px; min-width: 0; }
.m-follow__pick { margin: 6px 0 0; min-width: 0; }
.m-follow__pick .m-fbtn { padding: 0 12px; gap: 5px; font-size: .78rem; }
.m-follow__grp { margin: 0 0 8px; min-width: 0; }
.m-follow__grp .m-morebtn { margin-top: 0; }
.m-follow__pick > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--fg-mid); font-size: .85rem; font-weight: 600; }
.m-follow__h { margin: 6px 0 6px; font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.m-news__fol { flex: 0 0 auto; color: var(--accent); font-size: .7rem; font-weight: 700; white-space: nowrap; }
.m-news__card.is-followed { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- 17. The vertical screen (P213, 6 Oct) ------------------------ */
/* A sticky row of section links under the top bar (it scrolls inside
   itself, never the page); sections land below it, not under it. */
.m-jump {
  position: sticky; top: calc(var(--top-h) + var(--stamp-h) + env(safe-area-inset-top)); z-index: 30;
  display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--gutter)) 12px; padding: 6px var(--gutter);
  background: var(--bg-0); border-bottom: 1px solid var(--border-soft);
}
.m-jump::-webkit-scrollbar { display: none; }
.m-jump__a {
  flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px;
  border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border);
  color: var(--fg-mid); font-size: .8rem; font-weight: 650; white-space: nowrap;
}
.m-jump__a:hover { text-decoration: none; color: var(--fg); }
.m-jump__a.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.m-vsec { scroll-margin-top: calc(var(--top-h) + var(--stamp-h) + env(safe-area-inset-top) + 60px); }
.m-vfollow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; min-width: 0; }
.m-vfollow__link { font-size: .8rem; font-weight: 600; }
.m-vfollow .m-note { flex-basis: 100%; margin: 0; }
.m-vpulse__line { display: flex; align-items: center; gap: 12px; min-width: 0; margin: -4px 0 0; }
.m-vpulse__lbl { color: var(--muted); font-size: .7rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
/* The mood line is a level, not a price: no green/red. */
.m-vpulse__line svg.m-spark { width: 160px; max-width: 50%; height: 30px; flex: 0 1 auto; color: var(--fg-mid); }
.m-why__chg { margin-left: auto; flex: 0 0 auto; font-weight: 700; font-size: .9rem; }
.m-why__stat { margin: 2px 0 0; color: var(--fg-mid); font-size: .76rem; overflow-wrap: anywhere; }
.m-why__list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; min-width: 0; }
.m-why__list li { font-size: .84rem; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; color: var(--fg); }
.m-why__list a { color: var(--fg); }
.m-why__list .c-chip { margin-right: 2px; vertical-align: 1px; }
.m-why__meta { color: var(--muted); font-size: .72rem; }
.m-why .m-note { margin-top: 6px; }
.m-tile__story {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--fg-mid); font-size: .72rem; line-height: 1.35; overflow-wrap: anywhere;
}
.m-tile__story b { color: var(--muted); font-weight: 650; }
.m-since { margin: 0 0 12px; color: var(--info); }
.m-share {
  margin-left: auto; flex: 0 0 auto; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-hard); background: transparent; color: var(--fg-mid);
  font: 650 .78rem var(--font-sans); cursor: pointer;
}
.m-share:hover { color: var(--fg); }
.m-share + .m-share { margin-left: 4px; }    /* P215: Share and Image side by side */
/* Key numbers (P2 card kpis): two a row on a phone, five on a desktop. */
.m-kpis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.m-kpi {
  display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 12px;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius);
}
.m-kpi__lbl {
  color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.m-kpi__val { color: var(--fg-strong); font-size: 1.02rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-kpi__val small { color: var(--muted); font-size: .66rem; font-weight: 600; }
.m-kpi__spark { display: block; height: 26px; }
.m-kpi__meta { color: var(--fg-mid); font-size: .7rem; overflow-wrap: anywhere; }
.m-kpi__date { color: var(--muted); font-size: .64rem; }
@media (min-width: 600px) { .m-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .m-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* How the sector works (P2 card chains). */
.m-chain { list-style: none; margin: 6px 0 12px; padding: 0; display: grid; gap: 10px; min-width: 0; }
.m-chain__step { padding-left: 10px; border-left: 2px solid var(--border-hard); font-size: .84rem; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.m-chain__step b { color: var(--fg); font-weight: 650; }
.m-chain__who { display: block; color: var(--fg-mid); font-size: .74rem; }
.m-chain__risk { display: block; color: var(--muted); font-size: .74rem; }
.m-card.is-new .m-card__title::before {
  content: "New"; display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px;
  background: var(--info-soft); color: var(--info); font-size: .62rem; font-weight: 750;
  letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px;
}

/* ---- P215: glossary page + the glossary link under every "i" note -------- */
.m-sheet__foot { margin: 10px 0 2px; font-size: .8rem; }
.m-gloss { margin: 0; }
.m-gloss__row { padding: 10px 0; border-bottom: 1px solid var(--border-soft); scroll-margin-top: 72px; }
.m-gloss__row:last-child { border-bottom: 0; }
.m-gloss__row:target { background: var(--accent-soft); }
.m-gloss__term { margin: 0; font-weight: 650; color: var(--fg-strong); font-size: .92rem; }
.m-gloss__text { margin: 3px 0 0; color: var(--fg-mid); font-size: .86rem; line-height: 1.5; }

/* ---- P215: offline reading - the saved-copy banner and the saved list ----- */
.m-offline-banner { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-hard);
  background: var(--accent-soft); color: var(--fg); font-size: .82rem; line-height: 1.45; }
.m-saved { margin-top: 14px; text-align: left; }
.m-saved__list { list-style: none; margin: 6px 0 0; padding: 0; }
.m-saved__list li { padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: .9rem; }
.m-saved__when { color: var(--muted); font-size: .76rem; }

/* ---- P215 (MX): more vertical-screen cards - earnings record, rotation,
   what came before big moves, smart money, valuation ranges, inventories.
   No fixed widths: every line wraps at 375 px. ------------------------------ */
.m-vmore .m-card__title, .m-vmore .m-why__stat, .m-vmore .m-card__meta { overflow-wrap: anywhere; }
.m-vmore .m-card__sym { min-width: 0; overflow-wrap: anywhere; }
.m-efacts { display: flex; flex-wrap: wrap; margin-top: 5px; color: var(--fg-mid); font-size: .72rem; line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
.m-efacts > span + span::before { content: "\00b7"; margin: 0 6px; color: var(--muted-2); }
.m-efacts b { font-weight: 700; }
.m-vrot { margin: 0; font-size: .9rem; line-height: 1.45; color: var(--fg); overflow-wrap: anywhere; }
.m-vrot .c-chip { margin-right: 4px; vertical-align: 1px; }
.m-vscore__rule { white-space: normal; overflow: visible; color: var(--fg); font-size: .84rem; font-weight: 600; }
.m-vscore__lift { margin-left: auto; flex: 0 0 auto; font-weight: 700; font-size: .86rem; color: var(--fg-strong); white-space: nowrap; }
/* A name's place in its own range: a neutral track and a dot (no colour - a position is not a call). */
.m-range { position: relative; height: 6px; margin: 10px 6px 4px; border-radius: 3px; background: var(--bg-3); }
.m-range__mid { position: absolute; top: -3px; bottom: -3px; left: 50%; width: 1px; background: var(--border-hard); }
.m-range__dot { position: absolute; top: 50%; width: 12px; height: 12px; margin-left: -6px; transform: translateY(-50%); border-radius: 50%; background: var(--fg-mid); border: 2px solid var(--bg-1); }
.m-range__ends { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .64rem; min-width: 0; }
.m-range__ends span:nth-child(2) { color: var(--fg-mid); font-weight: 650; text-align: center; }
.m-range__ends span:last-child { text-align: right; }
.m-vbal__h { margin: 14px 0 6px; }
