/* A quieter research workspace, related to the club pages without their
   editorial typography. Root tokens also reach the JavaScript-drawn charts. */
:root:has(#m-tools.on) {
  --bg: #f4f2ed;
  --panel: #fffdf9;
  --panel-2: #eeece6;
  --border: #dcd9d1;
  --text: #303640;
  --muted: #656b73;
  --accent: #50657c;
  --accent-2: #40566e;
  --accent-soft: #e6eaf0;
  --grid: #30364012;
  --good: #2e7050;
  --bad: #a3493d;
  --shadow: 0 1px 2px #30364005, 0 5px 18px #30364006;
  --tools-button-text: #fff;
  color-scheme: light;
}
:root[data-theme="dark"]:has(#m-tools.on) {
  --bg: #1b1e24;
  --panel: #242830;
  --panel-2: #2c313b;
  --border: #414752;
  --text: #e6e8ec;
  --muted: #b0b5be;
  --accent: #aabed5;
  --accent-2: #c2d1e3;
  --accent-soft: #354355;
  --grid: #e6e8ec12;
  --good: #8bc3a3;
  --bad: #e49a88;
  --shadow: 0 1px 2px #00000015, 0 5px 18px #00000012;
  --tools-button-text: #1c2a3a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):has(#m-tools.on) {
    --bg: #1b1e24; --panel: #242830; --panel-2: #2c313b; --border: #414752;
    --text: #e6e8ec; --muted: #b0b5be; --accent: #aabed5; --accent-2: #c2d1e3;
    --accent-soft: #354355; --grid: #e6e8ec12; --good: #8bc3a3; --bad: #e49a88;
    --shadow: 0 1px 2px #00000015, 0 5px 18px #00000012;
    --tools-button-text: #1c2a3a;
    color-scheme: dark;
  }
}
body:has(#m-tools.on) > .wrap { max-width: 1240px; padding-bottom: 28px; }
body:has(#m-tools.on) .topbar {
  background: var(--bg); border-color: var(--border); backdrop-filter: none;
  box-shadow: 0 2px 10px #30364004;
}
body:has(#m-tools.on) .topbar-in { max-width: 1260px; padding: 20px 24px; }
body:has(#m-tools.on) .brand .mark { height: 34px; color: var(--tools-button-text); }
body:has(#m-tools.on) .mtab { font-size: 13px; border-radius: 5px; }
body:has(#m-tools.on) .mtab.on { box-shadow: inset 0 -1px var(--accent); }
body:has(#m-tools.on) .applybtn { border-radius: 6px; color: var(--tools-button-text); }
#m-tools > .hero.sub {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px;
  align-items: center; padding: 42px 0 30px;
}
#m-tools > .hero .kicker { grid-column: 1 / -1; margin-bottom: 12px; font-size: 10px; letter-spacing: .13em; }
#m-tools > .hero h1 { font-size: clamp(28px, 3.5vw, 38px); font-weight: 600; margin: 0; letter-spacing: -.04em; }
#m-tools > .hero .lede { font-size: 14px; line-height: 1.75; margin: 0; max-width: 56ch; }
#m-tools .tabs {
  padding: 5px; gap: 4px; margin-bottom: 24px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 9px;
}
#m-tools .tab {
  font-size: 13px; font-weight: 500; padding: 10px 16px; margin: 0;
  border: 1px solid transparent; border-radius: 6px;
}
#m-tools .tab.on { background: var(--panel); border-color: var(--border); color: var(--accent); font-weight: 650; box-shadow: 0 1px 3px #30364008; }
#m-tools .tab:hover { background: var(--panel); }
#m-tools .panel { padding: 24px; border-radius: 10px; }
#m-tools .btn { font-size: 13px; border-radius: 7px; color: var(--tools-button-text); padding: 12px 18px; }
#m-tools .btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); box-shadow: none; }
#m-tools .btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
#m-tools :is(.range.on, .chart-mode[aria-pressed="true"], .pk-m.on) { color: var(--tools-button-text); }
#m-tools :is(.btn, .tab, .range, .chart-mode, .fd-nav button, .sr-download) { transition: background-color .16s, border-color .16s, box-shadow .16s, transform .16s; }
@media (hover: hover) {
  #m-tools .btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 3px 8px #30364015; }
  #m-tools .btn:not(:disabled):active { transform: translateY(0); box-shadow: none; }
}
#m-tools :is(button, input, select, textarea, a, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#m-tools .ticker-popup { border-radius: 8px; box-shadow: 0 8px 22px #1c2a3a1a; }
#m-tools :is(.note, .ticker-hint, .fd-muted) { line-height: 1.75; }
#m-tools .stats { border-radius: 8px; }
#m-tools .stat { padding: 16px; }
#m-tools .stat .k { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
#m-tools .stat .v { font-size: 18px; }
#m-tools .fd-heading { font-size: clamp(23px, 2.5vw, 28px); font-weight: 600; }
#m-tools .fd-intro { font-size: 14px; max-width: 76ch; }
#m-tools .fd-nav { gap: 4px; padding-bottom: 14px; margin-bottom: 20px; }
#m-tools .fd-nav button { background: transparent; border-color: transparent; padding: 8px 10px; }
#m-tools .fd-nav button:hover { background: var(--panel-2); }
#m-tools .fd-nav button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--border); color: var(--accent); }
#m-tools .fd-metric { background: var(--panel-2); border-color: transparent; border-radius: 8px; }
#m-tools .fd-table thead th { padding-block: 14px; }
#m-tools .fd-changes { border-width: 0 0 0 2px; border-radius: 0; padding: 4px 18px; }
#m-tools .sr-hero { background: var(--panel); padding: 24px; border-radius: 10px; box-shadow: var(--shadow); }
#m-tools .sr-hero h2 { font-size: clamp(25px, 3vw, 34px); font-weight: 600; }
#m-tools :is(.sr-model, .sr-kpi, .sr-finding, .sr-doc) { background: var(--panel); border-radius: 8px; }
#m-tools .sr-table thead { background: var(--panel-2); }
#m-tools .sr-table tbody tr:hover { background: var(--accent-soft); }
#m-tools #lock { max-width: 580px; margin: 12px 0 64px; }
body:has(#m-tools.on) .wrap > footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 1.8; }
@media (max-width: 760px) {
  #m-tools > .hero.sub { grid-template-columns: 1fr; gap: 10px; padding: 30px 0 24px; }
  #m-tools > .hero .kicker { margin-bottom: 0; }
  #m-tools > .hero .lede { max-width: 64ch; }
  #m-tools .panel { padding: 18px; }
  #m-tools .tab { padding: 9px 12px; }
}
@media (max-width: 650px) {
  body:has(#m-tools.on) .topbar-in { padding: 12px 16px; }
  #m-tools .tabs { gap: 2px; }
  #m-tools .tab { padding: 8px 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #m-tools :is(.btn, .tab, .range, .chart-mode, .fd-nav button, .sr-download) { transition: none; }
  #m-tools .btn:not(:disabled):hover { transform: none; }
}
