/* Standalone theme picker; all colors and typography keep the unified theme tokens. */
.app-shell .topbar .top-actions { position: relative; flex: 0 0 auto; }
.theme-menu { position: relative; flex: 0 0 auto; }
.app-shell .topbar #themeTrigger { min-width: 44px; min-height: 44px; }
.theme-trigger:focus-visible,
.theme-dropdown button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.app-shell .topbar .theme-trigger[aria-expanded="true"] {
  color: var(--shell-text);
  border-color: var(--shell-accent);
  background: var(--shell-hover);
}
.dropdown.theme-dropdown {
  top: calc(100% + 10px);
  z-index: 90;
  width: min(280px, calc(100vw - 20px));
  max-height: calc(100dvh - 88px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.theme-dropdown .theme-picker { margin: 0; padding: 0; border: 0; }
.theme-dropdown .theme-option { min-height: 56px; }

/* Make room for the new control without dropping navigation or search. */
@media (min-width: 861px) and (max-width: 1740px) {
  .app-shell .topbar { gap: 8px; }
  .app-shell .topbar .topbar-brand { width: 44px; flex: 0 0 44px; }
  .app-shell .topbar .topbar-brand > span:last-child { display: none; }
  .app-shell .topbar .search-box { width: 180px; flex: 0 1 180px; min-width: 100px; }
  .app-shell .topbar .user-menu { flex: 0 0 44px; width: 44px; max-width: 44px; }
  .app-shell .topbar .user-trigger { width: 44px; min-width: 44px; max-width: 44px; padding: 3px; gap: 0; }
  .app-shell .topbar .user-trigger :is(.user-copy, svg, i) { display: none; }
  .app-shell .topbar .user-trigger .avatar { flex: 0 0 36px; }
}
@media (min-width: 1231px) and (max-width: 1320px) {
  .app-shell .topbar .topbar-brand { display: none; }
  .app-shell .topbar .top-actions { gap: 6px; }
}
@media (max-width: 860px) {
  .theme-menu { position: static; }
  .dropdown.theme-dropdown { position: fixed; top: 72px; right: 10px; left: auto; }
  .app-shell .topbar .user-menu { flex: 0 0 44px; width: 44px; max-width: 44px; }
  .app-shell .topbar .user-trigger { width: 44px; min-width: 44px; max-width: 44px; min-height: 44px; padding: 3px; gap: 0; }
  .app-shell .topbar .user-trigger :is(.user-copy, svg, i) { display: none; }
  .app-shell .topbar .user-trigger .avatar { flex: 0 0 36px; }
}
@media (max-width: 640px) {
  .app-shell .topbar { gap: 8px; }
  .app-shell .topbar .top-actions { gap: 6px; }
  .app-shell .topbar .my-apps-trigger { padding-inline: 8px !important; gap: 6px; }
  .app-shell .topbar .my-apps-trigger-icon { width: 20px; }
}
@media (max-width: 360px) {
  .app-shell .topbar { gap: 6px; }
  .app-shell .topbar .my-apps-trigger-icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-dropdown { animation: none; }
}
