/* ═══════════════════════════════════════════════════════════════════
   GRADE — base stylesheet
   Design tokens lifted from the prototype; GRADE branding throughout.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Design tokens — Pearl Education brand palette ── */
:root {
  --navy:           #000a3d;   /* deep navy — headlines, nav, footer */
  --navy-light:     #1b305c;   /* secondary navy */
  --teal:           #097f94;   /* Pearl teal — primary actions, links */
  --teal-light:     #0b9cb4;   /* lighter teal — hover states */
  --cyan:           #62d5e5;   /* accent cyan — eyebrows, brand arc */
  --teal-bg:        #e6f6f9;   /* pale cyan tint */
  --amber:          #d97b4a;   /* Pearl orange */
  --amber-light:    #e89a6e;   /* lighter orange */
  --coral:          #d97b4a;   /* alias → Pearl orange */
  --green:          #5c962e;   /* Pearl green */
  --text:           #2c2c2c;
  --text-secondary: #5a6474;
  --bg:             #fafbfc;
  --card:           #ffffff;
  --border:         #e2e6ec;
  --radius:         10px;
  --nav-height:     64px;

  /* Typography — Crimson Pro serif headlines + Montserrat labels + Poppins body */
  --font-serif: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --font-sans:  'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-label: 'Montserrat', system-ui, -apple-system, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Crimson Pro serif headlines — the signature Pearl typographic voice */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  letter-spacing: -0.005em;
}

main#main-content {
  flex: 1;
}

a {
  color: var(--teal);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── Nav ── */
nav {
  background: #fff;
  border-top: 3px solid var(--amber);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,10,61,0.06);
}

/* GRADE brand mark */
.nav-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; }

.brand-grade {
  font-family: var(--font-label);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--navy);
  line-height: 1.1;
}

.brand-powered {
  font-family: var(--font-label);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-link {
  font-family: var(--font-label);
  color: var(--navy-light);
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 6px;
  transition: color 0.18s, background 0.18s;
  text-decoration: none;
}
.nav-link:hover {
  color: var(--teal);
  background: rgba(9,127,148,0.08);
  text-decoration: none;
}
.nav-link.active {
  color: var(--teal);
  background: rgba(9,127,148,0.12);
}

/* ── Layout ── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

/* ── Hero ── */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-areas:
    "text art"
    "actions art";
  column-gap: 3rem;
  align-items: center;
  text-align: left;
  padding: 3rem 1rem 3.75rem;
}

.hero-text {
  grid-area: text;
  position: relative;
  z-index: 1;
}

/* Whisper layer: faint ruling + motes behind the whole hero */
.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  animation: hero-fade 1.2s ease-out both;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.hero-backdrop svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: 2.7rem;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 660px;
  margin: 0 0 1.5rem;
}

.hero-actions {
  grid-area: actions;
  align-self: start;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* ── Hero illustration ── */
.hero-art {
  grid-area: art;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.hero-art svg {
  width: 100%;
  max-width: 520px;
  height: auto;
}

.hero-art-line   { animation: hero-draw 2s ease-out 0.2s both; }
.hero-art-crown  { animation: hero-fade 0.8s ease-out 1.9s both; }
.hero-art-campus { animation: hero-rise 0.7s ease-out 0.15s both; }

.hero-art-step               { animation: hero-rise 0.7s ease-out both; }
.hero-art-step:nth-child(1)  { animation-delay: 0.35s; }
.hero-art-step:nth-child(2)  { animation-delay: 0.43s; }
.hero-art-step:nth-child(3)  { animation-delay: 0.51s; }
.hero-art-step:nth-child(4)  { animation-delay: 0.59s; }
.hero-art-step:nth-child(5)  { animation-delay: 0.67s; }
.hero-art-step:nth-child(6)  { animation-delay: 0.75s; }

.hero-art-dot               { animation: hero-drift 10s ease-in-out infinite; }
.hero-art-dot:nth-child(2n) { animation-duration: 12s; animation-delay: -6s; }
.hero-art-dot:nth-child(3n) { animation-duration: 9s;  animation-delay: -3s; }

@keyframes hero-draw {
  from { stroke-dasharray: 600; stroke-dashoffset: 600; }
  to   { stroke-dasharray: 600; stroke-dashoffset: 0; }
}
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes hero-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes hero-drift {
  0%, 100% { transform: none; }
  50%      { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art-line,
  .hero-art-crown,
  .hero-art-campus,
  .hero-art-step,
  .hero-backdrop,
  .hero-art-dot { animation: none; }
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.65rem 1.75rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.btn-primary:hover {
  background: var(--teal-light);
  border-color: var(--teal-light);
  text-decoration: none;
  color: #fff;
}
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
  text-decoration: none;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}
.card p { color: var(--text-secondary); font-size: 0.92rem; }

.card-heading {
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 0.6rem;
  font-weight: 700;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 1.75rem;
}
.page-header h1 {
  font-size: 1.8rem;
  color: var(--navy);
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ── Home bands: full-bleed color sections ── */
.home-band { width: 100%; }

.band-why,
.band-how { padding: 3.5rem 0; }

.band-why .container,
.band-how .container {
  padding-top: 0;
  padding-bottom: 0;
}

.band-why {
  background:
    radial-gradient(circle, rgba(26,39,68,0.055) 1px, transparent 1.4px),
    linear-gradient(160deg, #ffffff 0%, var(--teal-bg) 100%);
  background-size: 17px 17px, auto;
  border-top: 1px solid #d9ebe8;
}

.band-how {
  background:
    radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1.4px),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  background-size: 19px 19px, auto;
}

/* ── Home sections ── */
.home-section p {
  font-size: 0.92rem;
  max-width: 88ch;
}
.home-section p + p { margin-top: 0.75rem; }

.section-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.section-head .card-heading {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.section-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: var(--navy);
}
.section-icon svg { width: 24px; height: 24px; }

/* "Why this matters": illustration left / text right (mirroring the hero) */
.section-why {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 3.5rem;
  align-items: center;
}
.section-why p { color: var(--text-secondary); }
.section-why .section-icon {
  background: var(--card);
  border: 1px solid #cfe7e3;
}

.why-art {
  display: flex;
  justify-content: center;
}
.why-art svg {
  width: 100%;
  max-width: 390px;
  height: auto;
}

/* "How it works": white-on-navy chalkboard band */
.section-how .card-heading { color: #fff; }
.section-how p { color: rgba(255,255,255,0.82); }
.section-how p strong { color: var(--amber-light); }
.section-how .section-icon {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
}
.section-how .tier-grid { margin: 1.5rem 0 0; }
/* Lift the white cards off the navy band so they read crisply */
.section-how .tier-card {
  border: none;
  box-shadow: 0 12px 30px rgba(0, 5, 30, 0.45);
}
/* Tint the icon tile so the icon stands apart from the white card */
.section-how .tier-icon {
  background: var(--teal);
  color: #fff;
}
.section-how .tier-icon svg { stroke: #fff; }

/* ── Tier grid ── */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.tier-card {
  position: relative;
  overflow: hidden;
  padding: 1.15rem 1.25rem 1.2rem;
  margin-bottom: 0;
}

.tier-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.tier-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--teal-bg);
  color: var(--navy);
}
.tier-icon svg { width: 27px; height: 27px; }

.tier-watermark {
  position: absolute;
  top: 0.1rem;
  right: 0.8rem;
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--teal);
  opacity: 0.1;
  pointer-events: none;
  user-select: none;
}

.tier-card .tier-num {
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  margin-bottom: 0.1rem;
}

.tier-card h3 {
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 700;
}

.tier-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── Leaderboard table ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead th {
  font-family: var(--font-label);
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
thead th:first-child { border-radius: var(--radius) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius) 0 0; }

tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}
tbody tr:hover { background: var(--teal-bg); }

.rank-cell    { font-weight: 700; color: var(--navy); width: 3rem; }
.model-name   { font-weight: 600; color: var(--navy); }

.score-bar {
  height: 8px;
  background: #e9ecf0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 2px;
}
.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ── Filter controls ── */
.filter-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s;
  color: var(--text-secondary);
}
.filter-btn:hover           { border-color: var(--teal); color: var(--teal); }
.filter-btn.active          { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ── Arena ── */
.arena-app { margin-top: 1rem; }

.scenario-box {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius);
  padding: 2rem;
  color: #fff;
  margin-bottom: 1.5rem;
}
.scenario-label {
  font-family: var(--font-label);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.scenario-box h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #fff;
}
.scenario-context {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.85);
}
.scenario-question {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 1rem;
  font-weight: 600;
  color: var(--amber-light);
  font-style: italic;
}

.responses-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.response-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 0;
  overflow: hidden;
}
.response-card:hover        { border-color: var(--teal); box-shadow: 0 4px 16px rgba(9,127,148,0.14); }
.response-card.selected     { border-color: var(--teal); background: var(--teal-bg); }

.response-label {
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  margin-bottom: 0.75rem;
}

.vote-section   { text-align: center; padding: 1rem 0; }
.vote-prompt    { font-size: 1rem; color: var(--navy); font-weight: 600; margin-bottom: 1rem; }
.vote-buttons   { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.vote-btn {
  padding: 0.65rem 2rem;
  border: 2px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}
.vote-btn:hover             { border-color: var(--teal); color: var(--teal); }
.vote-btn.primary           { background: var(--teal); color: #fff; border-color: var(--teal); }
.vote-btn.primary:hover     { background: var(--teal-light); }

/* ── Role picker ── */
.role-picker {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0 0.5rem;
  flex-wrap: wrap;
}
.role-btn {
  padding: 0.5rem 1.15rem;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s;
  color: var(--text-secondary);
}
.role-btn:hover             { border-color: var(--teal); color: var(--teal); }
.role-btn.active            { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── Coming soon placeholder ── */
.coming-soon-card {
  text-align: center;
  padding: 3rem 2rem;
}
.coming-soon-label {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin-bottom: 0.75rem;
}

/* ── Doc page bands (Methodology + About) ── */

/*
 * .doc-band — full-bleed section band for doc/info pages.
 * Contains an inner .container; prose is constrained to .doc-inner (74ch).
 *
 * Variants:
 *   .doc-band--plain — white background with a hairline top border
 *   .doc-band--tint  — light teal dot-texture gradient (mirrors .band-why)
 */
.doc-band {
  width: 100%;
  padding: 3rem 0;
}

.doc-band .container {
  padding-top: 0;
  padding-bottom: 0;
}

/* Reading-width prose container inside a band */
.doc-band .doc-inner {
  max-width: 74ch;
  margin: 0 auto;
}

/* White band — hairline separator so adjacent plain bands are distinct */
.doc-band--plain {
  background: var(--card);
  border-top: 1px solid var(--border);
}

/* Light teal dot-texture gradient (same recipe as .band-why) */
.doc-band--tint {
  background:
    radial-gradient(circle, rgba(26,39,68,0.055) 1px, transparent 1.4px),
    linear-gradient(160deg, #ffffff 0%, var(--teal-bg) 100%);
  background-size: 17px 17px, auto;
  border-top: 1px solid #d9ebe8;
}

/* Hero band for doc pages — navy dark band (mirrors .band-how) */
.doc-band--hero {
  background:
    radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1.4px),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  background-size: 19px 19px, auto;
  padding: 3.5rem 0;
  border-top: none;
}

.doc-band--hero .doc-inner { max-width: 74ch; margin: 0 auto; }

.doc-band--hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.doc-band--hero p {
  color: rgba(255,255,255,0.82);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0.5rem 0 0;
}

/* Lead intro is rendered inside .doc-body, whose dark prose colors would
   otherwise win on the navy hero — force light text here. */
.doc-band--hero .doc-body,
.doc-band--hero .doc-body p { color: rgba(255,255,255,0.85); }
.doc-band--hero .doc-body strong { color: #fff; }
.doc-band--hero .doc-body a { color: #fff; text-decoration: underline; }

/* ── Footer — Pearl's dark-navy footer with light text ── */
footer {
  background: var(--navy);
  border-top: 3px solid var(--amber);
  padding: 2.5rem 1rem;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
}
.footer-brand {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 0.5rem;
}
/* Wordmark is navy on the white nav; on the dark footer use Pearl cyan */
.footer-brand .brand-grade { color: var(--cyan); }
.footer-links {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.4rem;
}
.footer-links a { color: var(--cyan); }
.footer-copy {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}
.footer-copy a { color: var(--cyan); }

/* ── Responsive ── */
@media (max-width: 1000px) {
  .tier-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "text"
      "art"
      "actions";
    row-gap: 0.5rem;
    text-align: center;
  }
  .hero-subtitle    { margin: 0 auto; }
  .hero-actions     { justify-content: center; }
  .hero-art svg     { max-width: 350px; }
  .hero-headline    { font-size: 1.6rem; }
  .section-why      { grid-template-columns: 1fr; gap: 1.5rem; }
  .why-art          { order: 2; }
  .why-art svg      { max-width: 280px; }
  .responses-grid   { grid-template-columns: 1fr; }
  .tier-grid        { grid-template-columns: 1fr; }
  nav               { padding: 0 1rem; }
  .brand-grade      { font-size: 1.1rem; }
  .nav-link         { padding: 0.4rem 0.6rem; font-size: 0.82rem; }
  .container        { padding: 1.25rem; }
}

@media (max-width: 500px) {
  .nav-links { gap: 0; }
  .nav-link  { padding: 0.35rem 0.45rem; font-size: 0.78rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   Dataset browser — shared styles (Explorer + Arena)
   ═══════════════════════════════════════════════════════════════════ */

.datasets-section {
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.datasets-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.3rem;
}
.datasets-intro {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.dataset-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dataset-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.dataset-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.dataset-row-header:hover,
.dataset-row-header:focus-visible {
  background: rgba(9,127,148,0.06);
  outline: none;
}
.dataset-row.is-open .dataset-row-header {
  border-bottom: 1px solid var(--border);
}
.dataset-row-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
}
.dataset-row-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
  font-weight: 400;
}
.dataset-row-filename {
  font-size: 0.73rem;
  color: var(--text-secondary);
  font-family: monospace;
  flex-shrink: 0;
}
.dataset-row-toggle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.dataset-row-toggle .ds-chevron {
  font-size: 0.65rem;
  transition: transform 0.2s;
  display: inline-block;
}
.dataset-row.is-open .dataset-row-toggle .ds-chevron {
  transform: rotate(180deg);
}
.dataset-table-wrap {
  display: none;
  padding: 0.75rem 1rem 1rem;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 320px;
}
.dataset-row.is-open .dataset-table-wrap {
  display: block;
}
.dataset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.77rem;
  white-space: nowrap;
}
.dataset-table thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  border-bottom: 2px solid var(--border);
  padding: 0.35rem 0.6rem;
  text-align: left;
  font-weight: 700;
  color: var(--navy);
  z-index: 1;
}
.dataset-table tbody tr:nth-child(even) {
  background: rgba(9,127,148,0.05);
}
.dataset-table tbody td {
  padding: 0.28rem 0.6rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dataset-table-caption {
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-align: right;
}
.dataset-loading {
  padding: 0.75rem 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.dataset-error {
  padding: 0.5rem 0;
  font-size: 0.82rem;
  color: #c0392b;
}

/* Markdown prose inside arena response cards */
.response-card .prose-md h1,
.response-card .prose-md h2,
.response-card .prose-md h3,
.response-card .prose-md h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin: 1rem 0 0.35rem;
}
.response-card .prose-md h1:first-child,
.response-card .prose-md h2:first-child,
.response-card .prose-md h3:first-child { margin-top: 0; }
.response-card .prose-md p  { margin: 0 0 0.6rem; }
.response-card .prose-md p:last-child { margin-bottom: 0; }
.response-card .prose-md ul,
.response-card .prose-md ol {
  margin: 0.35rem 0 0.6rem 1.25rem;
  padding: 0;
}
.response-card .prose-md li { margin-bottom: 0.2rem; }
.response-card .prose-md .table-wrap {
  overflow-x: auto;
  margin: 0.6rem 0;
}
.response-card .prose-md table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0;
}
.response-card .prose-md th,
.response-card .prose-md td {
  border: 1px solid var(--border);
  padding: 0.3rem 0.55rem;
  text-align: left;
}
.response-card .prose-md th { background: var(--teal-bg); font-weight: 700; color: var(--navy); }
.response-card .prose-md code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.85em;
}
.response-card .prose-md pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}
.response-card .prose-md pre code { background: none; border: none; padding: 0; }
