.topbar{
  position: sticky; top:0; z-index:1000;
  width:100%;
  padding: .55rem .4rem .55rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg,#071225 0%,#0b2b5f 38%,#0e65c0 72%,#27a8ff 100%);
  border-bottom-left-radius:18px; border-bottom-right-radius:18px;
  box-shadow: 0 10px 24px rgba(0,0,0,.55), 0 0 18px rgba(56,189,248,.45);
  overflow: visible;
}

.logo-circle{
  width:52px; height:52px; flex-shrink:0;
  margin: -6px 0;
}
.logo-circle img{
  width:100%; height:100%; object-fit:contain;
}

.title-block{ display:flex; flex-direction:column; line-height:1.05; min-width:0; }
.main-title{ font-size:1.02rem; font-weight:800; letter-spacing:.04em; color:#f9fafb; }
.sub-title{ font-size:.74rem; color:#dbeafe; opacity:.95; }

.topbar-right{
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  margin-right: 0;
  padding-right: 0;
  flex-wrap: nowrap;
  flex-shrink: 0;
  width: auto;
  justify-content: flex-end;
}

.topbar-user-section{
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}


.theme-switch{ display:flex; gap:.28rem; }
.theme-dot{
  width:22px; height:22px; border-radius:999px;
  border:1px solid rgba(148,163,184,.85);
  background:rgba(15,23,42,.9); color:#e5e7eb; font-size:.65rem;
  display:flex; align-items:center; justify-content:center; padding:0; cursor:pointer;
  box-shadow:0 0 6px rgba(15,23,42,.9); transition:transform 0.36s ease;
}
.theme-dot:hover{ transform:scale(1.06); }
.theme-dot-active{ border-color:#facc15; box-shadow:0 0 10px rgba(250,204,21,.9),0 0 14px rgba(56,189,248,.55); }

.btn-primary, .btn-secondary{
  padding:.32rem .85rem; font-size:.78rem; border-radius:999px; font-weight:700; cursor:pointer;
  white-space:nowrap; line-height:1;
}
.btn-primary{
  border:1px solid #22c55e;
  background:radial-gradient(circle at 30% 30%,#22c55e,#16a34a);
  color:#f9fafb;
  box-shadow:0 4px 10px rgba(22,163,74,.5),0 0 8px rgba(22,163,74,.6);
}
.btn-primary:disabled{ opacity:.6; cursor:default; }
.btn-secondary{
  border:1px solid #bfdbfe;
  background:rgba(15,23,42,.25);
  color:#e0f2fe;
  box-shadow:0 3px 10px rgba(15,23,42,.6);
}
.btn-secondary:hover{ background:rgba(15,23,42,.45); }

.btn-icon{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(148,163,184,.5);
  background: rgba(15,23,42,.6);
  color: #38bdf8;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(56,189,248,.3);
  transition: all 0.3s ease;
}
.btn-icon:hover{
  background: rgba(56,189,248,.2);
  box-shadow: 0 0 16px rgba(56,189,248,.6);
  transform: scale(1.1);
  border-color: #38bdf8;
}

/* New action buttons design */
.topbar-actions{
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

.btn-action{
  height: 32px;
  padding: 0 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.8));
  color: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-action i{
  font-size: 0.9rem;
}

.btn-action .btn-label{
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.btn-action:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
  border-color: rgba(56, 189, 248, 0.6);
}

.btn-action:active{
  transform: translateY(0);
}

.btn-action:disabled{
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Specific button colors */
.btn-action-install{
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border-color: rgba(139, 92, 246, 0.5);
  color: white;
}

.btn-action-install:hover{
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.6);
  border-color: #a78bfa;
}

.btn-action-islands{
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  border-color: rgba(6, 182, 212, 0.5);
  color: white;
}

.btn-action-islands:hover{
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.6);
  border-color: #22d3ee;
}

.btn-action-auth{
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: rgba(16, 185, 129, 0.5);
  color: white;
}

.btn-action-auth:hover{
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.6);
  border-color: #34d399;
}

@media (max-width:900px){
  .topbar-right{
    gap: 0.6rem;
  }

  .btn-action .btn-label{
    display: none;
  }

  .btn-action{
    padding: 0 0.5rem;
  }
}

@media (max-width:640px){
  .topbar{
    padding: .5rem .4rem .5rem .7rem;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    flex-wrap: wrap;
  }

  .main-title{ font-size: 1rem; }
  .sub-title{ font-size: .7rem; }

  .topbar-right{
    width: fit-content !important;
    max-width: fit-content !important;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-left: auto;
    margin-top: 0.5rem;
    flex-grow: 0;
    flex-shrink: 1;
  }

  .topbar-user-section{
    order: 1;
    width: fit-content !important;
    max-width: fit-content !important;
    flex-grow: 0;
  }

  .sw-userchip{
    width: fit-content !important;
    max-width: fit-content !important;
    flex-grow: 0;
  }

  .sw-usertext{
    width: fit-content !important;
    max-width: fit-content !important;
    flex-grow: 0;
  }

  .sw-userline, .sw-userhandle{
    max-width: fit-content !important;
  }

  .topbar-actions{
    order: 2;
    gap: 0.3rem;
    width: fit-content !important;
    flex-grow: 0;
  }

  .btn-action{
    height: 34px;
    min-width: 34px;
    padding: 0 0.5rem;
  }

  .btn-action i{
    font-size: 0.9rem;
  }
}

/* SW_AUTH_UI:BEGIN */
.auth-strip{
  margin-top: 6px;
  display:flex;
  align-items:center;
  gap: .45rem;
  flex-wrap: wrap;
}

.auth-pill{
  display:inline-flex;
  align-items:center;
  gap: .35rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .70rem;
  font-weight: 900;
  letter-spacing: .02em;
  border: 1px solid rgba(148,163,184,.55);
  background: rgba(2,6,23,.25);
  color: #e5e7eb;
}
.auth-pill i{ font-size: .85rem; opacity:.95; }

.auth-pill--ok{
  border-color: rgba(34,197,94,.65);
  background: rgba(34,197,94,.16);
}
.auth-pill--loading{
  border-color: rgba(56,189,248,.65);
  background: rgba(56,189,248,.14);
}
.auth-pill--anon{
  border-color: rgba(148,163,184,.55);
  background: rgba(2,6,23,.20);
}

.auth-banner{
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 14px;
  font-size: .72rem;
  font-weight: 800;
  display:flex;
  gap: 8px;
  align-items:center;
  flex-wrap:wrap;
}
.auth-banner--error{
  background: rgba(248,113,113,0.14);
  border: 1px solid rgba(248,113,113,0.55);
  color: #ffe4e6;
}
.auth-banner--info{
  background: rgba(56,189,248,0.14);
  border: 1px solid rgba(56,189,248,0.55);
  color: #e0f2fe;
}
.auth-banner--success{
  background: rgba(34,197,94,0.14);
  border: 1px solid rgba(34,197,94,0.55);
  color: #d1fae5;
}

.user-chip{
  display:inline-flex;
  align-items:center;
  gap: .45rem;
  padding: .22rem .55rem;
  border-radius: 999px;
  background: rgba(2,6,23,.25);
  border: 1px solid rgba(148,163,184,.55);
}
.user-avatar{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(56,189,248,0.18);
  border: 1px solid rgba(56,189,248,0.35);
}
.user-avatar i{ font-size: 14px; }

.user-name{
  font-size: .80rem;
  font-weight: 950;
  color: #f9fafb;
  max-width: 220px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Light theme readability */
body[data-theme="light"] .auth-pill{
  background: rgba(255,255,255,0.82);
  border-color: rgba(148,163,184,0.85);
  color: #0b1220;
}
body[data-theme="light"] .user-chip{
  background: rgba(255,255,255,0.82);
  border-color: rgba(148,163,184,0.85);
}
body[data-theme="light"] .user-name{ color:#0b1220; }
body[data-theme="light"] .user-avatar{
  background: rgba(30,107,255,0.12);
  border-color: rgba(30,107,255,0.35);
  color:#0b1220;
}
/* SW_AUTH_UI:END */

/* SW_AUTH_UI2:BEGIN */
.sw-notice{
  margin: 10px 14px 0 14px;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.2;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(2,6,23,.22);
  color: #e5e7eb;
}
.sw-notice--error{
  background: rgba(248,113,113,0.14);
  border-color: rgba(248,113,113,0.55);
  color: #ffe4e6;
}
.sw-notice--info{
  background: rgba(56,189,248,0.14);
  border-color: rgba(56,189,248,0.55);
  color: #e0f2fe;
}
.sw-notice--success{
  background: rgba(34,197,94,0.14);
  border-color: rgba(34,197,94,0.55);
  color: #d1fae5;
}
.sw-notice--warn{
  background: rgba(251,191,36,0.12);
  border-color: rgba(251,191,36,0.40);
  color: #fffbeb;
}

/* single user chip (no duplicates) */
.user-chip{
  display:inline-flex;
  align-items:center;
  gap: .45rem;
  padding: .22rem .55rem;
  border-radius: 999px;
  background: rgba(2,6,23,.25);
  border: 1px solid rgba(148,163,184,.55);
}
.user-avatar{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(56,189,248,0.18);
  border: 1px solid rgba(56,189,248,0.35);
}
.user-avatar i{ font-size: 14px; }
.user-name{
  font-size: .82rem;
  font-weight: 950;
  color: #f9fafb;
  max-width: 180px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-badge{
  display:inline-flex;
  align-items:center;
  gap: .35rem;
  padding: .10rem .45rem;
  border-radius: 999px;
  font-size: .70rem;
  font-weight: 950;
  border: 1px solid rgba(34,197,94,.55);
  background: rgba(34,197,94,.14);
  color: #d1fae5;
}
/* SW_AUTH_UI2:END */


/* SW_TOPBAR_POLISH:BEGIN */

/* Make right side look like a clean “glass dock” */
.topbar-right{
  padding: calc(.28rem + 5px) calc(.35rem + 5px);
  border-radius: 999px;
  background: rgba(2,6,23,.18);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  min-height: 44px;
  min-width: max-content;
  overflow: visible;
}

/* User chip used by TopBar.jsx (missing styles before) */
.sw-userchip{
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  background: rgba(2,6,23,.22);
  border: 1px solid rgba(148,163,184,.45);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  margin: 0;
}

.sw-userchip-btn{
  border: 0;
  cursor: pointer;
}

.sw-userchip-btn:hover{
  box-shadow: 0 6px 16px rgba(56,189,248,.35);
  border-color: rgba(56,189,248,.7);
}

.sw-avatar{
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(56,189,248,0.18);
  border: 1px solid rgba(56,189,248,0.35);
  color: #e5e7eb;
  font-weight: 950;
  overflow: hidden;
  flex-shrink: 0;
}
.sw-avatar i{ font-size: 12px; }
.sw-avatar-guest{
  background: transparent;
  border: none;
}
.sw-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sw-usertext{
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
  max-width: max-content;
}
.sw-userline{
  font-size: 0.68rem;
  font-weight: 950;
  color: #f9fafb;
  white-space: nowrap;
}
.sw-userhandle{
  font-size: 0.64rem;
  font-weight: 800;
  color: #dbeafe;
  opacity: .92;
  max-width: max-content;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile: dock becomes full width and nice */
@media (max-width:640px){
  .topbar-right{
    width:100%;
    border-radius: 16px;
    justify-content: flex-start;
  }
}

/* Light theme readability */
body[data-theme="light"] .topbar-right{
  background: rgba(255,255,255,.55);
  border-color: rgba(148,163,184,.55);
}
body[data-theme="light"] .sw-userchip{
  background: rgba(255,255,255,.80);
  border-color: rgba(148,163,184,.70);
  color: #0b1220;
}
body[data-theme="light"] .sw-userline,
body[data-theme="light"] .sw-userhandle{
  color:#0b1220;
}
body[data-theme="light"] .sw-avatar{
  background: rgba(30,107,255,0.10);
  border-color: rgba(30,107,255,0.35);
  color:#0b1220;
}

/* SW_TOPBAR_POLISH:END */

/* SW_TOPBAR_OVERFLOW_FIX:BEGIN */
.topbar{
  flex-wrap: wrap;           /* ✅ allow wrap instead of overflowing right */
  row-gap: .45rem;
}

.topbar-left{
  display:flex;
  align-items:center;
  gap: .65rem;
  min-width: 0;              /* ✅ allow shrinking */
}

.title-block{ min-width:0; }
.main-title, .sub-title{
  max-width: 58vw;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-right{
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;           /* ✅ wrap buttons instead of clipping */
  gap: .45rem;
}

@media (max-width:640px){
  .main-title, .sub-title{ max-width: 86vw; }
  .topbar-right{
    justify-content: flex-start;
    width: 100%;
  }
}

/* Unified auth button (guest online / log on / log off) */
.sw-auth-combo{
  display:flex;
  align-items:center;
  gap:.5rem;
  padding:.25rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.55);
  background: rgba(2,6,23,.22);
  color: #e5e7eb;
  cursor:pointer;
  max-width: 100%;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
}

.sw-auth-combo .sw-usertext{
  min-width: 0;
}

.sw-auth-combo .sw-userhandle{
  max-width: 120px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-auth-action{
  margin-left: .25rem;
  padding: .22rem .55rem;
  border-radius: 999px;
  font-weight: 950;
  font-size: .70rem;
  border: 1px solid rgba(56,189,248,.35);
  background: rgba(56,189,248,.14);
  color: #dbeafe;
  white-space: nowrap;
}

.sw-auth-combo--on .sw-auth-action{
  border-color: rgba(34,197,94,.45);
  background: rgba(34,197,94,.16);
  color: #d1fae5;
}
/* SW_TOPBAR_OVERFLOW_FIX:END */


/* SW_TOPBAR_ONE_LINE_FIX:BEGIN */
/* Keep the header on ONE ROW (no wrapping to a second line) */
.topbar{
  flex-wrap: nowrap;
  align-items: center;
}

/* Left brand stack (logo + title, with theme dots underneath) */
.brand-stack{
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.brand-toprow{
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.brand-under{
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-left: 46px; /* aligns under title block visually */
}

/* Prevent title from pushing the right side off-screen */
.title-block{ min-width: 0; }
.main-title{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(360px, 48vw);
}
.sub-title{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(360px, 48vw);
}

/* Right side never wraps */
.topbar-right{
  flex-wrap: nowrap !important;
  white-space: nowrap;
  min-width: 0;
  max-width: max-content;
  overflow: visible;
}

/* Make user handle and chip take only needed space */
.sw-userchip{ min-width: 0; max-width: max-content; width: max-content; }

@media (max-width: 640px){
  .main-title, .sub-title{ max-width: 62vw; }
  .topbar-right{ max-width: 100%; }
  .brand-under{ padding-left: 0; }
}
/* SW_TOPBAR_ONE_LINE_FIX:END */

/* SW_FRIENDS_BUTTON:BEGIN */
.btn-action-friends{
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: rgba(245, 158, 11, 0.5);
  color: white;
}

.btn-action-friends:hover{
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.6);
  border-color: #fbbf24;
}

.btn-action-friends.is-active{
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.6);
  border-color: #fbbf24;
}

.btn-action-friends{
  position: relative;
}

.friends-badge-count{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(15, 23, 42, 0.9);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
}

/* Friends dropdown panel positioning */
.friends-dropdown-wrap{
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 10000005;
  animation: friendsSlideIn 0.2s ease-out;
}

@keyframes friendsSlideIn{
  from{
    opacity: 0;
    transform: translateY(-10px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px){
  .friends-dropdown-wrap{
    top: auto;
    bottom: 80px;
    right: 10px;
    left: 10px;
  }
  .friends-dropdown-wrap .friends-panel{
    max-width: none;
    width: 100%;
  }
}
/* SW_FRIENDS_BUTTON:END */

/* SW_LANGUAGE_SELECTOR:BEGIN */
.lang-selector-wrap{
  position: relative;
  z-index: 9999;
}

.btn-action-lang{
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
}

.btn-action-lang .btn-label{
  font-size: 0.65rem;
  font-weight: 700;
}

.btn-action-lang.is-active{
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.7);
}

.lang-dropdown{
  position: fixed;
  top: auto;
  right: auto;
  margin-top: 6px;
  min-width: 140px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
  overflow: hidden;
  z-index: 10000010;
  animation: langDropIn 0.18s ease-out;
}

@keyframes langDropIn{
  from{
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  to{
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lang-option{
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.lang-option:hover{
  background: rgba(56, 189, 248, 0.18);
}

.lang-option.is-active{
  background: rgba(56, 189, 248, 0.28);
  color: #38bdf8;
}

body[data-theme="light"] .lang-dropdown{
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(148, 163, 184, 0.6);
}

body[data-theme="light"] .lang-option{
  color: #0f172a;
}

body[data-theme="light"] .lang-option:hover{
  background: rgba(56, 189, 248, 0.15);
}

body[data-theme="light"] .lang-option.is-active{
  background: rgba(56, 189, 248, 0.25);
  color: #0369a1;
}
/* SW_LANGUAGE_SELECTOR:END */

/* SW_THEME_SELECTOR:BEGIN */
.theme-selector-wrap{
  position: relative;
}

.btn-action-theme{
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border-color: rgba(139, 92, 246, 0.5);
  color: white;
}

.btn-action-theme:hover{
  background: linear-gradient(135deg, #a78bfa, #818cf8);
}

.btn-action-theme.is-active{
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}

.theme-dropdown{
  position: fixed;
  z-index: 10000010;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(139, 92, 246, 0.5);
  border-radius: 8px;
  min-width: 120px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.theme-option{
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.theme-option:hover{
  background: rgba(139, 92, 246, 0.18);
}

.theme-option.is-active{
  background: rgba(139, 92, 246, 0.28);
  color: #a78bfa;
}

body[data-theme="light"] .theme-dropdown{
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(139, 92, 246, 0.6);
}

body[data-theme="light"] .theme-option{
  color: #0f172a;
}

body[data-theme="light"] .theme-option:hover{
  background: rgba(139, 92, 246, 0.15);
}

body[data-theme="light"] .theme-option.is-active{
  background: rgba(139, 92, 246, 0.25);
  color: #6d28d9;
}
/* SW_THEME_SELECTOR:END */

/* SW_MOBILE_TOPBAR_COMPACT:BEGIN - Facebook-style compact single-row topbar */
@media (max-width: 900px){
  .btn-action .btn-label{
    display: none;
  }
  .btn-action{
    padding: 0 0.45rem;
    min-width: 32px;
    height: 30px;
  }
}

@media (max-width: 640px){
  /* COMPACT SINGLE ROW - like Facebook */
  .topbar{
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    padding: 0.35rem 0.5rem;
    gap: 0.4rem;
    min-height: 44px;
    max-height: 52px;
  }

  /* Logo smaller */
  .logo-circle{
    width: 32px;
    height: 32px;
    margin: 0;
  }

  /* Brand stack inline, no column */
  .brand-stack{
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    flex-shrink: 1;
  }

  .brand-toprow{
    gap: 0.35rem;
    min-width: 0;
  }

  /* Hide subtitle and theme dots on mobile */
  .sub-title{
    display: none;
  }
  .brand-under{
    display: none;
  }

  .main-title{
    font-size: 0.85rem;
    white-space: nowrap;
  }

  /* Right side: compact pill with small buttons */
  .topbar-right{
    flex-shrink: 0;
    padding: 0.2rem 0.3rem;
    border-radius: 999px;
    gap: 0.25rem;
    min-height: 34px;
    max-width: none;
    width: auto;
    background: rgba(2, 6, 23, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
  }

  /* User chip: just avatar, no text */
  .topbar-user-section{
    flex-shrink: 0;
  }
  .sw-userchip{
    padding: 0.15rem;
    gap: 0;
  }
  .sw-usertext{
    display: none;
  }
  .sw-avatar{
    width: 24px;
    height: 24px;
  }

  /* Compact action buttons */
  .topbar-actions{
    gap: 0.2rem;
  }
  .btn-action{
    height: 28px;
    min-width: 28px;
    padding: 0 0.35rem;
    border-radius: 999px;
  }
  .btn-action i{
    font-size: 0.8rem;
  }
  .btn-action .btn-label{
    display: none;
  }

  /* Friends badge smaller */
  .friends-badge-count{
    top: -4px;
    right: -4px;
    min-width: 14px;
    height: 14px;
    font-size: 0.55rem;
    padding: 0 3px;
  }
}

@media (max-width: 380px){
  .topbar{
    padding: 0.3rem 0.4rem;
  }
  .logo-circle{
    width: 28px;
    height: 28px;
  }
  .main-title{
    font-size: 0.75rem;
    white-space: nowrap;
  }
  .btn-action{
    height: 26px;
    min-width: 26px;
    padding: 0 0.3rem;
  }
  .btn-action i{
    font-size: 0.75rem;
  }
  .sw-avatar{
    width: 22px;
    height: 22px;
  }
}
/* SW_MOBILE_TOPBAR_COMPACT:END */
