/* azusa Night Cat theme, adapted from the local nyacraft visual language. */
:root {
  --bg: #11131a;
  --rail: rgba(13, 15, 23, .96);
  --sidebar: rgba(20, 22, 33, .9);
  --surface: rgba(25, 27, 40, .88);
  --surface-2: rgba(35, 38, 56, .9);
  --surface-3: rgba(43, 46, 66, .94);
  --line: rgba(222, 229, 255, .11);
  --line-soft: rgba(222, 229, 255, .065);
  --text: #eef1fa;
  --muted: #a5acbf;
  --faint: #747c91;
  --accent: #7aa2d6;
  --accent-strong: #a9c9f0;
  --accent-soft: rgba(122, 162, 214, .14);
  --pink: #d89ac7;
  --purple: #8b7fd1;
  --green: #78cba0;
  --yellow: #e4bd73;
  --red: #ef858d;
  --blue: #7aa2d6;
  --azusa-notice: #7aa2d6;
  --azusa-notice-text: #a9c9f0;
  --azusa-notice-soft: rgba(122, 162, 214, .12);
  --azusa-notice-border: rgba(122, 162, 214, .58);
  --azusa-notification-surface: rgba(31, 37, 45, .98);
  --azusa-broadcast: #d89ac7;
  --azusa-broadcast-text: #efbadb;
  --azusa-broadcast-soft: rgba(216, 154, 199, .12);
  --azusa-broadcast-border: rgba(216, 154, 199, .58);
  --azusa-error: #ef858d;
  --shadow: 0 22px 60px rgba(4, 6, 13, .44);
}

html,
body,
.workspace,
.content-view {
  background: #11131a;
}

.loading-screen,
.auth-screen {
  background: linear-gradient(135deg, #10121a 0%, #1a1d29 52%, #141722 100%);
}

.brand-mark,
.brand-button {
  overflow: hidden;
  border: 1px solid rgba(222, 229, 255, .18);
  background: #6f95e8;
  box-shadow: 0 8px 24px rgba(67, 91, 153, .26);
}

.brand-mark img,
.brand-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.auth-brand-art {
  width: 62px;
  height: 62px;
  flex-basis: 62px;
  border-radius: 8px;
}

.auth-panel {
  border-color: rgba(222, 229, 255, .12);
  background: rgba(23, 25, 37, .88);
  box-shadow: 0 28px 80px rgba(3, 5, 12, .5), inset 0 1px 0 rgba(255, 255, 255, .035);
  backdrop-filter: blur(18px);
}

.auth-brand h1,
.sidebar-header h2,
.chat-heading h2,
.content-header h2,
.modal-header h2 {
  color: #f4f5fb;
}

.auth-brand p,
.eyebrow {
  color: #9db9df;
}

.segmented {
  border-color: rgba(222, 229, 255, .09);
  background: rgba(8, 10, 18, .48);
}

.segmented button {
  color: #858ea5;
}

.segmented button.active {
  background: linear-gradient(135deg, rgba(122, 162, 214, .2), rgba(216, 154, 199, .11));
  color: #f1f3fa;
  box-shadow: inset 0 0 0 1px rgba(169, 201, 240, .12);
}

input,
textarea,
select {
  border-color: rgba(222, 229, 255, .12);
  background: rgba(8, 10, 18, .58);
  color: #edf0f8;
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(169, 201, 240, .28);
}

input:focus,
textarea:focus,
select:focus {
  border-color: #7aa2d6;
  box-shadow: 0 0 0 3px rgba(122, 162, 214, .1);
}

.primary-button,
.send-button {
  border-color: rgba(208, 220, 255, .18);
  background: linear-gradient(135deg, #7099d1, #887fd0);
  box-shadow: 0 8px 22px rgba(75, 84, 153, .24), inset 0 1px 0 rgba(255, 255, 255, .18);
  color: #fff;
}

.primary-button:hover,
.send-button:hover {
  background: linear-gradient(135deg, #80a9df, #9a8ddd);
  box-shadow: 0 10px 28px rgba(93, 101, 177, .3), 0 0 18px rgba(216, 154, 199, .1);
  transform: translateY(-1px);
}

.secondary-button {
  border-color: rgba(222, 229, 255, .11);
  background: rgba(255, 255, 255, .045);
  color: #d8ddeb;
}

.secondary-button:hover {
  border-color: rgba(216, 154, 199, .26);
  background: rgba(216, 154, 199, .1);
  color: #f4edf4;
  transform: translateY(-1px);
}

.icon-button {
  color: #8993aa;
}

.icon-button:hover {
  border-color: rgba(169, 201, 240, .2);
  background: rgba(122, 162, 214, .1);
  color: #c9dcf3;
}

.app-shell {
  --rail-column-width: 72px;
  --sidebar-column-width: 310px;
  position: relative;
  background: linear-gradient(135deg, #10121a 0%, #171a25 54%, #12151e 100%);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--rail-column-width) 0 minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .sidebar {
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.sidebar-collapse-button {
  position: absolute;
  top: 50%;
  left: calc(var(--rail-column-width) + var(--sidebar-column-width));
  z-index: 12;
  width: 26px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(210, 222, 242, .14);
  border-radius: 7px;
  background: rgba(20, 24, 34, .48);
  color: rgba(194, 207, 226, .72);
  cursor: pointer;
  opacity: .62;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(7px);
}

.sidebar-collapse-button:hover,
.sidebar-collapse-button:focus-visible {
  border-color: rgba(169, 201, 240, .3);
  background: rgba(31, 38, 52, .66);
  color: #d7e4f4;
  opacity: .94;
}

.sidebar-collapse-button .lucide { width: 17px; height: 17px; }
.app-shell.sidebar-collapsed .sidebar-collapse-button { left: var(--rail-column-width); }

@media (min-width: 721px) and (max-width: 980px) {
  .app-shell {
    --rail-column-width: 66px;
    --sidebar-column-width: 278px;
  }
}

.rail {
  border-color: rgba(222, 229, 255, .075);
  background: var(--rail);
  box-shadow: 8px 0 26px rgba(3, 5, 12, .16);
  backdrop-filter: blur(18px);
}

.rail-button {
  color: #747d93;
}

.rail-button:hover {
  background: rgba(122, 162, 214, .075);
  color: #b9c9df;
}

.rail-button.active {
  background: linear-gradient(135deg, rgba(122, 162, 214, .16), rgba(216, 154, 199, .08));
  color: #a9c9f0;
}

.rail-button.active::before {
  background: #8eb5e6;
  box-shadow: 0 0 12px rgba(142, 181, 230, .34);
}

.sidebar {
  border-color: rgba(222, 229, 255, .08);
  background: var(--sidebar);
  backdrop-filter: blur(18px);
}

.search-wrap {
  border-color: rgba(222, 229, 255, .09);
  background: rgba(8, 10, 18, .42);
}

.conversation-item:hover,
.contact-item:hover {
  background: rgba(255, 255, 255, .035);
}

.conversation-item.active,
.contact-item.active {
  background: linear-gradient(135deg, rgba(122, 162, 214, .13), rgba(216, 154, 199, .075));
}

.conversation-item.active::before,
.contact-item.active::before {
  background: #8eb5e6;
  box-shadow: 0 0 10px rgba(142, 181, 230, .28);
}

.avatar {
  background: linear-gradient(135deg, #46516d, #55506e);
  color: #f5f6fb;
}

.group-avatar {
  background: linear-gradient(135deg, #4c6385, #625c89);
}

.presence-dot.online,
.presence-dot[data-presence="online"] {
  background: #78cba0;
}

.badge,
.nav-dot {
  background: #d9899b;
}

.workspace,
.content-view {
  background: linear-gradient(145deg, rgba(18, 20, 29, .98), rgba(22, 24, 35, .96));
}

.empty-symbol {
  border-color: rgba(169, 201, 240, .18);
  background: linear-gradient(135deg, rgba(122, 162, 214, .12), rgba(216, 154, 199, .07));
  color: #a9c9f0;
}

.chat-header,
.content-header {
  border-color: rgba(222, 229, 255, .09);
  background: rgba(24, 26, 39, .88);
  backdrop-filter: blur(16px);
}

.messages {
  background: transparent;
}

.message-bubble {
  border-color: rgba(222, 229, 255, .11);
  background: rgba(38, 41, 58, .94);
  color: #f0f2f8;
  box-shadow: 0 5px 16px rgba(2, 4, 10, .16), inset 0 1px 0 rgba(255, 255, 255, .025);
}

.message-row.own .message-bubble {
  border-color: rgba(153, 190, 237, .24);
  background: linear-gradient(135deg, rgba(49, 68, 101, .96), rgba(63, 62, 101, .94));
}

.reply-quote {
  border-color: #8eb5e6;
  background: rgba(8, 10, 18, .24);
}

.reaction-pill {
  border-color: rgba(222, 229, 255, .11);
  background: rgba(27, 30, 43, .92);
}

.reaction-pill.own {
  border-color: rgba(169, 201, 240, .28);
  background: rgba(122, 162, 214, .13);
  color: #bcd5f2;
}

.message-actions {
  border-color: rgba(222, 229, 255, .12);
  background: rgba(31, 34, 49, .98);
  box-shadow: 0 12px 32px rgba(3, 5, 12, .42);
}

.message-actions button:hover {
  background: rgba(122, 162, 214, .1);
  color: #dbe8f7;
}

.message-file {
  border-color: rgba(222, 229, 255, .095);
  background: rgba(8, 10, 18, .28);
}

.file-kind,
.menu-icon {
  color: #a9c9f0;
}

.composer,
.reply-bar,
.draft-attachments {
  border-color: rgba(222, 229, 255, .09);
  background: rgba(24, 26, 39, .9);
  backdrop-filter: blur(16px);
}

.composer textarea {
  border-color: rgba(222, 229, 255, .11);
  background: rgba(8, 10, 18, .54);
}

.section-block,
.profile-editor,
.settings-group,
.admin-section {
  border-color: rgba(222, 229, 255, .1);
  background: rgba(25, 27, 40, .64);
}

.modal-backdrop,
.drawer-backdrop {
  background: rgba(4, 6, 13, .64);
  backdrop-filter: blur(4px);
}

.modal,
.side-drawer {
  border-color: rgba(222, 229, 255, .12);
  background: rgba(24, 26, 39, .97);
  box-shadow: -16px 0 48px rgba(3, 5, 12, .42);
}

.modal-header,
.drawer-tabs {
  border-color: rgba(222, 229, 255, .09);
  background: rgba(29, 31, 45, .98);
}

.drawer-tab.active {
  color: #b7d2f1;
}

.drawer-tab.active::after {
  background: #8eb5e6;
}

.toast {
  border-color: rgba(222, 229, 255, .13);
  background: rgba(39, 42, 60, .98);
  box-shadow: 0 16px 38px rgba(3, 5, 12, .38);
}

* {
  scrollbar-color: #48516a transparent;
}

@media (max-width: 720px) {
  .sidebar-collapse-button { display: none !important; }

  .app-shell,
  .app-shell.deletion-mode {
    height: 100dvh;
    grid-template-rows: minmax(0, 1fr) 54px;
  }

  .rail {
    min-height: 54px;
    gap: 0;
    padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
    background: rgba(13, 15, 23, .98);
    box-shadow: 0 -8px 26px rgba(3, 5, 12, .18);
  }

  .rail-button,
  .rail-button:hover,
  .rail-button.active {
    width: min(84px, 28vw);
    height: 54px;
    border-radius: 0;
    background: transparent;
    transform: none;
  }

  .rail-button.active {
    color: #a9c9f0;
  }

  .rail-button.active::before {
    top: 0;
    width: 22px;
    height: 3px;
    border-radius: 0 0 3px 3px;
  }

  .rail-button .lucide {
    width: 20px;
    height: 20px;
  }

  .rail-button small {
    font-size: calc(9px + var(--font-size-delta));
  }

  #admin-nav {
    display: none !important;
  }

  .my-feature-card {
    min-height: 132px;
    padding: 18px;
  }

  .content-body {
    padding-bottom: 24px;
  }

  .message-actions {
    border-color: rgba(222, 229, 255, .13);
    background: rgba(34, 37, 53, .99);
  }

  .chat-header,
  .composer {
    backdrop-filter: none;
  }

  .sticker-delete {
    width: 28px;
    height: 28px;
    opacity: 1;
  }
}

/* Optional spacing profile for longer chat reading sessions. */
html.comfortable-reading .messages {
  padding-top: 32px;
  padding-bottom: 26px;
}

html.comfortable-reading .message-row {
  grid-template-columns: 42px minmax(0, 680px);
  gap: 12px;
  margin-bottom: 22px;
}

html.comfortable-reading .message-row.own {
  grid-template-columns: minmax(0, 680px) 42px;
}

html.comfortable-reading .message-row:has(+ .message-row.grouped),
html.comfortable-reading .message-row.grouped {
  margin-bottom: 8px;
}

html.comfortable-reading .message-row > .avatar {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  font-size: calc(13px + var(--font-size-delta));
}

html.comfortable-reading .message-author {
  margin-bottom: 6px;
  font-size: calc(12px + var(--font-size-delta));
}

html.comfortable-reading .message-bubble {
  font-size: calc(15px + var(--font-size-delta));
  line-height: 1.72;
}

html.comfortable-reading .message-bubble:not(:has(> .message-image, > .message-image-placeholder, > .message-gallery, > .bot-message-card)) {
  padding: 12px 14px;
}

html.comfortable-reading .reply-quote {
  margin-bottom: 9px;
  padding: 8px 10px;
  line-height: 1.58;
}

@media (max-width: 720px) {
  html.comfortable-reading .messages {
    padding: 18px 14px 14px;
  }

  html.comfortable-reading .message-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  html.comfortable-reading .message-row.own {
    grid-template-columns: minmax(0, 1fr) 36px;
  }

  html.comfortable-reading .message-row:has(+ .message-row.grouped),
  html.comfortable-reading .message-row.grouped {
    margin-bottom: 6px;
  }

  html.comfortable-reading .message-row > .avatar {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  html.comfortable-reading .message-author {
    margin-bottom: 5px;
    font-size: calc(11px + var(--font-size-delta));
  }

  html.comfortable-reading .message-bubble {
    font-size: calc(14px + var(--font-size-delta));
    line-height: 1.65;
  }

  html.comfortable-reading .message-bubble:not(:has(> .message-image, > .message-image-placeholder, > .message-gallery, > .bot-message-card)) {
    padding: 10px 12px;
  }
}

@media (max-width: 420px) {
  .auth-brand-art {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }
}

/* Chat interaction layers */
.chat-view {
  display: flex;
  flex-direction: column;
}

.chat-header { flex: 0 0 68px; }
.connection-status,
.reply-bar,
.draft-attachments,
.composer,
.sticker-panel { flex-shrink: 0; }
.messages { flex: 1 1 auto; }

.message-member-avatar {
  cursor: context-menu;
  touch-action: pan-y;
  user-select: none;
  -webkit-touch-callout: none;
}

.message-member-avatar.touching { opacity: .78; }

.member-context-backdrop {
  position: fixed;
  inset: 0;
  z-index: 56;
  background: transparent;
}

.member-context-menu {
  position: absolute;
  width: 202px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid #3a434e;
  border-radius: 7px;
  background: #20252c;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .46);
}

.member-context-action {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #e7ebef;
  cursor: pointer;
  font-size: calc(12px + var(--font-size-delta));
  text-align: left;
}

.member-context-action:hover { background: #303741; }
.member-context-action.danger { color: #ffaaa5; }
.member-context-action .lucide { width: 16px; height: 16px; color: #a8b1bc; }
.member-context-action.danger .lucide { color: #ff8f89; }

.member-context-separator {
  height: 1px;
  margin: 4px 5px;
  background: #353d47;
}

.mention-preview,
.mention-label,
.message-mention.me {
  color: #ff706d;
  font-weight: 700;
}

.mention-label {
  margin-left: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 91, 88, .12);
  font-size: calc(9px + var(--font-size-delta));
}

.message-mention {
  color: #80c8ff;
  font-weight: 650;
}

.message-row.mentioned-me .message-bubble {
  border-color: rgba(255, 105, 101, .72);
  box-shadow: 0 0 0 1px rgba(255, 105, 101, .18);
}

.featured-label {
  margin-left: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(245, 189, 78, .13);
  color: #f2c565;
  font-size: calc(9px + var(--font-size-delta));
  font-weight: 700;
}

.group-content-backdrop {
  position: fixed;
  inset: 0;
  z-index: 64;
  background: transparent;
}

.group-content-menu {
  position: fixed;
  width: 174px;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid #3c444e;
  border-radius: 7px;
  background: #20252c;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .48);
}

.group-content-item {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 5px;
  padding: 0 11px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: calc(13px + var(--font-size-delta));
  text-align: left;
}

.group-content-item:hover { background: #2a3038; }
.group-content-item .lucide { width: 18px; height: 18px; color: #9fb6cf; }

.message-system-row {
  display: flex;
  justify-content: center;
  margin: 4px 0 16px;
}

.message-system-notice {
  max-width: min(520px, 92%);
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 4px 8px;
  background: transparent;
  color: #78b9f5;
  cursor: pointer;
  font-size: calc(11px + var(--font-size-delta));
  line-height: 1.45;
  text-align: center;
}

.group-announcement-detail {
  display: grid;
  gap: 16px;
}

.group-announcement-content {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}

.group-announcement-meta {
  color: var(--muted);
  font-size: calc(12px + var(--font-size-delta));
}

.message-system-notice.muted { color: var(--faint); }
.message-system-notice .lucide { width: 13px; height: 13px; flex: 0 0 13px; }

.featured-modal { width: min(880px, 100%); }
.featured-modal .modal-body { padding: 18px; background: #141820; }

.featured-list {
  min-height: 360px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.featured-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: calc(13px + var(--font-size-delta));
}

.featured-card {
  position: relative;
  min-width: 0;
  overflow: visible;
  border: 1px solid rgba(222, 229, 255, .09);
  border-radius: 7px;
  padding: 16px;
  background: #1c2029;
}

.featured-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.featured-card-header > .avatar {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.featured-card-meta {
  min-width: 0;
  flex: 1;
}

.featured-card-meta strong,
.featured-card-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured-card-meta strong { font-size: calc(13px + var(--font-size-delta)); }
.featured-card-meta span { margin-top: 4px; color: var(--faint); font-size: calc(10px + var(--font-size-delta)); }

.featured-card-actions { position: relative; align-self: flex-start; }
.featured-card-actions > .icon-button { width: 32px; height: 32px; }

.featured-card-menu {
  position: absolute;
  top: 34px;
  right: 0;
  z-index: 4;
  width: 146px;
  padding: 5px;
  border: 1px solid #3c444e;
  border-radius: 6px;
  background: #20252c;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .4);
}

.featured-card-menu-item {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 4px;
  padding: 0 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: calc(12px + var(--font-size-delta));
}

.featured-card-menu-item:hover { background: #2a3038; }
.featured-card-menu-item .lucide { width: 15px; height: 15px; color: #f2c565; }

.featured-card-body {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 10px;
}

.featured-card-text {
  max-width: 100%;
  color: var(--text);
  font-size: calc(13px + var(--font-size-delta));
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.featured-image {
  max-width: min(460px, 100%);
  max-height: 420px;
  display: block;
  border-radius: 5px;
  object-fit: contain;
  cursor: zoom-in;
}

.featured-media-placeholder {
  width: min(420px, 100%);
  min-height: 180px;
}

.featured-gallery {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.featured-gallery .featured-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.featured-gallery .featured-media-placeholder {
  width: 100%;
  height: 180px;
}

.featured-card-body .message-video-card,
.featured-card-body .message-file { max-width: min(520px, 100%); }

@media (max-width: 720px) {
  .message-system-row { margin-bottom: 12px; }
  .message-system-notice { font-size: calc(10px + var(--font-size-delta)); }
  .featured-modal { height: min(92vh, 840px); }
  .featured-modal .modal-body { padding: 10px; }
  .featured-list { gap: 10px; }
  .featured-card { padding: 12px; }
  .featured-card-meta span { white-space: normal; }
  .featured-image { max-height: 320px; }
  .featured-gallery .featured-image { height: 150px; }
}

.message-context-backdrop {
  position: fixed;
  inset: 0;
  z-index: 58;
  background: transparent;
}

.message-context-menu {
  position: absolute;
  width: 178px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid #3c444e;
  border-radius: 7px;
  background: #20252c;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .48);
}

.message-context-action {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #e7ebef;
  cursor: pointer;
  font-size: calc(12px + var(--font-size-delta));
  text-align: left;
}

.message-context-action:hover { background: #303741; }
.message-context-action.danger { color: #ffaaa5; }
.message-context-action .lucide { width: 15px; height: 15px; color: #aeb7c1; }
.message-context-action.danger .lucide { color: #ff8f89; }

.message-context-reactions {
  display: flex;
  justify-content: space-between;
  gap: 2px;
}

.message-context-reaction {
  width: 26px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-size: calc(16px + var(--font-size-delta));
}

.message-context-reaction:hover { background: #303741; }
.message-context-separator { height: 1px; margin: 3px 4px; background: #353d47; }

.message-row.selection-mode { position: relative; padding-left: 34px; }
.message-row.selected .message-bubble { outline: 2px solid rgba(96, 161, 255, .62); }
.message-select-toggle {
  position: absolute;
  top: 4px;
  left: 0;
  width: 28px;
  height: 28px;
  color: #83b8ff;
}
.message-select-toggle .lucide { width: 17px; height: 17px; }

.message-selection-bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid #2b323b;
  background: #191d23;
}

.message-selection-bar > strong { font-size: calc(12px + var(--font-size-delta)); }
.selection-actions { display: flex; gap: 5px; }
.selection-actions .danger { color: #ff928d; }
.composer.selection-hidden { display: none; }

.join-policy-options {
  overflow: hidden;
  border: 1px solid #343c46;
  border-radius: 7px;
  background: #181d23;
}

.join-policy-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 13px;
  border-bottom: 1px solid #2d343d;
  color: #e4e9ed;
  cursor: pointer;
  font-size: calc(12px + var(--font-size-delta));
}

.join-policy-row:last-child { border-bottom: 0; }
.join-policy-row:has(input:disabled) { cursor: default; opacity: .7; }
.join-policy-row input { width: 17px; height: 17px; accent-color: #4b9eff; }

.sticker-panel {
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid #2b323b;
  background: #171b20;
}

.sticker-panel-header {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 4px 15px;
  border-bottom: 1px solid #282f37;
  color: #dfe5ea;
  font-size: calc(12px + var(--font-size-delta));
}

.sticker-panel-content {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
}

.sticker-utility {
  width: 100%;
  height: 100%;
  min-height: 64px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 1px dashed #424b56;
  border-radius: 6px;
  background: #1d2229;
  color: #9ba6b1;
}

.sticker-utility .lucide { width: 24px; height: 24px; }
.sticker-utility span:last-child { font-size: calc(10px + var(--font-size-delta)); }

.sticker-grid > .empty-list {
  grid-column: 1 / -1;
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
}

.sticker-panel.desktop-popover {
  position: absolute;
  bottom: 66px;
  left: 14px;
  z-index: 32;
  width: min(460px, calc(100% - 28px));
  height: 360px;
  border: 1px solid #3a424d;
  border-radius: 8px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .48);
}

.sticker-selection-bar {
  position: sticky;
  top: -12px;
  z-index: 4;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -12px -12px 12px;
  padding: 7px 10px 7px 14px;
  border-bottom: 1px solid #2d343d;
  background: #1b2026;
}

.sticker-selection-bar > strong { font-size: calc(11px + var(--font-size-delta)); }
.sticker-selection-bar > div { display: flex; gap: 6px; }
.sticker-selection-bar button { min-height: 32px; padding: 0 10px; font-size: calc(10px + var(--font-size-delta)); }
.sticker-item.selected .sticker-send { border-color: #70aaff; box-shadow: inset 0 0 0 2px rgba(88, 154, 255, .45); }
.sticker-item.selected::after {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 3;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #4b96ef;
  color: white;
  content: '✓';
  font-size: calc(12px + var(--font-size-delta));
  pointer-events: none;
}

@media (max-width: 720px) {
  .app-shell.mobile-workspace {
    grid-template-rows: minmax(0, 1fr);
  }

  .app-shell.mobile-workspace .rail { display: none; }
  .app-shell.mobile-workspace .workspace { grid-row: 1; }
  .chat-header { flex-basis: 58px; }

  .sticker-panel {
    position: static;
    width: auto;
    height: auto;
    flex: 0 0 clamp(230px, 42dvh, 360px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sticker-panel .sticker-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .chat-view.sticker-open .message-actions {
    bottom: calc(clamp(230px, 42dvh, 360px) + 68px + env(safe-area-inset-bottom));
  }

  .message-context-backdrop.mobile {
    display: flex;
    align-items: flex-end;
    background: rgba(5, 7, 10, .48);
  }

  .message-context-menu.mobile {
    position: static;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 10px max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .message-context-reactions,
  .message-context-separator { grid-column: 1 / -1; }
  .message-context-reactions { justify-content: space-around; }
  .message-context-reaction { width: 38px; height: 36px; }
  .message-context-action {
    min-height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 5px 2px;
    font-size: calc(10px + var(--font-size-delta));
    text-align: center;
  }
  .message-context-action .lucide { width: 18px; height: 18px; }
  .message-row.selection-mode { padding-left: 30px; }
  .message-selection-bar { min-height: 58px; }
}

.message-bubble:has(.message-video-card) {
  width: min(430px, 100%);
}

@media (max-width: 720px) {
  .message-bubble:has(.message-video-card) {
    width: min(300px, calc(100vw - 84px));
  }

  .message-video-meta .file-download-button {
    width: 34px;
    padding: 0;
  }

  .message-video-meta .file-download-button span {
    display: none;
  }
}

.file-download-button {
  width: auto;
  flex: 0 0 auto;
  display: inline-flex;
}

@media (max-width: 720px) {
  .message-video-meta .file-download-button { width: 34px; flex-basis: 34px; }
  .message-image,
  .message-gallery .message-image,
  .message-gallery.count-1 .message-image {
    width: auto;
    height: auto;
    max-width: min(240px, calc(100vw - 96px));
    max-height: 280px;
    object-fit: contain;
  }
  .message-gallery { max-width: min(244px, calc(100vw - 92px)); }
  .message-image.deferred-media:not(.loaded),
  .message-gallery .message-image.deferred-media:not(.loaded),
  .message-gallery.count-1 .message-image.deferred-media:not(.loaded) {
    width: min(240px, calc(100vw - 96px));
    height: 160px;
  }
  .message-image-placeholder,
  .message-gallery .message-image-placeholder,
  .message-gallery.count-1 .message-image-placeholder {
    width: min(240px, calc(100vw - 96px));
    height: 160px;
  }
  .message-caption { max-width: min(260px, calc(100vw - 84px)); }
  .new-messages-button {
    right: 12px;
    bottom: calc(66px + env(safe-area-inset-bottom));
  }
  .history-drawer {
    width: 100vw;
    border-left: 0;
  }
}

.background-crop-stage {
  width: min(720px, 100%);
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.background-crop-guide {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, .62);
  background:
    linear-gradient(to right, transparent 33.2%, rgba(255, 255, 255, .22) 33.2%, rgba(255, 255, 255, .22) 33.5%, transparent 33.5%, transparent 66.5%, rgba(255, 255, 255, .22) 66.5%, rgba(255, 255, 255, .22) 66.8%, transparent 66.8%),
    linear-gradient(to bottom, transparent 33.2%, rgba(255, 255, 255, .22) 33.2%, rgba(255, 255, 255, .22) 33.5%, transparent 33.5%, transparent 66.5%, rgba(255, 255, 255, .22) 66.5%, rgba(255, 255, 255, .22) 66.8%, transparent 66.8%);
  pointer-events: none;
}

/* Taller profile composition */
.my-body {
  width: min(1000px, 100%);
}

.my-profile-hero,
.my-profile-shade {
  min-height: 340px;
}

.my-profile-main > .avatar {
  width: 96px;
  height: 96px;
  flex-basis: 96px;
  border-radius: 20px;
}

.my-profile-copy strong {
  font-size: calc(29px + var(--font-size-delta));
}

.my-feature-icon.admin {
  background: rgba(216, 154, 199, .14);
  color: #e0afd3;
}

.my-feature-icon.settings {
  background: rgba(232, 195, 112, .14);
  color: #e4c77e;
}

.my-feature-icon.appearance {
  background: rgba(139, 127, 209, .16);
  color: #b9afea;
}

.profile-card {
  width: min(540px, calc(100% - 24px));
}

.profile-card-hero {
  position: relative;
  min-height: 380px;
}

.profile-card-hero-content {
  position: relative;
  z-index: 1;
  padding-top: 38px;
  padding-bottom: 30px;
  background: transparent;
}

/* Keep native image previews centered instead of inheriting the mobile sheet alignment. */
.lightbox-backdrop {
  place-items: center;
}

@media (max-width: 720px) {
  .my-profile-hero,
  .my-profile-shade {
    min-height: 300px;
  }

  .my-profile-main > .avatar {
    width: 80px;
    height: 80px;
    flex-basis: 80px;
    border-radius: 17px;
  }

  .my-profile-copy strong {
    font-size: calc(24px + var(--font-size-delta));
  }

  .profile-card {
    margin: 12px auto;
  }

  .profile-card-hero {
    min-height: 340px;
  }

  .lightbox-backdrop {
    place-items: center !important;
    overflow: hidden;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .lightbox-shell {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: grid;
    place-items: center;
  }

  .lightbox-image {
    grid-area: 1 / 1;
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    margin: auto;
  }

  .lightbox-stage {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
  }

  .lightbox-toolbar {
    position: absolute;
    top: max(4px, env(safe-area-inset-top));
    right: max(4px, env(safe-area-inset-right));
    z-index: 7;
    max-width: calc(100% - 8px);
    flex-wrap: wrap;
    justify-content: flex-end;
    margin: 0;
  }
}

.settings-view .settings-page-header {
  border-color: var(--line);
  background: var(--surface);
}

.settings-view .settings-detail-body {
  width: min(820px, 100%);
  padding: 10px 34px 70px;
}

@media (max-width: 720px) {
  .settings-view .settings-detail-body { padding: 0 16px 86px; }
}

/* Brightness and palette controls */
.color-mode-options {
  width: min(360px, 100%);
  margin: 0;
}

.color-mode-options button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.color-mode-options .lucide { width: 17px; height: 17px; }

.palette-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.palette-option {
  position: relative;
  min-height: 78px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.palette-option.active { border-color: var(--accent); }
.palette-option > .lucide { width: 17px; height: 17px; color: var(--accent-strong); }

.palette-swatches {
  height: 46px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 6px;
}

.palette-swatches i { display: block; }
.palette-option-copy { min-width: 0; display: grid; gap: 5px; }
.palette-option-copy strong { font-size: calc(13px + var(--font-size-delta)); }
.palette-option-copy small { color: var(--muted); font-size: calc(10px + var(--font-size-delta)); line-height: 1.4; }

/* Sakura palette is independent from brightness. */
html[data-palette="sakura"][data-color-mode="night"] {
  --accent: #d982a5;
  --accent-strong: #efb6cc;
  --accent-soft: rgba(217, 130, 165, .14);
  --pink: #e39bb8;
  --purple: #a789b6;
  --blue: #87a8c5;
}

html[data-palette="sakura"][data-color-mode="night"] .primary-button,
html[data-palette="sakura"][data-color-mode="night"] .send-button {
  border-color: rgba(255, 220, 233, .2);
  background: linear-gradient(135deg, #d47d9f, #a7799c);
  box-shadow: 0 8px 22px rgba(116, 59, 83, .25), inset 0 1px 0 rgba(255, 255, 255, .18);
}

html[data-palette="sakura"][data-color-mode="night"] .primary-button:hover,
html[data-palette="sakura"][data-color-mode="night"] .send-button:hover {
  background: linear-gradient(135deg, #e391b0, #b98aac);
}

html[data-palette="sakura"][data-color-mode="night"] .rail-button.active,
html[data-palette="sakura"][data-color-mode="night"] .conversation-item.active,
html[data-palette="sakura"][data-color-mode="night"] .contact-item.active {
  background: linear-gradient(135deg, rgba(217, 130, 165, .17), rgba(135, 168, 197, .07));
  color: var(--accent-strong);
}

html[data-palette="sakura"][data-color-mode="night"] .rail-button.active::before,
html[data-palette="sakura"][data-color-mode="night"] .conversation-item.active::before,
html[data-palette="sakura"][data-color-mode="night"] .contact-item.active::before {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(217, 130, 165, .34);
}

html[data-palette="sakura"][data-color-mode="night"] .message-bubble,
html[data-palette="sakura"][data-color-mode="night"] .message-row.own .message-bubble {
  border-color: rgba(239, 182, 204, .2);
  background: rgba(67, 50, 62, .94);
  color: #f3edf1;
}

html[data-palette="sakura"][data-color-mode="night"] .drawer-tab.active,
html[data-palette="sakura"][data-color-mode="night"] .eyebrow,
html[data-palette="sakura"][data-color-mode="night"] .file-kind,
html[data-palette="sakura"][data-color-mode="night"] .menu-icon {
  color: var(--accent-strong);
}

/* Sakura daylight: white foundation with directional glass borders. */
html[data-color-mode="day"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --rail: rgba(255, 255, 255, .7);
  --sidebar: rgba(255, 252, 254, .64);
  --surface: rgba(255, 255, 255, .58);
  --surface-2: rgba(255, 255, 255, .7);
  --surface-3: rgba(255, 255, 255, .86);
  --line: rgba(128, 102, 114, .2);
  --line-soft: rgba(128, 102, 114, .12);
  --text: #392f35;
  --muted: #776a72;
  --faint: #9a8c94;
  --accent: #dc789f;
  --accent-strong: #b8527b;
  --accent-soft: rgba(220, 120, 159, .14);
  --pink: #dc789f;
  --purple: #967a9d;
  --green: #559979;
  --yellow: #b88c43;
  --red: #cf5e69;
  --blue: #618ca9;
  --azusa-notice-text: #4f76a8;
  --azusa-notice-soft: rgba(122, 162, 214, .13);
  --azusa-notice-border: rgba(91, 128, 178, .55);
  --azusa-notification-surface: rgba(255, 255, 255, .92);
  --azusa-broadcast-text: #a75478;
  --azusa-broadcast-soft: rgba(216, 154, 199, .15);
  --azusa-broadcast-border: rgba(176, 92, 127, .5);
  --shadow: 0 18px 50px rgba(84, 61, 71, .16);
  --glass-edge-top: rgba(255, 255, 255, .98);
  --glass-edge-right: rgba(145, 118, 130, .22);
  --glass-edge-bottom: rgba(119, 94, 106, .28);
  --glass-edge-left: rgba(255, 255, 255, .92);
  --glass-shadow: 0 14px 36px rgba(94, 67, 78, .12), inset 1px 1px 0 rgba(255, 255, 255, .72), inset -1px -1px 0 rgba(121, 96, 108, .07);
}

html[data-color-mode="day"],
html[data-color-mode="day"] body,
html[data-color-mode="day"] .workspace,
html[data-color-mode="day"] .content-view {
  background: #f5f6f8;
  color: var(--text);
}

html[data-color-mode="day"] .app-shell,
html[data-color-mode="day"] .loading-screen,
html[data-color-mode="day"] .auth-screen {
  background: linear-gradient(135deg, #fff 0%, #f6f7f9 52%, #eef1f4 100%);
}

html[data-color-mode="day"] .auth-panel,
html[data-color-mode="day"] .rail,
html[data-color-mode="day"] .sidebar,
html[data-color-mode="day"] .chat-header,
html[data-color-mode="day"] .content-header,
html[data-color-mode="day"] .composer,
html[data-color-mode="day"] .reply-bar,
html[data-color-mode="day"] .draft-attachments,
html[data-color-mode="day"] .modal,
html[data-color-mode="day"] .side-drawer,
html[data-color-mode="day"] .sticker-panel,
html[data-color-mode="day"] .settings-hub-item,
html[data-color-mode="day"] .my-feature-card,
html[data-color-mode="day"] .admin-status-card,
html[data-color-mode="day"] .profile-card,
html[data-color-mode="day"] .save-location-row,
html[data-color-mode="day"] .client-update-panel {
  border: 1px solid;
  border-color: var(--glass-edge-top) var(--glass-edge-right) var(--glass-edge-bottom) var(--glass-edge-left);
  background: rgba(255, 255, 255, .6);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
}

html[data-color-mode="day"] .rail { background: rgba(255, 255, 255, .7); }
html[data-color-mode="day"] .sidebar { background: rgba(255, 250, 253, .58); }
html[data-color-mode="day"] .workspace,
html[data-color-mode="day"] .content-view {
  background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(240, 243, 246, .82));
}

html[data-color-mode="day"] .chat-header,
html[data-color-mode="day"] .content-header,
html[data-color-mode="day"] .composer,
html[data-color-mode="day"] .reply-bar,
html[data-color-mode="day"] .draft-attachments {
  background: rgba(255, 255, 255, .54);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .88), inset -1px -1px 0 rgba(113, 87, 100, .06), 0 8px 24px rgba(91, 66, 77, .07);
}

html[data-color-mode="day"] .auth-brand h1,
html[data-color-mode="day"] .sidebar-header h2,
html[data-color-mode="day"] .chat-heading h2,
html[data-color-mode="day"] .content-header h2,
html[data-color-mode="day"] .modal-header h2,
html[data-color-mode="day"] .item-copy strong,
html[data-color-mode="day"] .empty-state h2 {
  color: var(--text);
}

html[data-color-mode="day"] .auth-brand p,
html[data-color-mode="day"] .message-author,
html[data-color-mode="day"] .item-copy p,
html[data-color-mode="day"] .settings-detail-body .section-heading p,
html[data-color-mode="day"] .save-location-row span {
  color: var(--muted);
}

html[data-color-mode="day"] .stack-form label,
html[data-color-mode="day"] .field { color: #5f5159; }

html[data-color-mode="day"] input,
html[data-color-mode="day"] textarea,
html[data-color-mode="day"] select,
html[data-color-mode="day"] .search-wrap,
html[data-color-mode="day"] .composer textarea {
  border-color: rgba(130, 102, 115, .2);
  background: rgba(255, 255, 255, .68);
  color: var(--text);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .88), inset -1px -1px 0 rgba(112, 86, 98, .06);
}

html[data-color-mode="day"] input:hover,
html[data-color-mode="day"] textarea:hover,
html[data-color-mode="day"] select:hover { border-color: rgba(220, 120, 159, .42); }

html[data-color-mode="day"] input:focus,
html[data-color-mode="day"] textarea:focus,
html[data-color-mode="day"] select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(220, 120, 159, .12), inset 1px 1px 0 rgba(255, 255, 255, .9);
}

html[data-color-mode="day"] .segmented {
  border-color: rgba(129, 100, 114, .16);
  background: rgba(131, 106, 118, .08);
}

html[data-color-mode="day"] .segmented button { color: var(--muted); }
html[data-color-mode="day"] .segmented button.active {
  background: rgba(255, 255, 255, .86);
  color: var(--accent-strong);
  box-shadow: 0 3px 12px rgba(93, 67, 79, .09), inset 1px 1px 0 #fff;
}

html[data-color-mode="day"] .primary-button,
html[data-color-mode="day"] .send-button {
  border-color: rgba(255, 255, 255, .68) rgba(157, 71, 106, .28) rgba(130, 54, 85, .34) rgba(255, 255, 255, .62);
  background: #d8749b;
  color: #fff;
  box-shadow: 0 8px 20px rgba(174, 79, 117, .2), inset 1px 1px 0 rgba(255, 255, 255, .35);
}

html[data-color-mode="day"] .primary-button:hover,
html[data-color-mode="day"] .send-button:hover { background: #c9638b; }

html[data-color-mode="day"] .secondary-button {
  border-color: rgba(255, 255, 255, .92) rgba(133, 105, 118, .22) rgba(113, 87, 99, .28) rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .62);
  color: #584951;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .9), 0 5px 14px rgba(91, 64, 77, .07);
}

html[data-color-mode="day"] .secondary-button:hover,
html[data-color-mode="day"] .icon-button:hover {
  border-color: rgba(220, 120, 159, .34);
  background: rgba(255, 236, 244, .78);
  color: var(--accent-strong);
}

html[data-color-mode="day"] .icon-button { color: #82747c; }
html[data-color-mode="day"] .notice-block { background: rgba(255, 231, 240, .66); color: #6b4051; }
html[data-color-mode="day"] .notice-block p { color: #80616e; }

html[data-color-mode="day"] .rail-button { color: #8d7f87; }
html[data-color-mode="day"] .rail-button:hover { background: rgba(255, 255, 255, .48); color: #654f5a; }
html[data-color-mode="day"] .rail-button.active {
  background: rgba(255, 229, 239, .72);
  color: var(--accent-strong);
}
html[data-color-mode="day"] .rail-button.active::before { background: var(--accent); box-shadow: 0 0 10px rgba(220, 120, 159, .3); }

html[data-color-mode="day"] .conversation-item:hover,
html[data-color-mode="day"] .contact-item:hover { background: rgba(255, 255, 255, .46); }
html[data-color-mode="day"] .conversation-item.active,
html[data-color-mode="day"] .contact-item.active { background: rgba(255, 225, 237, .66); }
html[data-color-mode="day"] .conversation-item.active::before,
html[data-color-mode="day"] .contact-item.active::before { background: var(--accent); }

html[data-color-mode="day"] .avatar { background: linear-gradient(135deg, #c4aeb9, #9aaeb9); color: #fff; }
html[data-color-mode="day"] .group-avatar { background: linear-gradient(135deg, #d9a4b9, #9daeba); }
html[data-color-mode="day"] .presence-dot { border-color: rgba(255, 255, 255, .9); }
html[data-color-mode="day"] .badge,
html[data-color-mode="day"] .nav-dot { background: var(--accent); color: #fff; }

html[data-color-mode="day"] .empty-symbol {
  border-color: rgba(255, 255, 255, .9) rgba(142, 112, 126, .2) rgba(119, 92, 104, .25) rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .56);
  color: var(--accent);
  box-shadow: var(--glass-shadow);
}

html[data-color-mode="day"] .message-bubble,
html[data-color-mode="day"] .message-file,
html[data-color-mode="day"] .reaction-pill,
html[data-color-mode="day"] .draft-tile,
html[data-color-mode="day"] .featured-card {
  border-color: var(--glass-edge-top) var(--glass-edge-right) var(--glass-edge-bottom) var(--glass-edge-left);
  background: rgba(255, 255, 255, .68);
  color: var(--text);
  box-shadow: 0 7px 18px rgba(94, 67, 79, .09), inset 1px 1px 0 rgba(255, 255, 255, .82), inset -1px -1px 0 rgba(112, 85, 98, .06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

html[data-color-mode="day"] .message-row.own .message-bubble {
  border-color: rgba(255, 255, 255, .95) rgba(192, 104, 140, .26) rgba(164, 78, 113, .3) rgba(255, 255, 255, .9);
  background: rgba(248, 215, 228, .78);
  color: #4e3440;
}

html[data-color-mode="day"] .reply-quote { border-color: var(--accent); background: rgba(255, 255, 255, .42); color: #69555f; }
html[data-color-mode="day"] button.reply-quote:hover { background: rgba(255, 235, 243, .72); }
html[data-color-mode="day"] .reaction-pill.own { border-color: rgba(220, 120, 159, .32); background: rgba(250, 220, 232, .72); color: #9f4669; }
html[data-color-mode="day"] .message-system-notice { color: #668ca5; }
html[data-color-mode="day"] .mention-preview,
html[data-color-mode="day"] .mention-label,
html[data-color-mode="day"] .message-mention.me { color: #c84f69; }
html[data-color-mode="day"] .message-mention { color: #4d83a4; }

html[data-color-mode="day"] .mention-panel,
html[data-color-mode="day"] .bot-command-panel,
html[data-color-mode="day"] .message-actions,
html[data-color-mode="day"] .member-context-menu,
html[data-color-mode="day"] .message-context-menu,
html[data-color-mode="day"] .image-context-menu,
html[data-color-mode="day"] .group-content-menu,
html[data-color-mode="day"] .featured-card-menu {
  border-color: var(--glass-edge-top) var(--glass-edge-right) var(--glass-edge-bottom) var(--glass-edge-left);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

html[data-color-mode="day"] .member-context-action,
html[data-color-mode="day"] .message-context-action,
html[data-color-mode="day"] .image-context-action,
html[data-color-mode="day"] .group-content-item,
html[data-color-mode="day"] .featured-card-menu-item { color: var(--text); }

html[data-color-mode="day"] .member-context-action:hover,
html[data-color-mode="day"] .message-context-action:hover,
html[data-color-mode="day"] .message-context-reaction:hover,
html[data-color-mode="day"] .image-context-action:hover,
html[data-color-mode="day"] .group-content-item:hover,
html[data-color-mode="day"] .featured-card-menu-item:hover { background: rgba(255, 226, 238, .66); }

html[data-color-mode="day"] .member-context-action .lucide,
html[data-color-mode="day"] .message-context-action .lucide,
html[data-color-mode="day"] .group-content-item .lucide { color: #806f78; }
html[data-color-mode="day"] .member-context-separator,
html[data-color-mode="day"] .message-context-separator { background: var(--line-soft); }

html[data-color-mode="day"] .modal-backdrop,
html[data-color-mode="day"] .drawer-backdrop {
  background: rgba(91, 70, 80, .2);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

html[data-color-mode="day"] .modal-header,
html[data-color-mode="day"] .drawer-tabs,
html[data-color-mode="day"] .settings-view .settings-page-header {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, .7);
}

html[data-color-mode="day"] .drawer-tab { color: var(--muted); }
html[data-color-mode="day"] .drawer-tab.active { color: var(--accent-strong); }
html[data-color-mode="day"] .featured-modal .modal-body { background: transparent; }

html[data-color-mode="day"] .settings-hub-item:hover,
html[data-color-mode="day"] .my-feature-card:hover {
  border-color: rgba(220, 120, 159, .42);
  background: rgba(255, 244, 248, .78);
}

html[data-color-mode="day"] .settings-hub-icon,
html[data-color-mode="day"] .settings-hub-item:nth-child(2) .settings-hub-icon,
html[data-color-mode="day"] .settings-hub-item:nth-child(3) .settings-hub-icon,
html[data-color-mode="day"] .settings-hub-item:nth-child(4) .settings-hub-icon {
  background: rgba(247, 211, 225, .72);
  color: var(--accent-strong);
}

html[data-color-mode="day"] .settings-detail-body > .settings-section + .settings-section,
html[data-color-mode="day"] .settings-detail-body .setting-row,
html[data-color-mode="day"] .settings-detail-body .appearance-setting-block,
html[data-color-mode="day"] .settings-section,
html[data-color-mode="day"] .admin-section,
html[data-color-mode="day"] .drawer-section { border-color: var(--line-soft); }

html[data-color-mode="day"] .palette-option {
  border-color: rgba(255, 255, 255, .94) rgba(137, 107, 121, .22) rgba(114, 87, 99, .28) rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .64);
  box-shadow: var(--glass-shadow);
}
html[data-color-mode="day"] .palette-option.active { border-color: rgba(255, 255, 255, .96) var(--accent) #b9547b rgba(255, 255, 255, .92); }

html[data-color-mode="day"] .join-policy-options,
html[data-color-mode="day"] .sticker-utility,
html[data-color-mode="day"] .inline-create-folder {
  border-color: var(--line);
  background: rgba(255, 255, 255, .5);
}
html[data-color-mode="day"] .join-policy-row { border-color: var(--line-soft); color: var(--text); }
html[data-color-mode="day"] .join-policy-row input { accent-color: var(--accent); }

html[data-color-mode="day"] .toast {
  border-color: var(--glass-edge-top) var(--glass-edge-right) var(--glass-edge-bottom) var(--glass-edge-left);
  background: rgba(255, 255, 255, .9);
  color: var(--text);
  box-shadow: var(--glass-shadow);
}

html[data-color-mode="day"] * { scrollbar-color: #c8aab7 transparent; }

@media (max-width: 720px) {
  .palette-options { grid-template-columns: 1fr; }
  html[data-color-mode="day"] .rail {
    background: rgba(255, 255, 255, .76);
    box-shadow: 0 -10px 28px rgba(91, 66, 77, .1), inset 0 1px 0 rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    backdrop-filter: blur(18px) saturate(1.08);
  }
  html[data-color-mode="day"] .chat-header,
  html[data-color-mode="day"] .composer {
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    backdrop-filter: blur(14px) saturate(1.05);
  }
  html[data-color-mode="day"] .message-context-backdrop.mobile { background: rgba(91, 70, 80, .18); }
}

/* Nyacraft keeps the original cool blue and violet identity. */
html[data-color-mode="day"][data-palette="nyacraft"] {
  --accent: #729fd0;
  --accent-strong: #426f9f;
  --accent-soft: rgba(114, 159, 208, .14);
  --pink: #c58fb9;
  --purple: #827bb4;
  --blue: #729fd0;
}

html[data-color-mode="day"][data-palette="nyacraft"] .primary-button,
html[data-color-mode="day"][data-palette="nyacraft"] .send-button {
  border-color: rgba(255, 255, 255, .7) rgba(77, 119, 164, .28) rgba(55, 91, 132, .34) rgba(255, 255, 255, .64);
  background: linear-gradient(135deg, #739fd0, #847eb7);
  box-shadow: 0 8px 20px rgba(72, 95, 139, .2), inset 1px 1px 0 rgba(255, 255, 255, .34);
}

html[data-color-mode="day"][data-palette="nyacraft"] .primary-button:hover,
html[data-color-mode="day"][data-palette="nyacraft"] .send-button:hover {
  background: linear-gradient(135deg, #6592c4, #7770aa);
}

html[data-color-mode="day"][data-palette="nyacraft"] input:focus,
html[data-color-mode="day"][data-palette="nyacraft"] textarea:focus,
html[data-color-mode="day"][data-palette="nyacraft"] select:focus {
  box-shadow: 0 0 0 3px rgba(114, 159, 208, .13), inset 1px 1px 0 rgba(255, 255, 255, .9);
}

html[data-color-mode="day"][data-palette="nyacraft"] .secondary-button:hover,
html[data-color-mode="day"][data-palette="nyacraft"] .icon-button:hover,
html[data-color-mode="day"][data-palette="nyacraft"] .member-context-action:hover,
html[data-color-mode="day"][data-palette="nyacraft"] .message-context-action:hover,
html[data-color-mode="day"][data-palette="nyacraft"] .message-context-reaction:hover,
html[data-color-mode="day"][data-palette="nyacraft"] .image-context-action:hover,
html[data-color-mode="day"][data-palette="nyacraft"] .group-content-item:hover,
html[data-color-mode="day"][data-palette="nyacraft"] .featured-card-menu-item:hover {
  border-color: rgba(114, 159, 208, .34);
  background: rgba(226, 237, 249, .76);
  color: var(--accent-strong);
}

html[data-color-mode="day"][data-palette="nyacraft"] .rail-button.active,
html[data-color-mode="day"][data-palette="nyacraft"] .conversation-item.active,
html[data-color-mode="day"][data-palette="nyacraft"] .contact-item.active {
  background: rgba(222, 235, 249, .72);
}

html[data-color-mode="day"][data-palette="nyacraft"] .message-row.own .message-bubble {
  border-color: rgba(255, 255, 255, .95) rgba(111, 151, 194, .27) rgba(81, 119, 161, .31) rgba(255, 255, 255, .9);
  background: rgba(215, 230, 247, .82);
  color: #34485c;
}

html[data-color-mode="day"][data-palette="nyacraft"] .settings-hub-item:hover,
html[data-color-mode="day"][data-palette="nyacraft"] .my-feature-card:hover {
  border-color: rgba(114, 159, 208, .42);
  background: rgba(240, 246, 252, .82);
}

html[data-color-mode="day"][data-palette="nyacraft"] .settings-hub-icon,
html[data-color-mode="day"][data-palette="nyacraft"] .settings-hub-item:nth-child(2) .settings-hub-icon,
html[data-color-mode="day"][data-palette="nyacraft"] .settings-hub-item:nth-child(3) .settings-hub-icon,
html[data-color-mode="day"][data-palette="nyacraft"] .settings-hub-item:nth-child(4) .settings-hub-icon {
  background: rgba(214, 230, 247, .76);
  color: var(--accent-strong);
}

html[data-color-mode="day"][data-palette="nyacraft"] .palette-option.active {
  border-color: rgba(255, 255, 255, .96) var(--accent) #4c78a7 rgba(255, 255, 255, .92);
}

html[data-color-mode="day"][data-palette="nyacraft"] .notice-block {
  background: rgba(220, 234, 248, .7);
  color: #3e5f7f;
}

/* Sakura daylight deliberately tints the whole environment, not only controls. */
html[data-color-mode="day"][data-palette="sakura"] {
  --bg: #fbe5ed;
  --rail: rgba(255, 235, 243, .56);
  --sidebar: rgba(255, 231, 240, .48);
  --surface: rgba(255, 242, 247, .44);
  --surface-2: rgba(255, 237, 244, .56);
  --surface-3: rgba(255, 247, 250, .72);
  --line: rgba(174, 92, 124, .22);
  --line-soft: rgba(174, 92, 124, .13);
  --text: #55434c;
  --muted: #8b707c;
  --faint: #ad8e9a;
  --accent: #e37fa6;
  --accent-strong: #b84f78;
  --accent-soft: rgba(227, 127, 166, .17);
  --glass-edge-right: rgba(188, 104, 137, .22);
  --glass-edge-bottom: rgba(165, 78, 112, .28);
  --glass-shadow: 0 15px 38px rgba(165, 76, 111, .13), inset 1px 1px 0 rgba(255, 255, 255, .76), inset -1px -1px 0 rgba(169, 78, 113, .08);
}

html[data-color-mode="day"][data-palette="sakura"],
html[data-color-mode="day"][data-palette="sakura"] body,
html[data-color-mode="day"][data-palette="sakura"] .workspace,
html[data-color-mode="day"][data-palette="sakura"] .content-view {
  background: #fbe5ed;
}

html[data-color-mode="day"][data-palette="sakura"] .app-shell,
html[data-color-mode="day"][data-palette="sakura"] .loading-screen,
html[data-color-mode="day"][data-palette="sakura"] .auth-screen {
  background:
    linear-gradient(118deg, rgba(255, 255, 255, .72) 0%, rgba(255, 255, 255, .14) 42%, transparent 68%),
    linear-gradient(304deg, rgba(226, 119, 160, .2) 0%, rgba(251, 221, 232, .54) 46%, rgba(255, 246, 250, .72) 100%),
    #f8dce7;
}

html[data-color-mode="day"][data-palette="sakura"] .workspace,
html[data-color-mode="day"][data-palette="sakura"] .content-view {
  background:
    linear-gradient(112deg, rgba(255, 255, 255, .36) 0%, transparent 45%),
    linear-gradient(302deg, rgba(225, 118, 159, .15) 0%, rgba(255, 238, 245, .3) 68%),
    rgba(248, 221, 231, .7);
}

html[data-color-mode="day"][data-palette="sakura"] .rail {
  background: rgba(255, 239, 245, .5);
}

html[data-color-mode="day"][data-palette="sakura"] .sidebar {
  background: rgba(255, 237, 244, .44);
}

html[data-color-mode="day"][data-palette="sakura"] .auth-panel,
html[data-color-mode="day"][data-palette="sakura"] .chat-header,
html[data-color-mode="day"][data-palette="sakura"] .content-header,
html[data-color-mode="day"][data-palette="sakura"] .composer,
html[data-color-mode="day"][data-palette="sakura"] .reply-bar,
html[data-color-mode="day"][data-palette="sakura"] .draft-attachments,
html[data-color-mode="day"][data-palette="sakura"] .modal,
html[data-color-mode="day"][data-palette="sakura"] .side-drawer,
html[data-color-mode="day"][data-palette="sakura"] .sticker-panel,
html[data-color-mode="day"][data-palette="sakura"] .settings-hub-item,
html[data-color-mode="day"][data-palette="sakura"] .my-feature-card,
html[data-color-mode="day"][data-palette="sakura"] .admin-status-card,
html[data-color-mode="day"][data-palette="sakura"] .profile-card,
html[data-color-mode="day"][data-palette="sakura"] .save-location-row,
html[data-color-mode="day"][data-palette="sakura"] .client-update-panel {
  background: rgba(255, 246, 249, .4);
  -webkit-backdrop-filter: blur(24px) saturate(1.12);
  backdrop-filter: blur(24px) saturate(1.12);
}

html[data-color-mode="day"][data-palette="sakura"] .chat-header,
html[data-color-mode="day"][data-palette="sakura"] .content-header,
html[data-color-mode="day"][data-palette="sakura"] .composer,
html[data-color-mode="day"][data-palette="sakura"] .reply-bar,
html[data-color-mode="day"][data-palette="sakura"] .draft-attachments,
html[data-color-mode="day"][data-palette="sakura"] .modal-header,
html[data-color-mode="day"][data-palette="sakura"] .drawer-tabs,
html[data-color-mode="day"][data-palette="sakura"] .settings-view .settings-page-header {
  background: rgba(255, 242, 247, .4);
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
  backdrop-filter: blur(22px) saturate(1.1);
}

html[data-color-mode="day"][data-palette="sakura"] input,
html[data-color-mode="day"][data-palette="sakura"] textarea,
html[data-color-mode="day"][data-palette="sakura"] select,
html[data-color-mode="day"][data-palette="sakura"] .search-wrap,
html[data-color-mode="day"][data-palette="sakura"] .composer textarea {
  background: rgba(255, 247, 250, .5);
}

html[data-color-mode="day"][data-palette="sakura"] .conversation-item:hover,
html[data-color-mode="day"][data-palette="sakura"] .contact-item:hover {
  background: rgba(255, 240, 246, .55);
}

html[data-color-mode="day"][data-palette="sakura"] .conversation-item.active,
html[data-color-mode="day"][data-palette="sakura"] .contact-item.active,
html[data-color-mode="day"][data-palette="sakura"] .rail-button.active {
  background: rgba(244, 183, 207, .48);
}

html[data-color-mode="day"][data-palette="sakura"] .message-bubble,
html[data-color-mode="day"][data-palette="sakura"] .message-file,
html[data-color-mode="day"][data-palette="sakura"] .reaction-pill,
html[data-color-mode="day"][data-palette="sakura"] .draft-tile,
html[data-color-mode="day"][data-palette="sakura"] .featured-card {
  background: rgba(255, 247, 250, .48);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  backdrop-filter: blur(20px) saturate(1.1);
}

html[data-color-mode="day"][data-palette="sakura"] .message-row.own .message-bubble {
  border-color: var(--glass-edge-top) var(--glass-edge-right) var(--glass-edge-bottom) var(--glass-edge-left);
  background: rgba(255, 247, 250, .48);
  color: var(--text);
}

html[data-color-mode="day"][data-palette="sakura"] .mention-panel,
html[data-color-mode="day"][data-palette="sakura"] .bot-command-panel,
html[data-color-mode="day"][data-palette="sakura"] .message-actions,
html[data-color-mode="day"][data-palette="sakura"] .member-context-menu,
html[data-color-mode="day"][data-palette="sakura"] .message-context-menu,
html[data-color-mode="day"][data-palette="sakura"] .image-context-menu,
html[data-color-mode="day"][data-palette="sakura"] .group-content-menu,
html[data-color-mode="day"][data-palette="sakura"] .featured-card-menu,
html[data-color-mode="day"][data-palette="sakura"] .toast {
  background: rgba(255, 244, 248, .72);
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
  backdrop-filter: blur(22px) saturate(1.1);
}

@media (max-width: 720px) {
  html[data-color-mode="day"][data-palette="sakura"] .rail {
    background: rgba(255, 239, 245, .58);
  }
}

/* Neutral glass handle shared by every brightness and palette combination. */
.sidebar-collapse-button,
.sidebar-collapse-button:hover,
.sidebar-collapse-button:focus-visible {
  border: 1px solid rgba(127, 127, 127, .16);
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .18), inset -1px -1px 0 rgba(35, 30, 33, .06);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
  backdrop-filter: blur(10px) saturate(1.05);
}

.sidebar-collapse-button { opacity: .56; }
.sidebar-collapse-button:hover,
.sidebar-collapse-button:focus-visible { opacity: .88; }

html[data-color-mode="day"] .sidebar-collapse-button,
html[data-color-mode="day"] .sidebar-collapse-button:hover,
html[data-color-mode="day"] .sidebar-collapse-button:focus-visible {
  border-color: rgba(104, 86, 95, .14);
  background: rgba(255, 255, 255, .16);
  color: rgba(83, 69, 76, .62);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .54), inset -1px -1px 0 rgba(79, 61, 70, .04);
}

/* Dessert palettes share one glass system while keeping independent colors. */
html[data-color-mode="day"][data-palette="sakura"] {
  --theme-bg: #f8e5ed;
  --theme-depth: #e9bdce;
  --theme-tint: #dd789e;
  --theme-secondary: #c897b2;
  --theme-button-end: #b4779b;
  --text: #55434c;
  --muted: #876f7a;
  --faint: #aa8e9a;
  --accent: #dd789e;
  --accent-strong: #ad4e72;
  --accent-soft: rgba(221, 120, 158, .16);
  --theme-shadow: rgba(150, 74, 105, .09);
  --theme-shadow-soft: rgba(150, 74, 105, .05);
  --theme-glow: rgba(221, 120, 158, .2);
}

html[data-color-mode="day"][data-palette="taro-boba"] {
  --theme-bg: #eee7f5;
  --theme-depth: #cbb6dc;
  --theme-tint: #9b74bc;
  --theme-secondary: #d6a7ca;
  --theme-button-end: #c483a8;
  --text: #493d52;
  --muted: #776981;
  --faint: #9b8da5;
  --accent: #9b74bc;
  --accent-strong: #71518e;
  --accent-soft: rgba(155, 116, 188, .16);
  --theme-shadow: rgba(104, 74, 128, .09);
  --theme-shadow-soft: rgba(104, 74, 128, .05);
  --theme-glow: rgba(155, 116, 188, .2);
}

html[data-color-mode="day"][data-palette="sea-salt-lychee"] {
  --theme-bg: #f2f6f7;
  --theme-depth: #c7e4e9;
  --theme-tint: #69adbf;
  --theme-secondary: #d94f78;
  --theme-button-end: #b93d64;
  --text: #344950;
  --muted: #61777e;
  --faint: #879ba1;
  --accent: #5d9faf;
  --accent-strong: #397786;
  --accent-soft: rgba(93, 159, 175, .16);
  --theme-shadow: rgba(129, 70, 91, .1);
  --theme-shadow-soft: rgba(129, 70, 91, .055);
  --theme-glow: rgba(93, 159, 175, .22);
}

html[data-color-mode="day"][data-palette="orange-soda"] {
  --theme-bg: #f7e7dd;
  --theme-depth: #efc1a7;
  --theme-tint: #df7f55;
  --theme-secondary: #efad93;
  --theme-button-end: #e49a79;
  --text: #553f35;
  --muted: #80695e;
  --faint: #a48b7e;
  --accent: #df7f55;
  --accent-strong: #aa5535;
  --accent-soft: rgba(223, 127, 85, .16);
  --theme-shadow: rgba(130, 75, 50, .085);
  --theme-shadow-soft: rgba(130, 75, 50, .045);
  --theme-glow: rgba(223, 127, 85, .2);
}

html[data-color-mode="day"][data-palette="mung-bean"] {
  --theme-bg: #e4efe8;
  --theme-depth: #b2d2be;
  --theme-tint: #679a7a;
  --theme-secondary: #8fbab3;
  --theme-button-end: #6e9f98;
  --text: #374b40;
  --muted: #65796d;
  --faint: #889b8f;
  --accent: #679a7a;
  --accent-strong: #47745a;
  --accent-soft: rgba(103, 154, 122, .16);
  --theme-shadow: rgba(52, 96, 68, .085);
  --theme-shadow-soft: rgba(52, 96, 68, .045);
  --theme-glow: rgba(103, 154, 122, .2);
}

html[data-color-mode="night"][data-palette="sakura"] {
  --theme-bg: #1c151c;
  --theme-depth: #2c2029;
  --theme-tint: #d982a5;
  --theme-secondary: #a789b6;
  --theme-button-end: #9e7399;
  --text: #f3edf1;
  --muted: #c0a9b5;
  --faint: #8e7581;
  --accent: #d982a5;
  --accent-strong: #efb6cc;
  --accent-soft: rgba(217, 130, 165, .14);
  --theme-shadow: rgba(0, 0, 0, .22);
  --theme-shadow-soft: rgba(0, 0, 0, .14);
  --theme-glow: rgba(217, 130, 165, .24);
}

html[data-color-mode="night"][data-palette="taro-boba"] {
  --theme-bg: #17131d;
  --theme-depth: #292032;
  --theme-tint: #aa88c4;
  --theme-secondary: #d2a5c7;
  --theme-button-end: #8d689f;
  --text: #f0eaf5;
  --muted: #baa9c4;
  --faint: #82758c;
  --accent: #aa88c4;
  --accent-strong: #d9bbed;
  --accent-soft: rgba(170, 136, 196, .14);
  --theme-shadow: rgba(0, 0, 0, .22);
  --theme-shadow-soft: rgba(0, 0, 0, .14);
  --theme-glow: rgba(170, 136, 196, .24);
}

html[data-color-mode="night"][data-palette="sea-salt-lychee"] {
  --theme-bg: #111b22;
  --theme-depth: #25202a;
  --theme-tint: #70b3c3;
  --theme-secondary: #d75a7e;
  --theme-button-end: #a93a60;
  --text: #e9f2f4;
  --muted: #a2bac0;
  --faint: #70868c;
  --accent: #70b3c3;
  --accent-strong: #b5e0e6;
  --accent-soft: rgba(112, 179, 195, .14);
  --theme-shadow: rgba(0, 0, 0, .22);
  --theme-shadow-soft: rgba(0, 0, 0, .14);
  --theme-glow: rgba(112, 179, 195, .24);
}

html[data-color-mode="night"][data-palette="orange-soda"] {
  --theme-bg: #1d1612;
  --theme-depth: #2e221b;
  --theme-tint: #e58a61;
  --theme-secondary: #e5a98d;
  --theme-button-end: #b96b51;
  --text: #f7eee8;
  --muted: #c4aa9b;
  --faint: #8d7569;
  --accent: #e58a61;
  --accent-strong: #ffc1a2;
  --accent-soft: rgba(229, 138, 97, .14);
  --theme-shadow: rgba(0, 0, 0, .22);
  --theme-shadow-soft: rgba(0, 0, 0, .14);
  --theme-glow: rgba(229, 138, 97, .24);
}

html[data-color-mode="night"][data-palette="mung-bean"] {
  --theme-bg: #121b17;
  --theme-depth: #1e2c25;
  --theme-tint: #75a989;
  --theme-secondary: #76a7a0;
  --theme-button-end: #568c83;
  --text: #eaf3ed;
  --muted: #a4baad;
  --faint: #72867b;
  --accent: #75a989;
  --accent-strong: #aad4ba;
  --accent-soft: rgba(117, 169, 137, .14);
  --theme-shadow: rgba(0, 0, 0, .22);
  --theme-shadow-soft: rgba(0, 0, 0, .14);
  --theme-glow: rgba(117, 169, 137, .24);
}

html[data-color-mode="day"][data-palette]:not([data-palette="nyacraft"]) {
  --bg: var(--theme-bg);
  --rail: color-mix(in srgb, var(--theme-bg) 54%, rgba(255, 255, 255, .68));
  --sidebar: color-mix(in srgb, var(--theme-bg) 62%, rgba(255, 255, 255, .54));
  --surface: color-mix(in srgb, var(--theme-bg) 34%, rgba(255, 255, 255, .62));
  --surface-2: color-mix(in srgb, var(--theme-bg) 42%, rgba(255, 255, 255, .7));
  --surface-3: color-mix(in srgb, var(--theme-bg) 24%, rgba(255, 255, 255, .86));
  --line: color-mix(in srgb, var(--accent) 24%, transparent);
  --line-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --pink: var(--theme-secondary);
  --purple: var(--theme-button-end);
  --blue: var(--theme-tint);
  --theme-glass: color-mix(in srgb, var(--theme-bg) 28%, rgba(255, 255, 255, .62));
  --theme-glass-strong: color-mix(in srgb, var(--theme-bg) 20%, rgba(255, 255, 255, .78));
  --theme-input: color-mix(in srgb, var(--theme-bg) 18%, rgba(255, 255, 255, .72));
  --theme-active: color-mix(in srgb, var(--theme-tint) 22%, rgba(255, 255, 255, .54));
  --theme-edge-top: rgba(255, 255, 255, .98);
  --theme-edge-right: color-mix(in srgb, var(--accent) 26%, rgba(102, 80, 90, .16));
  --theme-edge-bottom: color-mix(in srgb, var(--accent) 34%, rgba(85, 65, 74, .2));
  --theme-edge-left: rgba(255, 255, 255, .92);
  --theme-glass-shadow: 0 8px 24px var(--theme-shadow), inset 1px 1px 0 rgba(255, 255, 255, .78), inset -1px -1px 0 rgba(72, 53, 62, .07);
}

html[data-color-mode="night"][data-palette]:not([data-palette="nyacraft"]) {
  --bg: var(--theme-bg);
  --rail: color-mix(in srgb, var(--theme-depth) 72%, rgba(9, 10, 14, .82));
  --sidebar: color-mix(in srgb, var(--theme-depth) 78%, rgba(12, 13, 18, .76));
  --surface: color-mix(in srgb, var(--theme-depth) 72%, rgba(17, 18, 24, .74));
  --surface-2: color-mix(in srgb, var(--theme-depth) 78%, rgba(25, 26, 34, .8));
  --surface-3: color-mix(in srgb, var(--theme-depth) 82%, rgba(34, 35, 44, .86));
  --line: color-mix(in srgb, var(--theme-tint) 20%, transparent);
  --line-soft: color-mix(in srgb, var(--theme-tint) 11%, transparent);
  --pink: var(--theme-secondary);
  --purple: var(--theme-button-end);
  --blue: var(--theme-tint);
  --theme-glass: color-mix(in srgb, var(--theme-depth) 72%, rgba(14, 15, 21, .72));
  --theme-glass-strong: color-mix(in srgb, var(--theme-depth) 78%, rgba(20, 21, 28, .86));
  --theme-input: color-mix(in srgb, var(--theme-depth) 52%, rgba(7, 8, 12, .66));
  --theme-active: color-mix(in srgb, var(--theme-tint) 18%, rgba(255, 255, 255, .035));
  --theme-edge-top: rgba(255, 255, 255, .16);
  --theme-edge-right: color-mix(in srgb, var(--theme-tint) 18%, rgba(0, 0, 0, .22));
  --theme-edge-bottom: rgba(0, 0, 0, .32);
  --theme-edge-left: rgba(255, 255, 255, .11);
  --theme-glass-shadow: 0 12px 32px var(--theme-shadow), inset 1px 1px 0 rgba(255, 255, 255, .08), inset -1px -1px 0 rgba(0, 0, 0, .15);
}

html[data-palette]:not([data-palette="nyacraft"]),
html[data-palette]:not([data-palette="nyacraft"]) body,
html[data-palette]:not([data-palette="nyacraft"]) .workspace,
html[data-palette]:not([data-palette="nyacraft"]) .content-view {
  background: var(--theme-bg);
  color: var(--text);
}

html[data-palette]:not([data-palette="nyacraft"]) .app-shell,
html[data-palette]:not([data-palette="nyacraft"]) .loading-screen,
html[data-palette]:not([data-palette="nyacraft"]) .auth-screen {
  background:
    linear-gradient(122deg, color-mix(in srgb, white 34%, transparent), transparent 48%),
    linear-gradient(310deg, color-mix(in srgb, var(--theme-tint) 20%, transparent), transparent 62%),
    linear-gradient(145deg, var(--theme-bg), color-mix(in srgb, var(--theme-depth) 42%, var(--theme-bg)));
}

html[data-color-mode="night"][data-palette]:not([data-palette="nyacraft"]) .app-shell,
html[data-color-mode="night"][data-palette]:not([data-palette="nyacraft"]) .loading-screen,
html[data-color-mode="night"][data-palette]:not([data-palette="nyacraft"]) .auth-screen {
  background:
    linear-gradient(122deg, rgba(255, 255, 255, .035), transparent 46%),
    linear-gradient(310deg, color-mix(in srgb, var(--theme-tint) 10%, transparent), transparent 64%),
    linear-gradient(145deg, var(--theme-bg), color-mix(in srgb, var(--theme-depth) 68%, #0c0d12));
}

/* Sea-salt lychee uses a full diagonal blue-to-rose field instead of a single tint. */
html[data-color-mode="day"][data-palette="sea-salt-lychee"]:not([data-palette="nyacraft"]) {
  --theme-glass: rgba(255, 255, 255, .46);
  --theme-glass-strong: rgba(255, 255, 255, .58);
  --theme-input: rgba(255, 255, 255, .54);
  --theme-active: rgba(199, 232, 239, .58);
  --theme-edge-top: rgba(255, 255, 255, .98);
  --theme-edge-right: rgba(160, 88, 108, .16);
  --theme-edge-bottom: rgba(134, 72, 91, .19);
  --theme-edge-left: rgba(255, 255, 255, .92);
  --theme-glass-shadow: 0 9px 26px rgba(102, 72, 82, .08), inset 1px 1px 0 rgba(255, 255, 255, .8), inset -1px -1px 0 rgba(120, 70, 86, .05);
}

html[data-color-mode="day"][data-palette="sea-salt-lychee"] :is(.app-shell, .loading-screen, .auth-screen) {
  background: linear-gradient(135deg, #bce8f1 0%, #f9f8f9 47%, #efd7dd 76%, #c88b9c 100%);
}

html[data-color-mode="day"][data-palette="sea-salt-lychee"] .app-shell :is(.workspace, .content-view) {
  background: linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .025) 54%, rgba(255, 255, 255, .04));
}

html[data-color-mode="night"][data-palette="sea-salt-lychee"]:not([data-palette="nyacraft"]) {
  --theme-glass: rgba(20, 24, 31, .58);
  --theme-glass-strong: rgba(20, 24, 31, .7);
  --theme-input: rgba(12, 17, 23, .64);
  --theme-active: rgba(62, 116, 130, .3);
  --theme-edge-right: rgba(167, 79, 105, .16);
  --theme-edge-bottom: rgba(92, 45, 61, .24);
  --theme-glass-shadow: 0 12px 32px rgba(0, 0, 0, .24), inset 1px 1px 0 rgba(255, 255, 255, .09), inset -1px -1px 0 rgba(76, 35, 49, .16);
}

html[data-color-mode="night"][data-palette="sea-salt-lychee"]:not([data-palette="nyacraft"]) :is(.app-shell, .loading-screen, .auth-screen) {
  background: linear-gradient(135deg, #123040 0%, #171923 49%, #432a35 76%, #653245 100%);
}

html[data-color-mode="night"][data-palette="sea-salt-lychee"] .app-shell :is(.workspace, .content-view) {
  background: linear-gradient(135deg, rgba(112, 179, 195, .045), rgba(12, 13, 18, .08) 54%, rgba(193, 111, 135, .035));
}

html[data-palette]:not([data-palette="nyacraft"]) .workspace,
html[data-palette]:not([data-palette="nyacraft"]) .content-view {
  background:
    linear-gradient(112deg, color-mix(in srgb, white 16%, transparent), transparent 44%),
    linear-gradient(302deg, color-mix(in srgb, var(--theme-tint) 11%, transparent), transparent 68%),
    color-mix(in srgb, var(--theme-bg) 88%, transparent);
}

html[data-palette]:not([data-palette="nyacraft"]) :is(
  .auth-panel, .rail, .sidebar, .chat-header, .content-header, .composer,
  .reply-bar, .draft-attachments, .modal, .side-drawer, .sticker-panel,
  .settings-hub-item, .my-feature-card, .admin-status-card, .profile-card,
  .save-location-row, .client-update-panel, .section-block, .profile-editor,
  .settings-group, .admin-section, .mention-panel, .bot-command-panel,
  .message-actions, .member-context-menu, .message-context-menu,
  .image-context-menu, .group-content-menu, .featured-card-menu, .toast,
  .palette-option
) {
  border: 1px solid;
  border-color: var(--theme-edge-top) var(--theme-edge-right) var(--theme-edge-bottom) var(--theme-edge-left);
  background: var(--theme-glass);
  box-shadow: var(--theme-glass-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  backdrop-filter: blur(20px) saturate(1.1);
}

html[data-palette]:not([data-palette="nyacraft"]) :is(.rail, .sidebar, .modal, .side-drawer, .sticker-panel) {
  background: var(--theme-glass-strong);
}

html[data-palette]:not([data-palette="nyacraft"]) :is(input, textarea, select, .search-wrap, .composer textarea) {
  border-color: var(--line);
  background: var(--theme-input);
  color: var(--text);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .1);
}

html[data-color-mode="day"][data-palette]:not([data-palette="nyacraft"]) :is(input, textarea, select, .search-wrap, .composer textarea) {
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .88), inset -1px -1px 0 rgba(70, 50, 60, .05);
}

html[data-palette]:not([data-palette="nyacraft"]) :is(input, textarea, select):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--theme-glow), inset 1px 1px 0 rgba(255, 255, 255, .13);
}

html[data-palette]:not([data-palette="nyacraft"]) :is(.primary-button, .send-button) {
  border-color: color-mix(in srgb, white 26%, var(--theme-tint));
  background: linear-gradient(135deg, var(--theme-tint), var(--theme-button-end));
  color: #fff;
  box-shadow: 0 7px 18px var(--theme-shadow), inset 1px 1px 0 rgba(255, 255, 255, .27);
}

html[data-palette]:not([data-palette="nyacraft"]) :is(.primary-button, .send-button):hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme-tint) 84%, white), color-mix(in srgb, var(--theme-button-end) 86%, white));
}

html[data-palette]:not([data-palette="nyacraft"]) :is(
  .rail-button.active, .conversation-item.active, .contact-item.active,
  .segmented button.active
) {
  background: var(--theme-active);
  color: var(--accent-strong);
}

html[data-palette]:not([data-palette="nyacraft"]) .rail-button.active::before,
html[data-palette]:not([data-palette="nyacraft"]) .conversation-item.active::before,
html[data-palette]:not([data-palette="nyacraft"]) .contact-item.active::before {
  background: var(--accent);
  box-shadow: 0 0 10px var(--theme-glow);
}

html[data-palette]:not([data-palette="nyacraft"]) :is(
  .conversation-item:hover, .contact-item:hover, .rail-button:hover,
  .secondary-button:hover, .icon-button:hover, .settings-hub-item:hover,
  .my-feature-card:hover
) {
  border-color: color-mix(in srgb, var(--accent) 36%, transparent);
  background: color-mix(in srgb, var(--theme-active) 78%, transparent);
  color: var(--accent-strong);
}

html[data-palette]:not([data-palette="nyacraft"]) :is(
  .message-bubble, .message-row.own .message-bubble, .message-file,
  .reaction-pill, .draft-tile, .featured-card
) {
  border: 1px solid;
  border-color: var(--theme-edge-top) var(--theme-edge-right) var(--theme-edge-bottom) var(--theme-edge-left);
  background: var(--theme-glass-strong);
  color: var(--text);
  box-shadow: 0 4px 12px var(--theme-shadow-soft), inset 1px 1px 0 rgba(255, 255, 255, .08);
}

html[data-color-mode="day"][data-palette]:not([data-palette="nyacraft"]) :is(
  .message-bubble, .message-row.own .message-bubble, .message-file,
  .reaction-pill, .draft-tile, .featured-card
) {
  box-shadow: 0 4px 12px var(--theme-shadow-soft), inset 1px 1px 0 rgba(255, 255, 255, .78);
}

html[data-palette]:not([data-palette="nyacraft"]) :is(
  .drawer-tab.active, .eyebrow, .file-kind, .menu-icon,
  .settings-hub-icon, .palette-option > .lucide
) {
  color: var(--accent-strong);
}

html[data-palette]:not([data-palette="nyacraft"]) .palette-option.active {
  border-color: var(--theme-edge-top) var(--accent) var(--accent-strong) var(--theme-edge-left);
}

html[data-palette]:not([data-palette="nyacraft"]) * {
  scrollbar-color: color-mix(in srgb, var(--accent) 58%, transparent) transparent;
}

@media (max-width: 720px) {
  html[data-palette]:not([data-palette="nyacraft"]) .rail {
    background: var(--theme-glass-strong);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, .24), inset 0 1px 0 rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: blur(20px) saturate(1.1);
    backdrop-filter: blur(20px) saturate(1.1);
  }

  html[data-palette]:not([data-palette="nyacraft"]) :is(
    .auth-panel, .sidebar, .chat-header, .content-header, .composer,
    .reply-bar, .draft-attachments, .modal, .side-drawer, .sticker-panel,
    .settings-hub-item, .my-feature-card, .admin-status-card, .profile-card,
    .save-location-row, .client-update-panel, .section-block, .profile-editor,
    .settings-group, .admin-section, .mention-panel, .bot-command-panel,
    .message-actions, .member-context-menu, .message-context-menu,
    .image-context-menu, .group-content-menu, .featured-card-menu, .toast,
    .palette-option
  ) {
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .3), inset -1px -1px 0 rgba(55, 42, 49, .05);
  }

  html[data-palette]:not([data-palette="nyacraft"]) :is(
    .message-bubble, .message-row.own .message-bubble, .message-file,
    .reaction-pill, .draft-tile, .featured-card
  ) {
    box-shadow: 0 2px 5px var(--theme-shadow-soft), inset 1px 1px 0 rgba(255, 255, 255, .28);
  }
}

/* Stable Azusa semantic colors across all palettes. */
html[data-color-mode] :is(.badge, .nav-dot, .nav-unread-badge) {
  background: var(--azusa-notice);
  color: #fff;
}

html[data-color-mode] .conversation-item:has(.mention-preview.mention-all) .badge {
  background: var(--azusa-broadcast);
}

html[data-color-mode] .notification-menu-item .menu-icon {
  color: var(--azusa-notice-text);
}

html[data-color-mode] .notification-menu-item > .avatar {
  border-color: var(--azusa-notice-border);
  background: var(--azusa-notice-soft);
}

html[data-color-mode] .notification-row {
  padding-left: 12px;
  border-left: 2px solid var(--azusa-notice-border);
  background: linear-gradient(90deg, var(--azusa-notice-soft), transparent 42%);
}

html[data-color-mode] .message-notification {
  border-color: var(--azusa-notice-border);
  border-left-color: var(--azusa-notice);
  background:
    linear-gradient(90deg, var(--azusa-notice-soft), transparent 42%),
    var(--azusa-notification-surface);
}

html[data-color-mode] .message-notification.mentioned {
  border-color: var(--azusa-notice-border);
  border-left-color: var(--azusa-notice);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .46), 0 0 0 1px var(--azusa-notice-soft);
}

html[data-color-mode] .message-notification.mention-all {
  border-color: var(--azusa-broadcast-border);
  border-left-color: var(--azusa-broadcast);
  background:
    linear-gradient(90deg, var(--azusa-broadcast-soft), transparent 42%),
    var(--azusa-notification-surface);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .46), 0 0 0 1px var(--azusa-broadcast-soft);
}

html[data-color-mode] .message-notification-heading small {
  color: var(--azusa-notice-text);
}

html[data-color-mode] .message-notification.mentioned .message-notification-heading small {
  color: var(--azusa-notice-text);
}

html[data-color-mode] .message-notification.mention-all .message-notification-heading small {
  color: var(--azusa-broadcast-text);
}

html[data-color-mode] .mention-preview {
  margin-right: 2px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--azusa-notice-soft);
  color: var(--azusa-notice-text);
  font-weight: 700;
}

html[data-color-mode] .mention-preview.mention-all {
  background: var(--azusa-broadcast-soft);
  color: var(--azusa-broadcast-text);
}

html[data-color-mode] .mention-label {
  border: 1px solid var(--azusa-notice-border);
  background: var(--azusa-notice-soft);
  color: var(--azusa-notice-text);
}

html[data-color-mode] .message-row.mention-all .mention-label {
  border-color: var(--azusa-broadcast-border);
  background: var(--azusa-broadcast-soft);
  color: var(--azusa-broadcast-text);
}

html[data-color-mode] .message-mention,
html[data-color-mode] .message-mention.me {
  color: var(--azusa-notice-text);
}

html[data-color-mode] .message-mention.all,
html[data-color-mode] .message-mention.all.me {
  color: var(--azusa-broadcast-text);
}

html[data-color-mode][data-palette] #messages .message-row.mentioned-me .message-bubble {
  border-color: var(--azusa-notice-border);
  box-shadow: 0 0 0 1px var(--azusa-notice-soft), 0 7px 22px rgba(25, 46, 76, .12);
}

html[data-color-mode][data-palette] #messages .message-row.mentioned-me.mention-all .message-bubble {
  border-color: var(--azusa-broadcast-border);
  box-shadow: 0 0 0 1px var(--azusa-broadcast-soft), 0 7px 22px rgba(88, 39, 62, .12);
}

html[data-color-mode][data-palette] #messages .message-bubble.media-only {
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

html[data-color-mode][data-palette] .reply-quote {
  border-left-color: var(--azusa-notice);
  background: linear-gradient(90deg, var(--azusa-notice-soft), rgba(0, 0, 0, .08));
  color: var(--muted);
}

html[data-color-mode][data-palette] .reply-quote strong {
  color: var(--azusa-notice-text);
}

html[data-color-mode][data-palette] button.reply-quote:hover {
  background: linear-gradient(90deg, rgba(122, 162, 214, .18), rgba(122, 162, 214, .05));
}

html[data-color-mode][data-palette] .chat-view .reply-bar {
  border-left: 3px solid var(--azusa-notice);
  background:
    linear-gradient(90deg, var(--azusa-notice-soft), transparent 34%),
    var(--surface-2);
}

html[data-color-mode][data-palette] .chat-view .reply-bar strong {
  color: var(--azusa-notice-text);
}

@keyframes located-message {
  0%, 30% {
    border-color: var(--azusa-notice);
    box-shadow: 0 0 0 3px var(--azusa-notice-soft), 0 8px 26px rgba(38, 69, 112, .16);
  }
  100% { box-shadow: none; }
}

@media (max-width: 720px) {
  html[data-color-mode] .message-notification,
  html[data-color-mode] .message-notification.mention-all {
    background-color: var(--azusa-notification-surface);
  }
}

/* Mobile color themes keep their tint in the background and use quieter glass surfaces. */
@media (max-width: 720px) {
  html[data-color-mode="night"][data-palette]:not([data-palette="nyacraft"]) {
    --mobile-theme-page: color-mix(in srgb, var(--theme-bg) 42%, #10131a);
    --mobile-theme-panel: color-mix(in srgb, var(--theme-depth) 26%, rgba(17, 20, 27, .8));
    --mobile-theme-panel-strong: color-mix(in srgb, var(--theme-depth) 31%, rgba(14, 17, 23, .9));
    --mobile-theme-input: color-mix(in srgb, var(--theme-depth) 18%, rgba(8, 11, 16, .56));
    --mobile-theme-border: color-mix(in srgb, var(--theme-tint) 11%, rgba(255, 255, 255, .075));
    --mobile-theme-highlight: color-mix(in srgb, var(--theme-tint) 11%, rgba(255, 255, 255, .035));
    --mobile-theme-shadow: rgba(0, 0, 0, .18);
  }

  html[data-color-mode="day"][data-palette]:not([data-palette="nyacraft"]) {
    --mobile-theme-page: color-mix(in srgb, var(--theme-bg) 42%, #f6f7f9);
    --mobile-theme-panel: color-mix(in srgb, var(--theme-bg) 13%, rgba(255, 255, 255, .64));
    --mobile-theme-panel-strong: color-mix(in srgb, var(--theme-bg) 15%, rgba(255, 255, 255, .78));
    --mobile-theme-input: color-mix(in srgb, var(--theme-bg) 10%, rgba(255, 255, 255, .7));
    --mobile-theme-border: color-mix(in srgb, var(--theme-tint) 12%, rgba(92, 77, 86, .085));
    --mobile-theme-highlight: color-mix(in srgb, var(--theme-tint) 10%, rgba(255, 255, 255, .55));
    --mobile-theme-shadow: rgba(68, 50, 59, .09);
  }

  html[data-palette]:not([data-palette="nyacraft"]) .app-shell {
    background:
      linear-gradient(155deg, color-mix(in srgb, var(--theme-tint) 9%, transparent), transparent 38%),
      linear-gradient(335deg, color-mix(in srgb, var(--theme-secondary) 7%, transparent), transparent 44%),
      var(--mobile-theme-page);
  }

  html[data-palette]:not([data-palette="nyacraft"]) .app-shell :is(
    .workspace, .content-view, .messages
  ) {
    background: transparent;
  }

  html[data-palette]:not([data-palette="nyacraft"]) .sidebar {
    border: 0;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--theme-tint) 4%, transparent), transparent 31%),
      var(--mobile-theme-page);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-palette]:not([data-palette="nyacraft"]) .sidebar-header {
    padding-inline: 18px;
  }

  html[data-palette]:not([data-palette="nyacraft"]) .sidebar-header .icon-button {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  html[data-palette]:not([data-palette="nyacraft"]) .client-network-route {
    background: color-mix(in srgb, var(--mobile-theme-panel) 72%, transparent);
  }

  html[data-palette]:not([data-palette="nyacraft"]) .search-wrap {
    margin-inline: 14px;
    border-color: var(--mobile-theme-border);
    border-radius: 8px;
    background: var(--mobile-theme-input);
    box-shadow: 0 7px 20px var(--mobile-theme-shadow), inset 0 1px 0 rgba(255, 255, 255, .1);
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    backdrop-filter: blur(14px) saturate(1.05);
  }

  html[data-color-mode="day"][data-palette]:not([data-palette="nyacraft"]) .search-wrap {
    box-shadow: 0 7px 20px var(--mobile-theme-shadow), inset 0 1px 0 rgba(255, 255, 255, .72);
  }

  html[data-color-mode][data-palette]:not([data-palette="nyacraft"]) .search-wrap input,
  html[data-color-mode][data-palette]:not([data-palette="nyacraft"]) .search-wrap input:focus {
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
  }

  html[data-palette]:not([data-palette="nyacraft"]) :is(
    .conversation-item, .contact-item, .request-item
  ) {
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
  }

  html[data-palette]:not([data-palette="nyacraft"]) :is(
    .conversation-item:hover, .contact-item:hover,
    .conversation-item.active, .contact-item.active
  ) {
    border-color: transparent;
    background: var(--mobile-theme-highlight);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
  }

  html[data-palette]:not([data-palette="nyacraft"]) :is(
    .conversation-item, .contact-item, .request-item
  ) .avatar {
    border: 1px solid color-mix(in srgb, var(--theme-tint) 12%, rgba(255, 255, 255, .12));
    box-shadow: 0 5px 14px var(--mobile-theme-shadow);
  }

  html[data-palette]:not([data-palette="nyacraft"]) .rail {
    border: 0;
    border-top: 1px solid var(--mobile-theme-border);
    background: var(--mobile-theme-panel-strong);
    box-shadow: 0 -8px 24px var(--mobile-theme-shadow), inset 0 1px 0 rgba(255, 255, 255, .055);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    backdrop-filter: blur(18px) saturate(1.08);
  }

  html[data-color-mode][data-palette]:not([data-palette="nyacraft"]) .rail :is(
    .rail-button, .rail-button:hover, .rail-button.active
  ) {
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  html[data-color-mode][data-palette]:not([data-palette="nyacraft"]) .rail .rail-button.active {
    color: var(--accent-strong);
  }

  html[data-color-mode][data-palette]:not([data-palette="nyacraft"]) .rail .rail-button.active::before {
    top: 0;
    width: 24px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--accent);
    box-shadow: 0 2px 9px var(--theme-glow);
  }

  html[data-palette]:not([data-palette="nyacraft"]) :is(.chat-header, .content-header) {
    border: 0;
    border-bottom: 1px solid var(--mobile-theme-border);
    background: var(--mobile-theme-panel);
    box-shadow: 0 5px 18px var(--mobile-theme-shadow);
    -webkit-backdrop-filter: blur(16px) saturate(1.05);
    backdrop-filter: blur(16px) saturate(1.05);
  }

  html[data-palette]:not([data-palette="nyacraft"]) .composer {
    border: 0;
    border-top: 1px solid var(--mobile-theme-border);
    background: var(--mobile-theme-panel-strong);
    box-shadow: 0 -6px 20px var(--mobile-theme-shadow);
  }

  html[data-palette]:not([data-palette="nyacraft"]) :is(
    .settings-hub-item, .my-feature-card, .admin-status-card, .profile-card,
    .save-location-row, .client-update-panel, .section-block, .profile-editor,
    .settings-group, .admin-section, .palette-option
  ) {
    border-color: var(--mobile-theme-border);
    background: var(--mobile-theme-panel);
    box-shadow: 0 8px 22px var(--mobile-theme-shadow), inset 0 1px 0 rgba(255, 255, 255, .065);
    -webkit-backdrop-filter: blur(12px) saturate(1.04);
    backdrop-filter: blur(12px) saturate(1.04);
  }

  html[data-color-mode="day"][data-palette]:not([data-palette="nyacraft"]) :is(
    .settings-hub-item, .my-feature-card, .admin-status-card, .profile-card,
    .save-location-row, .client-update-panel, .section-block, .profile-editor,
    .settings-group, .admin-section, .palette-option
  ) {
    box-shadow: 0 8px 22px var(--mobile-theme-shadow), inset 0 1px 0 rgba(255, 255, 255, .7);
  }
}

@media (max-width: 720px) {
  .my-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  .my-feature-card {
    min-width: 0;
    min-height: 116px;
    gap: 10px;
    padding: 12px;
  }

  .my-feature-icon {
    width: 36px;
    height: 36px;
  }

  .my-feature-icon .lucide {
    width: 19px;
    height: 19px;
  }

  .my-feature-copy {
    min-width: 0;
    gap: 4px;
  }

  .my-feature-copy strong,
  .my-feature-copy small {
    overflow-wrap: anywhere;
  }

  .my-feature-copy strong {
    font-size: calc(14px + var(--font-size-delta));
    line-height: 1.3;
  }

  .my-feature-copy small {
    font-size: calc(9px + var(--font-size-delta));
    line-height: 1.4;
  }
}
