/* Claude.ai shell tokens — matched to current app */
:root {
  /* Surfaces */
  --bg-page: #F6F3EE;          /* outer canvas */
  --bg-sidebar: #F0ECE4;       /* slightly deeper warm */
  --bg-chat: #FAF8F4;          /* chat column */
  --bg-card: #FFFFFF;          /* elevated cards */
  --bg-warm: #F2E9D9;          /* promotion card — one shade warmer */
  --bg-warm-hover: #ECDFC6;
  --bg-user-bubble: #EDE6D8;   /* user message bubble */
  --bg-code: #F4EEE2;

  /* Borders */
  --border: #E5DECE;
  --border-strong: #D8CFBB;
  --border-subtle: #EDE7D9;

  /* Text */
  --ink: #2B2924;
  --ink-soft: #46443C;
  --ink-muted: #7A7567;
  --ink-faint: #A59E8C;

  /* Accent — Claude's warm rust */
  --accent: #C96442;
  --accent-hover: #B65736;
  --accent-soft: #E8B7A5;
  --accent-wash: #F7E6DD;

  /* Status */
  --ok: #5A8C5C;
  --ok-wash: #E3EADF;
  --warn: #C47A2B;

  /* Type */
  --font-serif: "Tiempos Text", "Source Serif 4", "Source Serif Pro", "Charter", Georgia, serif;
  --font-sans: "Styrene B", "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Söhne Mono", "IBM Plex Mono", ui-monospace, monospace;

  /* Radius + shadow */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --shadow-card: 0 1px 2px rgba(40,32,20,0.04), 0 1px 0 rgba(40,32,20,0.03);
  --shadow-pop: 0 1px 3px rgba(40,32,20,0.06), 0 8px 24px rgba(40,32,20,0.05);
}

html[data-theme="dark"] {
  --bg-page: #1C1B19;
  --bg-sidebar: #232220;
  --bg-chat: #262523;
  --bg-card: #2C2B28;
  --bg-warm: #3B2F25;
  --bg-warm-hover: #49382A;
  --bg-user-bubble: #38332B;
  --bg-code: #2C2B28;
  --border: #3A3732;
  --border-strong: #4A4640;
  --border-subtle: #302E2A;
  --ink: #EFEBE2;
  --ink-soft: #DDD7C8;
  --ink-muted: #9C9583;
  --ink-faint: #6F6A5B;
  --accent: #E08466;
  --accent-hover: #EC9479;
  --accent-soft: #5A3A2E;
  --accent-wash: #3A2820;
  --ok-wash: #2A3A2B;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-pop: 0 1px 3px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== Page shell (scrollable doc) ===== */
.doc {
  max-width: 1340px;
  margin: 0 auto;
  padding: 56px 32px 120px;
}
.doc-header {
  margin-bottom: 48px;
}
.doc-eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 14px;
}
.doc-title {
  font-family: var(--font-serif);
  font-size: 36px;
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 14px;
  max-width: 820px;
}
.doc-intro {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 740px;
  margin: 0;
}
.doc-meta {
  display: flex;
  gap: 18px;
  margin-top: 24px;
  font-size: 13px;
  color: var(--ink-muted);
}
.doc-meta span + span::before {
  content: "·";
  margin-right: 18px;
  color: var(--ink-faint);
}

.frame-section {
  margin-top: 72px;
}
.frame-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
}
.frame-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.frame-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.frame-purpose {
  font-size: 13px;
  color: var(--ink-muted);
  margin-left: auto;
  font-family: var(--font-sans);
}
.frame-stage {
  background: var(--bg-page);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
}
.frame-caption {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 780px;
}

/* Sticky frame index */
.toc {
  position: fixed;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 40;
}
.toc a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 6px 4px;
  border-right: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.toc a:hover, .toc a.active { color: var(--accent); border-right-color: var(--accent); }
@media (max-width: 1200px) { .toc { display: none; } }

/* ===== App shell ===== */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 760px;
  background: var(--bg-sidebar);
  font-size: 14px;
  position: relative;
}
.app.has-right { grid-template-columns: 260px 1fr 340px; }
.app.wide { height: 820px; }

/* Sidebar */
.sb {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  padding: 14px 10px 14px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 14px;
}
.sb-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
}
.sb-logo-mark {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 600;
}
.sb-icons { display: flex; gap: 6px; color: var(--ink-muted); }
.sb-icons svg { width: 16px; height: 16px; }
.sb-nav { display: flex; flex-direction: column; gap: 1px; margin-bottom: 14px; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  cursor: default;
  font-size: 13.5px;
}
.sb-item:hover { background: rgba(0,0,0,0.03); }
.sb-item.active { background: var(--bg-card); color: var(--ink); box-shadow: var(--shadow-card); }
.sb-item svg { width: 15px; height: 15px; color: var(--ink-muted); flex-shrink: 0; }
.sb-item .kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
}
.sb-section-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 14px 10px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sb-section-label .expand { font-size: 10px; color: var(--ink-muted); cursor: pointer; }

.sb-list { display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.sb-chat {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  cursor: default;
}
.sb-chat:hover { background: rgba(0,0,0,0.03); }
.sb-chat.active { background: var(--bg-card); color: var(--ink); box-shadow: var(--shadow-card); }
.sb-chat .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-faint);
  flex-shrink: 0;
  opacity: .5;
}
.sb-chat.active .dot { background: var(--accent); opacity: 1; }
.sb-chat .label { overflow: hidden; text-overflow: ellipsis; }

/* Project node in sidebar */
.sb-project {
  margin-top: 2px;
  padding: 8px 10px 8px 10px;
  border-radius: var(--r-sm);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}
.sb-project-head {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}
.sb-project-head svg { width: 14px; height: 14px; color: var(--accent); }
.sb-project-head .chev { color: var(--ink-muted); margin-left: auto; }
.sb-project-files {
  display: flex; flex-direction: column; gap: 2px;
  padding-left: 4px;
  border-left: 1px solid var(--border);
  margin-left: 6px;
}
.sb-file {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px;
  font-size: 12.5px;
  color: var(--ink-muted);
  border-radius: var(--r-sm);
}
.sb-file svg { width: 11px; height: 11px; color: var(--ink-faint); }
.sb-file:hover { background: rgba(0,0,0,0.03); color: var(--ink-soft); }
.sb-project-children {
  margin-top: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  margin-left: 6px;
  display: flex; flex-direction: column; gap: 1px;
}
.sb-project-child {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
  border-radius: var(--r-sm);
  cursor: default;
}
.sb-project-child.active { background: var(--bg-warm); color: var(--ink); }
.sb-project-child.active .dot { background: var(--accent); }
.sb-project-child .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-faint); opacity: .6;
}

.sb-user {
  margin-top: auto;
  padding: 10px;
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--border-subtle);
}
.sb-user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: #5B6F8A;
  display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 600;
}
.sb-user-name { font-size: 13px; color: var(--ink-soft); }
.sb-user-chev { margin-left: auto; color: var(--ink-muted); }

/* Chat column */
.chat {
  background: var(--bg-chat);
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-chat);
  flex-shrink: 0;
}
.chat-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--ink);
}
.chat-title .crumb {
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 13px;
}
.chat-title .crumb-sep { color: var(--ink-faint); }
.chat-title .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  margin-left: 4px;
}
.chat-head-actions {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-muted);
}
.chat-head-actions button {
  background: transparent; border: 0; padding: 6px;
  color: var(--ink-muted); cursor: pointer; border-radius: var(--r-sm);
}
.chat-head-actions button:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.chat-head-actions svg { width: 16px; height: 16px; }
.model-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-soft);
}

/* Messages */
.chat-body {
  flex: 1;
  overflow: hidden;
  padding: 24px 0 16px;
  position: relative;
}
.messages {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex; flex-direction: column; gap: 28px;
}
.msg-user {
  align-self: flex-end;
  max-width: 78%;
  background: var(--bg-user-bubble);
  color: var(--ink);
  padding: 11px 16px;
  border-radius: 18px 18px 4px 18px;
  font-size: 14.5px;
  line-height: 1.5;
}
.msg-assistant {
  align-self: flex-start;
  max-width: 92%;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  font-family: var(--font-serif);
  font-weight: 400;
}
.msg-assistant p { margin: 0 0 14px; }
.msg-assistant p:last-child { margin: 0; }
.msg-assistant .doc-ref {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 7px 1px 5px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-soft);
  vertical-align: 1px;
  margin: 0 1px;
}
.msg-assistant .doc-ref svg { width: 10px; height: 10px; color: var(--accent); }
.msg-assistant strong { font-weight: 600; color: var(--ink); }
.msg-assistant ul { padding-left: 22px; margin: 0 0 14px; }
.msg-assistant li { margin-bottom: 4px; }

.msg-actions {
  display: flex; gap: 4px; margin-top: 10px;
  color: var(--ink-faint);
}
.msg-actions button {
  background: transparent; border: 0; padding: 5px;
  color: inherit; cursor: pointer; border-radius: var(--r-sm);
}
.msg-actions button:hover { background: rgba(0,0,0,0.04); color: var(--ink-muted); }
.msg-actions svg { width: 14px; height: 14px; }

/* Promotion card — between last assistant message and composer */
.promo {
  max-width: 760px;
  margin: 0 auto;
  padding: 4px 32px 0;
}
.promo-card {
  position: relative;
  background: var(--bg-warm);
  border-radius: var(--r-lg);
  padding: 18px 22px 18px 22px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 16px;
  align-items: start;
}
.promo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent-wash);
  display: grid; place-items: center;
  color: var(--accent);
  margin-top: 2px;
}
.promo-icon svg { width: 16px; height: 16px; }
.promo-content .promo-head {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.promo-content .promo-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 540px;
  margin-bottom: 14px;
}
.promo-signals {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.signal {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink-soft);
}
html[data-theme="dark"] .signal { background: rgba(255,255,255,0.06); }
.signal svg { width: 10px; height: 10px; color: var(--accent); }
.promo-actions {
  display: flex; align-items: center; gap: 10px;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  border: 0;
  line-height: 1;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(0,0,0,0.04); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--ink);
}
.btn-outline:hover { background: rgba(0,0,0,0.03); }
.promo-dismiss {
  grid-column: 2 / 3;
  font-size: 12px;
  color: var(--ink-muted);
  text-decoration: underline;
  text-decoration-color: var(--ink-faint);
  text-underline-offset: 2px;
  cursor: pointer;
  margin-top: -4px;
}
.promo-close {
  background: transparent; border: 0;
  color: var(--ink-faint); cursor: pointer;
  padding: 4px;
  grid-column: 3 / 4;
}
.promo-close:hover { color: var(--ink); }

/* Composer */
.composer-wrap {
  padding: 10px 32px 22px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  flex-shrink: 0;
}
.composer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px 10px;
  box-shadow: var(--shadow-card);
}
.composer-input {
  font-family: var(--font-sans);
  font-size: 14.5px;
  color: var(--ink-muted);
  min-height: 20px;
  padding: 2px 0 14px;
}
.composer-row {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--ink-muted);
}
.composer-row .left, .composer-row .right { display: flex; align-items: center; gap: 4px; }
.composer-row button {
  background: transparent; border: 0; padding: 6px;
  color: var(--ink-muted); cursor: pointer; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px;
  font-family: var(--font-sans);
}
.composer-row button:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.composer-row button svg { width: 14px; height: 14px; }
.composer-send {
  background: var(--ink) !important;
  color: var(--bg-chat) !important;
  width: 28px; height: 28px;
  border-radius: 50% !important;
  display: grid !important; place-items: center !important;
  padding: 0 !important;
}
.composer-footnote {
  text-align: center;
  font-size: 11px;
  color: var(--ink-faint);
  padding: 6px 0 0;
}

/* Right rail — memory panel */
.rail {
  background: var(--bg-chat);
  border-left: 1px solid var(--border-subtle);
  padding: 18px 18px 18px;
  display: flex; flex-direction: column; gap: 14px;
  overflow: hidden;
}
.rail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 2px;
}
.rail-title {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--ink);
}
.rail-title-sub {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.rail-head .icon-btn {
  background: transparent; border: 0; padding: 4px;
  color: var(--ink-muted); cursor: pointer; border-radius: var(--r-sm);
}
.rail-head .icon-btn:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.rail-head svg { width: 14px; height: 14px; }

.mem-tier {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
}
.mem-tier-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 8px;
}
.mem-tier-head .tier-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.mem-tier-head .tier-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}
.mem-tier-body {
  padding: 0 12px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.mem-line {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  display: flex; align-items: flex-start; gap: 8px;
  padding: 3px 0;
}
.mem-line .mem-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink-faint);
  margin-top: 8px;
  flex-shrink: 0;
}
.mem-line.added .mem-dot { background: var(--ok); }
.mem-line.added {
  background: var(--ok-wash);
  margin: 0 -6px;
  padding: 3px 6px;
  border-radius: var(--r-sm);
}
.mem-line-text { flex: 1; }
.mem-line .edit-btn {
  opacity: 0;
  background: transparent; border: 0;
  color: var(--ink-faint); cursor: pointer;
  padding: 2px;
  transition: opacity .1s;
}
.mem-line:hover .edit-btn { opacity: 1; }
.mem-tier.collapsed .mem-tier-body { display: none; }
.mem-tier-chev {
  color: var(--ink-faint);
  transition: transform .2s;
}
.mem-tier.collapsed .mem-tier-chev { transform: rotate(-90deg); }

/* ===== Agents — Frame 3 & 4 ===== */
.agents-stage {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg-chat);
}
.agents-head {
  padding: 14px 24px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}
.agents-head .title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif);
  font-size: 15px;
}
.agents-head .crumb { color: var(--ink-muted); font-family: var(--font-sans); font-size: 13px; }
.agents-head .crumb-sep { color: var(--ink-faint); }
.agents-head .status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--ok-wash);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ok);
  font-weight: 500;
}
.agents-head .status-chip .ping {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  position: relative;
}
.agents-head .status-chip .ping::after {
  content: ""; position: absolute; inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  opacity: .35;
  animation: ping 1.6s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: .6 } 100% { transform: scale(1.6); opacity: 0 } }

.agents-grid {
  display: grid;
  flex: 1;
  overflow: hidden;
  gap: 0;
}
.agents-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.agents-grid.four { grid-template-columns: 1fr 1fr 1fr 1fr; }

.agent-pane {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  overflow: hidden;
  background: var(--bg-chat);
}
.agent-pane:last-child { border-right: 0; }
.agent-pane-head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-chat);
}
.agent-identity {
  display: flex; align-items: center; gap: 10px;
}
.agent-mono {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.agent-name {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.agent-role {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.3;
  margin-top: 2px;
}
.agent-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px;
  font-size: 11px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--ink-muted);
  font-family: var(--font-sans);
}
.chip.live {
  background: var(--accent-wash);
  border-color: transparent;
  color: var(--accent);
  font-weight: 500;
}
.chip.live .ping {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  position: relative;
}
.chip.live .ping::after {
  content: ""; position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: ping 1.6s cubic-bezier(0,0,.2,1) infinite;
}
.chip.done { background: var(--ok-wash); color: var(--ok); border-color: transparent; }
.chip svg { width: 10px; height: 10px; }

.agent-stream {
  flex: 1;
  overflow: hidden;
  padding: 16px 18px 12px;
  display: flex; flex-direction: column; gap: 10px;
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.stream-block {
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.stream-block .label {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.stream-block .label svg { width: 10px; height: 10px; }
.stream-block .body { color: var(--ink); font-size: 13px; }
.stream-block.tool .body {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}
.stream-thought {
  color: var(--ink-soft);
}
.stream-thought .typing {
  display: inline-block;
  width: 6px; height: 14px;
  background: var(--ink);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0 } }

.synth-strip {
  border-top: 1px solid var(--border-subtle);
  padding: 14px 24px;
  background: var(--bg-chat);
  display: flex; align-items: center; gap: 16px;
}
.synth-strip .synth-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-wash);
  display: grid; place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.synth-strip .synth-icon svg { width: 13px; height: 13px; }
.synth-strip .synth-text {
  flex: 1;
  font-size: 13.5px;
  color: var(--ink);
}
.synth-strip .synth-text .sub {
  color: var(--ink-muted); font-size: 12px;
}
.synth-strip .progress {
  width: 200px; height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.synth-strip .progress-bar {
  height: 100%;
  background: var(--accent);
  width: 62%;
  border-radius: 999px;
  animation: glide 3s ease-in-out infinite alternate;
}
@keyframes glide { 0% { width: 42% } 100% { width: 74% } }
.synth-strip .eta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

/* Parallel frame variants */
.agent-pane.parallel .agent-stream { padding-top: 12px; }
.run-log {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}
.run-log .row { display: flex; gap: 8px; padding: 2px 0; }
.run-log .row .t { color: var(--ink-faint); width: 44px; flex-shrink: 0; }
.run-log .row.done { color: var(--ok); }

/* ===== Tweaks panel ===== */
.tweaks-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  z-index: 80;
  padding: 16px;
  display: none;
  font-family: var(--font-sans);
}
.tweaks-panel.on { display: block; }
.tweaks-panel h4 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
}
.tweaks-panel .t-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--ink-soft);
}
.tweaks-panel .t-row:first-of-type { border-top: 0; }
.tweaks-panel .t-row .t-ctrl {
  display: flex; gap: 4px;
}
.tweaks-panel .t-btn {
  padding: 4px 8px;
  font-size: 11px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--ink-soft);
  font-family: var(--font-sans);
}
.tweaks-panel .t-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tweaks-close {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: 0; color: var(--ink-muted); cursor: pointer;
  padding: 2px;
}

/* Small inline highlight for recently added/changed elements */
.just-added {
  animation: just-added 1.8s ease-out;
}
@keyframes just-added {
  0% { box-shadow: 0 0 0 0 rgba(201,100,66,0.35); }
  100% { box-shadow: 0 0 0 0 rgba(201,100,66,0); }
}

/* Tweaks-driven variants */
body[data-promo="bold"] .promo-card { background: #EFE1CC; }
body[data-promo="soft"] .promo-card { background: #F2E9D9; }
body[data-promo="outline"] .promo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
}
