/* =====================================================================
   Turing Agent portal — shared stylesheet
   Look: Clarity-style academic page (Poppins UI / Source Serif body / Fira Code)
   All colours are tokens; dark mode only redefines the tokens.
   ===================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f5f7;
  --bg-linear: linear-gradient(90deg, #f2f4f7 0%, #ffffff 16%, #ffffff 84%, #f2f4f7 100%);
  --bg-code: #f4f5f7;
  --bg-row: #f6f7f9;
  --bg-banner: rgba(255, 255, 255, 0.9);
  --text: #1e2127;
  --body: #2f333d;
  --muted: #6c7380;
  --border: #e5e7ec;
  --rule: #1e2127;
  --navy: #2b3d4f;
  --blue: #1f62d0;
  --blue-soft: rgba(31, 98, 208, 0.09);
  --warm: #b4513f;
  --warm-soft: rgba(180, 81, 63, 0.09);
  --green: #2b8a6e;
  --green-soft: rgba(43, 138, 110, 0.1);
  --amber: #a86d12;
  --amber-soft: rgba(168, 109, 18, 0.1);
  --def-bg: #f2f3f5;   /* report: targetbox_blue  */
  --thm-bg: #f5f1e9;   /* report: targetbox_yellow */
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 8px rgba(16, 24, 40, 0.04);
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, Cambria, 'Songti SC', serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
  --banner-h: 58px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #13161c;
    --bg-soft: #1b1f27;
    --bg-linear: linear-gradient(90deg, #181c24 0%, #13161c 16%, #13161c 84%, #181c24 100%);
    --bg-code: #1b1f27;
    --bg-row: #191d25;
    --bg-banner: rgba(19, 22, 28, 0.88);
    --text: #f1f3f5;
    --body: #ced4da;
    --muted: #8b939e;
    --border: #2b303c;
    --rule: #8b939e;
    --navy: #9db4ff;
    --blue: #7aa7ff;
    --blue-soft: rgba(122, 167, 255, 0.12);
    --warm: #ff9a85;
    --warm-soft: rgba(255, 154, 133, 0.12);
    --green: #63d2ae;
    --green-soft: rgba(99, 210, 174, 0.12);
    --amber: #f2b45a;
    --amber-soft: rgba(242, 180, 90, 0.12);
    --def-bg: #1c2029;
    --thm-bg: #221f19;
    --shadow: none;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--banner-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-sans); color: var(--text); line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
code, pre, .mono { font-family: var(--font-mono); }
code { font-size: 0.86em; background: var(--bg-code); border: 1px solid var(--border); border-radius: 5px; padding: 0.05em 0.35em; }
strong { color: var(--text); font-weight: 600; }
[hidden] { display: none !important; }

/* ---------- containers (Clarity widths) ---------- */
.wrap-main, .wrap-large, .wrap-xl, .wrap-trace { margin-inline: auto; padding-inline: 24px; }
.wrap-main { max-width: 800px; }
.wrap-large { max-width: 980px; }
.wrap-xl { max-width: 1160px; }
@media (max-width: 480px) { .wrap-main, .wrap-large, .wrap-xl, .wrap-trace { padding-inline: 16px; } }

.section { padding-block: 44px; }
.section + .section { padding-top: 12px; }
.stack > * + * { margin-top: 1rem; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: 0.5rem;
}
.lede { font-size: 1.06rem; color: var(--body); }
.muted { color: var(--muted); }
.ui { font-family: var(--font-sans); }

/* ---------- top banner ---------- */
.banner {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-banner);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}
.banner-inner {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 24px;
  min-height: var(--banner-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--font-sans);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: auto; height: 20px; }
.brand small { font-weight: 400; color: var(--muted); font-size: 0.78rem; margin-left: 2px; }
.nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  position: relative;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 18px 10px;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--warm);
}
@media (max-width: 760px) {
  .banner-inner { flex-direction: column; align-items: stretch; gap: 0; padding-inline: 16px; }
  .brand { padding-top: 12px; }
  .brand small { display: none; }
  .nav { margin-inline: -10px; }
  .nav a { padding: 10px 10px 12px; }
}

/* ---------- page header (hero) ---------- */
.page-head { padding-top: 56px; padding-bottom: 8px; }
.page-head h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); line-height: 1.15; }
.page-head .lede { margin-top: 1rem; width: 100%; max-width: 100%; text-align: justify; text-justify: inter-word; }
.hero { text-align: center; padding-top: 64px; padding-bottom: 24px; }
.hero-logo { display: block; width: auto; height: 56px; margin: 0 auto 20px; }
.hero h1 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.3rem); line-height: 1.12; max-width: 52rem; margin-inline: auto; }
.hero h1 span { display: block; font-size: 0.56em; font-weight: 500; color: var(--body); margin-top: 0.5rem; letter-spacing: 0; }
.affil { font-family: var(--font-sans); font-size: 0.92rem; color: var(--muted); margin-top: 1.1rem; }
.hero .lede { max-width: 46rem; margin: 1.2rem auto 0; }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 1.6rem; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: 0.86rem; font-weight: 500;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--navy); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: var(--bg); }
.btn.primary:hover { opacity: 0.92; }
.btn svg { width: 15px; height: 15px; }

/* ---------- Clarity boxes ---------- */
.box { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px; }
.box-linear { background: var(--bg-linear); border: 1px solid var(--border); border-radius: 14px; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; }
.pad { padding: 24px; }
@media (min-width: 720px) { .pad-lg { padding: 32px; } }
@media (max-width: 719px) { .pad-lg { padding: 20px; } }

/* figures: images are white-background PDFs, so keep a white mat in dark mode too */
.figure { margin: 0; }
.figure .mat { background: #fff; border-radius: 10px; padding: 12px; border: 1px solid var(--border); }
.figure img { margin-inline: auto; }
.figure figcaption { font-family: var(--font-sans); font-size: 0.82rem; line-height: 1.6; color: var(--muted); margin-top: 12px; text-align: center; max-width: 100%; margin-inline: auto; }
.figure figcaption b { color: var(--text); font-weight: 600; }
.zoomable { cursor: zoom-in; }

/* ---------- stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 18px 18px 16px; font-family: var(--font-sans); }
.stat .num { font-size: 1.9rem; font-weight: 600; color: var(--text); letter-spacing: -0.02em; line-height: 1.1; }
.stat .num em { font-style: normal; font-size: 0.55em; color: var(--muted); font-weight: 500; margin-left: 2px; }
.stat .label { font-size: 0.8rem; color: var(--body); margin-top: 6px; line-height: 1.45; }
.stat .sub { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }

/* ---------- grids & tiles ---------- */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.tile { padding: 20px; font-family: var(--font-sans); display: flex; flex-direction: column; gap: 8px; }
.tile h3 { font-size: 1rem; min-height: 1.4em; }
.tile p { font-size: 0.86rem; line-height: 1.6; color: var(--body); margin: 0; }
.tile .tag { align-self: flex-start; }
a.tile { color: inherit; transition: border-color 0.15s ease, transform 0.15s ease; }
a.tile:hover { text-decoration: none; border-color: var(--navy); }
a.tile .go { margin-top: auto; padding-top: 6px; font-size: 0.8rem; color: var(--warm); font-weight: 500; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 5px;
  background: var(--blue-soft); color: var(--blue);
}
.tag.warm { background: var(--warm-soft); color: var(--warm); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.plain { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--border); }

/* ---------- pills (filters / toggles) ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  font-family: var(--font-sans); font-size: 0.8rem;
  padding: 4px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--body);
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.pill:hover { border-color: var(--navy); }
.pill[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--bg); font-weight: 500; }

/* ---------- academic table ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ac-table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.ac-table thead tr:first-child { border-top: 2px solid var(--rule); }
.ac-table thead tr:last-child { border-bottom: 1.5px solid var(--rule); }
.ac-table tbody tr:nth-child(odd) { background: var(--bg-row); }
.ac-table tbody tr:last-child { border-bottom: 2px solid var(--rule); }
.ac-table th, .ac-table td { padding: 9px 14px; text-align: left; white-space: nowrap; }
.ac-table th { font-weight: 600; color: var(--text); }
.ac-table td.num, .ac-table th.num { text-align: right; }
.ac-table tr.ours td { font-weight: 600; color: var(--blue); }
.ac-table .best { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.table-note { font-family: var(--font-sans); font-size: 0.8rem; color: var(--muted); margin-top: 10px; }
.table-note b { color: var(--text); }

/* ---------- report-style theorem boxes ---------- */
.def-box, .thm-box { border-radius: 6px; padding: 14px 18px; margin: 1rem 0; }
.def-box { background: var(--def-bg); }
.thm-box { background: var(--thm-bg); }
.def-box > .kind, .thm-box > .kind { font-family: var(--font-sans); font-weight: 600; font-size: 0.85rem; color: var(--text); display: block; margin-bottom: 4px; }

/* ---------- prose ---------- */
.prose h3 { margin: 1.8rem 0 0.6rem; font-size: 1.08rem; }
.prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1em; }
.prose li + li { margin-top: 0.35em; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

/* ---------- component list (harness page) ---------- */
.comp { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 18px 20px; }
.comp .idx { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; color: var(--warm); padding-top: 3px; }
.comp h3 { font-size: 1.02rem; margin-bottom: 4px; }
.comp p { font-size: 0.95rem; }

/* ---------- OpenAI explorer ---------- */
.funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 860px) { .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.funnel .stat { position: relative; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.funnel .stat:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }
.funnel .stat.hl {
  border-color: var(--warm);
  background: linear-gradient(180deg, var(--warm-soft) 0%, var(--bg) 100%);
  box-shadow: 0 2px 8px rgba(180, 81, 63, 0.12);
}
.funnel .stat.hl .num { color: var(--warm); font-weight: 700; }

.explorer { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .explorer { grid-template-columns: minmax(0, 1fr); } }
.explorer-side { position: sticky; top: calc(var(--banner-h) + 16px); display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 960px) { .explorer-side { position: static; } }
.search {
  width: 100%; font-family: var(--font-sans); font-size: 0.85rem;
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
}
.search:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
.plist { display: flex; flex-direction: column; gap: 6px; max-height: 62vh; overflow-y: auto; padding-right: 2px; }
@media (max-width: 960px) { .plist { max-height: none; } }
.pitem {
  text-align: left; width: 100%; cursor: pointer;
  font-family: var(--font-sans); color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 3px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pitem:hover { border-color: var(--navy); }
.pitem[aria-selected="true"] { border-color: var(--warm); background: var(--bg-soft); box-shadow: inset 3px 0 0 var(--warm); }
.pitem .meta { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }
.pitem .meta .id { color: var(--warm); font-weight: 600; }
.pitem .t { font-size: 0.84rem; font-weight: 600; line-height: 1.35; }
.count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.empty { font-family: var(--font-sans); font-size: 0.85rem; color: var(--muted); text-align: center; padding: 28px 12px; border: 1px dashed var(--border); border-radius: 10px; }

.detail { padding: 28px; }
@media (max-width: 620px) { .detail { padding: 18px; } }
.detail-head { display: flex; flex-direction: column; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.detail-head h2 { font-size: clamp(1.3rem, 1.05rem + 0.9vw, 1.7rem); }
.detail-head .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 4px 0 18px; }
.kv div { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-family: var(--font-sans); }
.kv dt { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.kv dd { margin: 2px 0 0; font-size: 0.92rem; font-weight: 600; color: var(--text); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.code {
  background: var(--bg-code); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; font-size: 0.8rem; line-height: 1.65; color: var(--text); margin: 0 0 1em;
}

/* ---------- demo gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 960px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .gallery { grid-template-columns: 1fr; } }
.demo { padding: 20px; display: flex; flex-direction: column; gap: 10px; font-family: var(--font-sans); }
.demo .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.demo h3 { font-size: 1.02rem; line-height: 1.35; }
.demo p { font-size: 0.85rem; line-height: 1.6; margin: 0; color: var(--body); }
.demo .metrics { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--border); margin-top: auto; }
.demo .metrics b { color: var(--text); font-weight: 600; }
.demo .links a { font-size: 0.8rem; font-weight: 500; color: var(--warm); }

/* ---------- workshops / news lists ---------- */
.rows > * + * { border-top: 1px solid var(--border); }
.row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; padding: 20px 24px; font-family: var(--font-sans); }
@media (max-width: 680px) { .row { grid-template-columns: 1fr; gap: 6px; padding: 16px 18px; } }
.row .when { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); line-height: 1.6; }
.row .when b { display: block; color: var(--navy); font-weight: 600; }
.row h3 { font-size: 1rem; line-height: 1.4; }
.row p { font-size: 0.86rem; line-height: 1.6; margin: 6px 0 0; color: var(--body); }
.row .who { font-family: var(--font-mono); font-size: 0.75rem; color: var(--blue); margin-top: 6px; }
.row .links { margin-top: 10px; }
.row .links a { font-size: 0.8rem; font-weight: 500; color: var(--warm); margin-right: 14px; }

.news { list-style: none; padding: 0; margin: 0; font-family: var(--font-sans); }
.news li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 0.9rem; line-height: 1.55; }
.news li:last-child { border-bottom: 0; }
.news time { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); padding-top: 2px; }

/* ---------- bibtex ---------- */
.bib { position: relative; }
.bib .copy { position: absolute; top: 10px; right: 10px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 16, 0.82); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-height: 92vh; width: auto; max-width: 100%; background: #fff; border-radius: 8px; padding: 10px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 64px; padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); font-family: var(--font-sans); font-size: 0.78rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--text); }

/* ---------- toast ---------- */
.toast { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 120; background: var(--bg); color: var(--text); border: 1px solid var(--navy); border-radius: 8px; padding: 8px 14px; font-family: var(--font-sans); font-size: 0.8rem; box-shadow: var(--shadow); }

/* reserve banner height before JS fills it (avoids layout jump) */
.banner:empty { min-height: var(--banner-h); }

/* long Lean identifiers in titles must wrap instead of overflowing */
.demo h3, .pitem .t, .detail-head h2, .row h3 { overflow-wrap: anywhere; }


/* showcase video: no white mat padding, cream background matches the animation */
.figure .video-mat { padding: 0; overflow: hidden; background: #f4f1e8; }
video.showcase { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* =====================================================================
   Home: tabs + sliding panels
   ===================================================================== */
.res-links { display: flex; justify-content: center; gap: 18px; margin-top: 1rem; font-family: var(--font-sans); font-size: 0.86rem; }
.res-links:not(:has(a:not([hidden]))) { display: none; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 1.8rem 0 1.5rem; }
.tab {
  font-family: var(--font-sans); font-size: 0.88rem; font-weight: 500;
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.tab:hover { border-color: var(--navy); }
.tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: var(--bg); }
.tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.slider-viewport { overflow: hidden; margin-inline: -12px; transition: height 0.45s cubic-bezier(0.22, 0.61, 0.36, 1); }
.slider-track { display: flex; align-items: flex-start; transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1); will-change: transform; }
.slide { flex: 0 0 100%; min-width: 0; padding-inline: 12px; }
.slider.no-anim .slider-track, .slider.no-anim .slider-viewport { transition: none; }
@media (prefers-reduced-motion: reduce) { .slider-track, .slider-viewport { transition: none; } }
.steps { margin-top: 20px; }
.step-no { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; color: var(--warm); }
.panel-lede { font-size: 1rem; max-width: 54rem; margin: 0 auto 18px; text-align: center; }
.panel-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; width: 100%; }
.section-head > div:only-child { width: 100%; }
.section-head .eyebrow { margin-bottom: 0.35rem; }
.section-sub { width: 100%; max-width: 100%; text-align: justify; text-justify: inter-word; }
.prose { width: 100%; max-width: 100%; }
.prose p { width: 100%; max-width: 100%; text-align: justify; text-justify: inter-word; }
.more { font-family: var(--font-sans); font-size: 0.85rem; font-weight: 500; color: var(--warm); }
.home-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; }
@media (max-width: 860px) { .home-split { grid-template-columns: minmax(0, 1fr); } }
.more-tiles { display: grid; gap: 12px; margin-top: 1rem; }

/* Home: Bottom grid for News and Citation */
.home-bottom-sec { padding-top: 24px; }
.home-bottom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; align-items: start; }
.home-bottom-col { display: flex; flex-direction: column; min-width: 0; }
.citation-intro { font-size: 0.9rem; margin: 0 0 12px; line-height: 1.5; }
@media (max-width: 860px) {
  .home-bottom-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* =====================================================================
   Home: OpenAI Verified Problems Spotlight Carousel
   ===================================================================== */
.home-spotlight { padding-top: 32px; padding-bottom: 28px; }
.home-spotlight .section-head { margin-bottom: 12px; }
.home-spotlight .lede { max-width: 100%; margin: 0 0 24px; font-size: 1.05rem; text-align: justify; text-justify: inter-word; }

/* Spotlight Header Redesign */
.spotlight-header-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.spotlight-headline-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 840px;
}
.spotlight-eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 10px;
  border-radius: 9999px;
  background: var(--warm-soft);
  border: 1px solid rgba(180, 81, 63, 0.28);
  box-shadow: 0 1px 4px rgba(180, 81, 63, 0.08);
  width: fit-content;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm);
  position: relative;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(180, 81, 63, 0.7);
  animation: ta-pulse-dot 2.2s infinite cubic-bezier(0.66, 0, 0, 1);
}
@keyframes ta-pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(180, 81, 63, 0.75); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(180, 81, 63, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(180, 81, 63, 0); }
}
.spotlight-eyebrow-pill .pill-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm);
}
.spotlight-eyebrow-pill .pill-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9999px;
  background: rgba(180, 81, 63, 0.14);
  color: var(--warm);
  letter-spacing: 0.04em;
}

.spotlight-main-title {
  font-family: var(--font-sans);
  font-size: clamp(1.85rem, 1.35rem + 1.8vw, 2.65rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.028em;
  color: var(--text);
  margin: 0;
}
.title-gradient {
  background: linear-gradient(135deg, #c93b2b 0%, #ab2374 48%, #1f62d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
@media (prefers-color-scheme: dark) {
  .title-gradient {
    background: linear-gradient(135deg, #ff6b57 0%, #f472b6 48%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.spotlight-explore-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--warm);
  background: var(--bg);
  border: 1px solid rgba(180, 81, 63, 0.32);
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.spotlight-explore-link:hover {
  background: var(--warm-soft);
  border-color: var(--warm);
  transform: translateX(2px);
  color: var(--warm);
  box-shadow: 0 2px 8px rgba(180, 81, 63, 0.16);
}
.spotlight-explore-link .arr-icon {
  transition: transform 0.2s ease;
}
.spotlight-explore-link:hover .arr-icon {
  transform: translateX(3px);
}

.spotlight-lede-box {
  margin: 0 0 24px;
  padding: 14px 18px;
  border-left: 3px solid var(--warm);
  background: linear-gradient(90deg, var(--warm-soft) 0%, transparent 100%);
  border-radius: 0 8px 8px 0;
}
.spotlight-lede {
  max-width: 100%;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--body);
  text-align: justify;
  text-justify: inter-word;
}

/* Highlighting styles in lede */
.text-hl {
  font-weight: 600;
  color: var(--text);
  background: rgba(31, 98, 208, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}
.text-hl-warn {
  font-weight: 600;
  color: var(--warm);
  background: var(--warm-soft);
  padding: 1px 6px;
  border-radius: 4px;
}
.text-hl-success {
  font-weight: 600;
  color: var(--green);
  background: var(--green-soft);
  padding: 1px 6px;
  border-radius: 4px;
}
.text-hl-success .proof-count {
  font-family: inherit;
  font-size: 1.12em;
  font-weight: 700;
  line-height: inherit;
  color: inherit;
}

.spotlight-carousel { margin-top: 24px; }

/* Tabs navigation */
.spotlight-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.spotlight-tab {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 18px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  font-family: inherit;
  color: inherit;
}
.spotlight-tab:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
}
.spotlight-tab[aria-selected="true"] {
  background: var(--bg-soft);
  border-color: var(--blue);
  box-shadow: var(--shadow);
  transform: none;
}
.spotlight-tab .tab-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.spotlight-tab .tab-title {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.spotlight-tab .tab-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: transparent;
}
.spotlight-tab[aria-selected="true"] .tab-progress {
  background: rgba(31, 98, 208, 0.15);
}
.spotlight-tab[aria-selected="true"] .tab-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--blue);
  transition: width 0.1s linear;
}

/* Slide viewport and track */
.spotlight-viewport {
  overflow: hidden;
  border-radius: 14px;
  position: relative;
  transition: height 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.spotlight-track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.spotlight-slide {
  flex: 0 0 100%;
  min-width: 0;
}
.spotlight-card {
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* Grid layout within slide */
.spotlight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
  gap: 32px;
  align-items: stretch;
}
.spotlight-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.spotlight-content .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.spotlight-title {
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.6rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 10px;
}
.spotlight-summary {
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--body);
  margin: 0 0 16px;
}
.spotlight-thm {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--thm-bg);
  border-left: 3px solid var(--amber);
}
.spotlight-thm .kind {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--amber);
  margin-bottom: 6px;
}
.spotlight-thm .thm-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text);
}
.spotlight-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.spotlight-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.spotlight-stat .k {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.spotlight-stat .v {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding-top: 14px;
}

/* Media & DAG Trace Card on right */
.spotlight-dag-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 560px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.spotlight-dag-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.dag-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dag-badge {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue);
}
.dag-info {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.dag-replay-btn {
  font-size: 0.76rem !important;
  padding: 4px 12px !important;
  white-space: nowrap;
}
.spotlight-dag-wrap {
  position: relative;
  overflow: auto;
  background: var(--bg);
  flex: 1 1 0;
  min-height: 360px;
  max-height: 460px;
  padding: 18px 14px;
  border: none !important;
  border-radius: 0 !important;
  cursor: grab;
  user-select: none;
}
.spotlight-dag-wrap:active {
  cursor: grabbing;
}
.spotlight-dag-foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
}
.spotlight-dag-foot .mini-legend {
  margin: 0;
  font-size: 0.72rem;
  gap: 12px;
}
.dag-hint {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.spotlight-media {
  margin: 0;
}
.spotlight-media .mat {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
}
.spotlight-media .mat.video-mat {
  padding: 0;
  overflow: hidden;
  background: #f4f1e8;
}
.spotlight-media img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
}
.spotlight-media figcaption {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}
.spotlight-media figcaption b {
  color: var(--text);
}

/* Controls underneath */
.spotlight-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-inline: 0;
}
.spotlight-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.spotlight-status-text {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .spotlight-nav { grid-template-columns: 1fr; }
  .spotlight-grid { grid-template-columns: 1fr; gap: 24px; }
  .spotlight-stats { grid-template-columns: 1fr; }
  .spotlight-controls { flex-direction: column; align-items: stretch; text-align: center; }
  .spotlight-btn-group { justify-content: center; }
}

/* =====================================================================
   Proof-trace viewer
   ===================================================================== */
:root { --edge: #c9ced6; --node-stroke: #b6bdc8; --violet: #7b5cc4; }
@media (prefers-color-scheme: dark) { :root { --edge: #3a404c; --node-stroke: #4c5362; --violet: #b39cff; } }

.run-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; }
.run-btn {
  text-align: left; cursor: pointer; font-family: var(--font-sans); color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.run-btn:hover { border-color: var(--navy); }
.run-btn[aria-selected="true"] { border-color: var(--warm); background: var(--bg-soft); box-shadow: inset 0 -3px 0 var(--warm); }
.run-btn .k { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--warm); }
.run-btn .t { font-size: 0.86rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.run-btn .m { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }

.trace-head { display: flex; flex-direction: column; gap: 10px; }
.trace-head h2 { font-size: clamp(1.25rem, 1rem + 0.9vw, 1.65rem); overflow-wrap: anywhere; }
.trace-head .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.trace-head p { font-size: 0.95rem; margin: 0; width: 100%; max-width: 100%; text-align: justify; text-justify: inter-word; }
.pipeline { display: flex; flex-wrap: wrap; gap: 6px; }
.stage { font-family: var(--font-sans); font-size: 0.74rem; padding: 3px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); border: 1px solid transparent; }
.stage::before { content: "✓ "; }
.stage.given { background: var(--bg-soft); color: var(--muted); border-color: var(--border); }
.stage.given::before { content: "→ "; }

.replay { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: center; margin-top: 18px; padding: 14px 16px; }
.play-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--navy); color: var(--bg); cursor: pointer; display: grid; place-items: center; }
.play-btn svg { width: 14px; height: 14px; fill: currentColor; }
.play-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.scrub { width: 100%; accent-color: var(--warm); margin: 0; }
.activity { grid-column: 2; display: block; width: 100%; height: 30px; cursor: pointer; }
.activity .bar { fill: var(--node-stroke); }
.activity .ok { fill: var(--green); }
.activity .head { stroke: var(--warm); stroke-width: 1.5; }
.replay-status { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); }
.replay-status b { color: var(--text); font-weight: 600; }

.trace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; align-items: start; margin-top: 16px; }
@media (max-width: 1020px) { .trace-grid { grid-template-columns: minmax(0, 1fr); } }
.dag-wrap { overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px 14px; max-height: 80vh; }
.dag svg { display: block; margin: 0 auto; overflow: visible; }
.dag .edge { fill: none; stroke: var(--edge); stroke-width: 1.3; transition: opacity 0.25s ease, stroke 0.2s ease; }
.dag .edge.dropped { stroke-dasharray: 4 4; }
.dag .edge.hl { stroke: var(--warm); stroke-width: 2; }
.dag .node { cursor: pointer; transition: opacity 0.25s ease; }
.dag .node rect { fill: var(--bg); stroke: var(--node-stroke); stroke-width: 1.2; transition: fill 0.25s ease, stroke 0.25s ease; }
.dag .node text { font-family: var(--font-sans); font-size: 11.5px; fill: var(--text); pointer-events: none; }
.dag .node .tick { font-size: 11px; fill: var(--green); font-weight: 700; }
.dag .node.proved rect { fill: var(--green-soft); stroke: var(--green); }
.dag .node.unused rect { fill: var(--bg-soft); stroke: var(--muted); }
.dag .node.unused .tick { fill: var(--muted); }
.dag .node.dropped rect { fill: transparent; stroke: var(--muted); stroke-dasharray: 4 3; }
.dag .node.dropped text { fill: var(--muted); text-decoration: line-through; }
.dag .node.root rect { fill: var(--text); stroke: var(--text); }
.dag .node.root text { fill: var(--bg); font-weight: 600; }
.dag .node.root.proved rect { stroke: var(--green); stroke-width: 2.5; }
.dag .node.root .tick { fill: #7fe0b8; }
.dag .node.working rect { stroke: var(--warm); stroke-width: 2.4; }
.dag .node.sel rect { stroke: var(--blue); stroke-width: 2.6; }
.dag .node:focus { outline: none; }
.dag .node:focus-visible rect { stroke: var(--blue); stroke-width: 2.6; }
.dag .hidden { opacity: 0; pointer-events: none; }
.dag .badge circle { fill: var(--violet); }
.dag .badge text { fill: #fff; font-size: 9px; font-weight: 700; }
.dag .pulse { fill: var(--warm); }
@media (prefers-reduced-motion: no-preference) {
  .dag .node.working .pulse { animation: ta-pulse 1.1s ease-in-out infinite; }
}
@keyframes ta-pulse { 50% { opacity: 0.25; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--font-sans); font-size: 0.74rem; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 18px; height: 11px; border-radius: 4px; border: 1.3px solid var(--node-stroke); background: var(--bg); }
.legend i.ok { background: var(--green-soft); border-color: var(--green); }
.legend i.un { background: var(--bg-soft); border-color: var(--muted); }
.legend i.dr { border-style: dashed; border-color: var(--muted); background: transparent; }
.legend i.wk { border: 2.2px solid var(--warm); }
.legend i.s { width: 12px; height: 12px; border-radius: 50%; border: 0; background: var(--violet); }

.inspector { position: sticky; top: calc(var(--banner-h) + 16px); padding: 18px; max-height: calc(100vh - var(--banner-h) - 32px); overflow: auto; font-family: var(--font-sans); }
@media (max-width: 1020px) { .inspector { position: static; max-height: none; } }
.inspector .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.inspector h3 { font-size: 1.02rem; overflow-wrap: anywhere; }
.inspector .nid { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
.inspector .when { font-size: 0.78rem; color: var(--muted); margin-top: 8px; }
.inspector .claim { font-family: var(--font-serif); font-size: 0.92rem; line-height: 1.6; color: var(--body); overflow-wrap: anywhere; }
.inspector h4 { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.inspector pre.code { font-size: 0.72rem; max-height: 280px; white-space: pre; margin: 0; }
.inspector details summary { cursor: pointer; font-size: 0.8rem; color: var(--blue); margin: 4px 0; }
.inspector .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-family: var(--font-mono); font-size: 0.7rem; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); cursor: pointer; overflow-wrap: anywhere; text-align: left; }
.chip:hover { border-color: var(--navy); }
.lessons { margin: 0; padding-left: 1.1rem; }
.lessons li { font-size: 0.8rem; line-height: 1.55; color: var(--body); overflow-wrap: anywhere; }
.lessons li + li { margin-top: 6px; }
.trace-loading { padding: 40px; text-align: center; font-family: var(--font-sans); color: var(--muted); }
.wrap-trace { max-width: 1380px; }
.trace-grid { grid-template-columns: minmax(0, 1fr) 350px; }
@media (max-width: 1020px) { .trace-grid { grid-template-columns: minmax(0, 1fr); } }
.kv.kv-tight { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.activity .bad { fill: var(--warm); opacity: 0.8; }
.activity-key { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--font-sans); font-size: 0.7rem; color: var(--muted); margin-top: -2px; }
.activity-key i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; background: var(--node-stroke); }
.activity-key i.bad { background: var(--warm); }
.activity-key i.ok { background: var(--green); }
.legend b.ln { display: inline-block; width: 22px; height: 0; border-top: 1.6px solid var(--edge); }
.legend b.ln.hl { border-top: 2px solid var(--warm); }
.legend b.ln.dash { border-top: 1.6px dashed var(--muted); }
.legend-note { font-family: var(--font-sans); font-size: 0.74rem; line-height: 1.55; color: var(--muted); margin: 8px 0 0; max-width: 100%; text-align: justify; text-justify: inter-word; }

/* grouped results table: one underline per benchmark (like \cmidrule), divider between benchmarks, centred numbers */
.ac-table.results th.mcol { vertical-align: bottom; }
.ac-table.results th.grp { text-align: center; position: relative; padding-bottom: 8px; vertical-align: bottom; }
.ac-table.results th.grp::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; border-bottom: 1px solid var(--rule); }
.ac-table.results th.grp .gsub { display: block; font-size: 0.74rem; font-weight: 400; color: var(--muted); margin-top: 1px; }
.ac-table.results td.num, .ac-table.results th.num { text-align: center; }
.ac-table.results .gstart { border-left: 1px solid var(--border); }

/* problem explorer → demo */
.pitem .meta .demo-badge { margin-left: auto; font-family: var(--font-sans); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.04em; color: var(--green); background: var(--green-soft); padding: 1px 7px; border-radius: 999px; }
.replay-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 4px; }
.replay-cta .mono { font-size: 0.74rem; color: var(--muted); }
.pitem .meta { min-width: 0; }
.pitem .meta > span { white-space: nowrap; }
.pitem .meta > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.pitem .meta .demo-badge { flex: none; }
.ac-table.results { table-layout: fixed; min-width: 640px; }
.ac-table.results th, .ac-table.results td { padding-left: 10px; padding-right: 10px; }
.ac-table.results th.mcol, .ac-table.results tbody td:first-child { white-space: normal; }

/* =====================================================================
   Workshops: expandable program panel
   ===================================================================== */
.ws-series { font-family: var(--font-sans); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warm); margin-bottom: 4px; }
.ws-detail { grid-column: 1 / -1; border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 4px; }
.ws-detail > summary { cursor: pointer; font-family: var(--font-sans); font-size: 0.84rem; font-weight: 500; color: var(--blue); list-style-position: inside; }
.ws-body { margin-top: 16px; }
.ws-top { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 22px; align-items: start; }
@media (max-width: 720px) { .ws-top { grid-template-columns: minmax(0, 1fr); } .ws-poster { max-width: 240px; } }
.ws-sub { font-family: var(--font-sans); font-size: 0.82rem; color: var(--muted); margin: 0 0 10px; }
.ws-intro { font-family: var(--font-serif); font-size: 0.98rem; line-height: 1.7; color: var(--body); margin: 0; }
.ws-poster { margin: 0; }
.ws-poster img { border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.ws-poster figcaption, .ws-photo figcaption { font-family: var(--font-sans); font-size: 0.74rem; color: var(--muted); margin-top: 6px; text-align: center; }
.prog-sec { margin-top: 22px; }
.prog-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--font-sans); font-size: 0.8rem; font-weight: 600; color: var(--bg); background: var(--navy); border-radius: 8px; padding: 7px 12px; }
.prog-item { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--border); font-family: var(--font-sans); }
@media (max-width: 560px) { .prog-item { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.prog-item:last-child { border-bottom: 0; }
.prog-time { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); padding-top: 2px; }
.prog-title { font-size: 0.95rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.prog-zh { font-family: var(--font-sans); font-size: 0.82rem; color: var(--muted); }
.prog-spk { display: flex; flex-direction: column; gap: 1px; margin-top: 5px; font-size: 0.8rem; color: var(--blue); }
.prog-spk b { font-weight: 600; }
.prog-item.brk .prog-title { font-weight: 500; color: var(--body); }
.prog-more { margin-top: 6px; }
.prog-more summary { cursor: pointer; font-size: 0.78rem; color: var(--warm); font-weight: 500; }
.prog-abs, .prog-bio { font-family: var(--font-serif); font-size: 0.9rem; line-height: 1.65; color: var(--body); margin: 8px 0 0; }
.prog-bio { font-size: 0.84rem; color: var(--muted); }
.prog-bio strong { color: var(--text); }
.ws-photo { margin: 24px 0 4px; }
.ws-photo img { border-radius: 10px; width: 100%; }
.news-type { display: inline-flex; margin-bottom: 4px; }
.row .when .news-type { display: flex; width: max-content; }
.news li .news-type { margin: 0 6px 0 0; vertical-align: 1px; }

/* =====================================================================
   Home: Hero vision + What's new before the citation
   ===================================================================== */
.hero-vision {
  width: 100%;
  max-width: 100%;
  margin: 32px auto 0;
}
.hero-vision > h2 {
  margin-bottom: 16px;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.hero-vision > h2::before,
.hero-vision > h2::after {
  content: "";
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--border);
}
.vision-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.vision-points li {
  padding: 22px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}
.vision-points li:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.vision-points h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 1.4em;
}
.vision-points li:nth-child(1) h3 { color: var(--warm); }
.vision-points li:nth-child(2) h3 { color: var(--green); }
.vision-points li:nth-child(3) h3 { color: var(--blue); }

.vision-points p {
  margin: 8px 0 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--body);
}

@media (max-width: 768px) {
  .hero-vision { margin-top: 24px; }
  .vision-points { grid-template-columns: 1fr; gap: 10px; }
  .vision-points li { padding: 16px 18px; text-align: left; }
  .vision-points h3 { font-size: 1.15rem; }
  .vision-points p { font-size: 0.9rem; }
}

/* Hero Action Links (Paper / Code) */
.hero-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.hero-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.hero-link-btn:hover {
  transform: translateY(-2px);
  border-color: var(--navy);
  color: var(--blue);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}
.hero-link-btn .link-icon {
  stroke: currentColor;
  transition: transform 0.18s ease;
}
.hero-link-btn:hover .link-icon {
  transform: scale(1.1);
}

/* What's new */
.home-news .news { margin-top: 12px; }
.home-news h3 { font-size: 0.95rem; font-weight: 500; line-height: 1.55; }
.home-news p { margin: 4px 0 0; font-size: 0.84rem; line-height: 1.5; color: var(--body); }

/* =====================================================================
   People page (members come from data/people.js)
   ===================================================================== */
.people-group + .people-group { margin-top: 48px; }
.people-title { font-size: 1.3rem; margin-bottom: 20px; }
.people-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 16px; }
.person { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 16px 8px; }
.person-portrait { width: 112px; height: 112px; }
.person-photo { display: block; width: 112px; height: 112px; border: 1px solid var(--border); border-radius: 50%; object-fit: cover; background: var(--bg-soft); }
.person-name { font-size: 1.02rem; line-height: 1.35; }
.person-refs { margin-left: 4px; font-size: 0.68rem; font-weight: 500; white-space: nowrap; }
.author-role-mark { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; line-height: 0; }
.person-zh { margin-top: -4px; font-family: var(--font-sans); font-size: 0.95rem; font-weight: 500; color: var(--text); }
.people-affiliations { margin-top: 12px; padding-top: 28px; border-top: 1px solid var(--border); }
.people-affiliations h2 { font-size: 1.3rem; }
.author-notes { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--border); font-family: var(--font-sans); font-size: 0.92rem; line-height: 1.7; color: var(--text); }
.author-notes span { display: inline-block; }
.author-notes sup { color: var(--blue); }
.affiliation-grid { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; }
.affiliation-grid li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; scroll-margin-top: calc(var(--banner-h) + 28px); }
.affiliation-number { font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.5; color: var(--blue); }
.affiliation-institution { font-size: 0.9rem; line-height: 1.5; }
.affiliation-grid p { margin: 4px 0 0; font-family: var(--font-sans); font-size: 0.82rem; line-height: 1.6; color: var(--muted); }
@media (max-width: 760px) {
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .person-name { font-size: 0.92rem; }
  .affiliation-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
