/* FRIENDS UI V2 — shell tokens only (topbar + companion rail). Does not restyle legacy pages. */

:root {
  --shell-gold: #d4a017;
  --shell-gold-hover: #e8b82a;
  --shell-purple: #8b5cf6;
  --shell-danger: #c45c5c;
  --shell-surface: rgba(11, 14, 24, 0.94);
  --shell-border: rgba(212, 160, 23, 0.26);
  --shell-text: #f3efe6;
  --shell-muted: #a8b0bf;
  /* Canonical geometry (aliases for commercial shell contract) */
  --friends-topbar-height: 68px;
  --friends-rail-expanded-width: 272px;
  --friends-rail-collapsed-width: 0px;
  --friends-content-gutter: 1.25rem;
  --friends-content-max-width: 1200px;
  --shell-rail-expanded: var(--friends-rail-expanded-width);
  --shell-rail-collapsed: var(--friends-rail-collapsed-width);
  --shell-topbar-h: var(--friends-topbar-height);
  --shell-z-chrome: 200;
  --shell-z-dropdown: 260;
}

html.friends-ui-v2 #site-release-static.site-release-label {
  position: static !important;
  transform: none !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 1 !important;
  opacity: 0.45;
  font-size: 0.6rem !important;
  letter-spacing: 0.06em;
  pointer-events: none;
  margin: 0.35rem auto 0;
  display: block;
  width: max-content;
}

.friends-ui-v2-shell .player-mobile-dock {
  display: none !important;
}

.shell-btn {
  appearance: none;
  border-radius: 12px;
  font: 600 0.85rem/1.2 ui-sans-serif, system-ui, sans-serif;
  padding: 0.5rem 0.95rem;
  min-height: 2.5rem;
  cursor: pointer;
  border: 1px solid transparent;
  color: var(--shell-text);
  background: transparent;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease, background 180ms ease,
    border-color 180ms ease, opacity 180ms ease;
}
.shell-btn--primary {
  background: linear-gradient(180deg, var(--shell-gold-hover), var(--shell-gold));
  color: #1a1205;
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 6px 16px rgba(212, 160, 23, 0.18);
}
.shell-btn--secondary {
  border-color: var(--shell-border);
  background: rgba(255, 255, 255, 0.04);
}
.shell-btn--ghost {
  color: var(--shell-muted);
}
.shell-btn--icon {
  width: 2.25rem;
  height: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.shell-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.shell-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--shell-text);
  padding: 0.55rem 0.75rem;
  font: 500 0.88rem/1.25 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  border-radius: 8px;
}
.shell-menu-item:hover,
.shell-menu-item:focus-visible {
  background: rgba(212, 160, 23, 0.12);
  outline: none;
}
.shell-menu-item--danger {
  color: #fca5a5;
}

.friends-topbar {
  position: sticky;
  top: 0;
  z-index: var(--shell-z-chrome);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--shell-topbar-h);
  padding: 0.5rem 1rem;
  background: var(--shell-surface);
  border-bottom: 1px solid var(--shell-border);
  backdrop-filter: blur(10px);
}
.friends-topbar-left,
.friends-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.friends-topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  border-radius: 12px;
  text-align: left;
}
.friends-topbar-logo:focus-visible {
  outline: 2px solid var(--shell-gold);
  outline-offset: 2px;
}
.friends-topbar-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(145deg, var(--shell-gold), #8a6a10);
  color: #1a1205;
}
.friends-topbar-title {
  display: block;
  font: 800 1rem/1.1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.04em;
}
.friends-topbar-subtitle {
  display: block;
  font: 500 0.68rem/1.2 ui-sans-serif, system-ui, sans-serif;
  color: var(--shell-muted);
  max-width: 14rem;
}
.friends-topbar-section {
  font: 600 0.78rem/1 ui-sans-serif, system-ui, sans-serif;
  color: var(--shell-gold);
  white-space: nowrap;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--shell-border);
}
.friends-topbar-balance {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}
.friends-topbar-balance-label {
  font-size: 0.68rem;
  color: var(--shell-muted);
}
.friends-topbar-balance-value {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  min-width: 4ch;
}
.friends-topbar-earned {
  display: none;
}
.friends-topbar-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: min(20rem, 80vw);
  z-index: var(--shell-z-dropdown);
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--shell-border);
  background: #0f1422;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.friends-topbar-popover.is-open {
  display: block;
}
.shell-currency-list {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
}
.shell-currency-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}
.friends-topbar-menu,
.friends-topbar-avatar-wrap {
  position: relative;
}
.friends-topbar-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 14rem;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--shell-border);
  background: #0f1422;
  z-index: var(--shell-z-dropdown);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.friends-topbar-dropdown.is-open {
  display: block;
}
.friends-topbar-avatar-cluster {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 0.25rem 0.65rem 0.25rem 0.25rem;
  color: inherit;
  cursor: pointer;
}
.friends-topbar-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(212, 160, 23, 0.2);
  font-size: 0.75rem;
  font-weight: 700;
}
.friends-topbar-avatar-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.friends-topbar-nick {
  font: 600 0.82rem/1.1 ui-sans-serif, system-ui, sans-serif;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friends-topbar-rank {
  font-size: 0.68rem;
  color: var(--shell-muted);
}
.friends-topbar-rank-bar {
  display: block;
  width: 5.5rem;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 0.15rem;
}
.friends-topbar-rank-bar > span {
  display: block;
  height: 100%;
  background: var(--shell-gold);
}

/* Companion rail — class is on the same node as .showcase-shell (not a descendant). */
.showcase-shell.friends-ui-v2-shell {
  --showcase-sidebar-width: var(--shell-rail-expanded);
  grid-template-columns: var(--friends-rail-expanded-width) minmax(0, 1fr);
}
.showcase-shell.friends-ui-v2-shell.showcase-shell--sidebar-collapsed,
.showcase-shell.friends-ui-v2-shell:has(aside.companion-rail.companion-rail--collapsed) {
  --showcase-sidebar-width: 0px;
  grid-template-columns: 0 minmax(0, 1fr);
}

/* Hub / suppressed rail: single full-width main — never leave an empty second column. */
.showcase-shell.friends-ui-v2-shell:has(aside.companion-rail.companion-rail--suppressed),
.showcase-shell.friends-ui-v2-shell:has(aside.companion-rail[hidden]) {
  --showcase-sidebar-width: 0px;
  grid-template-columns: minmax(0, 1fr) !important;
}
.showcase-shell.friends-ui-v2-shell:has(aside.companion-rail.companion-rail--suppressed) > .showcase-main,
.showcase-shell.friends-ui-v2-shell:has(aside.companion-rail[hidden]) > .showcase-main {
  grid-column: 1 !important;
  min-width: 0;
  width: 100%;
}

/* Slot + embed: collapsed = full-bleed stage; expanded = rail column shrinks the game. */
.showcase-shell.friends-ui-v2-shell.playground--slot-active,
.showcase-shell.friends-ui-v2-shell.playground--embed-active {
  grid-template-rows: minmax(0, 1fr) !important;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.showcase-shell.friends-ui-v2-shell.playground--slot-active:has(aside.companion-rail.companion-rail--collapsed),
.showcase-shell.friends-ui-v2-shell.playground--embed-active:has(aside.companion-rail.companion-rail--collapsed),
.showcase-shell.friends-ui-v2-shell.playground--slot-active:has(aside.companion-rail.companion-rail--suppressed),
.showcase-shell.friends-ui-v2-shell.playground--embed-active:has(aside.companion-rail.companion-rail--suppressed),
.showcase-shell.friends-ui-v2-shell.playground--slot-active:has(aside.companion-rail[hidden]),
.showcase-shell.friends-ui-v2-shell.playground--embed-active:has(aside.companion-rail[hidden]) {
  --showcase-sidebar-width: 0px;
  grid-template-columns: 0 minmax(0, 1fr) !important;
}
.showcase-shell.friends-ui-v2-shell.playground--slot-active:has(aside.companion-rail:not(.companion-rail--collapsed):not(.companion-rail--suppressed):not([hidden])),
.showcase-shell.friends-ui-v2-shell.playground--embed-active:has(aside.companion-rail:not(.companion-rail--collapsed):not(.companion-rail--suppressed):not([hidden])) {
  --showcase-sidebar-width: var(--friends-rail-expanded-width);
  grid-template-columns: var(--friends-rail-expanded-width) minmax(0, 1fr) !important;
}
.showcase-shell.friends-ui-v2-shell.playground--slot-active > aside.companion-rail,
.showcase-shell.friends-ui-v2-shell.playground--embed-active > aside.companion-rail {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  min-height: 0;
  max-height: 100%;
  z-index: calc(var(--shell-z-chrome) + 1);
}
.showcase-shell.friends-ui-v2-shell.playground--slot-active > .showcase-main,
.showcase-shell.friends-ui-v2-shell.playground--embed-active > .showcase-main {
  grid-column: 2 !important;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

/*
 * Mobile (≤900): collapsed rail is position:fixed (floating pill).
 * Do NOT keep a 72px empty grid column — pin main full-bleed and share cell 1/1.
 */
@media (max-width: 900px) {
  .showcase-shell.friends-ui-v2-shell.playground--slot-active,
  .showcase-shell.friends-ui-v2-shell.playground--embed-active {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .showcase-shell.friends-ui-v2-shell.playground--slot-active > aside.companion-rail,
  .showcase-shell.friends-ui-v2-shell.playground--embed-active > aside.companion-rail,
  .showcase-shell.friends-ui-v2-shell.playground--slot-active > .showcase-main,
  .showcase-shell.friends-ui-v2-shell.playground--embed-active > .showcase-main {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
}

/* Legacy social mega-tabs must not appear inside V2 shell destinations. */
html.friends-ui-v2 [data-lobby-panel='social'],
html.friends-ui-v2 .social-hub-tabs,
html.friends-ui-v2 .social-hub-tab {
  display: none !important;
}
.showcase-shell.friends-ui-v2-shell.showcase-shell--sidebar-collapsed .showcase-center--player {
  width: min(100%, 100vw);
}
.friends-ui-v2-shell .companion-rail--collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  border-right: none !important;
  background: transparent !important;
  overflow: visible !important;
  pointer-events: none;
}
.friends-ui-v2-shell aside.companion-rail {
  width: var(--shell-rail-expanded);
  max-width: var(--friends-rail-expanded-width);
  background: var(--shell-surface);
  border-right: 1px solid var(--shell-border);
  position: relative;
  z-index: calc(var(--shell-z-chrome) - 1);
  overflow: hidden;
  transition: width 180ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .friends-ui-v2-shell aside.companion-rail {
    transition: none;
  }
}
.companion-rail-toggle {
  position: absolute;
  top: 0.45rem;
  right: 0.35rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--shell-border);
  background: rgba(18, 16, 22, 0.92);
  color: #f3efe6;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
}
.companion-rail-toggle-icon {
  font-size: 0.85rem;
}
.companion-rail-toggle-label {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.companion-mini-dock-expand-label {
  font-size: 0.58rem;
  line-height: 1.1;
  text-align: center;
  color: var(--shell-muted, #a8a29a);
  max-width: 3.9rem;
}
.companion-rail-expanded {
  padding: 2.4rem 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 100%;
}
.companion-rail-room {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.companion-rail-dialogue {
  margin: 0;
  font-size: 0.8rem;
  color: var(--shell-muted);
  line-height: 1.35;
  max-height: 2.7em;
  overflow: hidden;
}
.companion-rail-identity {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.companion-rail-stats {
  display: grid;
  gap: 0.35rem;
  font-size: 0.78rem;
}
.companion-rail-stats > div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--shell-muted);
}
.companion-rail-actions {
  display: grid;
  gap: 0.4rem;
}
.companion-rail-quest {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  margin: 0 0 0.4rem;
}
.companion-rail-quest.is-claimable {
  border-color: rgba(34, 197, 94, 0.45);
}
.companion-rail-quest-title {
  margin: 0;
  font-size: 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  max-height: 2.5em;
}
.companion-rail-quest-desc {
  margin: 0.25rem 0;
  font-size: 0.72rem;
  color: var(--shell-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.companion-rail--collapsed [data-rail-expanded-body],
.companion-rail--collapsed .companion-rail-expanded,
.companion-rail--collapsed .companion-rail-quest {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.companion-rail:not(.companion-rail--truncated) .companion-rail-quest {
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.companion-rail-quest-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--shell-muted);
}
/* Companion Mini Dock — floating edge control; rail layout width is 0 when collapsed. */
.companion-mini-dock,
.companion-rail-collapsed {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.35rem 0.45rem;
  pointer-events: auto;
}
.companion-rail--collapsed .companion-mini-dock,
.companion-rail--collapsed .companion-rail-collapsed {
  display: flex;
  position: fixed;
  left: max(0.65rem, env(safe-area-inset-left, 0px));
  top: calc(var(--shell-topbar-h, 56px) + 0.65rem);
  z-index: calc(var(--shell-z-dropdown, 40) + 2);
  width: 4.25rem;
  min-height: 4.25rem;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid var(--shell-border);
  background: rgba(18, 16, 22, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.companion-rail--suppressed .companion-mini-dock,
.companion-rail--suppressed .companion-rail-collapsed,
.companion-rail[hidden] .companion-mini-dock,
.companion-rail[hidden] .companion-rail-collapsed {
  display: none !important;
}
.companion-rail-avatar-btn {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--shell-border);
  background: rgba(212, 160, 23, 0.12);
  cursor: pointer;
  color: #f3efe6;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.companion-mini-dock-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.companion-rail-avatar-glyph {
  font-size: 1.25rem;
  line-height: 1;
}
.companion-mini-dock-identity {
  max-width: 3.9rem;
  font-size: 0.62rem;
  line-height: 1.15;
  text-align: center;
  color: #e8dfc8;
  word-break: break-word;
}
.companion-mini-dock-chevron {
  font-size: 0.75rem;
  color: var(--shell-muted);
  line-height: 1;
}
.companion-rail-indicators {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.companion-rail-indicators[hidden] {
  display: none !important;
}
.companion-rail-badge {
  min-width: 1.35rem;
  min-height: 1.35rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35rem;
  color: #0c0e13;
}
.companion-rail-badge--income {
  background: #22c55e;
}
.companion-rail-badge--quest {
  background: var(--shell-gold, #d4af37);
}
.companion-rail-badge--msg {
  background: var(--shell-purple, #a78bfa);
  color: #fff;
}
.companion-rail-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.companion-rail-dot--income {
  background: #22c55e;
}
.companion-rail-dot--quest {
  background: var(--shell-gold);
}
.companion-rail-dot--msg {
  background: var(--shell-purple);
}
.companion-mini-dock-coach {
  position: absolute;
  left: calc(100% + 0.55rem);
  top: 0.15rem;
  z-index: 2;
  width: min(12.5rem, 42vw);
  padding: 0.45rem 1.4rem 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(24, 20, 14, 0.96);
  color: #f3efe6;
  font-size: 0.75rem;
  line-height: 1.3;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.companion-mini-dock-coach p {
  margin: 0;
}
.companion-mini-dock-coach-dismiss {
  position: absolute;
  top: 0.15rem;
  right: 0.2rem;
  border: 0;
  background: transparent;
  color: var(--shell-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.15rem;
}
.companion-rail-quest-game {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: #c9b27a;
}

/* Play-route overlay drawer (mobile ≤900 only): expand without crushing the stage. */
.companion-rail.companion-rail--play-drawer {
  position: fixed !important;
  left: 0;
  top: var(--shell-topbar-h, 56px);
  bottom: 0;
  z-index: calc(var(--shell-z-dropdown, 40) + 3);
  width: min(100vw, var(--friends-rail-expanded-width)) !important;
  min-width: min(100vw, var(--friends-rail-expanded-width)) !important;
  max-width: min(100vw, var(--friends-rail-expanded-width)) !important;
  border-right: 1px solid var(--shell-border) !important;
  background: var(--shell-surface) !important;
  overflow: auto !important;
  pointer-events: auto;
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.35);
}
.companion-rail.companion-rail--play-drawer .companion-mini-dock,
.companion-rail.companion-rail--play-drawer .companion-rail-collapsed {
  display: none !important;
}
.companion-rail.companion-rail--play-drawer [data-rail-expanded-body] {
  display: block !important;
}

.friends-surface-terminal {
  border: 1px solid var(--shell-border);
  border-radius: 14px;
  padding: 1.25rem 1.2rem;
  background: rgba(15, 20, 34, 0.92);
  max-width: 36rem;
}
.friends-surface-terminal-title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}
.friends-surface-terminal-detail {
  margin: 0 0 0.9rem;
  color: var(--shell-muted);
  line-height: 1.45;
}
.friends-surface-terminal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.shell-placeholder-host {
  margin: 0.75rem 1rem 0;
}
.shell-placeholder {
  border: 1px solid var(--shell-border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: rgba(15, 20, 34, 0.9);
}
.shell-placeholder-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.shell-placeholder-header h2 {
  margin: 0;
  font-size: 1.05rem;
}
.shell-placeholder-body {
  margin: 0.65rem 0;
  color: var(--shell-text);
}
.shell-placeholder-meta {
  margin: 0;
  color: var(--shell-muted);
  font-size: 0.8rem;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Floating oracle paw: lobby uses Mini Dock; slot keeps atmospheric companion speech. */
html.friends-ui-v2 .companion-oracle:not(.companion-oracle--slot-mode) {
  display: none !important;
}
html.friends-ui-v2 .companion-oracle.companion-oracle--slot-mode {
  display: flex !important;
}

@media (max-width: 1600px) {
  :root {
    /* Keep canonical expanded rail width — do not widen on laptop. */
    --shell-rail-expanded: var(--friends-rail-expanded-width);
  }
  .friends-topbar-subtitle {
    max-width: 11rem;
  }
}
@media (max-width: 1366px) {
  .friends-topbar-subtitle {
    display: none;
  }
  .friends-topbar-nick {
    max-width: 5.5rem;
  }
}
@media (max-width: 900px) {
  .friends-ui-v2-shell aside.companion-rail:not(.companion-rail--collapsed):not([hidden]) {
    position: fixed;
    left: 0;
    top: var(--shell-topbar-h);
    bottom: 0;
    z-index: calc(var(--shell-z-dropdown) + 1);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
  }
  .friends-ui-v2-shell aside.companion-rail.companion-rail--collapsed {
    position: fixed;
    left: 0;
    bottom: 0;
    top: auto;
    width: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    z-index: var(--shell-z-dropdown);
    pointer-events: none;
  }
  .friends-ui-v2-shell aside.companion-rail.companion-rail--collapsed .companion-mini-dock,
  .friends-ui-v2-shell aside.companion-rail.companion-rail--collapsed .companion-rail-collapsed {
    left: auto;
    right: max(0.65rem, env(safe-area-inset-right, 0px));
    bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
    top: auto;
  }
  .friends-ui-v2-shell .companion-mini-dock-coach {
    left: auto;
    right: calc(100% + 0.55rem);
  }
  .friends-ui-v2-shell .companion-rail-avatar-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .friends-topbar-rank,
  .friends-topbar-rank-bar {
    display: none;
  }
}
@media (max-width: 720px) {
  .friends-topbar {
    flex-wrap: wrap;
    min-height: 0;
  }
  .friends-topbar-section {
    display: none;
  }
}
