:root {
  --sidebar-w: 279px;
  --bg: #f1f5f9;
  --panel: #fff;
  --border: rgba(148, 163, 184, 0.28);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #4f46e5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.demo-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.demo-top h1 { margin: 0; font-size: 14px; font-weight: 700; }
.demo-top p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.demo-top a { font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; }

.demo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px 40px;
}

.sidebar-mock {
  width: var(--sidebar-w);
  height: min(520px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  font-size: 12px;
}

.ctx-agent-fade {
  flex: 0 0 auto;
  height: 56px;
  background: linear-gradient(135deg, #c7d2fe 0%, #e9d5ff 55%, #fbcfe8 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.ctx-agent-fade::after {
  content: "↑ agent hero";
  position: absolute;
  left: 10px;
  bottom: 6px;
  font-size: 9px;
  font-weight: 600;
  color: rgba(71, 85, 105, 0.75);
}

.panel-zone {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.size-badge {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  font-size: 11px;
  font-weight: 600;
}

.panel-tree {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 6px 10px 10px 12px;
}

.panel-tree ul { list-style: none; margin: 0; padding: 0; }
.panel-tree li ul { padding-left: 14px; }

.panel-tree-node {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 2px 4px;
  border-radius: 6px;
  color: #334155;
}

.panel-tree-node.is-active { background: #eef2ff; color: #1e3a8a; }

.panel-tree-toggle {
  width: 16px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  font-size: 10px;
}

.panel-tree-badge { margin-left: auto; font-size: 10px; color: #94a3b8; }

/* shared controls */

.tool-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  font-size: 12px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

.tool-btn.is-active {
  border-color: #6366f1;
  background: #eef2ff;
  color: #3730a3;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
}

.search-bar:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  outline: none;
}

.search-input::placeholder { color: #94a3b8; }
.search-icon { color: #94a3b8; font-size: 12px; flex-shrink: 0; }

/* ── v11 ghost ── */

.v11-zone { padding: 6px 10px 8px; }

.v11-ghost-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 6px;
}

.v11-ghost-tools .tool-btn {
  border-color: transparent;
  background: transparent;
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.v11-ghost-tools .tool-btn:hover { background: #f1f5f9; }
.v11-ghost-tools .tool-btn.is-active { background: #eef2ff; border-color: transparent; }

.v11-ghost-tools .spacer { flex: 1; }

.v11-search .search-bar {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0 2px 4px;
  min-height: 28px;
  background: transparent;
}

.v11-search .search-bar:focus-within {
  border-bottom-color: #6366f1;
  box-shadow: none;
}

/* ── v12 text tabs ── */

.v12-zone { padding: 6px 10px 8px; }

.v12-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 6px;
}

.v12-tab {
  border: 0;
  background: transparent;
  padding: 4px 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 6px;
}

.v12-tab.is-active {
  color: #1e3a8a;
  background: #eef2ff;
}

.v12-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.v12-link {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 10px;
  color: #64748b;
  cursor: pointer;
  padding: 2px 4px;
}

.v12-link:hover { color: #4f46e5; }

/* ── v13 icon rail ── */

.v13-zone {
  display: flex;
  gap: 6px;
  padding: 6px 10px 8px;
  align-items: stretch;
}

.v13-rail {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.v13-rail .tool-btn {
  width: 22px;
  height: 22px;
  font-size: 10px;
  border-radius: 6px;
}

.v13-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.v13-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

.v13-actions .tool-btn { width: 22px; height: 22px; font-size: 10px; }

/* ── v14 command ── */

.v14-zone { padding: 6px 10px 8px; }

.v14-command {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  cursor: text;
}

.v14-command:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
  background: var(--panel);
}

.v14-command .search-input { font-size: 11px; }

.v14-kbd {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
}

.v14-hint {
  margin: 5px 2px 0;
  font-size: 10px;
  color: #94a3b8;
}

/* ── v15 status chip ── */

.v15-zone { padding: 6px 10px 8px; display: flex; flex-direction: column; gap: 6px; }

.v15-status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 10px;
  color: #475569;
}

.v15-status strong { color: #1e3a8a; font-weight: 600; }

.v15-dot { color: #cbd5e1; }

.v15-status button {
  margin-left: auto;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 10px;
  color: #4f46e5;
  cursor: pointer;
  font-weight: 600;
}

/* ── v16 segmented ── */

.v16-zone { padding: 6px 10px 8px; }

.v16-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.v16-segment {
  flex: 1;
  display: flex;
  height: 28px;
  padding: 2px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid var(--border);
}

.v16-seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
}

.v16-seg-btn.is-active {
  background: var(--panel);
  color: #1e3a8a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* ── v17 tree-integrated ── */

.v17-zone { padding: 4px 8px 0; }

.v17-tree-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 2px 6px 2px 4px;
  margin-bottom: 2px;
  border-radius: 6px;
  color: #64748b;
  font-size: 11px;
}

.v17-tree-tools:hover { background: #f8fafc; }

.v17-mode {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.v17-tree-tools .spacer { flex: 1; }

.v17-mini {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 10px;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 4px;
}

.v17-mini.is-active { color: #4f46e5; }

.v17-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 6px 0 22px;
  margin-bottom: 4px;
  border-radius: 6px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: #fafbfc;
}

.v17-search-row .search-input { font-size: 11px; }

/* ── v18 breadcrumb ── */

.v18-zone { padding: 6px 10px 8px; }

.v18-crumb {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v18-crumb strong { color: #334155; font-weight: 600; }
.v18-sep { color: #cbd5e1; }

.v18-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.v18-row .search-bar { min-height: 30px; flex: 1; }

/* ── v19 hover reveal ── */

.v19-zone {
  position: relative;
  padding: 6px 10px 8px;
}

.v19-search-only .search-bar { min-height: 32px; }

.v19-reveal {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.18s ease;
  overflow: hidden;
}

.v19-zone:hover .v19-reveal,
.v19-zone:focus-within .v19-reveal {
  grid-template-rows: 1fr;
}

.v19-reveal-inner {
  min-height: 0;
  overflow: hidden;
}

.v19-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 6px;
}

.v19-tools .view-cluster {
  flex: 1;
  display: flex;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}

.v19-tools .view-btn {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.v19-tools .view-btn.is-active { background: #eef2ff; color: #3730a3; }

/* ── v20 zen footer ── */

.v20-zone { padding: 6px 10px 4px; }

.v20-search .search-bar { min-height: 34px; border-radius: 10px; }

.v20-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 0 2px;
}

.v20-footer .tool-btn {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  font-size: 11px;
  border-radius: 6px;
}

.v20-footer .tool-btn:hover { background: #f1f5f9; }
.v20-footer .tool-btn.is-active { background: #eef2ff; color: #3730a3; }

.v20-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 2px;
}

.panel-hint {
  margin: 6px 10px 0;
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.35;
}
