:root {
  color-scheme: dark;
  --bg: #0b1018;
  --bg-2: rgba(15, 23, 42, 0.72);
  --panel: rgba(14, 21, 32, 0.94);
  --panel-strong: #111827;
  --line: rgba(96, 165, 250, 0.22);
  --text: #E5EDF8;
  --muted: #94A3B8;
  --soft: #CBD5E1;
  --accent: #3B82F6;
  --accent-2: #8B5CF6;
  --accent-3: #22D3EE;
  --good: #34D399;
  --warn: #FBBF24;
  --bad: #FB7185;
  --shadow: 0 18px 46px rgba(2, 6, 23, 0.34);
  --radius: 24px;
  --radius-sm: 16px;
  --mouse-x: 50%;
  --mouse-y: 50%;
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html[data-ai-theme="admin-light"] {
  color-scheme: light;
  --bg:#f8fafc; --bg-2:rgba(255,255,255,.96); --panel:#ffffff; --panel-strong:#ffffff;
  --line:rgba(37,99,235,.24); --text:#0f172a; --muted:#64748b; --soft:#334155; --accent:#2563eb; --accent-2:#7c3aed; --accent-3:#0284c7;
}
html[data-ai-theme="admin-dark"] {
  color-scheme: dark;
  --bg:#0b1018; --bg-2:rgba(15,23,42,.94); --panel:#0f172a; --panel-strong:#111827;
  --line:rgba(96,165,250,.22); --text:#E5EDF8; --muted:#94A3B8; --soft:#CBD5E1; --accent:#60a5fa; --accent-2:#8b5cf6; --accent-3:#22d3ee;
}
html[data-ai-theme="fd-light"] {
  color-scheme: light;
  --bg:#dbe7f3; --bg-2:rgba(255,255,255,.96); --panel:#ffffff; --panel-strong:#ffffff;
  --line:rgba(217,119,6,.28); --text:#172033; --muted:#526070; --soft:#1f2937; --accent:#d97706; --accent-2:#0284c7; --accent-3:#60a5fa;
}
html[data-ai-theme="fd-dark"] {
  color-scheme: dark;
  --bg:#111827; --bg-2:rgba(15,23,42,.96); --panel:#111827; --panel-strong:#0f172a;
  --line:rgba(245,158,11,.30); --text:#f8fafc; --muted:#cbd5e1; --soft:#e5e7eb; --accent:#f59e0b; --accent-2:#38bdf8; --accent-3:#60a5fa;
}
html[data-ai-theme="ccre-light"] {
  color-scheme: light;
  --bg:#eff8fb; --bg-2:rgba(255,255,255,.96); --panel:#ffffff; --panel-strong:#ffffff;
  --line:rgba(5,150,105,.24); --text:#0f172a; --muted:#64748b; --soft:#334155; --accent:#059669; --accent-2:#0d9488; --accent-3:#0284c7;
}
html[data-ai-theme="ccre-dark"] {
  color-scheme: dark;
  --bg:#031412; --bg-2:rgba(6,24,22,.96); --panel:#061816; --panel-strong:#08211e;
  --line:rgba(52,211,153,.28); --text:#ecfdf5; --muted:#99f6e4; --soft:#d1fae5; --accent:#34d399; --accent-2:#14b8a6; --accent-3:#60a5fa;
  --readable-card-shadow: 0 18px 42px rgba(2, 6, 23, 0.22);
}
html[data-ai-theme] body {
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--accent) 24%, transparent) 0%, transparent 34%),
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--accent-2) 20%, transparent) 0%, transparent 32%),
    linear-gradient(180deg,var(--bg) 0%,color-mix(in srgb, var(--bg) 92%, #000 8%) 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(59,130,246,0.24) 0%, rgba(59,130,246,0) 34%),
    radial-gradient(circle at 88% 8%, rgba(139,92,246,0.20) 0%, rgba(139,92,246,0) 32%),
    linear-gradient(180deg,#0b1018 0%,#0e1623 56%,#090d14 100%);
  background-attachment: fixed;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

/* Animations */
@keyframes typewriter {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 100%;
    opacity: 1;
  }
}

@keyframes float-up {
  from {
    opacity: 0;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%, 49% {
    border-right-color: var(--accent);
  }
  50%, 100% {
    border-right-color: transparent;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem clamp(1rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--panel-strong) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(130%);
  box-shadow: 0 16px 34px rgba(2,6,23,0.28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  min-width: max-content;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(59,130,246,0.28);
}
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand small { color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }

.tabs {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.tab, .pill {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--soft);
  padding: 0.58rem 0.85rem;
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 200ms ease-out;
}
.tab:hover, .pill:hover { color: var(--text); background: rgba(59,130,246,0.10); }
.tab.is-active, .pill.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(59,130,246,0.24);
}
.workspace-link {
  justify-self: end;
  padding: 0.62rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: all 200ms ease-out;
}
.workspace-link:hover { border-color: var(--accent); background: rgba(59,130,246,0.10); }

.header-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.theme-select {
  padding: 0.62rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--soft);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
}
.theme-select:hover, .theme-select:focus { border-color: var(--accent); outline: none; }
.play-sandbox-button {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.play-sandbox-button.is-running {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}


main {
  min-height: calc(100vh - 150px);
  position: relative;
  z-index: 100;
}
.page { display: none; animation: pageIn 200ms ease-out; }
.page.is-active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.section-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4.8rem) 0;
}
.section-heading {
  max-width: 780px;
  margin-bottom: 1.8rem;
  background: var(--panel-strong);
  color: var(--text);
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--readable-card-shadow, var(--shadow));
}
.section-heading.narrow { max-width: 820px; }
.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 0.75rem;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.035em; font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif; }
h1 {
  font-size: clamp(2.0rem, 6vw, 4.8rem);
  line-height: 1.05;
  font-weight: 700;
  overflow: hidden;
  display: inline-block;
  border-right: none;
  min-height: 1.1em;
}

.hero-copy {
  background: var(--panel-strong);
  color: var(--text);
  padding: 1.5rem 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  z-index: 20;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(310px, 0.62fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  min-height: 65vh;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
h2 { font-size: clamp(1.35rem, 2.8vw, 2.1rem); line-height: 1.1; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { color: var(--muted); line-height: 1.75; }
/* Keep the page readable immediately. Fancy delay is cute once. Then it becomes a bad capacitor: silent failure. */
.hero-text { font-size: clamp(1.05rem, 2.2vw, 1.25rem); max-width: 760px; color: var(--soft); opacity: 1; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.8rem; opacity: 1; }
.hero-card { opacity: 1; }
.section-shell:nth-of-type(n+2) { opacity: 1; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 44px;
  padding: 0.75rem 1.2rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  transition: all 200ms ease-out;
}
.button:hover { transform: translateY(-2px); border-color: var(--accent); background: rgba(59,130,246,0.10); }
.button.primary { border: 0; color: #F8FAFC; background: var(--accent); }
.button.primary:hover { background: #2563EB; }
.button.ghost { background: rgba(59,130,246,0.08); }
.button.full { width: 100%; }

.hero-card, .card, .course-card, .lab-panel, .leaderboard-card, .glossary-card, .timeline-item {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--readable-card-shadow, var(--shadow));
}
.hero-card {
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: -40% -30% auto auto;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: rgba(59,130,246,0.16);
  filter: blur(10px);
}
.score-ring {
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  background:
    radial-gradient(circle at center, var(--panel-strong) 58%, transparent 59%),
    conic-gradient(from -90deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
}
.score-ring span { display: block; font-size: 2rem; font-weight: 800; color: var(--text); }
.score-ring small { display: block; color: var(--soft); text-align: center; margin-top: -1.6rem; font-weight: 700; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.2rem; }
.stat-row span { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: var(--radius-sm); padding: 1rem; }
.stat-row strong, .stat-row small { display: block; }
.stat-row small { color: var(--muted); margin-top: 0.3rem; }

.card-grid, .course-grid, .glossary-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 1.2rem; }
.card-grid.five { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card, .glossary-card, .course-card {
  border-radius: var(--radius);
  padding: 1.35rem;
  animation: none;
  min-height: 100%;
}
.card .icon, .course-icon { font-size: 1.55rem; margin-bottom: 0.8rem; }
.card p, .course-card p, .glossary-card p { margin-bottom: 0; font-size: 0.98rem; color: var(--soft); line-height: 1.7; }

.split { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 2.5rem; align-items: start; }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.steps article { border: 1px solid var(--line); background: var(--panel-strong); color: var(--text); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--readable-card-shadow, var(--shadow)); }
.steps span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #F8FAFC; background: var(--accent); font-weight: 700; margin-bottom: 0.8rem; }
.steps p { margin-bottom: 0; }
.warning-note { border-top: 1px solid var(--line); display: flex; gap: 0.8rem; color: var(--soft); padding-top: 1.8rem; }
.warning-note strong { color: var(--warn); }

.timeline-controls, .path-filters { display: flex; gap: 0.65rem; flex-wrap: wrap; margin: 1.3rem 0 1.6rem; }
.timeline { position: relative; display: grid; gap: 1rem; }
.timeline::before { content: ""; position: absolute; left: 1.15rem; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--accent), transparent); opacity: 0.3; }
.timeline-item { position: relative; margin-left: 2.4rem; border-radius: var(--radius); padding: 1rem 1rem 1rem 1.25rem; }
.timeline-item::before { content: ""; position: absolute; left: -2.04rem; top: 1.2rem; width: 12px; height: 12px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 6px rgba(59,130,246,0.16); }
.timeline-meta { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.4rem; }
.year { color: var(--accent-3); font-weight: 700; }
.era { color: #F8FAFC; background: var(--accent); border-radius: 999px; padding: 0.25rem 0.6rem; font-size: 0.75rem; font-weight: 700; }

.course-card { display: flex; flex-direction: column; gap: 0.8rem; }
.course-top { display: flex; justify-content: space-between; gap: 0.75rem; }
.level { width: fit-content; padding: 0.3rem 0.65rem; border-radius: 999px; background: rgba(59,130,246,0.16); color: var(--accent); font-size: 0.76rem; font-weight: 700; }
.course-actions { margin-top: auto; display: flex; gap: 0.65rem; flex-wrap: wrap; }

.course-task {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--line) 72%, var(--accent) 28%);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-strong) 90%);
  color: var(--soft);
}
.course-task strong { color: var(--text); }
.course-flow {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.55;
}
.course-status {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.38rem 0.65rem;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
}
.mini-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.25);
}
.mini-button { border: 1px solid var(--line); background: rgba(59,130,246,0.08); color: var(--text); border-radius: 999px; padding: 0.5rem 0.75rem; font-size: 0.83rem; font-weight: 700; transition: all 200ms ease-out; }
.mini-button:hover { background: rgba(59,130,246,0.16); }
.mini-button.done { color: #F8FAFC; background: var(--good); border-color: transparent; }

.playground-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 1.5rem; align-items: start; }
.activity-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0.8rem; margin: 1.5rem 0; }
.activity-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem; background: rgba(59,130,246,0.08); text-align: left; color: var(--text); transition: all 200ms ease-out; }
.activity-card:hover { background: rgba(59,130,246,0.12); }
.activity-card.is-active { border-color: var(--accent); background: rgba(59,130,246,0.18); }
.activity-card strong { display: block; margin-bottom: 0.3rem; }
.activity-card small { color: var(--muted); }
.lab-panel { border-radius: var(--radius); padding: 1.2rem; }
.lab-panel label { display: block; color: var(--soft); font-weight: 700; margin: 1rem 0 0.5rem; }
.lab-panel label:first-child { margin-top: 0; }
select, textarea, input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  outline: none;
  transition: all 200ms ease-out;
}
textarea { resize: vertical; min-height: 190px; }
select:focus, textarea:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.16); }
.prompt-tools { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1rem; }
.model-note { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.88rem; margin-top: 0.9rem; }
.status-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--good); box-shadow: 0 0 0 5px rgba(168,212,184,0.2); }
.status-dot.loading { background: var(--warn); box-shadow: 0 0 0 5px rgba(232,196,160,0.2); }
.status-dot.error { background: var(--bad); box-shadow: 0 0 0 5px rgba(232,180,168,0.2); }
.output-panel { margin-bottom: 1rem; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; }
.panel-title button { border: 1px solid var(--line); border-radius: 999px; background: rgba(59,130,246,0.08); color: var(--text); padding: 0.45rem 0.7rem; transition: all 200ms ease-out; }
.panel-title button:hover { background: rgba(59,130,246,0.16); }
pre#ai-output { white-space: pre-wrap; word-break: break-word; min-height: 260px; margin: 0; color: var(--soft); line-height: 1.6; background: var(--panel-strong); padding: 1rem; border-radius: var(--radius-sm); }
.challenge-panel p { margin-top: 0.5rem; }

.leaderboard-layout { display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(340px, 0.64fr); gap: 1.5rem; align-items: start; }
.inline-form { display: flex; gap: 0.75rem; }
.inline-form input { flex: 1; }
.badge-list { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.2rem; }
.badge { border: 1px solid var(--line); background: rgba(59,130,246,0.08); color: var(--soft); border-radius: 999px; padding: 0.55rem 0.8rem; font-weight: 700; font-size: 0.86rem; }
.badge.earned { background: rgba(168,212,184,0.15); border-color: rgba(168,212,184,0.3); color: var(--good); }
.leaderboard-card { border-radius: var(--radius); padding: 1.2rem; }
.leader-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 0.8rem; align-items: center; border-bottom: 1px solid var(--line); padding: 0.85rem 0; }
.leader-row:last-child { border-bottom: 0; }
.rank { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(59,130,246,0.12); font-weight: 700; }
.leader-row.me .rank { background: var(--accent); color: #F8FAFC; }
.xp { color: var(--accent-3); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  background: var(--accent);
  color: #F8FAFC;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(201,130,92,0.18);
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.site-footer {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 1.8rem 1rem 2.2rem;
  font-size: 0.88rem;
  position: relative;
  z-index: 100;
}

.site-header, .hero-card, .card, .course-card, .lab-panel, .leaderboard-card, .glossary-card, .timeline-item, .steps article, .play-input-bar, .play-msg-bubble {
  backdrop-filter: blur(14px) saturate(125%);
}

.brand strong {
  color: var(--text);
  letter-spacing: -0.03em;
}

.tab, .pill, .workspace-link, .button, .mini-button {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.button.primary, .play-send, .play-msg.user .play-msg-bubble, .steps span, .leader-row.me .rank, .toast {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

/* ── Playground Chat UI ── */
.play-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center; /* center title+input when no messages */
  height: calc(100vh - 64px);
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
  z-index: 20;
}

.play-wrap.has-messages {
  justify-content: flex-start; /* normal top-down once chat starts */
}

.play-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 0 1.8rem;
  transition: padding 400ms ease-out, text-align 400ms ease-out;
  pointer-events: none;
}

.play-header.has-messages {
  padding: 0.8rem 0 0.6rem;
  align-items: flex-start;
  text-align: left;
}

.play-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  display: inline-block;
  border-right: none;
  background: var(--panel-strong);
  color: var(--text);
  padding: 0.12em 0.26em;
  border-radius: 4px;
}

.play-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1rem 0;
  scroll-behavior: smooth;
}

/* Hide message area when empty so justify-content:center works */
.play-messages:empty {
  flex: 0;
  padding: 0;
}

.play-msg {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  position: relative;
  z-index: 20;
}

.play-msg.user { flex-direction: row-reverse; }

.play-msg-bubble {
  max-width: 78%;
  padding: 0.85rem 1.1rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.play-msg.user .play-msg-bubble {
  background: var(--accent);
  color: #F8FAFC;
  border-color: transparent;
}

.play-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.play-msg.user .play-msg-avatar { background: var(--accent); color: #F8FAFC; border-color: transparent; }

.play-typing { opacity: 0.6; font-style: italic; }

.play-error {
  background: rgba(232,180,168,0.15) !important;
  border-color: rgba(232,180,168,0.4) !important;
  color: #c0554a !important;
}

.play-input-wrap {
  padding: 0.8rem 0 1.2rem;
  position: relative;
  z-index: 20;
}

.play-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.6rem 0.6rem 0.6rem 0.8rem;
  box-shadow: var(--readable-card-shadow, 0 4px 20px rgba(0,0,0,0.10));
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}

.play-input-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(59,130,246,0.16);
}

.play-textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.5;
  padding: 0.3rem 0;
}

.play-textarea::placeholder { color: var(--muted); }

.play-icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 200ms ease-out;
  flex-shrink: 0;
}

.play-icon-btn:hover { background: rgba(59,130,246,0.12); color: var(--accent); }
.play-icon-btn.recording { color: #E84343; animation: pulse 1s infinite; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.play-send {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #F8FAFC;
  cursor: pointer;
  transition: all 200ms ease-out;
  flex-shrink: 0;
}

.play-send:hover:not(:disabled) { background: #2563EB; transform: scale(1.05); }
.play-send:disabled { background: var(--line); color: var(--muted); cursor: default; }

.play-toolbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.5rem;
  padding: 0 0.4rem;
}

.play-model-select {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--soft);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease-out;
}

.play-model-select:hover { border-color: var(--accent); }

.play-file-badge {
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.24);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.play-hint { margin-left: auto; font-size: 0.75rem; color: var(--muted); }

.play-agent-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding: 0.5rem 0.8rem;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--muted);
}

.play-agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(139,168,138,0.2);
  animation: pulse 2s infinite;
}

.play-agent-name { font-weight: 700; color: var(--accent-2); }
.play-agent-meta { color: var(--muted); }

@media (max-width: 1050px) {
  .site-header { grid-template-columns: 1fr; }
  .header-actions { justify-self: start; }
  .hero, .split, .playground-layout, .leaderboard-layout { grid-template-columns: 1fr; }
  .card-grid.five { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .activity-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .section-shell { width: min(100% - 1rem, 1180px); }
  .tabs { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.2rem; }
  .tab { white-space: nowrap; }
  .card-grid, .card-grid.five, .course-grid, .glossary-grid, .steps, .activity-strip { grid-template-columns: 1fr; }
  .warning-note { display: block; }
  .inline-form, .prompt-tools { flex-direction: column; }
  .hero { min-height: auto; padding-top: 1rem; }
  h1 { font-size: clamp(2.0rem, 12vw, 3.8rem); }
}


/* Readability pass 0.6.05.1754: explicit high-contrast cards and controls. */
.hero-card h2, .card h3, .course-card h3, .glossary-card h3, .timeline-item h3,
.leaderboard-card h2, .lab-panel h2, .section-heading h2 {
  color: var(--text);
}
.hero-card p, .timeline-item p, .steps p, .leaderboard-card p, .lab-panel p,
.activity-card small, .model-note, .muted, .play-agent-meta, .play-hint {
  color: var(--soft);
}
.hero-card, .card, .course-card, .lab-panel, .leaderboard-card, .glossary-card, .timeline-item, .steps article,
.play-input-bar, .play-msg-bubble, .play-agent-bar, .theme-select, .play-model-select {
  background-color: var(--panel-strong);
  color: var(--text);
  border-color: color-mix(in srgb, var(--line) 78%, var(--text) 22%);
}
.theme-select, .play-model-select, .workspace-link, .tab, .pill {
  color: var(--text);
}
.theme-select option {
  background: var(--panel-strong);
  color: var(--text);
}
html[data-ai-theme$="light"] .button.primary,
html[data-ai-theme$="light"] .play-send,
html[data-ai-theme$="light"] .steps span,
html[data-ai-theme$="light"] .leader-row.me .rank {
  color: #ffffff;
}


/* ── Apple-clean Playground revision: 0.6.05.1848 ───────────────────────── */
body[data-ai-route="playground"] {
  background:
    radial-gradient(circle at 50% -10%, rgba(210, 226, 255, 0.72), transparent 36%),
    linear-gradient(180deg, #f7f8fb 0%, #eef1f5 50%, #e8ebf0 100%);
  color: #111827;
}
body[data-ai-route="playground"] #particle-canvas { opacity: 0.16; filter: saturate(0.45) blur(0.2px); }
body[data-ai-route="playground"] .site-header {
  background: rgba(255,255,255,0.72);
  border-color: rgba(17,24,39,0.08);
  box-shadow: 0 18px 50px rgba(31,41,55,0.08);
}
#playground.is-active { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 0; }
#playground.is-active .play-wrap {
  width: min(940px, calc(100vw - 2rem)); max-width: 940px;
  min-height: calc(100vh - 84px); height: calc(100vh - 84px);
  margin: 0 auto; padding: clamp(1rem, 3vw, 2rem) 0 clamp(1rem, 3vw, 2rem); color: #111827;
}
#playground.is-active .play-wrap.has-messages { justify-content: flex-start; }
.play-side-controls { position: absolute; top: clamp(0.85rem, 2vw, 1.35rem); right: 0; display: flex; gap: 0.55rem; align-items: flex-start; z-index: 60; }
.play-dropdown { position: relative; }
.play-dropdown > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 0.42rem; min-height: 38px;
  padding: 0.5rem 0.78rem; border-radius: 999px; border: 1px solid rgba(17,24,39,0.08);
  background: rgba(255,255,255,0.78); color: #1f2937; font-size: 0.82rem; font-weight: 700; letter-spacing: -0.01em;
  box-shadow: 0 14px 34px rgba(17,24,39,0.09), inset 0 1px 0 rgba(255,255,255,0.8); backdrop-filter: blur(24px) saturate(145%);
  cursor: pointer; user-select: none;
}
.play-dropdown > summary::-webkit-details-marker { display: none; }
.play-dropdown[open] > summary { background: rgba(255,255,255,0.96); border-color: rgba(17,24,39,0.14); }
.play-dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 0.55rem); width: min(340px, calc(100vw - 2rem)); padding: 0.72rem;
  border: 1px solid rgba(17,24,39,0.10); border-radius: 22px; background: rgba(255,255,255,0.92); color: #111827;
  box-shadow: 0 24px 70px rgba(17,24,39,0.18); backdrop-filter: blur(28px) saturate(150%);
}
.play-history-list { display: grid; gap: 0.45rem; max-height: 320px; overflow: auto; }
.play-history-new, .play-history-item {
  width: 100%; border: 1px solid rgba(17,24,39,0.08); border-radius: 15px; background: rgba(248,250,252,0.92); color: #111827;
  padding: 0.68rem 0.78rem; text-align: left; font-size: 0.84rem; font-weight: 700;
}
.play-history-new { margin-bottom: 0.5rem; background: #111827; color: #fff; text-align: center; }
.play-history-item small { display: block; margin-top: 0.16rem; color: #6b7280; font-weight: 600; }
.play-history-empty { padding: 0.8rem; color: #6b7280; font-size: 0.84rem; text-align: center; }
.play-options-panel { display: grid; gap: 0.62rem; width: min(300px, calc(100vw - 2rem)); }
.play-options-panel label { font-size: 0.72rem; font-weight: 800; color: #6b7280; text-transform: uppercase; letter-spacing: 0.08em; }
.play-options-panel .play-model-select, .play-options-panel .play-sandbox-button {
  width: 100%; border-color: rgba(17,24,39,0.10); background: rgba(248,250,252,0.95); color: #111827; border-radius: 14px; padding: 0.62rem 0.76rem; text-align: left;
}
.play-options-panel .play-sandbox-button { text-align: center; }
.play-options-panel .play-hint { margin: 0; color: #6b7280; }
#playground.is-active .play-header { gap: 0.34rem; padding: 4vh 0 1.15rem; }
#playground.is-active .play-header.has-messages { padding: 0.8rem 0 0.5rem; transform: scale(0.94); transform-origin: left top; }
.play-kicker { color: #6b7280; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
#playground.is-active .play-header h1 {
  margin: 0; background: linear-gradient(180deg, #111827 0%, #374151 100%); color: transparent; -webkit-background-clip: text; background-clip: text;
  border-radius: 0; padding: 0; font-size: clamp(2.25rem, 6vw, 5rem); letter-spacing: -0.065em; line-height: 0.98; box-shadow: none;
}
#playground.is-active .play-header p { margin: 0.35rem 0 0; color: #6b7280; font-size: clamp(0.95rem, 1.8vw, 1.12rem); letter-spacing: -0.02em; }
#playground.is-active .play-header.has-messages p, #playground.is-active .play-header.has-messages .play-kicker { display: none; }
#playground.is-active .play-messages { width: min(820px, 100%); margin: 0 auto; gap: 0.85rem; padding: 0.8rem 0 1rem; }
#playground.is-active .play-msg-bubble { border: 1px solid rgba(17,24,39,0.08); background: rgba(255,255,255,0.88); color: #111827; box-shadow: 0 16px 42px rgba(17,24,39,0.08); backdrop-filter: blur(22px) saturate(150%); }
#playground.is-active .play-msg.user .play-msg-bubble { background: #111827; color: #fff; box-shadow: 0 16px 42px rgba(17,24,39,0.18); }
#playground.is-active .play-msg-avatar { background: rgba(255,255,255,0.84); color: #111827; border-color: rgba(17,24,39,0.08); box-shadow: inset 0 1px 0 rgba(255,255,255,0.9); }
#playground.is-active .play-msg.user .play-msg-avatar { background: #111827; color: #fff; }
#playground.is-active .play-input-wrap { width: min(760px, 100%); margin: 0 auto; padding: 0.6rem 0 0; }
#playground.is-active .play-input-bar {
  min-height: 66px; border-radius: 28px; border: 1px solid rgba(17,24,39,0.08); background: rgba(255,255,255,0.84);
  box-shadow: 0 22px 70px rgba(17,24,39,0.14), inset 0 1px 0 rgba(255,255,255,0.88); backdrop-filter: blur(26px) saturate(155%);
}
#playground.is-active .play-input-bar:focus-within { border-color: rgba(0,122,255,0.34); box-shadow: 0 24px 80px rgba(0,122,255,0.16), inset 0 1px 0 rgba(255,255,255,0.9); }
#playground.is-active .play-textarea { color: #111827; font-size: 1.02rem; }
#playground.is-active .play-textarea::placeholder { color: #9ca3af; }
#playground.is-active .play-icon-btn { color: #6b7280; }
#playground.is-active .play-icon-btn:hover { background: rgba(17,24,39,0.06); color: #111827; }
#playground.is-active .play-send { background: #111827; color: #fff; }
#playground.is-active .play-send:hover:not(:disabled) { background: #000; }
#playground.is-active .play-send:disabled { background: #e5e7eb; color: #9ca3af; }
#playground.is-active .play-agent-bar { margin-top: 0.2rem; border-radius: 14px; border-color: rgba(17,24,39,0.08); background: rgba(248,250,252,0.86); color: #6b7280; flex-wrap: wrap; }


/* ── Playground revision fix: visible controls + compact Apple composer 0.6.05.1848 ── */
html[data-ai-theme] body[data-ai-route="playground"] {
  background:
    radial-gradient(circle at 50% -10%, rgba(210, 226, 255, 0.72), transparent 36%),
    linear-gradient(180deg, #f7f8fb 0%, #eef1f5 50%, #e8ebf0 100%) !important;
  color: #111827;
}
body[data-ai-route="playground"] .play-side-controls {
  position: fixed;
  top: 138px;
  right: clamp(1rem, 3vw, 2.25rem);
  z-index: 2000;
}
#playground.is-active .play-wrap {
  padding-top: clamp(1.2rem, 4vh, 2.8rem);
}
#playground.is-active .play-textarea {
  min-height: 24px !important;
  height: auto;
  max-height: 140px;
}
#playground.is-active .play-input-bar {
  align-items: center;
}
@media (max-width: 820px) {
  body[data-ai-route="playground"] .play-side-controls {
    top: 98px;
    right: 1rem;
    transform: scale(0.92);
    transform-origin: top right;
  }
}


/* ── Thinking pulse: brighter playground dots + animated typing 0.6.05.1848 ── */
body[data-ai-route="playground"].play-thinking #particle-canvas {
  opacity: 0.96 !important;
  filter: saturate(1.9) brightness(1.5) blur(0px) !important;
  animation: wolfParticleThinking 1.15s ease-in-out infinite;
}
body[data-ai-route="playground"].play-thinking::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(59,130,246,0.20), transparent 28%),
    radial-gradient(circle at 50% 52%, rgba(139,92,246,0.14), transparent 38%);
  animation: wolfThinkingGlow 1.45s ease-in-out infinite;
}
#playground.is-active.is-thinking .play-input-bar {
  border-color: rgba(59,130,246,0.34);
  box-shadow: 0 26px 90px rgba(59,130,246,0.20), 0 0 0 1px rgba(139,92,246,0.12), inset 0 1px 0 rgba(255,255,255,0.92);
}
#playground.is-active .play-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  opacity: 1;
  font-style: normal;
  color: #111827;
  background: rgba(255,255,255,0.95);
  border-color: rgba(59,130,246,0.22);
}
.play-thinking-avatar {
  animation: wolfThinkingAvatar 1.2s ease-in-out infinite;
}
.play-thinking-label {
  font-weight: 750;
  letter-spacing: -0.01em;
}
.play-thinking-dots {
  display: inline-flex;
  gap: 0.24rem;
  align-items: center;
}
.play-thinking-dots i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  display: block;
  background: #3B82F6;
  box-shadow: 0 0 0 rgba(59,130,246,0.0), 0 0 18px rgba(59,130,246,0.8);
  animation: wolfTypingDot 0.9s ease-in-out infinite;
}
.play-thinking-dots i:nth-child(2) { background: #8B5CF6; animation-delay: 0.12s; box-shadow: 0 0 18px rgba(139,92,246,0.85); }
.play-thinking-dots i:nth-child(3) { background: #22D3EE; animation-delay: 0.24s; box-shadow: 0 0 18px rgba(34,211,238,0.85); }
@keyframes wolfParticleThinking {
  0%, 100% { opacity: 0.70; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.012); }
}
@keyframes wolfThinkingGlow {
  0%, 100% { opacity: 0.35; transform: scale(0.98); }
  50% { opacity: 0.95; transform: scale(1.02); }
}
@keyframes wolfTypingDot {
  0%, 100% { transform: translateY(0) scale(0.78); opacity: 0.48; }
  45% { transform: translateY(-0.24rem) scale(1.32); opacity: 1; }
}
@keyframes wolfThinkingAvatar {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.22), inset 0 1px 0 rgba(255,255,255,0.9); }
  50% { box-shadow: 0 0 0 8px rgba(59,130,246,0.12), 0 0 24px rgba(59,130,246,0.32), inset 0 1px 0 rgba(255,255,255,0.9); }
}

/* ── AI 101 task-list + chat-controlled thinking dots 0.6.05.1959 ── */
.course-value {
  border: 1px solid rgba(59,130,246,0.16);
  border-radius: 16px;
  padding: 0.72rem 0.82rem;
  background: rgba(59,130,246,0.08);
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.55;
}
.course-value strong { color: var(--text); }
.course-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 58%, transparent);
}
.course-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  transition: width 260ms ease-out;
}
.course-task-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
#playground.is-active .course-task-panel {
  width: min(820px, 100%);
  margin: 0 auto 0.8rem;
  padding: 0.82rem;
  border: 1px solid rgba(17,24,39,0.08);
  border-radius: 24px;
  background: rgba(255,255,255,0.86);
  box-shadow: 0 16px 46px rgba(17,24,39,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter: blur(24px) saturate(150%);
  color: #111827;
}
.course-task-panel[hidden] { display: none !important; }
.course-task-panel-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}
.course-task-kicker {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.course-task-value { color: #4b5563; font-size: 0.86rem; margin-bottom: 0.65rem; }
.course-task-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.46rem; }
.course-task-row {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 0.52rem;
  align-items: start;
  border: 1px solid rgba(17,24,39,0.07);
  border-radius: 16px;
  background: rgba(248,250,252,0.82);
  padding: 0.56rem 0.64rem;
}
.course-task-row > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(17,24,39,0.07);
  color: #6b7280;
  font-weight: 900;
}
.course-task-row strong { display: block; color: #111827; font-size: 0.8rem; }
.course-task-row small { display: block; color: #6b7280; font-size: 0.74rem; line-height: 1.35; margin-top: 0.12rem; }
.course-task-row.active { border-color: rgba(59,130,246,0.34); background: rgba(239,246,255,0.92); }
.course-task-row.active > span { background: #2563eb; color: #fff; box-shadow: 0 0 0 5px rgba(37,99,235,0.10); }
.course-task-row.done { border-color: rgba(22,163,74,0.24); background: rgba(240,253,244,0.88); }
.course-task-row.done > span { background: #16a34a; color: #fff; }
body[data-ai-route="playground"].ambient-thinking #particle-canvas {
  opacity: 0.72 !important;
  filter: saturate(1.55) brightness(1.18) blur(0px) !important;
  animation: wolfParticleThinking 1.9s ease-in-out infinite;
}
body[data-ai-route="playground"].ambient-thinking::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 72%, rgba(34,211,238,0.13), transparent 26%),
    radial-gradient(circle at 38% 58%, rgba(59,130,246,0.11), transparent 30%),
    radial-gradient(circle at 64% 54%, rgba(139,92,246,0.11), transparent 32%);
  animation: wolfThinkingGlow 2.4s ease-in-out infinite;
}
.chat-ripple {
  position: fixed;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 2500;
  background: radial-gradient(circle, rgba(255,255,255,0.96) 0%, rgba(59,130,246,0.42) 36%, rgba(139,92,246,0.18) 58%, transparent 72%);
  animation: chatRippleWake 720ms cubic-bezier(.2,.75,.2,1) forwards;
}
.chat-ripple.off {
  background: radial-gradient(circle, rgba(255,255,255,0.92) 0%, rgba(17,24,39,0.28) 42%, rgba(107,114,128,0.14) 62%, transparent 74%);
  animation-name: chatRippleSleep;
}
@keyframes chatRippleWake {
  from { transform: scale(0.4); opacity: 0.95; }
  to { transform: scale(92); opacity: 0; }
}
@keyframes chatRippleSleep {
  from { transform: scale(42); opacity: 0.48; }
  to { transform: scale(0.4); opacity: 0; }
}
@media (max-width: 720px) {
  #playground.is-active .course-task-panel { width: min(100%, calc(100vw - 1rem)); margin-top: 3.4rem; }
  .course-task-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-ripple { display: none; }
  body[data-ai-route="playground"].ambient-thinking #particle-canvas { animation: none; }
}

/* ── Superhuman auto-typing affordance 0.6.05.2011 ── */
.course-task-auto {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.68rem;
  padding: 0.62rem 0.72rem;
  border-radius: 18px;
  border: 1px solid rgba(59,130,246,0.18);
  background: linear-gradient(135deg, rgba(239,246,255,0.95), rgba(245,243,255,0.92));
}
.course-task-auto small { color: #4b5563; font-size: 0.76rem; line-height: 1.3; }
.course-autotype {
  white-space: nowrap;
  background: #111827 !important;
  color: #fff !important;
  box-shadow: 0 14px 32px rgba(17,24,39,0.18);
}
.course-autotype:disabled, .course-row-run:disabled { opacity: 0.55; cursor: wait; }
.course-row-run {
  margin-top: 0.44rem;
  border: 1px solid rgba(37,99,235,0.20);
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  padding: 0.26rem 0.58rem;
  font-size: 0.7rem;
  font-weight: 850;
  cursor: pointer;
}
body.superhuman-typing #playground.is-active .play-input-bar {
  border-color: rgba(37,99,235,0.42);
  box-shadow: 0 24px 86px rgba(37,99,235,0.20), 0 0 0 1px rgba(139,92,246,0.12), inset 0 1px 0 rgba(255,255,255,0.92);
}
body.superhuman-typing #playground.is-active .play-send {
  animation: superhumanSendPulse 520ms ease-in-out infinite;
}
@keyframes superhumanSendPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 7px rgba(37,99,235,0.13); }
}
@media (max-width: 720px) {
  .course-task-auto { align-items: stretch; flex-direction: column; }
  .course-autotype { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  body.superhuman-typing #playground.is-active .play-send { animation: none; }
}

/* ── Playground side-task rail + dominant chat canvas 0.6.05.2022 ── */
#playground.is-active {
  place-items: stretch;
  padding: 0 clamp(1rem, 2.5vw, 2rem);
}
#playground.is-active .play-wrap {
  width: min(1500px, 100%);
  max-width: 1500px;
  min-height: calc(100vh - 84px);
  height: calc(100vh - 84px);
  padding-top: clamp(0.7rem, 2vh, 1.25rem);
  padding-bottom: clamp(0.8rem, 2vh, 1.25rem);
  justify-content: flex-start;
}
#playground.is-active .play-header.has-messages {
  display: none;
}
.play-session-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  grid-template-areas: "chat tasks";
  gap: clamp(0.8rem, 1.8vw, 1.25rem);
  width: 100%;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
.play-session-grid:has(.course-task-panel[hidden]) {
  grid-template-columns: minmax(0, min(940px, 100%));
  grid-template-areas: "chat";
  justify-content: center;
}
.play-chat-column {
  grid-area: chat;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#playground.is-active .play-messages {
  width: 100%;
  max-width: none;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  padding: 0.4rem 0 0.75rem;
  overflow-y: auto;
}
#playground.is-active .play-input-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.55rem 0 0;
  flex: 0 0 auto;
}
#playground.is-active .course-task-panel {
  grid-area: tasks;
  align-self: stretch;
  width: 100%;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 0.78rem;
  border-radius: 24px;
}
#playground.is-active .course-task-panel-head {
  gap: 0.42rem;
  margin-bottom: 0.36rem;
}
#playground.is-active .course-task-panel-head strong {
  font-size: 1rem;
}
#playground.is-active .course-task-kicker {
  font-size: 0.58rem;
  padding: 0.18rem 0.46rem;
}
#playground.is-active .course-task-value {
  font-size: 0.76rem;
  line-height: 1.35;
  margin-bottom: 0.52rem;
}
#playground.is-active .course-task-auto {
  flex-direction: column;
  align-items: stretch;
  gap: 0.42rem;
  margin-bottom: 0.56rem;
  padding: 0.56rem;
}
#playground.is-active .course-task-auto small {
  font-size: 0.68rem;
}
#playground.is-active .course-autotype {
  width: 100%;
  justify-content: center;
  min-height: 38px;
}
#playground.is-active .course-task-list {
  grid-template-columns: 1fr;
  gap: 0.42rem;
}
#playground.is-active .course-task-row {
  grid-template-columns: 22px 1fr;
  gap: 0.44rem;
  padding: 0.52rem 0.56rem;
  border-radius: 15px;
}
#playground.is-active .course-task-row > span {
  width: 21px;
  height: 21px;
  font-size: 0.72rem;
}
#playground.is-active .course-task-row strong {
  font-size: 0.76rem;
}
#playground.is-active .course-task-row small {
  font-size: 0.68rem;
  line-height: 1.26;
}
#playground.is-active .course-row-run {
  margin-top: 0.34rem;
  padding: 0.22rem 0.5rem;
  font-size: 0.66rem;
}
@media (min-width: 1280px) {
  #playground.is-active .play-msg-bubble { max-width: 84%; }
}
@media (max-width: 980px) {
  #playground.is-active { padding: 0 1rem; }
  .play-session-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "tasks"
      "chat";
  }
  #playground.is-active .course-task-panel {
    max-height: 34vh;
  }
}
@media (max-width: 720px) {
  #playground.is-active .play-wrap {
    width: 100%;
    min-height: calc(100vh - 74px);
    height: calc(100vh - 74px);
  }
  #playground.is-active .course-task-panel {
    width: 100%;
    margin-top: 0;
    max-height: 32vh;
  }
}

@media (max-width: 1300px) {
  #playground.is-active .play-wrap:has(.course-task-panel:not([hidden])) .course-task-panel {
    margin-top: 3.35rem;
    max-height: calc(100% - 3.35rem);
  }
}

