/* Build Your Agent — app layer on top of the Napster design tokens.
 * tokens.css owns colour/type/spacing. Nothing here should re-declare a brand
 * value; reach for the var instead so this stays in sync with napster.com.
 */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; }

/* .gate and .shell carry display:flex/grid, which outrank the UA stylesheet's
 * [hidden]{display:none}. Without this the gate never goes away when the guide
 * is revealed and both stack on the page. */
[hidden] { display: none !important; }

/* Atmospheric plum wash behind everything — the brand's "not-quite-black". */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 78% -5%, rgba(96, 22, 86, 0.40), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(55, 9, 113, 0.28), transparent 62%);
  pointer-events: none;
  z-index: 0;
}

/* ── Topbar ─────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 60px;
  padding: 0 var(--space-6);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: var(--blur-panel);
  border-bottom: var(--panel-border);
}
.topbar-left { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.wordmark { height: 18px; width: auto; display: block; }
.topbar-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.14); }
.topbar-title {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-body);
  letter-spacing: var(--ls-eyebrow);
  white-space: nowrap;
}
.badge-internal {
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--fg-muted);
  border: var(--panel-border);
  border-radius: var(--r-pill);
  padding: 5px 11px;
  white-space: nowrap;
}

/* ── Landing gate ───────────────────────────────────────────────────── */

.gate {
  position: relative;
  z-index: 1;
  /* The glow is wider than a phone viewport; clip it or it scrolls the page. */
  overflow: hidden;
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}
.gate-glow {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 720px;
  height: 720px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(221, 82, 203, 0.20), transparent 62%);
  filter: var(--blur-atmospheric);
  pointer-events: none;
}
.gate-inner { position: relative; max-width: 760px; }
.gate.is-leaving {
  opacity: 0;
  transform: scale(1.03);
  transition: opacity .55s ease, transform .55s ease;
  pointer-events: none;
}
.gate-mark {
  width: 54px;
  height: auto;
  margin: 0 auto var(--space-6);
  animation: markPulse 2.6s ease-in-out infinite;
}
@keyframes markPulse {
  0%, 100% { opacity: .75; filter: drop-shadow(0 0 12px rgba(255, 16, 232, 0.35)); }
  50%      { opacity: 1;   filter: drop-shadow(0 0 30px rgba(255, 16, 232, 0.75)); }
}

/* Fills over PRELOAD_MS; the duration is set from JS so the two can't drift. */
.gate-progress {
  width: 260px;
  height: 2px;
  margin: var(--space-10) auto var(--space-4);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
}
.gate-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--pink-deep), var(--pink-rim));
}
.gate-progress.is-running span {
  width: 100%;
  transition: width var(--preload-ms, 3500ms) cubic-bezier(.35, .1, .25, 1);
}
.gate-status { font-size: var(--fs-body-sm); color: var(--fg-subtle); margin: 0; }

.shell.is-entering { animation: shellIn .6s ease both; }
@keyframes shellIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-mark { animation: none; }
  .shell.is-entering { animation: none; }
  .gate.is-leaving { transition: none; }
}
.gate-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, var(--fs-hero));
  font-weight: var(--fw-semibold);
  line-height: var(--lh-headline);
  letter-spacing: var(--ls-hero);
  margin: var(--space-5) 0 0;
}
.gate-sub {
  margin: var(--space-6) auto 0;
  max-width: 620px;
  font-size: var(--fs-body-lg);
  line-height: 1.65;
  color: var(--fg-muted);
}
.gate-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-10);
}
.gate-note { margin-top: var(--space-5); font-size: var(--fs-body-sm); color: var(--fg-subtle); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--fg);
  background: linear-gradient(96deg, var(--pink-deep), var(--pink-bright));
  border: 1px solid var(--pink-rim);
  border-radius: var(--r-md);
  padding: 14px 26px;
  cursor: pointer;
  box-shadow: var(--shadow-glow-pink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 56px rgba(255, 16, 232, 0.5); }
.btn-primary:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-mic {
  width: 15px; height: 15px; flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--mic-mask) center / contain no-repeat;
  mask: var(--mic-mask) center / contain no-repeat;
  --mic-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 15a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3z'/><path d='M19 11a1 1 0 1 0-2 0 5 5 0 0 1-10 0 1 1 0 1 0-2 0 7 7 0 0 0 6 6.92V21a1 1 0 1 0 2 0v-3.08A7 7 0 0 0 19 11z'/></svg>");
}
.btn-ghost {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--fg-muted);
  background: var(--bg-panel);
  border: var(--panel-border);
  border-radius: var(--r-md);
  padding: 14px 22px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.btn-ghost:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.25); }

/* ── Shell layout ───────────────────────────────────────────────────── */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 400px;
  gap: var(--space-8);
  max-width: 1680px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-16);
  align-items: start;
}

/* ── Left rail ──────────────────────────────────────────────────────── */

.rail {
  position: sticky;
  top: calc(60px + var(--space-6));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 11px 13px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: none;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  text-align: left;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.rail-item:hover { color: var(--fg); background: var(--bg-panel); }
.rail-num {
  flex: 0 0 auto;
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  color: var(--fg-subtle);
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
}
.rail-item.is-active { color: var(--fg); background: var(--bg-panel); }
.rail-item.is-active .rail-num { color: var(--pink); }
/* Kai is talking about this one — stronger than plain scroll-spy. */
.rail-item.is-focused {
  color: var(--fg);
  background: var(--plum-panel);
  border-color: var(--pink-rim);
}
.rail-item.is-focused .rail-num { color: var(--pink-rim); }

/* ── Document ───────────────────────────────────────────────────────── */

.doc { min-width: 0; }
.doc-head { padding-bottom: var(--space-6); }
.doc-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-headline);
  letter-spacing: var(--ls-hero);
  margin: var(--space-4) 0 0;
}
.doc-lead {
  margin: var(--space-5) 0 0;
  max-width: 62ch;
  font-size: var(--fs-body-lg);
  line-height: 1.7;
  color: var(--fg-muted);
}
.doc-banner {
  margin-top: var(--space-8);
  padding: 12px var(--space-5);
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 193, 7, 0.22);
  background: rgba(255, 193, 7, 0.06);
  color: #f0d9a0;
  font-size: var(--fs-body-sm);
}
.doc-banner strong { color: #ffdf9e; }
.doc-foot {
  margin-top: var(--space-16);
  padding-top: var(--space-6);
  border-top: var(--panel-border);
  font-size: var(--fs-body-sm);
  color: var(--fg-subtle);
}

/* ── Section cards ──────────────────────────────────────────────────── */

.section {
  position: relative;
  margin-top: var(--space-8);
  padding: var(--space-8) var(--space-8) var(--space-10);
  border-radius: var(--r-xl);
  border: var(--panel-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  scroll-margin-top: calc(60px + var(--space-6));
  transition: border-color .45s ease, box-shadow .45s ease, background .45s ease;
}

/* The focus treatment: pink rim, outer glow, and a breathing pulse so it
 * reads as "live" rather than merely selected. */
.section.is-focused {
  border-color: var(--pink-rim);
  background: linear-gradient(180deg, rgba(221, 82, 203, 0.10), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-glow-pink), var(--shadow-inset-light);
  animation: sectionPulse 3.2s ease-in-out infinite;
}
@keyframes sectionPulse {
  0%, 100% { box-shadow: 0 0 34px rgba(255, 16, 232, 0.26), var(--shadow-inset-light); }
  50%      { box-shadow: 0 0 62px rgba(255, 16, 232, 0.46), var(--shadow-inset-light); }
}
@media (prefers-reduced-motion: reduce) {
  .section.is-focused { animation: none; }
  html { scroll-behavior: auto; }
}

/* "Kai is on this" flag, injected on focus. */
.section-flag {
  position: absolute;
  top: -11px;
  left: var(--space-8);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: linear-gradient(96deg, var(--pink-deep), var(--pink-bright));
  border: 1px solid var(--pink-rim);
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s ease, transform .3s ease;
}
.section.is-focused .section-flag { opacity: 1; transform: translateY(0); }
.section-flag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: var(--r-full);
  background: var(--fg);
  animation: flagBlink 1.4s ease-in-out infinite;
}
@keyframes flagBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.section-num {
  font-family: var(--font-display);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-bold);
  color: var(--fg-subtle);
  letter-spacing: 0.06em;
}
.section h2 {
  font-family: var(--font-display);
  font-size: var(--fs-title);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-headline);
  letter-spacing: var(--ls-section);
  margin: var(--space-2) 0 0;
}
.section h3 {
  font-family: var(--font-display);
  font-size: var(--fs-subtitle);
  font-weight: var(--fw-semibold);
  margin: var(--space-8) 0 var(--space-3);
}
.section .dek { margin: var(--space-3) 0 0; color: var(--fg-muted); font-size: var(--fs-body); }
.section p { font-size: var(--fs-body); line-height: 1.7; color: rgba(255, 255, 255, 0.78); }

.section-list { margin: var(--space-5) 0 0; padding-left: var(--space-5); }
.section-list li { margin-bottom: var(--space-3); line-height: 1.7; color: rgba(255, 255, 255, 0.78); }
.section-list li::marker { color: var(--pink); }

/* Facts table */
.facts { margin: var(--space-6) 0 0; border-top: var(--panel-border); }
.fact-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: var(--space-5);
  padding: 13px 0;
  border-bottom: var(--panel-border);
}
.fact-row dt { font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); color: var(--fg); }
.fact-row dd { margin: 0; font-size: var(--fs-body-sm); color: var(--fg-muted); line-height: 1.6; }

/* Numbered steps */
.steps { margin: var(--space-6) 0 0; display: flex; flex-direction: column; gap: 2px; }
.step {
  position: relative;
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.step-num {
  flex: 0 0 28px;
  height: 28px;
  border-radius: var(--r-full);
  display: grid;
  place-items: center;
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  color: var(--fg-muted);
  background: rgba(255, 255, 255, 0.07);
  border: var(--panel-border);
  font-variant-numeric: tabular-nums;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.step-title { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--fg); }
.step-body { margin: 3px 0 0; font-size: var(--fs-body-sm); line-height: 1.65; color: var(--fg-muted); }

/* Author-marked "this one matters" step (e.g. Write the Agent Prompt). */
.step.is-emphasis { border-color: rgba(190, 54, 157, 0.30); background: rgba(221, 82, 203, 0.05); }
.step.is-emphasis .step-num { color: var(--pink-rim); border-color: rgba(255, 161, 243, 0.35); }

/* Kai pointed at this exact step. */
.step.is-highlighted {
  background: var(--plum-panel);
  border-color: var(--pink-rim);
  box-shadow: 0 0 26px rgba(255, 16, 232, 0.28);
}
.step.is-highlighted .step-num {
  background: linear-gradient(96deg, var(--pink-deep), var(--pink-bright));
  color: var(--fg);
  border-color: var(--pink-rim);
}
.step.is-highlighted .step-body { color: rgba(255, 255, 255, 0.88); }

/* Pull quote */
.quote {
  margin: var(--space-6) 0 0;
  padding: var(--space-6);
  border-radius: var(--r-lg);
  border: var(--panel-border-pink);
  background: var(--gradient-bg-rose);
}
.quote p {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-subtitle);
  font-weight: var(--fw-medium);
  line-height: 1.45;
  color: var(--fg);
}

/* Notes */
.note {
  margin: var(--space-6) 0 0;
  padding: var(--space-5);
  border-radius: var(--r-lg);
  border: var(--panel-border);
  background: var(--bg-panel);
}
.note-title {
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}
.note p { margin: 0; font-size: var(--fs-body-sm); line-height: 1.65; }
.note.tone-warn { border-color: rgba(255, 193, 7, 0.22); background: rgba(255, 193, 7, 0.05); }
.note.tone-warn .note-title { color: #ffdf9e; }
.note.tone-pink { border-color: rgba(190, 54, 157, 0.35); background: rgba(221, 82, 203, 0.07); }
.note.tone-pink .note-title { color: var(--pink); }

/* Code block */
.code {
  position: relative;
  margin: var(--space-5) 0 0;
  border-radius: var(--r-lg);
  border: var(--panel-border);
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.code pre {
  margin: 0;
  padding: var(--space-5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.72;
  color: rgba(255, 255, 255, 0.82);
  white-space: pre-wrap;
  overflow-x: auto;
}

/* Contact card */
.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin: var(--space-6) 0 0;
  padding: var(--space-5) var(--space-6);
  border-radius: var(--r-lg);
  border: var(--panel-border);
  background: var(--bg-panel);
}
.contact-who { display: flex; align-items: center; gap: var(--space-4); }
.contact-avatar {
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: var(--fs-body-lg);
  font-weight: var(--fw-semibold);
  background: var(--gradient-label);
  border: 1px solid var(--pink-rim);
}
.contact-name { font-weight: var(--fw-semibold); }
.contact-role { font-size: var(--fs-body-sm); color: var(--fg-muted); }
.btn-slack {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px;
  border-radius: var(--r-md);
  background: #4A154B;
  color: var(--fg);
  text-decoration: none;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.btn-slack:hover { background: #5c1d5e; }

/* ── Right dock ─────────────────────────────────────────────────────── */

.dock {
  position: sticky;
  top: calc(60px + var(--space-6));
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-height: calc(100vh - 60px - var(--space-12));
}

.avatar-panel {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  height: 400px;
  border-radius: var(--r-lg);
  border: var(--panel-border);
  background: var(--bg-charcoal);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}
.avatar-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 11px var(--space-4);
  border-bottom: var(--panel-border);
  background: rgba(0, 0, 0, 0.35);
}
.avatar-dot {
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  background: var(--fg-subtle);
  flex: 0 0 auto;
}
.avatar-dot.is-live { background: var(--good); box-shadow: 0 0 10px var(--good); }
.avatar-dot.is-speaking { background: var(--pink); box-shadow: 0 0 12px var(--pink-glow); }
.avatar-name { font-weight: var(--fw-semibold); font-size: var(--fs-body-sm); }
.avatar-role { font-size: var(--fs-meta); color: var(--fg-muted); margin-left: 2px; }
.btn-end {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: var(--fs-meta);
  font-weight: var(--fw-semibold);
  color: var(--fg-muted);
  background: none;
  border: var(--panel-border);
  border-radius: var(--r-pill);
  padding: 4px 11px;
  cursor: pointer;
}
.btn-end:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.28); }

/* Fixed panel height + flex:1 mount is the SDK-friendly sizing pattern.
 * Never hardcode a px height here, and never fight the SDK with !important —
 * sizing is passed to init() via `style` instead. */
.avatar-mount { position: relative; flex: 1; width: 100%; overflow: hidden; }
.avatar-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-3);
  background: var(--bg-charcoal);
  z-index: 2;
}
.avatar-loading p { margin: 0; font-size: var(--fs-body-sm); color: var(--fg-muted); }
.avatar-poster {
  width: 84px; height: 84px;
  border-radius: var(--r-full);
  object-fit: cover;
  object-position: center 22%;
  opacity: .55;
  filter: grayscale(.3);
}
.avatar-spinner {
  width: 22px; height: 22px;
  border-radius: var(--r-full);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--pink);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* ── Workbench ──────────────────────────────────────────────────────── */

.workbench {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  border: var(--panel-border);
  background: var(--bg-panel);
  overflow: hidden;
}
.workbench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: var(--panel-border);
}
.btn-mini {
  font-family: var(--font-body);
  font-size: var(--fs-meta);
  color: var(--fg-muted);
  background: none;
  border: var(--panel-border);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  cursor: pointer;
}
.btn-mini:hover { color: var(--fg); }
.workbench-empty { padding: var(--space-5); }
.workbench-empty p { margin: 0; font-size: var(--fs-body-sm); line-height: 1.6; color: var(--fg-subtle); }
.workbench-stack {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.artifact {
  /* Column flex children shrink by default, which clips each card's body to a
   * sliver once several are stacked. Keep natural height; the stack scrolls. */
  flex: 0 0 auto;
  border-radius: var(--r-lg);
  border: var(--panel-border);
  background: rgba(0, 0, 0, 0.42);
  overflow: hidden;
  animation: artifactIn .45s cubic-bezier(.2, .8, .3, 1);
}
@keyframes artifactIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.artifact.is-fresh { border-color: var(--pink-rim); box-shadow: 0 0 26px rgba(255, 16, 232, 0.22); }
.artifact-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 11px var(--space-4);
  border-bottom: var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
}
.artifact-kind {
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--pink);
}
.artifact-title {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact-rev {
  font-size: var(--fs-meta);
  color: var(--fg-subtle);
  border: var(--panel-border);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  white-space: nowrap;
}
.btn-copy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: var(--fs-meta);
  font-weight: var(--fw-semibold);
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
  border: var(--panel-border);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.btn-copy:hover { background: var(--pink-deep); border-color: var(--pink-rim); }
.btn-copy.is-done { background: rgba(52, 211, 153, 0.18); border-color: var(--good); color: var(--good); }
.artifact-body {
  padding: var(--space-4);
  max-height: 300px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.66;
  color: rgba(255, 255, 255, 0.82);
}
.artifact-body pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.66;
  white-space: pre-wrap;
  word-break: break-word;
}
.artifact-note {
  padding: 10px var(--space-4);
  border-top: var(--panel-border);
  font-size: var(--fs-meta);
  color: var(--fg-muted);
  line-height: 1.55;
}

/* Checklist artifact */
.check-item { display: flex; gap: var(--space-3); padding: 7px 0; }
.check-item + .check-item { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.check-mark { flex: 0 0 16px; height: 16px; margin-top: 2px; border-radius: var(--r-full); display: grid; place-items: center; font-size: 10px; font-weight: var(--fw-bold); }
.check-item.done .check-mark { background: rgba(52, 211, 153, 0.18); color: var(--good); }
.check-item.done .check-mark::after { content: '✓'; }
.check-item.todo .check-mark { border: 1px solid var(--fg-subtle); }
.check-label { font-weight: var(--fw-semibold); color: var(--fg); }
.check-detail { color: var(--fg-muted); }
.check-item.todo .check-label { color: var(--fg-muted); }

/* Q/A artifact */
.qa-item { padding: 8px 0; }
.qa-item + .qa-item { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.qa-q { font-weight: var(--fw-semibold); color: var(--fg); }
.qa-a { color: var(--fg-muted); margin-top: 2px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-2); }
.chip {
  font-size: var(--fs-meta);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: var(--panel-border);
  color: var(--fg-muted);
  background: rgba(255, 255, 255, 0.04);
}

/* ── Toast ──────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 90;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.9);
  border: var(--panel-border);
  backdrop-filter: var(--blur-panel);
  font-size: var(--fs-body-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1360px) {
  .shell { grid-template-columns: minmax(0, 1fr) 360px; }
  .rail { display: none; }
}
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding-bottom: 440px; }
  .dock {
    position: fixed;
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    top: auto;
    max-height: 420px;
    flex-direction: row;
    gap: var(--space-3);
    z-index: 50;
  }
  .avatar-panel { width: 240px; height: 100%; }
  .workbench { background: rgba(0, 0, 0, 0.86); backdrop-filter: var(--blur-panel); }
  .section { padding: var(--space-6) var(--space-5) var(--space-8); }
  .fact-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (max-width: 680px) {
  .dock { flex-direction: column; max-height: 62vh; }
  .avatar-panel { width: 100%; height: 190px; }
  .shell { padding-bottom: 66vh; }
  .topbar { padding: 0 var(--space-4); }
  .topbar-title { display: none; }
}
