/* ───────────────────────────────────────────────────────────
   Sidebar (#panel) — sits to the right of the activity bar.
   Always shows the "Events" view (Live / Sample sources).
   Header, mode tabs, content, status footer.
   ─────────────────────────────────────────────────────────── */

#panel {
  position: fixed;
  top: 0;
  left: var(--ab-w);
  width: var(--pw);
  height: 100vh;
  z-index: 30;

  display: flex;
  flex-direction: column;

  background: var(--surface-1);
  border-right: 1px solid var(--border);

  /* When collapsed, slide left until the panel hides exactly behind the
     activity bar (z-index keeps the bar on top). Using -100% adapts to
     any user-resized --pw value. */
  transform: translateX(0);
  transition: transform var(--pt) cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
#panel.collapsed {
  transform: translateX(-100%);
}

/* Resize handle — column resizer on the right edge */
#panel-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 31;
  transition: background var(--motion-fast);
}
#panel-resizer:hover,
#panel-resizer.dragging {
  background: var(--accent-edge);
}
#panel.collapsed ~ #panel-resizer {
  display: none;
}

/* Edge tap zones — show a flush 14 px strip when sidebar is hidden. */
#panel-edge {
  position: fixed;
  left: var(--ab-w);
  top: 0;
  width: 12px;
  height: 100%;
  z-index: 29;
  display: none;
  cursor: e-resize;
}
body.panel-unpinned #panel-edge {
  display: block;
}
#rpanel-edge {
  position: fixed;
  right: 0;
  top: 0;
  width: 12px;
  height: 100%;
  z-index: 29;
  display: none;
  cursor: w-resize;
}
body.rpanel-unpinned #rpanel-edge {
  display: block;
}

/* ── Header ────────────────────────────────────────────── */
#panel-head {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}
.panel-head-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-head-row-top {
  justify-content: space-between;
}

.logo-block {
  min-width: 0;
  flex: 1;
}
.logo-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.logo {
  font: 700 13px/1 var(--font);
  color: var(--bright);
  letter-spacing: 0.14em;
}
.logo-sep {
  color: var(--dim);
  font-weight: 400;
}
.logo-context {
  font: 500 11.5px/1.2 var(--font);
  color: var(--text);
}
.logo-lab {
  font: 500 9.5px/1 var(--font);
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.head-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.icon-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--muted);
  transition:
    color var(--motion-fast),
    background var(--motion-fast);
}
.icon-btn:hover {
  color: var(--bright);
  background: var(--surface-hover);
}
.icon-btn.on {
  color: var(--accent-text);
  background: var(--accent-soft);
}

/* ── External-links rail ───────────────────────────────── */
#ext-links-top {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#ext-links-top a {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--muted);
  transition:
    color var(--motion-fast),
    background var(--motion-fast);
}
#ext-links-top a .ti {
  font-size: 14px;
}
#ext-links-top a:hover {
  color: var(--bright);
  background: var(--surface-hover);
}
#ext-links-top a.docs {
  color: var(--accent-text);
  background: var(--accent-soft);
}
#ext-links-top a.docs:hover {
  color: var(--bright);
  background: rgba(99, 152, 255, 0.18);
}

/* ── Mode tabs (Live / Sample) ─────────────────────────── */
#mode-bar {
  display: flex;
  flex-shrink: 0;
  padding: 8px 12px 4px;
  gap: 2px;
  border-bottom: 1px solid var(--divider);
}
.mbtn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: var(--r);
  color: var(--muted);
  font: 500 var(--fs-sm) / 1 var(--font);
  letter-spacing: 0.04em;
  transition:
    color var(--motion-fast),
    background var(--motion-fast);
  border-bottom: 2px solid transparent;
  border-radius: var(--r) var(--r) 0 0;
}
.mbtn .ic,
.mbtn .ti {
  font-size: 13px;
  width: 13px;
  height: 13px;
}
.mbtn:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.mbtn.on {
  color: var(--bright);
  border-bottom-color: var(--accent);
  background: var(--surface-hover);
}
