/* AURA refinement: navigation, language control and portal chrome. */
.language-toggle,
.topbar-actions > .language-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  flex: 0 0 auto;
  width: 88px;
  min-width: 88px;
  height: 38px;
  padding: 3px;
  border: 1px solid rgba(196, 174, 255, .25);
  border-radius: 999px;
  background: rgba(20, 15, 35, .78);
  box-shadow: inset 0 1px rgba(255,255,255,.07);
}
.language-toggle button {
  width: 100%;
  height: 30px;
  border-radius: 999px;
  color: #b4abc6;
  background: transparent;
  font: 700 11px/1 "IBM Plex Mono", monospace;
  letter-spacing: .035em;
  transition: color .2s, background .2s, box-shadow .2s;
}
.language-toggle button.active {
  color: #fff;
  background: linear-gradient(135deg, #815cff, #5d3dbe);
  box-shadow: 0 2px 12px rgba(121, 80, 255, .34), inset 0 1px rgba(255,255,255,.2);
}
.language-toggle button:focus-visible {
  outline: 2px solid #d2c4ff;
  outline-offset: 2px;
}

.app-shell {
  min-width: 0;
  transition: grid-template-columns .3s cubic-bezier(.22,1,.36,1);
}
.app-shell .sidebar {
  min-width: 0;
  transition: width .3s cubic-bezier(.22,1,.36,1), transform .3s cubic-bezier(.22,1,.36,1);
}
.app-shell .sidebar-head { min-width: 0; }
.app-shell .collapse-button,
.app-shell.sidebar-compact .collapse-button {
  position: static !important;
  flex: 0 0 36px;
  width: 36px !important;
  height: 36px !important;
  margin-left: auto;
  border: 1px solid rgba(185,160,255,.3) !important;
  border-radius: 11px !important;
  background: rgba(137,97,236,.13) !important;
  box-shadow: none !important;
  transform: none !important;
}
.app-shell .collapse-button:hover { background: rgba(137,97,236,.28) !important; }
.app-shell .collapse-button:focus-visible { outline: 2px solid #c2acff; outline-offset: 2px; }
.app-shell.sidebar-compact { grid-template-columns: 92px minmax(0,1fr) !important; }
.app-shell.sidebar-compact .sidebar {
  width: 92px !important;
  min-width: 92px !important;
  max-width: 92px !important;
}
.app-shell.sidebar-compact .sidebar-head { gap: 8px; padding-inline: 12px !important; }
.app-shell.sidebar-compact .sidebar-head .brand-mark { min-width: 28px !important; width: 28px !important; }
.app-shell.sidebar-compact .collapse-button { width: 32px !important; height: 32px !important; flex-basis: 32px; }
.app-shell.sidebar-compact .sidebar-context { margin-inline: 10px !important; }
.app-shell.sidebar-compact .main-navigation { padding-inline: 8px !important; }
.app-shell.sidebar-compact .main-navigation button,
.app-shell.sidebar-compact .sidebar-system > button {
  width: 48px !important;
  min-width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  border-radius: 12px !important;
}
.app-shell .sidebar,
.app-shell .main-navigation { scrollbar-width: thin; scrollbar-color: rgba(164,133,230,.28) transparent; }
.app-shell .main-navigation button:focus-visible { outline: 2px solid #c2acff; outline-offset: -2px; }

.app-shell .topbar-actions { gap: 10px; min-width: 0; }
.app-shell .topbar-balance {
  min-width: 116px;
  min-height: 38px;
  padding: 5px 14px;
  border: 1px solid rgba(196,174,255,.18);
  border-radius: 13px;
  background: rgba(255,255,255,.045);
}
.app-shell .topbar-balance small { font-size: 10px; color: #a79cbd; }
.app-shell .topbar-balance b { font-size: 12px; color: #f4eefe; }
.app-shell .admin-entry {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(196,174,255,.22);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
}
.app-shell .user-menu {
  min-width: 0;
  min-height: 42px;
  padding: 4px 12px 4px 5px;
  border: 1px solid rgba(196,174,255,.22);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}
.app-shell .user-avatar { flex: 0 0 34px; border-radius: 10px; }
.app-shell .user-menu b { max-width: 126px; }
.app-shell .topbar-actions > * { box-shadow: none; }

/* Keep the restored creation workspace in the same AURA language. */
.aim-playground-studio .aim-studio-tabs {
  max-width: 100%;
  border-color: rgba(196,174,255,.25);
  border-radius: 15px;
  background: rgba(27,19,46,.84);
}
.aim-playground-studio .aim-studio-tab {
  flex: 0 0 auto;
  border-radius: 11px;
  font-weight: 650;
  color: #c2b6d6;
}
.aim-playground-studio .aim-studio-tab.active {
  background: linear-gradient(135deg,#c5b0ff,#9474f1);
  color: #170d2a;
}
.aim-playground-studio .aim-studio-card {
  border-color: rgba(196,174,255,.24);
  background: linear-gradient(150deg,#211932,#14101e);
}
.aim-playground-studio .aim-studio-icon,
.aim-playground-studio .aim-studio-dd-btn {
  border-color: rgba(196,174,255,.24);
  background: rgba(255,255,255,.055);
  color: #eee6ff;
}
.aim-playground-studio .aim-studio-send {
  background: linear-gradient(135deg,#c5b0ff,#9474f1);
  border-color: transparent;
  color: #170d2a;
}
.aim-playground-studio button:focus-visible {
  outline: 2px solid #d5c5ff;
  outline-offset: 2px;
}

@media (max-width: 1120px) and (min-width: 761px) {
  .app-shell .topbar { padding-inline: 18px; }
  .app-shell .topbar-actions { gap: 7px; }
  .app-shell .user-menu b { max-width: 92px; }
}
@media (max-width: 760px) {
  .app-shell, .app-shell.sidebar-compact { display: block !important; }
  .app-shell .sidebar, .app-shell.sidebar-compact .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(320px, calc(100vw - 32px)) !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100dvh !important;
    overflow: hidden !important;
    transform: translateX(-105%);
  }
  .app-shell .sidebar.mobile-open, .app-shell.sidebar-compact .sidebar.mobile-open { transform: translateX(0); }
  .app-shell.sidebar-compact .sidebar-head { padding-inline: 20px !important; }
  .app-shell.sidebar-compact .sidebar-head .brand-mark { min-width: 150px !important; width: auto !important; }
  .app-shell.sidebar-compact .sidebar-head .brand-mark strong,
  .app-shell.sidebar-compact .sidebar-context small,
  .app-shell.sidebar-compact .sidebar-context span,
  .app-shell.sidebar-compact .main-navigation button span,
  .app-shell.sidebar-compact .system-pulse span,
  .app-shell.sidebar-compact .sidebar-system > button span { display: initial !important; }
  .app-shell.sidebar-compact .main-navigation { padding-inline: 10px !important; }
  .app-shell.sidebar-compact .main-navigation button,
  .app-shell.sidebar-compact .sidebar-system > button { width: 100% !important; justify-content: flex-start !important; padding: 0 12px !important; }
  .app-shell .collapse-button { display: none !important; }
  .app-shell .topbar { gap: 8px; min-width: 0; padding: 0 14px; }
  .app-shell .topbar-trail { min-width: 0; }
  .app-shell .topbar-trail b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-shell .topbar-actions { gap: 6px; margin-left: auto; }
  .app-shell .topbar-actions > .language-toggle { width: 74px; min-width: 74px; height: 34px; padding: 2px; }
  .app-shell .language-toggle button { height: 28px; font-size: 10px; }
  .app-shell .topbar-balance { display: none; }
  .app-shell .admin-entry { width: 34px; height: 34px; flex-basis: 34px; }
  .app-shell .user-menu { min-height: 34px; padding: 2px; border-radius: 10px; }
  .app-shell .user-avatar { width: 28px; height: 28px; flex-basis: 28px; }
  .aim-playground-studio .aim-studio-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .aim-playground-studio .aim-studio-tabs::-webkit-scrollbar { display: none; }
  .aim-playground-studio .aim-studio-tab {
    min-height: 38px;
    padding-inline: 14px;
    font-size: 12px;
    scroll-snap-align: start;
  }
  .aim-playground-studio .aim-studio-title h1 { font-size: clamp(28px, 8vw, 36px); }
}
@media (max-width: 390px) {
  .app-shell .topbar-actions > .language-toggle { width: 68px; min-width: 68px; }
  .app-shell .admin-entry { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell, .app-shell .sidebar, .language-toggle button { transition-duration: .01ms !important; }
}
