@layer legacy {
@media (min-width: 821px) {
  .mobile-menu-button,
  .mobile-shell-header [data-action="mobile-menu"],
  .mobile-tabbar-ios [data-action="mobile-menu"] {
    display: none !important;
    pointer-events: none !important;
  }
}

/* AIOS final mobile/iOS layer. Loaded after every legacy stylesheet. */
.mobile-tabbar-ios {
  display: none;
}

/* TRUE EOF override - fix chat welcome layout and inline attachments v2. */
.app-shell.chat-shell .welcome-screen,
.app-shell.chat-shell .welcome-screen * {
  box-sizing: border-box !important;
}

.app-shell.chat-shell .welcome-screen {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  padding-inline: clamp(18px, 5vw, 42px) !important;
  text-align: center !important;
}

.app-shell.chat-shell .welcome-screen .ai-orb {
  flex: 0 0 auto !important;
  align-self: center !important;
  margin: 0 0 18px !important;
}

.app-shell.chat-shell .welcome-screen h1 {
  width: min(760px, 100%) !important;
  max-width: min(760px, 100%) !important;
  min-width: 0 !important;
  display: block !important;
  margin: 0 auto 14px !important;
  white-space: normal !important;
  text-align: center !important;
  text-wrap: balance !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  line-height: 0.98 !important;
}

.app-shell.chat-shell .welcome-screen p {
  width: min(560px, 100%) !important;
  max-width: min(560px, 100%) !important;
  margin: 0 auto !important;
  text-align: center !important;
  text-wrap: balance !important;
}

.app-shell.chat-shell .welcome-prompts {
  width: min(760px, 100%) !important;
  max-width: 100% !important;
  min-width: 0 !important;
  align-self: center !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin: clamp(48px, 10vh, 116px) auto 0 !important;
  padding: 0 !important;
  transform: none !important;
  overflow: visible !important;
}

.app-shell.chat-shell .suggestion-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 58px !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  text-align: left !important;
}

.app-shell.chat-shell .claude-composer {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) 48px auto !important;
  grid-template-rows: auto auto !important;
  align-items: end !important;
  row-gap: 6px !important;
}

.app-shell.chat-shell .claude-composer .attachment-tray {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.app-shell.chat-shell .claude-composer .attachment-tray.empty {
  display: none !important;
}

.app-shell.chat-shell .attachment-chip {
  flex: 0 1 min(100%, 560px) !important;
  width: auto !important;
  max-width: min(100%, 560px) !important;
  min-height: 52px !important;
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) 42px !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 7px 8px 7px 10px !important;
  border-radius: 999px !important;
  background: rgba(42, 43, 48, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
  box-shadow: none !important;
}

body[data-theme="light"] .app-shell.chat-shell .attachment-chip {
  background: rgba(245, 247, 252, 0.94) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}

.app-shell.chat-shell .attachment-chip > span,
.app-shell.chat-shell .attachment-chip > img {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 10px !important;
  display: grid !important;
  place-items: center !important;
  object-fit: cover !important;
  background: linear-gradient(135deg, #ef4444, #f97316) !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
}

.app-shell.chat-shell .attachment-chip strong {
  display: block !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  font-size: 16px !important;
  line-height: 1.1 !important;
  color: inherit !important;
}

.app-shell.chat-shell .attachment-chip small {
  display: none !important;
}

.app-shell.chat-shell .attachment-chip button {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  display: grid !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.94) !important;
}

.app-shell.chat-shell .claude-composer .composer-tools {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

.app-shell.chat-shell .claude-composer textarea {
  grid-column: 2 !important;
  grid-row: 2 !important;
}

.app-shell.chat-shell .claude-composer #aios-mic-button {
  grid-column: 3 !important;
  grid-row: 2 !important;
}

.app-shell.chat-shell .claude-composer #aios-send,
.app-shell.chat-shell .claude-composer .secondary[data-action="stop-aios-generation"] {
  grid-column: 4 !important;
  grid-row: 2 !important;
}

@media (max-width: 820px) {
  .app-shell.chat-shell .welcome-screen {
    padding-top: clamp(54px, 8vh, 82px) !important;
    padding-bottom: 0 !important;
  }

  .app-shell.chat-shell .welcome-screen h1 {
    width: min(350px, 100%) !important;
    max-width: min(350px, 100%) !important;
    font-size: clamp(38px, 10vw, 52px) !important;
    line-height: 1.02 !important;
  }

  .app-shell.chat-shell .welcome-screen p {
    width: min(330px, 100%) !important;
    font-size: 17px !important;
    line-height: 1.35 !important;
  }

  .app-shell.chat-shell .welcome-prompts {
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    margin-top: clamp(64px, 13vh, 140px) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0 2px 8px !important;
  }

  .app-shell.chat-shell .suggestion-card {
    flex: 0 0 min(78vw, 270px) !important;
    min-height: 66px !important;
    scroll-snap-align: start !important;
  }

  .app-shell.chat-shell .claude-composer {
    grid-template-columns: 44px minmax(0, 1fr) 42px 70px !important;
    padding: 10px !important;
    border-radius: 30px !important;
  }
}

/* Absolute EOF override - chat composer attachments and welcome layout v1. */
.app-shell.chat-shell .welcome-screen {
  min-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}

.app-shell.chat-shell .welcome-prompts {
  margin-top: clamp(44px, 10vh, 124px) !important;
  align-self: stretch !important;
}

.app-shell.chat-shell .claude-composer {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) 48px auto !important;
  grid-template-rows: auto auto !important;
  align-items: end !important;
  row-gap: 6px !important;
}

.app-shell.chat-shell .claude-composer .attachment-tray {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.app-shell.chat-shell .claude-composer .attachment-tray.empty {
  display: none !important;
}

.app-shell.chat-shell .attachment-chip {
  flex: 0 1 min(100%, 560px) !important;
  width: auto !important;
  max-width: min(100%, 560px) !important;
  min-height: 52px !important;
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) 42px !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 7px 8px 7px 10px !important;
  border-radius: 999px !important;
  background: rgba(42, 43, 48, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
  box-shadow: none !important;
}

body[data-theme="light"] .app-shell.chat-shell .attachment-chip {
  background: rgba(245, 247, 252, 0.94) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}

.app-shell.chat-shell .attachment-chip > span,
.app-shell.chat-shell .attachment-chip > img {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 10px !important;
  display: grid !important;
  place-items: center !important;
  object-fit: cover !important;
  background: linear-gradient(135deg, #ef4444, #f97316) !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
}

.app-shell.chat-shell .attachment-chip strong {
  display: block !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  font-size: 16px !important;
  line-height: 1.1 !important;
  color: inherit !important;
}

.app-shell.chat-shell .attachment-chip small {
  display: none !important;
}

.app-shell.chat-shell .attachment-chip button {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  display: grid !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.94) !important;
}

.app-shell.chat-shell .attachment-chip button svg {
  width: 20px !important;
  height: 20px !important;
}

.app-shell.chat-shell .claude-composer .composer-tools {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

.app-shell.chat-shell .claude-composer textarea {
  grid-column: 2 !important;
  grid-row: 2 !important;
}

.app-shell.chat-shell .claude-composer #aios-mic-button {
  grid-column: 3 !important;
  grid-row: 2 !important;
}

.app-shell.chat-shell .claude-composer #aios-send,
.app-shell.chat-shell .claude-composer .secondary[data-action="stop-aios-generation"] {
  grid-column: 4 !important;
  grid-row: 2 !important;
}

@media (max-width: 820px) {
  .app-shell.chat-shell .welcome-screen {
    justify-content: flex-start !important;
    padding-top: clamp(74px, 13vh, 132px) !important;
  }

  .app-shell.chat-shell .welcome-prompts {
    width: 100% !important;
    margin-top: clamp(92px, 18vh, 190px) !important;
    transform: translateY(14px) !important;
  }

  .app-shell.chat-shell .suggestion-card {
    min-height: 66px !important;
  }

  .app-shell.chat-shell .claude-composer {
    grid-template-columns: 44px minmax(0, 1fr) 42px 70px !important;
    padding: 10px !important;
    border-radius: 30px !important;
  }

  .app-shell.chat-shell .attachment-chip {
    min-height: 48px !important;
    max-width: 100% !important;
    grid-template-columns: 34px minmax(0, 1fr) 38px !important;
  }
}

/* AIOS chat final repair: full composer, visible tools menu, stable fullscreen. */
body:has(.app-shell.chat-shell) {
  overflow: hidden !important;
}

.app-shell.chat-shell .content:has(.aios-chat-app) {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.app-shell.chat-shell .aios-chat-app {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.app-shell.chat-shell .aios-chat-app.chat-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100dvw !important;
  max-width: 100dvw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  z-index: var(--z-modal) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: translate(
    calc(-1 * var(--aios-chat-fullscreen-left, 0px)),
    calc(-1 * var(--aios-chat-fullscreen-top, 0px))
  ) !important;
}

.app-shell.chat-shell:has(.aios-chat-app.chat-fullscreen),
.app-shell.chat-shell:has(.aios-chat-app.chat-fullscreen) .main,
.app-shell.chat-shell:has(.aios-chat-app.chat-fullscreen) .content,
.app-shell.chat-shell:has(.aios-chat-app.chat-fullscreen) .aios-chat-main {
  transform: none !important;
  translate: none !important;
  filter: none !important;
  perspective: none !important;
  contain: none !important;
}

.app-shell.chat-shell .aios-chat-main {
  min-width: 0 !important;
  min-height: 0 !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-main {
  width: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
}

.app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-messages {
  min-height: 0 !important;
  padding-inline: clamp(18px, 5vw, 84px) !important;
}

.app-shell.chat-shell .composer-wrap {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  isolation: isolate !important;
}

.app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap {
  padding: 12px clamp(18px, 4vw, 64px) calc(14px + env(safe-area-inset-bottom)) !important;
}

.app-shell.chat-shell .claude-composer {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr) 52px 84px !important;
  gap: 10px !important;
  overflow: visible !important;
  z-index: calc(var(--z-raised) + 1) !important;
}

.app-shell.chat-shell .claude-composer textarea {
  width: 100% !important;
  min-width: 0 !important;
  resize: none !important;
}

.app-shell.chat-shell .composer-tools {
  position: relative !important;
  overflow: visible !important;
  z-index: calc(var(--z-raised) + 6) !important;
}

.app-shell.chat-shell .composer-tools-popover {
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  bottom: calc(100% + 12px) !important;
  width: min(380px, calc(100vw - 40px)) !important;
  max-height: min(58dvh, 520px) !important;
  overflow: auto !important;
  display: grid !important;
  z-index: calc(var(--z-modal) + 3) !important;
  pointer-events: auto !important;
}

.app-shell.chat-shell .composer-tools-popover[hidden] {
  display: none !important;
}

.app-shell.chat-shell .tool-menu-action {
  min-height: 56px !important;
}

.app-shell.chat-shell .resource-mention-menu {
  z-index: calc(var(--z-modal) + 2) !important;
}

@media (max-width: 720px) {
  .app-shell.chat-shell .aios-chat-app,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen {
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-messages {
    padding-inline: 12px !important;
  }

  .app-shell.chat-shell .composer-wrap,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom)) !important;
  }

  .app-shell.chat-shell .claude-composer {
    width: 100% !important;
    max-width: none !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px 62px !important;
    gap: 7px !important;
    min-height: 58px !important;
    padding: 7px !important;
    border-radius: 24px !important;
    overflow: visible !important;
  }

  .app-shell.chat-shell .claude-composer .icon-button,
  .app-shell.chat-shell .claude-composer .primary,
  .app-shell.chat-shell .claude-composer .secondary {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  .app-shell.chat-shell .claude-composer .primary,
  .app-shell.chat-shell .claude-composer .secondary[data-action="stop-aios-generation"] {
    width: 62px !important;
    min-width: 62px !important;
  }

  .app-shell.chat-shell .composer-tools-popover {
    left: 0 !important;
    right: auto !important;
    bottom: calc(100% + 10px) !important;
    width: min(340px, calc(100vw - 24px)) !important;
    max-height: min(58dvh, 460px) !important;
  }
}
@media (max-width: 820px) {
  html.aios-mobile-menu-open,
  body.aios-mobile-menu-open {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
  }
}

/* Mobile chat absolute final lock: keep input above the iOS tabbar even when the textarea is focused. */
@media (max-width: 820px) {
  .app-shell.chat-shell {
    --aios-tabbar-height: 72px !important;
    --aios-chat-composer-reserve: 156px !important;
  }

  .app-shell.chat-shell .mobile-tabbar-ios,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .mobile-tabbar-ios {
    position: fixed !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: calc(7px + env(safe-area-inset-bottom)) !important;
    height: 62px !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    pointer-events: auto !important;
    z-index: calc(var(--z-top) + 2) !important;
  }

  .app-shell.chat-shell .composer-wrap,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(var(--aios-tabbar-height) + env(safe-area-inset-bottom) + 12px) !important;
    width: 100dvw !important;
    padding: 8px 12px !important;
    transform: none !important;
    z-index: var(--z-top) !important;
  }

  .app-shell.chat-shell .aios-chat-messages,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-messages {
    padding-bottom: calc(var(--aios-chat-composer-reserve) + var(--aios-tabbar-height) + env(safe-area-inset-bottom)) !important;
  }
}

/* True final mobile override: removes the old bottom tabbar lock and keeps chat usable like a modern mobile messenger. */
@media (max-width: 820px) {
  .app-shell.chat-shell {
    --aios-tabbar-height: 0px !important;
    --aios-chat-composer-reserve: 96px !important;
  }

  .app-shell.chat-shell .mobile-tabbar-ios,
  .app-shell.chat-shell .mobile-tabbar-ios::before,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .mobile-tabbar-ios {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    transform: translateY(140%) !important;
    pointer-events: none !important;
  }

  .app-shell.chat-shell .composer-wrap,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(env(safe-area-inset-bottom) + 9px) !important;
    width: 100dvw !important;
    padding: 0 16px !important;
    border: 0 !important;
    background: transparent !important;
    transform: none !important;
    pointer-events: none !important;
    z-index: var(--z-top) !important;
  }

  .app-shell.chat-shell .claude-composer,
  .app-shell.chat-shell .attachment-tray {
    pointer-events: auto !important;
  }

  .app-shell.chat-shell .aios-chat-messages,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-messages {
    padding-bottom: calc(102px + env(safe-area-inset-bottom)) !important;
    scroll-padding-bottom: calc(108px + env(safe-area-inset-bottom)) !important;
  }

  .app-shell.chat-shell .chat-selectors .safety-pill,
  .app-shell.chat-shell .chat-selectors:not(:has(#chat-provider)) .field:nth-of-type(n + 2),
  .app-shell.chat-shell .chat-selectors:has(#chat-provider) .field:nth-of-type(n + 4) {
    display: none !important;
  }

  .app-shell.chat-shell .chat-selectors {
    max-height: 38px !important;
    overflow: hidden !important;
  }

  .app-shell.chat-shell .composer-tools-popover,
  .app-shell.chat-shell .resource-mention-menu {
    position: fixed !important;
    right: 16px !important;
    bottom: calc(78px + env(safe-area-inset-bottom)) !important;
    left: 16px !important;
    z-index: calc(var(--z-top) + 1) !important;
    max-height: min(54dvh, 430px) !important;
  }
}

/* ChatGPT-inspired mobile rebuild. Keep this last: it replaces the older iOS tabbar layout on phones. */
@media (max-width: 820px) {
  html,
  body,
  #app {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
  }

  body:has(.app-shell.chat-shell) {
    overflow: hidden !important;
    background: #ffffff !important;
  }

  body[data-theme="dark"]:has(.app-shell.chat-shell) {
    background: #111111 !important;
  }

  .mobile-tabbar-ios,
  .mobile-tabbar-ios::before,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .mobile-tabbar-ios {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transform: translateY(120%) !important;
    pointer-events: none !important;
  }

  .app-shell.chat-shell {
    --aios-tabbar-height: 0px !important;
    --aios-chat-composer-reserve: 96px !important;
    display: block !important;
    width: 100dvw !important;
    max-width: 100dvw !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: #0f172a !important;
    background: #ffffff !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell {
    color: #f7f7f4 !important;
    background: #111111 !important;
  }

  .app-shell.chat-shell .mobile-shell-header,
  .app-shell.chat-shell > .sidebar,
  .app-shell.chat-shell .sidebar-footer,
  .app-shell.chat-shell .safety-bar,
  .app-shell.chat-shell .chat-actions,
  .app-shell.chat-shell .ai-orb {
    display: none !important;
  }

  .app-shell.chat-shell .main,
  .app-shell.chat-shell .content {
    width: 100dvw !important;
    max-width: 100dvw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    transform: none !important;
  }

  .app-shell.chat-shell .aios-chat-app,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen {
    position: relative !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 1fr !important;
    width: 100dvw !important;
    max-width: 100dvw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    background: #ffffff !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-app,
  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-app.chat-fullscreen {
    background: #111111 !important;
  }

  .app-shell.chat-shell .aios-chat-main {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    width: 100dvw !important;
    min-width: 0 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    background: #ffffff !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-main {
    background: #111111 !important;
  }

  .app-shell.chat-shell .aios-chat-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: calc(var(--z-shell) + 10) !important;
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr) 56px !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 0 !important;
    padding: calc(env(safe-area-inset-top) + 10px) 18px 8px !important;
    overflow: visible !important;
    border: 0 !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: none !important;
    backdrop-filter: blur(18px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-topbar {
    background: rgba(17, 17, 17, 0.92) !important;
  }

  .app-shell.chat-shell .aios-chat-topbar > .chat-sidebar-toggle,
  .app-shell.chat-shell .chat-mobile-new {
    display: grid !important;
    place-items: center !important;
    width: 50px !important;
    min-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #111827 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08) !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-topbar > .chat-sidebar-toggle,
  body[data-theme="dark"] .app-shell.chat-shell .chat-mobile-new {
    color: #f8fafc !important;
    background: #1d1d1f !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28) !important;
  }

  .app-shell.chat-shell .chat-mobile-title {
    display: inline-flex !important;
    justify-self: center !important;
    align-items: center !important;
    gap: 7px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 50px !important;
    padding: 0 18px !important;
    color: #111827 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.86) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07) !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .chat-mobile-title {
    color: #f8fafc !important;
    background: rgba(29, 29, 31, 0.92) !important;
  }

  .app-shell.chat-shell .chat-mobile-title strong {
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 18px !important;
    font-weight: 760 !important;
    letter-spacing: 0 !important;
  }

  .app-shell.chat-shell .chat-mobile-title span {
    display: block !important;
    max-width: 92px !important;
    overflow: hidden !important;
    color: #737373 !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .chat-mobile-title span {
    color: #a3a3a3 !important;
  }

  .app-shell.chat-shell .chat-mobile-exit {
    display: none !important;
  }

  .app-shell.chat-shell .chat-selectors {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
  }

  .app-shell.chat-shell .chat-selectors::-webkit-scrollbar {
    display: none !important;
  }

  .app-shell.chat-shell .chat-selectors .safety-pill,
  .app-shell.chat-shell .chat-selectors:not(:has(#chat-provider)) .field:nth-of-type(n + 2),
  .app-shell.chat-shell .chat-selectors:has(#chat-provider) .field:nth-of-type(n + 4) {
    display: none !important;
  }

  .app-shell.chat-shell .chat-selectors .field,
  .app-shell.chat-shell .chat-selectors .model-pill {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 38px !important;
    margin: 0 !important;
  }

  .app-shell.chat-shell .chat-selectors .field label,
  .app-shell.chat-shell .chat-selectors .model-pill span {
    display: none !important;
  }

  .app-shell.chat-shell .chat-selectors select,
  .app-shell.chat-shell .chat-selectors .model-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 88px !important;
    max-width: 170px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 28px 0 13px !important;
    color: #171717 !important;
    font-size: 14px !important;
    font-weight: 720 !important;
    line-height: 1 !important;
    border: 1px solid rgba(17, 24, 39, 0.1) !important;
    border-radius: 999px !important;
    background: rgba(246, 246, 247, 0.96) !important;
    box-shadow: none !important;
  }

  .app-shell.chat-shell .chat-selectors .model-pill {
    padding: 0 13px !important;
  }

  .app-shell.chat-shell .chat-selectors .model-pill strong {
    max-width: 132px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .chat-selectors select,
  body[data-theme="dark"] .app-shell.chat-shell .chat-selectors .model-pill {
    color: #f5f5f5 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: #1f1f21 !important;
  }

  .app-shell.chat-shell .aios-chat-messages,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-messages {
    display: grid !important;
    align-content: start !important;
    gap: 18px !important;
    min-height: 0 !important;
    width: 100% !important;
    padding: 14px 18px calc(102px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    scroll-padding-bottom: calc(108px + env(safe-area-inset-bottom)) !important;
    -webkit-overflow-scrolling: touch !important;
    background: #ffffff !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-messages,
  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-messages {
    background: #111111 !important;
  }

  .app-shell.chat-shell .welcome-screen {
    width: 100% !important;
    max-width: 100% !important;
    min-height: calc(100dvh - 250px) !important;
    margin: 0 !important;
    padding: 22dvh 0 18px !important;
    display: grid !important;
    align-content: end !important;
    justify-items: stretch !important;
    gap: 14px !important;
    text-align: left !important;
  }

  .app-shell.chat-shell .welcome-screen h1 {
    max-width: 12ch !important;
    margin: 0 auto !important;
    color: #111827 !important;
    text-align: center !important;
    font-size: clamp(32px, 10vw, 46px) !important;
    line-height: 1.04 !important;
    letter-spacing: 0 !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .welcome-screen h1 {
    color: #f8fafc !important;
  }

  .app-shell.chat-shell .welcome-screen p {
    max-width: 32ch !important;
    margin: 0 auto 8px !important;
    color: #737373 !important;
    text-align: center !important;
    font-size: 15px !important;
    line-height: 1.45 !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .welcome-screen p {
    color: #a3a3a3 !important;
  }

  .app-shell.chat-shell .welcome-prompts {
    display: flex !important;
    gap: 12px !important;
    width: calc(100% + 36px) !important;
    margin: 12px -18px 0 !important;
    padding: 0 18px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity !important;
    scrollbar-width: none !important;
  }

  .app-shell.chat-shell .welcome-prompts::-webkit-scrollbar {
    display: none !important;
  }

  .app-shell.chat-shell .suggestion-card {
    flex: 0 0 min(72vw, 260px) !important;
    min-height: 74px !important;
    padding: 16px 17px !important;
    color: #111827 !important;
    font-size: 16px !important;
    font-weight: 720 !important;
    line-height: 1.2 !important;
    text-align: left !important;
    border: 1px solid rgba(17, 24, 39, 0.06) !important;
    border-radius: 20px !important;
    background: #f6f6f4 !important;
    box-shadow: none !important;
    scroll-snap-align: start !important;
    transform: none !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .suggestion-card {
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    background: #1d1d1f !important;
  }

  .app-shell.chat-shell .chat-message,
  .app-shell.chat-shell .chat-message.user {
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    animation: mobileChatRise 180ms ease both !important;
  }

  .app-shell.chat-shell .chat-message .message-avatar {
    display: none !important;
  }

  .app-shell.chat-shell .chat-message .message-body {
    max-width: min(100%, 88vw) !important;
    padding: 12px 14px !important;
    color: #111827 !important;
    border: 0 !important;
    border-radius: 19px !important;
    background: #f2f2f0 !important;
    box-shadow: none !important;
  }

  .app-shell.chat-shell .chat-message.ai .message-body {
    justify-self: start !important;
    border-top-left-radius: 7px !important;
  }

  .app-shell.chat-shell .chat-message.user .message-body {
    justify-self: end !important;
    color: #ffffff !important;
    border-top-right-radius: 7px !important;
    background: #1877f2 !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .chat-message .message-body {
    color: #f5f5f5 !important;
    background: #242426 !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .chat-message.user .message-body {
    color: #ffffff !important;
    background: #0a84ff !important;
  }

  .app-shell.chat-shell .message-text {
    color: inherit !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
  }

  .app-shell.chat-shell .message-tools {
    opacity: 1 !important;
  }

  .app-shell.chat-shell .composer-wrap,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap {
    position: fixed !important;
    right: 0 !important;
    bottom: calc(env(safe-area-inset-bottom) + 9px) !important;
    left: 0 !important;
    z-index: calc(var(--z-shell) + 14) !important;
    width: 100dvw !important;
    padding: 0 16px !important;
    border: 0 !important;
    background: transparent !important;
    transform: none !important;
    pointer-events: none !important;
  }

  .app-shell.chat-shell .claude-composer {
    pointer-events: auto !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px 52px !important;
    align-items: end !important;
    gap: 7px !important;
    width: 100% !important;
    min-height: 58px !important;
    max-height: 150px !important;
    padding: 7px !important;
    overflow: visible !important;
    border: 1px solid rgba(17, 24, 39, 0.08) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.14) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .claude-composer {
    border-color: rgba(255, 255, 255, 0.08) !important;
    background: #1d1d1f !important;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42) !important;
  }

  .app-shell.chat-shell .claude-composer .icon-button,
  .app-shell.chat-shell .claude-composer .primary,
  .app-shell.chat-shell .claude-composer .secondary {
    display: grid !important;
    place-items: center !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    color: #111827 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .claude-composer .icon-button,
  body[data-theme="dark"] .app-shell.chat-shell .claude-composer .secondary {
    color: #f8fafc !important;
  }

  .app-shell.chat-shell .claude-composer .primary,
  .app-shell.chat-shell .claude-composer .secondary[data-action="stop-aios-generation"] {
    width: 52px !important;
    min-width: 52px !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    background: #ff6a21 !important;
  }

  .app-shell.chat-shell .claude-composer .primary:disabled {
    opacity: 0.72 !important;
    background: #ff8a4d !important;
  }

  .app-shell.chat-shell .claude-composer textarea {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    max-height: 114px !important;
    padding: 11px 0 !important;
    color: #111827 !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
    border: 0 !important;
    resize: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .app-shell.chat-shell .claude-composer textarea::placeholder {
    color: #8a8a8e !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .claude-composer textarea {
    color: #f5f5f5 !important;
  }

  .app-shell.chat-shell .attachment-tray {
    pointer-events: auto !important;
    margin: 8px 0 0 !important;
    max-height: 86px !important;
    overflow: auto !important;
  }

  .app-shell.chat-shell .composer-tools-popover,
  .app-shell.chat-shell .resource-mention-menu {
    position: fixed !important;
    right: 16px !important;
    bottom: calc(78px + env(safe-area-inset-bottom)) !important;
    left: 16px !important;
    z-index: calc(var(--z-drawer) + 4) !important;
    width: auto !important;
    max-height: min(54dvh, 430px) !important;
    padding: 12px !important;
    overflow: auto !important;
    color: #111827 !important;
    border: 1px solid rgba(17, 24, 39, 0.1) !important;
    border-radius: 24px !important;
    background: #ffffff !important;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18) !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .composer-tools-popover,
  body[data-theme="dark"] .app-shell.chat-shell .resource-mention-menu {
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: #1d1d1f !important;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5) !important;
  }

  .app-shell.chat-shell .tool-menu-action {
    min-height: 54px !important;
    color: inherit !important;
    border-color: rgba(17, 24, 39, 0.08) !important;
    border-radius: 18px !important;
    background: #f7f7f5 !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .tool-menu-action {
    border-color: rgba(255, 255, 255, 0.08) !important;
    background: #2a2a2c !important;
  }

  .app-shell.chat-shell .tool-menu-action span {
    color: inherit !important;
    background: rgba(17, 24, 39, 0.06) !important;
  }

  .app-shell.chat-shell .tool-menu-action small {
    color: #737373 !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .tool-menu-action small {
    color: #a3a3a3 !important;
  }

  .app-shell.chat-shell .chat-sidebar-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: calc(var(--z-drawer) + 1) !important;
    display: block !important;
    width: 100dvw !important;
    height: 100dvh !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(0, 0, 0, 0.06) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: opacity 180ms ease, visibility 180ms ease !important;
  }

  .app-shell.chat-shell .aios-chat-app:not(.sidebar-collapsed) .chat-sidebar-backdrop {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .app-shell.chat-shell .aios-chat-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: calc(var(--z-drawer) + 5) !important;
    display: grid !important;
    grid-template-rows: auto auto auto minmax(0, 1fr) !important;
    gap: 14px !important;
    width: min(92vw, 420px) !important;
    max-width: min(92vw, 420px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: calc(env(safe-area-inset-top) + 28px) 26px calc(env(safe-area-inset-bottom) + 24px) !important;
    overflow: hidden !important;
    color: #111827 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: 18px 0 46px rgba(15, 23, 42, 0.08) !important;
    transform: translateX(-104%) !important;
    opacity: 1 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 240ms ease !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-sidebar {
    color: #f8fafc !important;
    background: #111111 !important;
    box-shadow: 18px 0 46px rgba(0, 0, 0, 0.36) !important;
  }

  .app-shell.chat-shell .aios-chat-app:not(.sidebar-collapsed) .aios-chat-sidebar {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .app-shell.chat-shell .chat-sidebar-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 50px !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .app-shell.chat-shell .chat-sidebar-head .brand-lockup {
    display: flex !important;
    min-width: 0 !important;
    color: inherit !important;
    font-size: 28px !important;
    font-weight: 760 !important;
    letter-spacing: 0 !important;
  }

  .app-shell.chat-shell .chat-sidebar-head .brand-mark {
    display: none !important;
  }

  .app-shell.chat-shell .chat-sidebar-head .chat-sidebar-toggle {
    display: grid !important;
    place-items: center !important;
    width: 50px !important;
    min-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    color: inherit !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #f7f7f5 !important;
    box-shadow: none !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .chat-sidebar-head .chat-sidebar-toggle {
    background: #1f1f21 !important;
  }

  .app-shell.chat-shell .aios-chat-sidebar .full-button {
    justify-self: end !important;
    width: auto !important;
    min-height: 48px !important;
    padding: 0 19px !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #ff6a21 !important;
    box-shadow: 0 12px 30px rgba(255, 106, 33, 0.24) !important;
  }

  .app-shell.chat-shell .aios-chat-sidebar .chat-search,
  .app-shell.chat-shell .aios-chat-sidebar .field select {
    width: 100% !important;
    min-height: 48px !important;
    color: #111827 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #f7f7f5 !important;
    box-shadow: none !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-sidebar .chat-search,
  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-sidebar .field select {
    color: #f8fafc !important;
    background: #1f1f21 !important;
  }

  .app-shell.chat-shell .aios-chat-sidebar .field label {
    display: none !important;
  }

  .app-shell.chat-shell .conversation-groups {
    min-height: 0 !important;
    display: block !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 8px 0 86px !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .app-shell.chat-shell .conversation-group {
    margin: 26px 0 0 !important;
  }

  .app-shell.chat-shell .conversation-group:first-child {
    margin-top: 14px !important;
  }

  .app-shell.chat-shell .conversation-group h4 {
    margin: 0 0 14px !important;
    color: #111827 !important;
    font-size: 22px !important;
    font-weight: 760 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .conversation-group h4 {
    color: #f8fafc !important;
  }

  .app-shell.chat-shell .conversation-item {
    position: relative !important;
    display: grid !important;
    min-height: 48px !important;
    padding: 9px 48px 9px 0 !important;
    color: inherit !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .app-shell.chat-shell .conversation-item.active {
    color: #0a84ff !important;
    background: transparent !important;
  }

  .app-shell.chat-shell .conversation-main {
    min-width: 0 !important;
    gap: 2px !important;
  }

  .app-shell.chat-shell .conversation-main strong {
    color: inherit !important;
    font-size: 18px !important;
    font-weight: 520 !important;
    letter-spacing: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-shell.chat-shell .conversation-main span,
  .app-shell.chat-shell .conversation-meta {
    display: none !important;
  }

  /* Keep a visible, tappable Delete button per conversation on mobile.
     The other row actions stay hidden to avoid clutter on the narrow list. */
  .app-shell.chat-shell .conversation-actions {
    display: flex !important;
    position: absolute !important;
    top: 50% !important;
    right: 2px !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    background: none !important;
    z-index: calc(var(--z-raised) + 1) !important;
  }

  .app-shell.chat-shell .conversation-actions .icon-button:not([data-action^="delete-chat"]) {
    display: none !important;
  }

  .app-shell.chat-shell .conversation-actions .icon-button[data-action^="delete-chat"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 12px !important;
    color: #ff5a5a !important;
    background: rgba(255, 78, 78, 0.12) !important;
    border: 1px solid rgba(255, 78, 78, 0.26) !important;
  }

  .app-shell.chat-shell .conversation-actions .icon-button[data-action^="delete-chat"] .icon-symbol {
    width: 18px !important;
    height: 18px !important;
    font-size: 15px !important;
  }
}

@media (max-width: 420px) {
  .app-shell.chat-shell .aios-chat-topbar {
    grid-template-columns: 50px minmax(0, 1fr) 50px !important;
    padding-inline: 14px !important;
  }

  .app-shell.chat-shell .chat-mobile-title {
    padding-inline: 15px !important;
  }

  .app-shell.chat-shell .chat-mobile-title span {
    display: none !important;
  }

  .app-shell.chat-shell .welcome-screen {
    padding-top: 18dvh !important;
  }

  .app-shell.chat-shell .composer-wrap,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .composer-wrap {
    padding-inline: 12px !important;
  }

  .app-shell.chat-shell .claude-composer {
    grid-template-columns: 42px minmax(0, 1fr) 42px 50px !important;
    gap: 5px !important;
  }
}

@keyframes mobileChatRise {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile chat final lock: the composer must never sit under the iOS tabbar. */
@media (max-width: 820px) {
  .app-shell.chat-shell {
    --aios-tabbar-height: 72px !important;
    --aios-chat-composer-reserve: 156px !important;
  }

  .app-shell.chat-shell .mobile-tabbar-ios,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .mobile-tabbar-ios {
    position: fixed !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: calc(7px + env(safe-area-inset-bottom)) !important;
    height: 62px !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    pointer-events: auto !important;
    z-index: calc(var(--z-top) + 2) !important;
  }

  .app-shell.chat-shell .composer-wrap,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(var(--aios-tabbar-height) + env(safe-area-inset-bottom) + 12px) !important;
    width: 100dvw !important;
    padding: 8px 12px !important;
    transform: none !important;
    z-index: var(--z-top) !important;
  }

  .app-shell.chat-shell .aios-chat-messages,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-messages {
    padding-bottom: calc(var(--aios-chat-composer-reserve) + var(--aios-tabbar-height) + env(safe-area-inset-bottom)) !important;
  }
}


.chat-sidebar-backdrop {
  display: none;
}

.student-twin-panel {
  position: relative;
  overflow: hidden;
}

.student-twin-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 122, 255, 0.16), transparent 32%),
    radial-gradient(circle at 90% 20%, rgba(52, 199, 89, 0.12), transparent 28%);
}

.student-twin-panel > * {
  position: relative;
  z-index: var(--z-raised);
}

.twin-grid,
.twin-columns,
.twin-levels {
  display: grid;
  gap: 10px;
}

.twin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.twin-cell {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--apple-separator, rgba(60, 60, 67, 0.16));
  border-radius: 16px;
  background: var(--apple-fill, rgba(120, 120, 128, 0.12));
}

.twin-cell span,
.twin-list,
.twin-columns h4 {
  color: var(--apple-secondary, #6e6e73);
}

.twin-cell strong {
  color: var(--apple-ink, #1d1d1f);
  font-size: 15px;
  line-height: 1.18;
}

.twin-columns {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.twin-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.twin-levels {
  margin-top: 12px;
}

.twin-levels > span {
  display: grid;
  grid-template-columns: minmax(96px, 0.32fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

@media (max-width: 720px) {
  .twin-grid,
  .twin-columns {
    grid-template-columns: 1fr;
  }

  .twin-cell {
    min-height: auto;
  }

  .twin-levels > span {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  :root {
    --aios-tabbar-height: 76px;
    --aios-mobile-glass: rgba(255, 255, 255, 0.72);
    --aios-mobile-glass-strong: rgba(255, 255, 255, 0.9);
    --aios-mobile-ink: #101014;
    --aios-mobile-muted: rgba(60, 60, 67, 0.72);
  }

  body[data-theme="dark"] {
    --aios-mobile-glass: rgba(28, 28, 30, 0.72);
    --aios-mobile-glass-strong: rgba(38, 38, 42, 0.9);
    --aios-mobile-ink: #f5f5f7;
    --aios-mobile-muted: rgba(235, 235, 245, 0.68);
  }

  html,
  body {
    overflow-x: clip !important;
  }

  .public-nav {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
    padding: 8px !important;
    border-radius: 22px !important;
  }

  .public-nav nav {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-columns: unset !important;
    gap: 8px !important;
    overflow: visible !important;
    padding: 2px !important;
    scroll-snap-type: none !important;
  }

  .public-nav-item,
  .public-hero-actions > button,
  .public-contact-actions > button,
  .subscription-card button,
  .section-head button {
    min-height: 44px !important;
    height: auto !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }

  .public-nav-item {
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px 8px !important;
    writing-mode: horizontal-tb !important;
  }

  .public-brand .brand-mark.aios-logo-mark,
  .public-brand .aios-logo-svg,
  .entity-core .brand-mark.aios-logo-mark,
  .entity-core .aios-logo-svg {
    max-width: min(220px, 58vw) !important;
  }

  .aios-public-entity .entity-core {
    width: min(210px, 52vw) !important;
    height: min(210px, 52vw) !important;
  }

  .aios-public-entity .entity-core .brand-mark.aios-logo-mark {
    width: min(132px, 34vw) !important;
    height: min(132px, 34vw) !important;
    transform: none !important;
  }

  .aios-public-entity .entity-core .aios-logo-svg,
  .aios-public-entity .entity-core .aios-logo-icon {
    width: min(132px, 34vw) !important;
    height: min(132px, 34vw) !important;
  }

  .mobile-shell-header {
    position: sticky !important;
    top: 0 !important;
    z-index: calc(var(--z-shell) + 4) !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: calc(58px + env(safe-area-inset-top)) !important;
    margin: 0 !important;
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px !important;
    border: 0 !important;
    border-radius: 0 0 22px 22px !important;
    background:
      linear-gradient(180deg, var(--aios-mobile-glass-strong), var(--aios-mobile-glass)),
      rgba(255, 255, 255, 0.58) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  }

  body[data-theme="dark"] .mobile-shell-header {
    background:
      linear-gradient(180deg, rgba(30, 30, 34, 0.94), rgba(20, 20, 24, 0.72)),
      rgba(14, 14, 18, 0.7) !important;
  }

  .mobile-shell-brand {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) !important;
    gap: 9px !important;
    min-height: 44px !important;
    max-width: 100% !important;
    color: var(--aios-mobile-ink) !important;
  }

  .mobile-shell-brand .brand-mark.aios-logo-mark,
  .mobile-shell-brand .aios-logo-svg,
  .mobile-shell-brand .aios-logo-icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 14px !important;
  }

  .mobile-shell-brand > span,
  .mobile-shell-brand strong,
  .mobile-shell-brand small {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .mobile-shell-brand small {
    display: block !important;
    color: var(--aios-mobile-muted) !important;
  }

  .mobile-shell-actions {
    display: none !important;
  }

  .app-shell {
    padding-bottom: calc(var(--aios-tabbar-height) + env(safe-area-inset-bottom)) !important;
  }

  .mobile-tabbar-ios {
    position: fixed !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    z-index: calc(var(--z-shell) + 10) !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    min-height: var(--aios-tabbar-height) !important;
    padding: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.34) !important;
    border-radius: 26px !important;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.52)),
      rgba(255, 255, 255, 0.58) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.74),
      0 22px 62px rgba(15, 23, 42, 0.2) !important;
    backdrop-filter: blur(34px) saturate(210%) !important;
    -webkit-backdrop-filter: blur(34px) saturate(210%) !important;
    animation: aiosTabbarRise 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  body[data-theme="dark"] .mobile-tabbar-ios {
    border-color: rgba(255, 255, 255, 0.14) !important;
    background:
      linear-gradient(180deg, rgba(44, 44, 48, 0.82), rgba(24, 24, 28, 0.58)),
      rgba(12, 12, 16, 0.62) !important;
  }

  .mobile-tabbar-ios::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 0 34%, rgba(255, 255, 255, 0.36) 48%, transparent 62% 100%);
    background-size: 220% 220%;
    opacity: 0.45;
    animation: aiosMobileGlassSweep 5.8s ease-in-out infinite alternate;
  }

  .mobile-tabbar-item {
    position: relative;
    z-index: var(--z-raised);
    display: grid !important;
    place-items: center !important;
    align-content: center !important;
    gap: 3px !important;
    min-width: 0 !important;
    min-height: 58px !important;
    padding: 6px 4px !important;
    border: 0 !important;
    border-radius: 20px !important;
    color: var(--aios-mobile-muted) !important;
    background: transparent !important;
  }

  .mobile-tabbar-item.active {
    color: #fff !important;
    background:
      radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.42), transparent 52%),
      linear-gradient(135deg, #007aff, #5e5ce6) !important;
    transform: translateY(-2px);
  }

  .mobile-tabbar-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 22px;
    font-size: 18px;
    line-height: 1;
  }

  .mobile-tabbar-item small {
    max-width: 100%;
    overflow: hidden;
    color: currentColor;
    font-size: 10px;
    font-weight: 860;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-shell:not(.chat-shell) .content {
    padding-bottom: calc(var(--aios-tabbar-height) + 22px + env(safe-area-inset-bottom)) !important;
  }

  .app-shell.chat-shell .composer-wrap {
    bottom: calc(var(--aios-tabbar-height) + env(safe-area-inset-bottom)) !important;
  }

  .app-shell.chat-shell .aios-chat-messages {
    padding-bottom: calc(112px + var(--aios-tabbar-height)) !important;
  }

  .app-shell.chat-shell .aios-chat-topbar > .icon-button,
  .app-shell.chat-shell .chat-mobile-exit,
  .app-shell.chat-shell .claude-composer .icon-button,
  .app-shell.chat-shell .claude-composer .primary,
  .app-shell.chat-shell .claude-composer .secondary {
    width: auto !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  .app-shell.chat-shell .chat-selectors {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  .app-shell.chat-shell .chat-selectors .field,
  .app-shell.chat-shell .chat-selectors select,
  .app-shell.chat-shell .chat-selectors .model-pill {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  .app-shell.chat-shell .suggestion-card,
  .app-shell.chat-shell .claude-composer textarea {
    min-height: 44px !important;
    height: auto !important;
  }

  .toast-close {
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
  }
}

@media (max-width: 420px) {
  .app-shell.chat-shell .chat-selectors {
    grid-template-columns: 1fr !important;
  }

  .public-nav-item {
    font-size: 12px !important;
  }
}

@keyframes aiosTabbarRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes aiosSheetLift {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes aiosMobileGlassSweep {
  from {
    background-position: 0% 40%;
  }

  to {
    background-position: 100% 60%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-tabbar-ios,
  .mobile-tabbar-ios::before,
  .mobile-tabbar-item {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

.compact-mobile-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.account-avatar {
  color: #ffffff !important;
}

.account-avatar .account-avatar-icon {
  width: 100% !important;
  height: 100% !important;
  display: grid !important;
  place-items: center !important;
  font-size: 0 !important;
}

.account-avatar .account-avatar-icon svg {
  width: 23px !important;
  height: 23px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.account-avatar.large .account-avatar-icon svg {
  width: 32px !important;
  height: 32px !important;
}

@media (max-width: 820px) {

  .mobile-shell-brand,
  .sidebar > .brand-lockup {
    align-items: center !important;
    min-height: 44px !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .mobile-shell-brand .brand-mark.aios-logo-mark,
  .sidebar > .brand-lockup .brand-mark.aios-logo-mark {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    flex: 0 0 46px !important;
  }

  .mobile-shell-brand .aios-logo-icon,
  .sidebar > .brand-lockup .aios-logo-icon {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
  }

  .mobile-shell-brand .aios-logo-text,
  .sidebar > .brand-lockup .aios-logo-text {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .mobile-shell-brand .aios-logo-text strong,
  .sidebar > .brand-lockup .aios-logo-text strong {
    font-size: 18px !important;
    line-height: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .mobile-shell-brand .aios-logo-text small,
  .sidebar > .brand-lockup .aios-logo-text small {
    display: none !important;
  }

  .compact-mobile-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Final mobile chat navigation repair. Keeps the composer tappable above the iOS tabbar. */
@media (max-width: 820px) {
  .app-shell.chat-shell {
    --aios-tabbar-height: 62px;
    --aios-chat-composer-reserve: 116px;
    padding-bottom: 0 !important;
  }

  .app-shell.chat-shell .mobile-tabbar-ios {
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: max(7px, env(safe-area-inset-bottom)) !important;
    left: max(12px, env(safe-area-inset-left)) !important;
    z-index: calc(var(--z-shell) + 9) !important;
    min-height: var(--aios-tabbar-height) !important;
    max-height: var(--aios-tabbar-height) !important;
    gap: 4px !important;
    padding: 6px !important;
    border-radius: 24px !important;
    transition:
      opacity 180ms ease,
      transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
      filter 180ms ease !important;
  }

  .app-shell.chat-shell .mobile-tabbar-item {
    min-height: 48px !important;
    height: 48px !important;
    padding: 5px 2px !important;
    border-radius: 18px !important;
    transform: none !important;
  }

  .app-shell.chat-shell .mobile-tabbar-item.active {
    transform: none !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.44),
      0 10px 26px rgba(0, 122, 255, 0.24) !important;
  }

  .mobile-tabbar-icon svg {
    width: 21px !important;
    height: 21px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.9 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }

  .app-shell.chat-shell .mobile-tabbar-item small {
    font-size: 9px !important;
    letter-spacing: 0 !important;
  }

  .app-shell.chat-shell .aios-chat-main {
    min-height: 100dvh !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .app-shell.chat-shell .content,
  .app-shell.chat-shell .aios-chat-app {
    contain: none !important;
    transform: none !important;
  }

  .app-shell.chat-shell .chat-sidebar-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: var(--z-drawer) !important;
    display: block !important;
    width: 100vw !important;
    height: 100dvh !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    background: rgba(3, 7, 18, 0.42) !important;
    backdrop-filter: blur(8px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(130%) !important;
    transition: opacity 180ms ease !important;
  }

  .app-shell.chat-shell .aios-chat-app:not(.sidebar-collapsed) .chat-sidebar-backdrop {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .app-shell.chat-shell .aios-chat-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: calc(var(--z-drawer) + 3) !important;
    display: grid !important;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) !important;
    gap: 11px !important;
    width: min(88vw, 356px) !important;
    max-width: calc(100vw - 20px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: calc(12px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-left: 0 !important;
    border-radius: 0 26px 26px 0 !important;
    background:
      linear-gradient(180deg, rgba(18, 26, 43, 0.98), rgba(8, 13, 24, 0.96)),
      rgba(8, 13, 24, 0.94) !important;
    box-shadow: 28px 0 70px rgba(0, 0, 0, 0.48) !important;
    transform: translateX(calc(-100% - 18px)) !important;
    opacity: 0.98 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition:
      transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
      opacity 180ms ease !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  }

  body[data-theme="light"] .app-shell.chat-shell .aios-chat-sidebar {
    border-color: rgba(9, 46, 170, 0.14) !important;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 255, 0.94)),
      rgba(255, 255, 255, 0.94) !important;
    box-shadow: 28px 0 70px rgba(25, 58, 120, 0.22) !important;
  }

  .app-shell.chat-shell .aios-chat-app:not(.sidebar-collapsed) .aios-chat-sidebar {
    transform: translateX(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .app-shell.chat-shell .chat-sidebar-head {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .app-shell.chat-shell .chat-sidebar-head .brand-lockup {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .app-shell.chat-shell .chat-sidebar-head .chat-sidebar-toggle,
  .app-shell.chat-shell .aios-chat-sidebar .full-button,
  .app-shell.chat-shell .aios-chat-sidebar .chat-search,
  .app-shell.chat-shell .aios-chat-sidebar .field select {
    min-height: 44px !important;
  }

  .app-shell.chat-shell .conversation-groups {
    min-height: 0 !important;
    height: auto !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 2px 2px 12px !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .app-shell.chat-shell .conversation-item {
    min-height: 74px !important;
    padding: 12px !important;
    border-radius: 18px !important;
  }

  .app-shell.chat-shell .conversation-main,
  .app-shell.chat-shell .conversation-main strong,
  .app-shell.chat-shell .conversation-main span,
  .app-shell.chat-shell .conversation-meta {
    min-width: 0 !important;
  }

  .app-shell.chat-shell .conversation-main strong,
  .app-shell.chat-shell .conversation-main span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-shell.chat-shell .aios-chat-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: calc(var(--z-shell) + 11) !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    align-items: center !important;
    gap: 7px !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    padding: calc(7px + env(safe-area-inset-top)) 8px 7px !important;
    overflow: visible !important;
    border-bottom: 1px solid rgba(120, 150, 210, 0.16) !important;
    background:
      linear-gradient(180deg, rgba(6, 10, 20, 0.96), rgba(8, 14, 27, 0.9)),
      rgba(8, 12, 22, 0.82) !important;
    backdrop-filter: blur(24px) saturate(170%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(170%) !important;
  }

  body[data-theme="light"] .app-shell.chat-shell .aios-chat-topbar {
    border-bottom-color: rgba(9, 46, 170, 0.12) !important;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.94)),
      rgba(255, 255, 255, 0.86) !important;
  }

  .app-shell.chat-shell .aios-chat-topbar > .chat-sidebar-toggle,
  .app-shell.chat-shell .chat-mobile-exit {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 16px !important;
  }

  .app-shell.chat-shell .chat-selectors {
    grid-column: 2 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 2px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: none !important;
  }

  .app-shell.chat-shell .chat-selectors::-webkit-scrollbar {
    display: none !important;
  }

  .app-shell.chat-shell .chat-selectors .field,
  .app-shell.chat-shell .chat-selectors .model-pill {
    flex: 0 0 auto !important;
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
  }

  .app-shell.chat-shell .chat-selectors .field label,
  .app-shell.chat-shell .model-pill span,
  .app-shell.chat-shell .safety-pill,
  .app-shell.chat-shell .chat-expand-button {
    display: none !important;
  }

  .app-shell.chat-shell .chat-selectors select,
  .app-shell.chat-shell .chat-selectors .model-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 30px 0 12px !important;
    border-radius: 16px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .app-shell.chat-shell .chat-selectors .field:nth-of-type(1) select {
    width: 116px !important;
  }

  .app-shell.chat-shell .chat-selectors .field:nth-of-type(2) select,
  .app-shell.chat-shell .chat-selectors .field:nth-of-type(3) select {
    width: 116px !important;
  }

  .app-shell.chat-shell .chat-selectors .model-pill {
    width: 108px !important;
    max-width: 108px !important;
    padding: 0 11px !important;
  }

  .app-shell.chat-shell .chat-selectors .model-pill strong {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-shell.chat-shell .aios-chat-messages {
    min-height: 0 !important;
    padding-bottom: calc(var(--aios-chat-composer-reserve) + var(--aios-tabbar-height) + env(safe-area-inset-bottom)) !important;
    scroll-padding-bottom: calc(var(--aios-chat-composer-reserve) + var(--aios-tabbar-height) + env(safe-area-inset-bottom)) !important;
  }

  .app-shell.chat-shell .welcome-screen {
    min-height: auto !important;
    justify-content: start !important;
    padding: 18px 14px 24px !important;
  }

  .app-shell.chat-shell .welcome-screen h1 {
    max-width: 11ch !important;
    margin-inline: auto !important;
    font-size: clamp(32px, 9vw, 42px) !important;
    line-height: 1.04 !important;
  }

  .app-shell.chat-shell .welcome-screen p {
    max-width: 32ch !important;
    margin-inline: auto !important;
  }

  .app-shell.chat-shell .composer-wrap {
    position: fixed !important;
    right: 0 !important;
    bottom: calc(var(--aios-tabbar-height) + env(safe-area-inset-bottom) + 18px) !important;
    left: 0 !important;
    z-index: calc(var(--z-shell) + 13) !important;
    padding: 7px 10px 0 !important;
    background:
      linear-gradient(180deg, rgba(5, 9, 18, 0), rgba(5, 9, 18, 0.76) 22%, rgba(5, 9, 18, 0.96)) !important;
    pointer-events: none !important;
  }

  body[data-theme="light"] .app-shell.chat-shell .composer-wrap {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(247, 251, 255, 0.82) 24%, rgba(255, 255, 255, 0.98)) !important;
  }

  .app-shell.chat-shell .claude-composer {
    pointer-events: auto !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px 56px !important;
    gap: 7px !important;
    min-height: 58px !important;
    max-height: 138px !important;
    padding: 8px !important;
    border-radius: 23px !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.08)),
      rgba(10, 16, 30, 0.9) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 16px 38px rgba(0, 0, 0, 0.34) !important;
    backdrop-filter: blur(26px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(26px) saturate(180%) !important;
  }

  body[data-theme="light"] .app-shell.chat-shell .claude-composer {
    border-color: rgba(9, 46, 170, 0.14) !important;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 248, 255, 0.9)),
      rgba(255, 255, 255, 0.92) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.84),
      0 16px 38px rgba(25, 58, 120, 0.16) !important;
  }

  .app-shell.chat-shell .claude-composer .icon-button,
  .app-shell.chat-shell .claude-composer .secondary {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 16px !important;
  }

  .app-shell.chat-shell .claude-composer .primary,
  .app-shell.chat-shell .claude-composer .secondary[data-action="stop-aios-generation"] {
    width: 56px !important;
    min-width: 56px !important;
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 16px !important;
  }

  .app-shell.chat-shell .claude-composer textarea {
    min-height: 44px !important;
    max-height: 104px !important;
    padding: 10px 2px !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
    resize: none !important;
    touch-action: manipulation !important;
  }

  .app-shell.chat-shell .composer-tools-popover,
  .app-shell.chat-shell .resource-mention-menu {
    position: fixed !important;
    right: 10px !important;
    bottom: calc(var(--aios-tabbar-height) + 82px + env(safe-area-inset-bottom)) !important;
    left: 10px !important;
    z-index: calc(var(--z-shell) + 15) !important;
    max-height: min(54dvh, 420px) !important;
  }

  body:has(#aios-chat-input:focus) .app-shell.chat-shell .mobile-tabbar-ios {
    opacity: 0 !important;
    filter: blur(6px) !important;
    transform: translateY(calc(100% + 18px)) scale(0.98) !important;
    pointer-events: none !important;
  }

  body:has(#aios-chat-input:focus) .app-shell.chat-shell .composer-wrap {
    bottom: calc(env(safe-area-inset-bottom) + 8px) !important;
    padding-bottom: 0 !important;
  }
}

@media (max-width: 420px) {
  .app-shell.chat-shell {
    --aios-tabbar-height: 60px;
    --aios-chat-composer-reserve: 108px;
  }

  .app-shell.chat-shell .mobile-tabbar-ios {
    right: 10px !important;
    left: 10px !important;
  }

  .app-shell.chat-shell .mobile-tabbar-item small {
    font-size: 8.5px !important;
  }

  .app-shell.chat-shell .welcome-screen {
    padding-top: 14px !important;
  }

  .app-shell.chat-shell .welcome-screen h1 {
    font-size: clamp(30px, 9.2vw, 38px) !important;
  }
}

/* Final desktop sidebar rebuild. Keeps the PC menu structured and non-overlapping. */
@media (min-width: 821px) {
  .mobile-shell-header,
  .mobile-tabbar-ios {
    display: none !important;
  }

  .app-shell:not(.chat-shell) {
    --aios-desktop-sidebar-width: clamp(286px, 18vw, 326px);
    display: grid !important;
    grid-template-columns: var(--aios-desktop-sidebar-width) minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 0 !important;
    width: 100% !important;
    min-height: 100dvh !important;
    overflow-x: clip !important;
    background:
      radial-gradient(circle at 14% 0%, rgba(10, 132, 255, 0.12), transparent 34%),
      linear-gradient(180deg, #f7faff 0%, #eef4ff 100%) !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) {
    background:
      radial-gradient(circle at 14% 0%, rgba(10, 132, 255, 0.18), transparent 34%),
      linear-gradient(180deg, #070b12 0%, #0a111d 100%) !important;
  }

  .app-shell:not(.chat-shell) > .sidebar {
    position: sticky !important;
    top: 12px !important;
    align-self: start !important;
    box-sizing: border-box !important;
    width: calc(var(--aios-desktop-sidebar-width) - 12px) !important;
    height: calc(100dvh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    min-height: 0 !important;
    margin: 12px 0 12px 12px !important;
    padding: 14px !important;
    display: grid !important;
    grid-template-rows: auto auto minmax(0, 1fr) auto !important;
    gap: 12px !important;
    overflow: hidden !important;
    color: #0b1220 !important;
    border: 1px solid rgba(85, 112, 172, 0.18) !important;
    border-radius: 24px !important;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 250, 255, 0.76)),
      rgba(255, 255, 255, 0.78) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.72),
      0 20px 54px rgba(29, 52, 100, 0.12) !important;
    backdrop-filter: blur(26px) saturate(175%) !important;
    -webkit-backdrop-filter: blur(26px) saturate(175%) !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) > .sidebar {
    color: #f7fbff !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    background:
      linear-gradient(180deg, rgba(28, 34, 45, 0.9), rgba(14, 18, 26, 0.86)),
      rgba(12, 17, 25, 0.82) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 20px 54px rgba(0, 0, 0, 0.32) !important;
  }

  .app-shell:not(.chat-shell) > .sidebar > .brand-lockup {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 54px !important;
    min-height: 54px !important;
    padding: 7px 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
    border: 1px solid rgba(85, 112, 172, 0.14) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.54) !important;
    box-shadow: none !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) > .sidebar > .brand-lockup {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.06) !important;
  }

  .app-shell:not(.chat-shell) > .sidebar > .brand-lockup > span:not(.brand-mark) {
    display: none !important;
  }

  .app-shell:not(.chat-shell) > .sidebar > .brand-lockup .brand-mark.aios-logo-mark {
    width: 100% !important;
    height: 40px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    flex-basis: auto !important;
    padding: 0 !important;
    gap: 9px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .app-shell:not(.chat-shell) > .sidebar > .brand-lockup .aios-logo-icon {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex: 0 0 40px !important;
  }

  .app-shell:not(.chat-shell) > .sidebar > .brand-lockup .aios-logo-text {
    display: grid !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .app-shell:not(.chat-shell) > .sidebar > .brand-lockup .aios-logo-text strong {
    color: currentColor !important;
    font-size: 20px !important;
    font-weight: 1000 !important;
    line-height: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-shell:not(.chat-shell) > .sidebar > .brand-lockup .aios-logo-text small {
    display: block !important;
    color: rgba(83, 95, 115, 0.76) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) > .sidebar > .brand-lockup .aios-logo-text small {
    color: rgba(230, 238, 250, 0.62) !important;
  }

  .app-shell:not(.chat-shell) .school-chip {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 78px !important;
    max-height: 104px !important;
    padding: 13px !important;
    display: grid !important;
    gap: 5px !important;
    overflow: hidden !important;
    border-radius: 16px !important;
    border: 1px solid rgba(85, 112, 172, 0.16) !important;
    background: rgba(255, 255, 255, 0.5) !important;
    box-shadow: none !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) .school-chip {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.055) !important;
  }

  .app-shell:not(.chat-shell) .school-chip strong,
  .app-shell:not(.chat-shell) .school-chip span {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .app-shell:not(.chat-shell) .school-chip strong {
    color: currentColor !important;
    white-space: nowrap !important;
    font-size: 16px !important;
    line-height: 1.15 !important;
  }

  .app-shell:not(.chat-shell) .school-chip span {
    color: rgba(83, 95, 115, 0.78) !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) .school-chip span {
    color: rgba(230, 238, 250, 0.66) !important;
  }

  .app-shell:not(.chat-shell) .nav {
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    padding: 1px 4px 8px 0 !important;
    display: grid !important;
    grid-auto-rows: minmax(42px, auto) !important;
    align-content: start !important;
    gap: 6px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-gutter: stable !important;
    overscroll-behavior: contain !important;
  }

  .app-shell:not(.chat-shell) .nav::-webkit-scrollbar {
    width: 8px !important;
  }

  .app-shell:not(.chat-shell) .nav::-webkit-scrollbar-thumb {
    border: 2px solid transparent !important;
    border-radius: 999px !important;
    background: rgba(90, 110, 145, 0.28) !important;
    background-clip: padding-box !important;
  }

  .app-shell:not(.chat-shell) .nav-item {
    box-sizing: border-box !important;
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    max-width: none !important;
    padding: 8px 10px !important;
    display: grid !important;
    grid-template-columns: 26px minmax(0, 1fr) !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 10px !important;
    text-align: left !important;
    color: rgba(69, 78, 96, 0.92) !important;
    border: 1px solid transparent !important;
    border-radius: 14px !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    font-size: 14px !important;
    font-weight: 850 !important;
    line-height: 1.1 !important;
    white-space: normal !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) .nav-item {
    color: rgba(232, 238, 248, 0.72) !important;
  }

  .app-shell:not(.chat-shell) .nav-item::before {
    content: none !important;
  }

  .app-shell:not(.chat-shell) .nav-item-icon {
    width: 26px !important;
    height: 26px !important;
    display: grid !important;
    place-items: center !important;
    color: currentColor !important;
    border-radius: 10px !important;
    background: rgba(10, 132, 255, 0.08) !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) .nav-item-icon {
    background: rgba(255, 255, 255, 0.06) !important;
  }

  .app-shell:not(.chat-shell) .nav-item-icon svg {
    width: 17px !important;
    height: 17px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }

  .app-shell:not(.chat-shell) .nav-item-label {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-shell:not(.chat-shell) .nav-item:hover {
    color: #0a2a5f !important;
    border-color: rgba(10, 132, 255, 0.16) !important;
    background: rgba(10, 132, 255, 0.08) !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) .nav-item:hover {
    color: #ffffff !important;
    border-color: rgba(140, 190, 255, 0.18) !important;
    background: rgba(255, 255, 255, 0.075) !important;
  }

  .app-shell:not(.chat-shell) .nav-item.active {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.26) !important;
    background:
      radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.34), transparent 52%),
      linear-gradient(135deg, #0a84ff, #4f5df7) !important;
    box-shadow: 0 12px 26px rgba(10, 132, 255, 0.24) !important;
  }

  .app-shell:not(.chat-shell) .nav-item.active .nav-item-icon {
    background: rgba(255, 255, 255, 0.18) !important;
  }

  .app-shell:not(.chat-shell) .sidebar-footer {
    box-sizing: border-box !important;
    margin: 0 !important;
    min-height: 0 !important;
    padding-top: 10px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: stretch !important;
    border-top: 1px solid rgba(85, 112, 172, 0.14) !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) .sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
  }

  .app-shell:not(.chat-shell) .sidebar-account {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    min-height: 58px !important;
    padding: 9px !important;
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: center !important;
    color: currentColor !important;
    border: 1px solid rgba(85, 112, 172, 0.16) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.5) !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) .sidebar-account {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.055) !important;
  }

  .app-shell:not(.chat-shell) .sidebar-account .account-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 14px !important;
  }

  .app-shell:not(.chat-shell) .sidebar-account strong {
    color: currentColor !important;
    font-size: 14px !important;
    line-height: 1.1 !important;
  }

  .app-shell:not(.chat-shell) .sidebar-account span {
    color: rgba(83, 95, 115, 0.74) !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) .sidebar-account span {
    color: rgba(230, 238, 250, 0.62) !important;
  }

  .app-shell:not(.chat-shell) .sidebar-footer > button {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 10px !important;
    justify-content: center !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .app-shell:not(.chat-shell) .sidebar-footer .mobile-menu-button {
    display: none !important;
  }

  .app-shell:not(.chat-shell) .sidebar-footer .cloud-sync {
    grid-column: 1 / -1 !important;
    justify-self: start !important;
    max-width: 100% !important;
    min-height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    line-height: 1 !important;
  }

  .app-shell:not(.chat-shell) .main {
    min-width: 0 !important;
    width: 100% !important;
  }

  .app-shell:not(.chat-shell) .content {
    min-width: 0 !important;
    width: 100% !important;
    padding: 16px 18px 24px 22px !important;
  }
}

@media (min-width: 821px) and (max-height: 760px) {
  .app-shell:not(.chat-shell) > .sidebar {
    padding: 12px !important;
    gap: 9px !important;
  }

  .app-shell:not(.chat-shell) > .sidebar > .brand-lockup {
    height: 48px !important;
    min-height: 48px !important;
  }

  .app-shell:not(.chat-shell) .school-chip {
    min-height: 64px !important;
    padding: 10px !important;
  }

  .app-shell:not(.chat-shell) .nav {
    gap: 4px !important;
  }

  .app-shell:not(.chat-shell) .nav-item {
    min-height: 38px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  .app-shell:not(.chat-shell) .sidebar-account {
    min-height: 52px !important;
  }

  .app-shell:not(.chat-shell) .sidebar-footer > button {
    min-height: 38px !important;
    height: 38px !important;
  }
}

/* AIOS logo + public home final rebuild */
.brand-mark.aios-logo-mark {
  box-sizing: border-box !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
  isolation: isolate !important;
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  aspect-ratio: 1578 / 496 !important;
}

.brand-mark.aios-logo-mark .aios-logo-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  flex: 0 0 auto !important;
  /* No drop-shadow: it painted a soft blue haze that read as a background box
     behind the logo. The wordmark now sits flush on the surface. */
  filter: none !important;
  pointer-events: none !important;
}

/* Dark theme: the AIOS wordmark is a deep royal blue and sinks into the dark
   app surface (measured contrast ~2:1). Lift it to a vivid, legible blue. No
   glow / drop-shadow — that created a halo; the PNG's anti-aliased edge is
   flattened to the brand blue, so brightening it produces no white fringe.
   Light theme is untouched. */
body[data-theme="dark"] .brand-mark.aios-logo-mark .aios-logo-image {
  filter: brightness(2.3) saturate(1.12) !important;
}

.brand-mark.aios-logo-mark .aios-logo-icon,
.brand-mark.aios-logo-mark .aios-logo-svg,
.brand-mark.aios-logo-mark .aios-logo-text {
  display: none !important;
}

.public-site {
  width: 100% !important;
  min-width: 0 !important;
  overflow-x: clip !important;
  color: #081225 !important;
  background:
    radial-gradient(circle at 15% 8%, rgba(10, 132, 255, 0.12), transparent 32%),
    radial-gradient(circle at 84% 18%, rgba(52, 199, 89, 0.1), transparent 30%),
    linear-gradient(180deg, #f7fbff 0%, #edf4ff 46%, #f8fbff 100%) !important;
}

body[data-theme="dark"] .public-site {
  color: #f8fbff !important;
  background:
    radial-gradient(circle at 16% 8%, rgba(10, 132, 255, 0.24), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(90, 200, 250, 0.12), transparent 30%),
    linear-gradient(180deg, #050914 0%, #07101f 48%, #050914 100%) !important;
}

.public-nav {
  box-sizing: border-box !important;
  position: sticky !important;
  top: 14px !important;
  z-index: calc(var(--z-shell) + 7) !important;
  width: min(1180px, calc(100% - 32px)) !important;
  min-height: 76px !important;
  margin: 14px auto 0 !important;
  padding: 10px 12px !important;
  display: grid !important;
  grid-template-columns: minmax(176px, 240px) minmax(0, 1fr) auto !important;
  gap: 12px !important;
  align-items: center !important;
  border: 1px solid rgba(96, 122, 172, 0.18) !important;
  border-radius: 26px !important;
  background: rgba(255, 255, 255, 0.74) !important;
  box-shadow: 0 20px 54px rgba(25, 47, 90, 0.12) !important;
  backdrop-filter: blur(24px) saturate(1.28) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.28) !important;
}

body[data-theme="dark"] .public-nav {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(10, 15, 28, 0.72) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34) !important;
}

.public-brand {
  box-sizing: border-box !important;
  min-width: 0 !important;
  min-height: 52px !important;
  height: 52px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  border: 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

.public-brand .brand-mark.aios-logo-mark {
  width: min(222px, 100%) !important;
  height: 52px !important;
}

.public-nav nav {
  min-width: 0 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  gap: 6px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch !important;
}

.public-nav nav::-webkit-scrollbar {
  display: none !important;
}

.public-nav-item {
  box-sizing: border-box !important;
  min-width: max-content !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  border-radius: 15px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid transparent !important;
  color: rgba(13, 24, 42, 0.74) !important;
  background: transparent !important;
  font-size: 14px !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

body[data-theme="dark"] .public-nav-item {
  color: rgba(238, 244, 255, 0.72) !important;
}

.public-nav-item.active {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.34), transparent 54%),
    linear-gradient(135deg, #0a84ff, #4f5df7) !important;
  box-shadow: 0 12px 28px rgba(10, 132, 255, 0.22) !important;
}

.public-nav-actions {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}

.public-nav-actions .icon-button {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 15px !important;
}

.public-nav-actions .primary {
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 18px !important;
  border-radius: 15px !important;
  white-space: nowrap !important;
}

.public-page-stage {
  box-sizing: border-box !important;
  width: min(1180px, calc(100% - 32px)) !important;
  margin: 24px auto 0 !important;
  padding: 0 0 34px !important;
  overflow: visible !important;
}

.public-home-grid {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: clamp(520px, calc(100svh - 130px), 720px) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr) !important;
  gap: clamp(24px, 4vw, 56px) !important;
  align-items: center !important;
  overflow: visible !important;
}

.public-hero-copy {
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 20px !important;
}

.public-hero-copy h1 {
  max-width: 840px !important;
  margin: 0 !important;
  color: inherit !important;
  font-size: clamp(42px, 5.35vw, 76px) !important;
  line-height: 0.96 !important;
  letter-spacing: 0 !important;
  text-wrap: balance !important;
  overflow-wrap: anywhere !important;
}

.public-hero-copy p {
  max-width: 680px !important;
  margin: 0 !important;
  color: rgba(40, 52, 72, 0.78) !important;
  font-size: clamp(17px, 1.5vw, 21px) !important;
  line-height: 1.55 !important;
}

body[data-theme="dark"] .public-hero-copy p {
  color: rgba(230, 238, 250, 0.72) !important;
}

.public-hero-actions {
  width: 100% !important;
  max-width: 720px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: stretch !important;
}

.public-hero-actions button,
.public-contact-actions button,
.subscription-card button,
.section-head button {
  min-height: 44px !important;
  max-width: 100% !important;
  border-radius: 15px !important;
  line-height: 1.08 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.public-hero-actions button {
  flex: 1 1 180px !important;
  padding: 0 18px !important;
}

.hero-stats {
  width: 100% !important;
  max-width: 720px !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

.hero-stat {
  box-sizing: border-box !important;
  min-width: 0 !important;
  min-height: 74px !important;
  padding: 14px !important;
  border-radius: 18px !important;
}

.aios-public-entity {
  box-sizing: border-box !important;
  justify-self: center !important;
  width: min(510px, 100%) !important;
  max-width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  min-height: 0 !important;
  overflow: visible !important;
  transform: none !important;
}

.aios-public-entity .entity-core {
  width: min(330px, 66%) !important;
  height: min(330px, 66%) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 30px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  overflow: visible !important;
}

.aios-public-entity .entity-core .brand-mark.aios-logo-mark {
  width: min(250px, 82%) !important;
  height: auto !important;
  max-height: 112px !important;
}

.aios-public-entity .entity-core > span:not(.brand-mark) {
  width: 100% !important;
  color: rgba(10, 36, 84, 0.78) !important;
  text-align: center !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

body[data-theme="dark"] .aios-public-entity .entity-core > span:not(.brand-mark) {
  color: rgba(235, 244, 255, 0.78) !important;
}

.entity-chip {
  min-height: 40px !important;
  max-width: 42% !important;
  padding: 10px 14px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.public-section-band,
.public-login-section,
.public-split-page,
.public-contact-page {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 1180px !important;
  min-width: 0 !important;
  margin: 28px auto 0 !important;
  overflow: visible !important;
}

.public-category-grid,
.subscription-grid,
.public-feature-grid,
.public-security-stack,
.public-auth-grid {
  min-width: 0 !important;
}

.public-module-card,
.subscription-card,
.public-mini-card,
.auth-card {
  min-width: 0 !important;
  overflow: hidden !important;
}

.public-module-card span {
  flex: 0 0 auto !important;
}

.public-module-card strong,
.subscription-card h3,
.public-mini-card strong,
.auth-card h3 {
  overflow-wrap: anywhere !important;
}

.public-module-card p,
.subscription-card p,
.public-mini-card span,
.auth-card p {
  overflow-wrap: anywhere !important;
}

.login-hero .brand-mark.aios-logo-mark,
.mini-loader .brand-mark.aios-logo-mark {
  width: 230px !important;
  height: 76px !important;
  max-width: 100% !important;
}

.app-shell:not(.chat-shell) > .sidebar > .brand-lockup .brand-mark.aios-logo-mark,
.app-shell:not(.chat-shell) .sidebar > .brand-lockup .brand-mark.aios-logo-mark {
  width: 176px !important;
  max-width: 100% !important;
  height: 56px !important;
  justify-self: center !important;
}

.aios-chat-sidebar .chat-sidebar-head .brand-mark.aios-logo-mark,
.aios-chat-sidebar .brand-mark.aios-logo-mark {
  width: 172px !important;
  max-width: 100% !important;
  height: 54px !important;
}

@media (min-width: 821px) {
  .app-shell:not(.chat-shell) > .sidebar > .brand-lockup {
    overflow: visible !important;
  }

  .app-shell:not(.chat-shell) > .sidebar > .brand-lockup .brand-mark.aios-logo-mark {
    width: min(188px, 100%) !important;
    height: 58px !important;
  }
}

@media (max-width: 820px) {
  .public-site {
    overflow-x: hidden !important;
  }

  .public-nav {
    position: relative !important;
    top: auto !important;
    width: calc(100% - 20px) !important;
    min-height: 0 !important;
    margin: 10px auto 0 !important;
    padding: 10px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "brand actions"
      "tabs tabs" !important;
    gap: 10px !important;
    border-radius: 22px !important;
  }

  .public-brand {
    grid-area: brand !important;
    height: 48px !important;
    min-height: 48px !important;
  }

  .public-brand .brand-mark.aios-logo-mark {
    width: 178px !important;
    max-width: 178px !important;
    flex: 0 0 178px !important;
    height: 48px !important;
    aspect-ratio: auto !important;
  }

  .public-nav nav {
    grid-area: tabs !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    justify-content: stretch !important;
    gap: 8px !important;
    padding: 2px 0 !important;
    overflow: visible !important;
  }

  .public-nav-item {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 0 13px !important;
    border-radius: 15px !important;
    font-size: 13px !important;
    white-space: normal !important;
    text-align: center !important;
    overflow-wrap: anywhere !important;
  }

  .public-nav-actions {
    grid-area: actions !important;
    gap: 7px !important;
  }

  .public-nav-actions .primary {
    width: auto !important;
    min-width: 98px !important;
    padding: 0 14px !important;
  }

  .public-page-stage {
    width: calc(100% - 20px) !important;
    margin-top: 18px !important;
    padding-bottom: 26px !important;
  }

  .public-home-grid {
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 22px !important;
    align-items: start !important;
  }

  .public-hero-copy {
    align-items: stretch !important;
    gap: 16px !important;
  }

  .public-hero-copy h1 {
    font-size: clamp(38px, 12vw, 52px) !important;
    line-height: 0.98 !important;
  }

  .public-hero-copy p {
    font-size: 16px !important;
    line-height: 1.48 !important;
  }

  .public-hero-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: none !important;
  }

  .public-hero-actions button {
    width: 100% !important;
    min-height: 48px !important;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    max-width: none !important;
  }

  .hero-stat {
    min-height: 68px !important;
    padding: 11px 8px !important;
    text-align: center !important;
  }

  .hero-stat strong {
    font-size: clamp(18px, 5vw, 24px) !important;
    line-height: 1 !important;
  }

  .hero-stat small {
    font-size: 11px !important;
    line-height: 1.1 !important;
    overflow-wrap: anywhere !important;
  }

  .aios-public-entity {
    width: min(390px, 100%) !important;
    margin: 0 auto !important;
  }

  .aios-public-entity .entity-core {
    width: min(250px, 68%) !important;
    height: min(250px, 68%) !important;
    padding: 24px !important;
  }

  .aios-public-entity .entity-core .brand-mark.aios-logo-mark {
    width: min(198px, 86%) !important;
    max-height: 88px !important;
  }

  .entity-chip {
    max-width: 48% !important;
    min-height: 36px !important;
    padding: 9px 12px !important;
    font-size: 12px !important;
  }

  .public-section-band,
  .public-login-section,
  .public-split-page,
  .public-contact-page {
    margin-top: 22px !important;
  }

  .section-head {
    gap: 10px !important;
    align-items: flex-start !important;
  }

  .section-head h3 {
    font-size: 22px !important;
    line-height: 1.12 !important;
  }

  .subscription-grid.compact,
  .subscription-grid,
  .public-category-grid,
  .public-category-grid.compact,
  .public-feature-grid,
  .public-auth-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .mobile-shell-brand {
    grid-template-columns: minmax(116px, 132px) minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .mobile-shell-brand .brand-mark.aios-logo-mark {
    width: 128px !important;
    height: 42px !important;
    min-width: 0 !important;
  }

  .login-hero .brand-mark.aios-logo-mark,
  .mini-loader .brand-mark.aios-logo-mark {
    width: 190px !important;
    height: 64px !important;
  }
}

@media (max-width: 430px) {
  .public-nav-actions .primary {
    min-width: 86px !important;
    padding: 0 11px !important;
    font-size: 13px !important;
  }

  .public-brand .brand-mark.aios-logo-mark {
    width: 154px !important;
    max-width: 154px !important;
    flex: 0 0 154px !important;
    aspect-ratio: auto !important;
  }

  .public-nav nav {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .hero-stats {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hero-stat {
    min-height: 58px !important;
    text-align: left !important;
  }

  .mobile-shell-brand {
    grid-template-columns: minmax(100px, 112px) minmax(0, 1fr) !important;
  }

  .mobile-shell-brand .brand-mark.aios-logo-mark {
    width: 108px !important;
    max-width: 108px !important;
    flex: 0 0 108px !important;
    height: 38px !important;
    aspect-ratio: auto !important;
  }
}

/* Public homepage and AIOS configurator rebuild */
.public-home-managebac {
  position: relative !important;
}

.public-dashboard-band {
  box-sizing: border-box !important;
  width: min(1180px, calc(100% - 32px)) !important;
  margin: 0 auto 28px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(220px, 0.75fr)) !important;
  gap: 14px !important;
}

.public-dashboard-card {
  min-width: 0 !important;
  min-height: 184px !important;
  padding: 22px !important;
  display: grid !important;
  align-content: space-between !important;
  gap: 16px !important;
  border: 1px solid rgba(107, 130, 178, 0.22) !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at 18% 10%, rgba(20, 184, 166, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(246, 249, 255, 0.58)) !important;
  box-shadow: 0 24px 70px rgba(25, 47, 90, 0.11) !important;
  backdrop-filter: blur(24px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.2) !important;
}

body[data-theme="dark"] .public-dashboard-card {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background:
    radial-gradient(circle at 18% 10%, rgba(20, 184, 166, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(18, 26, 44, 0.86), rgba(10, 14, 26, 0.66)) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3) !important;
}

.public-dashboard-card.main {
  min-height: 240px !important;
}

.public-dashboard-card h3 {
  margin: 0 !important;
  color: #06111f !important;
  font-size: clamp(28px, 3vw, 42px) !important;
  line-height: 1.02 !important;
  letter-spacing: 0 !important;
}

.public-dashboard-card strong {
  color: #06111f !important;
  font-size: 21px !important;
  line-height: 1.1 !important;
}

.public-dashboard-card p {
  margin: 0 !important;
  color: rgba(42, 54, 78, 0.72) !important;
  line-height: 1.5 !important;
}

body[data-theme="dark"] .public-dashboard-card h3,
body[data-theme="dark"] .public-dashboard-card strong {
  color: #f7fbff !important;
}

body[data-theme="dark"] .public-dashboard-card p {
  color: rgba(232, 240, 255, 0.72) !important;
}

.dashboard-mock-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

.dashboard-mock-grid span {
  min-width: 0 !important;
  min-height: 86px !important;
  padding: 14px !important;
  display: grid !important;
  align-content: center !important;
  gap: 4px !important;
  border: 1px solid rgba(77, 104, 160, 0.18) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.5) !important;
}

body[data-theme="dark"] .dashboard-mock-grid span {
  border-color: rgba(255, 255, 255, 0.11) !important;
  background: rgba(255, 255, 255, 0.075) !important;
}

.dashboard-mock-grid strong {
  font-size: 28px !important;
  line-height: 1 !important;
}

.dashboard-mock-grid small {
  color: rgba(72, 84, 108, 0.74) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1.12 !important;
}

body[data-theme="dark"] .dashboard-mock-grid small {
  color: rgba(232, 240, 255, 0.64) !important;
}

.public-module-icon {
  width: 52px !important;
  height: 52px !important;
  flex: 0 0 52px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 18px !important;
  color: #ffffff !important;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(135deg, #0a84ff, #14b8a6) !important;
  box-shadow: 0 14px 34px rgba(10, 132, 255, 0.22) !important;
}

.public-module-icon svg {
  width: 24px !important;
  height: 24px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.public-config-cta {
  padding: clamp(22px, 3.2vw, 34px) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 16px !important;
  align-items: center !important;
  border: 1px solid rgba(89, 119, 180, 0.2) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 12% 10%, rgba(10, 132, 255, 0.16), transparent 34%),
    radial-gradient(circle at 86% 10%, rgba(245, 158, 11, 0.12), transparent 32%),
    rgba(255, 255, 255, 0.68) !important;
  box-shadow: 0 24px 70px rgba(25, 47, 90, 0.12) !important;
}

body[data-theme="dark"] .public-config-cta {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background:
    radial-gradient(circle at 12% 10%, rgba(10, 132, 255, 0.18), transparent 34%),
    radial-gradient(circle at 86% 10%, rgba(245, 158, 11, 0.14), transparent 32%),
    rgba(11, 17, 31, 0.76) !important;
}

.public-config-cta h3 {
  margin: 4px 0 8px !important;
  color: #071322 !important;
  font-size: clamp(28px, 4vw, 46px) !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}

.public-config-cta p {
  max-width: 720px !important;
  margin: 0 !important;
  color: rgba(40, 52, 72, 0.72) !important;
  line-height: 1.52 !important;
}

body[data-theme="dark"] .public-config-cta h3 {
  color: #f7fbff !important;
}

body[data-theme="dark"] .public-config-cta p {
  color: rgba(232, 240, 255, 0.72) !important;
}

.aios-configurator {
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: calc(100svh - 164px) !important;
  padding: clamp(18px, 3vw, 34px) !important;
  display: grid !important;
  gap: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  border-radius: 34px !important;
  color: #f8fbff !important;
  background:
    radial-gradient(circle at 22% 12%, color-mix(in srgb, var(--config-accent, #0a84ff) 34%, transparent), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(20, 184, 166, 0.18), transparent 30%),
    radial-gradient(circle at 55% 88%, rgba(245, 158, 11, 0.12), transparent 36%),
    linear-gradient(145deg, #050814, #0a1020 48%, #050814) !important;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.36) !important;
  overflow: hidden !important;
}

.configurator-copy {
  max-width: 920px !important;
  display: grid !important;
  gap: 10px !important;
}

.configurator-copy h2 {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: clamp(38px, 6vw, 76px) !important;
  line-height: 0.94 !important;
  letter-spacing: 0 !important;
  text-wrap: balance !important;
}

.configurator-copy p {
  max-width: 760px !important;
  margin: 0 !important;
  color: rgba(238, 244, 255, 0.7) !important;
  font-size: clamp(16px, 1.5vw, 20px) !important;
  line-height: 1.52 !important;
}

.configurator-layout {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.25fr) minmax(286px, 0.85fr) !important;
  gap: 16px !important;
  align-items: stretch !important;
}

.config-panel,
.configurator-preview {
  min-width: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.075) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 24px 80px rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(28px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.25) !important;
}

.config-options,
.config-summary {
  padding: 18px !important;
  display: grid !important;
  align-content: start !important;
  gap: 18px !important;
}

.config-step {
  min-width: 0 !important;
  display: grid !important;
  gap: 10px !important;
}

.config-step-head {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: rgba(248, 251, 255, 0.92) !important;
}

.config-step-head span {
  width: 30px !important;
  height: 30px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--config-accent, #0a84ff) 36%, rgba(255, 255, 255, 0.12)) !important;
  font-size: 12px !important;
  font-weight: 1000 !important;
}

.config-step-head strong {
  font-size: 15px !important;
  font-weight: 950 !important;
}

.config-choice-grid,
.config-level-row {
  display: grid !important;
  gap: 8px !important;
}

.config-choice {
  min-width: 0 !important;
  min-height: 68px !important;
  padding: 13px !important;
  display: grid !important;
  gap: 4px !important;
  text-align: left !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 18px !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.055) !important;
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease !important;
}

.config-choice:hover,
.config-module-toggle:hover,
.config-level:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  background: rgba(255, 255, 255, 0.095) !important;
}

.config-choice.active,
.config-module-toggle.active,
.config-level.active {
  border-color: color-mix(in srgb, var(--config-accent, #0a84ff) 58%, rgba(255, 255, 255, 0.36)) !important;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.18), transparent 34%),
    color-mix(in srgb, var(--config-accent, #0a84ff) 22%, rgba(255, 255, 255, 0.09)) !important;
}

.config-choice strong,
.config-level strong,
.config-module-toggle strong {
  color: #ffffff !important;
  font-weight: 950 !important;
  line-height: 1.08 !important;
}

.config-choice small,
.config-level small,
.config-module-toggle small,
.config-upload small {
  color: rgba(238, 244, 255, 0.58) !important;
  font-size: 12px !important;
  font-weight: 850 !important;
}

.config-module-list {
  max-height: 340px !important;
  padding-right: 4px !important;
  display: grid !important;
  gap: 8px !important;
  overflow: auto !important;
  scrollbar-width: thin !important;
}

.config-module-toggle {
  min-height: 68px !important;
  padding: 10px !important;
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: center !important;
  text-align: left !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 18px !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.055) !important;
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease !important;
}

.config-module-toggle > span:last-child {
  min-width: 0 !important;
  display: grid !important;
  gap: 3px !important;
}

.config-icon {
  width: 44px !important;
  height: 44px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 16px !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.config-icon svg,
.config-module-orb svg {
  width: 22px !important;
  height: 22px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.config-level-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.config-level {
  min-width: 0 !important;
  min-height: 64px !important;
  padding: 12px 8px !important;
  display: grid !important;
  place-items: center !important;
  gap: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 18px !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.055) !important;
}

.config-upload {
  min-height: 76px !important;
  padding: 12px !important;
  display: grid !important;
  grid-template-columns: 70px minmax(0, 1fr) !important;
  column-gap: 12px !important;
  align-items: center !important;
  text-align: left !important;
  border: 1px dashed rgba(255, 255, 255, 0.22) !important;
  border-radius: 20px !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.055) !important;
}

.config-upload > span:first-child {
  grid-row: span 2 !important;
  width: 70px !important;
  height: 46px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  overflow: hidden !important;
}

.config-upload .brand-mark.aios-logo-mark {
  width: 66px !important;
  height: 28px !important;
}

.config-brand-row {
  display: grid !important;
  gap: 10px !important;
}

.config-color-dots {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.config-color-dots button {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border: 2px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 999px !important;
  background: var(--dot) !important;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--dot) 34%, transparent) !important;
}

.config-color-dots button.active {
  border-color: #ffffff !important;
  transform: scale(1.08) !important;
}

.config-tone-select {
  min-width: 0 !important;
  display: grid !important;
  gap: 6px !important;
}

.config-tone-select span {
  color: rgba(238, 244, 255, 0.62) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.config-tone-select select {
  min-height: 48px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 16px !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.075) !important;
  font-weight: 900 !important;
}

.config-tone-select option {
  color: #06111f !important;
}

.configurator-preview {
  position: relative !important;
  min-height: 690px !important;
  padding: 18px !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  gap: 14px !important;
  overflow: hidden !important;
}

.config-preview-stage {
  position: relative !important;
  min-height: 0 !important;
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  max-height: 610px !important;
  align-self: center !important;
  justify-self: center !important;
}

.config-preview-stage::before {
  content: "" !important;
  position: absolute !important;
  inset: 8% !important;
  border-radius: 999px !important;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--config-accent, #0a84ff) 24%, transparent), transparent 58%),
    radial-gradient(circle at 65% 32%, rgba(20, 184, 166, 0.14), transparent 40%) !important;
  filter: blur(4px) !important;
  animation: configCoreBreath 5s ease-in-out infinite alternate !important;
}

.config-energy-ring {
  position: absolute !important;
  inset: 12% !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 999px !important;
  animation: configSpin 28s linear infinite !important;
}

.config-energy-ring.ring-b {
  inset: 24% !important;
  border-style: dashed !important;
  animation-duration: 20s !important;
  animation-direction: reverse !important;
}

.config-module-orb {
  position: absolute !important;
  left: var(--orb-x) !important;
  top: var(--orb-y) !important;
  width: 118px !important;
  min-height: 94px !important;
  padding: 12px !important;
  display: grid !important;
  place-items: center !important;
  gap: 7px !important;
  text-align: center !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 24px !important;
  color: rgba(255, 255, 255, 0.62) !important;
  background: rgba(255, 255, 255, 0.055) !important;
  transform: translate(-50%, -50%) scale(0.88) !important;
  opacity: 0.46 !important;
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.28s ease, background 0.28s ease, border-color 0.28s ease !important;
}

.config-module-orb.active {
  color: #ffffff !important;
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1) !important;
  border-color: color-mix(in srgb, var(--accent, #0a84ff) 48%, rgba(255, 255, 255, 0.26)) !important;
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.2), transparent 34%),
    color-mix(in srgb, var(--accent, #0a84ff) 18%, rgba(255, 255, 255, 0.075)) !important;
  box-shadow: 0 0 42px color-mix(in srgb, var(--accent, #0a84ff) 34%, transparent) !important;
  animation: configOrbIn 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both !important;
}

.config-module-orb span {
  width: 42px !important;
  height: 42px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.config-module-orb small {
  max-width: 100% !important;
  color: inherit !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1.08 !important;
  overflow-wrap: anywhere !important;
}

.config-core {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: min(230px, 44%) !important;
  aspect-ratio: 1 / 1 !important;
  padding: 22px !important;
  display: grid !important;
  place-items: center !important;
  align-content: center !important;
  gap: 8px !important;
  text-align: center !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 44px !important;
  color: #ffffff !important;
  background:
    radial-gradient(circle at 30% 10%, rgba(255, 255, 255, 0.24), transparent 34%),
    rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 0 90px color-mix(in srgb, var(--config-accent, #0a84ff) 48%, transparent) !important;
  backdrop-filter: blur(30px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.4) !important;
  transform: translate(-50%, -50%) !important;
  animation: configCoreFloat 4.8s ease-in-out infinite alternate !important;
}

.config-core .brand-mark.aios-logo-mark {
  width: min(168px, 86%) !important;
  height: 58px !important;
}

.config-core strong {
  color: #ffffff !important;
  font-size: 20px !important;
  font-weight: 1000 !important;
}

.config-core span:last-child {
  color: rgba(238, 244, 255, 0.66) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.config-preview-caption {
  min-height: 72px !important;
  padding: 16px !important;
  display: grid !important;
  gap: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.065) !important;
}

.config-preview-caption strong {
  color: #ffffff !important;
  font-size: 18px !important;
  font-weight: 1000 !important;
}

.config-preview-caption span {
  color: rgba(238, 244, 255, 0.62) !important;
  font-weight: 800 !important;
}

.config-summary h3 {
  margin: 2px 0 0 !important;
  color: #ffffff !important;
  font-size: clamp(38px, 4.6vw, 58px) !important;
  line-height: 0.95 !important;
  letter-spacing: 0 !important;
}

.config-summary h3 small {
  color: rgba(238, 244, 255, 0.52) !important;
  font-size: 16px !important;
  font-weight: 900 !important;
}

.summary-lines {
  display: grid !important;
  gap: 8px !important;
}

.summary-lines p {
  margin: 0 !important;
  padding: 12px 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.summary-lines span {
  color: rgba(238, 244, 255, 0.56) !important;
  font-weight: 850 !important;
}

.summary-lines strong {
  max-width: 58% !important;
  color: #ffffff !important;
  text-align: right !important;
  font-weight: 950 !important;
  overflow-wrap: anywhere !important;
}

.summary-module-stack {
  padding: 15px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.055) !important;
}

.summary-module-stack strong {
  width: 100% !important;
  color: #ffffff !important;
  font-weight: 950 !important;
}

.summary-module-stack span {
  max-width: 100% !important;
  padding: 8px 10px !important;
  border-radius: 999px !important;
  color: rgba(238, 244, 255, 0.74) !important;
  background: rgba(255, 255, 255, 0.09) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  overflow-wrap: anywhere !important;
}

.summary-actions {
  display: grid !important;
  gap: 10px !important;
}

.summary-actions button {
  min-height: 50px !important;
  border-radius: 17px !important;
}

.summary-note {
  margin: 0 !important;
  color: rgba(238, 244, 255, 0.58) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}

@keyframes configSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes configCoreBreath {
  from {
    opacity: 0.68;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes configCoreFloat {
  from {
    margin-top: -5px;
  }
  to {
    margin-top: 7px;
  }
}

@keyframes configOrbIn {
  from {
    opacity: 0.2;
    transform: translate(-50%, -50%) scale(0.72);
  }
}

@media (max-width: 1100px) {
  .public-dashboard-band {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .configurator-layout {
    grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.14fr) !important;
  }

  .config-summary {
    grid-column: 1 / -1 !important;
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr) minmax(220px, 0.6fr) !important;
    align-items: start !important;
  }
}

@media (max-width: 820px) {
  .public-dashboard-band {
    width: calc(100% - 20px) !important;
    margin-top: 0 !important;
  }

  .dashboard-mock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .public-config-cta {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .public-config-cta button {
    width: 100% !important;
  }

  .aios-configurator {
    min-height: 0 !important;
    padding: 14px !important;
    border-radius: 26px !important;
  }

  .configurator-copy h2 {
    font-size: clamp(36px, 11vw, 52px) !important;
    line-height: 0.98 !important;
  }

  .configurator-layout,
  .config-summary {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .config-summary {
    grid-column: auto !important;
  }

  .configurator-preview {
    min-height: 520px !important;
  }

  .config-preview-stage {
    width: min(100%, 520px) !important;
  }

  .config-module-orb {
    width: 102px !important;
    min-height: 86px !important;
    padding: 10px !important;
  }

  .config-core {
    width: min(190px, 46%) !important;
    border-radius: 34px !important;
  }

  .config-core .brand-mark.aios-logo-mark {
    width: min(136px, 88%) !important;
    height: 48px !important;
  }
}

@media (max-width: 520px) {
  .public-dashboard-card {
    min-height: 150px !important;
    padding: 18px !important;
  }

  .dashboard-mock-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .config-level-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .configurator-preview {
    min-height: 460px !important;
    padding: 10px !important;
  }

  .config-module-orb {
    width: 86px !important;
    min-height: 76px !important;
    border-radius: 20px !important;
  }

  .config-module-orb span {
    width: 34px !important;
    height: 34px !important;
    border-radius: 13px !important;
  }

  .config-module-orb svg {
    width: 18px !important;
    height: 18px !important;
  }

  .config-module-orb small {
    font-size: 10px !important;
  }

  .config-core {
    width: min(154px, 45%) !important;
    padding: 14px !important;
    border-radius: 28px !important;
  }

  .config-core .brand-mark.aios-logo-mark {
    width: 112px !important;
    height: 40px !important;
  }

  .config-core strong {
    font-size: 16px !important;
  }

  .config-core span:last-child {
    font-size: 10px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .config-energy-ring,
  .config-preview-stage::before,
  .config-core,
  .config-module-orb.active {
    animation: none !important;
  }
}

/* Public sign-in modal */
.modal:has(.public-login-modal) {
  width: min(980px, calc(100vw - 28px)) !important;
  max-height: min(860px, calc(100svh - 28px)) !important;
  padding: clamp(18px, 2.4vw, 28px) !important;
  border-radius: 32px !important;
  overflow: auto !important;
}

.modal:has(.public-login-modal) .section-title {
  margin-bottom: 16px !important;
}

.modal:has(.public-login-modal) .section-title h2 {
  font-size: clamp(28px, 4vw, 44px) !important;
  line-height: 1 !important;
}

.public-login-modal {
  min-width: 0 !important;
  display: grid !important;
  gap: 18px !important;
}

.public-login-modal .public-login-copy {
  min-width: 0 !important;
  display: grid !important;
  gap: 10px !important;
}

.public-login-modal .public-login-copy h2 {
  margin: 0 !important;
  color: #071322 !important;
  font-size: clamp(30px, 4.6vw, 54px) !important;
  line-height: 0.98 !important;
  letter-spacing: 0 !important;
}

body[data-theme="dark"] .public-login-modal .public-login-copy h2 {
  color: #f7fbff !important;
}

.public-login-modal .public-login-copy p {
  max-width: 720px !important;
  margin: 0 !important;
  color: rgba(40, 52, 72, 0.72) !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
}

body[data-theme="dark"] .public-login-modal .public-login-copy p {
  color: rgba(232, 240, 255, 0.72) !important;
}

.public-login-modal .public-auth-grid {
  display: grid !important;
  grid-template-columns: minmax(300px, 0.92fr) minmax(280px, 1.08fr) !important;
  gap: 14px !important;
  align-items: stretch !important;
}

.public-login-modal .auth-card {
  min-width: 0 !important;
  height: 100% !important;
  border-radius: 24px !important;
}

.modal-login-tools {
  margin-top: 18px !important;
  display: grid !important;
  gap: 8px !important;
}

.modal-login-tools .ghost {
  min-height: 44px !important;
  border-radius: 15px !important;
}

@media (max-width: 760px) {
  .modal:has(.public-login-modal) {
    width: calc(100vw - 18px) !important;
    max-height: calc(100svh - 18px) !important;
    padding: 14px !important;
    border-radius: 26px !important;
  }

  .public-login-modal .public-auth-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .public-login-modal .status-strip {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Configurator redesign: premium guided studio */
.aios-configurator.wizard-configurator {
  position: relative !important;
  isolation: isolate !important;
  padding: clamp(18px, 2.4vw, 30px) !important;
  border-radius: 38px !important;
  background:
    radial-gradient(circle at 12% 5%, color-mix(in srgb, var(--config-accent, #0a84ff) 34%, transparent), transparent 30%),
    radial-gradient(circle at 86% 12%, rgba(20, 184, 166, 0.18), transparent 30%),
    radial-gradient(circle at 46% 96%, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(145deg, #030712 0%, #081121 48%, #030712 100%) !important;
}

.aios-configurator.wizard-configurator::before {
  content: "" !important;
  position: absolute !important;
  inset: 14px !important;
  z-index: var(--z-behind) !important;
  pointer-events: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 30px !important;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) !important;
  background-size: 42px 42px !important;
  mask-image: radial-gradient(circle at 50% 20%, #000, transparent 72%) !important;
  opacity: 0.72 !important;
}

.wizard-configurator .configurator-copy {
  max-width: none !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) !important;
  align-items: end !important;
  gap: 18px !important;
  padding: 4px 2px 10px !important;
}

.wizard-configurator .configurator-copy h2 {
  max-width: 980px !important;
  font-size: clamp(42px, 5.4vw, 82px) !important;
  line-height: 0.91 !important;
}

.wizard-configurator .configurator-copy p {
  max-width: 820px !important;
}

.configurator-copy-meta {
  min-width: 0 !important;
  padding: 16px !important;
  display: grid !important;
  gap: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.14), transparent 34%),
    rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(24px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.25) !important;
}

.configurator-copy-meta span,
.configurator-copy-meta small {
  color: rgba(238, 244, 255, 0.6) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.configurator-copy-meta strong {
  color: #ffffff !important;
  font-size: 34px !important;
  font-weight: 1000 !important;
  line-height: 0.95 !important;
}

.wizard-configurator .configurator-layout {
  grid-template-columns: minmax(420px, 1.08fr) minmax(360px, 0.82fr) minmax(300px, 0.62fr) !important;
  gap: 14px !important;
}

.wizard-configurator .config-panel,
.wizard-configurator .configurator-preview {
  border-radius: 30px !important;
  border-color: rgba(255, 255, 255, 0.13) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 26px 90px rgba(0, 0, 0, 0.34) !important;
}

.wizard-configurator .config-options {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto !important;
  gap: 16px !important;
}

.wizard-configurator .config-progress-head {
  padding: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.wizard-configurator .config-stepper {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 9px !important;
}

.wizard-configurator .config-stepper button {
  min-height: 58px !important;
  padding: 10px 12px !important;
  grid-template-columns: 34px minmax(0, 1fr) auto !important;
  align-items: center !important;
  text-align: left !important;
  border-radius: 18px !important;
}

.wizard-configurator .config-stepper button::after {
  content: "" !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.22) !important;
}

.wizard-configurator .config-stepper button.active::after,
.wizard-configurator .config-stepper button.done::after {
  background: var(--config-accent, #0a84ff) !important;
  box-shadow: 0 0 18px var(--config-accent, #0a84ff) !important;
}

.wizard-configurator .config-stepper span {
  grid-row: span 2 !important;
  background: rgba(255, 255, 255, 0.09) !important;
}

.wizard-configurator .config-stepper small {
  color: rgba(238, 244, 255, 0.5) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

.wizard-configurator .config-step-screen {
  min-height: 0 !important;
  padding: clamp(16px, 2vw, 22px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--config-accent, #0a84ff) 14%, transparent), transparent 34%),
    rgba(255, 255, 255, 0.045) !important;
}

.wizard-configurator .config-step-intro h3 {
  max-width: 720px !important;
  font-size: clamp(30px, 3.6vw, 52px) !important;
}

.wizard-configurator .config-choice,
.wizard-configurator .config-module-toggle,
.wizard-configurator .config-level,
.wizard-configurator .config-brand-card,
.wizard-configurator .config-request-form label,
.wizard-configurator .config-upload {
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.1), transparent 30%),
    rgba(255, 255, 255, 0.06) !important;
}

.wizard-configurator .config-choice.active,
.wizard-configurator .config-module-toggle.active,
.wizard-configurator .config-level.active {
  transform: translateY(-2px) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 18px 50px color-mix(in srgb, var(--config-accent, #0a84ff) 22%, transparent) !important;
}

.wizard-configurator .config-module-list.wizard {
  gap: 10px !important;
}

.wizard-configurator .config-module-list.wizard .config-module-toggle {
  min-height: 132px !important;
  grid-template-columns: 48px minmax(0, 1fr) !important;
}

.wizard-configurator .config-icon {
  background: color-mix(in srgb, var(--config-accent, #0a84ff) 22%, rgba(255, 255, 255, 0.08)) !important;
}

.wizard-configurator .configurator-preview {
  min-height: 640px !important;
  padding: 20px !important;
}

.wizard-configurator .config-preview-stage {
  width: min(100%, 560px) !important;
  max-height: 560px !important;
}

.wizard-configurator .config-preview-stage::after {
  content: "" !important;
  position: absolute !important;
  inset: 28% !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--config-accent, #0a84ff) 45%, rgba(255, 255, 255, 0.18)) !important;
  filter: drop-shadow(0 0 26px color-mix(in srgb, var(--config-accent, #0a84ff) 32%, transparent)) !important;
}

.wizard-configurator .config-core {
  width: min(210px, 42%) !important;
  border-radius: 40px !important;
}

.wizard-configurator .config-module-orb {
  width: 108px !important;
  min-height: 90px !important;
  border-radius: 22px !important;
}

.wizard-configurator .config-preview-caption {
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.075) !important;
}

.wizard-configurator .config-summary {
  position: sticky !important;
  top: 18px !important;
  align-self: start !important;
  gap: 16px !important;
}

.config-summary-top {
  display: grid !important;
  gap: 10px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.wizard-configurator .config-summary h3 {
  font-size: clamp(34px, 3.8vw, 52px) !important;
}

.wizard-configurator .summary-lines p {
  padding: 10px 0 !important;
  align-items: flex-start !important;
}

.wizard-configurator .summary-lines span {
  font-size: 12px !important;
  text-transform: uppercase !important;
}

.wizard-configurator .summary-lines strong {
  max-width: 62% !important;
}

.wizard-configurator .summary-actions .primary {
  background:
    radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.3), transparent 34%),
    linear-gradient(135deg, var(--config-accent, #0a84ff), #4f5df7) !important;
}

@media (max-width: 1180px) {
  .wizard-configurator .configurator-copy {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .wizard-configurator .configurator-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .wizard-configurator .config-summary {
    position: static !important;
  }
}

@media (max-width: 760px) {
  .wizard-configurator .configurator-copy h2 {
    font-size: clamp(38px, 11vw, 56px) !important;
  }

  .wizard-configurator .config-stepper {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
  }

  .wizard-configurator .config-stepper button {
    min-width: 62px !important;
    min-height: 56px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    place-items: center !important;
    text-align: center !important;
  }

  .wizard-configurator .config-stepper span {
    grid-row: auto !important;
  }

  .wizard-configurator .config-stepper button::after,
  .wizard-configurator .config-stepper small,
  .wizard-configurator .config-stepper strong {
    display: none !important;
  }

  .wizard-configurator .config-module-list.wizard .config-module-toggle {
    min-height: 104px !important;
  }

  .wizard-configurator .configurator-preview {
    min-height: 440px !important;
  }

  .wizard-configurator .config-preview-stage {
    max-height: 420px !important;
  }
}

/* Configurator wizard completion and Super Admin request review */
.wizard-configurator .configurator-layout {
  grid-template-columns: minmax(420px, 1.25fr) minmax(340px, 0.95fr) minmax(280px, 0.8fr) !important;
}

.config-progress-head {
  display: grid !important;
  gap: 8px !important;
}

.config-progress-head strong {
  color: #ffffff !important;
  font-size: 24px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
}

.config-progress-head span {
  color: rgba(238, 244, 255, 0.62) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.config-progress-track {
  height: 9px !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.11) !important;
}

.config-progress-track i {
  display: block !important;
  height: 100% !important;
  border-radius: inherit !important;
  background: linear-gradient(90deg, var(--config-accent, #0a84ff), #14b8a6) !important;
  box-shadow: 0 0 28px color-mix(in srgb, var(--config-accent, #0a84ff) 52%, transparent) !important;
  transition: width 0.28s ease !important;
}

.config-stepper {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.config-stepper button {
  min-width: 0 !important;
  min-height: 76px !important;
  padding: 10px !important;
  display: grid !important;
  align-content: center !important;
  gap: 7px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 18px !important;
  color: rgba(238, 244, 255, 0.66) !important;
  background: rgba(255, 255, 255, 0.055) !important;
}

.config-stepper button.active,
.config-stepper button.done {
  color: #ffffff !important;
  border-color: color-mix(in srgb, var(--config-accent, #0a84ff) 48%, rgba(255, 255, 255, 0.24)) !important;
  background: color-mix(in srgb, var(--config-accent, #0a84ff) 20%, rgba(255, 255, 255, 0.07)) !important;
}

.config-stepper span {
  width: 28px !important;
  height: 28px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.11) !important;
  font-weight: 1000 !important;
}

.config-stepper strong {
  min-width: 0 !important;
  font-size: 11px !important;
  line-height: 1.08 !important;
  overflow-wrap: anywhere !important;
}

.config-step-screen {
  min-width: 0 !important;
  min-height: 420px !important;
  display: grid !important;
  align-content: start !important;
  gap: 16px !important;
  animation: configStepIn 0.26s ease both !important;
}

.config-step-intro h3 {
  margin: 4px 0 8px !important;
  color: #ffffff !important;
  font-size: clamp(28px, 4vw, 46px) !important;
  line-height: 0.98 !important;
  letter-spacing: 0 !important;
}

.config-step-intro p {
  max-width: 720px !important;
  margin: 0 !important;
  color: rgba(238, 244, 255, 0.66) !important;
  line-height: 1.5 !important;
}

.config-choice-grid.large {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.config-choice span,
.config-level span,
.config-module-toggle em {
  color: rgba(238, 244, 255, 0.56) !important;
  font-size: 12px !important;
  font-style: normal !important;
  font-weight: 760 !important;
  line-height: 1.35 !important;
}

.config-module-list.wizard {
  max-height: none !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.config-module-list.wizard .config-module-toggle {
  min-height: 116px !important;
  align-items: start !important;
}

.config-level-row.wizard .config-level {
  min-height: 160px !important;
  align-content: center !important;
  padding: 18px !important;
}

.config-branding-grid,
.config-request-form {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.config-brand-card,
.config-request-form label {
  min-width: 0 !important;
  padding: 16px !important;
  display: grid !important;
  gap: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.055) !important;
}

.config-request-form label.full {
  grid-column: 1 / -1 !important;
}

.config-request-form span,
.config-brand-card strong {
  color: rgba(238, 244, 255, 0.74) !important;
  font-size: 13px !important;
  font-weight: 950 !important;
}

.config-request-form input,
.config-request-form textarea {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 48px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 16px !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.075) !important;
  outline: none !important;
}

.config-request-form textarea {
  resize: vertical !important;
}

.config-wizard-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr) !important;
  gap: 10px !important;
}

.config-wizard-actions button {
  min-height: 50px !important;
  border-radius: 17px !important;
}

.config-form-error {
  min-height: 20px !important;
  margin: 0 !important;
  color: #ff9aa8 !important;
  font-weight: 900 !important;
}

.config-request-admin-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)) !important;
  gap: 14px !important;
}

.config-admin-request {
  display: grid !important;
  gap: 14px !important;
}

.request-card-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.config-request-details {
  margin: 14px 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

.config-request-details span {
  min-width: 0 !important;
  padding: 12px !important;
  display: grid !important;
  gap: 4px !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.07) !important;
  overflow-wrap: anywhere !important;
}

body[data-theme="light"] .config-request-details span {
  background: rgba(10, 28, 62, 0.05) !important;
}

.config-request-details b {
  font-size: 11px !important;
  text-transform: uppercase !important;
  color: var(--muted) !important;
}

.compact-request-modules {
  margin: 12px 0 !important;
}

@keyframes configStepIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .wizard-configurator .configurator-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .wizard-configurator .configurator-preview {
    min-height: 520px !important;
  }
}

@media (max-width: 760px) {
  .config-stepper {
    grid-template-columns: repeat(5, minmax(44px, 1fr)) !important;
    overflow-x: auto !important;
  }

  .config-stepper button {
    min-height: 58px !important;
    padding: 8px !important;
  }

  .config-stepper strong {
    display: none !important;
  }

  .config-step-screen {
    min-height: 0 !important;
  }

  .config-choice-grid.large,
  .config-module-list.wizard,
  .config-branding-grid,
  .config-request-form,
  .config-request-details {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .config-wizard-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Configurator redesign final overrides */
.aios-configurator.wizard-configurator .configurator-copy {
  max-width: none !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) !important;
  align-items: end !important;
}

.aios-configurator.wizard-configurator .configurator-layout {
  grid-template-columns: minmax(420px, 1.08fr) minmax(360px, 0.82fr) minmax(300px, 0.62fr) !important;
  gap: 14px !important;
}

.aios-configurator.wizard-configurator .config-stepper {
  grid-template-columns: minmax(0, 1fr) !important;
}

.aios-configurator.wizard-configurator .config-stepper button {
  min-height: 58px !important;
  grid-template-columns: 34px minmax(0, 1fr) auto !important;
  text-align: left !important;
}

.aios-configurator.wizard-configurator .config-stepper strong,
.aios-configurator.wizard-configurator .config-stepper small {
  display: block !important;
}

.aios-configurator.wizard-configurator .config-step-screen {
  min-height: 0 !important;
  padding: clamp(16px, 2vw, 22px) !important;
}

.aios-configurator.wizard-configurator .configurator-preview {
  min-height: 640px !important;
}

.aios-configurator.wizard-configurator .config-summary {
  position: sticky !important;
  top: 18px !important;
  align-self: start !important;
  grid-column: auto !important;
  grid-template-columns: minmax(0, 1fr) !important;
}

@media (max-width: 1180px) {
  .aios-configurator.wizard-configurator .configurator-copy,
  .aios-configurator.wizard-configurator .configurator-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .aios-configurator.wizard-configurator .config-summary {
    position: static !important;
  }
}

@media (max-width: 760px) {
  .aios-configurator.wizard-configurator .config-stepper {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
  }

  .aios-configurator.wizard-configurator .config-stepper button {
    min-width: 62px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    place-items: center !important;
    text-align: center !important;
  }

  .aios-configurator.wizard-configurator .config-stepper strong,
  .aios-configurator.wizard-configurator .config-stepper small,
  .aios-configurator.wizard-configurator .config-stepper button::after {
    display: none !important;
  }

  .aios-configurator.wizard-configurator .configurator-preview {
    min-height: 440px !important;
  }
}

/* AIOS premium configurator experience */
.aios-configurator.wizard-configurator {
  min-height: min(980px, calc(100svh - 34px)) !important;
  padding: clamp(18px, 3vw, 40px) !important;
  overflow: hidden !important;
  color: #f8fbff !important;
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--config-accent, #0a84ff) 30%, transparent), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(34, 211, 238, 0.18), transparent 30%),
    linear-gradient(145deg, #020614 0%, #071326 48%, #020816 100%) !important;
}

.aios-configurator.wizard-configurator::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: var(--z-behind) !important;
  pointer-events: none !important;
  background:
    linear-gradient(110deg, transparent 0 32%, rgba(255, 255, 255, 0.055) 38%, transparent 46%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06), transparent 56%) !important;
  opacity: 0.7 !important;
  animation: premiumConfigSheen 8s ease-in-out infinite alternate !important;
}

.aios-configurator.wizard-configurator .configurator-copy {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 310px) !important;
  gap: 18px !important;
  margin-bottom: 18px !important;
}

.aios-configurator.wizard-configurator .configurator-copy h2 {
  max-width: 920px !important;
  color: #ffffff !important;
  font-size: clamp(42px, 6vw, 88px) !important;
  line-height: 0.92 !important;
  letter-spacing: 0 !important;
}

.aios-configurator.wizard-configurator .configurator-copy p {
  max-width: 780px !important;
  color: rgba(236, 245, 255, 0.72) !important;
}

.aios-configurator.wizard-configurator .configurator-layout {
  display: grid !important;
  grid-template-columns: minmax(430px, 1fr) minmax(380px, 0.86fr) minmax(300px, 0.62fr) !important;
  gap: 16px !important;
  align-items: start !important;
}

.aios-configurator.wizard-configurator .config-panel,
.aios-configurator.wizard-configurator .configurator-preview {
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 32px !important;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(5, 12, 28, 0.7) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 34px 90px rgba(0, 0, 0, 0.34) !important;
  backdrop-filter: blur(28px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(150%) !important;
}

.aios-configurator.wizard-configurator .config-options {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto !important;
  gap: 14px !important;
  padding: clamp(14px, 1.8vw, 20px) !important;
}

.aios-configurator.wizard-configurator .config-stepper {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.aios-configurator.wizard-configurator .config-stepper button {
  min-height: 70px !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: start !important;
  align-content: center !important;
  text-align: left !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.055) !important;
}

.aios-configurator.wizard-configurator .config-stepper button.active,
.aios-configurator.wizard-configurator .config-stepper button.done {
  border-color: color-mix(in srgb, var(--config-accent, #0a84ff) 62%, rgba(255, 255, 255, 0.2)) !important;
  background:
    radial-gradient(circle at 30% 0%, color-mix(in srgb, var(--config-accent, #0a84ff) 28%, transparent), transparent 48%),
    rgba(255, 255, 255, 0.075) !important;
}

.aios-configurator.wizard-configurator .config-stepper span {
  width: 30px !important;
  height: 30px !important;
}

.aios-configurator.wizard-configurator .config-stepper strong {
  display: block !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
}

.aios-configurator.wizard-configurator .config-stepper small {
  display: none !important;
}

.config-intro-screen,
.aios-configurator.wizard-configurator .config-step-screen {
  min-height: 520px !important;
  padding: clamp(18px, 2.5vw, 28px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 12% 2%, color-mix(in srgb, var(--config-accent, #0a84ff) 18%, transparent), transparent 36%),
    rgba(255, 255, 255, 0.045) !important;
}

.config-intro-screen {
  display: grid !important;
  grid-template-columns: minmax(0, 0.92fr) minmax(240px, 1.08fr) !important;
  gap: 18px !important;
  align-items: center !important;
}

.config-intro-copy {
  position: relative !important;
  z-index: calc(var(--z-raised) + 5) !important;
  display: grid !important;
  gap: 14px !important;
}

.config-intro-copy h3,
.aios-configurator.wizard-configurator .config-step-intro h3 {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: clamp(34px, 4.4vw, 58px) !important;
  line-height: 0.96 !important;
  letter-spacing: 0 !important;
}

.config-intro-copy p,
.aios-configurator.wizard-configurator .config-step-intro p {
  color: rgba(236, 245, 255, 0.68) !important;
}

.config-start-button {
  width: fit-content !important;
  min-height: 54px !important;
  padding-inline: 24px !important;
  box-shadow: 0 18px 54px color-mix(in srgb, var(--config-accent, #0a84ff) 34%, transparent) !important;
}

.config-intro-showcase {
  position: relative !important;
  pointer-events: none !important;
  min-height: 430px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
}

.config-logo-reveal {
  position: relative !important;
  z-index: calc(var(--z-raised) + 2) !important;
  width: min(210px, 48vw) !important;
  aspect-ratio: 1 !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid rgba(255, 255, 255, 0.17) !important;
  border-radius: 42px !important;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.18), transparent 35%),
    linear-gradient(145deg, color-mix(in srgb, var(--config-accent, #0a84ff) 52%, #1b2b70), #060d22) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 18px color-mix(in srgb, var(--config-accent, #0a84ff) 9%, transparent),
    0 30px 90px color-mix(in srgb, var(--config-accent, #0a84ff) 28%, rgba(0, 0, 0, 0.2)) !important;
  animation: configCoreFloat 4.8s ease-in-out infinite !important;
}

.config-logo-reveal .brand-mark,
.config-core .brand-mark {
  width: 82px !important;
  height: 82px !important;
  min-width: 82px !important;
  border-radius: 24px !important;
  background: transparent !important;
}

.config-particle {
  position: absolute !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 999px !important;
  background: #bff6ff !important;
  box-shadow: 0 0 22px #67e8f9 !important;
  animation: configParticleDrift 6s ease-in-out infinite alternate !important;
}

.config-particle.p1 { left: 18% !important; top: 24% !important; }
.config-particle.p2 { right: 18% !important; top: 18% !important; animation-delay: -1.4s !important; }
.config-particle.p3 { right: 28% !important; bottom: 17% !important; animation-delay: -2.6s !important; }

.config-floating-panel {
  position: absolute !important;
  z-index: calc(var(--z-raised) + 3) !important;
  display: grid !important;
  gap: 3px !important;
  min-width: 152px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

.config-floating-panel strong {
  color: #ffffff !important;
  font-size: 13px !important;
}

.config-floating-panel span {
  color: rgba(236, 245, 255, 0.62) !important;
  font-size: 12px !important;
}

.config-floating-panel.panel-a { left: 5% !important; top: 18% !important; }
.config-floating-panel.panel-b { right: 3% !important; bottom: 18% !important; }

.aios-configurator.wizard-configurator .config-choice,
.aios-configurator.wizard-configurator .config-module-toggle,
.aios-configurator.wizard-configurator .config-level,
.config-security-card,
.config-style-choice {
  position: relative !important;
  overflow: hidden !important;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease !important;
}

.aios-configurator.wizard-configurator .config-choice:hover,
.aios-configurator.wizard-configurator .config-module-toggle:hover,
.aios-configurator.wizard-configurator .config-level:hover,
.config-security-card:hover,
.config-style-choice:hover {
  transform: translateY(-3px) !important;
  border-color: color-mix(in srgb, var(--config-accent, #0a84ff) 50%, rgba(255, 255, 255, 0.18)) !important;
}

.aios-configurator.wizard-configurator .config-choice.active,
.aios-configurator.wizard-configurator .config-module-toggle.active,
.aios-configurator.wizard-configurator .config-level.active,
.config-security-card.active,
.config-style-choice.active {
  border-color: color-mix(in srgb, var(--config-accent, #0a84ff) 66%, rgba(255, 255, 255, 0.2)) !important;
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, var(--config-accent, #0a84ff) 30%, transparent), transparent 42%),
    rgba(255, 255, 255, 0.085) !important;
  box-shadow: 0 20px 58px color-mix(in srgb, var(--config-accent, #0a84ff) 20%, transparent) !important;
}

.aios-configurator.wizard-configurator .config-choice {
  min-height: 172px !important;
  align-content: start !important;
  padding: 18px !important;
}

.aios-configurator.wizard-configurator .config-choice em {
  color: rgba(236, 245, 255, 0.58) !important;
  font-size: 13px !important;
  font-style: normal !important;
  line-height: 1.35 !important;
}

.aios-configurator.wizard-configurator .config-module-toggle {
  grid-template-columns: 48px minmax(0, 1fr) 46px !important;
  min-height: 128px !important;
}

.config-toggle-switch {
  width: 42px !important;
  height: 24px !important;
  align-self: start !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.14) !important;
}

.config-toggle-switch::after {
  content: "" !important;
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  margin: 3px !important;
  border-radius: inherit !important;
  background: rgba(255, 255, 255, 0.88) !important;
  transition: transform 0.2s ease !important;
}

.active > .config-toggle-switch {
  background: var(--config-accent, #0a84ff) !important;
}

.active > .config-toggle-switch::after {
  transform: translateX(18px) !important;
}

.config-level-row.wizard {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.config-level-row.wizard .config-level {
  min-height: 190px !important;
}

.config-branding-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr) !important;
  align-items: stretch !important;
}

.config-style-grid,
.config-brand-controls {
  display: grid !important;
  gap: 12px !important;
}

.config-style-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.config-interface-preview {
  grid-column: 1 / -1 !important;
  min-height: 280px !important;
  display: grid !important;
  grid-template-columns: 86px minmax(0, 1fr) !important;
  gap: 12px !important;
  padding: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.055) !important;
  transition: background 0.25s ease, border-color 0.25s ease !important;
}

.config-interface-preview.style-minimal { background: rgba(248, 250, 252, 0.06) !important; }
.config-interface-preview.style-modern { background: linear-gradient(135deg, rgba(10, 132, 255, 0.13), rgba(20, 184, 166, 0.06)) !important; }
.config-interface-preview.style-premium { background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(34, 211, 238, 0.08)) !important; }
.config-interface-preview.style-custom { background: linear-gradient(135deg, color-mix(in srgb, var(--config-accent, #0a84ff) 20%, transparent), rgba(255, 255, 255, 0.05)) !important; }

.preview-sidebar,
.preview-dashboard {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.07) !important;
}

.preview-sidebar {
  display: grid !important;
  align-content: start !important;
  gap: 10px !important;
  padding: 12px !important;
}

.preview-sidebar span {
  height: 30px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.13) !important;
}

.preview-sidebar span:first-child {
  background: var(--config-accent, #0a84ff) !important;
}

.preview-dashboard {
  display: grid !important;
  gap: 12px !important;
  padding: 14px !important;
}

.preview-topline,
.preview-chatbot {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.preview-topline small,
.preview-chatbot span,
.preview-profile span {
  color: rgba(236, 245, 255, 0.62) !important;
}

.preview-cards {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

.preview-cards span,
.preview-chatbot,
.preview-profile {
  min-height: 58px !important;
  padding: 12px !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.preview-chatbot i {
  width: 36px !important;
  height: 36px !important;
}

.preview-chatbot .brand-mark {
  width: 36px !important;
  height: 36px !important;
}

.preview-profile {
  display: grid !important;
  gap: 8px !important;
}

.preview-profile span {
  height: 8px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.13) !important;
}

.config-security-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
  gap: 12px !important;
}

.config-security-card {
  min-height: 154px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 9px !important;
  padding: 16px !important;
  text-align: left !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  border-radius: 22px !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.055) !important;
}

.config-security-card .config-icon,
.config-security-card strong,
.config-security-card small {
  grid-column: 1 / -1 !important;
}

.config-security-card .config-toggle-switch {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

.config-final-recap {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

.config-final-recap > div {
  min-height: 96px !important;
  display: grid !important;
  align-content: center !important;
  gap: 6px !important;
  padding: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.config-final-recap span {
  color: rgba(236, 245, 255, 0.55) !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  text-transform: uppercase !important;
}

.config-final-recap strong {
  color: #ffffff !important;
  font-size: 18px !important;
  line-height: 1.12 !important;
}

.aios-configurator.wizard-configurator .configurator-preview {
  position: relative !important;
  min-height: 640px !important;
  display: grid !important;
  align-content: center !important;
  overflow: hidden !important;
}

.aios-configurator.wizard-configurator .config-preview-stage {
  position: relative !important;
  width: min(100%, 560px) !important;
  aspect-ratio: 1 !important;
  max-height: none !important;
  margin: auto !important;
}

.aios-configurator.wizard-configurator .config-preview-stage::after {
  inset: 22% !important;
  animation: configPulseRing 3.8s ease-in-out infinite !important;
}

.config-energy-ring.ring-c {
  transform: rotate(64deg) scale(0.62) !important;
  opacity: 0.36 !important;
}

.aios-configurator.wizard-configurator .config-core {
  width: min(220px, 42%) !important;
  aspect-ratio: 1 !important;
  height: auto !important;
  transform-style: preserve-3d !important;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.24), transparent 32%),
    linear-gradient(145deg, color-mix(in srgb, var(--config-accent, #0a84ff) 44%, #0d1b4c), #040916) !important;
  animation: configCoreFloat 4.8s ease-in-out infinite !important;
}

.aios-configurator.wizard-configurator.level-essential .config-core {
  border-radius: 34px !important;
}

.aios-configurator.wizard-configurator.level-advanced .config-core {
  border-radius: 42px !important;
  box-shadow: 0 0 70px color-mix(in srgb, var(--config-accent, #0a84ff) 30%, transparent) !important;
}

.aios-configurator.wizard-configurator.level-full .config-core {
  border-radius: 50% 38% 48% 40% !important;
  box-shadow:
    0 0 0 18px color-mix(in srgb, var(--config-accent, #0a84ff) 8%, transparent),
    0 0 94px color-mix(in srgb, var(--config-accent, #0a84ff) 40%, transparent) !important;
}

.aios-configurator.wizard-configurator .config-module-orb {
  min-height: 96px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  opacity: 0.24 !important;
  filter: saturate(0.6) !important;
  transition: opacity 0.22s ease, transform 0.22s ease, filter 0.22s ease !important;
}

.aios-configurator.wizard-configurator .config-module-orb::before {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 86px !important;
  height: 1px !important;
  background: linear-gradient(90deg, color-mix(in srgb, var(--config-accent, #0a84ff) 60%, transparent), transparent) !important;
  transform-origin: left center !important;
  opacity: 0 !important;
}

.aios-configurator.wizard-configurator .config-module-orb.active {
  opacity: 1 !important;
  filter: saturate(1.3) !important;
  transform: translate(-50%, -50%) scale(1.04) !important;
  box-shadow: 0 16px 44px color-mix(in srgb, var(--config-accent, #0a84ff) 22%, transparent) !important;
  animation: configModuleJoin 0.34s ease both !important;
}

.aios-configurator.wizard-configurator .config-module-orb.active::before {
  opacity: 0.8 !important;
}

.aios-configurator.wizard-configurator .config-summary {
  position: sticky !important;
  top: 18px !important;
}

.aios-configurator.wizard-configurator .summary-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
}

.aios-configurator.wizard-configurator .summary-actions button {
  min-height: 48px !important;
}

.security-stack {
  max-height: 190px !important;
  overflow: auto !important;
}

@keyframes premiumConfigSheen {
  from { transform: translateX(-4%); opacity: 0.45; }
  to { transform: translateX(4%); opacity: 0.8; }
}

@keyframes configCoreFloat {
  0%, 100% { transform: translateY(0) rotateX(0deg) rotateY(0deg); }
  50% { transform: translateY(-10px) rotateX(4deg) rotateY(-5deg); }
}

@keyframes configParticleDrift {
  from { transform: translate3d(0, 0, 0); opacity: 0.42; }
  to { transform: translate3d(18px, -16px, 0); opacity: 1; }
}

@keyframes configPulseRing {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.06); opacity: 0.42; }
}

@keyframes configModuleJoin {
  from { transform: translate(-50%, -50%) scale(0.92); }
  to { transform: translate(-50%, -50%) scale(1.04); }
}

@media (max-width: 1260px) {
  .aios-configurator.wizard-configurator .configurator-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr) !important;
  }

  .aios-configurator.wizard-configurator .config-summary {
    position: static !important;
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 940px) {
  .aios-configurator.wizard-configurator .configurator-copy,
  .aios-configurator.wizard-configurator .configurator-layout,
  .config-intro-screen,
  .config-branding-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .aios-configurator.wizard-configurator .config-stepper {
    display: flex !important;
    overflow-x: auto !important;
    padding-bottom: 3px !important;
  }

  .aios-configurator.wizard-configurator .config-stepper button {
    min-width: 64px !important;
    min-height: 58px !important;
    justify-items: center !important;
    text-align: center !important;
  }

  .aios-configurator.wizard-configurator .config-stepper strong {
    display: none !important;
  }

  .aios-configurator.wizard-configurator .configurator-preview {
    min-height: 520px !important;
  }
}

@media (max-width: 720px) {
  .aios-configurator.wizard-configurator {
    width: calc(100vw - 16px) !important;
    margin-inline: -8px !important;
    padding: 12px !important;
    border-radius: 24px !important;
  }

  .aios-configurator.wizard-configurator .configurator-copy h2 {
    font-size: clamp(38px, 11vw, 58px) !important;
  }

  .config-intro-screen,
  .aios-configurator.wizard-configurator .config-step-screen {
    min-height: 0 !important;
    padding: 16px !important;
  }

  .config-intro-showcase {
    min-height: 330px !important;
  }

  .config-floating-panel {
    min-width: 128px !important;
    padding: 10px !important;
  }

  .config-choice-grid.large,
  .aios-configurator.wizard-configurator .config-module-list.wizard,
  .config-level-row.wizard,
  .config-style-grid,
  .config-security-grid,
  .config-final-recap,
  .config-request-form,
  .config-interface-preview {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .aios-configurator.wizard-configurator .config-module-toggle {
    grid-template-columns: 44px minmax(0, 1fr) 42px !important;
  }

  .aios-configurator.wizard-configurator .configurator-preview {
    min-height: 430px !important;
    padding: 14px !important;
  }

  .aios-configurator.wizard-configurator .config-module-orb {
    width: 88px !important;
    min-height: 78px !important;
    font-size: 11px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aios-configurator.wizard-configurator *,
  .aios-configurator.wizard-configurator::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* Chat admin AI routing controls */
.app-shell.chat-shell .chat-ai-routing {
  min-width: 0 !important;
  display: contents !important;
}

.app-shell.chat-shell .chat-selectors select#chat-provider,
.app-shell.chat-shell .chat-selectors select#chat-model {
  min-width: 150px !important;
}

@media (max-width: 720px) {
  .app-shell.chat-shell .chat-selectors select#chat-provider,
  .app-shell.chat-shell .chat-selectors select#chat-model {
    min-width: 132px !important;
  }
}

/* Mobile shell stability and configurator v2 rebuild */
@media (max-width: 820px) {
  :root {
    --aios-tabbar-height: 76px !important;
  }

  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
  }

  .app-shell {
    min-height: 100dvh !important;
    padding-bottom: calc(var(--aios-tabbar-height) + env(safe-area-inset-bottom) + 14px) !important;
  }

  .main,
  .content {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: clip !important;
  }

  .mobile-tabbar-ios,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .mobile-tabbar-ios {
    position: fixed !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    z-index: calc(var(--z-top) + 2) !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    min-height: var(--aios-tabbar-height) !important;
    max-height: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateZ(0) !important;
  }

  .mobile-tabbar-item {
    min-width: 0 !important;
    min-height: 54px !important;
    padding: 6px 4px !important;
  }

  .mobile-tabbar-item small {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11px !important;
  }

  .app-shell.chat-shell .composer-wrap {
    bottom: calc(var(--aios-tabbar-height) + env(safe-area-inset-bottom) + 10px) !important;
    z-index: calc(var(--z-shell) + 8) !important;
  }

  .app-shell.chat-shell .aios-chat-topbar {
    overflow: hidden !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    align-items: start !important;
  }

  .app-shell.chat-shell .chat-selectors {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .app-shell.chat-shell .chat-ai-routing {
    display: contents !important;
  }

  .app-shell.chat-shell .chat-selectors .field,
  .app-shell.chat-shell .chat-selectors .model-pill,
  .app-shell.chat-shell .chat-selectors .safety-pill {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .app-shell.chat-shell .chat-selectors select,
  .app-shell.chat-shell .chat-selectors select#chat-provider,
  .app-shell.chat-shell .chat-selectors select#chat-model {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .app-shell.chat-shell .safety-pill {
    min-height: 44px !important;
    align-content: center !important;
    text-align: center !important;
  }

  .app-shell.chat-shell .aios-chat-messages {
    padding-bottom: calc(var(--aios-chat-composer-reserve, 116px) + var(--aios-tabbar-height) + env(safe-area-inset-bottom) + 20px) !important;
  }
}

.aios-configurator-v2,
.aios-configurator-v2 * {
  box-sizing: border-box !important;
}

.aios-configurator-v2 {
  position: relative !important;
  isolation: isolate !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  gap: 18px !important;
  padding: clamp(18px, 3vw, 34px) !important;
  overflow: hidden !important;
  color: #f8fbff !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 32px !important;
  background:
    radial-gradient(circle at 14% 8%, color-mix(in srgb, var(--config-accent, #0a84ff) 34%, transparent), transparent 34%),
    radial-gradient(circle at 86% 14%, rgba(34, 211, 238, 0.2), transparent 30%),
    linear-gradient(145deg, #020617 0%, #07142a 52%, #030712 100%) !important;
}

.aios-configurator-v2::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: var(--z-behind) !important;
  pointer-events: none !important;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) !important;
  background-size: 44px 44px !important;
  mask-image: radial-gradient(circle at 50% 18%, #000, transparent 76%) !important;
}

.config-v2-hero {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 310px) !important;
  gap: 18px !important;
  align-items: end !important;
}

.config-v2-kicker,
.config-v2-step-head span {
  color: #8edaff !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.config-v2-hero h2 {
  max-width: 880px !important;
  margin: 6px 0 10px !important;
  color: #ffffff !important;
  font-size: clamp(42px, 5.4vw, 76px) !important;
  line-height: 0.94 !important;
  letter-spacing: 0 !important;
}

.config-v2-hero p,
.config-v2-step-head p {
  max-width: 760px !important;
  margin: 0 !important;
  color: rgba(236, 245, 255, 0.68) !important;
  line-height: 1.5 !important;
}

.config-v2-price,
.config-v2-panel,
.config-v2-summary-card {
  min-width: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 26px !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 24px 74px rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(24px) saturate(145%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(145%) !important;
}

.config-v2-price {
  display: grid !important;
  gap: 4px !important;
  padding: 16px !important;
}

.config-v2-price span,
.config-v2-price small {
  color: rgba(236, 245, 255, 0.62) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.config-v2-price strong {
  color: #ffffff !important;
  font-size: 34px !important;
  line-height: 1 !important;
}

.config-v2-progress {
  display: grid !important;
  gap: 12px !important;
}

.config-v2-progress > i {
  display: block !important;
  height: 8px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, var(--config-accent, #0a84ff), #22d3ee) !important;
  box-shadow: 0 0 28px color-mix(in srgb, var(--config-accent, #0a84ff) 44%, transparent) !important;
}

.config-v2-progress > div {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.config-v2-progress button {
  min-width: 0 !important;
  min-height: 44px !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  border-radius: 16px !important;
  color: rgba(236, 245, 255, 0.62) !important;
  background: rgba(255, 255, 255, 0.055) !important;
  font-weight: 950 !important;
}

.config-v2-progress button.active,
.config-v2-progress button.done {
  color: #ffffff !important;
  border-color: color-mix(in srgb, var(--config-accent, #0a84ff) 62%, rgba(255, 255, 255, 0.2)) !important;
  background: color-mix(in srgb, var(--config-accent, #0a84ff) 20%, rgba(255, 255, 255, 0.08)) !important;
}

.config-v2-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.56fr) !important;
  gap: 16px !important;
  align-items: start !important;
  min-width: 0 !important;
}

.config-v2-panel {
  display: grid !important;
  gap: 14px !important;
  padding: clamp(14px, 2vw, 20px) !important;
}

.config-v2-stage {
  min-width: 0 !important;
  min-height: 520px !important;
  display: grid !important;
  align-content: start !important;
  gap: 18px !important;
  padding: clamp(16px, 2.2vw, 24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.045) !important;
}

.config-v2-stage.intro {
  grid-template-columns: minmax(0, 0.95fr) minmax(260px, 1fr) !important;
  align-items: center !important;
}

.config-v2-intro {
  position: relative !important;
  z-index: calc(var(--z-raised) + 2) !important;
  display: grid !important;
  gap: 14px !important;
}

.config-v2-intro h3,
.config-v2-step-head h3 {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: clamp(32px, 4.2vw, 56px) !important;
  line-height: 0.98 !important;
  letter-spacing: 0 !important;
}

.config-v2-intro p {
  color: rgba(236, 245, 255, 0.7) !important;
}

.config-v2-start {
  width: fit-content !important;
  min-height: 54px !important;
  padding-inline: 24px !important;
}

.config-v2-core-wrap,
.config-v2-preview {
  position: relative !important;
  min-height: 360px !important;
  display: grid !important;
  place-items: center !important;
  pointer-events: none !important;
}

.config-v2-core {
  position: relative !important;
  z-index: calc(var(--z-raised) + 3) !important;
  width: min(210px, 46vw) !important;
  aspect-ratio: 1 !important;
  display: grid !important;
  place-items: center !important;
  gap: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 42px !important;
  background: radial-gradient(circle at 24% 18%, rgba(255,255,255,.22), transparent 32%), linear-gradient(145deg, color-mix(in srgb, var(--config-accent, #0a84ff) 56%, #16245f), #040916) !important;
  box-shadow: 0 0 0 18px color-mix(in srgb, var(--config-accent, #0a84ff) 8%, transparent), 0 30px 90px color-mix(in srgb, var(--config-accent, #0a84ff) 30%, transparent) !important;
}

.config-v2-core .brand-mark {
  width: 78px !important;
  height: 78px !important;
  background: transparent !important;
}

.config-v2-core strong,
.config-v2-core small {
  color: #ffffff !important;
}

.config-v2-orbit {
  position: absolute !important;
  width: 74% !important;
  aspect-ratio: 1 !important;
  border: 1px solid color-mix(in srgb, var(--config-accent, #0a84ff) 42%, rgba(255, 255, 255, 0.16)) !important;
  border-radius: 50% !important;
}

.config-v2-orbit.o2 {
  width: 52% !important;
  transform: rotate(48deg) !important;
}

.config-v2-dot {
  position: absolute !important;
  width: 9px !important;
  height: 9px !important;
  border-radius: 50% !important;
  background: #bff6ff !important;
  box-shadow: 0 0 20px #67e8f9 !important;
}

.config-v2-dot.d1 { left: 18% !important; top: 28% !important; }
.config-v2-dot.d2 { right: 19% !important; top: 18% !important; }
.config-v2-dot.d3 { right: 27% !important; bottom: 18% !important; }

.config-v2-card-grid,
.config-v2-module-grid,
.config-v2-interface-grid,
.config-v2-final-grid {
  display: grid !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.config-v2-card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.config-v2-card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.config-v2-card-grid.security { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important; }
.config-v2-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.config-v2-interface-grid { grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr) !important; }
.config-v2-final-grid { grid-template-columns: minmax(230px, 0.65fr) minmax(0, 1fr) !important; }

.config-v2-card,
.config-v2-module,
.config-v2-style,
.config-v2-logo-drop {
  min-width: 0 !important;
  min-height: 132px !important;
  display: grid !important;
  gap: 8px !important;
  align-content: start !important;
  padding: 16px !important;
  text-align: left !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.config-v2-card.active,
.config-v2-module.active,
.config-v2-style.active {
  border-color: color-mix(in srgb, var(--config-accent, #0a84ff) 66%, rgba(255, 255, 255, 0.2)) !important;
  background: radial-gradient(circle at 16% 0%, color-mix(in srgb, var(--config-accent, #0a84ff) 28%, transparent), transparent 42%), rgba(255,255,255,.085) !important;
  box-shadow: 0 20px 58px color-mix(in srgb, var(--config-accent, #0a84ff) 18%, transparent) !important;
}

.config-v2-card em,
.config-v2-card small,
.config-v2-module small,
.config-v2-style small {
  color: rgba(236, 245, 255, 0.62) !important;
  font-size: 12px !important;
  font-style: normal !important;
  line-height: 1.35 !important;
}

.config-v2-icon svg {
  width: 24px !important;
  height: 24px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
}

.config-v2-module {
  min-height: 112px !important;
  grid-template-columns: 42px minmax(0, 1fr) 44px !important;
  align-items: start !important;
}

.config-v2-module i {
  display: grid !important;
  place-items: center !important;
  min-height: 28px !important;
  border-radius: 999px !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.13) !important;
  font-size: 11px !important;
  font-style: normal !important;
  font-weight: 950 !important;
}

.config-v2-module.active i {
  background: var(--config-accent, #0a84ff) !important;
}

.config-v2-style-list,
.config-v2-brand-panel,
.config-v2-recap {
  display: grid !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.config-v2-brand-panel {
  align-content: start !important;
}

.config-v2-logo-drop {
  min-height: 112px !important;
  place-items: center !important;
  text-align: center !important;
}

.config-v2-logo-drop .brand-mark {
  width: 54px !important;
  height: 54px !important;
  background: transparent !important;
}

.config-v2-colors {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 9px !important;
}

.config-v2-colors button {
  width: 42px !important;
  height: 42px !important;
  border-radius: 999px !important;
  border: 2px solid rgba(255,255,255,.18) !important;
  background: var(--dot) !important;
}

.config-v2-colors button.active {
  outline: 3px solid rgba(255,255,255,.38) !important;
}

.config-v2-tone,
.config-v2-form label {
  display: grid !important;
  gap: 7px !important;
  color: rgba(236, 245, 255, 0.74) !important;
  font-weight: 850 !important;
}

.config-v2-tone select,
.config-v2-form input,
.config-v2-form textarea {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 48px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  border-radius: 15px !important;
  color: #ffffff !important;
  background: rgba(255,255,255,.08) !important;
}

.config-v2-form {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.config-v2-form .full {
  grid-column: 1 / -1 !important;
}

.config-v2-recap > div,
.config-v2-summary-card > div {
  display: grid !important;
  gap: 5px !important;
  padding: 12px !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.065) !important;
}

.config-v2-recap span,
.config-v2-summary-card span {
  color: rgba(236, 245, 255, 0.56) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

.config-v2-summary {
  min-width: 0 !important;
  display: grid !important;
  gap: 14px !important;
  position: sticky !important;
  top: 18px !important;
}

.config-v2-summary-card {
  display: grid !important;
  gap: 10px !important;
  padding: 16px !important;
}

.config-v2-summary-card h3 {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: clamp(32px, 3.5vw, 48px) !important;
  line-height: 1 !important;
}

.config-v2-summary-card h3 small {
  color: rgba(236,245,255,.55) !important;
  font-size: 14px !important;
}

.config-v2-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
}

.config-v2-tags span {
  padding: 7px 9px !important;
  border-radius: 999px !important;
  color: #ffffff !important;
  background: color-mix(in srgb, var(--config-accent, #0a84ff) 22%, rgba(255,255,255,.08)) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

.config-v2-tags.muted span {
  background: rgba(255,255,255,.08) !important;
}

.config-v2-module-orb {
  position: absolute !important;
  left: var(--x) !important;
  top: var(--y) !important;
  width: 46px !important;
  height: 46px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 15px !important;
  color: rgba(255,255,255,.65) !important;
  background: rgba(255,255,255,.08) !important;
  opacity: .34 !important;
  transform: translate(-50%, -50%) !important;
}

.config-v2-module-orb.active {
  color: #ffffff !important;
  opacity: 1 !important;
  background: color-mix(in srgb, var(--config-accent, #0a84ff) 42%, rgba(255,255,255,.1)) !important;
  box-shadow: 0 0 28px color-mix(in srgb, var(--config-accent, #0a84ff) 34%, transparent) !important;
}

.config-v2-actions {
  display: grid !important;
  grid-template-columns: minmax(0, .55fr) minmax(0, 1fr) !important;
  gap: 10px !important;
}

.config-v2-actions button,
.config-v2-summary-card > button {
  min-height: 48px !important;
}

@media (max-width: 1120px) {
  .config-v2-layout,
  .config-v2-hero {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .config-v2-summary {
    position: static !important;
  }

  .config-v2-preview {
    min-height: 320px !important;
  }
}

@media (max-width: 720px) {
  .aios-configurator-v2 {
    width: 100% !important;
    padding: 12px !important;
    border-radius: 24px !important;
  }

  .config-v2-hero h2 {
    font-size: clamp(36px, 10vw, 54px) !important;
  }

  .config-v2-progress > div {
    grid-template-columns: repeat(6, minmax(42px, 1fr)) !important;
    overflow-x: auto !important;
  }

  .config-v2-stage,
  .config-v2-stage.intro,
  .config-v2-card-grid.two,
  .config-v2-card-grid.three,
  .config-v2-module-grid,
  .config-v2-interface-grid,
  .config-v2-final-grid,
  .config-v2-form,
  .config-v2-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .config-v2-stage {
    min-height: 0 !important;
    padding: 14px !important;
  }

  .config-v2-core-wrap,
  .config-v2-preview {
    min-height: 300px !important;
  }

  .config-v2-module {
    grid-template-columns: 38px minmax(0, 1fr) 42px !important;
  }
}

@media (min-width: 721px) and (max-width: 820px) {
  .app-shell.chat-shell .chat-selectors {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* AI Rules final interface rebuild */
.ai-rules-workspace {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 18px !important;
}

.ai-rules-hero {
  box-sizing: border-box !important;
  content-visibility: visible !important;
  contain: none !important;
  contain-intrinsic-size: auto !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr) !important;
  gap: 16px !important;
  align-items: stretch !important;
  padding: 22px !important;
  border: 1px solid rgba(95, 120, 172, 0.18) !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 10% 0%, rgba(10, 132, 255, 0.16), transparent 44%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(244, 249, 255, 0.52)) !important;
  box-shadow: 0 22px 60px rgba(20, 46, 92, 0.1) !important;
  backdrop-filter: blur(22px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.25) !important;
  overflow: hidden !important;
}

body[data-theme="dark"] .ai-rules-hero {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background:
    radial-gradient(circle at 10% 0%, rgba(10, 132, 255, 0.26), transparent 44%),
    linear-gradient(135deg, rgba(20, 26, 40, 0.9), rgba(12, 18, 32, 0.68)) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28) !important;
}

.ai-rules-hero-copy {
  min-width: 0 !important;
  display: grid !important;
  align-content: center !important;
  gap: 8px !important;
}

.ai-rules-hero-copy h3 {
  margin: 0 !important;
  color: #071327 !important;
  font-size: clamp(28px, 3vw, 44px) !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  overflow-wrap: anywhere !important;
}

body[data-theme="dark"] .ai-rules-hero-copy h3 {
  color: #f7fbff !important;
}

.ai-rules-hero-copy p {
  max-width: 720px !important;
  margin: 0 !important;
  color: rgba(44, 56, 76, 0.72) !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
}

body[data-theme="dark"] .ai-rules-hero-copy p {
  color: rgba(230, 238, 250, 0.7) !important;
}

.ai-rules-health {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  align-self: center !important;
}

.ai-rules-health > div {
  min-width: 0 !important;
  min-height: 92px !important;
  padding: 14px !important;
  display: grid !important;
  align-content: center !important;
  gap: 8px !important;
  border: 1px solid rgba(95, 120, 172, 0.16) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.54) !important;
}

body[data-theme="dark"] .ai-rules-health > div {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.055) !important;
}

.ai-rules-health span {
  color: rgba(66, 78, 100, 0.68) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

body[data-theme="dark"] .ai-rules-health span {
  color: rgba(230, 238, 250, 0.58) !important;
}

.ai-rules-health strong {
  min-width: 0 !important;
  color: #071327 !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  line-height: 1.15 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-theme="dark"] .ai-rules-health strong {
  color: #ffffff !important;
}

.ai-rules-health strong.ok {
  color: #128a42 !important;
}

.ai-rules-health strong.warn {
  color: #b46a00 !important;
}

.ai-rules-summary {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.ai-rules-summary .status-tile {
  min-height: 82px !important;
  padding: 15px !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.68) !important;
}

body[data-theme="dark"] .ai-rules-summary .status-tile {
  background: rgba(255, 255, 255, 0.055) !important;
}

.ai-rules-summary .status-tile strong {
  color: #071327 !important;
  font-size: 30px !important;
  line-height: 1 !important;
}

body[data-theme="dark"] .ai-rules-summary .status-tile strong {
  color: #ffffff !important;
}

.ai-rules-presets,
.ai-rules-card,
.ai-rules-logs {
  content-visibility: visible !important;
  contain: none !important;
  contain-intrinsic-size: auto !important;
  border-radius: 22px !important;
  border: 1px solid rgba(95, 120, 172, 0.16) !important;
  background: rgba(255, 255, 255, 0.68) !important;
  box-shadow: 0 18px 50px rgba(20, 46, 92, 0.08) !important;
}

body[data-theme="dark"] .ai-rules-presets,
body[data-theme="dark"] .ai-rules-card,
body[data-theme="dark"] .ai-rules-logs {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(12, 18, 32, 0.7) !important;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.24) !important;
}

.ai-rules-presets {
  padding: 18px !important;
}

.ai-rules-presets .section-head,
.ai-rules-card .section-head,
.ai-rules-logs .section-head {
  margin: 0 !important;
  min-width: 0 !important;
  align-items: flex-start !important;
  gap: 12px !important;
}

.ai-rules-presets h3,
.ai-rules-card h3,
.ai-rules-logs h3 {
  margin: 0 !important;
  color: #071327 !important;
  font-size: 20px !important;
  line-height: 1.16 !important;
  letter-spacing: 0 !important;
}

body[data-theme="dark"] .ai-rules-presets h3,
body[data-theme="dark"] .ai-rules-card h3,
body[data-theme="dark"] .ai-rules-logs h3 {
  color: #f7fbff !important;
}

.ai-rules-presets .preset-row {
  margin-top: 14px !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

.ai-rules-presets .preset-row button {
  width: 100% !important;
  min-height: 46px !important;
  border-radius: 15px !important;
  white-space: nowrap !important;
}

.ai-rules-grid.two-col {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr) !important;
  gap: 18px !important;
  align-items: start !important;
}

.ai-rules-card {
  box-sizing: border-box !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding: 18px !important;
  overflow: visible !important;
}

.ai-rules-card.form-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

.ai-rules-card .full {
  grid-column: 1 / -1 !important;
}

.ai-rules-card .field {
  min-width: 0 !important;
  margin: 0 !important;
}

.ai-rules-card .field label,
.ai-rules-card > .check,
.ai-rules-card .permission-box legend {
  color: rgba(29, 39, 58, 0.84) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  letter-spacing: 0.02em !important;
}

body[data-theme="dark"] .ai-rules-card .field label,
body[data-theme="dark"] .ai-rules-card > .check,
body[data-theme="dark"] .ai-rules-card .permission-box legend {
  color: rgba(232, 240, 255, 0.78) !important;
}

.ai-rules-card input,
.ai-rules-card select,
.ai-rules-card textarea {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  border-radius: 14px !important;
  border-color: rgba(95, 120, 172, 0.18) !important;
  background: rgba(255, 255, 255, 0.72) !important;
}

body[data-theme="dark"] .ai-rules-card input,
body[data-theme="dark"] .ai-rules-card select,
body[data-theme="dark"] .ai-rules-card textarea {
  border-color: rgba(255, 255, 255, 0.11) !important;
  background: rgba(255, 255, 255, 0.065) !important;
}

.ai-rules-card textarea {
  min-height: 104px !important;
  max-height: 210px !important;
  resize: vertical !important;
  line-height: 1.45 !important;
}

.ai-rules-card-main textarea {
  min-height: 92px !important;
  max-height: 160px !important;
}

.ai-rules-card button.primary,
.ai-rules-card button.secondary {
  min-height: 46px !important;
  border-radius: 15px !important;
}

.ai-rules-card .connection-lock {
  padding: 14px !important;
  display: grid !important;
  gap: 10px !important;
  border: 1px solid rgba(95, 120, 172, 0.16) !important;
  border-radius: 18px !important;
  background: rgba(10, 132, 255, 0.07) !important;
}

body[data-theme="dark"] .ai-rules-card .connection-lock {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(10, 132, 255, 0.12) !important;
}

.ai-rules-card .connection-lock p {
  margin: 0 !important;
  color: rgba(44, 56, 76, 0.72) !important;
  line-height: 1.45 !important;
}

body[data-theme="dark"] .ai-rules-card .connection-lock p {
  color: rgba(230, 238, 250, 0.66) !important;
}

.ai-rules-card .chatgpt-status {
  min-width: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.ai-rules-card .chatgpt-status span {
  min-height: 32px !important;
  max-width: 100% !important;
  padding: 8px 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.ai-rules-card .permission-box {
  min-width: 0 !important;
  margin: 0 !important;
  padding: 14px !important;
  display: grid !important;
  gap: 10px !important;
  border: 1px solid rgba(95, 120, 172, 0.16) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.48) !important;
}

body[data-theme="dark"] .ai-rules-card .permission-box {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.045) !important;
}

.ai-rules-card .permission-box .check,
.ai-rules-card > .check {
  box-sizing: border-box !important;
  min-height: 42px !important;
  padding: 10px 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  border-radius: 13px !important;
  background: rgba(255, 255, 255, 0.46) !important;
}

body[data-theme="dark"] .ai-rules-card .permission-box .check,
body[data-theme="dark"] .ai-rules-card > .check {
  background: rgba(255, 255, 255, 0.05) !important;
}

.ai-rules-card .permission-box input,
.ai-rules-card > .check input,
.ai-rules-subjects .subject-policy-row .check input {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
}

.ai-rules-subjects {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

.ai-rules-subjects .section-head,
.ai-rules-subjects > .field.full:last-child {
  grid-column: 1 / -1 !important;
}

.ai-rules-subjects .subject-policy-row {
  grid-column: auto !important;
  min-height: 250px !important;
  padding: 14px !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(112px, 1fr) auto !important;
  gap: 10px !important;
  border: 1px solid rgba(95, 120, 172, 0.16) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.45) !important;
}

body[data-theme="dark"] .ai-rules-subjects .subject-policy-row {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.045) !important;
}

.ai-rules-subjects .subject-policy-row textarea {
  min-height: 112px !important;
  height: 100% !important;
}

.ai-rules-subjects .subject-policy-row .hint {
  margin: 0 !important;
  color: rgba(66, 78, 100, 0.68) !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

body[data-theme="dark"] .ai-rules-subjects .subject-policy-row .hint {
  color: rgba(230, 238, 250, 0.58) !important;
}

.ai-rules-card .request-card {
  min-width: 0 !important;
  border-radius: 18px !important;
}

.ai-rules-logs {
  padding: 18px !important;
}

.ai-rules-logs .table-wrap {
  margin-top: 14px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  border-radius: 18px !important;
  max-width: 100% !important;
  scrollbar-gutter: stable !important;
  -webkit-overflow-scrolling: touch !important;
}

.ai-rules-logs table {
  min-width: 720px !important;
  width: max-content !important;
}

@media (max-width: 1180px) {
  .ai-rules-hero,
  .ai-rules-grid.two-col {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ai-rules-health {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {
  .ai-rules-workspace {
    gap: 14px !important;
  }

  .ai-rules-hero,
  .ai-rules-card,
  .ai-rules-presets,
  .ai-rules-logs {
    border-radius: 20px !important;
    padding: 14px !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .ai-rules-hero-copy h3 {
    font-size: 30px !important;
  }

  .ai-rules-health,
  .ai-rules-summary,
  .ai-rules-presets .preset-row,
  .ai-rules-card.form-grid,
  .ai-rules-subjects {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ai-rules-health > div,
  .ai-rules-summary .status-tile {
    min-height: 70px !important;
  }

  .ai-rules-card textarea,
  .ai-rules-card-main textarea {
    min-height: 96px !important;
    max-height: 180px !important;
  }

  .ai-rules-subjects .subject-policy-row {
    grid-column: 1 / -1 !important;
    min-height: 240px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .ai-rules-logs {
    overflow: hidden !important;
  }

  .ai-rules-logs .table-wrap {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-width: 100% !important;
  }
}

/* AIOS Chat desktop sidebar and role sync layout fix */
@media (min-width: 821px) {
  body:has(.app-shell.chat-shell) {
    overflow-x: hidden !important;
  }

  .app-shell.chat-shell {
    box-sizing: border-box !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: clamp(268px, 17vw, 318px) minmax(0, 1fr) !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  /* Flush full-height panel to match the non-chat views: the AI chat sidebar
     used to be a floating inset card (height: 100vh - 24px, margin: 12px,
     rounded), so its length/shape changed when entering the chat. Align it to
     the base sidebar geometry (100dvh, edge-to-edge, right border, square). */
  .app-shell.chat-shell > .sidebar {
    box-sizing: border-box !important;
    position: sticky !important;
    top: 0 !important;
    align-self: stretch !important;
    width: 100% !important;
    height: 100dvh !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 12px 10px !important;
    display: grid !important;
    grid-template-rows: 58px auto minmax(0, 1fr) auto !important;
    gap: 12px !important;
    color: #0b1220;
    border: 0 !important;
    border-right: 1px solid rgba(85, 112, 172, 0.18) !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, 0.82) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overflow: hidden !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell > .sidebar {
    color: #f7fbff;
    border-right-color: rgba(255, 255, 255, 0.12) !important;
    background: rgba(12, 17, 25, 0.86) !important;
    box-shadow: none !important;
  }

  .app-shell.chat-shell > .sidebar > .brand-lockup {
    box-sizing: border-box !important;
    min-width: 0 !important;
    height: 58px !important;
    min-height: 58px !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    place-items: center !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.34) !important;
    overflow: visible !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell > .sidebar > .brand-lockup {
    background: rgba(255, 255, 255, 0.045) !important;
  }

  .app-shell.chat-shell > .sidebar > .brand-lockup .brand-mark.aios-logo-mark {
    width: min(190px, 92%) !important;
    max-width: min(190px, 92%) !important;
    height: 52px !important;
    flex: 0 0 auto !important;
    aspect-ratio: auto !important;
    justify-self: center !important;
  }

  .app-shell.chat-shell > .sidebar > .brand-lockup > span:not(.brand-mark) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
  }

  .app-shell.chat-shell .school-chip {
    box-sizing: border-box !important;
    min-width: 0 !important;
    min-height: 74px !important;
    padding: 14px !important;
    display: grid !important;
    align-content: center !important;
    gap: 6px !important;
    border: 1px solid rgba(85, 112, 172, 0.16) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.52) !important;
    overflow: hidden !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .school-chip {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.055) !important;
  }

  .app-shell.chat-shell .school-chip strong,
  .app-shell.chat-shell .school-chip span {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .app-shell.chat-shell .school-chip strong {
    color: #071327 !important;
    font-size: 16px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .school-chip strong {
    color: #f7fbff !important;
  }

  .app-shell.chat-shell .school-chip span {
    color: rgba(73, 84, 104, 0.72) !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .school-chip span {
    color: rgba(230, 238, 250, 0.62) !important;
  }

  .app-shell.chat-shell > .sidebar .nav {
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    padding: 1px 4px 8px 0 !important;
    display: grid !important;
    grid-auto-rows: minmax(42px, auto) !important;
    align-content: start !important;
    gap: 6px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-gutter: stable !important;
    overscroll-behavior: contain !important;
  }

  .app-shell.chat-shell > .sidebar .nav-item {
    box-sizing: border-box !important;
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    max-width: none !important;
    padding: 8px 10px !important;
    display: grid !important;
    grid-template-columns: 26px minmax(0, 1fr) !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 10px !important;
    text-align: left !important;
    color: rgba(69, 78, 96, 0.92) !important;
    border: 1px solid transparent !important;
    border-radius: 14px !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    font-size: 14px !important;
    font-weight: 850 !important;
    line-height: 1.1 !important;
    white-space: normal !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell > .sidebar .nav-item {
    color: rgba(232, 238, 248, 0.72) !important;
  }

  .app-shell.chat-shell > .sidebar .nav-item::before {
    content: none !important;
  }

  .app-shell.chat-shell > .sidebar .nav-item-icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    display: grid !important;
    place-items: center !important;
    color: currentColor !important;
    border-radius: 10px !important;
    background: rgba(10, 132, 255, 0.08) !important;
    overflow: hidden !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell > .sidebar .nav-item-icon {
    background: rgba(255, 255, 255, 0.06) !important;
  }

  .app-shell.chat-shell > .sidebar .nav-item-icon svg {
    width: 17px !important;
    height: 17px !important;
    max-width: 17px !important;
    max-height: 17px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    color: currentColor !important;
  }

  .app-shell.chat-shell > .sidebar .nav-item-label {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-shell.chat-shell > .sidebar .nav-item.active {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.26) !important;
    background:
      radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.34), transparent 52%),
      linear-gradient(135deg, #0a84ff, #4f5df7) !important;
    box-shadow: 0 12px 26px rgba(10, 132, 255, 0.24) !important;
  }

  .app-shell.chat-shell > .sidebar .nav-item.active .nav-item-icon {
    background: rgba(255, 255, 255, 0.18) !important;
  }

  .app-shell.chat-shell .sidebar-footer {
    box-sizing: border-box !important;
    margin: 0 !important;
    min-height: 0 !important;
    padding-top: 10px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: stretch !important;
    border-top: 1px solid rgba(85, 112, 172, 0.14) !important;
  }

  .app-shell.chat-shell .sidebar-account {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    min-height: 58px !important;
    padding: 9px !important;
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: center !important;
    border: 1px solid rgba(85, 112, 172, 0.16) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    overflow: hidden !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .sidebar-account {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.055) !important;
  }

  .app-shell.chat-shell .sidebar-account .account-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 14px !important;
  }

  .app-shell.chat-shell .sidebar-account strong,
  .app-shell.chat-shell .sidebar-account span {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-shell.chat-shell .sidebar-footer > button {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 10px !important;
    justify-content: center !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .app-shell.chat-shell .sidebar-footer .mobile-menu-button {
    display: none !important;
  }

  .app-shell.chat-shell .sidebar-footer .cloud-sync {
    grid-column: 1 / -1 !important;
    justify-self: start !important;
    max-width: 100% !important;
  }

  .app-shell.chat-shell .main,
  .app-shell.chat-shell .content {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .app-shell.chat-shell .content {
    padding: 12px 12px 12px 0 !important;
  }

  .app-shell.chat-shell .aios-chat-app {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 24px) !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .app-shell.chat-shell .aios-chat-app.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) !important;
  }

  .app-shell.chat-shell .aios-chat-main,
  .app-shell.chat-shell .aios-chat-topbar,
  .app-shell.chat-shell .chat-selectors,
  .app-shell.chat-shell .aios-chat-messages,
  .app-shell.chat-shell .composer-wrap,
  .app-shell.chat-shell .claude-composer {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .app-shell.chat-shell .aios-chat-topbar {
    overflow: hidden !important;
  }

  .app-shell.chat-shell .chat-selectors {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
  }

  .app-shell.chat-shell .chat-selectors::-webkit-scrollbar {
    display: none !important;
  }

  .app-shell.chat-shell .chat-selectors .field,
  .app-shell.chat-shell .chat-selectors .model-pill,
  .app-shell.chat-shell .chat-selectors .safety-pill {
    flex: 0 0 auto !important;
  }
}

/* AIOS chat absolute final repair. Keep this last. */
body:has(.app-shell.chat-shell) {
  overflow: hidden !important;
}

.app-shell.chat-shell .content:has(.aios-chat-app),
.app-shell.chat-shell .aios-chat-app,
.app-shell.chat-shell .composer-wrap {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.app-shell.chat-shell .aios-chat-app.chat-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100dvw !important;
  max-width: 100dvw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  z-index: var(--z-modal) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: translate(
    calc(-1 * var(--aios-chat-fullscreen-left, 0px)),
    calc(-1 * var(--aios-chat-fullscreen-top, 0px))
  ) !important;
}

.app-shell.chat-shell:has(.aios-chat-app.chat-fullscreen),
.app-shell.chat-shell:has(.aios-chat-app.chat-fullscreen) .main,
.app-shell.chat-shell:has(.aios-chat-app.chat-fullscreen) .content,
.app-shell.chat-shell:has(.aios-chat-app.chat-fullscreen) .aios-chat-main {
  transform: none !important;
  translate: none !important;
  filter: none !important;
  perspective: none !important;
  contain: none !important;
}

.app-shell.chat-shell .aios-chat-main {
  min-width: 0 !important;
  min-height: 0 !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-main {
  width: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
}

.app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-messages {
  min-height: 0 !important;
  padding-inline: clamp(18px, 5vw, 84px) !important;
}

.app-shell.chat-shell .composer-wrap {
  overflow: visible !important;
  isolation: isolate !important;
}

.app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap {
  padding: 12px clamp(18px, 4vw, 64px) calc(14px + env(safe-area-inset-bottom)) !important;
}

.app-shell.chat-shell .claude-composer {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr) 52px 84px !important;
  gap: 10px !important;
  overflow: visible !important;
  z-index: calc(var(--z-raised) + 1) !important;
}

.app-shell.chat-shell .claude-composer textarea {
  width: 100% !important;
  min-width: 0 !important;
  resize: none !important;
}

.app-shell.chat-shell .composer-tools {
  position: relative !important;
  overflow: visible !important;
  z-index: calc(var(--z-raised) + 6) !important;
}

.app-shell.chat-shell .composer-tools-popover {
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  bottom: calc(100% + 12px) !important;
  width: min(380px, calc(100vw - 40px)) !important;
  max-height: min(58dvh, 520px) !important;
  overflow: auto !important;
  display: grid !important;
  z-index: calc(var(--z-modal) + 3) !important;
  pointer-events: auto !important;
}

.app-shell.chat-shell .composer-tools-popover[hidden] {
  display: none !important;
}

.app-shell.chat-shell .tool-menu-action {
  min-height: 56px !important;
}

.app-shell.chat-shell .resource-mention-menu {
  z-index: calc(var(--z-modal) + 2) !important;
}

@media (max-width: 720px) {
  .app-shell.chat-shell .aios-chat-app,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen {
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-messages {
    padding-inline: 12px !important;
  }

  .app-shell.chat-shell .composer-wrap,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom)) !important;
  }

  .app-shell.chat-shell .claude-composer {
    width: 100% !important;
    max-width: none !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px 62px !important;
    gap: 7px !important;
    min-height: 58px !important;
    padding: 7px !important;
    border-radius: 24px !important;
    overflow: visible !important;
  }

  .app-shell.chat-shell .claude-composer .icon-button,
  .app-shell.chat-shell .claude-composer .primary,
  .app-shell.chat-shell .claude-composer .secondary {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  .app-shell.chat-shell .claude-composer .primary,
  .app-shell.chat-shell .claude-composer .secondary[data-action="stop-aios-generation"] {
    width: 62px !important;
    min-width: 62px !important;
  }

  .app-shell.chat-shell .composer-tools-popover {
    left: 0 !important;
    right: auto !important;
    bottom: calc(100% + 10px) !important;
    width: min(340px, calc(100vw - 24px)) !important;
    max-height: min(58dvh, 460px) !important;
  }
}

/* Mobile chat absolute final lock: keep input above the iOS tabbar even when the textarea is focused. */
@media (max-width: 820px) {
  .app-shell.chat-shell {
    --aios-tabbar-height: 72px !important;
    --aios-chat-composer-reserve: 156px !important;
  }

  .app-shell.chat-shell .mobile-tabbar-ios,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .mobile-tabbar-ios {
    position: fixed !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: calc(7px + env(safe-area-inset-bottom)) !important;
    height: 62px !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    pointer-events: auto !important;
    z-index: calc(var(--z-top) + 2) !important;
  }

  .app-shell.chat-shell .composer-wrap,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(var(--aios-tabbar-height) + env(safe-area-inset-bottom) + 12px) !important;
    width: 100dvw !important;
    padding: 8px 12px !important;
    transform: none !important;
    z-index: var(--z-top) !important;
  }

  .app-shell.chat-shell .aios-chat-messages,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-messages {
    padding-bottom: calc(var(--aios-chat-composer-reserve) + var(--aios-tabbar-height) + env(safe-area-inset-bottom)) !important;
  }
}
/* TRUE END OVERRIDE - ChatGPT-like mobile shell */
@media (max-width: 820px) {
  .app-shell.chat-shell {
    --aios-tabbar-height: 0px !important;
    --aios-chat-composer-reserve: 96px !important;
  }

  .app-shell.chat-shell .mobile-tabbar-ios,
  .app-shell.chat-shell .mobile-tabbar-ios::before,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .mobile-tabbar-ios {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    transform: translateY(140%) !important;
    pointer-events: none !important;
  }

  .app-shell.chat-shell .composer-wrap,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .composer-wrap,
  body:has(#aios-chat-input:focus) .app-shell.chat-shell .aios-chat-app.chat-fullscreen .composer-wrap {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(env(safe-area-inset-bottom) + 9px) !important;
    width: 100dvw !important;
    padding: 0 16px !important;
    border: 0 !important;
    background: transparent !important;
    transform: none !important;
    pointer-events: none !important;
    z-index: var(--z-top) !important;
  }

  .app-shell.chat-shell .claude-composer,
  .app-shell.chat-shell .attachment-tray {
    pointer-events: auto !important;
  }

  .app-shell.chat-shell .aios-chat-messages,
  .app-shell.chat-shell .aios-chat-app.chat-fullscreen .aios-chat-messages {
    padding-bottom: calc(102px + env(safe-area-inset-bottom)) !important;
    scroll-padding-bottom: calc(108px + env(safe-area-inset-bottom)) !important;
  }

  .app-shell.chat-shell .chat-selectors .safety-pill,
  .app-shell.chat-shell .chat-selectors:not(:has(#chat-provider)) .field:nth-of-type(n + 2),
  .app-shell.chat-shell .chat-selectors:has(#chat-provider) .field:nth-of-type(n + 4) {
    display: none !important;
  }

  .app-shell.chat-shell .chat-selectors {
    max-height: 38px !important;
    overflow: hidden !important;
  }

  .app-shell.chat-shell .composer-tools-popover,
  .app-shell.chat-shell .resource-mention-menu {
    position: fixed !important;
    right: 16px !important;
    bottom: calc(78px + env(safe-area-inset-bottom)) !important;
    left: 16px !important;
    z-index: calc(var(--z-top) + 1) !important;
    max-height: min(54dvh, 430px) !important;
  }
}

/* TRUE END OVERRIDE - App-wide ChatGPT-like mobile shell */
@media (max-width: 820px) {
  body:has(.app-shell) {
    overflow-x: hidden !important;
    background: #ffffff !important;
  }

  body[data-theme="dark"]:has(.app-shell) {
    background: #111111 !important;
  }

  .app-shell {
    width: 100dvw !important;
    max-width: 100dvw !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    color: #111827 !important;
    background: #ffffff !important;
  }

  body[data-theme="dark"] .app-shell {
    color: #f8fafc !important;
    background: #111111 !important;
  }

  .mobile-tabbar-ios,
  .mobile-tabbar-ios::before,
  .app-shell:not(.chat-shell) .mobile-tabbar-ios,
  .app-shell:not(.chat-shell) .mobile-tabbar-ios::before {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    pointer-events: none !important;
  }

  .app-shell:not(.chat-shell) > .sidebar {
    display: none !important;
  }

  .app-shell:not(.chat-shell) .main {
    width: 100dvw !important;
    max-width: 100dvw !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    background: #ffffff !important;
  }

  body[data-theme="dark"] .app-shell:not(.chat-shell) .main {
    background: #111111 !important;
  }

  .app-shell:not(.chat-shell) .content {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100dvh !important;
    padding: calc(env(safe-area-inset-top) + 86px) 16px calc(env(safe-area-inset-bottom) + 24px) !important;
    overflow-x: hidden !important;
    animation: aiosMobilePageIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both !important;
  }

  .mobile-shell-header {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    z-index: calc(var(--z-shell) + 12) !important;
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) 52px 52px !important;
    gap: 8px !important;
    align-items: center !important;
    min-height: 74px !important;
    padding: calc(env(safe-area-inset-top) + 10px) 18px 10px !important;
    border: 0 !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: none !important;
    backdrop-filter: blur(18px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
  }

  body[data-theme="dark"] .mobile-shell-header {
    background: rgba(17, 17, 17, 0.92) !important;
  }

  .mobile-shell-menu,
  .mobile-shell-account,
  .mobile-shell-new-chat {
    display: grid !important;
    place-items: center !important;
    width: 50px !important;
    min-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 !important;
    color: #111827 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08) !important;
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease !important;
  }

  body[data-theme="dark"] .mobile-shell-menu,
  body[data-theme="dark"] .mobile-shell-account,
  body[data-theme="dark"] .mobile-shell-new-chat {
    color: #f8fafc !important;
    background: #1d1d1f !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28) !important;
  }

  .mobile-shell-menu:active,
  .mobile-shell-account:active,
  .mobile-shell-new-chat:active,
  .mobile-shell-brand:active {
    transform: scale(0.97) !important;
  }

  .mobile-shell-account .account-avatar {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 999px !important;
    box-shadow: none !important;
  }

  .mobile-shell-brand {
    display: grid !important;
    justify-items: center !important;
    align-content: center !important;
    gap: 1px !important;
    min-width: 0 !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 18px !important;
    color: #111827 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.86) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07) !important;
    transition: transform 180ms ease, background 180ms ease !important;
  }

  body[data-theme="dark"] .mobile-shell-brand {
    color: #f8fafc !important;
    background: rgba(29, 29, 31, 0.92) !important;
  }

  .mobile-shell-brand strong,
  .mobile-shell-brand small {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    letter-spacing: 0 !important;
  }

  .mobile-shell-brand strong {
    font-size: 17px !important;
    font-weight: 760 !important;
    line-height: 1.08 !important;
  }

  .mobile-shell-brand small {
    color: #737373 !important;
    font-size: 11px !important;
    font-weight: 650 !important;
  }

  body[data-theme="dark"] .mobile-shell-brand small {
    color: #a3a3a3 !important;
  }

  .mobile-shell-actions,
  .mobile-shell-pill {
    display: none !important;
  }

  .mobile-shell-menu {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .mobile-shell-brand {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  .mobile-shell-account {
    grid-column: 3 !important;
    grid-row: 1 !important;
  }

  .mobile-shell-new-chat {
    grid-column: 4 !important;
    grid-row: 1 !important;
  }

  .mobile-shell-header .icon-symbol {
    width: 22px !important;
    height: 22px !important;
    display: grid !important;
    place-items: center !important;
    color: currentColor !important;
  }

  .mobile-shell-new-chat {
    color: #ffffff !important;
    background: #ff6a21 !important;
    box-shadow: 0 12px 30px rgba(255, 106, 33, 0.24) !important;
  }

  .compact-mobile-grid {
    display: block !important;
  }
}

@media (max-width: 420px) {
  .mobile-shell-header {
    grid-template-columns: 50px minmax(0, 1fr) 46px 46px !important;
    grid-template-rows: 46px !important;
    grid-auto-flow: column !important;
    gap: 7px !important;
    padding-inline: 14px !important;
  }

  .mobile-shell-menu {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .mobile-shell-brand {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  .mobile-shell-account {
    grid-column: 3 !important;
    grid-row: 1 !important;
  }

  .mobile-shell-new-chat {
    grid-column: 4 !important;
    grid-row: 1 !important;
  }

  .mobile-shell-menu,
  .mobile-shell-account,
  .mobile-shell-new-chat {
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
  }

  .mobile-shell-brand {
    height: 46px !important;
    min-height: 46px !important;
    padding-inline: 14px !important;
  }

  .mobile-shell-brand small {
    display: none !important;
  }

  .app-shell:not(.chat-shell) .content {
    padding-inline: 12px !important;
  }
}

@keyframes aiosMobileDrawerIn {
  from {
    opacity: 0.86;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes aiosMobilePageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell:not(.chat-shell) .content,
  .mobile-shell-menu,
  .mobile-shell-brand,
  .mobile-shell-account,
  .mobile-shell-new-chat {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

@keyframes aiosMobileMenuContentIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat escape route: keep AIOS menu reachable from inside AIOS Chat. */
@media (max-width: 820px) {
  .app-shell.chat-shell .aios-chat-topbar {
    grid-template-columns: 46px 46px minmax(0, 1fr) 46px !important;
    grid-template-rows: auto auto !important;
    gap: 7px !important;
    padding: calc(env(safe-area-inset-top) + 8px) 14px 8px !important;
  }

  .app-shell.chat-shell .chat-mobile-app-menu,
  .app-shell.chat-shell .aios-chat-topbar > .chat-sidebar-toggle,
  .app-shell.chat-shell .chat-mobile-new {
    display: grid !important;
    place-items: center !important;
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #111827 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08) !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .chat-mobile-app-menu,
  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-topbar > .chat-sidebar-toggle,
  body[data-theme="dark"] .app-shell.chat-shell .chat-mobile-new {
    color: #f8fafc !important;
    background: #1d1d1f !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28) !important;
  }

  .app-shell.chat-shell .chat-mobile-app-menu {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .app-shell.chat-shell .aios-chat-topbar > .chat-sidebar-toggle {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  .app-shell.chat-shell .chat-mobile-title {
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .app-shell.chat-shell .chat-mobile-new {
    grid-column: 4 !important;
    grid-row: 1 !important;
  }

  .app-shell.chat-shell .chat-selectors {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }
}

/* Final mobile interaction polish: stable buttons, edge gestures and liquid glass. */
@media (max-width: 820px) {
  :root {
    --mobile-glass-light: rgba(255, 255, 255, 0.72);
    --mobile-glass-dark: rgba(20, 20, 22, 0.62);
    --mobile-glass-stroke-light: rgba(148, 163, 184, 0.28);
    --mobile-glass-stroke-dark: rgba(255, 255, 255, 0.12);
  }

  html,
  body {
    overscroll-behavior-x: none !important;
  }

  .app-shell {
    touch-action: pan-y !important;
  }

  .aios-chat-messages,
  .conversation-groups {
    touch-action: pan-x pan-y !important;
  }

  .mobile-shell-header,
  .app-shell.chat-shell .aios-chat-topbar,
  .app-shell.chat-shell .composer-wrap,
  .mobile-tabbar-ios {
    background: var(--mobile-glass-light) !important;
    border-color: var(--mobile-glass-stroke-light) !important;
    -webkit-backdrop-filter: blur(28px) saturate(165%) !important;
    backdrop-filter: blur(28px) saturate(165%) !important;
  }

  body[data-theme="dark"] .mobile-shell-header,
  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-topbar,
  body[data-theme="dark"] .app-shell.chat-shell .composer-wrap,
  body[data-theme="dark"] .mobile-tabbar-ios {
    background: var(--mobile-glass-dark) !important;
    border-color: var(--mobile-glass-stroke-dark) !important;
  }

  .mobile-shell-menu,
  .mobile-shell-account,
  .mobile-shell-new-chat,
  .app-shell.chat-shell .chat-mobile-app-menu,
  .app-shell.chat-shell .aios-chat-topbar > .chat-sidebar-toggle,
  .app-shell.chat-shell .chat-mobile-new,
  .app-shell.chat-shell .claude-composer .icon-button,
  .mobile-tabbar-item {
    min-width: 44px !important;
    min-height: 44px !important;
    display: grid !important;
    place-items: center !important;
    flex: 0 0 auto !important;
    line-height: 1 !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mobile-shell-menu,
  .mobile-shell-account,
  .mobile-shell-new-chat,
  .app-shell.chat-shell .chat-mobile-app-menu,
  .app-shell.chat-shell .aios-chat-topbar > .chat-sidebar-toggle,
  .app-shell.chat-shell .chat-mobile-new {
    color: #111827 !important;
    background: rgba(255, 255, 255, 0.68) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1) !important;
    -webkit-backdrop-filter: blur(22px) saturate(170%) !important;
    backdrop-filter: blur(22px) saturate(170%) !important;
  }

  body[data-theme="dark"] .mobile-shell-menu,
  body[data-theme="dark"] .mobile-shell-account,
  body[data-theme="dark"] .mobile-shell-new-chat,
  body[data-theme="dark"] .app-shell.chat-shell .chat-mobile-app-menu,
  body[data-theme="dark"] .app-shell.chat-shell .aios-chat-topbar > .chat-sidebar-toggle,
  body[data-theme="dark"] .app-shell.chat-shell .chat-mobile-new {
    color: #f8fafc !important;
    background: rgba(28, 28, 30, 0.64) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28) !important;
  }

  .mobile-shell-menu:active,
  .mobile-shell-account:active,
  .mobile-shell-new-chat:active,
  .mobile-shell-brand:active,
  .app-shell.chat-shell .chat-mobile-app-menu:active,
  .app-shell.chat-shell .aios-chat-topbar > .chat-sidebar-toggle:active,
  .app-shell.chat-shell .chat-mobile-new:active,
  .app-shell.chat-shell .claude-composer .icon-button:active,
  .app-shell.chat-shell #aios-send:active,
  .mobile-tabbar-item:active {
    transform: scale(0.96) !important;
  }

  .app-shell.chat-shell .claude-composer {
    grid-template-columns: 44px minmax(0, 1fr) 44px 64px !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 56px !important;
    padding: 6px !important;
    border-radius: 28px !important;
    background: rgba(255, 255, 255, 0.72) !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14) !important;
    -webkit-backdrop-filter: blur(28px) saturate(160%) !important;
    backdrop-filter: blur(28px) saturate(160%) !important;
  }

  body[data-theme="dark"] .app-shell.chat-shell .claude-composer {
    background: rgba(28, 28, 30, 0.66) !important;
    border-color: rgba(255, 255, 255, 0.13) !important;
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.36) !important;
  }

  .app-shell.chat-shell .claude-composer textarea {
    min-width: 0 !important;
    height: var(--aios-composer-height, 36px) !important;
    min-height: 36px !important;
    max-height: 132px !important;
    padding: 8px 0 !important;
    line-height: 1.25 !important;
    overflow-y: hidden !important;
    resize: none !important;
  }

  .app-shell.chat-shell .claude-composer textarea.is-scrollable {
    overflow-y: auto !important;
  }

  .app-shell.chat-shell .claude-composer .icon-button {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: 999px !important;
  }

  .app-shell.chat-shell #aios-send,
  .app-shell.chat-shell .claude-composer .primary,
  .app-shell.chat-shell .claude-composer .secondary[data-action="stop-aios-generation"] {
    width: 64px !important;
    min-width: 64px !important;
    height: 46px !important;
    min-height: 46px !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #ff7a2b 0%, #ff5f1f 100%) !important;
    box-shadow: 0 12px 30px rgba(255, 106, 33, 0.28) !important;
    font-size: 14px !important;
    font-weight: 820 !important;
    line-height: 1 !important;
    text-align: center !important;
    opacity: 1 !important;
  }

  .app-shell.chat-shell #aios-send:disabled,
  .app-shell.chat-shell .claude-composer .primary:disabled {
    color: rgba(255, 255, 255, 0.88) !important;
    opacity: 0.78 !important;
    filter: saturate(0.82) brightness(0.98) !important;
    box-shadow: 0 10px 24px rgba(255, 106, 33, 0.18) !important;
  }

  .suggestion-card,
  .tool-menu-action {
    min-height: 48px !important;
  }
}

@media (max-width: 820px) and (prefers-reduced-motion: no-preference) {
  .mobile-shell-header,
  .app-shell.chat-shell .aios-chat-topbar,
  .app-shell.chat-shell .composer-wrap,
  .mobile-tabbar-ios {
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease !important;
  }

  .mobile-tabbar-item,
  .app-shell.chat-shell #aios-send,
  .app-shell.chat-shell .claude-composer .icon-button {
    transition: transform 150ms ease, opacity 150ms ease, background-color 180ms ease, box-shadow 180ms ease !important;
  }
}
@media (max-width: 820px) {
  body[data-theme="light"] .composer-tools-popover,
  body[data-theme="light"] .resource-mention-menu,
  body[data-theme="light"] .modal,
  body[data-theme="light"] .tool-menu-action {
    color: #071426 !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    background-color: #ffffff !important;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.92)),
      #ffffff !important;
    box-shadow: 0 20px 52px rgba(15, 23, 42, 0.12) !important;
  }

  body[data-theme="light"] .composer-tools-popover strong,
  body[data-theme="light"] .resource-mention-menu strong,
  body[data-theme="light"] .tool-menu-action strong,
  body[data-theme="light"] .modal h2,
  body[data-theme="light"] .modal h3 {
    color: #071426 !important;
  }

  body[data-theme="light"] .composer-tools-popover small,
  body[data-theme="light"] .resource-mention-menu small,
  body[data-theme="light"] .tool-menu-action small,
  body[data-theme="light"] .modal p {
    color: #526174 !important;
  }
}
@media (max-width: 820px) {

  .app-shell.chat-shell .chat-selectors .field::before,
  .app-shell.chat-shell .chat-selectors .model-pill::before {
    content: none !important;
    display: none !important;
  }

  .app-shell.chat-shell .chat-selectors {
    background: transparent !important;
  }

  .app-shell.chat-shell .chat-selectors .field,
  .app-shell.chat-shell .chat-selectors .model-pill {
    background: transparent !important;
    box-shadow: none !important;
  }

  .app-shell.chat-shell .chat-selectors select,
  .app-shell.chat-shell .chat-selectors .model-pill {
    border-radius: 999px !important;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.88)),
      #ffffff !important;
    box-shadow: none !important;
  }
}
@media (max-width: 820px) {
}

/* Center the square Stop icon inside the composer stop button (all viewports). */
.app-shell.chat-shell .claude-composer .secondary[data-action="stop-aios-generation"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.app-shell.chat-shell .claude-composer .secondary[data-action="stop-aios-generation"] .aios-stop-square {
  display: block !important;
  width: 17px !important;
  height: 17px !important;
}

/* Reserve space at the right of each conversation row for the mobile Delete
   button (guaranteed last so the padding wins over earlier duplicate blocks). */
@media (max-width: 820px) {
  .app-shell.chat-shell .conversation-item {
    position: relative !important;
    padding-right: 50px !important;
  }
}
}
