/* ─── PLAYGROUND ─────────────────────────── */
.playground {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  background: var(--bg);
}

/* Convo list (left) */
.convo-list {
  border-right: 1px solid var(--border);
  background: var(--bg-soft);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.convo-head {
  padding: 18px 16px 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.convo-head h3 {
  margin: 0;
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.01em;
}
.convo-head .new-btn {
  width: 26px; height: 26px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--text);
}
.convo-search {
  margin: 0 12px 8px;
  display: flex; align-items: center; gap: 8px;
  height: 32px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: var(--text-dim);
}
.convo-search input { flex: 1; background: transparent; border: none; outline: none; font-size: 12.5px; }
.convo-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.convo-group { margin-top: 12px; }
.convo-group h5 {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin: 0 6px 6px;
  font-weight: 500;
}
.convo-item {
  position: relative;
  display: block;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 2px;
}
.convo-item:hover { background: var(--surface-2); }
.convo-item.active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}
.convo-item .ttl { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.convo-item .preview {
  display: block;
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.convo-item .pinned {
  position: absolute; right: 8px; top: 8px;
  color: var(--accent-hi);
  font-size: 10px;
}

/* Center thread */
.thread {
  display: flex; flex-direction: column;
  overflow: hidden;
}
.thread-head {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.thread-head .title {
  font-size: 14px; font-weight: 500;
  flex: 1;
}
.thread-head .mode-pill {
  display: inline-flex; gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 3px;
}
.thread-head .mode-pill button {
  border: none; background: transparent;
  color: var(--text-dim);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.thread-head .mode-pill button.active { background: var(--surface-3); color: var(--text); }
.thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 0;
  position: relative;
}
.thread-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex; flex-direction: column; gap: 28px;
}
.msg {
  display: flex; gap: 14px;
}
.msg .avatar {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: white;
}
.msg.user .avatar {
  background: linear-gradient(135deg, var(--accent-warm), var(--accent-hi));
}
.msg.bot .avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.msg .body {
  flex: 1;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
}
.msg .body .who {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
}
.msg .body p { margin: 0 0 10px; }
.msg .body p:last-child { margin-bottom: 0; }

.node-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb),0.14);
  border: 1px solid rgba(var(--accent-2-rgb),0.28);
  color: var(--accent-2);
  font-size: 12.5px;
  font-weight: 500;
  margin: 0 2px;
  cursor: pointer;
}
.node-chip::before {
  content: "";
  width: 5px; height: 5px;
  transform: rotate(45deg);
  background: var(--accent-2);
}

.reasoning {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0;
  font-size: 13px;
}
.reasoning summary {
  list-style: none;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 12px;
  display: flex; align-items: center; gap: 8px;
}
.reasoning summary::-webkit-details-marker { display: none; }
.reasoning summary .ic { color: var(--accent-hi); }
.reasoning[open] summary { border-bottom: 1px solid var(--border); }
.reasoning .content { padding: 12px 14px; color: var(--text-soft); }
.reasoning .step-line {
  display: flex; gap: 10px;
  padding: 6px 0;
  font-size: 12.5px;
}
.reasoning .step-line .n {
  font-family: var(--font-mono);
  color: var(--accent-2);
  flex: none;
}

.action-row {
  display: flex; gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.action-row .qbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-soft);
}
.action-row .qbtn:hover { background: var(--surface-2); }

/* Compose at bottom of thread */
.composer {
  padding: 16px 24px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.composer-shell {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px;
  display: grid; gap: 10px;
}
.composer-shell textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 48px;
  color: var(--text);
}
.composer-shell textarea::placeholder { color: var(--text-dim); }
.composer-tools {
  display: flex; align-items: center; gap: 6px;
}
.composer-tools .icbtn {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  display: grid; place-items: center;
  color: var(--text-dim);
}
.composer-tools .icbtn:hover { background: var(--surface-2); color: var(--text); }
.composer-tools .model-pick {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 10px;
  height: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--text-soft);
  margin-left: 6px;
}
.composer-tools .send {
  margin-left: auto;
  background: var(--accent);
  color: white;
  border: none;
  height: 30px;
  padding: 0 14px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 500;
}

/* Right context (files / referenced nodes) */
.context-rail {
  border-left: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 20px 16px;
  overflow-y: auto;
}
.context-rail h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin: 0 0 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.context-rail h4 button {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 12px;
}
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--text-soft);
  cursor: pointer;
}
.file-item:hover { background: var(--surface-2); }
.file-item .ic {
  width: 22px; height: 22px;
  flex: none;
  background: var(--surface-3);
  border-radius: 4px;
  display: grid; place-items: center;
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
}
.file-item .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .file-meta {
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.context-section { margin-bottom: 28px; }
.context-section .node-chip { margin-bottom: 6px; }
