/* Deliberately restrained product styling for the companion sign-in screen. */
body::before {
  background: radial-gradient(circle at 50% -20%, rgba(139, 61, 255, 0.08), transparent 42%);
}

/* Compact mobile chat polish. */
@media (max-width: 650px) {
  #app .topbar { min-height: 58px !important; padding-inline: 10px !important; }
  #app .topbar h1 { font-size: 18px; }
  #app .top-actions { margin-left: auto; gap: 7px; }
  #app .top-actions > span { display: none !important; }
  #app .top-actions > .account-picker { width: 40px !important; height: 40px !important; padding: 0 !important; }
  #app .account-picker #account-picker-button,
  #app .top-actions #refresh {
    display: grid !important; width: 40px !important; min-width: 40px !important;
    height: 40px !important; min-height: 40px !important; place-items: center;
    margin: 0 !important; padding: 3px !important; border-radius: 12px !important;
  }
  #app #account-picker-avatar {
    display: grid !important; width: 32px !important; height: 32px !important; place-items: center;
    color: #fff !important; background-color: color-mix(in srgb, var(--accent) 65%, #272934) !important;
    font-size: 10px !important;
  }
  #app .account-picker #account-picker-button > span:nth-child(2),
  #app .account-picker #account-picker-button > b { display: none !important; }

  #chat-view.chat-layout.active { top: calc(58px + env(safe-area-inset-top)) !important; }
  #chat-view #thread-header {
    display: grid !important;
    grid-template-columns: 36px 38px minmax(0, 1fr) 38px 38px !important;
    grid-template-rows: 44px !important; align-items: center !important; gap: 6px !important;
    min-height: 58px !important; padding: 7px 9px !important;
  }
  #chat-view #thread-header > * { min-width: 0; margin: 0 !important; }
  #chat-view #thread-header > .chat-back { grid-column: 1; display: grid; place-items: center; }
  #chat-view #thread-header > .avatar { grid-column: 2; width: 38px !important; height: 38px !important; }
  #chat-view #thread-header > div:nth-of-type(2) { grid-column: 3; overflow: hidden; }
  #chat-view #chat-background-button { grid-column: 4; }
  #chat-view #call-button { grid-column: 5; }
  #chat-view #chat-background-button,
  #chat-view #call-button,
  #chat-view #chat-back {
    width: 36px !important; height: 36px !important; min-height: 36px !important;
    padding: 0 !important; border-radius: 11px !important; background: #15161d !important;
    border-color: color-mix(in srgb, #343640 72%, var(--accent) 28%) !important;
    color: var(--accent) !important;
  }
  #chat-view #chat-back { color: #e7e8ed !important; font-size: 24px !important; }
  #chat-view #chat-background-button svg,
  #chat-view #call-button svg { width: 18px !important; height: 18px !important; }

  #chat-view .message-list { padding: 7px 5px 10px !important; }
  #chat-view .message {
    grid-template-columns: 34px minmax(0, 1fr) !important; gap: 7px !important;
    margin: 0 !important; padding: 4px 5px !important;
  }
  #chat-view .message.grouped { padding-top: 0 !important; padding-bottom: 1px !important; }
  #chat-view .message .avatar,
  #chat-view .avatar-spacer { width: 34px !important; height: 34px !important; }
  #chat-view .message-body header { min-height: 16px; }
  #chat-view .message-body > p { margin: 0 !important; font-size: 14px !important; line-height: 1.32 !important; }
  #chat-view .message-body header strong { font-size: 13px; }
  #chat-view .reply-reference { margin-bottom: 2px; }

  #chat-view .gif-embed,
  #chat-view .message-image,
  #chat-view .message-media {
    width: min(290px, 76vw) !important; max-width: 100% !important; margin-top: 4px !important;
  }
  #chat-view .gif-embed img,
  #chat-view .message-image img,
  #chat-view .message-media video {
    width: auto !important; max-width: 100% !important; max-height: 280px !important;
    border-radius: 9px !important; object-fit: contain !important;
  }
  #chat-view .gif-embed button {
    right: 5px; top: 5px; width: 30px; height: 30px; opacity: 1; font-size: 17px;
  }
}

@media (max-width: 390px) {
  #chat-view #thread-header {
    grid-template-columns: 34px 34px minmax(0, 1fr) 34px 34px !important;
    gap: 4px !important; padding-inline: 6px !important;
  }
  #chat-view #thread-header > .avatar { width: 34px !important; height: 34px !important; }
  #chat-view #chat-background-button,
  #chat-view #call-button,
  #chat-view #chat-back { width: 34px !important; height: 34px !important; }
  #chat-view .gif-embed,
  #chat-view .message-image,
  #chat-view .message-media { width: min(260px, 74vw) !important; }
}

/* Launcher Home parity */
.launcher-home-heading {
  padding: 2px 3px 15px;
  border-bottom: 0;
}
.launcher-home-heading h2 {
  position: relative;
  margin: 0;
  padding-left: 15px;
  font-size: 28px;
  line-height: 1.15;
}
.launcher-home-heading h2::before {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}
.launcher-home-content {
  display: grid;
  gap: 12px;
}
.web-home-action-rail {
  position: sticky;
  z-index: 80;
  top: -1px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, #30323b);
  border-radius: 12px;
  background: linear-gradient(105deg, color-mix(in srgb, #17181e 94%, var(--accent) 6%), #111217);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px) saturate(125%);
}
.web-home-action-rail > strong {
  flex: 0 0 auto;
  color: color-mix(in srgb, #fff 77%, var(--accent));
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.web-home-action-rail > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}
.web-home-action-rail button {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 6px 10px;
  border-color: color-mix(in srgb, var(--accent) 72%, #30323b);
  background: linear-gradient(
    180deg,
    var(--accent),
    color-mix(in srgb, var(--accent) 76%, #29005c)
  );
  color: #fff;
  white-space: nowrap;
}
.web-home-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  gap: 8px;
}
.web-home-toolbar button {
  min-height: 40px;
}
.web-search-icon {
  width: 42px;
  padding: 0;
  font-size: 23px;
}
.web-home-toolbar span {
  display: none;
}
#web-home-search-wrap input {
  width: 100%;
  min-height: 42px;
}
.search-hidden {
  display: none !important;
}
.home-category {
  margin-bottom: 0;
  padding: 14px 16px 12px;
  border-color: color-mix(in srgb, #30323b 78%, var(--accent) 22%);
  border-radius: 14px;
  background: color-mix(in srgb, #111217 78%, transparent);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(10px);
}
.home-category > header {
  min-height: 42px;
  margin-bottom: 10px;
}
.home-category > header > div:first-child {
  align-items: center;
}
.home-category h3 {
  font-size: 14px;
}
.home-category header span {
  font-size: 10px;
}
.home-category-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.home-category-actions button {
  min-height: 33px;
  padding: 6px 9px;
}
.home-category-actions button:disabled {
  opacity: 0.54;
}
.home-category-empty {
  display: grid;
  width: 100%;
  min-height: 60px;
  place-items: center;
  color: #8e91a0;
  font-size: 12px;
  font-style: italic;
}
.home-category-cards {
  gap: 12px;
  padding: 2px 0 12px;
}
.home-category-cards .launcher-account-card {
  width: 270px;
  max-width: 270px;
  min-height: 232px;
  flex: 0 0 270px;
}
.web-account-card.launcher-account-card {
  position: relative;
  display: flex;
  isolation: isolate;
  flex-direction: column;
  gap: 11px;
  padding: 13px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #343640 72%, transparent);
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 100% 0%,
      color-mix(in srgb, var(--accent) 15%, transparent),
      transparent 42%
    ),
    linear-gradient(145deg, #17181e, #0e0f13);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.31),
    inset 0 1px rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.web-account-card.launcher-account-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 52%, #343640);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.38),
    0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}
.web-account-card.launcher-account-card.pinned {
  border-color: color-mix(in srgb, #e8be4a 48%, #343640);
}
.web-account-card.launcher-account-card.selected {
  border-color: rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.98), transparent 48%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(225, 229, 237, 0.9));
  color: #10141b;
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.36),
    0 0 0 2px rgba(255, 255, 255, 0.28),
    inset 0 1px #fff;
}
.launcher-account-card .account-card-new-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.web-platform-badge {
  display: grid;
  min-width: 38px;
  height: 27px;
  padding: 0 9px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, #343640);
  border-radius: 9px;
  background: #0c1018;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
}
.launcher-account-card .account-card-new-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 118px;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid #30323b;
  border-radius: 999px;
  background: rgba(7, 8, 12, 0.7);
  color: #8a94a2;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}
.launcher-account-card .account-card-new-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.launcher-account-card .account-card-new-identity {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.launcher-account-card .account-card-new-avatar {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, #343640);
  border-radius: 13px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent) 76%, white),
    color-mix(in srgb, var(--accent) 68%, black)
  );
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}
.launcher-account-card .account-card-new-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.launcher-account-card .account-card-new-title {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.launcher-account-card .account-card-new-title strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.launcher-account-card .account-card-new-title small {
  overflow: hidden;
  color: #9295a3;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.launcher-account-card .account-card-new-selected {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
  font-size: 12px;
  font-weight: 900;
}
.launcher-account-card .account-card-new-id {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #292b34;
  border-radius: 10px;
  background: rgba(5, 6, 9, 0.65);
}
.launcher-account-card .account-card-new-id span {
  color: #9295a3;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.launcher-account-card .account-card-new-id code {
  overflow: hidden;
  padding: 0;
  border: 0;
  background: none;
  color: #d8d9df;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.launcher-account-card .account-card-new-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: auto;
}
.launcher-account-card .account-action-btn {
  display: grid;
  min-height: 43px;
  place-items: center;
  gap: 1px;
  padding: 5px 3px;
  border-color: #30323b;
  border-radius: 9px;
  background: #15161b;
  color: #a7abb7;
}
.launcher-account-card .account-action-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, #343640);
  background: color-mix(in srgb, var(--accent) 13%, #17181e);
  color: #fff;
}
.launcher-account-card .account-action-btn span:last-child {
  font-size: 7px;
  font-weight: 800;
}
.launcher-account-card .card-action-icon {
  font-size: 15px;
  line-height: 1;
}
.launcher-account-card.selected .account-card-new-title strong,
.launcher-account-card.selected .account-card-new-id code {
  color: #10141b;
}
.launcher-account-card.selected .account-card-new-title small,
.launcher-account-card.selected .account-card-new-id span {
  color: rgba(16, 20, 27, 0.65);
}
.launcher-account-card.selected .account-card-new-id,
.launcher-account-card.selected .account-action-btn {
  border-color: rgba(15, 21, 28, 0.2);
  background: rgba(255, 255, 255, 0.52);
  color: #10141b;
}
.launcher-account-card > .custom-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
@media (max-width: 720px) {
  .launcher-home-heading h2 {
    font-size: 23px;
  }
  .web-home-action-rail {
    align-items: flex-start;
  }
  .web-home-action-rail > strong {
    display: none;
  }
  .web-home-action-rail {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
    overflow: hidden;
  }
  .web-home-action-rail > div {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 100%;
    padding: 2px 4px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 4px;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }
  .web-home-action-rail button {
    flex-shrink: 0;
    scroll-snap-align: start;
  }
  .web-home-action-rail > div::-webkit-scrollbar { height: 3px; }
  .web-home-action-rail > div::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 70%, transparent);
  }
  .home-category {
    padding: 11px;
  }
  .home-category > header {
    align-items: flex-start;
  }
  .home-category-actions {
    max-width: 56%;
    overflow-x: auto;
  }
  .home-category-cards .launcher-account-card {
    width: 248px;
    max-width: 248px;
    flex-basis: 248px;
  }
}

/* Launcher theme parity */
.has-app-background > .app-shell,
.has-app-background > .login-shell,
.has-app-background > dialog {
  position: relative;
  z-index: 1;
}
body.has-app-background::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background-image:
    linear-gradient(rgba(5, 8, 13, 0.42), rgba(5, 8, 13, 0.7)),
    var(--app-background-image);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: scroll;
  transform: translateZ(0);
  content: "";
  pointer-events: none;
}
.has-app-background .web-page {
  background: transparent !important;
}
.has-app-background #app,
.has-app-background #app > main {
  background: transparent !important;
}
.has-app-background .sidebar,
.has-app-background .topbar {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
}
#toast-stack {
  position: fixed !important;
  z-index: 10000 !important;
  right: 20px !important;
  bottom: 20px !important;
  left: auto !important;
  top: auto !important;
  width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}
#toast-stack .toast {
  width: 100%;
  min-width: 0;
  pointer-events: auto;
}
select {
  appearance: none;
  background-color: color-mix(in srgb, var(--bg) 82%, #20222a);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 52%,
    calc(100% - 11px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, #31333d);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 34px 11px 12px;
}
select option {
  background: color-mix(in srgb, var(--bg) 88%, #20222a);
  color: var(--text);
}
.launcher-nav-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  overflow: visible;
}
.mobile-nav .launcher-nav-icon { width: 21px; height: 21px; }
.mobile-more-menu .launcher-nav-icon { width: 19px; height: 19px; }
.account-picker-menu {
  border-color: color-mix(in srgb, var(--accent) 45%, #30323b) !important;
  background: color-mix(in srgb, var(--bg) 94%, #1a1720) !important;
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(var(--accent-rgb), 0.12) !important;
}
.account-picker-item {
  grid-template-columns: 42px minmax(0, 1fr) 24px !important;
  min-height: 58px !important;
  border: 1px solid transparent !important;
  border-radius: 11px !important;
}
.account-picker-item:hover,
.account-picker-item.active {
  border-color: color-mix(in srgb, var(--accent) 45%, #30323b) !important;
  background: rgba(var(--accent-rgb), 0.17) !important;
}
.account-picker-item .avatar {
  width: 38px !important;
  height: 38px !important;
}
.account-picker-item i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--accent) !important;
}
.account-picker-item.active i {
  background: var(--accent);
  color: #fff !important;
}
.thread {
  position: relative;
  isolation: isolate;
}
.thread::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background: #0a0b0f;
}
.thread.has-conversation-background::before {
  background:
    linear-gradient(rgba(4, 5, 8, 0.58), rgba(4, 5, 8, 0.72)),
    var(--conversation-background) center/cover no-repeat fixed;
}
.thread.has-conversation-video-background::before { background: rgba(4,5,8,.24); }
.conversation-background-video {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.thread.has-conversation-video-background::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(4,5,8,.24);
  pointer-events: none;
}
.thread.has-conversation-background > header,
.thread.has-conversation-background .composer {
  background: rgba(13, 14, 19, 0.82);
  backdrop-filter: blur(14px);
}
.chat-profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.14);
  font-size: 8px;
  font-weight: 800;
}
.chat-profile-tag img {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  object-fit: cover;
}
.message-body > header {
  flex-wrap: wrap;
}
.chat-mention {
  display: inline-block;
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.24);
  color: color-mix(in srgb, var(--accent) 70%, white);
  font-weight: 700;
}
.inline-emoji {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  object-fit: contain;
}
.gif-embed {
  position: relative;
  width: min(420px, 100%);
  margin-top: 7px;
}
.gif-embed img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  border-radius: 12px;
  object-fit: contain;
  background: #050508;
}
.gif-embed button {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  background: rgba(8, 9, 13, 0.86);
  color: var(--accent);
  font-size: 20px;
  opacity: 0;
  transform: none;
}
.gif-embed:hover button,
.gif-embed button.active {
  opacity: 1;
}
.gif-embed button.active {
  background: var(--accent);
  color: white;
}
.composer-main {
  position: relative;
}
.composer-autocomplete {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, #30323b);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 92%, #20212a);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7);
}
.composer-autocomplete button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  background: transparent;
  text-align: left;
  transform: none;
}
.composer-autocomplete button.selected,
.composer-autocomplete button:hover {
  background: rgba(var(--accent-rgb), 0.18);
}
.composer-autocomplete .avatar,
.composer-autocomplete img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.composer-autocomplete button > span {
  display: grid;
}
.composer-autocomplete small {
  color: var(--muted);
  font-size: 9px;
}
.profile-editor-grid,
.theme-settings-grid,
.settings-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.settings-dashboard {
  display: grid;
  gap: 14px;
  max-width: 1050px;
}
.settings-tabs {
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 88%, #191a21);
}
.settings-tabs button {
  border: 0;
  background: transparent;
  transform: none;
}
.settings-tabs button.active {
  background: rgba(var(--accent-rgb), 0.2);
}
.settings-section {
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, #30313a);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 86%, #181920);
}
.settings-section > header,
.settings-profile-card,
.connection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.settings-section h3 {
  margin: 3px 0 5px;
}
.settings-section p {
  margin: 0 0 14px;
  color: var(--muted);
}
.theme-settings-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}
.theme-settings-grid input[type="color"] {
  height: 45px;
  padding: 4px;
}
.theme-settings-grid .wide-field,
.settings-check {
  grid-column: 1/-1;
}
.settings-check {
  display: flex !important;
  align-items: center !important;
}
.settings-check input {
  width: 18px;
}
.settings-profile-card {
  justify-content: flex-start;
}
.settings-profile-card > .avatar {
  width: 58px;
  height: 58px;
}
.settings-profile-card > div:nth-child(2) {
  flex: 1;
}
.connection-summary > span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #4a1d25;
  color: #ff8794;
  font-size: 10px;
}
.connection-summary > span.online {
  background: #163a2d;
  color: #55dfa5;
}
.locker-web-modal {
  padding: 30px !important;
}
.locker-web-modal > article {
  display: grid !important;
  grid-template-columns: minmax(230px, 0.85fr) minmax(300px, 1.15fr) !important;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto !important;
  column-gap: 28px !important;
  width: min(900px, calc(100vw - 40px)) !important;
  max-height: min(760px, calc(100vh - 60px)) !important;
  overflow: auto !important;
}
.locker-web-modal > article > img {
  grid-row: 1/-1 !important;
  width: 100% !important;
  max-height: 650px !important;
  object-fit: contain !important;
  border-radius: 18px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.18), transparent 70%);
}
.locker-style-picker {
  overflow: auto !important;
  max-height: 300px !important;
  padding-right: 6px;
}
.locker-equip-button {
  position: sticky;
  bottom: 0;
  min-height: 46px;
}
.locker-modal-close {
  z-index: 3;
}
@media (max-width: 700px) {
  .profile-editor-grid,
  .theme-settings-grid,
  .settings-two-column {
    grid-template-columns: 1fr;
  }
  .locker-web-modal > article {
    display: block !important;
  }
  .locker-web-modal > article > img {
    max-height: 280px !important;
    margin-bottom: 16px;
  }
  .settings-profile-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
.gif-favorites-wrap {
  position: relative;
}
.gif-favorites-menu {
  position: absolute;
  z-index: 70;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 6px;
  width: min(390px, 75vw);
  max-height: 320px;
  padding: 8px;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, #30323b);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg) 92%, #20212a);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}
.gif-favorites-menu button {
  position: relative;
  overflow: hidden;
  min-height: 90px;
  padding: 0;
  border: 0;
  background: #08090d;
  transform: none;
}
.gif-favorites-menu img {
  width: 100%;
  height: 100%;
  min-height: 90px;
  object-fit: cover;
}
.gif-favorites-menu button span {
  position: absolute;
  inset: auto 0 0;
  padding: 5px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  font-size: 9px;
}
.gif-favorites-menu p {
  grid-column: 1/-1;
  margin: 0;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}
.image-upload-control {
  display: flex;
  align-items: stretch;
  gap: 7px;
  margin-top: 8px;
}
.custom-file-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  flex: 1;
  padding: 7px 10px;
  text-align: left;
  transform: none;
}
.custom-file-button > span:last-child {
  display: grid;
}
.custom-file-button small {
  color: var(--muted);
  font-size: 9px;
}
.file-image-preview {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 9px;
  background: rgba(var(--accent-rgb), 0.12) center/cover no-repeat;
  color: var(--accent);
}
.owner-web-editor {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.07);
}
.owner-web-editor header h3 {
  margin: 3px 0;
}
.owner-badge-list {
  display: grid;
  gap: 6px;
}
.owner-badge-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.22);
}
.owner-badge-list p {
  color: var(--muted);
  font-size: 11px;
}
.owner-badge-builder {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(200px, 1.5fr) auto;
  align-items: end;
  gap: 8px;
}
.owner-badge-builder label {
  margin: 0 !important;
}
@media (max-width: 700px) {
  .owner-badge-builder {
    grid-template-columns: 1fr;
  }
  .image-upload-control {
    flex-wrap: wrap;
  }
}

/* Match the launcher's compact account selector and isolate it from legacy status-dot styles. */
.top-actions > .account-picker .account-picker-menu {
  right: 0;
  width: 300px;
  max-height: min(440px, 68vh);
  padding: 7px;
  border-color: #343640;
  border-radius: 10px;
  background: linear-gradient(180deg, #14151a, #101116);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.68);
}
.top-actions > .account-picker .account-picker-menu label {
  gap: 6px;
  padding: 4px 4px 8px;
  font-size: 7px;
}
.top-actions > .account-picker .account-picker-menu input {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
}
.top-actions > .account-picker #account-picker-list {
  max-height: 350px;
  gap: 2px;
  padding-right: 2px;
}
.top-actions > .account-picker .account-picker-item {
  min-height: 44px !important;
  padding: 5px 7px !important;
  border-radius: 8px !important;
  background: transparent !important;
}
.top-actions > .account-picker .account-picker-item:hover {
  background: #1a1b22 !important;
}
.top-actions > .account-picker .account-picker-item.active {
  border-color: color-mix(in srgb, var(--accent) 58%, #353741) !important;
  background: color-mix(in srgb, var(--accent) 18%, #171820) !important;
}
.top-actions > .account-picker .account-picker-item > .avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  font-size: 11px;
}
.top-actions > .account-picker .account-picker-copy {
  gap: 0;
}
.top-actions > .account-picker .account-picker-copy strong {
  font-size: 10px;
}
.top-actions > .account-picker .account-picker-item > i {
  display: grid !important;
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  place-items: center;
  border-radius: 50%;
  background: transparent !important;
  color: transparent;
  font-size: 11px;
  font-style: normal;
}
.top-actions > .account-picker .account-picker-item.active > i {
  background: var(--accent) !important;
  color: white;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  grid-template-columns: none;
  padding: 32px 20px;
}

.login-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.login-art {
  display: none;
}

.login-card {
  position: relative;
  align-self: auto;
  width: min(420px, 100%);
  margin: 0;
  padding: 30px;
  border: 1px solid #292a32;
  border-radius: 16px;
  background: #111217;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
  backdrop-filter: none;
}

.login-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 28px;
  right: 28px;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 34px;
}

.mobile-logo b {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  box-shadow: none;
  font-size: 15px;
}

.mobile-logo span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.login-card > small {
  color: #aaa5b5;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.login-card h2 {
  margin: 8px 0 9px;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.login-card > p {
  max-width: 350px;
  margin-bottom: 25px;
  color: #9698a5;
  font-size: 12px;
  line-height: 1.55;
}

.login-card label {
  gap: 8px;
  margin: 14px 0;
  color: #c7c8d0;
  font-size: 11px;
}

.login-card input {
  min-height: 44px;
  border-color: #2c2d35;
  border-radius: 9px;
  background: #0b0c10;
  padding: 11px 12px;
}

.login-card input:focus {
  border-color: color-mix(in srgb, var(--accent) 72%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

.login-card button.wide {
  min-height: 44px;
  margin-top: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 74%, #fff 8%);
  border-radius: 9px;
  background: var(--accent);
  box-shadow: none;
  padding: 10px 13px;
  font-size: 12px;
}

.login-card button.wide:hover {
  filter: brightness(1.08);
  transform: none;
}

.login-card button.wide i {
  font-style: normal;
}

.form-error {
  margin-top: 10px;
  font-size: 11px;
}

@media (max-width: 900px) {
  .login-shell {
    padding: 20px;
  }

  .login-card {
    min-height: 0;
    width: min(420px, 100%);
    padding: 26px;
    border: 1px solid #292a32;
    border-radius: 15px;
  }
}

@media (max-width: 480px) {
  .login-shell {
    align-items: start;
    padding: max(22px, env(safe-area-inset-top)) 14px 20px;
  }

  .login-card {
    margin-top: 5vh;
    padding: 23px 20px;
  }

  .mobile-logo {
    margin-bottom: 29px;
  }
}

/* Companion app: follow the launcher's chat proportions and hierarchy. */
#overview-view {
  display: none !important;
}

.app-shell {
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
  background: #08090d;
}

.sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right-color: #25262d;
  background: #0d0e12;
}

.sidebar .logo {
  min-height: 74px;
}
.sidebar nav {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.sidebar nav button {
  flex: 0 0 auto;
  border-radius: 7px;
}
.sidebar nav button.active {
  background: color-mix(in srgb, var(--accent) 15%, #15161c);
}
.sidebar-profile {
  cursor: pointer;
}

main {
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  padding: 0 18px 18px;
}

.topbar {
  min-height: 74px;
  border-bottom: 0;
}

.topbar small {
  display: none;
}
.topbar h1 {
  font-size: 23px;
  letter-spacing: -0.025em;
}

.chat-layout.active {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  height: calc(100vh - 92px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #292a31;
  border-radius: 12px;
  background: #090a0e;
}

.conversation-pane {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid #292a31;
  background: #0d0e12;
}

.pane-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 11px 13px 8px;
  border-bottom: 1px solid #25262d;
}

.pane-head h2 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pane-head > button {
  padding: 6px 10px;
  font-size: 11px;
}
.pane-head input {
  display: none;
}

.conversation-list {
  min-height: 0;
  height: auto;
  flex: 1 1 auto;
  padding: 7px;
  overflow-x: hidden;
  overflow-y: auto;
}

.conversation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 0;
  gap: 9px;
  margin: 2px 0;
  padding: 9px;
  border-color: transparent;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.conversation .avatar {
  width: 38px;
  height: 38px;
}
.conversation-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.conversation-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-copy .conversation-custom-status {
  color: color-mix(in srgb, var(--accent) 72%, #b8c7e6);
}
.conversation-copy .conversation-typing {
  font-weight: 700;
}
.conversation-typing.status-online { color: #23a55a !important; }
.conversation-typing.status-idle { color: #f0b232 !important; }
.conversation-typing.status-dnd { color: #f23f43 !important; }
.conversation-typing.status-offline { color: #80848e !important; }
.conversation-typing.status-coding { color: #c678ff !important; }
.conversation-typing.status-scamming { color: #ff9933 !important; }
.conversation:hover {
  transform: none;
  background: color-mix(in srgb, var(--surface2) 75%, transparent);
}
.conversation.active {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface2));
}
.conversation-meta {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  align-items: flex-end;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}
.conversation-meta b {
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-size: 8px;
}

.thread {
  min-height: 0;
  grid-template-rows: 66px minmax(0, 1fr) auto;
  background: #090a0e;
}

.thread > header {
  min-width: 0;
  padding: 10px 16px;
  border-bottom: 1px solid #292a31;
  background: #0d0e12;
}

.thread > header .avatar {
  width: 39px;
  height: 39px;
}
.thread > header strong {
  font-size: 13px;
}
.thread > header span {
  margin-top: 2px;
}

.message-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px max(18px, 3vw) 14px;
  scroll-behavior: auto;
}

.message {
  position: relative;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 7px 10px;
  border-radius: 5px;
}

.message:hover {
  background: rgba(255, 255, 255, 0.025);
}
.message.grouped {
  padding-top: 2px;
  padding-bottom: 2px;
}
.message .avatar {
  width: 39px;
  height: 39px;
  border-radius: 50%;
}
.avatar-spacer {
  width: 39px;
}
.message-body {
  min-width: 0;
  max-width: 920px;
}
.message-body header {
  min-height: 18px;
}
.message-body header strong {
  color: #f4f4f7;
  font-size: 13px;
}
.message-body header time {
  margin-left: 1px;
  color: #777a87;
  font-size: 8px;
}
.message-body > p {
  margin: 2px 0;
  color: #f0f0f3;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message-body > p a {
  color: color-mix(in srgb, var(--accent) 70%, #8ebcff);
  text-decoration: none;
}
.message-body > p a:hover {
  text-decoration: underline;
}
.inline-emoji {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  object-fit: contain;
}
.message-deleted {
  color: #777a87 !important;
  font-style: italic;
}

.reply-reference {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin: 0 0 5px;
  color: #8b8e9d;
  font-size: 10px;
}
.reply-reference strong {
  flex: 0 0 auto;
  color: #b8bac5;
}
.reply-reference span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forwarded-label {
  margin-bottom: 3px;
  color: #989baa;
  font-size: 9px;
  font-weight: 700;
}

.message-image {
  display: block;
  width: fit-content;
  max-width: min(520px, 100%);
  margin-top: 7px;
}
.message-image img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 430px;
  border-radius: 8px;
  object-fit: contain;
}
.message-media {
  display: grid;
  width: min(620px, 100%);
  gap: 5px;
  margin-top: 7px;
}
.message-media video {
  width: 100%;
  max-height: 440px;
  border-radius: 8px;
  background: #000;
}
.message-media > span {
  color: #8d909e;
  font-size: 9px;
}

.message-file,
.message-audio {
  display: flex;
  width: min(430px, 100%);
  align-items: center;
  gap: 11px;
  margin-top: 7px;
  padding: 11px;
  border: 1px solid #2b2c34;
  border-radius: 9px;
  background: #111218;
  color: #f2f2f5;
  text-decoration: none;
}
.message-file > div:last-child,
.message-audio > div:last-child {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.message-file strong,
.message-audio strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-file span,
.message-audio span {
  color: #858896;
  font-size: 9px;
}
.message-audio audio {
  width: 100%;
  height: 31px;
  margin-top: 5px;
}
.file-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 22%, #171820);
  color: var(--accent);
  font-size: 17px;
}

.share-card,
.call-embed {
  display: grid;
  width: min(460px, 100%);
  gap: 4px;
  margin-top: 7px;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, #30313a);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #111218;
}
.share-card small,
.call-embed small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.share-card span {
  color: #9295a3;
  font-size: 10px;
  text-transform: capitalize;
}
.call-embed {
  grid-template-columns: 34px 1fr;
  align-items: center;
}
.call-embed > div:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, #15161b);
  color: var(--accent);
}
.call-embed > div:last-child {
  display: grid;
  gap: 3px;
}
.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.reaction {
  padding: 3px 7px;
  border: 1px solid #30313a;
  border-radius: 10px;
  background: #14151b;
  font-size: 10px;
}
.reaction.mine {
  border-color: color-mix(in srgb, var(--accent) 65%, #30313a);
  background: color-mix(in srgb, var(--accent) 12%, #14151b);
}
.message-actions {
  position: absolute;
  z-index: 2;
  top: -12px;
  right: 10px;
  display: none;
  gap: 2px;
  padding: 3px;
  border: 1px solid #30313a;
  border-radius: 7px;
  background: #15161c;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.35);
}
.message:hover .message-actions,
.message-actions:focus-within {
  display: flex;
}
.message-actions button {
  width: 29px;
  height: 27px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
}
.message-actions button:hover {
  background: #242630;
  transform: none;
}
.presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border: 3px solid #0d0e12;
  border-radius: 50%;
  background: #747780;
}
.avatar-presence {
  position: relative;
  overflow: visible;
}
.presence-dot.online {
  background: #23a55a;
}
.presence-dot.idle {
  background: #f0b232;
}
.presence-dot.dnd {
  background: #f23f43;
}
.presence-dot.coding {
  background: #c678ff;
}
.typing-dots {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}
.typing-dots span {
  display: inline-block;
  animation: typing-pulse 1s steps(3, end) infinite;
}
@keyframes typing-pulse {
  50% {
    opacity: 0.3;
  }
}

.load-older {
  display: block;
  margin: 0 auto 14px;
  padding: 7px 12px;
  font-size: 10px;
}
.loading-spinner {
  width: 25px;
  height: 25px;
  margin: 0 auto 12px;
  border: 2px solid #30313b;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: companion-spin 0.7s linear infinite;
}
@keyframes companion-spin {
  to {
    transform: rotate(360deg);
  }
}

.composer {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  margin: 0 16px 15px;
  padding: 6px;
  border-color: #30313a;
  border-radius: 11px;
  background: #14151a;
}
.composer textarea {
  min-height: 38px;
  padding: 9px 8px;
  line-height: 20px;
}
.composer-add {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  color: #a6a8b2;
  font-size: 20px;
}
.composer-add:disabled {
  opacity: 0.65;
}
.composer-schedule {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  color: #a6a8b2;
  font-size: 15px;
}
.composer .primary {
  min-width: 64px;
  height: 36px;
}
.composer-main {
  display: grid;
  min-width: 0;
  gap: 6px;
}
.attachment-queue:empty {
  display: none;
}
.attachment-queue {
  display: grid;
  gap: 6px;
  padding: 4px 2px 0;
}
.attachment-queued {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #30313a;
  border-radius: 9px;
  background: #14151a;
  overflow: hidden;
}
.attachment-queued .queue-file-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 22%, #171820);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
}
.attachment-queued > div {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.attachment-queued strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-queued small {
  color: #9295a3;
  font-size: 9px;
}
.attachment-queued.failed small {
  color: var(--bad);
}
.attachment-queued button {
  padding: 4px 8px;
  font-size: 9px;
}
.attachment-queued > button.remove-queued {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9295a3;
  font-size: 14px;
}
.attachment-progress-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.15s ease;
}
.composer.replying::before { display: none; }
.reply-preview {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px 8px 8px 11px;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}
.reply-preview.hidden { display: none; }
.reply-preview > span { display: grid; min-width: 0; flex: 1; grid-template-columns: auto minmax(0,1fr); gap: 2px 6px; }
.reply-preview small { color: var(--muted); font-size: 9px; }
.reply-preview strong { overflow: hidden; color: var(--accent); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reply-preview em { grid-column: 1 / -1; overflow: hidden; color: #b3b5bf; font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.reply-preview button { width: 30px; height: 30px; padding: 0; border-radius: 50%; color: #c8cad3; font-size: 20px; }
#chat-view .composer.replying { grid-template-rows: auto auto; }
#chat-view .composer.replying .reply-preview { grid-row: 1; }
#chat-view .composer.replying .attachment-menu-wrap,
#chat-view .composer.replying .composer-main,
#chat-view .composer.replying .gif-favorites-wrap,
#chat-view .composer.replying #schedule-send-button { grid-row: 2; }
.chat-back {
  display: none;
  width: 34px;
  height: 34px;
  padding: 0;
  margin-left: 0 !important;
  font-size: 25px;
}
.mobile-nav {
  grid-template-columns: repeat(4, 1fr);
}

.web-page {
  height: calc(100vh - 92px);
  overflow-y: auto;
  padding: 4px 0 32px;
}
.web-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 4px 20px;
  border-bottom: 1px solid #292a31;
}
.web-page-heading small {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}
.web-page-heading h2 {
  margin: 5px 0 4px;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.web-page-heading p {
  margin: 0;
  color: #9295a3;
}
.web-live {
  display: none !important;
}
.web-page-content {
  padding: 18px 4px;
}
.web-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.web-home-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.web-home-toolbar span {
  color: #9295a3;
  font-size: 10px;
}
.web-account-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #292a31;
  border-radius: 12px;
  background: #101116;
}
.web-account-card.selected {
  border-color: color-mix(in srgb, var(--accent) 66%, #34353e);
  box-shadow: inset 3px 0 var(--accent);
}
.web-account-card header {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}
.web-account-card header > div:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.web-account-card header span {
  overflow: hidden;
  color: #9295a3;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.web-account-card header b {
  color: var(--accent);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.web-account-card code {
  overflow: hidden;
  padding: 8px;
  border: 1px solid #272831;
  border-radius: 7px;
  background: #090a0e;
  color: #9699a8;
  font-size: 8px;
  text-overflow: ellipsis;
}
.web-account-card select {
  min-height: 35px;
  padding: 7px 9px;
  font-size: 10px;
}
.web-account-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.web-account-card footer button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 9px;
}
.web-account-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid #292a31;
  border-radius: 11px;
  background: #101116;
}
.web-account-row > div:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}
.web-account-row strong {
  font-size: 12px;
}
.web-account-row span {
  overflow: hidden;
  color: #7e8190;
  font-family: monospace;
  font-size: 8px;
  text-overflow: ellipsis;
}
.web-feature-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 16px;
  border: 1px solid #292a31;
  border-radius: 12px;
  background: #101116;
}
.web-feature-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 17%, #16171d);
  color: var(--accent);
  font-size: 20px;
}
.web-feature-card h3,
.web-settings h3 {
  margin: 0 0 4px;
  font-size: 14px;
}
.web-feature-card p,
.web-settings p {
  margin: 0;
  color: #9295a3;
  font-size: 11px;
}
.web-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}
.web-settings article {
  min-height: 150px;
  padding: 17px;
  border: 1px solid #292a31;
  border-radius: 12px;
  background: #101116;
}
.web-settings article > button,
.web-settings article > select {
  margin-top: 22px;
}
.web-tool {
  display: flex;
  gap: 8px;
  max-width: 620px;
}
.web-tool input {
  flex: 1;
}
.web-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-bottom: 12px;
}
.web-list-toolbar span {
  margin-right: auto;
  color: #9295a3;
  font-size: 10px;
}
.web-friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 9px;
}
.web-friend-grid article {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #292a31;
  border-radius: 11px;
  background: #101116;
}
.web-friend-grid article > div:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}
.web-friend-grid strong {
  font-size: 11px;
}
.web-friend-grid span {
  overflow: hidden;
  color: #858896;
  font-family: monospace;
  font-size: 8px;
  text-overflow: ellipsis;
}
.web-friend-grid button {
  padding: 6px 8px;
  font-size: 8px;
}
.web-record-list {
  display: grid;
  gap: 8px;
}
.web-record-list article {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 13px;
  border: 1px solid #292a31;
  border-radius: 10px;
  background: #101116;
}
.web-record-list article > div {
  display: grid;
  min-width: 120px;
  flex: 1 1 140px;
  gap: 4px;
}
.web-record-list article > div:first-child {
  flex: 1 1 220px;
  min-width: 180px;
}
.web-record-list small {
  color: #777a89;
  font-size: 8px;
  letter-spacing: 0.08em;
}
.web-record-list strong,
.web-record-list span {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  word-break: break-word;
}
.web-record-list article > button {
  flex: 0 0 auto;
  margin-left: auto;
}

.top-actions > .account-picker {
  position: relative;
  display: block;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.account-picker #account-picker-button {
  display: flex;
  width: 258px;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-color: color-mix(in srgb, #343640 64%, var(--accent) 36%);
  background: linear-gradient(180deg, color-mix(in srgb, #181920 90%, var(--accent) 10%), #101116);
  text-align: left;
}
.account-picker #account-picker-button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.account-picker small {
  color: #858896;
  font-size: 7px;
  letter-spacing: 0.12em;
}
.account-picker strong {
  overflow: hidden;
  color: #f4f4f7;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-picker b {
  color: var(--accent);
  transition: transform 0.14s ease;
}
.account-picker #account-picker-button.is-open b {
  transform: rotate(180deg);
}
#account-picker-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}
.account-picker-menu {
  position: absolute;
  z-index: 12050;
  top: calc(100% + 7px);
  right: 0;
  display: block !important;
  width: min(390px, calc(100vw - 24px));
  max-height: min(600px, 76vh);
  padding: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #343640 72%, var(--accent) 28%);
  border-radius: 12px;
  background: linear-gradient(180deg, #15161c, #0f1015);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.78),
    0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.account-picker-menu.hidden {
  display: none !important;
}
.account-picker-menu label {
  display: grid;
  gap: 7px;
  padding: 3px 3px 10px;
  color: #858896;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.account-picker-menu input {
  min-height: 39px;
  border-color: color-mix(in srgb, #343640 58%, var(--accent) 42%);
  background: #0b0c10;
}
.account-picker-menu input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}
#account-picker-list {
  display: grid;
  max-height: 480px;
  gap: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 3px;
}
.account-picker-item {
  display: flex !important;
  width: 100% !important;
  min-width: 0;
  min-height: 52px !important;
  align-items: center;
  gap: 10px;
  padding: 7px 9px !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  background: #111218 !important;
  text-align: left;
}
.account-picker-item:hover,
.account-picker-item.active {
  border-color: color-mix(in srgb, var(--accent) 40%, #30323b) !important;
  background: color-mix(in srgb, var(--accent) 18%, #15161c) !important;
}
.account-picker-item > .avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}
.account-picker-copy {
  display: grid !important;
  min-width: 0;
  flex: 1;
  gap: 3px;
}
.account-picker-copy strong,
.account-picker-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-picker-copy strong {
  color: #f4f4f7;
  font-size: 11px;
}
.account-picker-copy small {
  color: #777b89;
  font-family: monospace;
  font-size: 7px;
}
.account-picker-item > i {
  flex: 0 0 16px;
  color: var(--accent);
  font-style: normal;
}
.account-picker-empty {
  margin: 12px;
  color: #858896;
  text-align: center;
}
.party-grid,
.external-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
}
.party-grid article,
.external-grid article {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #2c2e37;
  border-radius: 12px;
  background: #101116;
}
.party-grid article > div:nth-child(2),
.external-grid article > div:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}
.party-grid small,
.external-grid small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.party-grid strong,
.external-grid strong {
  font-size: 12px;
}
.party-grid span,
.external-grid span {
  overflow: hidden;
  color: #858896;
  font-size: 8px;
  text-overflow: ellipsis;
}
.party-grid footer {
  display: flex;
  gap: 4px;
}
.party-grid footer button,
.external-grid button {
  padding: 7px 8px;
  font-size: 8px;
}
.party-skin {
  display: grid;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 25%, #171820), #0b0c10);
}
.party-skin img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.self-pill {
  color: #52d78a;
  font-size: 8px;
}
.external-logo {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 18%, #171820);
  color: var(--accent);
  font-weight: 900;
}
.manage-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px;
  border: 1px solid #2d2f38;
  border-radius: 13px;
  background: #101116;
}
.manage-hero .avatar {
  width: 55px;
  height: 55px;
}
.manage-hero > div:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.manage-hero small,
.manage-grid small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
}
.manage-hero h3 {
  margin: 0;
  font-size: 20px;
}
.manage-hero span {
  color: #858896;
  font-family: monospace;
  font-size: 8px;
}
.manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 9px;
  margin-top: 10px;
}
.manage-grid article {
  display: grid;
  gap: 7px;
  min-height: 82px;
  padding: 15px;
  border: 1px solid #292b34;
  border-radius: 11px;
  background: #101116;
}
.manage-grid strong {
  font-size: 12px;
}
.danger-zone {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(242, 63, 67, 0.3);
  border-radius: 12px;
  background: rgba(242, 63, 67, 0.045);
}
.danger-zone > div {
  flex: 1;
}
.danger-zone h3 {
  margin: 0 0 4px;
}
.danger-zone p {
  margin: 0;
  color: #8f929f;
  font-size: 10px;
}
.manage-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.manage-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
}
.manage-info-grid {
  display: grid;
  gap: 8px;
}
.manage-info-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #292a31;
  border-radius: 10px;
  background: #0d0e13;
}
.manage-info-label {
  color: #9295a3;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
}
.manage-info-value {
  color: #f0f0f3;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.manage-info-value.mono {
  font-family: monospace;
  font-size: 10px;
}
.manage-info-row.sensitive .manage-info-value {
  filter: blur(6px);
  transition: filter 0.14s ease;
  user-select: none;
}
.manage-info-row.sensitive:hover .manage-info-value,
.manage-info-row.sensitive:focus-within .manage-info-value {
  filter: blur(0);
  user-select: text;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid #30323b;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.status-chip.is-true {
  border-color: rgba(86, 179, 118, 0.7);
  background: rgba(38, 77, 50, 0.55);
  color: #d9ffe6;
}
.status-chip.is-false {
  border-color: rgba(204, 103, 118, 0.72);
  background: rgba(83, 34, 45, 0.54);
  color: #ffdbe2;
}
.status-chip.is-unknown {
  border-color: #30323b;
  background: #171820;
  color: #9295a3;
}
.locker-web-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 13px;
}
.locker-web-toolbar label {
  display: grid;
  width: min(430px, 100%);
  gap: 6px;
  color: #8c8f9d;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.locker-web-toolbar span {
  margin-left: auto;
  color: #858896;
  font-size: 9px;
}
.locker-web-toolbar span strong {
  color: #f3f3f5;
  font-size: 15px;
}
.locker-web-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.locker-web-card {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 0 0 11px;
  overflow: hidden;
  border-radius: 11px;
  text-align: left;
}
.locker-web-card > div {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(
    circle at 50% 85%,
    color-mix(in srgb, var(--accent) 32%, #1a1b22),
    #111218 70%
  );
}
.locker-web-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.18s ease;
}
.locker-web-card:hover img {
  transform: scale(1.04);
}
.locker-web-card div small {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.68);
}
.locker-web-card > strong,
.locker-web-card > span {
  overflow: hidden;
  padding: 0 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.locker-web-card > strong {
  font-size: 11px;
}
.locker-web-card > span {
  color: #858896;
  font-size: 8px;
}
.locker-web-modal {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
}
.locker-web-modal article {
  position: relative;
  display: grid;
  width: min(760px, 92vw);
  max-height: 90vh;
  gap: 8px;
  padding: 24px;
  overflow-y: auto;
  border: 1px solid #363842;
  border-radius: 16px;
  background: #111218;
}
.locker-web-modal img {
  width: min(430px, 100%);
  max-height: 48vh;
  margin: 0 auto;
  object-fit: contain;
}
.locker-web-modal h2 {
  margin: 0;
  font-size: 25px;
}
.locker-web-modal p {
  color: #a0a2ae;
}
.locker-web-modal code {
  overflow-wrap: anywhere;
  color: #777b8b;
}
.locker-modal-close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  width: 37px;
  height: 37px;
  padding: 0;
  font-size: 22px;
}
.locker-style-picker {
  display: grid;
  gap: 10px;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid #292a31;
  border-radius: 11px;
  background: #0d0e13;
}
.locker-style-picker > small {
  color: #9295a3;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.locker-style-picker > div {
  display: grid;
  gap: 6px;
}
.locker-style-picker strong {
  font-size: 10px;
  color: #c7c8d2;
  text-transform: capitalize;
}
.locker-style-picker span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.locker-style-picker button {
  padding: 6px 10px;
  font-size: 9px;
  border-radius: 7px;
}
.locker-style-picker button.selected {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #6c22e8);
}
.locker-equip-button {
  width: 100%;
  margin-top: 8px;
  height: 42px;
}
.home-category {
  min-width: 0;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #292b34;
  border-radius: 13px;
  background: rgba(16, 17, 22, 0.72);
  contain: layout paint style;
}
.home-category > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 3px;
}
.home-category > header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.home-category > header i {
  width: 3px;
  height: 17px;
  border-radius: 2px;
  background: var(--accent);
}
.home-category h3 {
  margin: 0;
  font-size: 12px;
}
.home-category header span {
  color: #858896;
  font-size: 9px;
}
.home-category-cards {
  display: flex;
  min-width: 0;
  align-items: stretch;
  gap: 12px;
  padding-bottom: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;
}
.home-category-cards::-webkit-scrollbar {
  height: 14px;
}
.home-category-cards::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 72%, #383a44);
  background-clip: padding-box;
}
.home-category-cards .web-account-card {
  width: 270px;
  max-width: 270px;
  flex: 0 0 270px;
  background: linear-gradient(145deg, #15161b, #0e0f13);
  contain: layout paint style;
}
.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.custom-select {
  position: relative;
  width: 100%;
}
.custom-select-trigger {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, #30323b 68%, var(--accent) 32%);
  border-radius: 8px;
  background: linear-gradient(180deg, #17181e, #101116);
  color: #f0f0f3;
  font-size: 10px;
  text-align: left;
}
.custom-select-trigger i {
  color: var(--accent);
  font-style: normal;
  transition: transform 0.14s ease;
}
.custom-select-trigger.is-open i {
  transform: rotate(180deg);
}
.custom-select-menu {
  position: fixed;
  z-index: 12500;
  display: grid;
  max-height: 230px;
  gap: 3px;
  padding: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, #353741 70%, var(--accent) 30%);
  border-radius: 9px;
  background: linear-gradient(180deg, #17181e, #101116);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.72),
    0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}
.custom-select-menu.hidden {
  display: none;
}
.custom-select-option {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  background: #121319;
  color: #e9e9ed;
  font-size: 9px;
  text-align: left;
}
.custom-select-option:hover,
.custom-select-option.active {
  border-color: color-mix(in srgb, var(--accent) 40%, #30323b);
  background: color-mix(in srgb, var(--accent) 18%, #15161c);
}

.web-dialog {
  width: min(520px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #34353f;
  border-radius: 15px;
  background: #111217;
  color: #f4f4f7;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72);
}
.web-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}
.web-dialog form {
  display: grid;
  gap: 14px;
  padding: 20px;
}
#profile-form {
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(760px, 88dvh);
}
.profile-form-scroll {
  display: grid;
  min-height: 0;
  gap: 14px;
  padding: 1px 3px 8px 1px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.web-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.web-dialog header small {
  color: var(--accent);
  font-size: 8px;
  letter-spacing: 0.12em;
}
.web-dialog h2 {
  margin: 4px 0 0;
}
.web-dialog header button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 20px;
}
.web-dialog label {
  display: grid;
  gap: 7px;
  color: #b7b9c3;
  font-size: 10px;
}
.web-dialog textarea {
  resize: vertical;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 5px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .chat-layout.active {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .account-picker #account-picker-button {
    width: 190px;
  }
}

.lookup-result {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #292a31;
  border-radius: 11px;
  background: #101116;
}
.settings-section {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #292a31;
  border-radius: 12px;
  background: #101116;
}
.settings-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
}
.settings-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.settings-field span {
  color: #9295a3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.suggestions-form-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.recent-deleted-list {
  display: grid;
  gap: 8px;
}
.recent-deleted-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #292a31;
  border-radius: 11px;
  background: #101116;
}
.recent-deleted-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.recent-deleted-info strong {
  font-size: 12px;
}
.recent-deleted-info span,
.recent-deleted-info small {
  overflow: hidden;
  color: #858896;
  font-size: 9px;
  text-overflow: ellipsis;
}
.recent-deleted-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.xmpp-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.xmpp-stat-card {
  padding: 14px;
  border: 1px solid #292a31;
  border-radius: 12px;
  background: #101116;
}
.xmpp-stat-card span {
  display: block;
  color: #9295a3;
  font-size: 10px;
}
.xmpp-stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}
.xmpp-controls {
  max-width: 100%;
}
.xmpp-controls input {
  flex: 1;
}
.xmpp-controls select {
  width: 170px;
  flex: 0 0 auto;
}
.web-friend-grid article.selected {
  border-color: color-mix(in srgb, var(--accent) 60%, #30323b);
  background: color-mix(in srgb, var(--accent) 10%, #101116);
}
.pane-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pane-head h2 {
  margin-right: auto;
}
.pane-head #new-chat-button {
  min-height: 32px;
  padding: 6px 14px;
  font-size: 11px;
}
.pane-head input {
  flex-basis: 100%;
}
.new-chat-dialog {
  width: min(560px, calc(100vw - 24px));
}
.new-chat-body {
  display: grid;
  gap: 14px;
  padding: 20px;
}
.new-chat-body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.new-chat-body header small {
  color: var(--accent);
  font-size: 8px;
  letter-spacing: 0.12em;
}
.new-chat-body header h2 {
  margin: 4px 0 0;
}
.new-chat-body header button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 20px;
}
.new-chat-tabs {
  display: flex;
  gap: 6px;
}
.new-chat-tabs button {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
}
.new-chat-tabs button.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #6c22e8);
}
.new-chat-panel {
  display: grid;
  gap: 10px;
}
.new-chat-panel.hidden {
  display: none;
}
.new-chat-results {
  display: grid;
  gap: 4px;
  max-height: 340px;
  overflow-y: auto;
}
.new-chat-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: left;
}
.new-chat-result:hover {
  border-color: #30323b;
  background: #15161c;
  transform: none;
}
.new-chat-result.selected {
  border-color: color-mix(in srgb, var(--accent) 55%, #30323b);
  background: color-mix(in srgb, var(--accent) 14%, #15161c);
}
.new-chat-result .avatar {
  width: 34px;
  height: 34px;
}
.new-chat-result > div {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.new-chat-result strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.new-chat-result span {
  color: #9295a3;
  font-size: 9px;
}
.new-chat-empty {
  padding: 20px;
  color: #858896;
  font-size: 11px;
  text-align: center;
}
.new-chat-group-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.new-chat-group-selected span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #30323b;
  border-radius: 999px;
  background: #15161c;
  font-size: 10px;
}
.new-chat-group-selected button {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9295a3;
  font-size: 12px;
}
.send-later-dialog {
  width: min(520px, calc(100vw - 24px));
}
.send-later-body {
  display: grid;
  gap: 14px;
  padding: 20px;
}
.send-later-body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.send-later-body header small {
  color: var(--accent);
  font-size: 8px;
  letter-spacing: 0.12em;
}
.send-later-body header h2 {
  margin: 4px 0 0;
}
.send-later-body header button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 20px;
}
.send-later-body label {
  display: grid;
  gap: 6px;
  color: #b7b9c3;
  font-size: 10px;
}
.send-later-time-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 8px;
}
.send-later-list-wrap h3 {
  margin: 0 0 8px;
  font-size: 12px;
}
.send-later-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.send-later-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid #292a31;
  border-radius: 9px;
  background: #101116;
}
.send-later-item > div {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.send-later-item strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.send-later-item span {
  color: #9295a3;
  font-size: 9px;
}
.send-later-item button {
  padding: 5px 9px;
  font-size: 9px;
}
.send-later-empty {
  padding: 14px;
  color: #858896;
  font-size: 11px;
  text-align: center;
}
.attachment-menu-wrap {
  position: relative;
}
.attachment-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: grid;
  width: 230px;
  gap: 2px;
  padding: 6px;
  border: 1px solid #30313a;
  border-radius: 11px;
  background: linear-gradient(180deg, #17181e, #101116);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}
.attachment-menu.hidden {
  display: none;
}
.attachment-menu button {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  color: #f0f0f3;
  font-size: 11px;
  font-weight: 700;
}
.attachment-menu button:hover {
  background: #1c1d24;
  transform: none;
}
.attachment-menu button small {
  color: #9295a3;
  font-size: 9px;
  font-weight: 400;
}
.recorder-dialog {
  width: min(420px, calc(100vw - 24px));
}
.recorder-body {
  display: grid;
  gap: 14px;
  padding: 22px;
  text-align: center;
}
.recorder-body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}
.recorder-body header small {
  color: var(--accent);
  font-size: 8px;
  letter-spacing: 0.12em;
}
.recorder-body header h2 {
  margin: 4px 0 0;
  font-size: 15px;
}
.recorder-body header button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 20px;
}
.recorder-audio-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  color: #b7b9c3;
  font-size: 11px;
}
.recorder-audio-toggle input {
  width: auto;
}
.recorder-orb-wrap {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 14px 0;
}
.recorder-orb {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 20%, #171820);
  color: var(--accent);
  font-size: 28px;
  transition: box-shadow 0.2s ease;
}
.recorder-orb.recording {
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--bad) 22%, transparent);
  color: var(--bad);
  animation: recorder-pulse 1.4s ease-in-out infinite;
}
@keyframes recorder-pulse {
  50% {
    box-shadow: 0 0 0 14px color-mix(in srgb, var(--bad) 12%, transparent);
  }
}
.recorder-time {
  color: #9295a3;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.recorder-wave {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 36px;
}
.recorder-wave i {
  width: 3px;
  min-height: 4px;
  border-radius: 2px;
  background: var(--accent);
}
.active-call-bar {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #30313a;
  border-radius: 14px;
  background: linear-gradient(180deg, #17181e, #101116);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}
.active-call-bar.hidden {
  display: none;
}
.active-call-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--good) 20%, #171820);
  color: var(--good);
}
.active-call-bar > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.active-call-bar strong {
  font-size: 11px;
}
.active-call-bar span {
  color: #9295a3;
  font-size: 9px;
}
.active-call-bar button {
  padding: 6px 10px;
  font-size: 10px;
}
@media (max-width: 650px) {
  .active-call-bar {
    left: 12px;
    right: 12px;
    bottom: 82px;
  }
}

@media (max-width: 650px) {
  main {
    height: auto;
    padding: 0 0 70px;
  }
  .topbar {
    padding: 0 14px;
  }
  .account-picker #account-picker-button {
    width: 46px;
    padding: 5px;
  }
  .account-picker #account-picker-button > span:nth-child(2),
  .account-picker #account-picker-button > b {
    display: none;
  }
  .chat-layout.active {
    inset: 70px 0 70px;
    height: auto;
    border-radius: 0;
  }
  .chat-back {
    display: block;
  }
  .message-list {
    padding: 14px 6px;
  }
  .message {
    grid-template-columns: 38px minmax(0, 1fr);
    padding-left: 8px;
    padding-right: 8px;
  }
  .message .avatar,
  .avatar-spacer {
    width: 35px;
    height: 35px;
  }
  .composer {
    margin: 0 8px 8px;
  }
  .web-page {
    height: auto;
    padding: 8px 13px 90px;
  }
  .web-page-heading {
    align-items: flex-start;
  }
  .web-page-heading h2 {
    font-size: 23px;
  }
  .web-live {
    display: none;
  }
  .web-feature-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .web-feature-card button {
    grid-column: 1/-1;
  }
  .web-record-list article > div {
    flex-basis: 100%;
  }
  .web-record-list article > button {
    margin-left: 0;
    width: 100%;
  }
}

/* Keep the launcher Home rules authoritative over the legacy web-card skin. */
.launcher-home-content .web-home-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
}
.launcher-home-content .home-category {
  margin-bottom: 0;
  padding: 14px 16px 12px;
  border-color: color-mix(in srgb, #30323b 78%, var(--accent) 22%);
  border-radius: 14px;
  background: color-mix(in srgb, #111217 78%, transparent);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(10px);
}
.launcher-home-content .home-category > header {
  min-height: 42px;
  margin-bottom: 10px;
}
.launcher-home-content .home-category h3 {
  font-size: 14px;
}
.launcher-home-content .home-category-cards {
  display: flex;
  gap: 12px;
  padding: 2px 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
}
.launcher-home-content .home-category-cards .launcher-account-card {
  width: 270px;
  max-width: 270px;
  min-height: 232px;
  flex: 0 0 270px;
}
.home-action-dialog > form > p {
  margin: 0;
  color: #9da0ad;
  font-size: 11px;
  line-height: 1.55;
}
.home-action-fields {
  display: grid;
  gap: 11px;
}
.home-action-fields > label {
  display: grid;
  gap: 7px;
  color: #bfc1cb;
  font-size: 10px;
  font-weight: 700;
}
.home-action-fields select,
.home-action-fields input[type="file"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid color-mix(in srgb, #343640 68%, var(--accent) 32%);
  border-radius: 9px;
  background: #0b0c10;
  color: #f2f2f5;
}
.home-action-summary,
.home-action-warning {
  padding: 12px 13px;
  border: 1px solid #30323b;
  border-radius: 10px;
  background: #0d0e13;
  color: #c8cad3;
  font-size: 10px;
}
.home-action-warning {
  border-color: rgba(242, 63, 67, 0.38);
  background: rgba(242, 63, 67, 0.07);
  color: #ffc4cb;
}
.home-category-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 270px;
  overflow-y: auto;
}
.home-category-checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #30323b;
  border-radius: 9px;
  background: #0d0e13;
  color: #e7e8ec;
  font-size: 10px;
}
.home-category-checks input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

/* Keep the web composer in lockstep with the launcher composer. */
#chat-view .composer {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 36px 36px;
  grid-template-rows: auto;
  align-items: center;
  gap: 4px;
  min-height: 58px;
  margin: 0 16px 15px;
  padding: 6px 8px;
  border: 1px solid #30323b;
  border-radius: 12px;
  background: #111217;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
#chat-view .composer.dragging {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent),
    0 8px 24px rgba(0, 0, 0, 0.22);
}
#chat-view .composer .attachment-menu-wrap {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}
#chat-view .composer-main {
  position: relative;
  display: grid;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
#chat-view .composer textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  max-height: 150px;
  margin: 0;
  padding: 10px 8px;
  overflow-y: auto;
  resize: none;
  border: 0;
  border-radius: 8px;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text, #f5f5f7);
  line-height: 22px;
}
#chat-view .composer textarea:focus {
  border: 0;
  outline: 0;
  box-shadow: none;
}
#chat-view .composer .gif-favorites-wrap {
  grid-column: 4;
  grid-row: 1;
}
#chat-view #schedule-send-button {
  grid-column: 3;
  grid-row: 1;
}
#chat-view .composer-add,
#chat-view .composer-schedule {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, #3a3d47 78%, var(--accent) 22%);
  border-radius: 9px;
  background: transparent;
  color: var(--accent);
  box-shadow: none;
  line-height: 1;
}
#chat-view .composer-add {
  border-radius: 50%;
  color: #d7d9e1;
  font-size: 21px;
}
#chat-view .composer-add:hover,
#chat-view .composer-schedule:hover {
  border-color: color-mix(in srgb, var(--accent) 64%, #3a3d47);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: #fff;
}
#chat-view .composer-schedule svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
#chat-view .composer-main > .attachment-queue {
  max-width: 100%;
}
@media (max-width: 680px) {
  #chat-view .composer {
    grid-template-columns: 36px minmax(0, 1fr) 34px 34px;
    margin-inline: 8px;
    padding-inline: 6px;
  }
}

/* Launcher-matched device-auth details dialog. */
.web-record-list [data-auth-details] { margin-left: auto; }
.web-record-list [data-revoke-auth] { margin-left: 0; }
.device-auth-web-dialog {
  width: min(680px, calc(100vw - 24px));
}
.device-auth-detail-shell {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
}
.device-auth-detail-shell > header {
  padding-bottom: 14px;
  border-bottom: 1px solid #2b2d36;
}
.device-auth-detail-hero {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, #30323b);
  border-radius: 15px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 10%, #0d0e13), #0d0e13);
}
.device-auth-detail-shield {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, #30323b);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 14%, #15161c);
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
}
.device-auth-detail-hero > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.device-auth-detail-hero small,
.device-auth-detail-grid small {
  color: #858895;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
}
.device-auth-detail-hero strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.device-auth-detail-hero > div > span {
  color: #858895;
  font-size: 10px;
}
.device-auth-detail-hero i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
  background: #42d98b;
  box-shadow: 0 0 8px #42d98b99;
}
.device-auth-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.device-auth-detail-grid > div {
  display: grid;
  min-height: 74px;
  align-content: center;
  gap: 6px;
  padding: 12px 14px;
  overflow: hidden;
  border: 1px solid #292b34;
  border-radius: 12px;
  background: #0d0e13;
}
.device-auth-detail-grid strong {
  overflow-wrap: anywhere;
  font-size: 11px;
}
.device-auth-detail-grid .device-auth-user-agent {
  grid-column: 1 / -1;
}
.device-auth-raw {
  overflow: hidden;
  border: 1px solid #292b34;
  border-radius: 12px;
  background: #0d0e13;
}
.device-auth-raw summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
}
.device-auth-raw summary > span { display: grid; gap: 2px; }
.device-auth-raw summary small { color: #858895; font-size: 10px; }
.device-auth-raw summary b { color: #858895; font-size: 20px; transition: transform .15s; }
.device-auth-raw[open] summary b { transform: rotate(180deg); }
.device-auth-raw > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid #292b34;
  color: #858895;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}
.device-auth-raw pre {
  max-height: 230px;
  margin: 0 10px 10px;
  padding: 12px;
  overflow: auto;
  border-radius: 10px;
  background: #08090d;
  color: #c8cad2;
  font-size: 10px;
  white-space: pre-wrap;
}
@media (max-width: 560px) {
  .device-auth-detail-shell { padding: 14px; }
  .device-auth-detail-grid { grid-template-columns: 1fr; }
  .device-auth-detail-grid .device-auth-user-agent { grid-column: 1; }
}

/* Complete phone layout: compact shell, touch-sized controls and bottom sheets. */
.mobile-more-menu,
.mobile-more-backdrop { display: none; }

@media (max-width: 650px) {
  html, body { min-width: 0; overflow-x: hidden; }
  body { -webkit-tap-highlight-color: transparent; }
  button { touch-action: manipulation; }
  input, textarea, select { font-size: 16px; }
  #app.app-shell {
    display: block !important;
    grid-template-columns: none !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100dvh;
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
    overflow: hidden;
  }
  #app > .sidebar { display: none !important; }
  #app > main {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 100dvh;
    margin: 0 !important;
    padding: 0 0 calc(76px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden;
  }

  .topbar {
    min-height: 64px;
    padding: env(safe-area-inset-top) 12px 0;
    background: color-mix(in srgb, #090a0e 92%, transparent);
  }
  .topbar h1 { max-width: 42vw; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions { gap: 6px; }
  .top-actions #refresh { width: 42px; height: 42px; }
  .account-picker #account-picker-button { width: 44px; min-height: 44px; border-radius: 12px; }
  .account-picker #account-picker-button .avatar { width: 32px; height: 32px; }
  .top-actions > .account-picker .account-picker-menu,
  .account-picker-menu {
    position: fixed; z-index: 140; top: calc(62px + env(safe-area-inset-top));
    right: 10px; left: 10px; width: auto; max-height: min(70dvh, 560px); border-radius: 16px;
  }

  .view { padding-top: 12px; }
  #app main > .view { width: 100% !important; max-width: none !important; margin-inline: 0 !important; }
  .web-page { height: auto; min-height: calc(100dvh - 140px); padding: 6px 12px calc(88px + env(safe-area-inset-bottom)); overflow: visible; }
  .web-page-content { padding: 14px 0; }
  .web-page-heading { display: grid; gap: 10px; padding: 12px 0 16px; }
  .web-page-heading h2 { margin-top: 4px; font-size: clamp(22px, 7vw, 28px); }
  .web-page-heading p { font-size: 12px; line-height: 1.5; }
  .section-intro { gap: 12px; padding: 8px 12px 15px; }
  .section-intro h2 { font-size: 24px; }
  #accounts-view, #approvals-view { padding-inline: 12px; }

  .hero { min-height: 0; padding: 26px 20px; border-radius: 18px; }
  .hero h2 { font-size: clamp(31px, 10vw, 42px); }
  .hero p { font-size: 13px; line-height: 1.55; }
  .hero-actions { flex-wrap: wrap; }
  .hero-actions button { min-height: 44px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }

  .web-account-grid, .web-friend-grid, .web-settings,
  .cards-grid, .account-grid { grid-template-columns: minmax(0, 1fr); }
  .web-home-toolbar, .web-list-toolbar { align-items: stretch; flex-wrap: wrap; }
  .web-home-toolbar button, .web-list-toolbar button { min-height: 42px; }
  .launcher-home-content .home-category { padding: 12px; border-radius: 13px; }
  .launcher-home-content .home-category > header { align-items: flex-start; flex-wrap: wrap; }
  .launcher-home-content .home-category-cards .launcher-account-card {
    width: min(82vw, 270px); flex-basis: min(82vw, 270px); scroll-snap-align: start;
  }
  .launcher-home-content .home-category-cards { scroll-snap-type: x proximity; }
  .web-feature-card { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .web-feature-card button { grid-column: 1 / -1; min-height: 44px; }
  .web-settings article { min-height: 0; padding: 15px; }
  .web-settings article > button, .web-settings article > select { width: 100%; min-height: 44px; margin-top: 15px; }
  .web-tool { display: grid; max-width: none; }
  .web-tool button { min-height: 44px; }
  .web-record-list article { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  .web-record-list article > div, .web-record-list article > div:first-child { min-width: 0; }
  .web-record-list article > button, .web-record-list [data-auth-details],
  .web-record-list [data-revoke-auth] { width: 100%; min-height: 42px; margin-left: 0; }
  .approval { grid-template-columns: 42px minmax(0, 1fr); padding: 14px; }
  .approval-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .home-category-checks { grid-template-columns: 1fr; }

  .chat-layout.active {
    position: fixed !important;
    z-index: 40;
    top: calc(64px + env(safe-area-inset-top)) !important;
    right: 0 !important;
    bottom: calc(68px + env(safe-area-inset-bottom)) !important;
    left: 0 !important;
    display: block !important;
    width: 100vw !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: none;
  }
  #chat-view > .conversation-pane,
  #chat-view > .thread {
    position: absolute;
    inset: 0;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100% !important;
  }
  #chat-view > .conversation-pane { display: block; border: 0; background: #090a0e; }
  #chat-view > .conversation-pane.chat-open { display: none !important; }
  #chat-view > .thread { display: none; }
  #chat-view > .thread.chat-open { display: grid !important; }
  .pane-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px; }
  .pane-head h2 { flex: 1; margin: 0; }
  .pane-head input { display: none; }
  .pane-head button { min-height: 40px; }
  .conversation-list { height: calc(100% - 67px); padding: 6px 8px 18px; }
  .conversation { min-height: 66px; padding: 9px 8px; border-radius: 12px; }
  .conversation .avatar { width: 46px; height: 46px; }
  .thread > header { min-height: 58px; padding: 8px 10px; }
  .thread > header .avatar { width: 38px; height: 38px; }
  .thread > header .icon-btn { width: 38px; height: 38px; flex: 0 0 38px; }
  .thread > header strong, .thread > header span { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .message-list { padding: 12px 8px; overscroll-behavior: contain; }
  .message { grid-template-columns: 34px minmax(0, 1fr); gap: 8px; margin: 10px 0; padding-inline: 2px; }
  .message p { font-size: 14px; }
  #chat-view .composer {
    grid-template-columns: 36px minmax(0, 1fr) 36px 36px; min-height: 54px;
    margin: 0 7px max(7px, env(safe-area-inset-bottom)); padding: 5px; border-radius: 14px;
  }
  #chat-view .composer textarea { min-height: 40px; padding: 9px 5px; font-size: 16px; }
  .attachment-menu, .gif-favorites-menu {
    position: fixed; right: 10px; bottom: calc(132px + env(safe-area-inset-bottom)); left: 10px;
    width: auto; max-height: 45dvh;
  }

  .web-dialog {
    width: 100vw; max-width: none; max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top)));
    margin: auto 0 0; border-width: 1px 0 0; border-radius: 22px 22px 0 0;
  }
  .web-dialog form, .new-chat-body, .send-later-body, .recorder-body {
    max-height: 88dvh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto;
  }
  .web-dialog header { position: sticky; z-index: 2; top: -18px; padding: 4px 0 12px; background: #111218; }
  .web-dialog header button { width: 42px; height: 42px; }
  .dialog-actions { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); padding: 12px 0 env(safe-area-inset-bottom); background: #111218; }
  .dialog-actions button { min-height: 44px; flex: 1; }
  .profile-editor-grid, .owner-badge-builder, .send-later-time-row { grid-template-columns: minmax(0, 1fr); }
  .device-auth-detail-hero { grid-template-columns: 44px minmax(0, 1fr); }
  .device-auth-detail-hero > :last-child { grid-column: 1 / -1; }

  .mobile-nav {
    position: fixed !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
    display: grid !important; width: 100% !important; max-width: none !important;
    z-index: 120; grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    height: calc(68px + env(safe-area-inset-bottom)); padding: 5px 4px env(safe-area-inset-bottom);
    background: color-mix(in srgb, #0c0d12 94%, transparent); box-shadow: 0 -10px 35px rgba(0,0,0,.3);
  }
  .mobile-nav button { min-width: 0; min-height: 58px; border-radius: 12px; }
  .mobile-nav button i { display: grid; min-height: 25px; place-items: center; font-size: 20px; line-height: 1; }
  .mobile-nav button span { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav button.active { background: color-mix(in srgb, var(--accent) 12%, transparent); }

  .mobile-more-backdrop {
    position: fixed; z-index: 125; inset: 0; display: block; background: rgba(0,0,0,.58); backdrop-filter: blur(4px);
  }
  .mobile-more-menu {
    position: fixed; z-index: 130; right: 0; bottom: 0; left: 0; display: block;
    max-height: min(78dvh, 680px); padding: 16px 14px calc(84px + env(safe-area-inset-bottom));
    overflow-y: auto; border: 1px solid #30323b; border-width: 1px 0 0; border-radius: 24px 24px 0 0;
    background: #111218; box-shadow: 0 -24px 70px rgba(0,0,0,.58); animation: mobile-sheet-in .2s ease-out;
  }
  .mobile-more-menu.hidden, .mobile-more-backdrop.hidden { display: none; }
  .mobile-more-menu > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .mobile-more-menu > header > div { display: grid; gap: 2px; }
  .mobile-more-menu > header small { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
  .mobile-more-menu > header strong { font-size: 20px; }
  .mobile-more-menu > header button { width: 42px; height: 42px; padding: 0; font-size: 24px; }
  .mobile-more-menu > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mobile-more-menu > div button { display: flex; min-width: 0; min-height: 54px; align-items: center; gap: 10px; padding: 10px 12px; text-align: left; }
  .mobile-more-menu > div button i { display: grid; width: 28px; place-items: center; color: var(--accent); font-size: 18px; font-style: normal; }
  .mobile-more-menu > div button span { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  body.mobile-menu-open { overflow: hidden; }
  @keyframes mobile-sheet-in { from { opacity: 0; transform: translateY(28px); } }
}

@media (max-width: 390px) {
  .topbar { padding-inline: 9px; }
  .topbar h1 { max-width: 34vw; font-size: 17px; }
  .mobile-nav button span { font-size: 8px; }
  .mobile-more-menu > div, .approval-actions { grid-template-columns: 1fr; }
  #chat-view .composer { grid-template-columns: 34px minmax(0, 1fr) 34px 34px; margin-inline: 4px; }
}

@media (max-width: 650px) and (orientation: landscape) {
  .topbar { min-height: 54px; }
  .chat-layout.active { top: calc(54px + env(safe-area-inset-top)); }
  .mobile-more-menu { max-height: 90dvh; }
}

/* Discord-like touch interactions for mobile messages. */
.mobile-message-actions,
.mobile-message-actions-backdrop { display: none; }

@media (max-width: 760px) {
  #chat-view .message {
    touch-action: pan-y;
    transition: transform 150ms cubic-bezier(.2,.8,.2,1), background 120ms ease;
    will-change: transform;
  }
  #chat-view .message.mobile-pressing { background: rgba(255,255,255,.055); }
  #chat-view .message::before {
    content: "↩";
    position: absolute;
    top: 50%;
    left: -34px;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: #1b1d25;
    color: #9b77ff;
    font-size: 16px;
    opacity: 0;
    transform: translateY(-50%) scale(.7);
    transition: opacity 100ms ease, transform 100ms ease, background 100ms ease;
  }
  #chat-view .message[style*="translateX"]::before { opacity: 1; transform: translateY(-50%) scale(1); }
  #chat-view .message.swipe-reply-ready::before { background: var(--accent); color: #fff; }
  #chat-view .message-actions { display: none !important; }

  .mobile-message-actions-backdrop {
    position: fixed;
    z-index: 160;
    inset: 0;
    display: block;
    background: rgba(0,0,0,.62);
    backdrop-filter: blur(5px);
  }
  .mobile-message-actions {
    position: fixed;
    z-index: 165;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    max-height: min(82dvh, 650px);
    padding: 7px 12px calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 1px solid #30323b;
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
    background: #111218;
    box-shadow: 0 -24px 70px rgba(0,0,0,.62);
    animation: mobile-message-sheet-in 180ms cubic-bezier(.2,.8,.2,1);
  }
  .mobile-message-actions.hidden,
  .mobile-message-actions-backdrop.hidden { display: none; }
  .mobile-message-grabber {
    width: 38px;
    height: 4px;
    margin: 0 auto 8px;
    border-radius: 999px;
    background: #4a4c57;
  }
  .mobile-message-actions > header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 3px 12px;
  }
  .mobile-message-actions > header > div { display: grid; min-width: 0; flex: 1; gap: 3px; }
  .mobile-message-actions > header strong { font-size: 13px; }
  .mobile-message-actions > header span {
    overflow: hidden;
    color: #9295a3;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-message-actions > header button {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    font-size: 21px;
  }
  .mobile-message-quick-reactions {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    padding: 7px;
    border: 1px solid #30323b;
    border-radius: 15px;
    background: #0c0d12;
  }
  .mobile-message-quick-reactions button {
    min-width: 0;
    height: 45px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 22px;
  }
  .mobile-message-quick-reactions button:active { background: #252732; transform: scale(.94); }
  .mobile-message-action-list { display: grid; gap: 4px; margin-top: 9px; }
  .mobile-message-action-list button {
    display: grid;
    grid-template-columns: 32px minmax(0,1fr);
    min-height: 48px;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    text-align: left;
  }
  .mobile-message-action-list button:active { background: #20222b; transform: none; }
  .mobile-message-action-list button i {
    color: #b795ff;
    font-size: 19px;
    font-style: normal;
    text-align: center;
  }
  .mobile-message-action-list button span { font-size: 13px; }
  .mobile-message-action-list button.danger,
  .mobile-message-action-list button.danger i { color: #ff6677; }
  .mobile-message-action-list button.hidden { display: none; }
  body.mobile-message-menu-open { overflow: hidden; }
  @keyframes mobile-message-sheet-in {
    from { opacity: .65; transform: translateY(34px); }
  }
}

/* Final mobile shell guard. Desktop refinement rules use stronger selectors,
   so these must remain last to prevent the sidebar/grid from returning. */
@media (max-width: 650px) {
  #profile-editor.web-dialog {
    position: fixed;
    inset: env(safe-area-inset-top) 0 0;
    width: 100%;
    height: calc(100dvh - env(safe-area-inset-top));
    max-width: none;
    max-height: none;
    margin: 0;
    overflow: hidden;
    border-width: 1px 0 0;
    border-radius: 20px 20px 0 0;
  }
  #profile-form {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    max-height: none;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }
  #profile-form > header {
    position: relative;
    top: auto;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #292b35;
    background: #111218;
  }
  #profile-form .profile-form-scroll {
    min-height: 0;
    gap: 13px;
    padding: 14px 16px 24px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }
  #profile-form .owner-web-editor > header {
    position: static;
    padding: 0;
    background: transparent;
  }
  #profile-form > .dialog-actions {
    position: relative;
    bottom: auto;
    z-index: 3;
    margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #292b35;
    background: #111218;
  }

  #app.app-shell {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 100dvh;
    grid-template-columns: none !important;
    overflow-x: clip;
  }
  #app.app-shell > .sidebar {
    display: none !important;
    position: static !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  #app.app-shell > main {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow-x: clip;
  }
  #app .topbar {
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  #app .view,
  #app .web-page,
  #app #accounts-view,
  #app #approvals-view {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  #chat-view.chat-layout.active {
    display: block !important;
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    grid-template-columns: none !important;
    overflow: hidden !important;
  }
  #chat-view .conversation-pane,
  #chat-view .thread {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  #chat-view .conversation-pane.chat-open { display: none !important; }
  #chat-view .thread { display: none !important; }
  #chat-view .thread.chat-open { display: grid !important; }
  #mobile-nav.mobile-nav {
    display: grid !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box;
  }
}

/* iOS can expose a wider CSS viewport under Display Zoom. Keep the desktop
   rail out of every phone-sized layout even when it reports above 650px. */
@media (max-width: 760px) {
  body.has-app-background::before {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100svh;
    min-height: 100dvh;
    background-position: center center;
    background-size: cover;
  }
  body.has-app-background #app.app-shell,
  body.has-app-background #app.app-shell > main,
  body.has-app-background .web-page,
  body.has-app-background .view.active {
    background-color: transparent !important;
  }

  #app .topbar {
    z-index: 220 !important;
    isolation: isolate;
  }
  #app .top-actions,
  #app .top-actions > .account-picker {
    position: relative;
    z-index: 221 !important;
    overflow: visible !important;
  }
  #app .account-picker-menu {
    z-index: 222 !important;
  }

  #toast-stack {
    top: calc(env(safe-area-inset-top) + 10px) !important;
    right: 10px !important;
    bottom: auto !important;
    left: auto !important;
    width: min(320px, calc(100vw - 20px)) !important;
    justify-items: end;
  }
  #toast-stack .toast {
    width: auto;
    max-width: 100%;
    min-width: min(240px, calc(100vw - 20px));
    padding: 10px 12px;
    border-radius: 11px;
    font-size: 11px;
    line-height: 1.35;
    animation: mobile-toast-in 180ms ease-out;
  }
  @keyframes mobile-toast-in {
    from { opacity: 0; transform: translate3d(16px, -5px, 0); }
  }

  body.mobile-keyboard-open { overflow: hidden; }
  body.mobile-keyboard-open .topbar,
  body.mobile-keyboard-open #mobile-nav { display: none !important; }
  body.mobile-keyboard-open #chat-view.chat-layout.active { top: 0 !important; bottom: 0 !important; }
  body.mobile-keyboard-open #chat-view .composer { margin-bottom: max(5px, env(safe-area-inset-bottom)); }
  body.mobile-keyboard-open #chat-view .thread > header {
    min-height: calc(58px + env(safe-area-inset-top));
    padding-top: calc(8px + env(safe-area-inset-top));
  }
  #chat-view .composer.replying { grid-template-rows: auto auto; }
  #chat-view .composer.replying .reply-preview { grid-row: 1; }
  #chat-view .composer.replying .attachment-menu-wrap,
  #chat-view .composer.replying .composer-main,
  #chat-view .composer.replying .gif-favorites-wrap,
  #chat-view .composer.replying #schedule-send-button { grid-row: 2; }
  #chat-view .reply-preview { padding-block: 6px; }

  #app.app-shell {
    display: block !important;
    grid-template-columns: none !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }
  #app.app-shell > .sidebar { display: none !important; }
  #app.app-shell > main {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  #mobile-nav.mobile-nav {
    position: fixed !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
}
