/* Research Lab: shares Base Rates' palette, type and panels (see
   assets/base-rates/styles.css). Static pages, no JavaScript. */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --ink: #111113;
  --ink-2: #3f3f46;   /* 10.3:1 on bg */
  --ink-3: #52525b;   /* 7.5:1 on bg  */
  --line: #e4e4e7;
  --line-2: #d4d4d8;
  --accent: #1d4ed8;  /* 6.6:1 on white */
  --accent-soft: #e8eefc;
  --bench: #71717a;
  --warn: #92400e;
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font); font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.page {
  max-width: 1180px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left));
}

/* lab nav */
.labnav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 6px 0 4px; border-bottom: 1px solid var(--line); }
.labnav .home { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; display: inline-flex; align-items: center; min-height: 44px; }
.labnav ul { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.labnav ul a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.labnav ul a:hover { background: #f0f0f1; color: var(--ink); }
.labnav ul a[aria-current="page"] { background: var(--ink); color: #fff; }

/* masthead */
main { outline: none; }
.masthead { padding: 32px 0 24px; max-width: 780px; }
.eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
h1 { margin: 0; font-size: clamp(32px, 5.2vw, 56px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; }
h1 em { font-style: normal; color: var(--accent); }
.lede { margin: 18px 0 0; font-size: clamp(16px, 1.6vw, 18px); color: var(--ink-2); max-width: 660px; }

.notice { border: 1px solid var(--line-2); border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 12px 16px; margin: 0 0 22px; }
.notice p { margin: 0; color: var(--ink); font-size: 15px; }

/* hub cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 10px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.card h2 { font-size: 24px; letter-spacing: -0.02em; margin: 6px 0 6px; }
.card p { margin: 0 0 10px; color: var(--ink-2); }
.card p:last-child { margin-top: auto; }
.go { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.go:hover { text-decoration: underline; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-2); }
.stat.up::before { background: var(--accent); }
.stat-label { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.stat-big { margin: 4px 0 6px; font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.stat.up .stat-big { color: var(--accent); }
.stat-line { margin: 0; font-size: 14px; color: var(--ink-2); }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; margin-bottom: 18px; min-width: 0; }
.panel-head { margin-bottom: 14px; }
h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.015em; }
h3 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.two > div > h3:first-child { margin-top: 0; }
.panel p { margin: 0 0 10px; }
.note { margin: 0; font-size: 14px; color: var(--ink-3); max-width: 780px; }
.panel .note.tight { margin: 10px 0 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 8px 32px; }
.badge { display: inline-block; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.rejected .badge { background: #f4f4f5; color: var(--ink); }
.rejected { border-style: dashed; }
.rules { margin: 0; padding-left: 20px; color: var(--ink-2); }
.rules li { margin: 0 0 6px; }
.kill { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: #f6f6f5; }
.kill h3 { margin-top: 0; }
.kill p { margin: 0; color: var(--ink-2); font-size: 15px; }
.empty { margin: 0; padding: 14px 16px; background: var(--bg); border-radius: 10px; color: var(--ink-2); }

/* chart */
.chart { margin: 0 0 6px; width: 100%; }
.chart svg { display: block; width: 100%; max-width: 760px; height: auto; }
.grid { stroke: var(--line); }
.axis { font-size: 12px; fill: var(--ink-3); font-family: var(--font); }
.l-eq { stroke: var(--accent); stroke-width: 2.5; }
.l-bench { stroke: var(--bench); stroke-width: 2; stroke-dasharray: 5 4; }
figcaption { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.key { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.b-up { background: var(--accent); }
.sw.b-bench { background: var(--bench); }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
thead th { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-top: 0; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 600; }
tr.mine th { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }
.summary td:nth-child(2), .summary td:last-child, .summary thead th:nth-child(2), .summary thead th:last-child { text-align: left; }
.summary th a { display: inline-flex; align-items: center; min-height: 44px; }
.summary th, .summary td { vertical-align: middle; }
.trades td:first-child, .trades td:nth-child(2) { white-space: nowrap; }
.num { font-weight: 600; white-space: nowrap; }
.na { color: var(--ink-3); font-weight: 400; font-size: 14px; }

/* caveats */
.caveats ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 32px; }
.caveats li { font-size: 15px; color: var(--ink-2); padding-left: 16px; position: relative; }
.caveats li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.caveats strong { color: var(--ink); }

.foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.foot p { margin: 0 0 6px; max-width: 820px; }
.foot a { display: inline-block; padding: 12px 0; margin: -12px 0; line-height: 20px; }

@media (max-width: 1000px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .labnav ul { margin-left: 0; }
  .labnav ul a { padding: 0 8px; font-size: 13px; }
  .masthead { padding: 18px 0 18px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat:first-child { grid-column: 1 / -1; }
  .stat { padding: 12px 14px 12px 16px; }
  .panel { padding: 18px 14px 14px; border-radius: 12px; }
  .caveats ul { grid-template-columns: 1fr; }
  table { font-size: 14px; }
  th, td { padding: 9px 5px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
