/* Drawer (desktop side panel) */

.c-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  pointer-events: auto;
}

.c-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity var(--duration-medium) var(--ease-out);
}
.c-drawer.is-open .c-drawer__backdrop { opacity: 1; }

.c-drawer__panel {
  position: absolute;
  /* Clear the desktop companion app's custom 32px titlebar (set on
   * html.sc2tree-desktop-frameless via style.css's --sc2tree-titlebar-h).
   * On web this var is 0 and the panel pins to the viewport top exactly
   * as before; in the desktop app it slides down by 32px so the panel's
   * "Friends" header isn't clipped behind the drag-region titlebar. */
  top: var(--sc2tree-titlebar-h, 0px);
  bottom: 0;
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border-left: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  outline: none;
  transition: transform var(--duration-medium) var(--ease-out);
}

.c-drawer--right .c-drawer__panel {
  right: 0;
  transform: translateX(100%);
}
.c-drawer--right.is-open .c-drawer__panel { transform: translateX(0); }

.c-drawer--left .c-drawer__panel {
  left: 0;
  border-left: none;
  border-right: 1px solid var(--color-border-strong);
  transform: translateX(-100%);
}
.c-drawer--left.is-open .c-drawer__panel { transform: translateX(0); }

.c-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.c-drawer__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.c-drawer__close {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  font-size: var(--text-2xl);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.c-drawer__close:hover { background: var(--color-bg-overlay); color: var(--color-text); }

.c-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}

@media (max-width: 767px) {
  .c-drawer { display: none !important; }
}
