/* ============================================================
   Market Watch — readable newsroom UI.
   - Inter for body, Fraunces for the wordmark only.
   - Sized up for legibility. No italics anywhere.
   - Theme-agnostic vars (layout, fonts) live in :root.
   - Theme-specific vars (colors) live in :root[data-theme=...].
   ============================================================ */

:root {
  /* Layout */
  --mw-pad-y: 56px;
  --mw-pad-x: clamp(20px, 4vw, 56px);
  --mw-content-w: 1120px;
  --mw-radius: 4px;

  /* Fonts: Google-style soft sans for everything except the wordmark */
  --mw-sans:    'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mw-display: 'Fraunces', Georgia, serif;
  --mw-mono:    'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  /* Type scale */
  --mw-size-base:    16px;
  --mw-size-small:   14px;
  --mw-size-xs:      12px;
  --mw-size-label:   11px;
  --mw-size-h3:      18px;
  --mw-size-h2:      24px;
  --mw-size-h1:      32px;
  --mw-line:         1.55;

  /* DARK theme (default — applied when data-theme is "dark" or unset) */
  --mw-bg:        #14110a;
  --mw-bg-2:      #1d1810;
  --mw-bg-3:      #251f14;
  --mw-rule:      #2e2719;
  --mw-rule-2:    #423a28;
  --mw-ink:       #f4e7c0;
  --mw-ink-2:     #c8bea4;
  --mw-ink-3:     #968c75;
  --mw-ink-4:     #5e5645;

  --mw-money:     #7fc69a;
  --mw-money-dim: #4f8f6c;

  --mw-accent:        #e0a94c;
  --mw-accent-soft:   rgba(224, 169, 76, 0.20);
  --mw-accent-faint:  rgba(224, 169, 76, 0.10);

  --mw-up:        #6acf94;
  --mw-up-soft:   rgba(106, 207, 148, 0.20);
  --mw-down:      #e58373;
  --mw-down-soft: rgba(229, 131, 115, 0.20);

  --mw-c-ticker:  #ead8a8;
  --mw-c-num:     #f1e5c2;
  --mw-c-date:    #b0bcdb;
  --mw-c-zone:    #dcb98a;
  --mw-c-event:   #b8c8a8;
  --mw-c-context: #c8a89c;
}

:root[data-theme="light"] {
  /* Muted off-white parchment, soft on the eyes */
  --mw-bg:        #d8cfb2;
  --mw-bg-2:      #cec3a4;
  --mw-bg-3:      #c0b48f;
  --mw-rule:      #a89b76;
  --mw-rule-2:    #8c8060;
  --mw-ink:       #1c1810;
  --mw-ink-2:     #3f3621;
  --mw-ink-3:     #6b6248;
  --mw-ink-4:     #8e8463;

  --mw-money:     #20613f;
  --mw-money-dim: #3a8260;

  --mw-accent:        #8a5a14;
  --mw-accent-soft:   rgba(138, 90, 20, 0.18);
  --mw-accent-faint:  rgba(138, 90, 20, 0.10);

  --mw-up:        #1e7a48;
  --mw-up-soft:   rgba(30, 122, 72, 0.16);
  --mw-down:      #b34528;
  --mw-down-soft: rgba(179, 69, 40, 0.16);

  --mw-c-ticker:  #2e2818;
  --mw-c-num:     #1c1810;
  --mw-c-date:    #2d3956;
  --mw-c-zone:    #5a3e10;
  --mw-c-event:   #2e4520;
  --mw-c-context: #5a2f1e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--mw-bg);
  color: var(--mw-ink);
  font-family: var(--mw-sans);
  font-size: var(--mw-size-base);
  font-weight: 500;
  line-height: var(--mw-line);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "ss01" 1;
}

/* ============================================================
   Always-rendered detail blocks. Hidden until the parent gets .is-open.
   This avoids a full re-render on every expand/collapse click.
   ============================================================ */
.mw-li > .mw-li-detail,
.mw-soc-row > .mw-soc-detail,
.mw-rec > .mw-rec-debate { display: none; }
.mw-li.is-open > .mw-li-detail,
.mw-soc-row.is-open > .mw-soc-detail { display: block; }
.mw-rec.is-open > .mw-rec-debate { display: flex; }
.mw-row-detail { display: none; }
.mw-row-detail.is-open { display: table-row; }

.mw-mono {
  font-family: var(--mw-mono);
  font-feature-settings: "tnum" 1, "zero" 1;
  letter-spacing: -0.01em;
}
.mw-strong { color: var(--mw-c-ticker); font-weight: 600; }
.mw-dim { color: var(--mw-ink-3); }
.is-up   { color: var(--mw-up);   font-weight: 600; }
.is-down { color: var(--mw-down); font-weight: 600; }
.is-strike { opacity: 0.55; }
.is-strike td:not(:first-child):not(:last-child) {
  text-decoration: line-through;
  text-decoration-color: var(--mw-ink-4);
}

.mw-page {
  position: relative; z-index: 1;
  max-width: calc(var(--mw-content-w) + 2 * var(--mw-pad-x));
  margin: 0 auto;
  padding: var(--mw-pad-y) var(--mw-pad-x) 96px;
}

/* ============================================================
   MASTHEAD
   ============================================================ */
.mw-masthead { margin-bottom: 16px; }

/* Top of masthead: wordmark stays centered; gear pinned to the right edge */
.mw-mast-top {
  position: relative;
  padding: 4px 0;
}
.mw-mast-top .mw-wordmark {
  margin: 4px 0;
}
.mw-mast-top .mw-settings-wrap {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.mw-mast-date {
  text-align: center;
  margin: 0;
  font-size: 11.5px;
  color: var(--mw-ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Glossary / Archive / Feedback links inside the gear popover */
.mw-settings-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--mw-rule);
  padding-top: 8px;
  margin-top: 4px;
}
.mw-settings-link {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 4px;
  color: var(--mw-ink-2);
  font-family: var(--mw-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: color 140ms ease, background-color 140ms ease;
}
.mw-settings-link:hover { color: var(--mw-ink); background: var(--mw-rule); }

/* Plain/Pro and Dark/Light pill toggles */
.mw-mode-toggle, .mw-theme-toggle {
  display: inline-flex;
  border: 1px solid var(--mw-rule-2);
  border-radius: 999px;
  padding: 2px;
  font-family: var(--mw-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mw-mode-toggle button, .mw-theme-toggle button {
  border: 0; background: transparent;
  color: var(--mw-ink-3);
  padding: 5px 14px; border-radius: 999px;
  cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  font-weight: 600;
  transition: background-color 140ms ease, color 140ms ease;
}
.mw-mode-toggle button:hover, .mw-theme-toggle button:hover { color: var(--mw-ink); }
.mw-mode-toggle button.is-active {
  background: var(--mw-money);
  color: var(--mw-bg);
  font-weight: 700;
}
.mw-theme-toggle button.is-active {
  background: var(--mw-accent);
  color: var(--mw-bg);
  font-weight: 700;
}

/* Settings icon + popover */
.mw-settings-wrap { position: relative; display: inline-flex; }
.mw-settings-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  padding: 0; border: 0; background: transparent;
  color: var(--mw-ink-3);
  cursor: pointer;
  border-radius: 999px;
  transition: color 140ms ease, background-color 140ms ease;
}
.mw-settings-btn:hover { color: var(--mw-ink); background: var(--mw-rule); }
.mw-settings-pop {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  z-index: 50;
  min-width: 180px;
  padding: 10px 12px;
  background: var(--mw-bg-2);
  border: 1px solid var(--mw-rule-2);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  text-transform: none; letter-spacing: 0;
}
.mw-settings-pop.is-open { display: block; }
.mw-settings-section + .mw-settings-section { margin-top: 10px; }
.mw-settings-label {
  font-family: var(--mw-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mw-ink-3);
  margin-bottom: 5px;
}
.mw-settings-options {
  display: inline-flex;
  border: 1px solid var(--mw-rule-2);
  border-radius: 999px;
  padding: 2px;
  font-family: var(--mw-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.mw-settings-options button {
  border: 0; background: transparent;
  color: var(--mw-ink-3);
  padding: 4px 10px; border-radius: 999px;
  cursor: pointer;
  font: inherit; letter-spacing: inherit;
  text-transform: uppercase; font-weight: 600;
  transition: background-color 140ms ease, color 140ms ease;
}
.mw-settings-options button:hover { color: var(--mw-ink); }
.mw-settings-options button.is-active {
  background: var(--mw-accent);
  color: var(--mw-bg);
  font-weight: 700;
}

.mw-tagline {
  text-align: center;
  margin: 32px 0 8px;
  font-family: var(--mw-mono);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: var(--mw-size-label);
  font-weight: 600;
  color: var(--mw-ink-3);
}
.mw-tagline-rule {
  height: 1px;
  background: var(--mw-rule-2);
  margin: 12px auto 12px;
  max-width: 320px;
}
.mw-wordmark {
  text-align: center;
  font-family: var(--mw-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0.02em;
  line-height: 0.95;
  color: var(--mw-money);
  margin: 12px 0 0;
  font-feature-settings: "ss01" 1;
}

/* Bullet-dot used by .mw-tab-intro-bullets and any future bulleted blocks */
.mw-hb-dot {
  flex: 0 0 14px;
  color: var(--mw-accent);
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}
.mw-wordmark-word { display: inline-block; }
.mw-wordmark-word + .mw-wordmark-word { margin-left: 0.32em; }

/* Direction C: a single BULL/BEAR/NEUTRAL chip on its own row, no REGIME label,
   then the regime_note as a tinted dek (no chip box) directly underneath. */
.mw-regime-row {
  display: flex; justify-content: center;
  margin: 14px 0 0;
}
.mw-regime {
  font-family: var(--mw-mono);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  padding: 5px 14px;
  border: 1px solid;
  border-radius: var(--mw-radius);
}
.mw-regime-bull, .mw-regime-BULL { color: var(--mw-bg); background: var(--mw-up); border-color: var(--mw-up); }
.mw-regime-bear, .mw-regime-BEAR { color: var(--mw-bg); background: var(--mw-down); border-color: var(--mw-down); }
.mw-regime-neutral, .mw-regime-NEUTRAL { color: var(--mw-bg); background: var(--mw-ink); border-color: var(--mw-ink); }
.mw-regime-sm { font-size: 11px; padding: 3px 8px; }

/* regime_note: tinted dek under the BULL chip, no box. Color follows regime. */
.mw-regime-note {
  margin: 10px auto 0;
  max-width: 640px;
  padding: 0 16px;
  font-family: var(--mw-display);
  font-size: clamp(14px, 1.4vw, 16px);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: center;
  text-wrap: balance;
  color: var(--mw-ink-2);
}
.mw-regime-note-BULL,    .mw-regime-note-bull    { color: var(--mw-up); }
.mw-regime-note-BEAR,    .mw-regime-note-bear    { color: var(--mw-down); }
.mw-regime-note-NEUTRAL, .mw-regime-note-neutral { color: var(--mw-accent); }

/* Per-tab intro: 3-5 bullets at the top of each pane */
.mw-tab-intro {
  margin: 0 0 18px;
  padding: 14px 18px;
  background: var(--mw-bg-2);
  border: 1px solid var(--mw-rule);
  border-radius: 12px;
}
.mw-tab-intro-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--mw-ink-2);
}
.mw-tab-intro-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
/* "Show N more" toggle. Desktop renders all bullets in source order, so this
   button is invisible there. Phones see only the first 2 bullets up front. */
.mw-tab-intro-more {
  display: none;
  margin-top: 10px;
  padding: 6px 0;
  background: transparent;
  border: 0;
  color: var(--mw-money);
  font-family: var(--mw-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mw-tab-intro-more:active { opacity: 0.6; }

/* The full-bullets list lives inline as the row's .mw-li-detail so the
   mobile overlay system can find it; it's hidden everywhere except inside
   the slide-in overlay. */
.mw-tab-intro > .mw-tab-intro-detail { display: none; }

/* Overlay-side rendering of the full bullet list — comfortable reading
   width and spacing for a "page of highlights". */
.mw-tab-intro-bullets-all {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--mw-ink);
}
.mw-tab-intro-bullets-all li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

@media (max-width: 720px) {
  .mw-tab-intro {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 14px;
  }
  .mw-tab-intro-bullets { font-size: 14px; }
  /* Phones: hide bullets 3+ inline. The toggle below routes to the overlay
     which renders the full list. */
  .mw-tab-intro .mw-bullet-extra { display: none; }
  .mw-tab-intro-more { display: inline-block; }
}

/* Market status: caption-style strip, no card outline. A small color dot
   (open=green, pre/post=amber, closed=gray) plus a single line of plain text.
   No border or margin — flows directly into Today's Actions below. */
.mw-mstatus {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  margin: 0;
  font-size: 13px;
  color: var(--mw-ink-2);
}
.mw-mstatus::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--mw-ink-4);
  flex: 0 0 8px;
}
.mw-mstatus .mw-pill { display: none; }   /* the inline tier pill is redundant with the dot */
.mw-mstatus-text {
  font-size: 13px;
  color: var(--mw-ink-2);
  font-weight: 500;
}
.mw-mstatus-open::before    { background: var(--mw-up); }
.mw-mstatus-pre::before     { background: var(--mw-accent); }
.mw-mstatus-post::before    { background: var(--mw-accent); }
.mw-mstatus-closed::before  { background: var(--mw-ink-4); }

/* ============================================================
   PILLS / STATUS
   ============================================================ */
.mw-pill {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mw-mono);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  padding: 5px 10px;
  border: 1px solid;
  border-radius: var(--mw-radius);
  white-space: nowrap;
}
.mw-pill-sm { font-size: 10px; padding: 3px 7px; }
.mw-pill-action  { color: var(--mw-up);     border-color: var(--mw-up-soft);     background: var(--mw-up-soft); }
.mw-pill-watch   { color: var(--mw-accent); border-color: var(--mw-accent-soft); background: var(--mw-accent-soft); }
.mw-pill-none    { color: var(--mw-ink-3);  border-color: var(--mw-rule-2);      background: var(--mw-bg-2); }
.mw-pill-long    { color: var(--mw-up);     border-color: var(--mw-up-soft);     background: var(--mw-up-soft); }
.mw-pill-short   { color: var(--mw-down);   border-color: var(--mw-down-soft);   background: var(--mw-down-soft); }
.mw-pill-neutral { color: var(--mw-ink-2);  border-color: var(--mw-rule-2);      background: var(--mw-bg-2); }
.mw-pill-open    { color: var(--mw-up);     border-color: var(--mw-up-soft);     background: var(--mw-up-soft); }

/* Borderless ticker mentions — match the Today's Actions look. The logo sits
   to the left, the symbol next to it, and the trend tone (red/green) colors
   the symbol text. No outline, no fill. */
.mw-tpill {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mw-mono);
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mw-c-ticker);
  border-radius: 0;
  white-space: nowrap;
}
.mw-tpill-sm { font-size: 12px; }

/* Logo + ticker variant: logo sits on the left next to the symbol. */
.mw-tpill-logo { gap: 7px; }
.mw-tpill-logo .mw-tlogo { width: 18px; height: 18px; }
.mw-tpill-sm.mw-tpill-logo { gap: 6px; }
.mw-tpill-sm.mw-tpill-logo .mw-tlogo { width: 14px; height: 14px; }
.mw-tpill-sym { letter-spacing: 0.04em; }

/* Trend tone — colors the symbol text only (no border to recolor any more). */
.mw-tpill-up   { color: var(--mw-up); }
.mw-tpill-down { color: var(--mw-down); }

.mw-status {
  font-family: var(--mw-mono);
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--mw-radius);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.mw-status::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.mw-status-in    { color: var(--mw-accent); background: var(--mw-accent-soft); border: 1px solid var(--mw-accent); }
.mw-status-near  { color: var(--mw-ink-2);  background: var(--mw-bg-3);       border: 1px solid var(--mw-rule-2); }
.mw-status-far   { color: var(--mw-ink-2);  background: transparent;          border: 1px solid var(--mw-rule-2); }
.mw-status-inv   { color: var(--mw-ink-3);  background: transparent;          border: 1px dashed var(--mw-rule-2); }
.mw-status-trig  { color: var(--mw-up);     background: var(--mw-up-soft);    border: 1px solid var(--mw-up); }

/* ============================================================
   TOP ACTIONS
   ============================================================ */
.mw-top-actions {
  margin: 0 0 28px;
  padding: 14px 0 6px;
  border-bottom: 1px solid var(--mw-rule);
}
.mw-eyebrow {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.mw-eyebrow-mark { color: var(--mw-accent); font-size: 14px; }
.mw-eyebrow-text {
  font-size: var(--mw-size-label);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--mw-ink-3);
}
.mw-eyebrow-rule { flex: 1; height: 1px; background: var(--mw-rule); }
.mw-eyebrow-count { font-size: var(--mw-size-label); color: var(--mw-ink-3); font-weight: 600; }

.mw-action-list { list-style: none; margin: 0; padding: 0; }
.mw-action-item { border-bottom: 1px solid var(--mw-rule); }
.mw-action-item:last-child { border-bottom: 0; }
.mw-action-item .mw-li-summary {
  display: grid;
  /* target | chg% | verb pill | text | caret */
  grid-template-columns: minmax(110px, auto) 64px auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  font-size: var(--mw-size-base);
  font-weight: 500;
}
.mw-action-text { color: var(--mw-ink); line-height: 1.45; }

/* Action target: logo + ticker (no pill). Color = today's chg direction. */
.mw-action-target {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.mw-action-target-sym { font-size: 15px; }
.mw-action-target-up   { color: var(--mw-up); }
.mw-action-target-down { color: var(--mw-down); }
.mw-action-target-neutral { color: var(--mw-ink); }
.mw-action-target-text {
  color: var(--mw-ink-2);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mw-action-target-empty { display: inline-block; }

.mw-tlogo {
  width: 22px; height: 22px;
  object-fit: contain;
  background: transparent;
  flex: 0 0 auto;
}

.mw-action-chg {
  font-size: 12px;
  font-weight: 600;
  color: var(--mw-ink-3);
  text-align: right;
}
.mw-action-target-up   ~ .mw-action-chg { color: var(--mw-up); }
.mw-action-target-down ~ .mw-action-chg { color: var(--mw-down); }
.mw-action-chg-empty { display: inline-block; }

/* ============================================================
   TABS — Desktop: segmented pill control, sticky on scroll.
   Mobile: fixed bottom nav bar (defined in the mobile @media block).
   ============================================================ */
#mw-tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  background: var(--mw-bg);
  padding: 12px 0;
  margin: -12px 0 16px;
}
.mw-tabs {
  display: inline-flex;
  background: var(--mw-bg-2);
  border: 1px solid var(--mw-rule-2);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.mw-tab {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  color: var(--mw-ink-3);
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mw-display);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 180ms ease, background-color 180ms ease;
}
.mw-tab-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  opacity: 0.85;
}
.mw-tab-icon svg { width: 18px; height: 18px; }
.mw-tab:hover:not(.is-active) { color: var(--mw-ink-2); background: var(--mw-rule); }
.mw-tab.is-active {
  background: var(--mw-money);
  color: var(--mw-bg);
}
.mw-tab.is-active .mw-tab-icon { opacity: 1; }

/* Mobile bottom-fixed nav. Uses safe-area-inset on iOS. */
@media (max-width: 720px) {
  body { padding-bottom: 70px; }
  #mw-tabs {
    position: fixed;
    top: auto;          /* reset desktop sticky's top:0 — without this the bar stretches to fill the screen */
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    margin: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--mw-bg);
    border-top: 1px solid var(--mw-rule);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: stretch;
  }
  .mw-tabs {
    flex: 1;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    gap: 0;
    display: flex;
  }
  .mw-tab {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .mw-tab-icon { width: 22px; height: 22px; }
  .mw-tab-icon svg { width: 22px; height: 22px; }
  .mw-tab.is-active {
    background: transparent;
    color: var(--mw-money);
  }
  .mw-tab.is-active .mw-tab-icon { color: var(--mw-money); }
  .mw-tab:hover:not(.is-active) { background: transparent; color: var(--mw-ink-2); }
}

/* ============================================================
   GRID & CARDS
   ============================================================ */
.mw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--mw-rule);
  /* No overflow:hidden here so :hover tooltips can extend outside the grid. */
}
.mw-card {
  background: var(--mw-bg-2);
  border-right: 1px solid var(--mw-rule);
  border-bottom: 1px solid var(--mw-rule);
  padding: 22px 22px 18px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.mw-card-span-2 { grid-column: span 2; }
.mw-card-span-3 { grid-column: span 3; }
.mw-grid > .mw-card:nth-child(3n) { border-right: 0; }
.mw-grid > .mw-card-span-2 { border-right: 1px solid var(--mw-rule); }
.mw-grid > .mw-card-span-3 { border-right: 0; }

.mw-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mw-rule);
}
.mw-card-title {
  font-family: var(--mw-mono);
  font-size: var(--mw-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mw-ink-2);
  margin: 0;
  font-weight: 700;
}
.mw-card-count {
  font-family: var(--mw-mono);
  font-size: var(--mw-size-xs);
  color: var(--mw-ink-3);
  font-weight: 600;
}
.mw-card-body { flex: 1; }
.mw-card-footer {
  margin: 16px -22px -18px;
  padding: 14px 22px;
  border-top: 1px solid var(--mw-rule);
  display: flex; align-items: center; gap: 14px;
  background: var(--mw-bg-3);
}
.mw-card-footer-watch { background: var(--mw-accent-faint); }
.mw-card-action-text {
  font-size: var(--mw-size-base);
  color: var(--mw-ink);
  line-height: 1.45;
  font-weight: 500;
}

/* ============================================================
   EXPANDABLE ROWS / LIs
   ============================================================ */
.mw-row.is-clickable, .mw-li.is-clickable { cursor: pointer; }
.mw-row.is-clickable:hover { background: var(--mw-bg-3); }
.mw-row.is-open { background: var(--mw-bg-3); }
.mw-row-detail td {
  padding: 0 !important;
  border-bottom: 1px solid var(--mw-rule);
  background: var(--mw-bg-3);
}
.mw-detail-inner {
  padding: 16px 18px 18px;
  font-size: var(--mw-size-base);
  line-height: 1.6;
  color: var(--mw-ink);
  font-weight: 500;
  border-left: 3px solid var(--mw-money-dim);
  margin-left: 4px;
}

.mw-li.is-clickable .mw-li-summary { transition: color 140ms ease; }
.mw-li.is-clickable:hover .mw-li-summary { color: var(--mw-ink); }
.mw-li.is-open .mw-li-summary { color: var(--mw-ink); }
.mw-li-detail {
  padding: 14px 18px 14px;
  margin: 8px 0 6px;
  font-size: var(--mw-size-base);
  line-height: 1.6;
  color: var(--mw-ink);
  font-weight: 500;
  background: var(--mw-bg-3);
  border-left: 3px solid var(--mw-money-dim);
  border-radius: 0 var(--mw-radius) var(--mw-radius) 0;
}

.mw-caret {
  color: var(--mw-ink-4); font-size: 11px;
  transition: transform 200ms ease, color 200ms ease;
  display: inline-block;
  font-weight: 700;
}
.mw-li.is-open .mw-caret, .mw-row.is-open .mw-caret {
  transform: rotate(180deg); color: var(--mw-money);
}

/* ============================================================
   TABLES
   ============================================================ */
.mw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--mw-size-small);
}
.mw-table th {
  text-align: left;
  font-family: var(--mw-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mw-ink-3);
  font-weight: 700;
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--mw-rule);
}
.mw-table th.r, .mw-table td.r { text-align: right; }
.mw-table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--mw-rule);
  color: var(--mw-ink);
  font-weight: 500;
  vertical-align: middle;
}
.mw-table tr:last-child td { border-bottom: 0; }
.mw-table-watch td { padding: 14px 12px 14px 0; }
.mw-table td.r.mw-mono { color: var(--mw-c-num); }
.mw-trigger { color: var(--mw-c-zone); font-size: var(--mw-size-small); font-weight: 500; }
.mw-table td.mw-dim { color: var(--mw-ink-2); }

.mw-spark { display: block; }
.mw-spark-up   { color: var(--mw-up); }
.mw-spark-down { color: var(--mw-down); }
.mw-spark-flat { color: var(--mw-ink-3); }

/* ============================================================
   KV DL (vol & yields)
   ============================================================ */
.mw-kv {
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--mw-rule);
}
.mw-kv > div {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--mw-rule);
}
.mw-kv > div:nth-child(odd)  { padding-right: 14px; border-right: 1px solid var(--mw-rule); }
.mw-kv > div:nth-child(even) { padding-left: 14px; }
.mw-kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.mw-kv dt {
  font-family: var(--mw-mono);
  font-size: var(--mw-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mw-ink-2);
  font-weight: 700;
  margin: 0;
}
.mw-kv dd {
  margin: 0;
  font-size: var(--mw-size-base);
  color: var(--mw-c-num);
  font-weight: 600;
}

/* ============================================================
   ROTATION
   ============================================================ */
.mw-rot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.mw-rot-head {
  font-family: var(--mw-mono);
  font-size: var(--mw-size-label);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mw-ink-2);
  font-weight: 700;
  margin-bottom: 8px;
}
.mw-rot-list { list-style: none; margin: 0; padding: 0; }
.mw-rot-row {
  display: grid;
  grid-template-columns: 44px 1fr 64px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: var(--mw-size-small);
  font-weight: 500;
}
.mw-rot-bar {
  position: relative; height: 7px;
  background: var(--mw-bg-3);
  border-radius: 4px;
  overflow: hidden;
}
.mw-rot-fill { display: block; height: 100%; }
.mw-rot-fill.mw-up   { background: var(--mw-up); }
.mw-rot-fill.mw-down { background: var(--mw-down); }
.mw-rot-row .mw-mono:last-child { text-align: right; }
.mw-rot-read {
  margin: 16px 0 0;
  font-size: var(--mw-size-base);
  color: var(--mw-ink);
  font-weight: 500;
  line-height: 1.5;
  padding-top: 14px;
  border-top: 1px solid var(--mw-rule);
}

/* ============================================================
   CALENDAR / EARNINGS LIST
   ============================================================ */
.mw-cal { list-style: none; margin: 0; padding: 0; }
.mw-cal-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--mw-rule);
  font-size: var(--mw-size-small);
  font-weight: 500;
}
.mw-li:last-child .mw-cal-row { border-bottom: 0; }
.mw-cal-row-3 { grid-template-columns: 96px auto 1fr !important; }
.mw-cal-date { color: var(--mw-c-date); font-size: var(--mw-size-xs); font-weight: 600; }
.mw-cal-event { color: var(--mw-ink); font-weight: 500; }

/* ============================================================
   CHIPS (smart money)
   ============================================================ */
.mw-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================================
   RANK (WSB)
   ============================================================ */
.mw-rank { list-style: none; margin: 0; padding: 0; }
.mw-rank-row {
  display: grid;
  grid-template-columns: 28px 64px 1fr 40px;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  font-size: var(--mw-size-small);
  font-weight: 500;
}
.mw-rank-i { color: var(--mw-ink-4); font-size: var(--mw-size-xs); font-weight: 600; }
.mw-rank-bar { height: 5px; background: var(--mw-bg-3); border-radius: 3px; overflow: hidden; }
.mw-rank-fill { display: block; height: 100%; background: var(--mw-accent); opacity: 0.85; }
.mw-rank-row .mw-mono:last-child { text-align: right; font-size: var(--mw-size-xs); font-weight: 600; }

/* ============================================================
   STATUS MIX
   ============================================================ */
.mw-statmix { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mw-statmix-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--mw-rule);
}
.mw-statmix-row:last-child { border-bottom: 0; }
.mw-statmix-label {
  font-size: 13px;
  color: var(--mw-ink-2);
  font-weight: 500;
}
.mw-statmix-n {
  color: var(--mw-ink);
  font-family: var(--mw-mono);
  font-size: 14px;
  font-weight: 700;
}

/* Reusable card-body explainer paragraph (the small grey text under a card title
   that says what the card actually contains). */
.mw-card-explainer {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mw-ink-3);
}

/* Robinhood directive inside Today's Actions: small, tinted, prominent.
   Sits on its own line below the headline so the reader sees the literal
   trade to place without expanding the row. */
.mw-action-rh {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
  padding: 8px 12px;
  background: var(--mw-money);
  border-radius: var(--mw-radius);
  color: var(--mw-bg);
}
.mw-action-rh-label {
  font-family: var(--mw-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mw-bg);
  opacity: 0.85;
}
.mw-action-rh-text {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--mw-bg);
}
.mw-action-rh-block {
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--mw-up-soft);
  border-left: 3px solid var(--mw-money);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mw-ink);
}
.mw-action-rh-block strong {
  color: var(--mw-money);
  font-family: var(--mw-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 6px;
}

/* Global Top Picks block (between Today's Actions and the per-tab pane).
   Same visual as the per-tab card, just slightly more emphasis. */
#mw-toppicks { margin: 0 0 28px; }
#mw-toppicks .mw-rec-card {
  background: var(--mw-bg-2);
  border: 1px solid var(--mw-rule);
  border-radius: 12px;
}

/* ============================================================
   MOVERS
   ============================================================ */
.mw-movers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--mw-rule-2);
}
.mw-movers-col + .mw-movers-col { border-left: 1px solid var(--mw-rule-2); }
.mw-movers-head {
  padding: 10px 16px;
  font-family: var(--mw-mono);
  font-size: var(--mw-size-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid var(--mw-rule);
  background: var(--mw-bg-2);
}
.mw-movers-head-up   { color: var(--mw-up);   }
.mw-movers-head-down { color: var(--mw-down); }
.mw-mover-list { list-style: none; margin: 0; padding: 0; }
.mw-mover-list .mw-li { border-bottom: 1px solid var(--mw-rule); }
.mw-mover-list .mw-li:last-child { border-bottom: 0; }
.mw-mover-row {
  display: grid;
  grid-template-columns: auto 70px 70px 70px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.mw-mover-pct  { font-size: var(--mw-size-base); font-weight: 700; text-align: right; }
.mw-mover-last { color: var(--mw-ink-2); font-size: var(--mw-size-small); text-align: right; font-weight: 500; }
.mw-mover-note { color: var(--mw-ink); font-size: var(--mw-size-small); line-height: 1.45; font-weight: 500; }

@media (max-width: 900px) {
  .mw-movers { grid-template-columns: 1fr; }
  .mw-movers-col + .mw-movers-col { border-left: 0; border-top: 1px solid var(--mw-rule-2); }
}
@media (max-width: 720px) {
  /* Mobile mover row: ticker · sparkline · change% · chevron only.
     Last price and note move to the detail overlay. */
  .mw-mover-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
  }
  .mw-mover-row > .mw-tpill { flex: 1 1 auto; }
  .mw-mover-row > .mw-spark { flex: 0 0 56px; height: 18px; }
  .mw-mover-pct  { flex: 0 0 auto; font-size: 13.5px; }
  .mw-mover-last { display: none; }
  .mw-mover-note { display: none; }
}

.mw-empty {
  color: var(--mw-ink-2);
  font-size: var(--mw-size-base);
  font-weight: 500;
  line-height: 1.5;
}
.mw-empty-pad { padding: 28px 0; text-align: center; color: var(--mw-ink-3); font-size: var(--mw-size-small); }
.mw-soon {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 40px 24px;
  text-align: center;
}
.mw-soon-tag {
  font-family: var(--mw-mono);
  font-size: var(--mw-size-xs);
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 5px 12px;
  border: 1px solid var(--mw-rule-2);
  border-radius: var(--mw-radius);
  color: var(--mw-ink-2);
}
.mw-soon-text {
  font-size: var(--mw-size-h3);
  color: var(--mw-ink);
  margin: 0; max-width: 480px; line-height: 1.5;
  font-weight: 500;
}
.mw-soon-list {
  display: flex; gap: 10px; align-items: center;
  font-size: var(--mw-size-xs); color: var(--mw-ink-3);
}

/* ============================================================
   GLOSSARY TOOLTIP
   ============================================================ */
.mw-glossy {
  position: relative;
  border-bottom: 1px dotted var(--mw-ink-3);
  cursor: help;
}
.mw-glossy:hover, .mw-glossy:focus {
  color: var(--mw-accent);
  border-bottom-color: var(--mw-accent);
  outline: none;
}
.mw-glossy::after {
  content: attr(data-tt);
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  z-index: 50;
  width: max-content; max-width: 280px;
  background: var(--mw-ink); color: var(--mw-bg);
  padding: 12px 14px;
  border-radius: var(--mw-radius);
  font-family: var(--mw-sans);
  font-size: var(--mw-size-small);
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}
.mw-glossy:hover::after, .mw-glossy:focus::after {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ============================================================
   SOCIAL SENTIMENT (per tab)
   ============================================================ */
.mw-soc-card { background: var(--mw-bg-2); }
.mw-soc-head {
  display: grid;
  grid-template-columns: 1fr 90px 100px auto;
  gap: 14px;
  align-items: center;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--mw-rule);
  font-family: var(--mw-mono);
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 700;
  color: var(--mw-ink-3);
}
.mw-soc-h-mentions { text-align: right; }
.mw-soc-h-sent { text-align: center; }
.mw-soc-list { list-style: none; margin: 0; padding: 0; }
.mw-soc-row {
  border-bottom: 1px solid var(--mw-rule);
  cursor: pointer;
  transition: background-color 140ms ease;
}
.mw-soc-row:last-child { border-bottom: 0; }
.mw-soc-row.is-open,
.mw-soc-row:hover { background: var(--mw-bg-3); }
.mw-soc-summary {
  display: grid;
  grid-template-columns: 1fr 90px 100px auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  font-size: var(--mw-size-small);
  font-weight: 500;
}
.mw-soc-mentions { text-align: right; color: var(--mw-c-num); font-size: var(--mw-size-small); font-weight: 600; }
.mw-soc-sentiment {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--mw-radius);
  background: var(--mw-bg-3);
  text-align: center;
}
.mw-soc-sentiment.is-up      { color: var(--mw-up);     background: var(--mw-up-soft); }
.mw-soc-sentiment.is-down    { color: var(--mw-down);   background: var(--mw-down-soft); }
.mw-soc-sentiment.is-neutral { color: var(--mw-accent); background: var(--mw-accent-soft); }
.mw-soc-sentiment.mw-dim     { color: var(--mw-ink-3); }
.mw-soc-row.is-open .mw-caret { transform: rotate(180deg); color: var(--mw-money); }
.mw-soc-detail {
  padding: 14px 18px 16px;
  background: var(--mw-bg-3);
  border-left: 3px solid var(--mw-money-dim);
  margin-left: 4px;
  font-size: var(--mw-size-base);
  line-height: 1.6;
  color: var(--mw-ink);
  font-weight: 500;
}
@media (max-width: 720px) {
  .mw-soc-head, .mw-soc-summary {
    grid-template-columns: 1fr 60px 80px auto;
    gap: 10px;
    font-size: var(--mw-size-xs);
  }
}

/* ============================================================
   RECOMMENDATIONS (Top picks: buy / sell)
   ============================================================ */
.mw-rec-card { background: var(--mw-bg-2); }
.mw-rec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--mw-rule-2);
}
.mw-rec-grid > div + div { border-left: 1px solid var(--mw-rule-2); }
.mw-rec-head {
  padding: 10px 16px;
  font-family: var(--mw-mono);
  font-size: var(--mw-size-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid var(--mw-rule);
  background: var(--mw-bg-2);
}
.mw-rec-head-up   { color: var(--mw-up); }
.mw-rec-head-down { color: var(--mw-down); }

.mw-rec-list { list-style: none; margin: 0; padding: 0; }
.mw-rec { border-bottom: 1px solid var(--mw-rule); }
.mw-rec:last-child { border-bottom: 0; }
/* Recommendation row visual rhythm matches Today's Actions:
   Row 1: ticker (logo+symbol, borderless) | verdict pill | confidence badge | caret
   Row 2: pros first-sentence (full-width, dim, line-clamped)
   Vehicle moves into the detail block. */
.mw-rec-summary {
  display: grid;
  grid-template-columns: minmax(0, max-content) auto auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 6px;
  padding: 14px 16px;
  font-size: var(--mw-size-small);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease;
}
.mw-rec-summary > * { min-width: 0; }
.mw-rec-tk-cell  { grid-column: 1; grid-row: 1; display: inline-flex; align-items: center; }
.mw-rec-summary > .mw-pill,
.mw-rec-summary > .mw-rec-meta > .mw-pill { grid-column: 2; grid-row: 1; }
.mw-rec-summary > .mw-rec-conf,
.mw-rec-summary > .mw-rec-meta > .mw-rec-conf { grid-column: 3; grid-row: 1; }
.mw-rec-meta {
  grid-column: 2 / 4;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mw-rec-summary-text {
  margin: 0;
  grid-column: 1 / -1;
  grid-row: 2;
  color: var(--mw-ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  line-height: 1.5;
  font-size: 13.5px;
}
.mw-rec-summary > .mw-caret { grid-column: 5; grid-row: 1; color: var(--mw-ink-3); }

@media (max-width: 720px) {
  .mw-rec-summary { padding: 12px 4px; column-gap: 10px; }
  .mw-rec-meta { gap: 6px; flex-wrap: wrap; }
  .mw-rec-summary-text { -webkit-line-clamp: 3; }
}
.mw-rec.is-open .mw-rec-summary,
.mw-rec-summary:hover { background: var(--mw-bg-3); }
.mw-rec-tk {
  font-family: var(--mw-mono);
  font-size: var(--mw-size-small);
  font-weight: 700;
  color: var(--mw-c-ticker);
  letter-spacing: 0.02em;
  /* Long trade names ("AMD 5/16 365/380 call spread") wrap inside the
     capped column instead of pushing the verdict pill off the row. */
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.mw-rec-conf {
  display: inline-flex; align-items: center;
  font-family: var(--mw-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--mw-radius);
  white-space: nowrap;
  cursor: help;
  position: relative;
}
.mw-rec-conf-high { color: var(--mw-up);     background: var(--mw-up-soft); }
.mw-rec-conf-med  { color: var(--mw-accent); background: var(--mw-accent-soft); }
.mw-rec-conf-low  { color: var(--mw-ink-3);  background: var(--mw-bg-3); }

/* Hover tooltip on the confidence badge (instant, styled to match glossary) */
.mw-rec-conf[data-tt]::after {
  content: attr(data-tt);
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  z-index: 50;
  width: max-content; max-width: 280px;
  background: var(--mw-ink); color: var(--mw-bg);
  padding: 12px 14px;
  border-radius: var(--mw-radius);
  font-family: var(--mw-sans);
  font-size: var(--mw-size-small);
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}
.mw-rec-conf[data-tt]:hover::after,
.mw-rec-conf[data-tt]:focus::after {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* Confidence label color in the expansion row (Pros/Cons/Confidence) */
.mw-rec-debate-label-high { color: var(--mw-up); }
.mw-rec-debate-label-med  { color: var(--mw-accent); }
.mw-rec-debate-label-low  { color: var(--mw-ink-3); }

/* The "Why this score" reason text inside the confidence row */
.mw-rec-conf-reason {
  display: block;
  margin-top: 6px;
  font-size: var(--mw-size-small);
  color: var(--mw-ink-2);
  font-weight: 500;
}
.mw-rec-vehicle {
  font-size: var(--mw-size-xs);
  color: var(--mw-ink-3);
  font-weight: 500;
}
.mw-rec-summary-text {
  color: var(--mw-ink);
  font-size: var(--mw-size-small);
  line-height: 1.45;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mw-rec.is-open .mw-rec-summary-text { white-space: normal; }
.mw-rec.is-open .mw-caret { transform: rotate(180deg); color: var(--mw-money); }

.mw-rec-debate {
  padding: 14px 18px 18px;
  background: var(--mw-bg-3);
  border-left: 3px solid var(--mw-money-dim);
  margin-left: 4px;
  display: flex; flex-direction: column; gap: 12px;
}

/* Wheel candidates: small explainer + per-row inline metadata + stats grid in detail */
.mw-wheel-explainer {
  font-size: var(--mw-size-small);
  color: var(--mw-ink-2);
  line-height: 1.5;
  margin: 0 0 14px;
  padding: 10px 14px;
  background: var(--mw-bg-3);
  border-left: 2px solid var(--mw-accent-soft);
  border-radius: 2px;
}
.mw-wheel .mw-rec-summary {
  flex-wrap: wrap;
  row-gap: 6px;
}
.mw-wheel-csp {
  font-size: var(--mw-size-xs);
  color: var(--mw-c-num);
  white-space: nowrap;
}
.mw-wheel-yield {
  font-size: var(--mw-size-xs);
  font-weight: 700;
  color: var(--mw-up);
  padding: 2px 7px;
  border-radius: var(--mw-radius);
  background: var(--mw-up-soft);
  white-space: nowrap;
}
.mw-wheel-erwarn {
  font-size: var(--mw-size-xs);
  font-weight: 700;
  color: var(--mw-down);
  padding: 2px 7px;
  border-radius: var(--mw-radius);
  background: var(--mw-down-soft);
  white-space: nowrap;
}
.mw-wheel-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px 18px;
  font-size: var(--mw-size-xs);
  color: var(--mw-ink-2);
  padding: 8px 0;
  border-bottom: 1px solid var(--mw-rule);
  margin-bottom: 4px;
}
.mw-wheel-stats > span {
  white-space: nowrap;
}
.mw-rec-debate-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: baseline;
}
.mw-rec-debate-label {
  font-family: var(--mw-mono);
  font-size: var(--mw-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--mw-ink-2);
}
.mw-rec-debate-label.is-up   { color: var(--mw-up); }
.mw-rec-debate-label.is-down { color: var(--mw-down); }
.mw-rec-debate-text {
  margin: 0;
  font-size: var(--mw-size-base);
  line-height: 1.55;
  color: var(--mw-ink);
  font-weight: 500;
}

@media (max-width: 720px) {
  .mw-rec-grid { grid-template-columns: 1fr; }
  .mw-rec-grid > div + div { border-left: 0; border-top: 1px solid var(--mw-rule-2); }
  /* Mobile rec row: ticker | verdict pill | caret only. Confidence badge,
     vehicle, and the pros first-sentence summary all move to the detail page.
     Switch to flex so the caret sits flush right without a fixed grid column. */
  .mw-rec-summary {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .mw-rec-tk-cell { flex: 0 0 auto; min-width: 0; }
  .mw-rec-meta { flex: 0 0 auto; }
  .mw-rec-summary > .mw-caret { flex: 0 0 auto; margin-left: auto; }
  .mw-rec-vehicle { display: none; }
  .mw-rec-conf { display: none; }
  .mw-rec-summary-text { display: none; }
  .mw-rec-debate-row { grid-template-columns: 1fr; gap: 4px; }

  /* Hard guarantee: nothing scrolls horizontally on phone. */
  html, body { overflow-x: hidden; max-width: 100vw; }
  .mw-app { padding-left: 16px; padding-right: 16px; }
  .mw-card { min-width: 0; max-width: 100%; }
  .mw-card-body { min-width: 0; max-width: 100%; overflow-x: hidden; }
  .mw-spark { max-width: 100%; }

  /* On desktop the .mw-grid is a 3-column container with shared internal
     borders, so its own outer 1px border closes the frame. On phones the
     cards stack vertically with their own rounded border + bg, which makes
     the grid's outer border read as a redundant "box around the boxes". */
  .mw-grid { border: 0; }

  /* Mobile detail overlay (per-ticker subpages): vertical scroll only. The
     content side blocks horizontal scroll the same way the main page does. */
  .mw-detail-overlay,
  .mw-detail-content { overflow-x: hidden; max-width: 100vw; }
  .mw-detail-content > * { max-width: 100%; box-sizing: border-box; }
  .mw-detail-summary-echo { box-sizing: border-box; }

  /* Cards feel like grouped lists in iOS Settings. */
  .mw-card {
    background: var(--mw-bg-2);
    border-radius: 14px;
    padding: 4px 16px;
    margin-bottom: 14px;
    border: 1px solid var(--mw-rule);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  }
  .mw-card-head {
    padding: 14px 0 8px;
    border-bottom: 1px solid var(--mw-rule);
    margin-bottom: 4px;
  }
  .mw-card-body { padding: 0; }
  .mw-card-footer { padding: 10px 0 14px; }

  /* Mobile rows are reduced to the bare essentials. Tap routes to the
     full-screen detail overlay — supplemental fields (trigger zone, note,
     RSI, context, etc.) live there, not on the list. The list shows:
        [ticker]  [sparkline]  [change %]  [status pill]  [chevron]
     For tables that don't have all four, only what's present renders. */
  .mw-table, .mw-table tbody { display: block; width: 100%; }
  .mw-table thead { display: none; }
  .mw-table tr {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--mw-rule);
    min-height: 52px;
  }
  .mw-table tr:last-child { border-bottom: 0; }
  .mw-table td {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--mw-ink);
    text-align: left;
    min-width: 0;
  }
  /* Ticker — first cell, takes the available space on the left */
  .mw-table tr td:first-child {
    flex: 1 1 auto;
    font-size: 14.5px;
    font-weight: 600;
  }
  /* Sparkline cell — visible on mobile (small inline graph). */
  .mw-table tr td:nth-child(2) {
    flex: 0 0 auto;
    display: inline-flex;
  }
  .mw-table tr td:nth-child(2):empty { display: none; }
  .mw-table tr td:nth-child(2) .mw-spark {
    width: 56px;
    height: 18px;
  }
  /* Numeric cells (Last + Δ): keep ONLY the last one on mobile (the change %)
     since both share the right side and we want a single-line look. */
  .mw-table tr td.r {
    flex: 0 0 auto;
    text-align: right !important;
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
    color: var(--mw-c-num);
    white-space: nowrap;
  }
  /* When two .r cells exist (Last + Δ) hide the first ($ price) — change %
     is the more useful signal at a glance. The full last price is in the detail. */
  .mw-table tr td.r:not(:last-of-type) { display: none; }
  /* For non-watchlist tables (ETFs, options unusual flow, etc.) the last
     numeric cell is RSI / vol-OI / similar — not a change %. The user's spec
     for the row is icon, name, %, action, sparkline only, so hide every .r
     cell on tables that don't carry a change %. Watchlist keeps its Δ. */
  .mw-table:not(.mw-table-watch) tr td.r { display: none; }
  /* Trigger zone, note, context, RSI text cells — hidden. Status pill cell
     stays visible because it's a small action chip the user wants on the list. */
  .mw-table tr td:nth-child(5),
  .mw-table tr td:nth-child(7),
  .mw-table tr td:last-child:not(.r):not(:first-child) {
    display: none;
  }
  /* Status pill cell (watchlist col 6) keeps showing — it has the
     TRIGGERED/FAR/NEAR/INVALID chip the user uses to scan. */
  .mw-table tr td:nth-child(6) {
    display: inline-flex;
    flex: 0 0 auto;
  }
  /* Append a chevron pseudo-element to every clickable row */
  .mw-row.is-clickable::after {
    content: "›";
    flex: 0 0 auto;
    font-family: var(--mw-mono);
    color: var(--mw-ink-4);
    font-size: 18px;
    line-height: 1;
    margin-left: 2px;
  }
  /* Detail rows (inline expansion) are not used on mobile — tap routes to
     the full-screen overlay instead. Hide the detail twin row entirely. */
  .mw-table tr.mw-row-detail { display: none !important; }
  .mw-detail-inner { padding: 14px 14px 16px; margin-top: 4px; border-radius: 10px; }

  /* Tappable rows: subtle press feedback like iOS */
  .mw-row.is-clickable { transition: background-color 120ms ease; }
  .mw-row.is-clickable:active { background: var(--mw-bg-3); }

  /* List items (recommendations, etc.) get the same iOS-list treatment */
  .mw-li {
    padding: 14px 0;
    min-height: 56px;
    border-bottom: 1px solid var(--mw-rule);
  }
  .mw-li:last-child { border-bottom: 0; }
  .mw-li-detail { border-radius: 10px; }

  /* Card titles read as section headers, not buried */
  .mw-card-title {
    font-size: 17px;
    font-weight: 700;
  }

  /* Headline / regime / hero copy gets a touch more breathing room */
  /* No outline on tap; replaced by background flash above */
  button { -webkit-tap-highlight-color: transparent; }

  /* Smooth momentum scroll inside any internal scrollers (unlikely now) */
  body { -webkit-overflow-scrolling: touch; }

  /* Native-feeling typography on mobile (SF Pro on iOS, Roboto on Android) */
  body, .mw-app {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }
  .mw-mono {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  }

  /* Bottom-nav tap feedback: scale + color flash */
  #mw-tabs .mw-tab {
    -webkit-tap-highlight-color: transparent;
    transition: transform 80ms ease, color 120ms ease;
  }
  #mw-tabs .mw-tab:active { transform: scale(0.92); }

  /* Card titles slightly larger / more presence */
  .mw-eyebrow-text { font-size: 11px; }
}

/* ============================================================
   Page-level polish (all viewports): tab-switch fade-in,
   smooth scrolling, reduced-motion respect.
   ============================================================ */
@keyframes mw-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
#mw-main > * {
  animation: mw-fade-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-reduced-motion: reduce) {
  #mw-main > * { animation: none; }
  html { scroll-behavior: auto; }
}
html { scroll-behavior: smooth; }
/* Disable double-tap-to-zoom on phones for a native-app feel. Pinch-zoom is
   still allowed (accessibility-safe). */
html, body { touch-action: manipulation; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ============================================================
   MOBILE DETAIL OVERLAY
   Phones only. Full-screen panel slides in from the right when the user
   taps a row. Hardware back button and edge swipe close it via popstate.
   ============================================================ */
.mw-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--mw-bg);
  display: none;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  overscroll-behavior: contain;
}
.mw-detail-overlay.is-open {
  transform: translateX(0);
}
@media (max-width: 720px) {
  .mw-detail-overlay { display: flex; }
}
.mw-detail-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  border-bottom: 1px solid var(--mw-rule);
  background: var(--mw-bg);
  flex: 0 0 auto;
}
.mw-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 4px;
  background: transparent;
  border: 0;
  color: var(--mw-money);
  font-family: var(--mw-display);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
}
.mw-detail-back:active { background: var(--mw-bg-3); }
.mw-detail-title {
  flex: 1;
  text-align: center;
  font-family: var(--mw-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--mw-ink);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  /* The title slot inherits the row's summary innerHTML; truncate gracefully. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}
/* Inside the title we only want the ticker pill, not the rest of the summary. */
.mw-detail-title .mw-tpill { font-size: 14px; }
.mw-detail-title :not(.mw-tpill):not(.mw-tlogo):not(.mw-tpill-sym):not(.mw-detail-title-text):not(svg):not(path):not(image) {
  display: none;
}
.mw-detail-title-text {
  font-family: var(--mw-display);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Vol & Yields list — tappable rows mirroring the watchlist row shape. */
.mw-vol-list, .mw-sm-list { list-style: none; margin: 0; padding: 0; }
.mw-vol-list .mw-li, .mw-sm-list .mw-li {
  border-bottom: 1px solid var(--mw-rule);
}
.mw-vol-list .mw-li:last-child, .mw-sm-list .mw-li:last-child { border-bottom: 0; }
.mw-vol-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  font-size: var(--mw-size-base);
  font-weight: 500;
}
.mw-vol-label {
  flex: 1 1 auto;
  color: var(--mw-ink);
  font-weight: 600;
}
.mw-vol-value {
  flex: 0 0 auto;
  color: var(--mw-c-num);
  font-variant-numeric: tabular-nums;
}
.mw-sm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
}
.mw-sm-row > .mw-tpill { flex: 1 1 auto; justify-content: flex-start; }
.mw-sm-count {
  flex: 0 0 auto;
  color: var(--mw-ink-3);
  font-size: var(--mw-size-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mw-sm-signals {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px;
}
.mw-sm-signal {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: var(--mw-radius);
  background: var(--mw-bg-3);
  color: var(--mw-ink-2);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.mw-detail-text {
  margin: 0;
  font-size: var(--mw-size-base);
  line-height: 1.55;
  color: var(--mw-ink);
}

/* Per-ticker "no-action thesis" panel. Renders above the detail prose
   on rows the skill flagged as WAIT/WATCH/HOLD. Layout is a stance pill
   on top, then label + text rows for Why/Waiting for/Watching/Expecting. */
.mw-thesis {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px 16px;
  background: var(--mw-bg-2);
  border: 1px solid var(--mw-rule);
  border-left: 3px solid var(--mw-money-dim);
  border-radius: 10px;
}
.mw-thesis-stance {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 2px;
}
.mw-thesis-stance-pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mw-thesis-stance-wait    { color: var(--mw-accent); background: var(--mw-accent-soft); }
.mw-thesis-stance-watch   { color: var(--mw-accent); background: var(--mw-accent-soft); }
.mw-thesis-stance-hold    { color: var(--mw-ink-2);  background: var(--mw-bg-3); }
.mw-thesis-stance-neutral { color: var(--mw-ink-2);  background: var(--mw-bg-3); }
.mw-thesis-stance-note {
  color: var(--mw-ink-3);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.mw-thesis-row {
  display: grid;
  gap: 4px;
}
.mw-thesis-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mw-ink-3);
}
.mw-thesis-text {
  margin: 0;
  font-size: var(--mw-size-base);
  line-height: 1.5;
  color: var(--mw-ink);
}
.mw-detail-bar-spacer { flex: 0 0 64px; }
.mw-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(40px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}
.mw-detail-summary-echo {
  display: block;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--mw-bg-2);
  border: 1px solid var(--mw-rule);
  border-radius: 12px;
  font-size: 14.5px;
  color: var(--mw-ink);
  line-height: 1.5;
}
.mw-detail-summary-echo .mw-caret { display: none; }

/* Robinhood-style ticker hero on the mobile detail overlay. Layout per spec:
   ticker name → chart → rest of content. The chart is finger-scrubable
   (attachChartScrub wires touch/mouse handlers to update the price + date
   labels). */
.mw-detail-hero {
  margin-bottom: 16px;
  padding: 16px 4px 12px;
  background: var(--mw-bg-2);
  border: 1px solid var(--mw-rule);
  border-radius: 14px;
}
.mw-hero-head {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  margin-bottom: 6px;
}
.mw-hero-head .mw-tlogo { width: 28px; height: 28px; }
.mw-hero-sym {
  font-size: 22px; font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--mw-ink);
}
.mw-hero-prices {
  display: flex; align-items: baseline; gap: 10px;
  padding: 0 12px;
  margin-bottom: 12px;
}
.mw-hero-price {
  font-size: 30px; font-weight: 700;
  color: var(--mw-ink);
  letter-spacing: 0.01em;
  line-height: 1.05;
}
.mw-hero-pct {
  font-size: 14px; font-weight: 600;
  color: var(--mw-ink-3);
}
.mw-hero-pct.is-up   { color: var(--mw-up); }
.mw-hero-pct.is-down { color: var(--mw-down); }
.mw-hero-period {
  margin-left: 6px;
  color: var(--mw-ink-4);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}
.mw-hero-scrub {
  padding: 8px 12px 0;
  text-align: center;
  color: var(--mw-ink-3);
  font-size: 12px;
  letter-spacing: 0.04em;
  min-height: 18px;
}
.mw-pchart {
  display: block;
  width: 100%;
  height: 120px;
  touch-action: none;        /* let us own touch gestures for scrub */
  -webkit-user-select: none;
  user-select: none;
}
.mw-pchart-up   { color: var(--mw-up); }
.mw-pchart-down { color: var(--mw-down); }
.mw-pchart-flat { color: var(--mw-ink-3); }
.mw-pchart-cross  { pointer-events: none; }
.mw-pchart-cursor { pointer-events: none; }
.mw-detail-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--mw-ink);
}
.mw-detail-body .mw-rec-debate-row + .mw-rec-debate-row { margin-top: 14px; }

body.mw-detail-locked {
  overflow: hidden;
  height: 100vh;
}

/* ============================================================
   PWA INSTALL BUTTON + iOS HINT
   ============================================================ */
.mw-install-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: none;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1px solid var(--mw-rule-2);
  border-radius: 999px;
  background: var(--mw-bg-2);
  color: var(--mw-ink);
  font-family: var(--mw-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: transform 140ms ease, background-color 160ms ease;
}
.mw-install-btn.is-visible { display: inline-flex; }
.mw-install-btn:hover { background: var(--mw-bg-3); }
.mw-install-btn:active { transform: scale(0.97); }
.mw-install-btn svg { color: var(--mw-money); }
.mw-install-x {
  margin-left: 4px;
  padding: 0 6px 0 8px;
  border-left: 1px solid var(--mw-rule-2);
  color: var(--mw-ink-3);
  font-size: 14px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.mw-install-x:hover { color: var(--mw-ink); }

@media (max-width: 720px) {
  .mw-install-btn {
    right: 16px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    font-size: 12px;
    padding: 9px 14px;
  }
}

.mw-ios-hint {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  display: none;
  padding: 14px 38px 14px 16px;
  background: var(--mw-bg-2);
  border: 1px solid var(--mw-rule-2);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.mw-ios-hint.is-visible { display: block; }
.mw-ios-hint p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mw-ink);
}
.mw-ios-hint strong { color: var(--mw-money); font-weight: 700; }
.mw-ios-hint-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border: 0; background: transparent;
  color: var(--mw-ink-3);
  font-family: var(--mw-mono);
  font-size: 14px;
  cursor: pointer;
  border-radius: 999px;
}
.mw-ios-hint-close:hover { background: var(--mw-rule); color: var(--mw-ink); }
.mw-ios-hint-done {
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid var(--mw-rule-2);
  border-radius: 999px;
  background: transparent;
  color: var(--mw-ink-2);
  font-family: var(--mw-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}
.mw-ios-hint-done:hover { background: var(--mw-rule); color: var(--mw-ink); }
@media (max-width: 720px) {
  .mw-ios-hint {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.mw-footer { margin-top: 64px; }
.mw-footer-rule { border-top: 1px solid var(--mw-rule); margin-bottom: 18px; }
.mw-footer-text {
  margin: 0;
  font-size: var(--mw-size-small);
  color: var(--mw-ink-3);
  font-weight: 500;
  text-align: center;
}

/* ============================================================
   MODALS
   ============================================================ */
.mw-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: grid; place-items: center;
  padding: 40px 20px;
  animation: mw-fade 160ms ease;
}
@keyframes mw-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mw-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.mw-modal {
  background: var(--mw-bg-2);
  color: var(--mw-ink);
  width: 100%; max-width: 720px; max-height: 86vh;
  overflow-y: auto;
  padding: 36px 40px;
  border: 1px solid var(--mw-rule);
  border-radius: var(--mw-radius);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  animation: mw-rise 220ms ease;
}
.mw-modal-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--mw-rule);
  padding-bottom: 16px;
  margin-bottom: 22px;
}
.mw-modal-title {
  margin: 0;
  font-family: var(--mw-display);
  font-size: var(--mw-size-h1);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.mw-modal-close {
  border: 0; background: transparent;
  font-size: 24px; color: var(--mw-ink-3);
  cursor: pointer; line-height: 1; padding: 0 6px;
}
.mw-modal-close:hover { color: var(--mw-ink); }
.mw-modal-intro {
  color: var(--mw-ink-2);
  margin: 0 0 22px;
  font-size: var(--mw-size-base);
  font-weight: 500;
  line-height: 1.5;
}

.mw-archive-list { list-style: none; margin: 0; padding: 0; }
.mw-archive-item {
  display: grid;
  grid-template-columns: 120px 80px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--mw-rule);
  align-items: baseline;
  font-size: var(--mw-size-small);
  cursor: pointer;
  transition: background-color 140ms ease;
}
.mw-archive-item:hover { background: var(--mw-bg-3); }
.mw-archive-item:last-child { border-bottom: 0; }
.mw-archive-date { font-family: var(--mw-mono); font-size: var(--mw-size-xs); color: var(--mw-ink-2); font-weight: 600; }
.mw-archive-headline { font-size: var(--mw-size-base); line-height: 1.45; color: var(--mw-ink); font-weight: 500; }

.mw-glossary-list { margin: 0; padding: 0; }
.mw-glossary-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--mw-rule);
}
.mw-glossary-row:last-child { border-bottom: 0; }
.mw-glossary-term {
  font-family: var(--mw-mono);
  font-size: var(--mw-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mw-ink-2);
  font-weight: 700;
  padding-top: 3px;
}
.mw-glossary-def {
  margin: 0;
  font-size: var(--mw-size-base);
  line-height: 1.55;
  color: var(--mw-ink);
  font-weight: 500;
}

/* ============================================================
   FEEDBACK FORM (modal)
   ============================================================ */
.mw-feedback-form {
  display: flex; flex-direction: column;
  gap: 10px;
  position: relative;
}
.mw-feedback-label {
  font-family: var(--mw-mono);
  font-size: var(--mw-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--mw-ink-3);
  margin-top: 6px;
}
.mw-feedback-input {
  width: 100%;
  background: var(--mw-bg);
  color: var(--mw-ink);
  border: 1px solid var(--mw-rule-2);
  border-radius: var(--mw-radius);
  padding: 10px 12px;
  font: inherit;
  font-size: var(--mw-size-base);
  font-weight: 500;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 140ms ease;
}
.mw-feedback-input:focus {
  outline: none;
  border-color: var(--mw-money);
}
.mw-feedback-input[aria-invalid="true"] { border-color: var(--mw-down); }
.mw-feedback-row {
  display: flex; align-items: center; gap: 14px;
  margin-top: 8px;
}
.mw-feedback-send {
  background: var(--mw-money);
  color: var(--mw-bg);
  border: 0;
  padding: 10px 22px;
  border-radius: var(--mw-radius);
  font: inherit;
  font-size: var(--mw-size-base);
  font-weight: 700;
  cursor: pointer;
  transition: filter 140ms ease, opacity 140ms ease;
}
.mw-feedback-send:hover:not(:disabled) { filter: brightness(1.08); }
.mw-feedback-send:disabled { opacity: 0.5; cursor: not-allowed; }
.mw-feedback-status {
  font-size: var(--mw-size-small);
  font-weight: 500;
  color: var(--mw-ink-3);
}
.mw-feedback-status.is-down { color: var(--mw-down); }
.mw-feedback-thanks {
  margin: 0; padding: 16px 0;
  font-size: var(--mw-size-h3);
  color: var(--mw-money);
  font-weight: 600;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .mw-grid { grid-template-columns: 1fr; }
  .mw-card { border-right: 0 !important; }
  .mw-card-span-2, .mw-card-span-3 { grid-column: 1; }
  .mw-tabs { grid-template-columns: repeat(2, 1fr); }
  .mw-tab:nth-child(2) { border-right: 0; }
  .mw-tab:nth-child(-n+2) { border-bottom: 1px solid var(--mw-rule); }
  /* Mobile: target+chg on row 1, verb pill on row 2, text spans full width on row 3 */
  .mw-action-item .mw-li-summary {
    grid-template-columns: minmax(110px, auto) 1fr auto;
    row-gap: 8px;
  }
  .mw-action-text { grid-column: 1 / -1; }
  .mw-table { font-size: var(--mw-size-xs); }
  .mw-archive-item { grid-template-columns: 1fr; gap: 4px; }
  .mw-glossary-row { grid-template-columns: 1fr; gap: 4px; }
  .mw-modal { padding: 28px 24px; }
  .mw-rot { grid-template-columns: 1fr; }
}

/* Phones only: action rows lose the inline blurb. The text (a.text) lives in
   the per-ticker detail overlay via the summary echo. Row collapses to a
   simple flex line: target (logo+name) | sparkline | chg% | verb pill | caret. */
@media (max-width: 720px) {
  .mw-action-item .mw-li-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
  }
  .mw-action-item .mw-action-target { flex: 0 0 auto; }
  .mw-action-item .mw-action-target-text { flex: 1 1 auto; min-width: 0; }
  .mw-action-text { display: none; }
}

/* Inline sparklines on action + recommendation rows. Hidden on desktop —
   those layouts are roomier and already carry richer per-row context. The
   row-shape spec on phones is icon · name · sparkline · % · action. */
.mw-action-spark, .mw-rec-spark { display: none; }
@media (max-width: 720px) {
  .mw-action-spark, .mw-rec-spark {
    display: inline-flex;
    flex: 0 0 56px;
    align-items: center;
    height: 18px;
  }
  .mw-action-spark .mw-spark, .mw-rec-spark .mw-spark { width: 100%; height: 100%; }
}

/* Row left-padding parity (mobile + desktop). Watchlist td has 0 left padding
   so its ticker logo aligns to the card's inner edge. Big-movers and Social
   chatter were each adding their own horizontal padding inside the card,
   pushing those tickers ~16px further right. Strip the inner horizontal
   padding so all card-list rows start flush. */
.mw-soc-head    { padding-left: 0; padding-right: 0; }
.mw-soc-summary { padding-left: 0; padding-right: 0; }
/* Mover row uses flex with the tpill stretching to absorb slack — its
   justify-content: center then visually centered the logo+symbol cluster.
   Force start-alignment so the ticker hugs the left edge like watchlist. */
.mw-mover-row > .mw-tpill { justify-content: flex-start; }

/* Mobile per-ticker detail overlay: restore everything we hid on the row
   so the full info lives on the per-ticker page as expected. The summary
   echo flips to a flex-wrap container so the cells/chips that were stripped
   off the list row reflow naturally inside the detail panel. */
@media (max-width: 720px) {
  .mw-detail-summary-echo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
  }
  .mw-detail-summary-echo .mw-rec-conf,
  .mw-detail-summary-echo .mw-rec-vehicle,
  .mw-detail-summary-echo .mw-mover-last { display: inline-flex !important; }
  .mw-detail-summary-echo .mw-rec-summary-text,
  .mw-detail-summary-echo .mw-action-text,
  .mw-detail-summary-echo .mw-mover-note { display: block !important; flex-basis: 100%; margin: 4px 0 0; line-height: 1.5; color: var(--mw-ink-2); }
  .mw-detail-summary-echo .mw-rec-summary-text { -webkit-line-clamp: unset; white-space: normal; }
  /* Restore every <td> cell inside the summary echo (trigger zone, note,
     RSI/vol-OI, full last price) — the table-row case the list view hid. */
  .mw-detail-summary-echo td,
  .mw-detail-summary-echo .mw-table:not(.mw-table-watch) tr td.r { display: inline-flex !important; }
  .mw-detail-summary-echo td.mw-dim,
  .mw-detail-summary-echo .mw-trigger { flex-basis: 100%; }
}

::selection { background: var(--mw-accent-soft); color: var(--mw-ink); }

.mw-modal::-webkit-scrollbar { width: 6px; }
.mw-modal::-webkit-scrollbar-track { background: transparent; }
.mw-modal::-webkit-scrollbar-thumb { background: var(--mw-rule-2); border-radius: 3px; }
