*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
* {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.bubble,
#user-input,
textarea,
.bubble * {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
.stopped-reply-msg,
.bubble .stopped-reply-msg {
  color: #ef4444 !important;
  font-weight: 500;
  font-size: 13px;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  cursor: default;
  display: block;
}
#error-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 21000;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 14px 16px;
  border: 0;
  border-radius: 15px;
  background: rgba(35, 35, 35, 0.42);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
  opacity: 0;
  transform: translateX(-50%) translateY(-14px) !important;
  transition:
    opacity 0.22s ease,
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.toast-visible {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
}
#error-toast .error-toast-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#error-toast button {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: 20px/1 inherit;
  cursor: pointer;
  padding: 0;
}
#error-toast button:hover {
  background: rgba(255, 255, 255, 0.15);
}
.bubble pre,
.bubble code,
.bubble .code-header {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
input:focus,
textarea:focus,
select:focus,
button:focus {
  outline: none !important;
  box-shadow: none !important;
}

@property --accent-primary {
  syntax: '<color>';
  inherits: true;
  initial-value: #1f6feb;
}
@property --accent-primary-hover {
  syntax: '<color>';
  inherits: true;
  initial-value: #1a60d6;
}

:root {
  --bg: #111111;
  --sidebar-bg: rgba(20, 20, 20, 0.45);
  --surface: #232323;
  --surface2: #2a2a2a;
  --border: #333333;
  --text: #ececec;
  --muted: #888888;
  --subtle: #232323;
  --accent: #555555;
  --accent-primary: #1f6feb;
  --accent2: #aaaaaa;
  --accent-glow: rgba(150, 150, 150, 0.12);
  --accent-hover: #444444;
  --danger: #f85149;
  --user-bubble: #2a2a2a;
  --user-text: #ffffff;
  --ai-bubble: #1c1c1c;
  --ai-border: #333333;
  --sidebar-w: 260px;
  --sidebar-icon-w: 56px;
}

html,
body {
  height: 100%;
  font-family:
    "Manrope",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

button,
input,
textarea,
select {
  font-family:
    "Manrope",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
}

#sidebar,
#sidebar * {
  font-family:
    "Manrope",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  position: relative;
}

#sidebar {
  width: var(--sidebar-w);
  height: 100%;
  height: 100dvh;
  background: transparent;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-right: none;
  display: flex;
  flex-direction: column;
  transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  will-change: width;
}
#sidebar.collapsed {
  width: var(--sidebar-icon-w);
}
#sidebar:has(#settings-popup.open) {
  overflow: visible;
}

#sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 1px;
  background: var(--border);
  opacity: 0.5;
  pointer-events: none;
}
#sidebar,
.settings-sidenav {
  background: transparent !important;
}
#sidebar::after {
  background: rgba(255, 255, 255, 0.08);
}
.settings-sidenav,
.settings-detail-content {
  scrollbar-width: none;
}
.settings-sidenav::-webkit-scrollbar,
.settings-detail-content::-webkit-scrollbar {
  display: none;
}

.sb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  min-height: 52px;
  transition:
    justify-content 0s 0.16s,
    padding 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
#sidebar.collapsed .sb-top {
  justify-content: center;
  padding: 12px 0 10px;
}
.sb-top-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.sb-search-expanded-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}
.sb-search-expanded-btn:hover {
  background: var(--surface2);
  color: var(--text);
}
#sidebar.collapsed .sb-search-expanded-btn {
  display: none;
}
.sb-logo {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  transition:
    opacity 0.12s ease,
    max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 180px;
}
.sb-logo-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  flex-shrink: 0;
  object-fit: contain;
}
#sidebar:not(.collapsed) .sb-logo {
  opacity: 1;
  transition: opacity 0.18s ease 0.08s, max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
#sidebar.collapsed .sb-logo {
  opacity: 0 !important;
  max-width: 0 !important;
  pointer-events: none !important;
}
.sb-toggle {
  width: 38px !important;
  height: 38px !important;
  border: none;
  background: none;
  color: var(--muted);
  border-radius: 50% !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  flex-shrink: 0;
}
.sb-toggle:active {
  transform: scale(0.88) !important;
}
.sb-toggle:hover {
  background: var(--surface2);
  color: var(--text);
}
.sb-toggle-logo {
  display: none;
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 50%;
  position: absolute;
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}
.sb-toggle-icon {
  width: 15px !important;
  height: 15px !important;
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}
#sidebar.collapsed .sb-toggle {
  position: relative;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
}
#sidebar.collapsed .sb-toggle-logo {
  display: block;
  width: 26px;
  height: 26px;
  opacity: 1;
  transform: scale(1);
}
#sidebar.collapsed .sb-toggle-icon {
  opacity: 0;
  transform: scale(0.86);
}
#sidebar.collapsed .sb-toggle:hover .sb-toggle-logo {
  opacity: 0;
  transform: scale(0.86);
}
#sidebar.collapsed .sb-toggle:hover .sb-toggle-icon {
  opacity: 1;
  transform: scale(1);
}

.sb-actions {
  padding: 6px 6px 2px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 2px !important;
}
#sidebar.collapsed .sb-actions {
  padding: 6px 0 0;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px !important;
}
.sb-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 12px 10px;
  flex-shrink: 0;
}
#sidebar.collapsed .sb-divider {
  margin: 6px 8px 8px;
}
.new-chat-btn {
  flex: none;
  width: 100% !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 12px !important;
  background: transparent !important;
  border: none;
  border-radius: 20px !important;
  color: #ffffff !important;
  font-size: 13.5px;
  font-weight: 500;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    opacity 0.1s ease;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box !important;
}
.new-chat-btn:hover,
.new-chat-btn:focus-visible,
.sb-search-chats-btn:hover,
.sb-search-chats-btn:focus-visible,
.sb-nav-btn:hover,
.sb-nav-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border-radius: 20px !important;
}
.new-chat-btn:active,
.new-chat-btn.active,
.sb-search-chats-btn:active,
.sb-nav-btn:active,
.sb-nav-btn.active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border-radius: 20px !important;
}
body.theme-light .new-chat-btn:hover,
html[data-theme="light"] .new-chat-btn:hover,
body.theme-light .sb-search-chats-btn:hover,
html[data-theme="light"] .sb-search-chats-btn:hover,
body.theme-light .sb-nav-btn:hover,
html[data-theme="light"] .sb-nav-btn:hover {
  background: #e9ecef !important;
  color: #1a1a1a !important;
}
.new-chat-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #ffffff !important;
}
.new-chat-btn span {
  transition:
    opacity 0.12s ease,
    max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 200px;
  overflow: hidden;
  white-space: nowrap;
  color: #ffffff !important;
}
#sidebar:not(.collapsed) .new-chat-btn span {
  opacity: 1;
  transition: opacity 0.18s ease 0.08s, max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
#sidebar.collapsed .new-chat-btn {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 20px !important;
  gap: 0;
  margin: 0;
}
#sidebar.collapsed .new-chat-btn span {
  opacity: 0 !important;
  max-width: 0 !important;
  pointer-events: none !important;
}

.sb-search-collapsed-btn {
  display: none;
}
.sb-search {
  padding: 6px 10px;
  flex-shrink: 0;
  overflow: hidden;
  transition:
    max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.32s;
}
.sb-search input {
  width: 100%;
  padding: 9px 14px;
  background: var(--surface);
  border: none;
  border-radius: 20px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: background 0.2s;
}
.sb-search input:focus {
  background: var(--surface2);
}
.sb-search input::placeholder {
  color: var(--muted);
}
#sidebar.collapsed .sb-search {
  padding: 8px 0 0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
#sidebar.collapsed .sb-search input {
  display: none;
}
#sidebar.collapsed .sb-search-collapsed-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: none;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  margin: 0;
  transition:
    background 0.2s,
    color 0.2s;
}
#sidebar.collapsed .sb-search-collapsed-btn:hover {
  background: #2e2e2e;
  color: var(--text);
}
#sidebar:not(.collapsed) .sb-search {
  display: none;
}
#sidebar.collapsed .sb-actions {
  align-items: center;
}
#sidebar.collapsed .sb-toggle,
#sidebar.collapsed .new-chat-btn,
#sidebar.collapsed .sb-search-collapsed-btn,
#sidebar.collapsed .sb-footer-btn {
  color: #fff;
}
#sidebar .sb-nav-btn > svg,
#settings-btn > svg {
  color: #fff;
}
body.theme-light #sidebar .sb-nav-btn > svg,
body.theme-light #settings-btn > svg,
html[data-theme="light"] #sidebar .sb-nav-btn > svg,
html[data-theme="light"] #settings-btn > svg {
  color: #1a1a1a;
}
body.theme-light #sidebar .sb-nav-btn,
html[data-theme="light"] #sidebar .sb-nav-btn {
  color: #1a1a1a;
}
.data-control-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: currentColor;
}
.data-control-icon svg {
  width: 100%;
  height: 100%;
}
.settings-sidenav-item .data-control-icon {
  width: 14px;
  height: 14px;
}


.chat-search-screen {
  position: fixed;
  inset: 0;
  z-index: 90000;
  display: none !important;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 40px;
}
.chat-search-screen.open,
.chat-search-screen.closing {
  display: flex !important;
}
.chat-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 14, 0) !important;
  opacity: 0 !important;
  backdrop-filter: blur(0px) !important;
  -webkit-backdrop-filter: blur(0px) !important;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.22s cubic-bezier(0.16, 1, 0.3, 1), -webkit-backdrop-filter 0.22s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  pointer-events: none !important;
}
.chat-search-screen.open.visible .chat-search-backdrop {
  background: rgba(10, 12, 14, 0.88) !important;
  opacity: 1 !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  pointer-events: auto !important;
}
.chat-search-screen.closing .chat-search-backdrop,
.chat-search-screen:not(.visible) .chat-search-backdrop {
  background: rgba(10, 12, 14, 0) !important;
  opacity: 0 !important;
  backdrop-filter: blur(0px) !important;
  -webkit-backdrop-filter: blur(0px) !important;
  transition: opacity 0.15s ease-out, backdrop-filter 0.15s ease-out, -webkit-backdrop-filter 0.15s ease-out, background-color 0.15s ease-out !important;
  pointer-events: none !important;
}
.chat-search-container,
.chat-search-container * {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}
.chat-search-container {
  position: relative;
  z-index: 1;
  width: min(580px, 100%);
  max-height: calc(100dvh - 120px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.chat-search-screen.open.visible .chat-search-container {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.chat-search-screen.closing .chat-search-container {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 0.15s ease-out, transform 0.15s ease-out !important;
}
.chat-search-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 9999px;
  padding: 0 18px;
  height: 46px;
  box-sizing: border-box;
  box-shadow: none !important;
  outline: none !important;
  transition: none !important;
}
.chat-search-input-wrap:focus-within {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
  outline: none !important;
}
.chat-search-input-icon {
  color: var(--muted, #8e8e93);
  margin-right: 12px;
  flex-shrink: 0;
}
.chat-search-input-wrap input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 14px;
  font-family: inherit;
  outline: none !important;
  box-shadow: none !important;
  padding: 0;
}
.chat-search-input-wrap input:focus {
  outline: none !important;
  box-shadow: none !important;
}
.chat-search-input-wrap input::placeholder {
  color: var(--muted, #8e8e93);
}
.chat-search-input-wrap input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 18px;
  width: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
  background-size: 15px 15px;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.chat-search-input-wrap input::-webkit-search-cancel-button:hover {
  opacity: 1;
  transform: scale(1.15);
}
.chat-search-label {
  margin: 16px 0 4px 6px;
  color: var(--muted, #8e8e93);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.chat-search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100dvh - 200px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.chat-search-results::-webkit-scrollbar {
  display: block !important;
  width: 5px;
}
.chat-search-results::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.chat-search-results::-webkit-scrollbar-track {
  background: transparent;
}
.chat-search-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22) !important;
  border-radius: 4px;
}
.chat-search-results::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}
.chat-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-radius: 20px !important;
  border: none;
  background: transparent;
  color: #ededed;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  animation: chatSearchResultIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes chatSearchResultIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.chat-search-result:hover {
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff;
}
.chat-search-result-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-search-result-date {
  font-size: 12px;
  color: var(--muted, #8e8e93);
  flex-shrink: 0;
  font-weight: 400;
}
.chat-search-empty {
  color: var(--muted, #8e8e93);
  font-size: 13px;
  padding: 16px 12px;
}
.guest-feature-popover {
  position: fixed;
  z-index: 9500;
  width: min(290px, calc(100vw - 24px));
  padding: 16px 18px 14px;
  border-radius: 16px;
  background: rgba(22, 22, 26, 0.68) !important;
  border: none !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  color: var(--text);
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 0.16s ease-out,
    transform 0.16s ease-out;
}
.guest-feature-popover.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.guest-feature-popover.animate-in {
  animation: guestPopoverFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes guestPopoverFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.guest-feature-popover strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}
.guest-feature-popover p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.guest-feature-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.guest-feature-actions button {
  border-radius: 999px;
  padding: 8px 12px;
  font: 600 13px inherit;
  cursor: pointer;
}
.guest-feature-login {
  border: 0;
  background: var(--text);
  color: var(--bg);
}
.guest-login-cta {
  border: 0;
  cursor: default;
}
.guest-login-button {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 700 12px inherit;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.guest-login-button:hover {
  background: var(--surface2);
  border-color: var(--muted);
}
.guest-login-button:focus-visible {
  outline: 1px solid var(--accent-primary, #1f6feb);
  outline-offset: 3px;
}
.chat-search-head input {
  font-size: 16px;
}
.chat-search-head input::placeholder {
  color: var(--text);
  opacity: 0.9;
}
.chat-search-label {
  display: none;
}
.chat-search-empty {
  color: var(--muted);
  font-size: 16px;
  padding: 32px 6px;
  text-align: center;
}

.conv-list {
  flex: 1 1 0;
  min-height: 0 !important;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 6px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.conv-list::-webkit-scrollbar {
  width: 3px;
  background: transparent;
}
.conv-list::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 2px;
}
#sidebar.collapsed .conv-list {
  padding: 4px 2px;
}

.conv-group-header {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
  padding: 4px 8px 1px !important;
  margin-bottom: 1px !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  user-select: none !important;
  text-align: left !important;
  outline: none !important;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.conv-group-header.has-pinned-above,
.conv-item + .conv-group-header {
  margin-top: 16px !important;
}

.conv-group-label {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 12px !important;
  color: #9ca3af !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  line-height: 1.2 !important;
  transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1), color 0.18s ease !important;
}

div.conv-group-label {
  padding: 4px 8px 1px !important;
  margin-bottom: 1px !important;
  display: block !important;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.conv-group-header:hover .conv-group-label {
  color: #ffffff !important;
}

.conv-group-triangle {
  width: 12px !important;
  height: 12px !important;
  color: #9ca3af !important;
  opacity: 0 !important;
  transform: rotate(0deg) !important;
  transition: opacity 0.18s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.18s ease !important;
  transform-origin: center !important;
  flex-shrink: 0 !important;
}

.conv-group-header:hover .conv-group-triangle {
  opacity: 1 !important;
  color: #ffffff !important;
}

.conv-group-header.collapsed .conv-group-triangle {
  transform: rotate(-90deg) !important;
}

.conv-group-wrap {
  overflow: hidden !important;
  transform-origin: top !important;
}

.conv-group-wrap.collapsed {
  display: none;
}

.conv-group-items {
  display: flex !important;
  flex-direction: column !important;
  gap: 1px !important;
  padding: 0 !important;
}

#sidebar:not(.collapsed) .conv-group-header,
#sidebar:not(.collapsed) .conv-group-label {
  opacity: 1;
  transition: opacity 0.18s ease 0.08s;
}

#sidebar.collapsed .conv-group-header,
#sidebar.collapsed .conv-group-label {
  opacity: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.12s ease, height 0.28s cubic-bezier(0.4, 0, 0.2, 1), padding 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.conv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 4px 12px !important;
  border-radius: 20px !important;
  cursor: pointer;
  transition:
    background 0.18s ease,
    padding 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    border-radius 0.18s ease;
  position: relative;
  margin-bottom: 1px !important;
  min-height: 32px !important;
  overflow: hidden;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}
.conv-item:hover {
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.06) !important;
}
@keyframes convFadeInSlow {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.conversation-fade-in {
  animation: convFadeInSlow 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
.conv-item.active,
.conv-item.active:hover {
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.09) !important;
}
body.theme-light .conv-item.active,
body.theme-light .conv-item.active:hover,
html[data-theme="light"] .conv-item.active,
html[data-theme="light"] .conv-item.active:hover {
  border-radius: 20px !important;
  background: rgba(0, 0, 0, 0.06) !important;
}
.conv-item.active .conv-title-generating .conv-title-skeleton {
  height: 15px !important;
  border-radius: 6px !important;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.38) 50%, rgba(255, 255, 255, 0.12) 100%) !important;
  background-size: 200% 100% !important;
  animation: convSkeletonShimmerPulse 1.4s infinite ease-in-out !important;
}
body.theme-light .conv-item.active .conv-title-generating .conv-title-skeleton,
html[data-theme="light"] .conv-item.active .conv-title-generating .conv-title-skeleton {
  height: 15px !important;
  border-radius: 6px !important;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.28) 50%, rgba(0, 0, 0, 0.08) 100%) !important;
  background-size: 200% 100% !important;
  animation: convSkeletonShimmerPulse 1.4s infinite ease-in-out !important;
}
.conv-title {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 13px;
  color: #8b949e !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  transition:
    color 0.18s ease,
    opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.32s;
}
.conv-item:hover .conv-title,
.conv-item.active .conv-title,
.conv-item.menu-open .conv-title {
  color: #ffffff !important;
}

/* ── Conversation Title & Item Styling ── */
.conv-title-generating {
  position: relative;
  display: flex !important;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 20px;
  overflow: hidden;
}

.conv-title-generating .conv-title-text {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  width: 100%;
  color: #8b949e !important;
}

.conv-item:hover .conv-title-generating .conv-title-text,
.conv-item.menu-open .conv-title-generating .conv-title-text {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  color: #ffffff !important;
}

body.theme-light .conv-title-generating .conv-title-text,
html[data-theme="light"] .conv-title-generating .conv-title-text {
  color: #57606a !important;
}

body.theme-light .conv-item:hover .conv-title-generating .conv-title-text,
body.theme-light .conv-item.menu-open .conv-title-generating .conv-title-text,
html[data-theme="light"] .conv-item:hover .conv-title-generating .conv-title-text,
html[data-theme="light"] .conv-item.menu-open .conv-title-generating .conv-title-text {
  color: #0f172a !important;
}

@keyframes convSkeletonShimmerPulse {
  0% {
    background-position: 200% 0;
    opacity: 0.65;
  }
  50% {
    background-position: 0% 0;
    opacity: 1;
  }
  100% {
    background-position: -200% 0;
    opacity: 0.65;
  }
}

.conv-title-skeleton {
  display: block !important;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 82% !important;
  min-width: 110px !important;
  max-width: 165px !important;
  height: 15px !important;
  border-radius: 6px !important;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.32) 50%, rgba(255, 255, 255, 0.08) 100%) !important;
  background-size: 200% 100% !important;
  animation: convSkeletonShimmerPulse 1.4s infinite ease-in-out !important;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

body.theme-light .conv-title-skeleton,
html[data-theme="light"] .conv-title-skeleton {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.22) 50%, rgba(0, 0, 0, 0.06) 100%) !important;
  background-size: 200% 100% !important;
  animation: convSkeletonShimmerPulse 1.4s infinite ease-in-out !important;
}

.conv-item:hover .conv-title-generating .conv-title-skeleton,
.conv-item.menu-open .conv-title-generating .conv-title-skeleton,
.conv-title-generating:hover .conv-title-skeleton,
body.theme-light .conv-item:hover .conv-title-generating .conv-title-skeleton,
html[data-theme="light"] .conv-item:hover .conv-title-generating .conv-title-skeleton,
body.theme-light .conv-item.menu-open .conv-title-generating .conv-title-skeleton,
html[data-theme="light"] .conv-item.menu-open .conv-title-generating .conv-title-skeleton {
  opacity: 0 !important;
  visibility: hidden !important;
  display: none !important;
  background: transparent !important;
  background-image: none !important;
  pointer-events: none !important;
  transition: none !important;
}

@keyframes convTitleFadeIn {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.conv-title-fade-in {
  animation: convTitleFadeIn 0.36s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
#sidebar:not(.collapsed) .conv-title {
  opacity: 1;
  transition: opacity 0.18s ease 0.08s, color 0.18s ease;
}

#sidebar.collapsed .conv-title {
  opacity: 0 !important;
  max-width: 0 !important;
  width: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.12s ease, max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
#sidebar.collapsed .conv-item {
  justify-content: center;
  padding: 8px;
}
.conv-item .conv-icon {
  display: none;
  flex-shrink: 0;
  color: var(--muted);
}
#sidebar.collapsed .conv-item .conv-icon {
  display: flex;
}

.conv-menu-btn {
  width: 28px !important;
  height: 28px !important;
  border: none;
  background: none;
  color: var(--muted);
  border-radius: 50% !important;
  cursor: pointer;
  visibility: hidden;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  padding: 0 !important;
  transition: background 0.14s ease, color 0.14s ease, transform 0.1s ease;
  display: flex;
}
.conv-menu-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.conv-item:hover,
.conv-item.menu-open {
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.06) !important;
}
body.theme-light .conv-item:hover,
body.theme-light .conv-item.menu-open,
body.theme-light .conv-item.active,
html[data-theme="light"] .conv-item:hover,
html[data-theme="light"] .conv-item.menu-open,
html[data-theme="light"] .conv-item.active {
  border-radius: 20px !important;
  background: rgba(0, 0, 0, 0.05) !important;
}
.conv-item:hover .conv-menu-btn,
.conv-item.active .conv-menu-btn,
.conv-item.menu-open .conv-menu-btn {
  visibility: visible !important;
}
.conv-menu-btn:hover,
.conv-item.menu-open .conv-menu-btn {
  background: var(--surface2) !important;
  color: var(--text) !important;
  border-radius: 50% !important;
}
#sidebar.collapsed .conv-menu-btn {
  display: none !important;
}

.sb-footer {
  padding: 12px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: padding 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
#sidebar.collapsed .sb-footer {
  padding: 12px 0 16px;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.sb-footer-btn {
  width: 100%;
  padding: 9px 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  transition:
    background 0.15s,
    border-color 0.15s,
    width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    border-radius 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    gap 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  overflow: hidden;
}
.sb-footer-btn:hover {
  background: var(--surface);
  border-color: var(--border);
}
.sb-footer-btn.settings-trigger {
  background: var(--surface);
  border: none;
  border-radius: 20px;
  height: 36px;
  padding: 0 14px;
  transition: background 0.18s;
}
.sb-footer-btn.settings-trigger:hover {
  background: var(--surface2);
}
.sb-footer-btn svg {
  flex-shrink: 0;
  color: var(--accent2);
}
.sb-footer-btn span {
  transition:
    opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 200px;
  overflow: hidden;
}
#sidebar.collapsed .sb-footer-btn {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  margin: 0 auto;
}
#sidebar.collapsed .sb-footer-btn span {
  display: none;
}
.profile-row {
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 9px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition:
    background 0.18s,
    width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    border-radius 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    gap 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  overflow: hidden;
}
.profile-row:hover {
  background: var(--surface);
}
#sidebar.collapsed .profile-row {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  background: #252525;
  margin: 0 auto;
  gap: 0;
}
#sidebar.collapsed .profile-info {
  display: none !important;
}
#sidebar.collapsed .signout-btn {
  display: none !important;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.profile-info {
  flex: 1;
  overflow: hidden;
  transition:
    opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 160px;
  text-align: left;
}
#sidebar.collapsed .profile-info {
  opacity: 0;
  max-width: 0;
}
.profile-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-email {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.signout-btn {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
  display: flex;
}
.signout-btn:hover {
  color: var(--danger);
}
#sidebar.collapsed .signout-btn {
  display: none;
}
.guest-login-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 16px);
  margin: 8px;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.guest-login-cta strong {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.guest-login-cta span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.guest-login-cta b {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.guest-login-cta:hover b {
  background: var(--surface2);
  border-color: var(--muted);
}
.guest-login-cta:focus-visible {
  outline: 1px solid var(--accent-primary, #1f6feb);
  outline-offset: 3px;
}
#sidebar.collapsed .guest-login-cta {
  display: none !important;
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
  background: var(--bg);
}
#main.has-welcome {
  background:
    radial-gradient(
      ellipse 75% 85% at 50% 50%,
      color-mix(in srgb, var(--accent-primary, #1f6feb) 29%, transparent) 0%,
      color-mix(in srgb, var(--accent-primary, #1f6feb) 18%, transparent) 20%,
      color-mix(in srgb, var(--accent-primary, #1f6feb) 8%, transparent) 46%,
      color-mix(in srgb, var(--accent-primary, #1f6feb) 2%, transparent) 66%,
      transparent 88%
    ),
    var(--bg);
  transition: background 0.58s cubic-bezier(0.22, 1, 0.36, 1);
}
#main.temporary-chat,
body.temporary-chat #main {
  background:
    radial-gradient(
      ellipse 75% 85% at 50% 0%,
      rgba(150, 150, 150, 0.22) 0%,
      rgba(150, 150, 150, 0.12) 20%,
      rgba(150, 150, 150, 0.05) 46%,
      rgba(150, 150, 150, 0.01) 66%,
      transparent 88%
    ),
    var(--bg) !important;
  transition: background 0.58s cubic-bezier(0.22, 1, 0.36, 1);
}

#main.has-welcome.temporary-chat {
  background:
    radial-gradient(
      ellipse 75% 85% at 50% 50%,
      rgba(150, 150, 150, 0.29) 0%,
      rgba(150, 150, 150, 0.18) 20%,
      rgba(150, 150, 150, 0.08) 46%,
      rgba(150, 150, 150, 0.02) 66%,
      transparent 88%
    ),
    var(--bg) !important;
  transition: background 0.58s cubic-bezier(0.22, 1, 0.36, 1);
}

.temporary-chat .message.user .bubble,
#main.temporary-chat .message.user .bubble,
body.temporary-chat .message.user .bubble {
  background: #3f3f46 !important;
  color: #f4f4f5 !important;
}

#ghost-mode-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 50%;
  padding: 0;
  width: 42px;
  height: 42px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
}
#ghost-mode-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}
#ghost-mode-btn:active {
  transform: scale(0.95);
}
body:not(.theme-light) #ghost-mode-btn.active,
html:not([data-theme="light"]) #ghost-mode-btn.active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #f4f4f5 !important;
}
#ghost-mode-btn svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
body:not(.theme-light) #ghost-mode-btn.active svg,
html:not([data-theme="light"]) #ghost-mode-btn.active svg {
  transform: scale(1.1);
  color: #f4f4f5 !important;
}

#ghost-banner {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(88, 166, 255, 0.07);
  border-bottom: 1px solid rgba(88, 166, 255, 0.15);
  font-size: 12px;
  color: rgba(88, 166, 255, 0.8);
  flex-shrink: 0;
  transition:
    max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease,
    padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 14px;
}
#ghost-banner.show {
  max-height: 40px;
  opacity: 1;
  padding: 7px 14px;
}

@keyframes ghostFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

#chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: auto;
}
#chat-window::-webkit-scrollbar {
  width: 4px;
}
#chat-window::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.ad.adsbox.ad-banner.advertisement,
#adblock-bait {
  position: absolute;
  left: -10000px;
  top: -10000px;
  width: 50px;
  height: 50px;
  pointer-events: none;
  opacity: 0.01;
}
#feature-access-notice {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: transparent;
}
.adblock-detected #feature-access-notice,
.vpn-detected #feature-access-notice,
#feature-access-notice.closing {
  display: flex;
}
.adblock-card {
  width: min(390px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  text-align: left;
}
.adblock-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text);
  text-align: left;
}
.adblock-card p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.adblock-points {
  margin: 0 0 20px;
  padding-left: 19px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.adblock-points li + li {
  margin-top: 9px;
}
.adblock-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 8px;
}
.adblock-card button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 14px;
  background: var(--accent-primary, #1f6feb);
  color: #fff;
  font: 800 17px inherit;
  cursor: pointer;
}
.adblock-actions button {
  min-width: 0;
  padding-inline: 12px;
  font-size: 14px;
}
.adblock-card .adblock-limited-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.chat-load-indicator {
  margin: auto;
  display: grid;
  place-items: center;
  min-height: 120px;
}
.chat-load-indicator .spinner-loader {
  width: 30px;
  height: 30px;
  border-width: 3px;
  border-color: rgba(139, 148, 158, 0.28);
  border-top-color: var(--accent2);
}

.welcome {
  margin: auto;
  text-align: center;
  max-width: 380px;
  padding: 20px 0 14px;
  animation: fadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: forwards;
}
@keyframes fadeUp {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.welcome h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}
.welcome-dots {
  justify-content: center;
}
.welcome-dots span {
  width: 8px;
  height: 8px;
}
.welcome-typewriter {
  display: inline-block;
  min-height: 34px;
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -0.35px;
  color: var(--text);
  white-space: normal;
  line-height: 1.35;
  text-align: center;
  word-break: break-word;
  animation: fadeUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.welcome-typewriter-text {
  display: inline;
  background: linear-gradient(90deg, #f5f5f5, #cfcfcf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: normal;
  text-align: center;
}
.welcome-typewriter-caret {
  display: none !important;
}

.message {
  display: flex;
  max-width: 100%;
  animation: msgIn 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes msgIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.history-message,
.message.history-message,
.history-message-fade,
.message.history-message-fade {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
.message.user {
  justify-content: flex-end;
}
.message.ai {
  justify-content: flex-start;
}
.bubble {
  max-width: 72%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.message.user .bubble {
  background: var(--user-bubble);
  color: var(--user-text);
  border-radius: 18px 18px 4px 18px;
  box-shadow: none;
  white-space: pre-wrap;
  min-width: 52px;
}
.message.ai .bubble {
  background: var(--ai-bubble);
  color: var(--text);
  border-radius: 18px 18px 18px 4px;
  border: 1px solid var(--ai-border);
}
.bubble img {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  margin-bottom: 6px;
}
.bubble code {
  font-family: "Courier New", monospace;
  background: rgba(31, 111, 235, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent2);
}
.bubble p {
  margin: 0 0 12px;
  line-height: 1.6;
}
.bubble p:last-child {
  margin-bottom: 0;
}
.bubble blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(31, 111, 235, 0.06);
}
.bubble strong {
  font-weight: 600;
}
.bubble em {
  font-style: italic;
}
.bubble a:not(.artifact-link):not(.button-link):not(.code-block-action):not(.source-item):not([class*="btn"]) {
  color: var(--accent-primary, #58a6ff);
  text-decoration: underline dotted !important;
  text-underline-offset: 3.5px !important;
  text-decoration-thickness: 1.5px !important;
  cursor: pointer;
  transition: opacity 0.15s ease, text-decoration-color 0.15s ease;
}
.bubble a:not(.artifact-link):not(.button-link):not(.code-block-action):not(.source-item):not([class*="btn"]):hover {
  opacity: 0.85;
  text-decoration: underline dotted !important;
  text-underline-offset: 3.5px !important;
  text-decoration-thickness: 1.8px !important;
}

.chat-inline-link {
  display: inline !important;
  color: var(--accent-primary, #58a6ff) !important;
  text-decoration: underline dotted !important;
  text-underline-offset: 3.5px !important;
  text-decoration-thickness: 1.5px !important;
  cursor: pointer !important;
  word-break: break-word !important;
  transition: opacity 0.15s ease, text-decoration-thickness 0.15s ease !important;
}

.chat-inline-link:hover {
  opacity: 0.85 !important;
  text-decoration: underline dotted !important;
  text-underline-offset: 3.5px !important;
  text-decoration-thickness: 1.8px !important;
}

.chat-inline-favicon {
  display: none !important;
}

.chat-inline-link-text {
  display: inline !important;
  color: inherit !important;
  text-decoration: underline dotted !important;
  text-underline-offset: 3.5px !important;
  text-decoration-thickness: 1.5px !important;
  word-break: break-word !important;
}

.chat-inline-link:hover .chat-inline-link-text {
  text-decoration: underline dotted !important;
  text-underline-offset: 3.5px !important;
  text-decoration-thickness: 1.8px !important;
}
.bubble h1,
.bubble h2,
.bubble h3,
.bubble h4,
.bubble h5,
.bubble h6 {
  margin-top: 4px;
  margin-bottom: 4px;
  color: var(--text);
}
.bubble h1 {
  font-size: 19px;
}
.bubble h2 {
  font-size: 17px;
}
.bubble h3 {
  font-size: 15px;
}
.bubble h4 {
  font-size: 14px;
}
.bubble h5 {
  font-size: 13px;
}
.bubble h6 {
  font-size: 12px;
  color: var(--muted);
}
.bubble ul,
.bubble ol {
  margin: 4px 0 4px 20px;
  padding: 0;
}
.bubble ul ul,
.bubble ol ol,
.bubble ul ol,
.bubble ol ul {
  margin: 2px 0 2px 16px;
}
.bubble li {
  margin-bottom: 2px;
}
.bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}
.bubble th {
  padding: 10px 12px;
  text-align: left;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  font-size: 13px;
}
.bubble hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.bubble td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.bubble tr:last-child td {
  border-bottom: none;
}
.message.ai .bubble .ai-fade-line {
  opacity: 0;
  transform: translateY(6px);
  animation: aiLineIn 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: opacity, transform;
}
@keyframes aiLineIn {
  to {
    opacity: 1;
    transform: none;
  }
}

.code-block-wrap {
  margin: 14px 0 18px;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #141414 !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 6px;
  background: transparent !important;
  border-bottom: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.code-header-left {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-family: "Manrope", var(--font), sans-serif !important;
  font-size: 14px !important;
  letter-spacing: -0.01em;
  color: #ffffff !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.code-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.code-action-icon-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  border-radius: 6px !important;
  border: none !important;
  background: transparent !important;
  color: #ffffff !important;
  cursor: pointer !important;
  transition: opacity 0.15s ease, background 0.15s ease;
  user-select: none !important;
  -webkit-user-select: none !important;
  pointer-events: auto !important;
  opacity: 0.88;
}

.code-action-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  opacity: 1 !important;
  color: #ffffff !important;
}

.code-action-icon-btn svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex-shrink: 0 !important;
  display: block !important;
  pointer-events: none !important;
}

.bubble pre {
  margin: 0 !important;
  padding: 8px 20px 20px !important;
  overflow-x: auto;
  background: transparent !important;
  border: none !important;
  border-radius: 0 0 20px 20px !important;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace !important;
  font-size: 13.5px !important;
  line-height: 1.65 !important;
  color: #e6edf3 !important;
}

.bubble pre code.hljs {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.bubble pre code.hljs .hljs-comment,
.bubble pre code.hljs .hljs-quote {
  color: #768390 !important;
  font-style: normal !important;
}

.bubble pre:hover {
  opacity: 1 !important;
}

.bubble pre:last-child {
  margin-bottom: 0;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
}
.typing-dots span {
  width: 5px;
  height: 5px;
  background: var(--muted);
  border-radius: 50%;
  animation: dot 1.2s infinite;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes dot {
  0%,
  60%,
  100% {
    opacity: 0.3;
  }
  30% {
    opacity: 1;
  }
}
.bubble.streaming:not(.loading-dots):not(.inline-skeleton-bubble)::after {
  display: none !important;
  content: none !important;
}

#chat-fade {
  position: relative;
  flex-shrink: 0;
  height: 48px;
  margin-bottom: -48px;
  pointer-events: none;
  z-index: 2;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 60%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 60%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, rgba(17, 17, 17, 0.8), transparent);
}

#input-area {
  padding: 6px 12px 6px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: transparent;
  position: relative;
  flex-shrink: 0;
  z-index: 3;
}
#footer {
  padding: 2px 14px 4px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 1;
}

#file-previews {
  box-sizing: border-box;
}
.file-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--muted);
  max-width: 160px;
}
.file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.file-chip-remove:hover {
  color: var(--text);
}
.attachment-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.6;
  color: var(--muted);
}
.attachment-tag svg {
  flex-shrink: 0;
  opacity: 0.85;
}
.attachment-tag span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#model-btn .chevron {
  color: var(--muted);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
#model-btn.open .chevron {
  transform: rotate(90deg);
}
#model-btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#model-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 99999;
  opacity: 0;
  transform: translateY(-6px) scaleY(0.95);
  transform-origin: top center;
  pointer-events: none;
  transition:
    opacity 0.18s,
    transform 0.2s cubic-bezier(0.34, 1.3, 0.64, 1);
  overflow: hidden;
  min-width: 220px;
}
#model-menu.open {
  opacity: 1;
  transform: none;
  pointer-events: all;
}
#model-menu-inner {
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  overscroll-behavior: contain;
  max-height: min(280px, 50dvh) !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
#model-menu-inner::-webkit-scrollbar {
  width: 4px;
}
#model-menu-inner::-webkit-scrollbar-track {
  background: transparent;
}
#model-menu-inner::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
#model-menu-inner:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
}
.model-opt {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  min-height: 40px;
  touch-action: pan-y !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-touch-callout: none !important;
  transition: background 0.12s;
}
.model-opt:last-child {
  border-bottom: none;
}
.model-opt:hover,
.model-opt:active {
  background: var(--surface2);
}
.model-opt > span:first-child {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-opt .check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent2);
  opacity: 0;
  transition: opacity 0.2s;
  margin-left: auto;
}
.model-opt.selected .check {
  opacity: 1;
}
.model-opt .tag {
  font-size: 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 2px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}
.model-opt.vision-model .tag {
  color: var(--accent2);
  border-color: rgba(56, 139, 253, 0.25);
  background: rgba(56, 139, 253, 0.08);
}
.donor-mode-row {
  align-items: center;
  gap: 14px;
}
.donor-mode-row > span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.donor-mode-row small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.donor-key-title {
  color: #fff !important;
  letter-spacing: 0.02em;
}
.donor-key-field,
.byok-key-field {
  height: 42px;
  box-sizing: border-box;
  margin-top: 8px;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  position: relative;
  display: flex;
  align-items: center;
  transition: background 0.18s ease, box-shadow 0.18s ease !important;
}
.donor-key-field:hover,
.byok-key-field:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border: none !important;
  border-width: 0 !important;
}
.donor-key-field:focus-within,
.byok-key-field:focus-within {
  background: rgba(255, 255, 255, 0.07) !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.2) !important;
}
.donor-key-field input,
.byok-key-field input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
  padding: 10px 46px 10px 14px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--text) !important;
  font:
    13px/1.3 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.donor-key-field input::placeholder,
.byok-key-field input::placeholder {
  color: var(--muted);
}
.donor-key-save {
  margin-top: 8px !important;
}
.settings-sub a,
#byok-box a {
  color: var(--accent-primary, #1f6feb) !important;
}
.byok-key-field {
  margin: 0;
}
.byok-key-field .byok-input-field {
  min-height: 46px !important;
  height: 46px !important;
}
#donor-openrouter-status,
#sidenav-byok-status,
#byok-status {
  display: none !important;
}
.celoapi-title {
  margin-top: 30px !important;
}
.celoapi-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}
.celoapi-row select,
.celoapi-key-row input,
#celoapi-personalization {
  width: 100%;
  box-sizing: border-box;
  border: none !important;
  outline: none !important;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text);
  font: 13.5px inherit;
  padding: 12px 14px;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.celoapi-row select:hover,
.celoapi-key-row input:hover,
#celoapi-personalization:hover {
  background: rgba(255, 255, 255, 0.07) !important;
}
.celoapi-row select:focus,
.celoapi-key-row input:focus,
#celoapi-personalization:focus {
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary, #10b981) 38%, transparent) !important;
}
.celoapi-label {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 12px;
}
.celoapi-key-wrap {
  margin-top: 14px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  position: relative;
}
.celoapi-key-input {
  padding: 10px 46px 10px 14px !important;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important;
  font-size: 13px !important;
  letter-spacing: 0.2px;
}
.celoapi-key-wrap .celoapi-icon-copy {
  position: absolute;
  right: 6px;
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
  border: none !important;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.celoapi-key-wrap .celoapi-icon-copy:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text);
}
.celoapi-key-wrap .celoapi-icon-copy svg {
  width: 15px;
  height: 15px;
}
.celoapi-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.celoapi-stats span {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035) !important;
  border: none !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.celoapi-stats strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
#settings-panel-developer,
#developer-celoapi-mount,
.celoapi-section,
.celoapi-section-title,
.celoapi-row,
.celoapi-row label,
.celoapi-model-picker,
.celoapi-model-picker > button,
.celoapi-model-menu,
.celoapi-model-menu button,
.celoapi-stats,
.celoapi-language-tabs button,
.celoapi-section .settings-sub,
.celoapi-section .settings-save-btn {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.celoapi-section {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035) !important;
  border: none !important;
  box-shadow: none !important;
}
.celoapi-section-title {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.1px;
}
.celoapi-section .settings-sub {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  margin: 6px 0 0;
}
.celoapi-row {
  margin-top: 14px;
}
.celoapi-model-picker {
  position: relative;
}
.celoapi-model-picker > button {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  outline: none !important;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text);
  font: 13.5px inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.celoapi-model-picker > button:hover,
.celoapi-model-picker > button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
.celoapi-model-picker > button svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
  transition: transform 0.18s ease;
}
.celoapi-model-picker > button[aria-expanded="true"] svg {
  transform: rotate(180deg);
  color: var(--text);
}
.celoapi-model-menu {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 230px;
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  background: rgba(24, 26, 31, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  scrollbar-width: none;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}
.celoapi-model-menu::-webkit-scrollbar {
  display: none;
}
.celoapi-model-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}
.celoapi-model-menu button {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e5e7eb !important;
  font: 13px inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.celoapi-model-menu button:hover,
.celoapi-model-menu button.selected {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}
.celoapi-model-menu button.selected {
  font-weight: 600;
}
.celoapi-model-menu button .celoapi-check {
  color: var(--accent-primary, #58a6ff);
  flex-shrink: 0;
}
body.theme-light .celoapi-model-picker > button,
html[data-theme="light"] .celoapi-model-picker > button {
  background: rgba(0, 0, 0, 0.035) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #111827 !important;
}
body.theme-light .celoapi-model-picker > button:hover,
body.theme-light .celoapi-model-picker > button[aria-expanded="true"],
html[data-theme="light"] .celoapi-model-picker > button:hover,
html[data-theme="light"] .celoapi-model-picker > button[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.06) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}
body.theme-light .celoapi-model-menu,
html[data-theme="light"] .celoapi-model-menu {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
}
body.theme-light .celoapi-model-menu button,
html[data-theme="light"] .celoapi-model-menu button {
  color: #374151 !important;
}
body.theme-light .celoapi-model-menu button:hover,
body.theme-light .celoapi-model-menu button.selected,
html[data-theme="light"] .celoapi-model-menu button:hover,
html[data-theme="light"] .celoapi-model-menu button.selected {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111827 !important;
}
.celoapi-label {
  margin-top: 16px;
}
.celoapi-section #celoapi-personalization {
  min-height: 120px;
  resize: none !important;
  line-height: 1.5;
}
.celoapi-howto pre {
  margin: 12px 0 0;
  padding: 14px 16px;
  overflow: auto;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35) !important;
  color: rgba(255, 255, 255, 0.88);
  font:
    11.5px/1.6 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.celoapi-howto code {
  color: inherit;
}
.celoapi-endpoint {
  overflow-wrap: anywhere;
}
.celoapi-language-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
  min-width: 0;
}
.celoapi-language-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font: 550 11.5px inherit;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.celoapi-language-tabs button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.celoapi-language-tabs button.active,
.celoapi-language-tabs button.active:hover {
  background: var(--accent-primary, #10b981) !important;
  color: #fff !important;
}
.celoapi-usage-title {
  margin-top: 18px;
}
.celoapi-icon-copy {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 0 !important;
  cursor: pointer;
  transition: background 0.18s ease;
}
.celoapi-icon-copy:hover {
  background: rgba(255, 255, 255, 0.09) !important;
}
.donor-key-save {
  border-radius: 12px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 11px 18px !important;
}
.celoapi-icon-copy svg {
  width: 18px;
  height: 18px;
}
.celoapi-example-wrap {
  position: relative;
}
.celoapi-example-wrap .celoapi-example-copy {
  position: absolute;
  right: 8px;
  top: 20px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.1);
}
.celoapi-example-wrap pre {
  padding-right: 56px;
}

#send-btn.send-press {
  animation: sendPress 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sendPress {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.86);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* ── Translucent Frosted Glass Plus Popup ── */
.plus-popup,
#plus-popup {
  position: fixed !important;
  width: 240px !important;
  max-height: calc(100vh - 24px) !important;
  overflow-y: auto !important;
  background: rgba(22, 24, 28, 0.45) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.52) !important;
  padding: 6px !important;
  z-index: 99999 !important;
  display: flex !important;
  flex-direction: column !important;
  transform-origin: 20px 0px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: perspective(700px) rotateX(-20deg) scale3d(0.08, 0.08, 1) translateY(-14px);
  will-change: transform, opacity;
  transition:
    opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.24s !important;
  box-sizing: border-box !important;
}

.plus-popup.opens-above,
#plus-popup.opens-above {
  transform-origin: 20px 100%;
  transform: perspective(700px) rotateX(20deg) scale3d(0.08, 0.08, 1) translateY(14px);
}

body.theme-midnight #plus-popup,
html[data-theme="midnight"] #plus-popup {
  background: rgba(10, 12, 16, 0.4) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55) !important;
}

body.theme-light #plus-popup,
html[data-theme="light"] #plus-popup {
  background: #f1f3f6 !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.theme-light .popup-item,
html[data-theme="light"] .popup-item {
  color: #111418 !important;
}
body.theme-light .popup-item:hover,
html[data-theme="light"] .popup-item:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111418 !important;
}
body.theme-light .popup-item.active,
html[data-theme="light"] .popup-item.active {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 12%, transparent) !important;
  color: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .popup-icon,
html[data-theme="light"] .popup-icon {
  color: #5e6673;
}

.plus-popup.open,
#plus-popup.open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: perspective(700px) rotateX(0deg) scale3d(1, 1, 1) translateY(0) !important;
  transition:
    opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.32s cubic-bezier(0.34, 1.35, 0.64, 1),
    visibility 0s linear 0s !important;
}

.popup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  color: #ececec !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
  min-height: 38px;
  touch-action: manipulation;
  transition:
    background 0.18s cubic-bezier(0.2, 0, 0, 1),
    color 0.18s cubic-bezier(0.2, 0, 0, 1),
    transform 0.14s cubic-bezier(0.2, 0, 0, 1) !important;
  user-select: none;
  position: relative;
  background: transparent;
}
.popup-item:active {
  transform: scale(0.96) !important;
}
.popup-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}
.popup-item.active,
#popup-web-search.active,
#popup-deep-research.active {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 14%, transparent) !important;
  color: var(--accent-primary, #1f6feb) !important;
}
.popup-item.active *,
#popup-web-search.active *,
#popup-deep-research.active * {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}
.popup-item.active:hover,
#popup-web-search.active:hover,
#popup-deep-research.active:hover {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 20%, transparent) !important;
}
.popup-item.active:hover *,
#popup-web-search.active:hover *,
#popup-deep-research.active:hover * {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .popup-item.active,
html[data-theme="light"] .popup-item.active {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 12%, transparent) !important;
  color: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .popup-item.active:hover,
html[data-theme="light"] .popup-item.active:hover {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 18%, transparent) !important;
}
.popup-icon {
  flex-shrink: 0;
  color: #888888;
  transition: color 0.15s, transform 0.18s ease;
}
.popup-item:hover .popup-icon {
  color: #ffffff;
}
.popup-item.active .popup-icon,
#popup-web-search.active .popup-icon,
#popup-deep-research.active .popup-icon {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
  transform: scale(1.06);
}
body.theme-light .popup-item.active .popup-icon,
html[data-theme="light"] .popup-item.active .popup-icon {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}
.popup-item .check-icon {
  margin-left: auto;
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
  display: block !important;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.popup-item.active .check-icon,
#popup-web-search.active .check-icon,
#popup-deep-research.active .check-icon {
  opacity: 1 !important;
  transform: scale(1) !important;
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}
.popup-item.locked .check-icon {
  display: none !important;
  opacity: 0 !important;
}
.popup-item .lock-icon {
  margin-left: auto;
  color: #888888;
  display: none;
  flex-shrink: 0;
}
.popup-item.locked .lock-icon {
  display: block !important;
}
body.theme-light .popup-item .check-icon,
html[data-theme="light"] .popup-item .check-icon {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .popup-item.locked .lock-icon,
html[data-theme="light"] .popup-item.locked .lock-icon {
  color: #8c959f;
}
.popup-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
  flex-shrink: 0;
}

#popup-web-search:hover,
#popup-deep-research:hover,
#popup-image-gen:hover,
#model-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

#popup-web-search:hover .popup-icon,
#popup-deep-research:hover .popup-icon,
#popup-image-gen:hover .popup-icon,
#model-btn:hover .popup-icon {
  color: #ffffff !important;
}

#model-btn.no-chevron .chevron {
  display: none !important;
}
#model-btn.locked-mode {
  cursor: default;
}
#model-btn.locked-mode:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.popup-item.locked {
  opacity: 0.6;
  cursor: not-allowed;
}
.popup-item.locked:hover {
  background: transparent;
}
.popup-item.locked .popup-icon {
  color: #666;
}
.popup-item.locked .lock-icon {
  margin-left: auto;
  color: #666;
  display: block;
  flex-shrink: 0;
}
.popup-item .lock-icon {
  display: none;
}

.spin {
  width: 10px;
  height: 10px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(35, 35, 35, 0.62);
  border: 0;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-radius: 28px;
  padding: 10px 12px 10px 10px;
  gap: 10px;
  transition:
    min-height 0.16s cubic-bezier(0.4, 0, 0.2, 1),
    border-radius 0.18s ease,
    padding 0.16s ease,
    border-color 0.2s;
  min-height: 52px;
  box-sizing: border-box;
}
.bar.drag-active {
  min-height: 125px !important;
}
.bar-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  position: relative;
}
body.theme-midnight .bar,
html[data-theme="midnight"] .bar {
  background: #0e0f12 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}
body.theme-light .bar,
html[data-theme="light"] .bar {
  background: #f1f3f6 !important;
  border: 1px solid rgba(0, 0, 0, 0.09) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}
.bar:focus-within {
  border-color: transparent;
}
.char-count {
  display: none !important;
}
#plus-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition:
    background 0.2s,
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  touch-action: manipulation;
  padding: 0;
  box-sizing: border-box;
}
#plus-btn .plus-h,
#plus-btn .plus-v {
  display: block;
  position: absolute;
  background: var(--text);
  border-radius: 2px;
}
#plus-btn .plus-h {
  width: 12px;
  height: 2px;
  top: 15px;
  left: 10px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#plus-btn .plus-v {
  width: 2px;
  height: 12px;
  top: 10px;
  left: 15px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#plus-btn:hover {
  background: var(--border);
}
#plus-btn.active .plus-h {
  transform: rotate(45deg) translate(0, 0);
}
#plus-btn.active .plus-v {
  transform: rotate(45deg) translate(0, 0);
}
#user-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  resize: none;
  max-height: 140px;
  min-height: 24px;
  line-height: 24px;
  padding: 4px 0;
  margin: 0;
  box-sizing: border-box;
  touch-action: manipulation;
}

/* ─── Expand / Fullscreen Prompt Button & Layout ─── */
.input-expand-btn {
  position: absolute !important;
  top: 10px !important;
  right: 12px !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.6) !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 10 !important;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease !important;
  outline: none !important;
}

.input-expand-btn:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 50% !important;
}

.input-expand-btn:active {
  background: rgba(255, 255, 255, 0.16) !important;
  border-radius: 50% !important;
}

body.theme-light .input-expand-btn,
html[data-theme="light"] .input-expand-btn {
  color: rgba(0, 0, 0, 0.5) !important;
  border-radius: 50% !important;
}
body.theme-light .input-expand-btn:hover,
html[data-theme="light"] .input-expand-btn:hover {
  color: #000000 !important;
  background: rgba(0, 0, 0, 0.08) !important;
  border-radius: 50% !important;
}

.input-expand-btn[data-tooltip]::after {
  bottom: auto !important;
  top: 50% !important;
  left: auto !important;
  right: calc(100% + 8px) !important;
  transform: translateY(-50%) translateX(4px) !important;
  white-space: nowrap !important;
}

.input-expand-btn[data-tooltip]:hover::after {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(-50%) translateX(0) !important;
}

.bar.has-large-prompt .input-expand-btn,
.bar.is-fullscreen .input-expand-btn {
  display: flex !important;
}

/* Multi-line / large prompt layout (Image 2) */
.bar.has-large-prompt {
  border-radius: 26px !important;
  padding: 12px 14px 10px 14px !important;
}

.bar.has-large-prompt .bar-input-row,
.bar.is-fullscreen .bar-input-row,
.bar.is-collapsing .bar-input-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: auto auto !important;
  row-gap: 8px !important;
  width: 100% !important;
  align-items: end !important;
}

.bar.has-large-prompt #user-input {
  grid-row: 1 !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  align-self: start !important;
  padding-right: 32px !important;
  padding-left: 2px !important;
}

.bar.has-large-prompt #plus-btn {
  grid-row: 2 !important;
  grid-column: 1 !important;
  justify-self: start !important;
  align-self: end !important;
}

.bar.has-large-prompt #send-btn,
.bar.has-large-prompt #stop-btn {
  grid-row: 2 !important;
  grid-column: 2 !important;
  justify-self: end !important;
  align-self: end !important;
}

/* Fullscreen expanded state (Image 1 & 3) */
.bar.is-fullscreen {
  height: min(540px, calc(100dvh - 120px));
  min-height: 480px;
  max-height: calc(100dvh - 80px);
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  border-radius: 26px !important;
  padding: 14px 16px 12px 16px !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45) !important;
  overflow: hidden !important;
}

.bar.is-animating {
  min-height: 0 !important;
}

.bar.is-fullscreen .bar-input-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 1fr auto !important;
  row-gap: 12px !important;
  height: 100% !important;
  flex: 1 1 auto !important;
  align-items: stretch !important;
  width: 100% !important;
}

.bar.is-fullscreen #user-input {
  grid-row: 1 !important;
  grid-column: 1 / -1 !important;
  height: 100% !important;
  max-height: none !important;
  overflow-y: auto !important;
  align-self: start !important;
  padding-top: 2px !important;
  padding-bottom: 6px !important;
  padding-right: 36px !important;
  padding-left: 2px !important;
  line-height: 24px !important;
}

.bar.is-fullscreen #plus-btn {
  grid-row: 2 !important;
  grid-column: 1 !important;
  justify-self: start !important;
  align-self: end !important;
  margin-top: auto !important;
}

.bar.is-fullscreen #send-btn,
.bar.is-fullscreen #stop-btn {
  grid-row: 2 !important;
  grid-column: 2 !important;
  justify-self: end !important;
  align-self: end !important;
  margin-top: auto !important;
}

#main.has-welcome.input-is-fullscreen #chat-window,
#main.has-welcome:has(.bar.is-fullscreen) #chat-window {
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  transform: translateY(-8px) scale(0.98) !important;
}
#main.has-welcome:has(.bar.is-fullscreen) {
  justify-content: center !important;
}
#user-input::placeholder {
  color: var(--muted);
}
#send-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--accent-primary, #1f6feb);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  touch-action: manipulation;
}
#send-btn:not(:disabled):hover {
  background: var(--accent-primary-hover, #1a60d6);
}
#send-btn svg {
  display: block;
  width: 17px;
  height: 17px;
  pointer-events: none;
}
#send-btn:active {
  transform: scale(0.95);
}
#send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.file-chip.animate-in {
  animation: chipPopIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.image-modal {
  display: none !important;
  position: fixed !important;
  inset: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 99999 !important;
  padding: 24px !important;
  pointer-events: none !important;
}
.image-modal.active {
  display: flex !important;
  pointer-events: auto !important;
}
.image-modal-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.72) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  animation: imageBackdropFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  will-change: opacity;
}

@keyframes imageBackdropFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.image-modal-content {
  position: relative !important;
  max-width: min(95vw, 840px) !important;
  max-height: min(95vh, 840px) !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.65) !important;
  background: rgba(14, 14, 18, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  animation: imageContentPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  will-change: transform, opacity;
}

@keyframes imageContentPopIn {
  0% {
    transform: scale(0.94) translateY(6px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.image-modal.closing {
  pointer-events: none !important;
}
.image-modal.closing .image-modal-backdrop {
  animation: imageBackdropFadeOut 0.16s ease-in forwards !important;
}
.image-modal.closing .image-modal-content {
  animation: imageContentPopOut 0.16s ease-in forwards !important;
}

@keyframes imageBackdropFadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes imageContentPopOut {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(0.96) translateY(4px);
    opacity: 0;
  }
}

.image-modal-content img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}
.image-modal-caption {
  padding: 12px 14px 14px;
  font-size: 13px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
}

.ctx-menu {
  position: fixed;
  background: rgba(26, 26, 26, 0.35) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 8px !important;
  z-index: 99999 !important;
  min-width: 150px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65) !important;
  opacity: 0;
  pointer-events: none;
  display: none;
}
.ctx-menu.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
  animation: ctxMenuPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
.ctx-menu.closing {
  display: block !important;
  pointer-events: none !important;
  animation: ctxMenuPopOut 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
@keyframes ctxMenuPopIn {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@keyframes ctxMenuPopOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.92) translateY(6px);
  }
}
@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
  color: var(--text);
  border: none;
  background: none;
  width: 100%;
}
.ctx-item:hover {
  background: var(--surface);
}
.ctx-item.danger {
  color: var(--danger);
}
.ctx-item.danger:hover {
  background: rgba(248, 81, 73, 0.1);
}

#auth-screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
#auth-screen.visible {
  display: flex;
}
.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: opacity 0.2s ease, backdrop-filter 0.2s ease, -webkit-backdrop-filter 0.2s ease, background 0.2s ease;
  pointer-events: none;
}
#auth-screen.visible .auth-backdrop {
  background: rgba(0, 0, 0, 0.82);
  opacity: 1;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
}
.auth-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  padding: 24px 28px 28px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.07);
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transition:
    opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
#auth-screen.visible .auth-box {
  opacity: 1;
  transform: none;
}
.auth-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: none !important;
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted, #a1a1aa);
  cursor: pointer;
  display: grid !important;
  place-items: center !important;
  place-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-sizing: border-box;
}
.auth-close svg {
  display: block;
  width: 14px;
  height: 14px;
  stroke: currentColor;
  transform-origin: 50% 50%;
  transition: stroke 0.2s ease;
  pointer-events: none;
  margin: auto;
}
.auth-close:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
}
.auth-close:hover svg {
  stroke: #ef4444 !important;
}
.auth-close:active {
  background: rgba(239, 68, 68, 0.24) !important;
  transform: scale(0.94);
}
.auth-logo {
  display: none !important;
}
.auth-box h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-top: 0;
  margin-bottom: 6px;
  line-height: 1.2;
}
.auth-box .auth-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
}

#auth-step-1,
#auth-step-2,
#auth-step-3 {
  transition: opacity 0.18s cubic-bezier(0.2, 0, 0.2, 1), transform 0.18s cubic-bezier(0.2, 0, 0.2, 1);
  will-change: opacity, transform;
}

.auth-step-anim-out-left {
  opacity: 0 !important;
  transform: translateX(-14px) !important;
  pointer-events: none;
}

.auth-step-anim-out-right {
  opacity: 0 !important;
  transform: translateX(14px) !important;
  pointer-events: none;
}

.auth-step-anim-in-from-right {
  animation: authSlideInRight 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-step-anim-in-from-left {
  animation: authSlideInLeft 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authSlideInRight {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes authSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.auth-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.auth-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition:
    background 0.3s,
    width 0.3s;
  flex-shrink: 0;
}
.auth-step-dot.active {
  background: #1f6feb;
  width: 18px;
  border-radius: 3px;
}

.auth-field {
  margin-bottom: 14px;
}
.auth-field input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
  -webkit-user-select: text;
  user-select: text;
}
.auth-field input:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent-primary, #1f6feb);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--accent-primary, #1f6feb) 16%, transparent);
}
.auth-field input::placeholder {
  color: #555;
}
.auth-btn {
  width: 100%;
  padding: 14px;
  background: #1f6feb;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition:
    background 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
  font-family: inherit;
}
.auth-btn:hover {
  background: #1a60d6;
  box-shadow: 0 6px 20px rgba(31, 111, 235, 0.4);
}
.auth-btn:active {
  transform: scale(0.98);
}
.auth-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.auth-btn.locked {
  background: #f85149;
  opacity: 1;
  cursor: not-allowed;
}
.auth-btn.locked:hover {
  background: #f85149;
  box-shadow: none;
}
.auth-provider-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.auth-provider-btn {
  flex: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px;
  background: transparent !important;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.auth-provider-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}
.auth-provider-btn:active {
  transform: scale(0.97);
}
.auth-provider-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.provider-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.provider-mark {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
}
.google-mark {
  color: #4285f4;
  font-family: Arial, sans-serif;
  font-size: 20px;
}
.microsoft-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 2px;
}
.microsoft-mark i:nth-child(1) {
  background: #f25022;
}
.microsoft-mark i:nth-child(2) {
  background: #7fba00;
}
.microsoft-mark i:nth-child(3) {
  background: #00a4ef;
}
.microsoft-mark i:nth-child(4) {
  background: #ffb900;
}
.discord-mark {
  color: #5865f2;
  font-size: 21px;
}
.github-mark {
  color: var(--text);
  font-size: 20px;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 46px !important;
}
.password-toggle {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.14s ease,
    visibility 0.14s,
    background 0.15s,
    color 0.15s;
}
.password-field:has(input:not(:placeholder-shown)) .password-toggle {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.password-toggle svg {
  width: 17px;
  height: 17px;
}
.password-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.dot-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 14px;
}
.dot-loader span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: dot-bounce 1.1s infinite ease-in-out both;
}
.dot-loader span:nth-child(1) {
  animation-delay: -0.24s;
}
.dot-loader span:nth-child(2) {
  animation-delay: -0.12s;
}
.dot-loader span:nth-child(3) {
  animation-delay: 0s;
}
.spinner-loader {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin-loader 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin-loader {
  to {
    transform: rotate(360deg);
  }
}
.sidebar-loading {
  text-align: center;
  padding: 20px 0;
}
.sidebar-loading .spinner-loader {
  width: 15px;
  height: 15px;
  border-color: rgba(139, 148, 158, 0.28);
  border-top-color: var(--accent2);
}
@keyframes dot-bounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #444;
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #2a2a2a;
}
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: #555;
  margin-top: 16px;
}
.auth-switch {
  display: none;
}
.auth-switch button {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: color 0.15s;
  padding: 0;
}
.auth-switch button:hover {
  color: #fff;
}
.auth-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}
.auth-secondary-actions button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #a6acb7;
  padding: 3px 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: color 0.16s ease, opacity 0.16s ease;
}
.auth-secondary-actions button:hover {
  color: #fff;
}
.auth-secondary-actions button:disabled {
  cursor: default;
  opacity: 0.65;
}
.auth-secondary-actions .spinner-loader {
  width: 15px;
  height: 15px;
}
.auth-error {
  color: #f85149;
  font-size: 12px;
  margin-top: 10px;
  text-align: center;
  min-height: 16px;
}
.auth-success {
  color: #3fb950;
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  line-height: 1.5;
}
.auth-method-list {
  display: flex;
  flex-direction: column;
  border: none !important;
  border-radius: 12px;
  overflow: hidden;
}
.auth-method-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: none !important;
  font-size: 13px;
}
.auth-method-row > span:first-child {
  min-width: 78px;
  color: var(--text);
  font-weight: 500;
}
.auth-provider-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-provider-name img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.auth-method-email {
  margin-left: auto;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-password-row > span:last-child,
.auth-status {
  margin-left: auto;
  color: #f87171;
  font-size: 12px;
}
.auth-status.linked,
.auth-password-row > span:last-child.linked {
  color: #4ade80;
}
.auth-link-btn {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface2);
  color: var(--text);
  font: 600 12px inherit;
  cursor: pointer;
}
.auth-link-btn:hover {
  border-color: #666;
}
.auth-link-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.auth-password-set {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.auth-password-set .settings-save-btn {
  margin-top: 9px;
  width: 100%;
  padding: 8px;
}
.auth-password-set input {
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  padding: 10px 42px 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font: 13px inherit;
  outline: none;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.auth-password-set input::placeholder {
  color: var(--muted);
}
.auth-password-set input:focus {
  border-color: var(--accent2);
  background: rgba(31, 111, 235, 0.06);
}
.auth-delete-btn {
  margin-top: 16px !important;
  background: transparent !important;
  border: 1px solid rgba(248, 81, 73, 0.55) !important;
  color: #f87171 !important;
}
.auth-delete-btn:hover {
  background: rgba(248, 81, 73, 0.1) !important;
}
.auth-inline-row {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.auth-inline-row:first-child {
  border-radius: 11px 11px 0 0;
  overflow: hidden;
}
.auth-inline-row input {
  width: 100%;
  height: 48px;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px inherit;
  outline: 0;
  padding: 0 46px 0 14px;
}
.auth-inline-row input::placeholder {
  color: var(--muted);
}
.auth-inline-row:focus-within {
  z-index: 1;
  box-shadow: inset 0 0 0 1px var(--accent-primary, #1f6feb);
}
.auth-inline-save {
  position: absolute;
  right: 9px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--accent-primary, #1f6feb);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.auth-inline-save:hover {
  background: rgba(255, 255, 255, 0.08);
}
.auth-inline-save svg {
  width: 16px;
  height: 16px;
}
.auth-inline-eye {
  right: 41px;
}
.auth-inline-row.password-field input {
  padding-right: 78px !important;
}
.auth-email-row {
  background: rgba(255, 255, 255, 0.018);
}
.auth-email-row input {
  color: var(--muted);
  padding-right: 58px;
  cursor: default;
}
.auth-email-row span {
  position: absolute;
  right: 14px;
  color: var(--muted);
  font-size: 11px;
}
.auth-delete-btn {
  background: rgba(239, 68, 68, 0.15) !important;
  border: none !important;
  color: #ef4444 !important;
  padding: 8px 18px !important;
  border-radius: 20px !important;
  font-family: 'Manrope', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  margin-top: 20px !important;
  transition: all 0.15s ease !important;
}
.auth-delete-btn:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #ff6b6b !important;
}
.auth-settings-section {
  background: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin-top: 18px !important;
  border: none !important;
  box-shadow: none !important;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}
.auth-section-heading {
  font-family: 'Manrope', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin: 0 0 6px !important;
}
.auth-section-description {
  font-family: 'Manrope', sans-serif !important;
  margin: 0 0 10px !important;
  color: #8e8e93 !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
}
.auth-method-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
.auth-credential-row,
.auth-method-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  padding: 14px 18px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}
.auth-credential-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.auth-credential-copy label,
.auth-credential-copy strong {
  margin: 0;
  color: #ffffff;
  font-family: 'Manrope', sans-serif !important;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
}
.auth-credential-copy small {
  max-width: 280px;
  color: #8e8e93;
  font-family: 'Manrope', sans-serif !important;
  font-size: 11.5px;
  line-height: 1.35;
}
.auth-credential-copy input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: #ffffff;
  font: 13.5px 'Manrope', sans-serif;
  line-height: 24px;
  outline: none;
}
.auth-credential-copy input::placeholder {
  color: #6b7280;
}
.auth-action-btn,
.auth-link-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 16px !important;
  border-radius: 20px !important;
  border: none !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  font-family: 'Manrope', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
.auth-action-btn:hover,
.auth-link-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}
.auth-link-btn.linked,
.auth-link-btn.linked:disabled {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #22c55e !important;
  cursor: default !important;
  opacity: 1 !important;
}
.auth-link-btn.linked:hover {
  background: rgba(34, 197, 94, 0.22) !important;
  color: #22c55e !important;
}
.auth-action-btn:disabled,
.auth-link-btn:not(.linked):disabled {
  cursor: wait;
  opacity: 0.6;
}
.auth-action-btn.is-pending {
  color: var(--text);
}
.auth-action-btn.is-pending::before {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: authActionSpin 0.7s linear infinite;
}
.auth-oauth-list .auth-method-row {
  background: transparent;
}
@keyframes authActionSpin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 600px) {
  .auth-credential-row {
    min-height: 76px;
    gap: 12px;
    padding: 12px;
  }
  .auth-action-btn {
    min-width: 96px;
  }
  .auth-credential-copy small {
    max-width: 180px;
  }
}

.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-bg.open {
  display: flex;
}
.modal-bg .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  opacity: 0;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.modal-bg.open.visible .modal-backdrop,
.modal-bg.visible .modal-backdrop {
  opacity: 1 !important;
}
.modal {
  position: relative;
  z-index: 1;
  background: #1c1c1e !important;
  border-radius: 20px !important;
  padding: 24px !important;
  border: none !important;
  outline: none !important;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75) !important;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  transition:
    opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.modal-bg.open.visible .modal,
.modal-bg.visible .modal {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}
.modal h3 {
  font-family: 'Manrope', sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin-bottom: 8px !important;
  text-align: left !important;
}
.modal p.modal-sub {
  font-family: 'Manrope', sans-serif !important;
  font-size: 13.5px !important;
  color: #8e8e93 !important;
  line-height: 1.5 !important;
  text-align: left !important;
  margin-bottom: 20px !important;
}
.modal input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06) !important;
  border: none !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  font-size: 14px;
  outline: none;
  margin-bottom: 20px;
  font-family: 'Manrope', sans-serif !important;
  transition: background 0.15s;
}
.modal input:focus {
  background: rgba(255, 255, 255, 0.09) !important;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Manrope', sans-serif !important;
}
.modal-btn.cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.modal-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.14);
}
.modal-btn.primary {
  background: #a8c7fa;
  color: #041e49;
}
.modal-btn.primary:hover {
  background: #c2e7ff;
}
.modal-btn.danger {
  background: #ef4444;
  color: #ffffff;
}
.modal-btn.danger:hover {
  background: #dc2626;
}

#overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.22) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 150 !important;
  display: none;
  animation: fadeIn 0.2s ease;
  pointer-events: auto !important;
}
#overlay.show {
  display: block !important;
}

@media (max-width: 640px) {
  #sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    height: 100dvh;
    z-index: 200;
  }
  #sidebar.collapsed {
    width: var(--sidebar-icon-w);
  }
  #main {
    margin-left: var(--sidebar-icon-w);
    transition: margin-left 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }
  #sidebar:not(.collapsed) ~ #main {
    margin-left: 0;
  }
  .auth-box {
    margin: 0 16px;
    max-width: calc(100% - 32px);
  }
  #auth-screen {
    align-items: flex-end;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

#sidebar.collapsed .conv-item {
  position: relative;
}
#sidebar.collapsed .guest-conv-msg {
  opacity: 0;
  pointer-events: none;
}

#main.has-welcome {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  min-height: 100% !important;
  height: 100% !important;
  height: 100dvh !important;
  overflow: hidden !important;
}
#main.has-welcome #chat-window {
  flex: 0 0 auto !important;
  height: 94px !important;
  min-height: 94px !important;
  max-height: 94px !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding: 0 16px !important;
  width: 100% !important;
  max-width: 820px !important;
  margin: 0 auto !important;
  opacity: 1;
  transform: none;
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              min-height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              margin 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              padding 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.28s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
#main.has-welcome .welcome {
  margin: 0 0 20px 0 !important;
  text-align: center !important;
  width: 100% !important;
}
#main.has-welcome #chat-fade {
  display: none !important;
}
#main.has-welcome #input-area {
  flex: 0 0 auto !important;
  max-width: 820px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 16px 12px !important;
  box-sizing: border-box !important;
}
#main:not(.has-welcome) #input-area {
  margin-top: auto;
}

#sidebar.collapsed .conv-list {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
#sidebar.collapsed .sb-search {
  padding: 6px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: visible;
  opacity: 1;
}

.settings-anchor {
  position: relative;
  width: 100%;
}
/* ── Settings Popup Fade In / Out Animation ── */
@keyframes celoSettingsGenieIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes celoSettingsGenieOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(6px);
  }
}

.settings-popup {
  position: fixed;
  background: rgba(31, 31, 31, 0.88);
  border: 1px solid transparent !important;
  border-color: transparent !important;
  border-radius: 16px;
  backdrop-filter: blur(38px) saturate(1.35);
  -webkit-backdrop-filter: blur(38px) saturate(1.35);
  padding: 6px;
  z-index: 10001 !important;
  min-width: 240px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform-origin: center center;
  pointer-events: none;
  left: 14px;
  max-width: calc(100vw - 80px);
  overflow-y: auto;
  max-height: 65vh;
  will-change: opacity, transform;
}
.settings-popup.open {
  opacity: 1;
  pointer-events: auto;
  animation: celoSettingsGenieIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
.settings-popup.closing {
  animation: celoSettingsGenieOut 0.16s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
  pointer-events: none;
}
.settings-profile-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 8px;
  pointer-events: none;
  cursor: default;
}
.settings-profile-header .avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-profile-header .avatar img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.settings-guest-icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
  flex-shrink: 0;
}
.settings-profile-info {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}
.settings-profile-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-profile-email {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}
.settings-trigger.active {
  background: var(--surface);
}
.settings-detail-screen {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.settings-detail-screen.open {
  display: flex;
}
.settings-detail-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0) !important;
  opacity: 0 !important;
  backdrop-filter: blur(0px) !important;
  -webkit-backdrop-filter: blur(0px) !important;
  transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.26s cubic-bezier(0.16, 1, 0.3, 1), -webkit-backdrop-filter 0.26s cubic-bezier(0.16, 1, 0.3, 1), background 0.26s cubic-bezier(0.16, 1, 0.3, 1) !important;
  pointer-events: none !important;
}
.settings-detail-screen.open.visible .settings-detail-backdrop {
  background: rgba(0, 0, 0, 0.72) !important;
  opacity: 1 !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  pointer-events: auto !important;
}
.settings-detail-screen.closing .settings-detail-backdrop,
.settings-detail-screen:not(.visible) .settings-detail-backdrop {
  opacity: 0 !important;
  backdrop-filter: blur(0px) !important;
  -webkit-backdrop-filter: blur(0px) !important;
  background: rgba(0, 0, 0, 0) !important;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.2s cubic-bezier(0.16, 1, 0.3, 1), -webkit-backdrop-filter 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  pointer-events: none !important;
}

/* ── Drag & Drop File Overlay ── */
.drag-drop-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1.5px dashed var(--accent, #4285f4) !important;
  background: rgba(18, 20, 26, 0.35) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
  box-sizing: border-box;
  animation: fadeIn 0.18s ease;
}
.drag-drop-overlay.active {
  display: flex;
}

@keyframes chipPopIn {
  0% {
    opacity: 0;
    transform: scale(0.82) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes chipPopOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.75) translateY(6px);
  }
}

.file-chip {
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.file-chip.animate-in {
  animation: chipPopIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

.file-chip.animate-out {
  animation: chipPopOut 0.12s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
  pointer-events: none !important;
}
.drag-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--accent, #4285f4);
}
.drag-drop-icon {
  width: 28px;
  height: 28px;
  color: var(--accent, #4285f4);
}
.drag-drop-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent, #4285f4);
}
.settings-detail-box {
  position: relative;
  z-index: 1;
  width: min(580px, calc(100vw - 40px)) !important;
  min-width: min(580px, calc(100vw - 40px)) !important;
  max-width: min(580px, calc(100vw - 40px)) !important;
  height: min(520px, 86vh) !important;
  min-height: min(520px, 86vh) !important;
  max-height: min(520px, 86vh) !important;
  display: flex !important;
  flex-direction: column !important;
  background: rgba(31, 31, 31, 0.48);
  border-radius: 20px;
  padding: 0;
  backdrop-filter: blur(38px) saturate(1.35);
  -webkit-backdrop-filter: blur(38px) saturate(1.35);
  box-shadow: none;
  opacity: 0;
  transform-origin: center center !important;
  will-change: transform, opacity;
  overflow: hidden;
}

@keyframes celoSettingsDetailGenieIn {
  0% {
    opacity: 0;
    transform: scale(0.97);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes celoSettingsDetailGenieOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.97);
  }
}

.settings-detail-screen.open.visible .settings-detail-box {
  opacity: 1 !important;
  transform-origin: center center !important;
  animation: celoSettingsDetailGenieIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
.settings-detail-screen.closing .settings-detail-box,
.settings-detail-screen:not(.visible) .settings-detail-box {
  opacity: 0 !important;
  transform-origin: center center !important;
  animation: celoSettingsDetailGenieOut 0.16s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}
.settings-detail-back {
  display: none;
}
.settings-detail-close {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: none !important;
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted, #a1a1aa);
  cursor: pointer;
  display: grid !important;
  place-items: center !important;
  place-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
  transition: background 0.2s ease, color 0.2s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-sizing: border-box;
}
.settings-detail-close svg {
  display: block;
  width: 14px;
  height: 14px;
  stroke: currentColor;
  transform-origin: 50% 50%;
  transition: stroke 0.2s ease;
  pointer-events: none;
  margin: auto;
}
.settings-detail-close:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
}
.settings-detail-close:hover svg {
  stroke: #ef4444 !important;
}
.settings-detail-close:active {
  background: rgba(239, 68, 68, 0.24) !important;
  transform: scale(0.94);
}
.settings-detail-layout {
  display: flex !important;
  flex: 1 1 0% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.settings-sidenav {
  width: 200px;
  flex-shrink: 0;
  background: var(--surface2);
  border-right: 1px solid var(--border);
  padding: 20px 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.settings-sidenav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}
.settings-sidenav-item svg {
  flex-shrink: 0;
}
.settings-sidenav-item:hover {
  background: var(--surface);
  color: var(--text);
}
.settings-sidenav-item.active {
  background: var(--surface);
  color: var(--text);
}
.settings-detail-content {
  flex: 1 1 0% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 24px;
  min-width: 0;
  box-sizing: border-box;
}
.settings-panel {
  display: none;
  opacity: 0;
}
.settings-panel.visible {
  display: block;
  animation: settingsPanelIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes settingsPanelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.settings-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}
.settings-sub {
  font-size: 12px;
  color: #666;
  margin-bottom: 14px;
  line-height: 1.5;
}
.settings-panel > .settings-sub,
.settings-title + .settings-sub {
  display: none !important;
}
.settings-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  font-family: inherit;
}
.settings-item:hover {
  background: var(--surface);
}
.settings-item.danger {
  color: var(--danger);
}
.settings-item.danger:hover {
  background: rgba(248, 81, 73, 0.1);
}
.settings-signout-item {
  color: var(--danger);
  font-weight: 400;
}
.settings-signout-item svg:first-child {
  color: var(--danger);
}
.settings-signout-item:hover {
  background: rgba(248, 81, 73, 0.1);
}
.settings-item svg:first-child {
  flex-shrink: 0;
  color: var(--accent2);
}
.settings-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted);
  opacity: 0.6;
}
.settings-back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0 0 12px;
  font-family: inherit;
  transition: color 0.15s;
}
.settings-back:hover {
  color: var(--text);
}
.notif-permission-bar.is-hidden,
.notif-permission-bar[style*="display: none"],
.notif-permission-bar[style*="display:none"] {
  display: none !important;
}

.notif-permission-bar {
  background: rgba(255, 255, 255, 0.045) !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  margin-top: 14px !important;
  margin-bottom: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  box-sizing: border-box !important;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}
.notif-permission-content {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 1 !important;
}
.notif-permission-icon {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
  color: var(--accent-primary, #1f6feb) !important;
}
.notif-permission-bar span,
#notif-permission-text {
  font-family: 'Manrope', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #f3f4f6 !important;
  line-height: 1.4 !important;
  margin: 0 !important;
}
.notif-permission-bar button,
#notif-permission-btn {
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--accent-primary, #1f6feb) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 9999px !important;
  padding: 7px 16px !important;
  font-family: 'Manrope', sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: background 0.15s ease, filter 0.15s ease !important;
}
.notif-permission-bar button:hover,
#notif-permission-btn:hover {
  background: var(--accent-primary-hover, #1a60d6) !important;
  filter: brightness(1.08) !important;
  transform: none !important;
}
.notif-permission-bar button:active,
#notif-permission-btn:active {
  transform: none !important;
}
.notif-permission-bar button:focus,
#notif-permission-btn:focus,
.notif-permission-bar button:focus-visible,
#notif-permission-btn:focus-visible {
  outline: none !important;
  transform: none !important;
}
.settings-textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
  line-height: 1.5;
  resize: none !important;
  min-height: 100px;
  outline: none;
  box-sizing: border-box;
  -webkit-user-select: text;
  user-select: text;
}
.settings-textarea-wrap {
  position: relative;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05) !important;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.settings-textarea-wrap:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary, #10b981) 25%, transparent) !important;
}
.settings-textarea-wrap:focus-within {
  background: rgba(255, 255, 255, 0.07) !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary, #10b981) 38%, transparent) !important;
}
.settings-textarea-wrap .settings-textarea {
  padding-bottom: 30px;
}
.settings-textarea:focus {
  border-color: var(--accent-primary, #10b981);
}
.settings-textarea::placeholder {
  color: var(--muted);
}
.settings-word-count {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  pointer-events: none;
}
.settings-word-count.overlimit {
  color: var(--danger);
}
.settings-save-btn {
  width: 100%;
  margin-top: 14px;
  padding: 11px;
  background: var(--accent-primary, #1f6feb);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.settings-save-btn:hover {
  background: var(--accent-primary-hover, #1a60d6);
}
.settings-status {
  display: none !important;
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
}
.katex {
  font-size: 1.05em;
}
/* ── Appearance panel ─────────────────────────────────────── */
.appearance-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.theme-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.theme-card {
  background: var(--surface);
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 80px;
}
.theme-card.active {
  border: none;
  background: rgba(255, 255, 255, 0.12);
}
.theme-card.active .theme-label {
  color: var(--accent-primary, #1f6feb);
  font-weight: 700;
}
.theme-card:hover {
  background: rgba(255, 255, 255, 0.08);
}
.theme-preview {
  width: 52px;
  height: 34px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
}
.theme-preview-dark {
  background: #111;
}
.theme-preview-midnight {
  background: #060607;
}
.theme-preview-light {
  background: #eaedf1;
  border: none;
}
.theme-preview-device {
  background: linear-gradient(135deg, #16181d 50%, #eaedf1 50%) !important;
  border: none;
}
.theme-preview-device .theme-preview-bar {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.3) 50%, rgba(0, 0, 0, 0.16) 50%) !important;
}
.theme-preview-device .theme-preview-line {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 50%, rgba(0, 0, 0, 0.12) 50%) !important;
}
.theme-preview-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
}
.theme-preview-light .theme-preview-bar {
  background: rgba(0, 0, 0, 0.12);
}
.theme-preview-line {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}
.theme-preview-line.short {
  width: 60%;
}
.theme-preview-light .theme-preview-line {
  background: rgba(0, 0, 0, 0.08);
}
.theme-label {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}
.theme-check {
  font-size: 11px;
  color: var(--accent-primary, #1f6feb);
  font-weight: 700;
  height: 14px;
}
.font-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.font-card {
  background: var(--surface);
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 70px;
}
.font-card.active {
  border: none;
  background: rgba(255, 255, 255, 0.12);
}
.font-card.active .font-label,
.font-card.active .font-preview {
  color: var(--accent-primary, #1f6feb);
  font-weight: 700;
}
.font-card:hover {
  background: rgba(255, 255, 255, 0.08);
}
.font-preview {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.font-label {
  font-size: 11px;
  color: var(--muted);
}
.font-check {
  font-size: 11px;
  color: var(--accent-primary, #1f6feb);
  font-weight: 700;
  height: 14px;
}
.accent-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.accent-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.accent-swatch.active {
  border-color: #fff;
  transform: scale(1.15);
}
.accent-swatch:hover {
  transform: scale(1.1);
}
.accent-custom-swatch {
  background: var(--surface);
  border: none;
  color: var(--muted);
}
.custom-color-picker {
  width: 220px;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(35, 35, 35, 0.72);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
}
.custom-color-native {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.custom-color-native input {
  width: 52px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}
.custom-color-native input::-webkit-color-swatch-wrapper {
  padding: 3px;
}
.custom-color-native input::-webkit-color-swatch {
  border: 0;
  border-radius: 5px;
}
.custom-color-hex-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.custom-color-hex-row input {
  min-width: 0;
  flex: 1;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  color: var(--text);
  font:
    13px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.custom-color-preview {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: #1f6feb;
}
.custom-color-apply {
  border: 0;
  border-radius: 9px;
  padding: 9px 10px;
  background: var(--accent-primary, #1f6feb);
  color: #fff;
  font: 700 13px inherit;
  cursor: pointer;
  transition:
    filter 0.15s,
    transform 0.15s;
}
.custom-color-apply:hover {
  filter: brightness(1.08);
}

/* ── Notifications panel ─────────────────────────────────── */
.notif-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045) !important;
  border: none !important;
  border-bottom: none !important;
  transition: background 0.15s ease;
}
.notif-row:hover {
  background: rgba(255, 255, 255, 0.075) !important;
}
.notif-row:last-child {
  margin-bottom: 0;
  border-bottom: none !important;
}
.notif-label {
  font-size: 13px;
  color: var(--text);
}
.notif-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}
.notif-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.notif-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: 0.2s;
}
.notif-slider:before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.notif-toggle input:checked + .notif-slider {
  background: var(--accent-primary, #1f6feb);
}
.notif-toggle input:checked + .notif-slider:before {
  transform: translateX(16px);
}

/* ── Theme overrides ─────────────────────────────────────────────── */
body.theme-midnight,
html[data-theme="midnight"] body,
:root:has(body.theme-midnight) {
  --bg: #060607;
  --sidebar-bg: #060607;
  --surface: #0e0f12;
  --surface2: #141519;
  --border: #1c1d22;
  --text: #e8e8e8;
  --muted: #888888;
  --user-bubble: #131418;
  --user-text: #e8e8e8;
  --ai-bubble: #090a0d;
  --ai-border: #18191f;
}
html[data-theme="midnight"] {
  --bg: #060607;
  --surface: #0e0f12;
  --surface2: #141519;
  --border: #1c1d22;
  --text: #e8e8e8;
}
body.theme-midnight #sidebar,
html[data-theme="midnight"] #sidebar {
  background: var(--bg) !important;
}
body.theme-light,
html[data-theme="light"] body,
:root:has(body.theme-light) {
  --bg: #eaedf1;
  --sidebar-bg: #dfe3e8;
  --surface: #dfe3e8;
  --surface2: #d3d8df;
  --border: #c6ccd5;
  --text: #111418;
  --muted: #5e6673;
  --accent: #374151;
  --accent2: #1f2937;
  --user-bubble: #d5dae2;
  --user-text: #111418;
  --ai-bubble: transparent;
  --ai-border: transparent;
}
html[data-theme="light"] {
  --bg: #eaedf1;
  --surface: #dfe3e8;
  --surface2: #d3d8df;
  --border: #c6ccd5;
  --text: #111418;
}

/* ── Light Theme Sidebar ── */
body.theme-light #sidebar,
html[data-theme="light"] #sidebar {
  background: var(--sidebar-bg) !important;
  border-right: 1px solid var(--border) !important;
}

body.theme-light #sidebar::after,
html[data-theme="light"] #sidebar::after {
  background: var(--border) !important;
  opacity: 1 !important;
}

body.theme-light .sb-logo,
html[data-theme="light"] .sb-logo {
  color: #111418 !important;
}

body.theme-light .sb-toggle,
html[data-theme="light"] .sb-toggle {
  color: #5e6673 !important;
}
body.theme-light .sb-toggle:hover,
html[data-theme="light"] .sb-toggle:hover {
  background: var(--surface2) !important;
  color: #111418 !important;
}

body.theme-light .new-chat-btn,
html[data-theme="light"] .new-chat-btn {
  color: #111418 !important;
}
body.theme-light .new-chat-btn svg,
html[data-theme="light"] .new-chat-btn svg,
body.theme-light .new-chat-btn span,
html[data-theme="light"] .new-chat-btn span {
  color: #111418 !important;
}
body.theme-light .new-chat-btn:hover,
html[data-theme="light"] .new-chat-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111418 !important;
}

body.theme-light .sb-nav-btn,
html[data-theme="light"] .sb-nav-btn {
  color: #111418 !important;
}
body.theme-light .sb-nav-btn svg,
html[data-theme="light"] .sb-nav-btn svg,
body.theme-light .sb-nav-btn span,
html[data-theme="light"] .sb-nav-btn span {
  color: #111418 !important;
}
body.theme-light .sb-nav-btn:hover,
html[data-theme="light"] .sb-nav-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111418 !important;
}
body.theme-light .sb-nav-btn.active,
html[data-theme="light"] .sb-nav-btn.active {
  background: rgba(0, 0, 0, 0.09) !important;
  color: #111418 !important;
}

body.theme-light .sb-divider,
html[data-theme="light"] .sb-divider {
  background: var(--border) !important;
}

body.theme-light .sb-section-label,
body.theme-light .pinned-label,
body.theme-light .recents-label,
html[data-theme="light"] .sb-section-label,
html[data-theme="light"] .pinned-label,
html[data-theme="light"] .recents-label {
  color: #6b7280 !important;
}

body.theme-light .conv-item,
html[data-theme="light"] .conv-item {
  color: #111418 !important;
}
body.theme-light .conv-title,
html[data-theme="light"] .conv-title {
  color: #374151 !important;
}
body.theme-light .conv-item:hover,
html[data-theme="light"] .conv-item:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}
body.theme-light .conv-item:hover .conv-title,
body.theme-light .conv-item.active .conv-title,
body.theme-light .conv-item.menu-open .conv-title,
html[data-theme="light"] .conv-item:hover .conv-title,
html[data-theme="light"] .conv-item.active .conv-title,
html[data-theme="light"] .conv-item.menu-open .conv-title {
  color: #111418 !important;
}
body.theme-light .conv-item.active,
html[data-theme="light"] .conv-item.active {
  background: rgba(0, 0, 0, 0.08) !important;
}

body.theme-light .conv-menu-btn,
html[data-theme="light"] .conv-menu-btn {
  color: #5e6673 !important;
}
body.theme-light .conv-menu-btn:hover,
html[data-theme="light"] .conv-menu-btn:hover {
  background: var(--surface2) !important;
  color: #111418 !important;
}

body.theme-light .sb-footer,
html[data-theme="light"] .sb-footer {
  border-top: 1px solid var(--border) !important;
}
body.theme-light .profile-row,
html[data-theme="light"] .profile-row {
  color: #111418 !important;
}
body.theme-light .profile-name,
html[data-theme="light"] .profile-name {
  color: #111418 !important;
}
body.theme-light #settings-btn,
html[data-theme="light"] #settings-btn {
  color: #5e6673 !important;
}
body.theme-light #settings-btn:hover,
html[data-theme="light"] #settings-btn:hover {
  color: #111418 !important;
  background: var(--surface2) !important;
}
body.theme-light #settings-btn svg,
html[data-theme="light"] #settings-btn svg {
  color: currentColor !important;
}

body.theme-light #sidebar.collapsed .sb-toggle,
body.theme-light #sidebar.collapsed .new-chat-btn,
body.theme-light #sidebar.collapsed .sb-search-collapsed-btn,
body.theme-light #sidebar.collapsed .sb-footer-btn,
html[data-theme="light"] #sidebar.collapsed .sb-toggle,
html[data-theme="light"] #sidebar.collapsed .new-chat-btn,
html[data-theme="light"] #sidebar.collapsed .sb-search-collapsed-btn,
html[data-theme="light"] #sidebar.collapsed .sb-footer-btn {
  color: #111418 !important;
}

/* ── Light Theme User Message Bubbles & Actions ── */
body.theme-light .message.user .bubble,
html[data-theme="light"] .message.user .bubble {
  background: #d5dae2 !important;
  color: #111418 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.theme-light .message.user.editing .bubble,
html[data-theme="light"] .message.user.editing .bubble {
  background: #d5dae2 !important;
  box-shadow: 0 0 0 1.5px #2563eb !important;
}

body.theme-light .user-edit-input,
html[data-theme="light"] .user-edit-input {
  color: #111418 !important;
}

body.theme-light .user-edit-btn.cancel,
html[data-theme="light"] .user-edit-btn.cancel {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #4b5563 !important;
}
body.theme-light .user-edit-btn.cancel:hover,
html[data-theme="light"] .user-edit-btn.cancel:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  color: #111827 !important;
}

body.theme-light .user-msg-action-btn,
body.theme-light button.user-msg-action-btn,
html[data-theme="light"] .user-msg-action-btn,
html[data-theme="light"] button.user-msg-action-btn {
  color: #5e6673 !important;
}
body.theme-light .user-msg-action-btn:hover,
html[data-theme="light"] .user-msg-action-btn:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #111418 !important;
}

/* ── Light Theme AI Bubbles & Content ── */
body.theme-light .message.ai .bubble,
body.theme-light .message.assistant .bubble,
html[data-theme="light"] .message.ai .bubble,
html[data-theme="light"] .message.assistant .bubble {
  color: #111418 !important;
}

body.theme-light .message.ai .bubble p,
body.theme-light .message.ai .bubble li,
body.theme-light .message.ai .bubble span,
html[data-theme="light"] .message.ai .bubble p,
html[data-theme="light"] .message.ai .bubble li,
html[data-theme="light"] .message.ai .bubble span {
  color: #111418;
}

body.theme-light .message.ai .bubble code:not(pre code),
html[data-theme="light"] .message.ai .bubble code:not(pre code) {
  background: #dfe3e8 !important;
  color: #0f172a !important;
}

/* ── Light Theme Controls, Buttons & Inputs ── */
body.theme-light #user-input,
html[data-theme="light"] #user-input {
  color: #111418 !important;
}
body.theme-light #user-input::placeholder,
html[data-theme="light"] #user-input::placeholder {
  color: #7b8390 !important;
}

body.theme-light #plus-btn,
html[data-theme="light"] #plus-btn {
  background: #e2e5ea !important;
  border: 1px solid #c6ccd5 !important;
  color: #111418 !important;
}
body.theme-light #plus-btn:hover,
html[data-theme="light"] #plus-btn:hover {
  background: #d5dae2 !important;
}
body.theme-light #plus-btn svg,
html[data-theme="light"] #plus-btn svg {
  stroke: #111418 !important;
  color: #111418 !important;
}

body.theme-light .disclaimer,
html[data-theme="light"] .disclaimer {
  color: #7b8390 !important;
}
body.theme-light .welcome-typewriter-text,
html[data-theme="light"] .welcome-typewriter-text {
  background: linear-gradient(90deg, #1a1a1a, #3a3a3a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Mobile layout ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Sidebar: slides in/out off-screen */
  html.mobile-sidebar-preload-closed #sidebar {
    transform: translateX(-100%) !important;
    transition: none !important;
  }
  #sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    height: 100dvh !important;
    z-index: 200 !important;
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(12, 12, 16, 0.38) !important;
    backdrop-filter: blur(28px) saturate(1.6) !important;
    -webkit-backdrop-filter: blur(28px) saturate(1.6) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: 10px 0 32px rgba(0, 0, 0, 0.3) !important;
    pointer-events: auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  #sidebar:not(.collapsed) {
    transform: translateX(0);
  }
  #sidebar.collapsed {
    transform: translateX(-100%);
  }
  #main {
    margin-left: 0 !important;
  }

  /* Topbar: padded below iOS safe area */
  #mobile-topbar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 150 !important;
    height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    padding: env(safe-area-inset-top, 0px) 16px 0 16px !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    background: transparent !important;
    border-bottom: none !important;
    pointer-events: none !important;
  }
  #mobile-topbar > * {
    pointer-events: auto !important;
  }

  /* Sidebar toggle circle button - no border, larger */
  #mobile-sidebar-fab {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    background: rgba(255, 255, 255, 0.09) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    cursor: pointer !important;
    color: #ffffff !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition:
      opacity 0.2s,
      background 0.15s,
      transform 0.15s !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
  }
  #mobile-sidebar-fab:active {
    background: rgba(255, 255, 255, 0.18) !important;
    transform: scale(0.88) !important;
  }
  #mobile-sidebar-fab svg {
    width: 20px !important;
    height: 20px !important;
  }
  /* Hide FAB pill when sidebar is open */
  #sidebar:not(.collapsed) ~ #main #mobile-sidebar-fab {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Action circle button - no border, larger */
  #mobile-action-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.09) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    overflow: hidden !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
  }
  #mobile-ghost-btn,
  #mobile-topbar-dots {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition:
      background 0.15s,
      color 0.15s,
      transform 0.15s !important;
    font-family: inherit !important;
  }
  #mobile-ghost-btn:hover,
  #mobile-topbar-dots:hover {
    background: transparent !important;
  }
  #mobile-ghost-btn.active,
  #mobile-ghost-btn:focus,
  #mobile-ghost-btn:active {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    transform: scale(0.95);
  }
  body:not(.theme-light) #mobile-ghost-btn.active svg,
  html:not([data-theme="light"]) #mobile-ghost-btn.active svg {
    color: #f4f4f5 !important;
  }
  #mobile-ghost-btn svg {
    width: 20px !important;
    height: 20px !important;
  }
  .mobile-pill-sep {
    display: none !important;
  }

  /* Hide desktop ghost btn and push chat below topbar */
  #ghost-mode-btn {
    display: none !important;
  }
  #main:not(.has-welcome) #chat-window {
    padding-top: calc(54px + env(safe-area-inset-top, 0px)) !important;
  }
  #main.has-welcome #chat-window {
    padding-top: 0 !important;
  }
  #connections-page {
    display: none !important;
  }
  body.on-connections-page #connections-page {
    display: block !important;
    flex: 1 1 100% !important;
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 120px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 10;
  }

  body.on-connections-page #mobile-action-pill,
  body.on-connections-page #mobile-ghost-btn,
  body.on-connections-page #ghost-mode-btn {
    display: none !important;
  }

  /* Note: #settings-popup mobile layout is defined authoritatively at the end of this file */
  #settings-blur-backdrop {
    display: none !important;
  }

  /* Mobile bubble formatting: natural rounded bubble instead of elongated capsule */
  .message.user .bubble {
    border-radius: 20px 20px 6px 20px !important;
    padding: 10px 16px !important;
    max-width: 86% !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
  }
  .message.user.editing .bubble {
    border-radius: 18px !important;
    padding: 8px 14px !important;
    max-width: 90% !important;
  }

  /* Unblock fluid vertical scrolling on mobile */
  #chat-window {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: auto !important;
  }
  .conv-list {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: auto !important;
  }

  /* Remove blooket frame on mobile */
  #celo-public-entry-frame,
  #celo-public-entry-frame iframe {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Settings detail on mobile: full-screen, matching back and close buttons */
  .settings-detail-screen {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    z-index: 10005 !important;
    background: #0e0e10 !important;
    display: none !important;
    opacity: 0;
    pointer-events: none !important;
    transform: none;
  }
  .settings-detail-screen.open {
    display: flex !important;
    pointer-events: auto !important;
    animation: celoPageSlideIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }
  .settings-detail-screen.closing {
    display: flex !important;
    pointer-events: none !important;
    animation: celoPageSlideOut 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
  }
  .settings-detail-screen.swiping-down {
    display: flex !important;
    pointer-events: auto !important;
    animation: none !important;
    border-top-left-radius: 32px !important;
    border-top-right-radius: 32px !important;
    overflow: hidden !important;
    will-change: transform, opacity, border-radius !important;
  }
  .settings-detail-backdrop {
    display: none !important;
  }
  .settings-detail-box {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    background: #0e0e10 !important;
    box-shadow: none !important;
    margin: 0 !important;
    transform: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .settings-detail-screen.open.visible .settings-detail-box {
    transform: none !important;
  }
  .settings-detail-layout {
    height: 100% !important;
    max-height: none !important;
    display: block !important;
  }
  .settings-detail-close {
    position: absolute !important;
    top: calc(14px + env(safe-area-inset-top, 0px)) !important;
    right: 16px !important;
    z-index: 10 !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
    border: none !important;
    outline: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--muted, #a1a1aa) !important;
    cursor: pointer !important;
    display: grid !important;
    place-items: center !important;
    place-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    box-sizing: border-box !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .settings-detail-close svg {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
    pointer-events: none !important;
    margin: auto !important;
  }
  .settings-detail-close:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
  }
  .settings-detail-close:active {
    background: rgba(239, 68, 68, 0.24) !important;
    color: #ef4444 !important;
    transform: scale(0.94) !important;
  }
  .settings-detail-back {
    position: absolute !important;
    top: calc(14px + env(safe-area-inset-top, 0px)) !important;
    left: 16px !important;
    z-index: 10 !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
    border: none !important;
    outline: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--muted, #a1a1aa) !important;
    cursor: pointer !important;
    display: grid !important;
    place-items: center !important;
    place-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    box-sizing: border-box !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .settings-detail-back svg {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
    pointer-events: none !important;
    margin: auto !important;
    transition: stroke 0.2s ease !important;
  }
  .settings-detail-back:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
  }
  .settings-detail-back:active {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
    transform: scale(0.94) !important;
  }
  .settings-sidenav {
    display: none !important;
  }
  .settings-detail-content {
    height: 100% !important;
    box-sizing: border-box !important;
    padding: calc(60px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .settings-title {
    font-size: 20px;
    margin-bottom: 16px;
  }
  .settings-sub {
    font-size: 13px;
    margin-bottom: 18px;
  }
  .settings-item {
    padding: 13px 10px;
  }
  .settings-textarea {
    font-size: 16px;
  }
  .theme-cards,
  .font-cards {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .theme-card,
  .font-card {
    flex: 1 1 calc(33.333% - 8px) !important;
    min-width: 80px !important;
    box-sizing: border-box !important;
  }
  .custom-color-picker {
    position: fixed !important;
    z-index: 10025 !important;
  }
}

/* Hide mobile elements on desktop & enforce desktop genie/modal settings */
@media (min-width: 641px) {
  #mobile-topbar {
    display: none !important;
  }
  #mobile-ghost-btn {
    display: none !important;
  }
  .settings-mobile-category {
    display: none !important;
  }
  #settings-popup.settings-popup {
    transform-origin: center center !important;
    border: none !important;
    border-width: 0 !important;
  }
  .settings-detail-screen {
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
  }
  .settings-detail-box {
    width: min(580px, calc(100vw - 40px)) !important;
    min-width: min(580px, calc(100vw - 40px)) !important;
    max-width: min(580px, calc(100vw - 40px)) !important;
    height: min(520px, 86vh) !important;
    min-height: min(520px, 86vh) !important;
    max-height: min(520px, 86vh) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: 20px !important;
    border: none !important;
    border-width: 0 !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75) !important;
    transform: none !important;
    transition: opacity 0.22s ease !important;
  }
  .settings-detail-screen.open.visible .settings-detail-box {
    transform: none !important;
  }
  .settings-detail-screen.closing .settings-detail-box {
    opacity: 0 !important;
    transform: none !important;
    transition: opacity 0.15s ease-out !important;
  }
  .settings-detail-screen.closing .settings-detail-backdrop {
    opacity: 0 !important;
    backdrop-filter: blur(0px) !important;
    -webkit-backdrop-filter: blur(0px) !important;
    background: rgba(0, 0, 0, 0) !important;
    transition: opacity 0.12s ease-out, backdrop-filter 0.12s ease-out, -webkit-backdrop-filter 0.12s ease-out, background 0.12s ease-out !important;
    pointer-events: none !important;
  }
  .settings-detail-layout {
    display: flex !important;
    flex-direction: row !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }
  .settings-sidenav {
    display: flex !important;
    flex-direction: column !important;
    width: 180px !important;
    flex-shrink: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }
  .settings-community-link {
    margin-top: auto !important;
    flex-shrink: 0 !important;
  }
  .settings-detail-content {
    flex: 1 1 0% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }
}

/* ── Connections Panel ─────────────────────────────────────── */
.connections-panel {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.connections-panel.open {
  transform: translateX(0);
}
.connections-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.connections-back {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
}
.connections-back:hover {
  background: var(--surface);
}
.connections-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.connections-list {
  display: none !important;
}
.conn-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.conn-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  overflow: hidden;
}
.conn-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.conn-info {
  flex: 1;
  min-width: 0;
}
.conn-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.conn-desc {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}
.conn-badge {
  font-size: 10px;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.conn-badge-on {
  background: rgba(31, 111, 235, 0.15);
  color: #3b82f6;
}
.conn-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.conn-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.conn-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 20px;
  transition: 0.2s;
}
.conn-slider:before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.conn-toggle input:checked + .conn-slider {
  background: var(--accent-primary, #1f6feb);
}
.conn-toggle input:checked + .conn-slider:before {
  transform: translateX(16px);
}

/* ── Sidebar nav button (below new-chat) ─────────────────── */
.sb-nav-btn {
  color: #ffffff !important;
  border-radius: 20px !important;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-radius 0.18s ease;
}
.sb-nav-btn:hover,
.sb-nav-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border-radius: 20px !important;
}
.sb-nav-btn.active,
.sb-nav-btn:active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border-radius: 20px !important;
}
#sidebar.collapsed .sb-nav-btn span {
  opacity: 0 !important;
  max-width: 0 !important;
  pointer-events: none !important;
}

/* ── Connections main page cards ─────────────────────────── */
#connections-page {
  display: none !important;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 36px 24px 80px 24px;
  width: 100%;
  max-width: 890px;
  margin: 0 auto;
  box-sizing: border-box;
}

body.on-connections-page #connections-page {
  display: block !important;
}
#connections-page.connections-page-fade-in {
  animation: celoFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
#connections-page.connections-page-fade-out {
  animation: celoFadeOut 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

#connections-page::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

#connections-page::-webkit-scrollbar-thumb,
#connections-page::-webkit-scrollbar-track {
  background: transparent !important;
}

.connections-page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 4px 4px 0 4px;
  flex-wrap: wrap;
}

.connections-page-header {
  flex: 1;
  min-width: 240px;
}

.connections-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 7px 14px;
  width: 220px;
  max-width: 100%;
  color: var(--muted);
  transition: all 0.15s ease;
}

.connections-search-wrap:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.connections-search-wrap input {
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  width: 100%;
}

.connections-search-wrap input::placeholder {
  color: var(--muted);
}

.connections-category-section {
  margin-bottom: 24px;
}

.connections-page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 6px 0;
}

.connections-page-subtitle {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.connections-category-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 4px 14px 4px !important;
  display: block;
}

.connections-category-title:first-of-type {
  margin-top: 10px !important;
}

.connections-page-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
}

@media (max-width: 680px) {
  .connections-page-grid {
    grid-template-columns: 1fr;
  }
}

.conn-page-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.035) !important;
  backdrop-filter: blur(20px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 16px;
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
  transition: none !important;
}

.conn-page-card:hover {
  background: rgba(255, 255, 255, 0.035) !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
}

body.theme-light .conn-page-card {
  background: rgba(0, 0, 0, 0.035) !important;
  border: none !important;
  box-shadow: none !important;
}

body.theme-light .conn-page-card:hover {
  background: rgba(0, 0, 0, 0.035) !important;
  border: none !important;
  box-shadow: none !important;
}

.conn-page-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05) !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}
.conn-page-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
#connections-page.connections-enter .conn-page-card {
  opacity: 0;
  transform: translateY(8px) scale(0.99);
  animation: connectionCardIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--connection-delay, 0.02s);
  will-change: opacity, transform;
}
@keyframes connectionCardIn {
  to {
    opacity: 1;
    transform: none;
  }
}
.conn-page-info {
  flex: 1;
  min-width: 0;
}
.conn-page-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.conn-page-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Cookie consent banner (Celo Theme) ─────────────────────── */
.cookie-consent {
  position: fixed;
  right: 20px;
  left: auto;
  bottom: 20px;
  z-index: 10000;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: rgba(18, 20, 24, 0.88) !important;
  backdrop-filter: blur(28px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.4) !important;
  border: none !important;
  border-radius: 20px !important;
  padding: 20px 20px 18px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55) !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.cookie-consent.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.cookie-consent-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cookie-consent-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cookie-consent-title {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.cookie-consent-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
}
.cookie-consent-text p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.cookie-consent-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  width: 100%;
}
.cookie-btn {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  height: 38px;
  padding: 0 16px !important;
  border-radius: 99px !important;
  border: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  transition: all 0.18s ease !important;
}
.cookie-btn-primary {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.cookie-btn-primary:hover {
  background: var(--accent-primary-hover, var(--accent-primary)) !important;
}
.cookie-btn-outline {
  background: rgba(255, 255, 255, 0.08) !important;
  border: none !important;
  color: var(--text) !important;
}
.cookie-btn-outline:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
}

body.theme-light .cookie-consent,
html[data-theme="light"] body .cookie-consent {
  background: rgba(255, 255, 255, 0.92) !important;
  border: none !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12) !important;
}
body.theme-light .cookie-btn-outline,
html[data-theme="light"] body .cookie-btn-outline {
  background: rgba(0, 0, 0, 0.06) !important;
  border: none !important;
  color: var(--text) !important;
}
body.theme-light .cookie-btn-outline:hover,
html[data-theme="light"] body .cookie-btn-outline:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  color: #000000 !important;
}
body.theme-light .cookie-consent-icon,
html[data-theme="light"] body .cookie-consent-icon {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}
body.theme-light .cookie-btn-outline,
html[data-theme="light"] body .cookie-btn-outline {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: var(--text) !important;
}
body.theme-light .cookie-btn-outline:hover,
html[data-theme="light"] body .cookie-btn-outline:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  border-color: rgba(0, 0, 0, 0.16) !important;
}
.guest-login-cta {
  cursor: default;
}
.guest-login-cta strong,
.guest-login-cta span {
  cursor: default;
}

.chat-search-box {
  background: rgba(30, 30, 30, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(28px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.4) !important;
}
.chat-search-results {
  margin-top: 14px;
}
#chat-window:has(> .chat-load-indicator) {
  background: radial-gradient(
    ellipse 70% 78% at 50% 50%,
    color-mix(in srgb, var(--accent-primary, #1f6feb) 17%, transparent) 0%,
    color-mix(in srgb, var(--accent-primary, #1f6feb) 7%, transparent) 44%,
    transparent 82%
  );
}
#main:not(.has-welcome) {
  background:
    radial-gradient(
      720px 440px at 50% -160px,
      color-mix(in srgb, var(--accent-primary, #4a68de) 26%, transparent) 0%,
      color-mix(in srgb, var(--accent-primary, #4a68de) 11%, transparent) 45%,
      transparent 70%
    ),
    var(--bg);
}
#main:not(.has-welcome) #chat-window {
  background: transparent;
}
.ctx-menu {
  background: rgba(35, 35, 35, 0.38) !important;
  border: 0 !important;
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
}
.ctx-menu button:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}
.profile-editor-avatar {
  width: 112px;
  height: 112px;
  margin: 4px auto 22px;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
}
.profile-editor-avatar:hover,
.profile-editor-avatar.drag-over {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
  border: none !important;
  outline: none !important;
}
.profile-avatar-drop-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}
.profile-avatar-drop-overlay svg {
  width: 38px;
  height: 38px;
  color: #ffffff;
  stroke: #ffffff;
  stroke-width: 2.2;
}
.profile-editor-avatar:hover .profile-avatar-drop-overlay,
.profile-editor-avatar.drag-over .profile-avatar-drop-overlay {
  opacity: 1;
}
.profile-editor-avatar img {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: none !important;
}
.profile-editor-avatar span {
  position: absolute;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
}
.profile-photo-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  animation: fadeInPhotoActions 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInPhotoActions {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.profile-confirm-btn {
  padding: 8px 18px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  background: var(--accent-primary, #1f6feb) !important;
  color: #ffffff !important;
  border: none !important;
  transition: opacity 0.15s ease, transform 0.15s ease !important;
}
.profile-confirm-btn:hover {
  opacity: 0.92 !important;
}
.profile-cancel-btn {
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, rgba(255, 255, 255, 0.65));
  border: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.profile-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text, #ffffff);
}
@keyframes modalShake {
  0%, 100% {
    translate: 0 0;
    transform: translateX(0);
  }
  15%, 45%, 75% {
    translate: -8px 0;
    transform: translateX(-8px);
  }
  30%, 60%, 90% {
    translate: 8px 0;
    transform: translateX(8px);
  }
}
.shake-modal {
  animation: modalShake 0.42s ease-in-out !important;
  transition: none !important;
}
.profile-input-wrap {
  position: relative;
  height: 42px;
  box-sizing: border-box;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  transition: background 0.18s ease, box-shadow 0.18s ease !important;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
}
.profile-input-wrap:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border: none !important;
  border-width: 0 !important;
}
.profile-input-wrap:focus-within {
  background: rgba(255, 255, 255, 0.07) !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.2) !important;
}
.profile-name-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 10px 52px 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  -webkit-user-select: text;
  user-select: text;
}
.profile-name-input::placeholder {
  color: var(--muted);
}
.profile-char-count {
  position: absolute;
  right: 12px;
  font-size: 10.5px;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
  font-family: inherit;
}
.profile-char-count.overlimit {
  color: #ef4444;
}
body.theme-light .profile-input-wrap,
html[data-theme="light"] .profile-input-wrap {
  background: rgba(0, 0, 0, 0.04) !important;
  border: none !important;
  border-width: 0 !important;
}
body.theme-light .profile-input-wrap:hover,
html[data-theme="light"] .profile-input-wrap:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  border: none !important;
  border-width: 0 !important;
}
.settings-floating-confirm,
.profile-floating-confirm {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 6px 6px 16px;
  background: rgba(22, 22, 24, 0.95);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  border-radius: 16px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.75) !important;
  max-width: calc(100% - 32px);
  box-sizing: border-box;
  animation: slideUpFloatingConfirm 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
  overflow: hidden;
}
@keyframes slideUpFloatingConfirm {
  from {
    transform: translate(-50%, 24px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
}
@keyframes slideDownFloatingConfirm {
  from {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(-50%, 24px) scale(0.96);
    opacity: 0;
  }
}
.settings-floating-confirm.hiding,
.profile-floating-confirm.hiding {
  animation: slideDownFloatingConfirm 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  pointer-events: none !important;
}
.settings-floating-text,
.profile-floating-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #fff);
  white-space: nowrap;
}
.settings-floating-actions,
.profile-floating-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.settings-floating-cancel-btn,
.profile-floating-cancel-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 32px !important;
  padding: 0 16px !important;
  border-radius: 9999px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text, #cbd5e1) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  cursor: pointer !important;
  font-family: inherit !important;
  transition: all 0.16s ease !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}
.settings-floating-cancel-btn:hover,
.profile-floating-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
}
.settings-floating-confirm-btn,
.profile-floating-confirm-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 32px !important;
  padding: 0 18px !important;
  border-radius: 9999px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  background: var(--accent-primary, #1f6feb) !important;
  color: #fff !important;
  border: none !important;
  cursor: pointer !important;
  font-family: inherit !important;
  transition: all 0.16s ease !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  position: relative !important;
  overflow: hidden !important;
}
.settings-floating-confirm-btn:hover,
.profile-floating-confirm-btn:hover {
  background: var(--accent-primary-hover, #1a60d6) !important;
  opacity: 0.95;
}
.settings-floating-confirm-btn.saving,
.profile-floating-confirm-btn.saving {
  pointer-events: none !important;
  color: transparent !important;
  position: relative !important;
}
.settings-floating-confirm-btn.saving::before,
.profile-floating-confirm-btn.saving::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: inherit !important;
  overflow: hidden !important;
  transform: none !important;
}
.settings-floating-confirm-btn.saving::after,
.profile-floating-confirm-btn.saving::after {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  margin-top: 0 !important;
  height: 100% !important;
  width: 45% !important;
  background: rgba(255, 255, 255, 0.35) !important;
  border-radius: inherit !important;
  box-shadow: none !important;
  animation: btnProgressBarIndeterminate 1.15s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
}
@keyframes btnProgressRunner {
  0% {
    left: calc(50% - 27px);
    width: 0;
  }
  50% {
    left: calc(50% - 14px);
    width: 36px;
  }
  100% {
    left: calc(50% + 27px);
    width: 0;
  }
}

/* ── Universal Indeterminate Progress Bar for Buttons ── */
.btn-progress-bar {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: inherit !important;
  overflow: hidden !important;
  margin: 0 !important;
  pointer-events: none !important;
}
.btn-progress-bar .btn-progress-line {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  height: 100% !important;
  width: 45% !important;
  background: rgba(255, 255, 255, 0.35) !important;
  border-radius: inherit !important;
  box-shadow: none !important;
  animation: btnProgressBarIndeterminate 1.15s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
}
@keyframes btnProgressBarIndeterminate {
  0% {
    left: -45%;
    width: 45%;
  }
  50% {
    left: 25%;
    width: 65%;
  }
  100% {
    left: 100%;
    width: 45%;
  }
}

/* ── Red Floating Error Popup for Login / Auth (Top Notification) ── */
.auth-floating-error {
  position: fixed !important;
  top: 24px !important;
  bottom: auto !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 100020 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 26px;
  background: rgba(30, 10, 10, 0.96) !important;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  border-radius: 9999px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.75), 0 0 24px rgba(239, 68, 68, 0.22);
  color: #fca5a5 !important;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  white-space: nowrap;
  pointer-events: auto;
  animation: slideDownFloatingErrorTop 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.auth-floating-error.hiding {
  animation: slideUpFloatingErrorTop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  pointer-events: none !important;
}
@keyframes slideDownFloatingErrorTop {
  from {
    transform: translate(-50%, -28px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
}
@keyframes slideUpFloatingErrorTop {
  from {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -28px) scale(0.96);
    opacity: 0;
  }
}
body.theme-light .auth-floating-error,
html[data-theme="light"] .auth-floating-error {
  background: rgba(254, 242, 242, 0.96) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #b91c1c !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.14), 0 0 20px rgba(239, 68, 68, 0.15);
}
body.theme-light .settings-floating-confirm,
html[data-theme="light"] .settings-floating-confirm {
  background: rgba(245, 245, 247, 0.96) !important;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18) !important;
}
body.theme-light .settings-floating-text,
html[data-theme="light"] .settings-floating-text {
  color: #111827 !important;
}
body.theme-light .settings-floating-cancel-btn,
html[data-theme="light"] .settings-floating-cancel-btn {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #374151 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}
body.theme-light .settings-floating-cancel-btn:hover,
html[data-theme="light"] .settings-floating-cancel-btn:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  color: #111827 !important;
}

/* ── Completely Borderless Settings Input Boxes (API Keys, Username, Personalization) ── */
.donor-key-field,
.byok-key-field,
.profile-input-wrap,
.settings-textarea-wrap,
#settings-panel-byok .profile-input-wrap,
#settings-panel-byok .byok-key-field,
#settings-panel-byok .donor-key-field,
#settings-panel-profile .profile-input-wrap,
#settings-panel-personalization .settings-textarea-wrap,
#donor-openrouter-key,
#sidenav-byok-input,
#sidenav-byok-mistral,
#sidenav-byok-hf,
#byok-input,
#profile-username,
#personalization-input {
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  resize: none !important;
}

#settings-panel-byok .byok-key-field,
#settings-panel-byok .donor-key-field,
#settings-panel-byok .profile-input-wrap {
  height: 44px !important;
  min-height: 44px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 12px !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
}

#settings-panel-byok .byok-header-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-top: 18px !important;
  margin-bottom: 8px !important;
}

#settings-panel-byok #byok-donor-openrouter-wrap {
  margin: 0 !important;
  padding: 0 !important;
}

#settings-panel-byok #byok-donor-openrouter-wrap:not([style*="display: none"]):not([style*="display:none"]) {
  display: contents !important;
}

#settings-panel-byok .settings-status {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#settings-panel-byok .settings-status:empty,
#settings-panel-byok .settings-status:not(.key-status-visible) {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
}

.donor-key-field:hover,
.byok-key-field:hover,
.profile-input-wrap:hover,
.settings-textarea-wrap:hover,
#settings-panel-byok .profile-input-wrap:hover,
#settings-panel-byok .byok-key-field:hover,
#settings-panel-byok .donor-key-field:hover,
#settings-panel-profile .profile-input-wrap:hover,
#settings-panel-developer .profile-input-wrap:hover,
#settings-panel-developer .celoapi-key-wrap:hover,
.celoapi-key-wrap:hover,
#settings-panel-personalization .settings-textarea-wrap:hover {
  outline: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.donor-key-field:focus-within,
.byok-key-field:focus-within,
.profile-input-wrap:focus-within,
.settings-textarea-wrap:focus-within,
#settings-panel-byok .profile-input-wrap:focus-within,
#settings-panel-byok .byok-key-field:focus-within,
#settings-panel-byok .donor-key-field:focus-within,
#settings-panel-profile .profile-input-wrap:focus-within,
#settings-panel-developer .profile-input-wrap:focus-within,
#settings-panel-developer .celoapi-key-wrap:focus-within,
.celoapi-key-wrap:focus-within,
.celoapi-key-wrap:active,
#settings-panel-personalization .settings-textarea-wrap:focus-within {
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: 0 0 0 1.5px var(--accent-primary, #10b981) !important;
}

#personalization-input,
#personalization-input:focus,
#personalization-input:hover,
#celoapi-key,
#celoapi-key:focus,
#celoapi-key:hover {
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

#model-menu {
  background: rgba(35, 35, 35, 0.38) !important;
  border: 0 !important;
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
}
.model-opt:hover,
.model-opt:active {
  background: rgba(255, 255, 255, 0.06) !important;
}
.settings-community-link {
  margin-top: auto;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 8px 10px !important;
  width: 100% !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.82) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}
.settings-community-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}
.settings-community-link:hover .settings-community-text {
  color: #ffffff !important;
}
.settings-community-link:hover .discord-icon,
.settings-community-link:hover .discord-icon path {
  color: #ffffff !important;
  fill: #ffffff !important;
}
.settings-community-link .settings-community-text {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.1px !important;
  color: rgba(255, 255, 255, 0.82) !important;
  text-decoration: none !important;
  white-space: normal !important;
  cursor: pointer !important;
  flex: 1;
  transition: color 0.15s ease !important;
}
.settings-community-link .discord-icon {
  color: rgba(255, 255, 255, 0.82) !important;
  fill: rgba(255, 255, 255, 0.82) !important;
  flex-shrink: 0 !important;
  width: 16px !important;
  height: 16px !important;
  display: block !important;
  transition: color 0.15s ease, fill 0.15s ease !important;
}
.settings-community-link .discord-icon path {
  fill: rgba(255, 255, 255, 0.82) !important;
  transition: fill 0.15s ease !important;
}
body.theme-light .settings-community-link,
html[data-theme="light"] .settings-community-link {
  color: rgba(0, 0, 0, 0.72) !important;
}
body.theme-light .settings-community-link .settings-community-text,
html[data-theme="light"] .settings-community-link .settings-community-text {
  color: rgba(0, 0, 0, 0.72) !important;
}
body.theme-light .settings-community-link .discord-icon,
body.theme-light .settings-community-link .discord-icon path,
html[data-theme="light"] .settings-community-link .discord-icon,
html[data-theme="light"] .settings-community-link .discord-icon path {
  color: rgba(0, 0, 0, 0.72) !important;
  fill: rgba(0, 0, 0, 0.72) !important;
}
body.theme-light .settings-community-link:hover,
html[data-theme="light"] .settings-community-link:hover {
  background: rgba(0, 0, 0, 0.055) !important;
}
body.theme-light .settings-community-link:hover .settings-community-text,
body.theme-light .settings-community-link:hover .discord-icon,
body.theme-light .settings-community-link:hover .discord-icon path,
html[data-theme="light"] .settings-community-link:hover .settings-community-text,
html[data-theme="light"] .settings-community-link:hover .discord-icon,
html[data-theme="light"] .settings-community-link:hover .discord-icon path {
  color: #111827 !important;
  fill: #111827 !important;
}
.settings-popup,
.settings-detail-box,
.modal,
.chat-search-box,
.custom-color-picker {
  border: 0 !important;
}
.celo-btn-cancel {
  border: 0 !important;
}
body.theme-light .settings-popup,
html[data-theme="light"] .settings-popup {
  background: rgba(255, 255, 255, 0.56) !important;
  color: #1a1a1a;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
body.theme-light .settings-detail-box,
html[data-theme="light"] .settings-detail-box {
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.18);
}
body.theme-light .settings-popup .settings-sep,
html[data-theme="light"] .settings-popup .settings-sep {
  background: rgba(0, 0, 0, 0.16);
}
.settings-sidenav {
  background: rgba(255, 255, 255, 0.045);
  border-right: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.settings-sidenav-item:hover,
.settings-sidenav-item.active,
.settings-item:hover {
  background: rgba(255, 255, 255, 0.07);
}
.settings-item.danger:hover,
.settings-signout-item:hover {
  background: rgba(248, 81, 73, 0.08);
}
.auth-method-list,
.auth-inline-row,
.auth-email-row {
  background: rgba(255, 255, 255, 0.045) !important;
}
.auth-inline-row {
  border-color: rgba(255, 255, 255, 0.1);
}
.auth-password-set input,
.settings-detail-content input:not([type="color"]):not(.profile-name-input) {
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: transparent !important;
}
.custom-color-picker {
  width: 220px;
  gap: 10px;
  padding: 12px;
  background: rgba(31, 31, 31, 0.45);
}
.custom-color-native {
  width: 100%;
  height: 38px;
  padding: 3px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
.custom-color-native::-webkit-color-swatch-wrapper {
  padding: 0;
}
.custom-color-native::-webkit-color-swatch {
  border: 0;
  border-radius: 6px;
}
.custom-color-hex-row input {
  background: rgba(255, 255, 255, 0.055);
  border: 0;
}
.custom-color-preview,
.custom-color-apply {
  display: none;
}
#sidebar .sb-search input,
#sidebar.collapsed .sb-search-collapsed-btn {
  background: rgba(255, 255, 255, 0.045);
}
#sidebar .sb-search input:focus,
#sidebar.collapsed .sb-search-collapsed-btn:hover,
#sidebar .sb-search-expanded-btn:hover,
#sidebar .sb-toggle:hover {
  background: rgba(255, 255, 255, 0.09);
}
.settings-popup {
  background: rgba(31, 31, 31, 0.38) !important;
}
.settings-detail-box {
  background: rgba(31, 31, 31, 0.38);
}
.modal {
  background: rgba(31, 31, 31, 0.38);
}
body.theme-light .settings-sidenav,
html[data-theme="light"] .settings-sidenav {
  background: rgba(255, 255, 255, 0.32);
}
body.theme-light .settings-sidenav-item:hover,
body.theme-light .settings-sidenav-item.active,
body.theme-light .settings-item:hover,
html[data-theme="light"] .settings-sidenav-item:hover,
html[data-theme="light"] .settings-sidenav-item.active,
html[data-theme="light"] .settings-item:hover {
  background: rgba(0, 0, 0, 0.055);
}
body.theme-light .auth-method-list,
body.theme-light .auth-inline-row,
body.theme-light .auth-email-row,
html[data-theme="light"] .auth-method-list,
html[data-theme="light"] .auth-inline-row,
html[data-theme="light"] .auth-email-row {
  background: rgba(255, 255, 255, 0.3) !important;
}
.settings-sidenav,
.auth-method-list,
.auth-inline-row,
.auth-email-row,
.auth-password-set input,
.settings-detail-content input:not([type="color"]):not(.profile-name-input) {
  background: transparent !important;
}
.settings-sidenav-item:hover,
.settings-sidenav-item.active,
.settings-item:hover {
  background: rgba(255, 255, 255, 0.035) !important;
}
.custom-color-picker {
  width: 220px !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.custom-color-native {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px;
  padding: 0 !important;
  border-radius: 9px !important;
}
.custom-color-hex-row {
  flex: 1;
}
.custom-color-hex-row input {
  width: 100%;
}
.custom-color-native::-webkit-color-swatch-wrapper {
  padding: 3px;
}
.custom-color-native::-webkit-color-swatch {
  border-radius: 6px;
}
.settings-detail-box {
  background: rgba(31, 31, 31, 0.2) !important;
}
.settings-popup {
  background: rgba(31, 31, 31, 0.2) !important;
}
body.theme-light .settings-sidenav,
html[data-theme="light"] .settings-sidenav,
body.theme-light .auth-method-list,
body.theme-light .auth-inline-row,
body.theme-light .auth-email-row,
html[data-theme="light"] .auth-method-list,
html[data-theme="light"] .auth-inline-row,
html[data-theme="light"] .auth-email-row {
  background: transparent !important;
}
body.theme-light .settings-detail-box,
body.theme-light .settings-popup,
html[data-theme="light"] .settings-detail-box,
html[data-theme="light"] .settings-popup {
  background: rgba(255, 255, 255, 0.2) !important;
}
@media (max-width: 640px) {
  .welcome {
    max-width: 90vw !important;
    padding: 0 12px !important;
    text-align: center !important;
  }
  .welcome-typewriter {
    display: inline !important;
    font-size: 24px !important;
    line-height: 1.35 !important;
    letter-spacing: -0.25px !important;
    white-space: normal !important;
    text-align: center !important;
    word-break: break-word !important;
  }
  .welcome-typewriter-text {
    display: inline !important;
    white-space: normal !important;
    text-align: center !important;
  }
  .welcome-typewriter-caret {
    vertical-align: -0.1em;
  }
  .welcome-typewriter-caret.hidden,
  .welcome-typewriter.done .welcome-typewriter-caret {
    display: none !important;
  }
  #main.has-welcome {
    background:
      radial-gradient(
        ellipse 130% 55% at 50% 52%,
        color-mix(in srgb, var(--accent-primary, #1f6feb) 28%, transparent) 0%,
        color-mix(in srgb, var(--accent-primary, #1f6feb) 14%, transparent) 34%,
        color-mix(in srgb, var(--accent-primary, #1f6feb) 4%, transparent) 58%,
        transparent 82%
      ),
      var(--bg);
  }
  #main.has-welcome.temporary-chat {
    background:
      radial-gradient(
        ellipse 130% 55% at 50% 52%,
        rgba(122, 122, 122, 0.23) 0%,
        rgba(122, 122, 122, 0.12) 34%,
        rgba(122, 122, 122, 0.035) 58%,
        transparent 82%
      ),
      var(--bg);
  }
  .cookie-consent {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-width: none;
  }
}

/* Final glass and attachment refinements. */
#model-menu {
  background: rgba(30, 30, 30, 0.3) !important;
  border: 0 !important;
  backdrop-filter: blur(24px) saturate(1.15);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
}
#model-menu-inner {
  scrollbar-width: none;
}
#model-menu-inner::-webkit-scrollbar {
  display: none;
}
#error-toast {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box !important;
}
#error-toast .error-toast-text {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  font-size: 13.5px !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  word-break: break-word !important;
  text-align: left !important;
}
.connections-section-title {
  margin: 2px 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.connections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.connections-category-title {
  grid-column: 1/-1;
  margin: 12px 0 -2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.connections-category-title:first-child {
  margin-top: 0;
}
.connections-grid .conn-page-card {
  min-width: 0;
  height: 100%;
  margin: 0;
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}
.connections-grid .conn-page-card:hover {
  background: rgba(255, 255, 255, 0.07);
}
@media (max-width: 760px) {
  .connections-grid {
    grid-template-columns: 1fr;
  }
  .connections-category-title {
    margin-top: 8px;
  }
}
.connections-grid .conn-page-card {
  background: rgba(31, 31, 31, 0.24);
  border: 0;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}
.connections-grid .conn-page-card:hover {
  background: rgba(255, 255, 255, 0.065);
}
body.theme-light .connections-grid .conn-page-card,
html[data-theme="light"] .connections-grid .conn-page-card {
  background: rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.5);
}
body.theme-light .connections-grid .conn-page-card:hover,
html[data-theme="light"] .connections-grid .conn-page-card:hover {
  background: rgba(255, 255, 255, 0.42);
}
/* ─── Modern Sleek Unblocker Settings Page ─── */
.unblocker-card {
  background: transparent !important;
  border-radius: 16px !important;
  padding: 18px 20px !important;
  margin-top: 14px !important;
  border: none !important;
  box-shadow: none !important;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.unblocker-card-header {
  margin-bottom: 12px;
}

.unblocker-card-title {
  font-family: 'Manrope', sans-serif !important;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.unblocker-card-desc {
  font-family: 'Manrope', sans-serif !important;
  font-size: 12.5px;
  color: #8e8e93;
  line-height: 1.45;
}

.unblocker-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.unblocker-preset-chip {
  padding: 6px 12px;
  border-radius: 16px;
  border: none !important;
  background: rgba(255, 255, 255, 0.07) !important;
  color: #d1d5db;
  font-family: 'Manrope', sans-serif !important;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.unblocker-preset-chip:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff;
}

.unblocker-preset-chip.danger {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.14) !important;
}

.unblocker-preset-chip.danger:hover {
  background: rgba(239, 68, 68, 0.24) !important;
  color: #ff6b6b !important;
}

.unblocker-field-group {
  margin-bottom: 12px;
}

.unblocker-label {
  display: block;
  font-family: 'Manrope', sans-serif !important;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 6px;
}

.unblocker-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: none !important;
  outline: none !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
  font-family: 'Manrope', sans-serif !important;
  font-size: 13.5px;
  box-sizing: border-box;
  transition: background 0.15s ease;
}

.unblocker-input:focus {
  background: rgba(255, 255, 255, 0.09) !important;
}

.unblocker-input::placeholder {
  color: #6b7280;
}

.unblocker-panic-grid {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.panic-key-record-box {
  display: flex;
  align-items: center;
}

.panic-key-record-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: none !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff;
  font-family: 'Manrope', sans-serif !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.panic-key-record-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}

.panic-key-record-btn.recording {
  background: rgba(239, 68, 68, 0.2) !important;
  border: 1px solid #ef4444 !important;
  color: #ef4444 !important;
  animation: panicPulse 1s infinite alternate;
}

@keyframes panicPulse {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

#panic-key-display {
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
}

.panic-key-hint {
  font-size: 11.5px;
  color: #9ca3af;
}

.unblocker-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.unblocker-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  border: none !important;
  font-family: 'Manrope', sans-serif !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.unblocker-btn.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.unblocker-btn.danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.unblocker-btn.primary {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.unblocker-btn.primary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.unblocker-btn.launch {
  background: #a8c7fa;
  color: #041e49;
}

.unblocker-btn.launch:hover {
  background: #c2e7ff;
}
#error-toast .error-toast-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
#error-toast button {
  flex: 0 0 24px;
}
#error-toast {
  z-index: 30000 !important;
  max-width: min(660px, calc(100vw - 32px));
  align-items: center !important;
}
#error-toast .error-toast-text {
  white-space: normal !important;
  line-height: 1.35;
}
#error-toast button {
  flex-shrink: 0 !important;
}

#file-previews {
  display: none !important;
  width: 100%;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  max-height: 0;
  opacity: 0;
  line-height: 0;
  font-size: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}
#file-previews.has-files {
  display: flex !important;
  max-height: 240px;
  opacity: 1;
  line-height: normal;
  font-size: initial;
  padding: 2px 4px 6px 4px;
  margin-bottom: 2px;
  pointer-events: auto;
  visibility: visible;
  transition:
    max-height 0.24s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.18s ease,
    padding 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.file-chip.image-chip {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.file-chip.image-chip:hover img {
  filter: brightness(1.08);
}
.file-chip.image-chip:active {
  transform: scale(0.96);
}
.file-chip.image-chip img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: inherit !important;
}
.file-chip.image-chip span {
  display: none;
}
.file-chip.image-chip .file-chip-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 13px;
  line-height: 1;
}
.auth-box,
.adblock-card {
  background: rgba(31, 31, 31, 0.42) !important;
  border: 0 !important;
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
}
@media (max-width: 640px) {
  .mobile-pill-sep,
  #mobile-topbar-dots {
    display: none !important;
  }
}

/* Compact icon-only Authentication actions. */
.auth-action-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 10px !important;
}
.auth-action-btn svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── HTML5 / Web Code Execution & Artifact Live Preview ─── */
.artifact-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface2, #21262d);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border: 1px solid var(--border, #30363d);
  border-bottom: 0;
  font-size: 12px;
  color: var(--muted, #8b949e);
  user-select: none;
}
.artifact-code-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.artifact-code-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
.code-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border, #30363d);
  background: var(--surface, #161b22);
  color: var(--text, #c9d1d9);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.code-action-btn:hover {
  background: var(--surface2, #21262d);
  border-color: var(--muted, #8b949e);
}
.code-action-btn.run-btn {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent-primary, #1f6feb) 45%, transparent);
  color: color-mix(in srgb, var(--accent-primary, #1f6feb) 85%, white);
}
.code-action-btn.run-btn:hover {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 35%, transparent);
  color: #fff;
}

/* ─── Citation & Grounding Links ─── */
.chat-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #30363d);
}
.citation-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--surface2, #21262d);
  border: 1px solid var(--border, #30363d);
  color: var(--text, #c9d1d9);
  font-size: 11px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.citation-pill:hover {
  background: var(--surface, #161b22);
  border-color: var(--accent-primary, #1f6feb);
  color: var(--accent-primary, #1f6feb);
}

/* ─── Artifact Sandbox Modal ─── */
.artifact-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.artifact-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.artifact-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}
.artifact-dialog {
  position: relative;
  width: min(96vw, 1080px);
  height: min(92vh, 780px);
  background: var(--surface, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.artifact-modal.active .artifact-dialog {
  transform: scale(1);
}
.artifact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface2, #21262d);
  border-bottom: 1px solid var(--border, #30363d);
}
.artifact-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #c9d1d9);
}
.artifact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.artifact-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--surface, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 7px;
  color: var(--text, #c9d1d9);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.artifact-btn:hover {
  background: var(--surface2, #282e37);
  border-color: var(--muted, #8b949e);
}
.artifact-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #c9d1d9);
  font-size: 15px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.artifact-close-btn:hover {
  background: var(--danger, #f85149);
  color: #fff;
}
.artifact-body {
  flex: 1;
  background: #ffffff;
  position: relative;
}
.artifact-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}


/* ── Chat skeleton loader ── */
.chat-skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 16px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}
.chat-skeleton-bubble {
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-skeleton-bubble.user {
  align-self: flex-end;
  width: 45%;
  min-width: 160px;
  background: rgba(255, 255, 255, 0.05);
}
.chat-skeleton-bubble.ai {
  align-self: flex-start;
  width: 75%;
  min-width: 240px;
  background: rgba(255, 255, 255, 0.03);
}
.chat-skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.11) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 2.6s infinite linear;
}
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Transparent connections icons with accent color ── */
.conn-page-icon,
.conn-icon-wrap {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--accent-primary, #1f6feb) !important;
}
.conn-page-icon svg,
.conn-icon-wrap svg {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}


/* ── Centered reading column & spaced input bar ── */
#chat-window {
  padding: 24px 20px 16px;
  align-items: center;
}
.message {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}
.welcome {
  max-width: 780px;
  width: 100%;
}
#input-area {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 20px 10px;
  box-sizing: border-box;
}
.chat-skeleton-container {
  max-width: 780px !important;
}
@media (max-width: 640px) {
  #chat-window {
    padding: 16px 12px 10px;
  }
  #input-area {
    padding: 6px 12px 8px;
    max-width: 100%;
  }
}


/* ── Enhanced Message & Input Bar Sizing ── */
#chat-window {
  padding: 28px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.message {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}
.bubble {
  font-size: 15px;
  line-height: 1.62;
  padding: 13px 18px;
}
.message.user .bubble {
  max-width: 70%;
  min-width: 58px;
  border-radius: 20px 20px 4px 20px;
}
.message.ai .bubble {
  max-width: 86%;
  border-radius: 20px 20px 20px 4px;
}
#input-area {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 24px 12px;
  box-sizing: border-box;
}
.bar {
  padding: 10px 12px 10px 10px;
  border-radius: 28px;
  gap: 10px;
  min-height: 52px;
}
.bar.has-files {
  padding: 10px 12px 10px 10px;
}
#user-input {
  font-size: 16px;
  line-height: 1.45;
  padding: 5px 4px;
}
#plus-btn, #send-btn {
  width: 34px;
  height: 34px;
}
.chat-skeleton-container {
  max-width: 820px !important;
  padding: 28px 0 20px !important;
}
.chat-skeleton-bubble.user {
  width: 42% !important;
  padding: 16px 20px !important;
  border-radius: 20px 20px 4px 20px !important;
}
.chat-skeleton-bubble.ai {
  width: 80% !important;
  padding: 18px 22px !important;
  border-radius: 20px 20px 20px 4px !important;
}


/* ── Perfectly Centered Plus Button ── */
#plus-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease !important;
}
#plus-btn:active {
  transform: scale(0.88) !important;
}
#plus-btn .plus-h,
#plus-btn .plus-v {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  background: var(--text) !important;
  border-radius: 2px !important;
  display: block !important;
}
#plus-btn .plus-h {
  width: 14px !important;
  height: 2px !important;
  margin-top: -1px !important;
  margin-left: -7px !important;
  top: 50% !important;
  left: 50% !important;
  transform: none !important;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
#plus-btn .plus-v {
  width: 2px !important;
  height: 14px !important;
  margin-top: -7px !important;
  margin-left: -1px !important;
  top: 50% !important;
  left: 50% !important;
  transform: none !important;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
#plus-btn.active .plus-h {
  transform: rotate(45deg) !important;
}
#plus-btn.active .plus-v {
  transform: rotate(45deg) !important;
}

#plus-btn.guest-greyed,
html:not(.user-logged-in) #plus-btn,
body:not(.user-logged-in) #plus-btn {
  display: inline-flex !important;
  opacity: 0.55 !important;
  cursor: pointer !important;
  transition: opacity 0.2s ease !important;
}

#plus-btn.guest-greyed:hover,
html:not(.user-logged-in) #plus-btn:hover,
body:not(.user-logged-in) #plus-btn:hover {
  opacity: 0.85 !important;
}

html.adblock-limited #plus-btn,
html.vpn-limited #plus-btn,
html.adblock-detected #plus-btn,
html.vpn-detected #plus-btn {
  opacity: 0.35 !important;
  filter: grayscale(1) !important;
  cursor: pointer !important;
  transition: opacity 0.2s ease, filter 0.2s ease !important;
}
html.adblock-limited #plus-btn:hover,
html.vpn-limited #plus-btn:hover,
html.adblock-detected #plus-btn:hover,
html.vpn-detected #plus-btn:hover {
  opacity: 0.52 !important;
}

/* ── Smooth Gradient & Blur Transition Above Input Bar ── */
#chat-fade {
  position: relative !important;
  flex-shrink: 0 !important;
  height: 72px !important;
  margin-bottom: -72px !important;
  pointer-events: none !important;
  z-index: 2 !important;
  background: linear-gradient(to bottom, transparent 0%, rgba(17, 17, 17, 0.35) 45%, rgba(17, 17, 17, 0.9) 100%) !important;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 70%) !important;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 70%) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 0 !important;
}
body.theme-light #chat-fade,
html[data-theme="light"] #chat-fade {
  background: linear-gradient(to bottom, transparent 0%, rgba(234, 237, 241, 0.45) 45%, rgba(234, 237, 241, 0.98) 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.theme-midnight #chat-fade,
html[data-theme="midnight"] #chat-fade {
  background: linear-gradient(to bottom, transparent 0%, rgba(6, 6, 7, 0.45) 45%, rgba(6, 6, 7, 0.98) 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}


/* ── Clean, Proportional Chat Bubbles ── */
.message {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
}
.message.user {
  justify-content: flex-end;
}
.message.ai {
  justify-content: flex-start;
}
.bubble {
  font-size: 15px;
  line-height: 1.6;
  box-sizing: border-box;
  word-break: break-word;
}
.message.user .bubble {
  background: var(--user-bubble);
  color: var(--user-text);
  border-radius: 18px !important;
  padding: 10px 16px !important;
  max-width: 72% !important;
  min-width: 0 !important;
  width: fit-content !important;
  box-shadow: none;
  white-space: pre-wrap;
}
.message.ai .bubble {
  background: var(--ai-bubble);
  color: var(--text);
  border-radius: 18px !important;
  padding: 12px 18px !important;
  max-width: 86% !important;
  border: 1px solid var(--ai-border);
}


/* ── Settings Usage Panel Styles ── */
.usage-card {
  margin: 14px 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04) !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.theme-light .usage-card,
html[data-theme="light"] .usage-card {
  background: rgba(0, 0, 0, 0.02) !important;
  border: none !important;
}
.usage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.usage-plan-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(31, 111, 235, 0.18);
  color: var(--accent-primary, #3b82f6);
  margin-bottom: 6px;
}
.usage-token-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.usage-percentage {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-primary, #3b82f6);
}
.usage-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}
body.theme-light .usage-progress-bar-wrap,
html[data-theme="light"] .usage-progress-bar-wrap {
  background: rgba(0, 0, 0, 0.08);
}
.usage-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-primary, #10b981) !important;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.usage-footer-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.usage-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.usage-info-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045) !important;
  border: none !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.theme-light .usage-info-item,
html[data-theme="light"] .usage-info-item {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
.usage-info-item strong {
  font-size: 13px;
  color: var(--text);
}
.usage-info-item span {
  font-size: 12px;
  color: var(--muted);
}

/* ── Personalization Behavioral Sliders ── */
.personalization-sliders-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.pref-slider-group {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04) !important;
  border: none !important;
  box-shadow: none !important;
  transition: background 0.2s;
}

body.theme-light .pref-slider-group,
html[data-theme="light"] .pref-slider-group {
  background: rgba(0, 0, 0, 0.02) !important;
  border: none !important;
}

.pref-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pref-slider-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.pref-slider-input {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.35); /* light grey bar */
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  margin: 8px 0 6px;
  transition: background 0.2s ease;
}

body.theme-light .pref-slider-input,
html[data-theme="light"] .pref-slider-input {
  background: #cbd5e1; /* light grey bar in light theme */
}

.pref-slider-input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.35);
}

body.theme-light .pref-slider-input::-webkit-slider-runnable-track,
html[data-theme="light"] .pref-slider-input::-webkit-slider-runnable-track {
  background: #cbd5e1;
}

.pref-slider-input::-moz-range-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.35);
}

body.theme-light .pref-slider-input::-moz-range-track,
html[data-theme="light"] .pref-slider-input::-moz-range-track {
  background: #cbd5e1;
}

.pref-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--accent-primary, #10b981);
  border: 2px solid var(--bg-card, #161b22);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pref-slider-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary, #10b981);
  border: 2px solid var(--bg-card, #161b22);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pref-slider-input:active::-webkit-slider-thumb,
.pref-slider-input:hover::-webkit-slider-thumb {
  transform: scale(1.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: grabbing;
}

.pref-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted, #8b949e);
  margin-top: 5px;
  user-select: none;
}

.pref-slider-labels span {
  transition: color 0.15s ease, font-weight 0.15s ease;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.pref-slider-labels span:hover {
  color: var(--text, #ffffff);
}

.pref-slider-labels span.active {
  color: var(--accent-primary, #10b981) !important;
  font-weight: 700;
}

/* ── Enhanced Weekly Usage Styles ── */
.usage-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 480px) {
  .usage-stats-grid {
    grid-template-columns: 1fr;
  }
}

.usage-stat-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04) !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.theme-light .usage-stat-card,
html[data-theme="light"] .usage-stat-card {
  background: rgba(0, 0, 0, 0.02) !important;
  border: none !important;
}

.usage-stat-val {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.usage-stat-lbl {
  font-size: 12px;
  color: var(--muted, #8b949e);
}

/* ── Inline Chat Message Skeleton Loader ── */
.inline-skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 2px;
  min-width: 180px;
  max-width: 280px;
}
.inline-skeleton-line {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.16) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s infinite linear;
}
body.theme-light .inline-skeleton-line,
html[data-theme="light"] .inline-skeleton-line {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 25%, rgba(0, 0, 0, 0.14) 50%, rgba(0, 0, 0, 0.05) 75%);
  background-size: 200% 100%;
}


/* ── Dynamically Morphing Chat Skeleton Loader ── */
.inline-skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 2px;
  min-width: 180px;
  max-width: 320px;
  width: 100%;
}
.inline-skeleton-line {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 20%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.05) 80%);
  background-size: 250% 100%;
}
.inline-skeleton-line:nth-child(1) {
  width: 65%;
  animation: skeletonShimmer 1.4s infinite linear, skeletonMorph1 3.2s infinite ease-in-out;
}
.inline-skeleton-line:nth-child(2) {
  width: 88%;
  animation: skeletonShimmer 1.4s infinite linear, skeletonMorph2 3.8s infinite ease-in-out;
}
.inline-skeleton-line:nth-child(3) {
  width: 45%;
  animation: skeletonShimmer 1.4s infinite linear, skeletonMorph3 2.9s infinite ease-in-out;
}

@keyframes skeletonMorph1 {
  0% { width: 55%; opacity: 0.8; }
  33% { width: 85%; opacity: 1; }
  66% { width: 40%; opacity: 0.7; }
  100% { width: 55%; opacity: 0.8; }
}

@keyframes skeletonMorph2 {
  0% { width: 88%; opacity: 1; }
  33% { width: 60%; opacity: 0.75; }
  66% { width: 95%; opacity: 0.95; }
  100% { width: 88%; opacity: 1; }
}

@keyframes skeletonMorph3 {
  0% { width: 45%; opacity: 0.75; }
  33% { width: 72%; opacity: 0.9; }
  66% { width: 32%; opacity: 0.65; }
  100% { width: 45%; opacity: 0.75; }
}


/* ── Natural Single-Shape Skeleton Loaders & Trailing Shimmer ── */
.organic-skeleton-loader {
  display: inline-block;
  min-height: 28px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 20%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.05) 80%);
  background-size: 250% 100%;
  animation: skeletonShimmer 1.2s infinite linear, organicPulse 2.8s infinite ease-in-out;
}
body.theme-light .organic-skeleton-loader,
html[data-theme="light"] .organic-skeleton-loader {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 20%, rgba(0, 0, 0, 0.14) 50%, rgba(0, 0, 0, 0.05) 80%);
  background-size: 250% 100%;
}
.organic-skeleton-shape-1 {
  width: 140px;
  height: 32px;
  border-radius: 16px 16px 6px 16px;
}
.organic-skeleton-shape-2 {
  width: 220px;
  height: 36px;
  border-radius: 18px 18px 18px 6px;
}
.organic-skeleton-shape-3 {
  width: 175px;
  height: 44px;
  border-radius: 20px 14px 20px 14px;
}
.organic-skeleton-shape-4 {
  width: 260px;
  height: 32px;
  border-radius: 16px;
}

@keyframes organicPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.02); opacity: 1; }
}

.typewriter-ghost-trail {
  display: inline-block;
  vertical-align: middle;
  height: 12px;
  width: 54px;
  margin-left: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 20%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0.06) 80%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.1s infinite linear;
}
body.theme-light .typewriter-ghost-trail,
html[data-theme="light"] .typewriter-ghost-trail {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 20%, rgba(0, 0, 0, 0.16) 50%, rgba(0, 0, 0, 0.06) 80%);
  background-size: 200% 100%;
}


/* ── Full-Length Message Bubbles & Multi-Line Skeleton Loaders ── */
.message.ai .bubble {
  background: var(--ai-bubble);
  color: var(--text);
  border-radius: 18px 18px 18px 4px !important;
  padding: 14px 18px !important;
  max-width: 86% !important;
  min-width: min(320px, 80%) !important;
  width: fit-content;
  border: 1px solid var(--ai-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.full-skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px;
  width: 100%;
  min-width: 260px;
}

.full-skeleton-line {
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 20%, rgba(255, 255, 255, 0.17) 50%, rgba(255, 255, 255, 0.05) 80%);
  background-size: 250% 100%;
  animation: skeletonShimmer 2.6s infinite linear;
}

body.theme-light .full-skeleton-line,
html[data-theme="light"] .full-skeleton-line {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 20%, rgba(0, 0, 0, 0.13) 50%, rgba(0, 0, 0, 0.05) 80%);
  background-size: 250% 100%;
}

/* Multi-line trailing skeleton lines ahead of the typewriter */
.typewriter-trailing-skeleton {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 10px;
  width: 100%;
}

.typewriter-trailing-line {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 20%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.06) 80%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.1s infinite linear;
}

body.theme-light .typewriter-trailing-line,
html[data-theme="light"] .typewriter-trailing-line {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 20%, rgba(0, 0, 0, 0.15) 50%, rgba(0, 0, 0, 0.06) 80%);
  background-size: 200% 100%;
}


/* ── Clean Message Bubbles (No AI border, User message card) ── */
.message.user .bubble {
  background: var(--user-bubble);
  color: var(--user-text);
  border-radius: 18px 18px 4px 18px !important;
  padding: 13px 18px !important;
  max-width: 78% !important;
  min-width: min(160px, 60%) !important;
  width: fit-content !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: none !important;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.6;
}

.message.ai .bubble {
  background: var(--ai-bubble);
  color: var(--text);
  border-radius: 18px 18px 18px 4px !important;
  padding: 14px 18px !important;
  max-width: 86% !important;
  min-width: min(320px, 80%) !important;
  width: fit-content;
  border: none !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}


/* ── Clean Top-Only Input Bar Transition Blur ── */
#main:not(.has-welcome) #chat-window {
  padding-bottom: 25vh !important;
}

#chat-window {
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

#chat-fade {
  display: block !important;
  position: relative !important;
  flex-shrink: 0 !important;
  height: 64px !important;
  margin-top: -64px !important;
  margin-bottom: 0 !important;
  pointer-events: none !important;
  z-index: 5 !important;
  background: linear-gradient(to bottom, transparent 0%, rgba(17, 17, 17, 0.4) 40%, rgba(17, 17, 17, 0.95) 100%) !important;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 70%) !important;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 70%) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 0 !important;
}

body.theme-light #chat-fade,
html[data-theme="light"] #chat-fade {
  background: linear-gradient(to bottom, transparent 0%, rgba(234, 237, 241, 0.45) 45%, rgba(234, 237, 241, 0.98) 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.theme-midnight #chat-fade,
html[data-theme="midnight"] #chat-fade {
  background: linear-gradient(to bottom, transparent 0%, rgba(6, 6, 7, 0.45) 45%, rgba(6, 6, 7, 0.98) 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Remove blur completely on start / welcome screen */
#main.has-welcome #chat-fade {
  display: none !important;
}

.sidebar-circle-loader-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 0;
  width: 100%;
}
.sidebar-circle-loader {
  width: 22px;
  height: 22px;
  border: 2.2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent-primary, #1f6feb);
  border-radius: 50%;
  animation: sidebarSpin 0.7s linear infinite;
}
@keyframes sidebarSpin {
  to {
    transform: rotate(360deg);
  }
}
body.theme-light .sidebar-circle-loader,
html[data-theme="light"] .sidebar-circle-loader {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--accent-primary, #1f6feb);
}

.sidebar-skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px 6px;
  width: 100%;
  box-sizing: border-box;
}

body.user-guest .sidebar-skeleton-loader,
html.user-guest .sidebar-skeleton-loader {
  display: none !important;
}
.sidebar-skeleton-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.028);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
body.theme-light .sidebar-skeleton-item,
html[data-theme="light"] .sidebar-skeleton-item {
  background: rgba(0, 0, 0, 0.035);
}
.sidebar-skeleton-icon {
  display: none !important;
}
.sidebar-skeleton-text {
  height: 10px;
  border-radius: 99px !important;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 20%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0.06) 80%);
  background-size: 200% 100%;
  animation: skeletonShimmer 2.4s infinite linear !important;
}
body.theme-light .sidebar-skeleton-text,
html[data-theme="light"] .sidebar-skeleton-text {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 20%, rgba(0, 0, 0, 0.14) 50%, rgba(0, 0, 0, 0.06) 80%);
  background-size: 200% 100%;
}





/* ── Translucent Frosted Glass & Smooth Fade In/Out for All Modals & Popups ── */

/* 1. Main Action & Confirmation Modal (#modal) */
.modal-bg {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.modal-bg.open {
  display: flex !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  transform: translateZ(0);
  will-change: opacity;
  opacity: 0;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.modal-bg.open.visible .modal-backdrop {
  opacity: 1 !important;
}

.modal-bg.closing .modal-backdrop {
  opacity: 0 !important;
}

.modal {
  position: relative;
  z-index: 1;
  background: rgba(22, 24, 28, 0.55) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  border: none !important;
  outline: none !important;
  border-radius: 20px !important;
  padding: 24px 26px !important;
  width: 400px !important;
  max-width: min(92vw, 420px) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4) !important;
  opacity: 0;
  transform: scale(0.96) translateY(6px);
  will-change: transform, opacity;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.modal-bg.open.visible .modal {
  opacity: 1 !important;
  transform: scale(1) translateY(0) !important;
}

.modal-bg.closing .modal {
  opacity: 0 !important;
  transform: scale(0.96) translateY(6px) !important;
}

.modal h3 {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: var(--text, #fff) !important;
  letter-spacing: -0.2px;
  margin-bottom: 12px !important;
  text-align: left !important;
}

.modal p.modal-sub {
  font-size: 13.5px !important;
  color: var(--muted, #94a3b8) !important;
  line-height: 1.55 !important;
  text-align: left !important;
  margin-bottom: 22px !important;
}

.modal input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  color: var(--text, #fff) !important;
  font-size: 14px !important;
  outline: none;
  margin-bottom: 20px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal input:focus {
  border-color: var(--accent-primary, #1f6feb) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary, #1f6feb) 20%, transparent);
}

.modal-actions {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

.modal-btn {
  flex: none !important;
  padding: 8px 18px !important;
  border-radius: 9999px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.16s ease !important;
  font-family: inherit !important;
}

.modal-btn.cancel {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text, #cbd5e1) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 9999px !important;
}

.modal-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
}

.modal-btn.danger {
  background: var(--danger, #f85149) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 9999px !important;
}

.modal-btn.danger:hover {
  background: #e03d35 !important;
}

.modal-btn.primary {
  background: var(--accent-primary, #1f6feb) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 9999px !important;
}

.modal-btn.primary:hover {
  background: var(--accent-primary-hover, #1a60d6) !important;
}



/* 3. Model Selector Menu */
#model-menu {
  background: rgba(22, 24, 28, 0.4) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.52) !important;
}

/* 4. Context Menu (#ctx-menu) */
.ctx-menu {
  background: rgba(22, 24, 28, 0.4) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 6px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5) !important;
}

/* 5. BYOK Box */
#byok-box {
  background: rgba(26, 29, 34, 0.76) !important;
  backdrop-filter: blur(32px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(32px) saturate(1.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6) !important;
}

/* Light Theme Overrides */
body.theme-light .modal {
  background: rgba(255, 255, 255, 0.82) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12) !important;
}
body.theme-light .modal h3 {
  color: #0f172a !important;
}
body.theme-light .modal p.modal-sub {
  color: #64748b !important;
}
body.theme-light .modal input {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #0f172a !important;
}
body.theme-light .modal-btn.cancel {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #334155 !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}
body.theme-light .modal-btn.cancel:hover {
  background: rgba(0, 0, 0, 0.1) !important;
}
body.theme-light #model-menu,
body.theme-light #byok-box {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}


/* ── Remove Border on All Popups & Modals + Translucent Frosted Glass ── */
.modal,
#model-menu,
.ctx-menu,
.ai-regen-popup,
#byok-box,
.settings-popup,
.settings-detail-box,
.celo-confirm-box,
.auth-box,
.chat-search-box,
.custom-color-picker,
.artifact-dialog {
  border: none !important;
  border-width: 0 !important;
}

/* ── Boxed Options in Settings (Appearance) ── */
.theme-card,
.font-card {
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 12px !important;
  border: none !important;
  transition: background 0.15s ease, transform 0.15s ease !important;
}

.theme-card:hover,
.font-card:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.theme-card.active,
.font-card.active {
  background: rgba(255, 255, 255, 0.13) !important;
}

.accent-custom-swatch {
  background: rgba(255, 255, 255, 0.06) !important;
  border-radius: 50% !important;
}

.custom-color-picker {
  background: rgba(26, 29, 34, 0.8) !important;
  backdrop-filter: blur(32px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(32px) saturate(1.25) !important;
  border: none !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5) !important;
}

/* ── Data Control & Confirmation Popups (Instant Frosted Backdrop Animation) ── */
.celo-confirm-overlay {
  display: none !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 10020 !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  background: transparent !important;
  pointer-events: none !important;
}

.celo-confirm-overlay.open {
  display: flex !important;
  pointer-events: auto !important;
}

.celo-confirm-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  animation: confirmBackdropFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes confirmBackdropFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.celo-confirm-box {
  position: relative !important;
  z-index: 1 !important;
  background: #141517 !important;
  border: none !important;
  outline: none !important;
  border-radius: 20px !important;
  padding: 24px !important;
  width: 440px !important;
  max-width: min(92vw, 480px) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75) !important;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  animation: confirmBoxPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes confirmBoxPopIn {
  0% {
    opacity: 0;
    transform: scale(0.93) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.celo-confirm-overlay.closing {
  pointer-events: none !important;
}
.celo-confirm-overlay.closing * {
  pointer-events: none !important;
}
.celo-confirm-overlay.closing .celo-confirm-backdrop {
  animation: confirmBackdropFadeOut 0.16s ease-in forwards !important;
}

.celo-confirm-overlay.closing .celo-confirm-box {
  animation: confirmBoxPopOut 0.16s ease-in forwards !important;
}

@keyframes confirmBackdropFadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes confirmBoxPopOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.95) translateY(6px);
  }
}

.bubble.typewriter-fade-in {
  animation: none !important;
  opacity: 1 !important;
}

/* ── Redesigned Clean Red Stop Chat Button ── */
.stop-btn,
#stop-btn {
  display: none;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #ef4444 !important;
  border: none !important;
  color: #ffffff !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4) !important;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease !important;
}

.stop-btn:hover,
#stop-btn:hover {
  background: #dc2626 !important;
  transform: scale(1.06) !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5) !important;
}

.stop-btn:active,
#stop-btn:active {
  transform: scale(0.94) !important;
}

.stop-icon-inner {
  display: block;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 2px;
}

/* ── BYOK Get Key Button ── */
.byok-get-key-btn {
  display: inline-flex;
  align-items: center;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--accent-primary) !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.18s ease, color 0.18s ease, text-decoration 0.18s ease;
}

.byok-get-key-btn:hover {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--accent-primary-hover, var(--accent-primary)) !important;
  opacity: 1;
  text-decoration: underline !important;
}

.celo-confirm-title {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin-bottom: 8px !important;
  text-align: left !important;
}

.celo-confirm-bullets {
  list-style: disc !important;
  padding-left: 18px !important;
  margin: 0 0 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.celo-confirm-bullets li {
  font-family: 'Manrope', sans-serif !important;
  font-size: 13px !important;
  color: #8e8e93 !important;
  line-height: 1.5 !important;
  text-align: left !important;
}

.celo-confirm-proceed {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 13.5px !important;
  color: #8e8e93 !important;
  margin-bottom: 20px !important;
  text-align: left !important;
  line-height: 1.5 !important;
}

.celo-confirm-actions {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

.celo-btn-cancel,
.celo-confirm-btn.cancel,
.celo-btn-confirm.secondary {
  min-height: auto !important;
  padding: 8px 18px !important;
  border-radius: 9999px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  background: #27272a !important;
  color: #e4e4e7 !important;
  border: 1px solid #3f3f46 !important;
  transition: all 0.16s ease !important;
  font-family: inherit !important;
}

.celo-btn-cancel:hover,
.celo-confirm-btn.cancel:hover,
.celo-btn-confirm.secondary:hover {
  background: #3f3f46 !important;
  color: #fff !important;
  border-color: #52525b !important;
}

.celo-btn-confirm {
  min-height: auto !important;
  padding: 8px 18px !important;
  border-radius: 9999px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  border: none !important;
  transition: all 0.16s ease !important;
  font-family: inherit !important;
}

.celo-btn-confirm.danger {
  background: var(--danger, #f85149) !important;
  color: #fff !important;
  border-radius: 9999px !important;
}

.celo-btn-confirm.danger:hover {
  background: #e03d35 !important;
}

.celo-btn-confirm.primary {
  background: var(--accent-primary, #1f6feb) !important;
  color: #fff !important;
  border-radius: 9999px !important;
}

.celo-btn-confirm.primary:hover {
  background: var(--accent-primary-hover, #1a60d6) !important;
}


/* ── Desktop Welcome Typewriter Vertical Placement ── */
@media (min-width: 641px) {
  #chat-window .welcome {
    margin-top: auto !important;
    margin-bottom: 28px !important;
  }
}


/* ── Compact Weekly Usage Card (Everything Tightly Grouped) ── */
.usage-card {
  margin: 6px 0 12px !important;
  padding: 14px 16px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.theme-light .usage-card,
html[data-theme="light"] .usage-card {
  background: rgba(0, 0, 0, 0.02) !important;
  border: none !important;
}

.usage-plan-badge {
  display: none !important;
}

.usage-header {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin-bottom: 6px !important;
}

.usage-token-count {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  line-height: 1.2 !important;
}

.usage-percentage {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: var(--accent-primary, #3b82f6) !important;
  line-height: 1.2 !important;
}

.usage-progress-bar-wrap {
  width: 100% !important;
  height: 5px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  margin-bottom: 6px !important;
}

.usage-footer-info {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 11.5px !important;
  color: var(--muted) !important;
  line-height: 1.2 !important;
}


/* ── Modern Frosted Ad-Blocker Modal Dialog ── */
#feature-access-notice {
  position: fixed !important;
  inset: 0 !important;
  z-index: 20000 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  background: transparent !important;
}

.adblock-detected #feature-access-notice,
.vpn-detected #feature-access-notice,
#feature-access-notice.closing {
  display: flex !important;
}

.adblock-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  animation: adblockBackdropFadeIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.adblock-card {
  position: relative !important;
  z-index: 1 !important;
  width: 440px !important;
  max-width: min(92vw, 460px) !important;
  padding: 26px 28px !important;
  background: rgba(26, 29, 34, 0.76) !important;
  backdrop-filter: blur(32px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(32px) saturate(1.25) !important;
  border: none !important;
  border-radius: 22px !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6) !important;
  text-align: left !important;
  animation: adblockCardPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

#feature-access-notice.closing .adblock-backdrop {
  animation: adblockBackdropFadeOut 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

#feature-access-notice.closing .adblock-card {
  animation: adblockCardPopOut 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes adblockBackdropFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes adblockBackdropFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes adblockCardPopIn {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes adblockCardPopOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(6px);
  }
}

.adblock-card h2 {
  font-size: 20px !important;
  font-weight: 650 !important;
  color: var(--text, #fff) !important;
  letter-spacing: -0.3px !important;
  margin: 0 0 10px !important;
  text-align: left !important;
}

.adblock-sub {
  font-size: 13.5px !important;
  color: var(--muted, #94a3b8) !important;
  line-height: 1.55 !important;
  margin: 0 0 10px !important;
}

.adblock-hint {
  font-size: 13.5px !important;
  color: var(--muted, #94a3b8) !important;
  line-height: 1.55 !important;
  margin: 0 0 22px !important;
}

.adblock-actions {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

.adblock-actions button {
  width: auto !important;
  min-height: auto !important;
  padding: 8px 18px !important;
  border-radius: 9999px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.16s ease !important;
  font-family: inherit !important;
}

.adblock-limited-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text, #cbd5e1) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.adblock-limited-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
}

.adblock-reload-btn {
  background: var(--accent-primary, #1f6feb) !important;
  color: #fff !important;
  border: none !important;
}

.adblock-reload-btn:hover {
  background: var(--accent-primary-hover, #1a60d6) !important;
}

/* ── Halve the Distance Between Welcome Typewriter & Input Bar ── */
#chat-window .welcome {
  margin-top: auto !important;
  margin-bottom: 10px !important;
  padding: 0 0 4px !important;
}

@media (max-width: 640px) {
  #chat-window .welcome {
    margin-top: auto !important;
    margin-bottom: 8px !important;
    padding: 0 0 4px !important;
  }
}


/* ── Auth Screen: Transparent Inputs, Centered Close Button, CeloAI Title ── */
#auth-screen .auth-field input,
#auth-screen .password-field input,
#auth-email,
#auth-password,
#auth-name {
  background: transparent !important;
  border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
}

#auth-screen .auth-field input:focus,
#auth-screen .password-field input:focus {
  background: transparent !important;
  border-color: var(--accent-primary, #1f6feb) !important;
}

.auth-logo {
  text-transform: none !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
}

.auth-close {
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 18px !important;
}

/* ── Ad-Blocker Popup: Matching Background & Compact Buttons ── */
#feature-access-notice .adblock-card {
  background: rgba(26, 29, 34, 0.72) !important;
  backdrop-filter: blur(32px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(32px) saturate(1.25) !important;
  border: none !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55) !important;
}

#feature-access-notice .adblock-actions {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

#feature-access-notice .adblock-actions button {
  width: auto !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 16px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 34px !important;
}

/* ── Mobile Welcome Layout: Centered with Input Bar ── */
@media (max-width: 640px) {
  #main.has-welcome {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100% !important;
    height: 100dvh !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
  }
  #main.has-welcome #chat-window {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 16px 14px 16px !important;
    width: 100% !important;
    margin: 0 auto !important;
  }
  #main.has-welcome #chat-window .welcome {
    margin: 0 0 18px 0 !important;
    padding: 0 !important;
    text-align: center !important;
    width: 100% !important;
  }
  #main.has-welcome #input-area {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 12px 8px !important;
  }
}


/* ── Ad-Blocker Bigger Action Buttons ── */
#feature-access-notice .adblock-actions {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 12px !important;
}

#feature-access-notice .adblock-actions button {
  width: auto !important;
  min-height: 40px !important;
  height: 40px !important;
  padding: 0 22px !important;
  border-radius: 9999px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 40px !important;
}


/* ── Ad-Blocker Popup Frosted Styling ── */

#feature-access-notice .adblock-card {
  background: rgba(26, 29, 34, 0.72) !important;
  backdrop-filter: blur(32px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(32px) saturate(1.25) !important;
  border: none !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55) !important;
}


/* ── Naturally Sized Message Bubbles (No elongation on short messages) ── */
.message.user .bubble {
  background: var(--user-bubble) !important;
  color: var(--user-text) !important;
  border-radius: 18px 18px 4px 18px !important;
  padding: 10px 16px !important;
  max-width: 78% !important;
  min-width: 0 !important;
  width: fit-content !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  border: none !important;
  white-space: pre-wrap !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
}

.message.ai .bubble {
  background: var(--ai-bubble) !important;
  color: var(--text) !important;
  border-radius: 18px 18px 18px 4px !important;
  padding: 12px 16px !important;
  max-width: 86% !important;
  min-width: 0 !important;
  width: fit-content !important;
  border: none !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
}


/* ── Sleek Custom Scrollbars (Transparent & Slim) ── */
*::-webkit-scrollbar {
  width: 5px !important;
  height: 5px !important;
}
*::-webkit-scrollbar-track {
  background: transparent !important;
}
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12) !important;
  border-radius: 999px !important;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.12) !important; }
*::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

#user-input:not(.has-scroll) {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
#user-input:not(.has-scroll)::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

#user-input.has-scroll {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent !important;
  -ms-overflow-style: auto !important;
}
#user-input.has-scroll::-webkit-scrollbar {
  display: block !important;
  width: 5px !important;
}
#user-input.has-scroll::-webkit-scrollbar-track {
  background: transparent !important;
}
#user-input.has-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22) !important;
  border-radius: 9999px !important;
}
#user-input.has-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.38) !important;
}
body.theme-light #user-input.has-scroll,
html[data-theme="light"] #user-input.has-scroll {
  scrollbar-color: rgba(0, 0, 0, 0.24) transparent !important;
}
body.theme-light #user-input.has-scroll::-webkit-scrollbar-thumb,
html[data-theme="light"] #user-input.has-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2) !important;
}

#sidebar,
.sb-convs,
#conv-list,
.settings-detail-content,
.connections-page-inner {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent !important;
}


/* ── Sleek Frosted Transparent Context Menu (#ctx-menu) ── */
.ctx-menu {
  background: rgba(26, 26, 26, 0.35) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 8px !important;
  min-width: 150px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65) !important;
  z-index: 99999 !important;
}

.ctx-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 11px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  border-radius: 9px !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  width: 100% !important;
  text-align: left !important;
  transition: background 0.12s ease, color 0.12s ease !important;
}

.ctx-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.ctx-item.danger {
  color: #ff5c5c !important;
}

.ctx-item.danger:hover {
  background: rgba(255, 75, 75, 0.12) !important;
  color: #ff7070 !important;
}

.ctx-item svg {
  width: 14px !important;
  height: 14px !important;
  opacity: 0.88 !important;
}


/* ── Unified Smooth Modal Overlays (Eliminated double-darkening glitch) ── */
.modal-bg {
  background: transparent !important;
}
.modal-bg .modal-backdrop {
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
}
.modal-bg.open.visible .modal-backdrop {
  opacity: 1 !important;
}



/* ── Unified All-At-Once Connections Fade-In (No line-by-line delay) ── */
.connections-enter .conn-page-card {
  animation: unifiedConnCardIn 0.2s ease-out forwards !important;
  animation-delay: 0ms !important;
  opacity: 1 !important;
}

@keyframes unifiedConnCardIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/* Auth Buttons & Circle Loading Spinner */
.auth-btn-spinner,
.spinner-loader {
  display: inline-block !important;
  width: 20px !important;
  height: 20px !important;
  border: 2.5px solid rgba(255, 255, 255, 0.3) !important;
  border-top-color: #ffffff !important;
  border-radius: 50% !important;
  animation: authSpin 0.7s linear infinite !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

@keyframes authSpin {
  to {
    transform: rotate(360deg);
  }
}

.auth-btn,
#auth-submit-btn,
#auth-continue-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 48px !important;
  height: 48px !important;
  padding: 0 18px !important;
  box-sizing: border-box !important;
  border-radius: 12px !important;
}

.auth-btn:disabled,
#auth-submit-btn:disabled,
#auth-continue-btn:disabled {
  opacity: 0.8 !important;
  cursor: not-allowed !important;
}

/* ══════════════════ MASTER UI FIXES & ENHANCEMENTS ══════════════════ */

/* ── 1. User Message Pill & Transparent AI Message ── */
.message.user {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: flex-end !important;
  width: 100% !important;
  margin: 6px 0 16px !important;
}

.message.user .bubble {
  border-radius: 9999px !important;
  padding: 12px 28px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-size: 14.5px !important;
  line-height: 1.5 !important;
  width: fit-content !important;
  max-width: min(85%, 720px) !important;
  box-sizing: border-box !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  overflow: hidden !important;
}

.message.ai,
.message.assistant {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  width: 100% !important;
  margin: 6px 0 20px !important;
  background: transparent !important;
}

.message.ai .bubble,
.message.assistant .bubble,
.bubble.assistant,
.bubble.ai {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  color: var(--text, #ffffff) !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
}

/* ── 2. User Message Action Buttons (Copy & Edit) ── */
.user-msg-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  margin-top: 6px !important;
  padding-right: 6px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease !important;
}

.message.user:hover .user-msg-actions {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.user-msg-action-btn,
button.user-msg-action-btn {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  flex: 0 0 28px !important;
  border-radius: 50% !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  color: rgba(255, 255, 255, 0.75) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease !important;
}

.user-msg-action-btn:hover,
button.user-msg-action-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border-radius: 50% !important;
}

.user-msg-action-btn:active,
button.user-msg-action-btn:active {
  transform: scale(0.92) !important;
}

.user-msg-action-btn svg,
button.user-msg-action-btn svg {
  width: 15px !important;
  height: 15px !important;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  display: block;
  transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1), transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-msg-action-btn.copy-btn .action-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
}

.user-msg-action-btn.copy-btn .copy-icon,
.user-msg-action-btn.copy-btn .check-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 15px !important;
  height: 15px !important;
}

.user-msg-action-btn.copy-btn .copy-icon {
  opacity: 1;
  pointer-events: auto;
}

.user-msg-action-btn.copy-btn .check-icon {
  opacity: 0;
  transform: scale(0.65);
  pointer-events: none;
  stroke: #22c55e !important;
}

.user-msg-action-btn.copy-btn.copied .copy-icon {
  opacity: 0;
  transform: scale(0.65);
}

.user-msg-action-btn.copy-btn.copied .check-icon {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* ── 2b. AI Message Actions (Regenerate, Copy, Variant Cycler) ── */
.ai-msg-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  margin-top: 6px !important;
  padding-left: 2px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease !important;
}

.message.ai:hover .ai-msg-actions,
.message.ai:focus-within .ai-msg-actions,
.message.ai.has-open-menu .ai-msg-actions,
.ai-msg-actions.menu-open {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ── Message Action Timestamp (Hover Copy / Edit / Regenerate) ── */
.msg-action-timestamp {
  font-size: 11px !important;
  line-height: 1 !important;
  color: var(--muted, #a1a1aa) !important;
  opacity: 0.65;
  user-select: none !important;
  -webkit-user-select: none !important;
  padding: 0 4px !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
  cursor: default !important;
  display: inline-flex !important;
  align-items: center !important;
  transition: opacity 0.15s ease, color 0.15s ease !important;
}

.user-msg-actions .msg-action-timestamp {
  margin-right: 2px !important;
}

.ai-msg-actions .msg-action-timestamp {
  margin-left: 2px !important;
}

.message.user:hover .msg-action-timestamp,
.message.ai:hover .msg-action-timestamp {
  opacity: 0.85;
}

.msg-action-timestamp:hover {
  opacity: 1 !important;
  color: var(--text, #ffffff) !important;
}

@media (hover: none) {
  .ai-msg-actions,
  .user-msg-actions {
    opacity: 0.85 !important;
    pointer-events: auto !important;
  }
}

.ai-msg-action-btn,
button.ai-msg-action-btn {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  flex: 0 0 28px !important;
  border-radius: 50% !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  color: rgba(255, 255, 255, 0.75) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease !important;
}

.ai-msg-action-btn:hover,
button.ai-msg-action-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border-radius: 50% !important;
}

.ai-msg-action-btn:active,
button.ai-msg-action-btn:active {
  transform: scale(0.92) !important;
}

.ai-msg-action-btn:disabled,
button.ai-msg-action-btn:disabled {
  opacity: 0.25 !important;
  cursor: default !important;
  pointer-events: none !important;
}

.ai-msg-action-btn svg,
button.ai-msg-action-btn svg {
  width: 15px !important;
  height: 15px !important;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  display: block;
  transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1), transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-msg-action-btn.copy-btn .action-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
}

.ai-msg-action-btn.copy-btn .copy-icon,
.ai-msg-action-btn.copy-btn .check-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 15px !important;
  height: 15px !important;
}

.ai-msg-action-btn.copy-btn .copy-icon {
  opacity: 1;
  pointer-events: auto;
}

.ai-msg-action-btn.copy-btn .check-icon {
  opacity: 0;
  transform: scale(0.65);
  pointer-events: none;
  stroke: #22c55e !important;
}

.ai-msg-action-btn.copy-btn.copied .copy-icon {
  opacity: 0;
  transform: scale(0.65);
}

.ai-msg-action-btn.copy-btn.copied .check-icon {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Variant Cycler Inline Navigation (Clean, no surrounding box) */
.ai-msg-variant-nav {
  display: inline-flex !important;
  align-items: center !important;
  gap: 1px !important;
  margin-left: 2px !important;
  margin-right: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.ai-variant-count {
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.55) !important;
  user-select: none !important;
  width: 26px !important;
  min-width: 26px !important;
  max-width: 26px !important;
  text-align: center !important;
  display: inline-block !important;
  line-height: 1 !important;
}

.ai-variant-nav-btn,
button.ai-variant-nav-btn {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  flex: 0 0 22px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  color: rgba(255, 255, 255, 0.6) !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

.ai-variant-nav-btn:hover,
button.ai-variant-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border-radius: 50% !important;
}

.ai-variant-nav-btn:active,
button.ai-variant-nav-btn:active {
  transform: none !important;
}

.ai-variant-nav-btn svg {
  width: 12px !important;
  height: 12px !important;
}

/* ── Regenerate Options Popup Menu (ChatGPT style) ── */
.ai-regen-popup {
  position: fixed;
  z-index: 10000;
  background: rgba(26, 26, 28, 0.65) !important;
  background-color: rgba(26, 26, 28, 0.65) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 6px !important;
  min-width: 180px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  opacity: 0 !important;
  transform: scale(0.65) translateY(12px) !important;
  filter: blur(4px);
  pointer-events: none !important;
  transform-origin: bottom left;
  transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), filter 0.15s ease !important;
}

.ai-regen-popup.open {
  opacity: 1 !important;
  transform: scale(1) translateY(0) !important;
  filter: blur(0px) !important;
  pointer-events: auto !important;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), filter 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.ai-regen-popup-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 9px 12px !important;
  border-radius: 10px !important;
  color: #ececec !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  border: none !important;
  background: transparent !important;
  background-color: transparent !important;
  width: 100% !important;
  text-align: left !important;
  user-select: none !important;
  outline: none !important;
  transition: background 0.12s ease, color 0.12s ease !important;
}

.ai-regen-popup-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

.ai-regen-popup-item svg {
  width: 17px !important;
  height: 17px !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  fill: none !important;
  flex-shrink: 0 !important;
}

body.theme-light .ai-regen-popup,
html[data-theme="light"] .ai-regen-popup {
  background: rgba(255, 255, 255, 0.85) !important;
  background-color: rgba(255, 255, 255, 0.85) !important;
  border: none !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
}

body.theme-light .ai-regen-popup-item,
html[data-theme="light"] .ai-regen-popup-item {
  color: #111418 !important;
}

body.theme-light .ai-regen-popup-item:hover,
html[data-theme="light"] .ai-regen-popup-item:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  background-color: rgba(0, 0, 0, 0.06) !important;
  color: #000000 !important;
}

#main:not(.has-welcome) #ghost-mode-btn,
#main:not(.has-welcome) #mobile-ghost-btn,
#main:not(.has-welcome) #mobile-action-pill {
  display: none !important;
}


/* ── 3. Inline User Edit Form ── */
.message.user.editing {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
}

.message.user.editing .bubble {
  background: #18181b !important;
  border-radius: 99px !important;
  padding: 14px 26px 16px 26px !important;
  box-shadow: 0 0 0 1.5px rgba(37, 99, 235, 0.45) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  max-width: min(92%, 620px) !important;
  transition: border-radius 0.28s cubic-bezier(0.16, 1, 0.3, 1), width 0.28s cubic-bezier(0.16, 1, 0.3, 1), height 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.message.user.editing .bubble.is-large {
  border-radius: 24px !important;
  padding: 14px 20px !important;
}

.message.user.editing .bubble.has-attachments {
  min-width: 220px !important;
  border-radius: 99px;
  padding: 14px 26px 16px 26px !important;
}

.message.user.editing .bubble.has-attachments.is-large {
  border-radius: 24px !important;
  padding: 14px 20px !important;
}

.user-edit-attachment-preview {
  margin-bottom: 8px !important;
  margin-left: 2px !important;
  margin-top: 2px !important;
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  user-select: none !important;
}

.user-edit-attachment-preview img {
  width: 56px !important;
  height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  border-radius: 12px !important;
  object-fit: cover !important;
  display: block !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  user-select: none !important;
  flex-shrink: 0 !important;
  transition: opacity 0.15s ease !important;
  transform: none !important;
}

.user-edit-attachment-preview img:hover {
  opacity: 0.88 !important;
  transform: none !important;
}

.user-edit-attachment-tags {
  margin-top: 8px !important;
  margin-left: 2px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  user-select: none !important;
}

.user-edit-attachment-tags .attachment-tag {
  pointer-events: none !important;
}

.user-edit-input {
  width: 100% !important;
  box-sizing: border-box !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
  font-family: inherit !important;
  resize: none !important;
  padding: 2px 2px !important;
  margin: 0 !important;
  margin-left: 2px !important;
  display: block !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  white-space: pre-wrap !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent !important;
}

.user-edit-input::-webkit-scrollbar {
  width: 6px !important;
}

.user-edit-input::-webkit-scrollbar-track {
  background: transparent !important;
}

.user-edit-input::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28) !important;
  border-radius: 9999px !important;
}

.user-edit-input::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45) !important;
}

.user-edit-buttons {
  display: flex !important;
  gap: 12px !important;
  margin-top: 10px !important;
  justify-content: flex-end !important;
  align-items: center !important;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.user-edit-btn,
button.user-edit-btn {
  font-size: 13.5px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  border: none !important;
  outline: none !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.user-edit-btn.cancel,
button.user-edit-btn.cancel {
  background: transparent !important;
  color: #ffffff !important;
  padding: 8px 14px !important;
  border-radius: 9999px !important;
}
.user-edit-btn.cancel:hover,
button.user-edit-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.user-edit-btn.submit,
button.user-edit-btn.submit {
  background: #27272a !important;
  color: #71717a !important;
  padding: 8px 18px !important;
  border-radius: 9999px !important;
  font-weight: 600 !important;
  cursor: not-allowed !important;
  opacity: 0.8 !important;
}
.user-edit-btn.submit:not(:disabled),
button.user-edit-btn.submit:not(:disabled) {
  background: #ffffff !important;
  color: #000000 !important;
  cursor: pointer !important;
  opacity: 1 !important;
}
.user-edit-btn.submit:hover:not(:disabled),
button.user-edit-btn.submit:hover:not(:disabled) {
  background: #e4e4e7 !important;
}

/* ── 4. Sidebar Footer Profile Row & Icon Controls ── */
.sb-footer {
  padding: 10px 12px 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-top: auto !important;
  flex-shrink: 0 !important;
}

.sb-profile-row {
  display: none;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 6px 8px !important;
  border-radius: 12px !important;
  gap: 10px !important;
  background: transparent !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: background 0.15s ease !important;
}

.sb-profile-row:hover,
.sb-profile-row.active,
#sb-profile-row.active,
.sb-profile-row:has(#settings-btn.active) {
  background: rgba(255, 255, 255, 0.08) !important;
}

.sb-profile-row:hover #settings-btn,
.sb-profile-row.active #settings-btn,
#sb-profile-row.active #settings-btn,
.sb-profile-row:hover .sb-cog-btn,
.sb-profile-row.active .sb-cog-btn {
  background: transparent !important;
  background-color: transparent !important;
}

.sb-user-profile {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.sb-avatar,
#sb-user-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  flex: 0 0 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  color: #ffffff !important;
}

#sb-gravatar,
img#sb-gravatar,
.sb-avatar img,
.avatar img,
#sb-user-avatar img {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.sb-avatar:has(#sb-initials:not([style*="display: none"])),
#sb-user-avatar:has(#sb-initials:not([style*="display: none"])),
.sb-avatar.show-initials,
#sb-user-avatar.show-initials {
  background: var(--accent-primary, #1f6feb) !important;
}

.sb-avatar img,
#sb-user-avatar img,
#sb-gravatar {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.sb-avatar img[style*="display: none"],
#sb-user-avatar img[style*="display: none"],
#sb-gravatar[style*="display: none"] {
  display: none !important;
}

.sb-avatar #sb-initials {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
}

#auth-name-field {
  position: relative !important;
}
#auth-name-field input {
  padding-right: 52px !important;
}
.auth-char-count {
  position: absolute;
  right: 14px;
  bottom: 14px;
  font-size: 11px;
  color: var(--muted, #888);
  pointer-events: none;
  user-select: none;
  font-family: inherit;
  font-weight: 500;
}
.auth-char-count.overlimit {
  color: #ef4444;
}

@keyframes smoothChatFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.chat-window-fade-in,
#chat-window.chat-window-fade-in {
  animation: smoothChatFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

@keyframes smoothMsgFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes smoothUserMsgFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.message-fade-in,
#chat-window .message.message-fade-in {
  animation: smoothMsgFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

.message.user.message-fade-in,
#chat-window .message.user.message-fade-in {
  animation: smoothUserMsgFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

.message.message-instant {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.thinking-bubble,
.thinking-bubble * {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

/* ── Thinking Indicator with Gliding Glint ── */
.thinking-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  animation: thinkingBubbleFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes thinkingBubbleFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.thinking-dot {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.45);
  animation: thinkingDotPulse 1.4s ease-in-out infinite;
}

.thinking-dot:nth-child(1) {
  animation-delay: 0s;
}
.thinking-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.thinking-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes thinkingDotPulse {
  0%, 80%, 100% {
    opacity: 0.32;
    transform: scale(0.85);
  }
  40% {
    opacity: 0.95;
    transform: scale(1.15);
  }
}

[data-theme="light"] .thinking-dot,
body.theme-light .thinking-dot,
html[data-theme="light"] .thinking-dot {
  background-color: rgba(30, 30, 35, 0.45);
}

.thinking-text {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.25px;
  line-height: 1.4;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  /* Luminous glint beam gliding across the text */
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.42) 20%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0.42) 80%,
    rgba(255, 255, 255, 0.42) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: glintGlide 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transition: opacity 0.18s ease-in-out;
  white-space: nowrap;
}
.thinking-text::selection,
.thinking-bubble::selection {
  background: transparent !important;
  color: inherit !important;
}

[data-theme="light"] .thinking-text,
body.theme-light .thinking-text,
html[data-theme="light"] .thinking-text {
  background: linear-gradient(
    90deg,
    rgba(20, 20, 25, 0.45) 0%,
    rgba(20, 20, 25, 0.45) 20%,
    rgba(10, 10, 12, 1) 50%,
    rgba(20, 20, 25, 0.45) 80%,
    rgba(20, 20, 25, 0.45) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes glintGlide {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}


.sb-user-name {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--text, #ffffff) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
}

.sb-cog-btn,
#settings-btn,
button#settings-btn,
.sb-collapsed-btn,
button.sb-collapsed-btn,
#sb-collapsed-settings-btn,
#sb-collapsed-auth-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  flex: 0 0 32px !important;
  border-radius: 50% !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--muted, #8e8e93) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease !important;
}

.sb-cog-btn:hover,
#settings-btn:hover,
#settings-btn.active,
button#settings-btn:hover,
button#settings-btn.active,
.sb-collapsed-btn:hover,
.sb-collapsed-btn.active,
#sb-collapsed-settings-btn:hover,
#sb-collapsed-settings-btn.active,
#sb-collapsed-auth-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

.sb-cog-btn,
#settings-btn,
button#settings-btn,
#sb-collapsed-settings-btn {
  transition:
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s ease,
    color 0.2s ease !important;
}

.sb-cog-btn:active,
#settings-btn:active,
button#settings-btn:active,
#sb-collapsed-settings-btn:active {
  transform: scale(0.88) !important;
}

.sb-cog-btn:active > svg,
#settings-btn:active > svg,
button#settings-btn:active > svg,
#sb-collapsed-settings-btn:active > svg {
  transform: rotate(45deg) scale(0.9) !important;
}

.sb-cog-btn svg,
#settings-btn svg,
button#settings-btn svg,
#sb-collapsed-settings-btn svg {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.sb-cog-btn:hover > svg,
#settings-btn:hover > svg,
#settings-btn.active > svg,
button#settings-btn:hover > svg,
button#settings-btn.active > svg,
#sb-collapsed-settings-btn:hover > svg,
#sb-collapsed-settings-btn.active > svg {
  transform: rotate(30deg) !important;
}

.sb-cog-btn svg,
#settings-btn svg,
.sb-collapsed-btn svg,
#sb-collapsed-settings-btn svg,
#sb-collapsed-auth-btn svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  fill: none !important;
  pointer-events: none !important;
}

#sidebar:not(.collapsed) .sb-collapsed-footer,
#sidebar:not(.collapsed) #sb-collapsed-footer,
#sidebar:not(.collapsed) #sb-collapsed-settings-btn,
#sidebar:not(.collapsed) #sb-collapsed-auth-btn {
  display: none !important;
}

#sidebar.collapsed .sb-profile-row,
#sidebar.collapsed #sb-profile-row,
#sidebar.collapsed .guest-login-cta,
#sidebar.collapsed #guest-login-cta {
  display: none !important;
}

#sidebar.collapsed .sb-collapsed-footer,
#sidebar.collapsed #sb-collapsed-footer {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
}

/* ── 5. Sidebar Footer Display Rules ── */
body:not(.user-logged-in) #sb-profile-row,
body:not(.user-logged-in) .sb-profile-row,
body:not(.user-logged-in) #sidebar #sb-profile-row,
body:not(.user-logged-in) #settings-btn,
body:not(.user-logged-in) #sidebar #settings-btn,
body:not(.user-logged-in) #sb-collapsed-settings-btn,
body.user-guest #sb-profile-row,
body.user-guest .sb-profile-row,
body.user-guest #sidebar #sb-profile-row,
body.user-guest #settings-btn,
body.user-guest #sidebar #settings-btn,
body.user-guest #sb-collapsed-settings-btn,
html:not(.user-logged-in) #sb-profile-row,
html:not(.user-logged-in) .sb-profile-row,
html:not(.user-logged-in) #sidebar #sb-profile-row,
html:not(.user-logged-in) #settings-btn,
html:not(.user-logged-in) #sidebar #settings-btn,
html:not(.user-logged-in) #sb-collapsed-settings-btn,
html.user-guest #sb-profile-row,
html.user-guest .sb-profile-row,
html.user-guest #sidebar #sb-profile-row,
html.user-guest #settings-btn,
html.user-guest #sidebar #settings-btn,
html.user-guest #sb-collapsed-settings-btn {
  display: none !important;
}

body.user-logged-in:not(.sb-footer-transitioning) #sidebar:not(.collapsed) #sb-profile-row,
body.user-logged-in:not(.sb-footer-transitioning) #sidebar:not(.collapsed) .sb-profile-row,
html.user-logged-in:not(.sb-footer-transitioning) #sidebar:not(.collapsed) #sb-profile-row,
html.user-logged-in:not(.sb-footer-transitioning) #sidebar:not(.collapsed) .sb-profile-row {
  display: flex !important;
}

body.user-logged-in:not(.sb-footer-transitioning) #sidebar:not(.collapsed) #settings-btn,
html.user-logged-in:not(.sb-footer-transitioning) #sidebar:not(.collapsed) #settings-btn {
  display: flex !important;
}

body.user-logged-in:not(.sb-footer-transitioning) #sidebar.collapsed #sb-collapsed-settings-btn,
html.user-logged-in:not(.sb-footer-transitioning) #sidebar.collapsed #sb-collapsed-settings-btn {
  display: flex !important;
}

html.user-logged-in #guest-login-cta,
html.user-logged-in .guest-login-cta,
html.user-logged-in #sidebar #guest-login-cta,
body.user-logged-in #guest-login-cta,
body.user-logged-in .guest-login-cta,
body.user-logged-in #sidebar #guest-login-cta,
html.user-logged-in #sb-collapsed-auth-btn,
body.user-logged-in #sb-collapsed-auth-btn {
  display: none !important;
}

html:not(.user-logged-in):not(.sb-footer-transitioning) #sidebar:not(.collapsed) #guest-login-cta,
body:not(.user-logged-in):not(.sb-footer-transitioning) #sidebar:not(.collapsed) #guest-login-cta,
html.user-guest:not(.user-logged-in):not(.sb-footer-transitioning) #sidebar:not(.collapsed) #guest-login-cta,
body.user-guest:not(.user-logged-in):not(.sb-footer-transitioning) #sidebar:not(.collapsed) #guest-login-cta {
  display: flex !important;
}

html:not(.user-logged-in):not(.sb-footer-transitioning) #sidebar.collapsed #sb-collapsed-auth-btn,
body:not(.user-logged-in):not(.sb-footer-transitioning) #sidebar.collapsed #sb-collapsed-auth-btn,
html.user-guest:not(.user-logged-in):not(.sb-footer-transitioning) #sidebar.collapsed #sb-collapsed-auth-btn,
body.user-guest:not(.user-logged-in):not(.sb-footer-transitioning) #sidebar.collapsed #sb-collapsed-auth-btn {
  display: flex !important;
}

body.user-logged-in #settings-signin-btn,
body.user-logged-in #settings-signin-sep,
html.user-logged-in #settings-signin-btn,
html.user-logged-in #settings-signin-sep {
  display: none !important;
}
body.user-logged-in #settings-signout-btn,
body.user-logged-in #settings-signout-sep,
html.user-logged-in #settings-signout-btn,
html.user-logged-in #settings-signout-sep {
  display: flex !important;
}
body:not(.user-logged-in) #settings-signout-btn,
body:not(.user-logged-in) #settings-signout-sep,
html:not(.user-logged-in) #settings-signout-btn,
html:not(.user-logged-in) #settings-signout-sep,
body.user-guest #settings-signout-btn,
body.user-guest #settings-signout-sep,
html.user-guest #settings-signout-btn,
html.user-guest #settings-signout-sep {
  display: none !important;
}
body:not(.user-logged-in) #settings-signin-btn,
html:not(.user-logged-in) #settings-signin-btn {
  display: flex !important;
}

/* ── 6. Transparent Rounded Notification Toast in Bottom Left ── */
#error-toast {
  position: fixed !important;
  bottom: 24px !important;
  left: 24px !important;
  top: auto !important;
  right: auto !important;
  z-index: 100050 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: auto !important;
  min-width: 280px !important;
  max-width: min(560px, calc(100vw - 48px)) !important;
  padding: 16px 26px !important;
  border-radius: 26px !important;
  background: rgba(28, 31, 38, 0.55) !important;
  border: none !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(28px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(160%) !important;
  color: #f3f4f6 !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
  cursor: pointer !important;
  opacity: 0 !important;
  transform: translateY(12px) scale(0.97) !important;
  pointer-events: none !important;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#error-toast.toast-visible {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
}

#error-toast.toast-success {
  background: rgba(28, 31, 38, 0.55) !important;
  border: none !important;
}

#error-toast.toast-announcement {
  background: rgba(28, 31, 38, 0.55) !important;
  border: none !important;
}

body.theme-light #error-toast,
html[data-theme="light"] #error-toast {
  background: rgba(240, 242, 245, 0.6) !important;
  border: none !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12) !important;
  color: #111827 !important;
}

body.theme-light #error-toast.toast-success,
html[data-theme="light"] #error-toast.toast-success {
  background: rgba(240, 242, 245, 0.6) !important;
  border: none !important;
}

#error-toast button {
  display: none !important;
}

/* ── 7. Auth Buttons & Spinner ── */
.auth-btn-spinner,
.spinner-loader {
  display: inline-block !important;
  width: 20px !important;
  height: 20px !important;
  border: 2.5px solid rgba(255, 255, 255, 0.3) !important;
  border-top-color: #ffffff !important;
  border-radius: 50% !important;
  animation: authSpin 0.7s linear infinite !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

@keyframes authSpin {
  to {
    transform: rotate(360deg);
  }
}

.auth-btn,
#auth-submit-btn,
#auth-continue-btn {
  position: relative !important;
  overflow: hidden !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 48px !important;
  height: 48px !important;
  padding: 0 18px !important;
  box-sizing: border-box !important;
  border-radius: 12px !important;
}

/* ── 8. Fluid 60fps Skeleton Wave Animation ── */
.full-skeleton-loader {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 4px 0 !important;
  width: 100% !important;
  max-width: 520px !important;
}

.full-skeleton-line,
.chat-skeleton-line,
.inline-skeleton-line {
  height: 12px !important;
  border-radius: 9999px !important;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.16) 50%,
    rgba(255, 255, 255, 0.05) 100%
  ) !important;
  background-size: 200% 100% !important;
  animation: smoothSkeletonWave 2.6s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
  will-change: background-position !important;
}

@keyframes smoothSkeletonWave {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

body.theme-light .full-skeleton-line,
html[data-theme="light"] .full-skeleton-line,
body.theme-light .chat-skeleton-line,
html[data-theme="light"] .chat-skeleton-line,
body.theme-light .inline-skeleton-line,
html[data-theme="light"] .inline-skeleton-line {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 0%,
    rgba(0, 0, 0, 0.13) 50%,
    rgba(0, 0, 0, 0.04) 100%
  ) !important;
  background-size: 200% 100% !important;
  animation: smoothSkeletonWave 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
}

/* ── 9. Modern Markdown Tables ── */
.message.ai table,
.message.assistant table,
.bubble table,
table {
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 16px 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: rgba(255, 255, 255, 0.025) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.message.ai thead,
.message.assistant thead,
.bubble thead,
table thead {
  background: rgba(255, 255, 255, 0.07) !important;
}

.message.ai thead tr,
.message.assistant thead tr,
.bubble thead tr,
table thead tr {
  background: transparent !important;
}

.message.ai th,
.message.assistant th,
.bubble th,
table th {
  padding: 11px 16px !important;
  font-size: 13.5px !important;
  font-weight: 650 !important;
  color: var(--text, #ffffff) !important;
  text-align: left !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: transparent !important;
}

.message.ai td,
.message.assistant td,
.bubble td,
table td {
  padding: 10px 16px !important;
  font-size: 13.5px !important;
  color: var(--text, #ffffff) !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  line-height: 1.55 !important;
  background: transparent !important;
}

.message.ai tbody tr:last-child td,
.message.assistant tbody tr:last-child td,
.bubble tbody tr:last-child td,
table tbody tr:last-child td {
  border-bottom: none !important;
}

.message.ai tbody tr:hover,
.message.assistant tbody tr:hover,
.bubble tbody tr:hover,
table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035) !important;
}


/* ── Skeleton Loading Styling (Transparent AI & Pill User) ── */
.message.ai .bubble.inline-skeleton-bubble,
.bubble.inline-skeleton-bubble,
.inline-skeleton-bubble,
.chat-skeleton-bubble.ai,
.full-skeleton-loader {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.chat-skeleton-bubble.user {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  align-self: flex-end !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  border-radius: 9999px !important;
  padding: 13px 22px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  width: fit-content !important;
  max-width: 60% !important;
  box-sizing: border-box !important;
}

.chat-skeleton-bubble.user .full-skeleton-line,
.chat-skeleton-bubble.user .chat-skeleton-line {
  height: 12px !important;
  border-radius: 9999px !important;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.22) 50%,
    rgba(255, 255, 255, 0.08) 100%
  ) !important;
  background-size: 200% 100% !important;
  animation: smoothSkeletonWave 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
  will-change: background-position !important;
}


/* ── Ensure Popups & Trays are Above All Blur Layers ── */
#chat-fade {
  z-index: 1 !important;
}

#input-area {
  position: relative !important;
  z-index: 20 !important;
}

#input-area .bar {
  position: relative !important;
  z-index: 21 !important;
}

.plus-popup,
#plus-popup,
#model-menu,
.ctx-menu {
  z-index: 99999 !important;
}


/* ── Never show blinking cursor | on skeleton loaders ── */
.bubble.inline-skeleton-bubble::after,
.inline-skeleton-bubble::after,
.full-skeleton-loader::after,
.full-skeleton-loader *::after {
  display: none !important;
  content: none !important;
}


/* ── Smooth Pure Opacity Fade-In ── */
@keyframes aiBubbleFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.message.ai .bubble.ai-fade-in {
  animation: aiBubbleFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.message.ai .bubble {
  opacity: 1;
}

/* ── Connection Source ── */
.connection-source {
  display: block !important;
  width: 100% !important;
  clear: both !important;
  font-size: 11.5px !important;
  color: var(--muted, #a1a1aa) !important;
  opacity: 0.85;
  margin-top: 12px !important;
  margin-bottom: 2px !important;
  line-height: 1.4;
  letter-spacing: 0.01em;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  cursor: default;
}

.connection-source a {
  color: var(--muted, #a1a1aa) !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(255, 255, 255, 0.25) !important;
  text-underline-offset: 2px;
  transition: all 0.15s ease;
  cursor: pointer !important;
}

.connection-source a:hover {
  color: var(--text, #ffffff) !important;
  text-decoration-color: rgba(255, 255, 255, 0.85) !important;
}

/* ── FLUX Generated Image Card ── */
.generated-image-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 512px;
  margin-top: 4px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface2, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
}
.generated-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0d0e12;
  overflow: hidden;
  cursor: pointer;
}
.generated-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.generated-image-wrap:hover img {
  transform: scale(1.02);
}
.generated-image-footer {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.generated-image-prompt {
  font-size: 13px;
  color: var(--text, #fff);
  line-height: 1.4;
  font-style: italic;
}
.generated-image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.image-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text, #fff);
  background: var(--surface, rgba(255,255,255,0.08));
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.image-download-btn:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.3);
}
.image-quota-badge {
  font-size: 11px;
  color: var(--muted, #888);
}

/* ── Simple Box Skeleton for Image Gen ── */
.image-gen-skeleton-bubble {
  width: 280px;
  max-width: 100%;
  padding: 8px !important;
  border-radius: 16px !important;
  background: var(--surface2, rgba(255, 255, 255, 0.04)) !important;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08)) !important;
}
.image-gen-box-skeleton {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.image-skeleton-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: imageShimmer 1.6s infinite ease-in-out;
}
@keyframes imageShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Creating Your Image Braille Dot Loader ── */
.message.ai .bubble.image-loader-bubble,
.image-loader-bubble {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 0 !important;
  margin: 4px 0 !important;
  display: inline-block !important;
  width: fit-content !important;
}

.image-gen-loading-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  background: transparent;
  color: #ececec;
  font-size: 14.5px;
  font-weight: 400;
  letter-spacing: -0.1px;
  user-select: none;
}

.braille-dot-spinner {
  position: relative;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.b-dot {
  position: absolute;
  width: 2.8px;
  height: 2.8px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0.35;
  animation: braillePulse 1.2s infinite ease-in-out;
}

.b-dot-1 {
  top: 1px;
  left: 2px;
  animation-delay: 0s;
}

.b-dot-2 {
  bottom: 1px;
  left: 2px;
  animation-delay: 0.4s;
}

.b-dot-3 {
  top: 5.5px;
  right: 2px;
  animation-delay: 0.8s;
}

@keyframes braillePulse {
  0%, 100% {
    opacity: 0.25;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
  }
}

body.theme-light .image-gen-loading-pill {
  color: #1a1a1a;
}
body.theme-light .b-dot {
  background: #1a1a1a;
}


/* ── Experimental Feature Modal ── */
.custom-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition:
    opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.22s linear;
}
.custom-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.custom-modal-backdrop {
  position: absolute;
  inset: 0;
}
.custom-modal-box {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: rgba(36, 40, 48, 0.68) !important;
  backdrop-filter: blur(32px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(160%) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  outline: none !important;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.custom-modal.active .custom-modal-box {
  transform: scale(1) translateY(0);
}
.custom-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.custom-modal-icon-wrap.warning {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  flex-shrink: 0;
}
.custom-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #ffffff);
}
.custom-modal-body {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted, #a1a1aa);
  margin-bottom: 22px;
}
.custom-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.custom-modal-btn {
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.custom-modal-btn.cancel {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #ffffff);
}
.custom-modal-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.14);
}
.custom-modal-btn.primary {
  background: var(--accent-primary, #1f6feb);
  color: #ffffff;
}
.custom-modal-btn.primary:hover {
  background: var(--accent-primary-hover, #1a60d6);
}


/* ── Model Selector Genie Animation ── */
@keyframes celoModelGenieIn {
  0% {
    opacity: 0;
    transform: scale(0.08, 0.05) skew(-4deg, 3deg);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: scale(1, 1) skew(0deg, 0deg);
  }
}

@keyframes celoModelGenieOut {
  0% {
    opacity: 1;
    transform: scale(1, 1) skew(0deg, 0deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.08, 0.05) skew(-4deg, 3deg);
  }
}

/* ── Model Selector Menu (Borderless & Fluid Genie) ── */
#model-menu {
  position: fixed;
  display: block !important;
  width: 240px !important;
  min-width: 240px !important;
  background: rgba(22, 24, 28, 0.45) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.52) !important;
  padding: 6px !important;
  z-index: 99999 !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: top left;
  will-change: opacity, transform;
  overflow: hidden;
  box-sizing: border-box;
  touch-action: pan-y !important;
  overscroll-behavior: contain !important;
}

#model-menu.open {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  animation: celoModelGenieIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

#model-menu.closing {
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
  animation: celoModelGenieOut 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
  pointer-events: none !important;
}

#model-menu-inner {
  overflow-y: scroll !important;
  max-height: 240px;
  overscroll-behavior-y: contain !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 !important;
  margin: 0 !important;
}

#model-menu-inner::-webkit-scrollbar {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
}

.model-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px !important;
  border-radius: 10px !important;
  color: #ececec !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
  border: none !important;
  border-bottom: none !important;
  min-height: 38px;
  width: 100% !important;
  box-sizing: border-box !important;
  touch-action: pan-y !important;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  background: transparent;
}

.model-opt:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

.model-opt.selected,
.popup-item.active,
#popup-web-search.active,
#popup-deep-research.active {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 14%, transparent) !important;
  color: var(--accent-primary, #1f6feb) !important;
}

.model-opt.selected *,
.popup-item.active *,
#popup-web-search.active *,
#popup-deep-research.active * {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}

.model-opt.selected:hover,
.popup-item.active:hover,
#popup-web-search.active:hover,
#popup-deep-research.active:hover {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 20%, transparent) !important;
}

.model-opt.selected:hover *,
.popup-item.active:hover *,
#popup-web-search.active:hover *,
#popup-deep-research.active:hover * {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}

.model-opt .check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
  opacity: 0;
  display: none;
  margin-left: auto;
}

.model-opt.selected .check {
  opacity: 1;
  display: block;
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}

body.theme-midnight #model-menu,
html[data-theme="midnight"] #model-menu {
  background: rgba(10, 12, 16, 0.4) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: none !important;
}

body.theme-light #model-menu,
html[data-theme="light"] #model-menu {
  background: rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
}
body.theme-light .model-opt {
  color: #1a1a1a !important;
}
body.theme-light .model-opt:hover {
  background: rgba(0, 0, 0, 0.06) !important;
}
body.theme-light .model-opt.selected {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 12%, transparent) !important;
  color: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .model-opt .check {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}

/* ─── Share Conversation Modal ─── */
.share-link-input-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 44px !important;
  padding: 11px 16px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: none !important;
  border-radius: 16px !important;
  margin-bottom: 20px !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  transition: background-color 0.18s ease !important;
}

.share-link-input-wrap:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  border: none !important;
}

.share-link-text,
#open-link-url-text {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 13.5px !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  text-decoration: underline dotted !important;
  text-underline-offset: 3.5px !important;
  text-decoration-thickness: 1.5px !important;
  flex: 1 !important;
}

.share-link-text::selection,
#open-link-url-text::selection {
  background: transparent !important;
  color: inherit !important;
}

.share-link-text.fade-in {
  animation: shareLinkFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes shareLinkFadeIn {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shared-links-container .shared-link-item:not(.skeleton-card) {
  animation: shareLinkFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.share-link-copy-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #8e8e93 !important;
  flex-shrink: 0 !important;
  transition: color 0.15s ease !important;
}

.share-link-input-wrap:hover .share-link-copy-icon {
  color: #ffffff !important;
}

.share-link-skeleton {
  display: inline-block !important;
  width: 220px !important;
  height: 16px !important;
  border-radius: 6px !important;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.06) 75%) !important;
  background-size: 200% 100% !important;
  animation: share-shimmer 1.4s infinite ease-in-out !important;
}

@keyframes share-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

#share-copy-btn {
  position: relative !important;
  overflow: hidden !important;
  transition: background-color 0.3s ease-in-out, transform 0.15s ease, box-shadow 0.3s ease !important;
}

#share-copy-btn.copied {
  background: #10b981 !important;
  color: #ffffff !important;
}

.share-copy-label-wrap {
  display: inline-grid !important;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  position: relative;
}

.share-copy-btn-label {
  grid-area: 1 / 1;
  transition: opacity 0.25s ease-in-out !important;
  white-space: nowrap;
  transform: none !important;
}

.share-label-default {
  opacity: 1;
  transform: none !important;
}

.share-label-copied {
  opacity: 0;
  transform: none !important;
  pointer-events: none;
}

#share-copy-btn.copied .share-label-default {
  opacity: 0;
  transform: none !important;
}

#share-copy-btn.copied .share-label-copied {
  opacity: 1;
  transform: none !important;
}

/* ─── Rename & Delete Chat Modals ─── */
.rename-input-wrap {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  min-height: 42px !important;
  padding: 8px 14px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  margin-bottom: 20px !important;
  box-sizing: border-box !important;
  transition: border-color 0.18s ease, background-color 0.18s ease !important;
}

.rename-input-wrap:focus-within {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: var(--accent-primary, #1f6feb) !important;
  box-shadow: 0 0 0 1px var(--accent-primary, #1f6feb) !important;
}

.rename-input {
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #ffffff !important;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  padding: 0 !important;
}

.rename-input::placeholder {
  color: #8e8e93 !important;
}

body.theme-light .rename-input-wrap,
html[data-theme="light"] .rename-input-wrap {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

body.theme-light .rename-input-wrap:focus-within,
html[data-theme="light"] .rename-input-wrap:focus-within {
  background: rgba(0, 0, 0, 0.06) !important;
  border-color: var(--accent-primary, #1f6feb) !important;
}

body.theme-light .rename-input,
html[data-theme="light"] .rename-input {
  color: #1a1a1a !important;
}

#sb-connections-btn.active,
body.on-connections-page #sb-connections-btn,
body.on-connections-page .sb-nav-btn {
  background: rgba(255, 255, 255, 0.09) !important;
  color: #ffffff !important;
  border-radius: 20px !important;
}

body.theme-light #sb-connections-btn.active,
body.theme-light.on-connections-page #sb-connections-btn,
body.theme-light.on-connections-page .sb-nav-btn,
html[data-theme="light"] #sb-connections-btn.active,
html[data-theme="light"] body.on-connections-page #sb-connections-btn,
html[data-theme="light"] body.on-connections-page .sb-nav-btn {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #1a1a1a !important;
  border-radius: 20px !important;
}

/* ─── Shared Links in Data Control ─── */
.shared-links-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.shared-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border: none !important;
  box-shadow: none !important;
}

.shared-link-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shared-link-title {
  font-family: 'Manrope', sans-serif !important;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shared-link-date {
  font-family: 'Manrope', sans-serif !important;
  font-size: 11.5px;
  color: #767676;
}

.shared-link-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.shared-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none !important;
  background: rgba(255, 255, 255, 0.07) !important;
  color: #a8a8a8;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.shared-link-btn svg {
  width: 14px !important;
  height: 14px !important;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shared-link-btn:hover {
  background: rgba(255, 255, 255, 0.13) !important;
  color: #ffffff;
}

.shared-link-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444;
}

.shared-empty-state {
  font-family: 'Manrope', sans-serif !important;
  padding: 24px 16px;
  text-align: center;
  font-size: 13.5px;
  color: #777777;
  border-radius: 14px;
  background: transparent !important;
  border: none !important;
}

.shared-link-item.skeleton-card {
  pointer-events: none;
  user-select: none;
}

.shared-skeleton-line {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.13) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: share-shimmer 1.4s infinite ease-in-out;
}

.model-menu-heading {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 12px 3px;
  user-select: none;
}

@keyframes celoFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes celoFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }
}
@keyframes celoSettingsFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes celoSettingsFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes celoSettingsGenieIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes celoSettingsGenieOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes celoSettingsFadeUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
@keyframes celoSettingsFadeDown {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
}
@keyframes celoPageSlideIn {
  0% {
    opacity: 0;
    transform: translate3d(36px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
@keyframes celoPageSlideOut {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  100% {
    opacity: 0;
    transform: translate3d(36px, 0, 0);
  }
}
@keyframes celoUnderlayPushBack {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(-24px, 0, 0);
    opacity: 0.85;
  }
}
@keyframes celoUnderlayRestore {
  0% {
    transform: translate3d(-24px, 0, 0);
    opacity: 0.85;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

/* ── Authoritative Settings Popup Styling ── */
#settings-popup-close,
.settings-popup-close,
.settings-popup-header {
  display: none !important;
}

#settings-popup.settings-popup {
  position: fixed !important;
  z-index: 10002 !important;
  background: rgba(22, 24, 28, 0.45) !important;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  border-radius: 16px !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.52) !important;
  padding: 8px !important;
  box-sizing: border-box !important;
  min-width: 240px !important;
  max-width: calc(100vw - 32px) !important;
  transform-origin: bottom left !important;
  opacity: 0;
  display: none !important;
  pointer-events: none !important;
  will-change: transform, opacity;
}
#settings-popup .settings-item {
  padding: 8px 11px !important;
  gap: 10px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  border-radius: 9px !important;
}
#settings-popup .settings-item svg:first-child {
  width: 16px !important;
  height: 16px !important;
}
#settings-popup .settings-chevron {
  width: 13px !important;
  height: 13px !important;
}
#settings-popup .settings-sep {
  margin: 5px 8px !important;
}
@media (min-width: 641px) {
  #settings-popup.settings-popup {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
    transform-origin: center center !important;
    border-radius: 16px !important;
  }
  #settings-popup.settings-popup.open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    animation: celoSettingsGenieIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }
  #settings-popup.settings-popup.closing {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none !important;
    animation: celoSettingsGenieOut 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
  }
  #settings-popup-close,
  .settings-popup-close,
  .settings-popup-header {
    display: none !important;
  }
}
@media (max-width: 640px) {
  #settings-popup.settings-popup {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #0e0e10 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)) 16px !important;
    box-sizing: border-box !important;
    z-index: 10002 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;

    display: none !important;
    opacity: 0;
    pointer-events: none !important;
  }
  #settings-popup.settings-popup.open {
    display: block !important;
    pointer-events: auto !important;
    animation: celoSettingsGenieIn 0.2s ease-in-out forwards !important;
  }
  #settings-popup.settings-popup.closing {
    display: block !important;
    pointer-events: none !important;
    animation: celoSettingsGenieOut 0.2s ease-in-out forwards !important;
  }
  #settings-popup.settings-popup.mobile-settings-underlay {
    display: block !important;
    pointer-events: none !important;
    animation: celoUnderlayPushBack 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }
  #settings-popup.settings-popup.open.restoring {
    display: block !important;
    pointer-events: none !important;
    animation: celoUnderlayRestore 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }
  #settings-popup.settings-popup.open.no-anim {
    display: block !important;
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
    animation: none !important;
    pointer-events: auto !important;
  }
  #settings-popup.settings-popup.swiping-down {
    display: block !important;
    pointer-events: auto !important;
    animation: none !important;
    border-top-left-radius: 32px !important;
    border-top-right-radius: 32px !important;
    overflow: hidden !important;
    will-change: transform, opacity, border-radius !important;
  }

  /* Clean Settings Header: right-aligned close button */
  .settings-popup-header {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    padding: 0 0 10px 0 !important;
    margin-bottom: 4px !important;
    flex-shrink: 0 !important;
    height: 34px !important;
    min-height: 34px !important;
  }

  /* Close button on mobile settings popup header */
  #settings-popup-close,
  .settings-popup-close {
    position: static !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
    border: none !important;
    outline: none !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--muted, #a1a1aa) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    box-sizing: border-box !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  #settings-popup-close svg,
  .settings-popup-close svg {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
    pointer-events: none !important;
    margin: auto !important;
  }
  #settings-popup-close:hover,
  .settings-popup-close:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
  }
  #settings-popup-close:active,
  .settings-popup-close:active {
    background: rgba(239, 68, 68, 0.24) !important;
    color: #ef4444 !important;
    transform: scale(0.94) !important;
  }

  /* Items matching screenshot */
  #settings-popup .settings-item {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 14px !important;
    margin: 2px 0 !important;
    border-radius: 12px !important;
    border: none !important;
    background: transparent !important;
    color: #9ca3af !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    text-align: left !important;
    box-sizing: border-box !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  #settings-popup .settings-item svg:first-child {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    color: #9ca3af !important;
    stroke: currentColor !important;
    display: block !important;
    transition: color 0.15s ease !important;
  }
  #settings-popup .settings-item svg[fill="currentColor"]:first-child {
    fill: currentColor !important;
  }
  #settings-popup .settings-item .data-control-icon {
    display: inline-flex !important;
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;
    align-items: center !important;
    justify-content: center !important;
  }
  #settings-popup .settings-item > span:not(.data-control-icon) {
    color: inherit !important;
    font-size: 15px !important;
    font-weight: inherit !important;
    flex: 1 !important;
  }
  #settings-popup .settings-item:hover {
    background: transparent !important;
    color: #9ca3af !important;
  }
  #settings-popup .settings-item:hover svg:first-child {
    color: #9ca3af !important;
  }
  #settings-popup .settings-item.active {
    background: transparent !important;
    color: #9ca3af !important;
  }
  #settings-popup .settings-item.active svg:first-child {
    color: #9ca3af !important;
  }
  #settings-popup .settings-item:active {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
  }
  #settings-popup .settings-item:active svg:first-child {
    color: #ffffff !important;
  }
  #settings-popup .settings-item.settings-signout-item {
    color: #ef4444 !important;
  }
  #settings-popup .settings-item.settings-signout-item svg:first-child {
    color: #ef4444 !important;
  }
  #settings-popup .settings-chevron {
    display: none !important;
  }
  #settings-popup .settings-sep {
    height: 1px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    margin: 6px 4px !important;
    border: none !important;
  }
}

/* ── Page Transitions (Connections, Chat Search, New Chat) ── */
#connections-page.fade-in {
  animation: celoPageFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
#connections-page.fade-out {
  animation: celoPageFadeOut 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
@keyframes celoPageFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes celoPageFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

body.theme-light #settings-popup.settings-popup,
html[data-theme="light"] #settings-popup.settings-popup {
  background: rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
}

body.theme-midnight #settings-popup.settings-popup,
html[data-theme="midnight"] #settings-popup.settings-popup {
  background: rgba(10, 12, 16, 0.4) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.52) !important;
}

/* ── Warning Modal Styles ── */
.warning-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.78) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.warning-modal-overlay.open {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.warning-modal-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}
.warning-modal-box {
  width: min(440px, calc(100vw - 32px));
  background: rgba(22, 22, 26, 0.98);
  border: none !important;
  border-width: 0 !important;
  border-radius: 20px;
  padding: 24px 24px 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8) !important;
  text-align: left !important;
  position: relative;
  z-index: 2;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.warning-modal-overlay.open .warning-modal-box {
  transform: scale(1) translateY(0);
}
.warning-modal-icon {
  display: none !important;
}
.warning-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  text-align: left !important;
  margin-bottom: 14px;
}
.warning-modal-subtitle {
  display: none !important;
}
.warning-modal-details {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  margin-bottom: 16px;
}
.warning-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  padding: 4px 0;
}
.warning-detail-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 4px;
  padding-bottom: 8px;
}
.warning-label {
  color: #71717a;
  font-weight: 500;
  flex-shrink: 0;
}
.warning-value {
  color: #e4e4e7;
  text-align: right;
  word-break: break-word;
}
.warning-modal-disclaimer {
  font-size: 12px;
  color: #71717a;
  line-height: 1.4;
  margin: 0 0 20px;
  text-align: left;
}
.warning-modal-actions {
  width: 100%;
}
.warning-ack-btn {
  position: relative;
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 600;
  cursor: not-allowed;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: none !important;
  user-select: none;
  box-shadow: none !important;
}
.warning-ack-btn:not(:disabled) {
  background: var(--accent-primary, #10b981) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary, #10b981) !important;
  cursor: pointer;
  box-shadow: none !important;
}
.warning-ack-btn:not(:disabled):hover {
  background: var(--accent-primary, #10b981) !important;
  border-color: var(--accent-primary, #10b981) !important;
  transform: none !important;
  box-shadow: none !important;
}
.warning-ack-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--accent-primary, #10b981) !important;
  transition: width 1s linear;
  pointer-events: none;
}
.warning-ack-label {
  position: relative;
  z-index: 2;
  color: #ffffff !important;
}

.announcement-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.72) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.announcement-modal-overlay.open {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.announcement-modal-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}
.announcement-modal-box {
  width: min(440px, calc(100vw - 32px));
  background: rgba(22, 22, 26, 0.98);
  border: none !important;
  border-width: 0 !important;
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 32px rgba(96, 165, 250, 0.1);
  text-align: center;
  position: relative;
  z-index: 2;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.announcement-modal-overlay.open .announcement-modal-box {
  transform: scale(1) translateY(0);
}
.announcement-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.announcement-modal-content {
  font-size: 14px;
  color: #d4d4d8;
  line-height: 1.55;
  margin-bottom: 20px;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}
.announcement-modal-actions {
  width: 100%;
}
.announce-ack-btn {
  position: relative;
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
  font-size: 14px;
  font-weight: 600;
  cursor: not-allowed;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
}
.announce-ack-btn:not(:disabled) {
  background: #60a5fa;
  color: #000;
  border-color: #60a5fa;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(96, 165, 250, 0.35);
}
.announce-ack-btn:not(:disabled):hover {
  background: #3b82f6;
  border-color: #3b82f6;
}
.announce-ack-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(96, 165, 250, 0.25);
  transition: width 1s linear;
  pointer-events: none;
}
.announce-ack-label {
  position: relative;
  z-index: 2;
}

/* ── Temporary Chat Send Button ── */
body.temporary-chat #send-btn,
#main.temporary-chat #send-btn {
  background: #e4e4e7 !important;
  color: #18181b !important;
  border-color: #e4e4e7 !important;
}
body.temporary-chat #send-btn svg,
#main.temporary-chat #send-btn svg {
  stroke: #18181b !important;
  color: #18181b !important;
}

/* ── Subtle Welcome Fade In ── */
@keyframes welcomeSubtleFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.welcome-typewriter.fade-in {
  animation: fadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

/* ── Pinned Chat Separators ── */
.conv-sep,
.chat-search-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 8px;
  flex-shrink: 0;
}
body.theme-light .conv-sep,
body.theme-light .chat-search-sep,
html[data-theme="light"] .conv-sep,
html[data-theme="light"] .chat-search-sep {
  background: rgba(0, 0, 0, 0.08);
}

/* ── Mobile Scroll & Bubble Refinements ── */
@media (max-width: 640px) {
  html,
  body {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }
  #app {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }
  #main {
    height: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  #main:not(.has-welcome) #chat-window {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: contain !important;
  }
  #main.has-welcome #chat-window {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  #chat-window .message,
  #chat-window .bubble {
    touch-action: pan-y !important;
  }
  .message.user .bubble {
    border-radius: 20px 20px 6px 20px !important;
    padding: 10px 16px !important;
    max-width: 86% !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
  }
  .message.user.editing .bubble {
    padding: 10px 18px !important;
    max-width: 92% !important;
  }
  .chat-skeleton-bubble.user {
    border-radius: 20px 20px 6px 20px !important;
    padding: 10px 16px !important;
    max-width: 86% !important;
  }
  #sidebar {
    touch-action: pan-y !important;
  }
  #sidebar .conv-list,
  .conv-list {
    flex: 1 1 0px !important;
    min-height: 0 !important;
    height: 0 !important;
    max-height: none !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: auto !important;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
  }
  #sidebar .sb-top,
  #sidebar .sb-actions,
  #sidebar .sb-divider {
    flex-shrink: 0 !important;
  }
  #sidebar .sb-footer {
    flex-shrink: 0 !important;
    margin-top: 0 !important;
    margin-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
  #model-menu {
    touch-action: pan-y !important;
    overscroll-behavior: contain !important;
  }
  #model-menu-inner {
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior: contain !important;
    max-height: min(280px, 48dvh) !important;
    -webkit-user-select: none !important;
    user-select: none !important;
  }
  .model-opt,
  .model-menu-heading {
    touch-action: pan-y !important;
  }

  /* Keyboard-open adaptive layout: make completely unscrollable when keyboard is open */
  body.keyboard-open,
  html.keyboard-open {
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
  }
  body.keyboard-open #app {
    position: fixed !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
  }
  body.keyboard-open #main {
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
  }
  body.keyboard-open #chat-window {
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
  }
  body.keyboard-open #input-area {
    touch-action: none !important;
    overscroll-behavior: none !important;
  }
  body.keyboard-open #user-input {
    touch-action: pan-y !important;
  }
  body.keyboard-open #main.has-welcome #chat-window .welcome {
    margin-bottom: 8px !important;
    transform: scale(0.92);
    transition: transform 0.2s ease, margin 0.2s ease;
  }
  body.keyboard-open #main.has-welcome #input-area {
    padding-bottom: 6px !important;
  }
  body.keyboard-open #mobile-topbar {
    position: fixed !important;
    top: 0 !important;
  }
}

/* ── Authoritative Auth Modal Styling (ChatGPT Style with Transparent BG) ── */
#auth-screen {
  position: fixed !important;
  inset: 0 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10005 !important;
  padding: 20px !important;
  padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
  box-sizing: border-box !important;
}

#auth-screen.visible {
  display: flex !important;
}

#auth-screen .auth-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0) !important;
  opacity: 0 !important;
  backdrop-filter: blur(0px) !important;
  -webkit-backdrop-filter: blur(0px) !important;
  transition: opacity 0.22s ease, backdrop-filter 0.22s ease, -webkit-backdrop-filter 0.22s ease, background 0.22s ease !important;
  pointer-events: none !important;
}

#auth-screen.visible .auth-backdrop {
  background: rgba(0, 0, 0, 0.65) !important;
  opacity: 1 !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  pointer-events: auto !important;
}

#auth-screen .auth-box {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  max-width: 410px !important;
  padding: 38px 32px 34px !important;
  background: rgba(28, 28, 28, 0.72) !important;
  border-radius: 28px !important;
  border: none !important;
  outline: none !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(32px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(32px) saturate(1.4) !important;
  box-sizing: border-box !important;
  opacity: 0 !important;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), transform 0.22s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

#auth-screen.visible .auth-box {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}

#auth-screen.visible .auth-box.shake-modal,
#auth-screen .auth-box.shake-modal,
.auth-box.shake-modal {
  animation: authBoxShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
  transition: none !important;
}

@keyframes authBoxShake {
  0%, 100% {
    translate: 0 0;
    transform: translateY(0) scale(1) translateX(0);
  }
  15%, 45%, 75% {
    translate: -9px 0;
    transform: translateY(0) scale(1) translateX(-9px);
  }
  30%, 60%, 90% {
    translate: 9px 0;
    transform: translateY(0) scale(1) translateX(9px);
  }
}

#auth-screen .auth-box h2 {
  font-size: 24px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  text-align: center !important;
  letter-spacing: -0.3px !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.25 !important;
}

#auth-screen .auth-box .auth-sub {
  color: #a1a1aa !important;
  font-size: 14px !important;
  text-align: center !important;
  margin: 0 auto 24px auto !important;
  line-height: 1.45 !important;
  max-width: 320px !important;
}

#auth-screen .auth-steps {
  display: none !important;
}

#auth-screen .auth-back {
  position: absolute !important;
  top: 18px !important;
  left: 18px !important;
  z-index: 10 !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  color: #9ca3af !important;
  cursor: pointer !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

#auth-screen .auth-back:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

#auth-screen .auth-back svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
}

#auth-screen .auth-close {
  position: absolute !important;
  top: 18px !important;
  right: 18px !important;
  z-index: 10 !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  color: #9ca3af !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

#auth-screen .auth-close:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

#auth-screen .auth-close svg {
  width: 14px !important;
  height: 14px !important;
  stroke: currentColor !important;
}

#auth-screen .auth-provider-stack {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100% !important;
  margin-bottom: 4px !important;
}

#auth-screen .auth-provider-btn {
  width: 100% !important;
  height: 52px !important;
  min-height: 52px !important;
  border-radius: 9999px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #ffffff !important;
  cursor: pointer !important;
  padding: 0 16px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
  font-family: inherit !important;
  text-decoration: none !important;
  transform: none !important;
  box-shadow: none !important;
}

#auth-screen .auth-provider-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: none !important;
  box-shadow: none !important;
}

#auth-screen .auth-provider-btn:active {
  transform: none !important;
  background: rgba(255, 255, 255, 0.22) !important;
  box-shadow: none !important;
}

#auth-screen .auth-provider-btn .provider-icon {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
  display: block !important;
}

#auth-screen .auth-divider-line {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  margin: 18px 0 16px !important;
  width: 100% !important;
}

#auth-screen .auth-divider-line::before,
#auth-screen .auth-divider-line::after {
  content: "" !important;
  flex: 1 !important;
  height: 1px !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

#auth-screen .auth-divider-line span {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #71717a !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase !important;
}

#auth-screen .auth-field {
  margin-bottom: 14px !important;
  width: 100% !important;
}

#auth-screen .auth-field input,
#auth-screen .password-field input,
#auth-screen #auth-email,
#auth-screen #auth-password,
#auth-screen #auth-name {
  width: 100% !important;
  height: 52px !important;
  padding: 0 22px !important;
  background: #000000 !important;
  border: none !important;
  outline: none !important;
  border-radius: 9999px !important;
  color: #ffffff !important;
  font-size: 15px !important;
  box-sizing: border-box !important;
  transition: box-shadow 0.2s ease, background 0.2s ease !important;
  font-family: inherit !important;
}

#auth-screen .auth-field input::placeholder,
#auth-screen .password-field input::placeholder {
  color: #71717a !important;
}

#auth-screen .auth-field input:focus,
#auth-screen .password-field input:focus,
#auth-screen #auth-email:focus,
#auth-screen #auth-password:focus,
#auth-screen #auth-name:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3) !important;
}

#auth-screen .password-field input,
#auth-screen #auth-password {
  padding-right: 56px !important;
}

#auth-screen .password-toggle {
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 32px !important;
  height: 32px !important;
  border: none !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #a1a1aa !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.15s ease, background 0.15s ease !important;
}

#auth-screen .password-toggle:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Password Strength Meter (Bars Only) */
#auth-screen .password-strength-wrap {
  margin: -6px 6px 14px 6px !important;
  display: flex;
  flex-direction: column;
  gap: 0 !important;
  box-sizing: border-box !important;
}

#auth-screen .password-strength-meter {
  display: flex !important;
  gap: 6px !important;
  width: 100% !important;
}

#auth-screen .strength-bar {
  flex: 1 !important;
  height: 3px !important;
  border-radius: 9999px !important;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.25s ease !important;
}

#auth-screen .password-strength-label {
  display: none !important;
}

#auth-screen .auth-btn {
  width: 100% !important;
  height: 52px !important;
  border-radius: 9999px !important;
  background: #ffffff !important;
  color: #000000 !important;
  border: none !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  transition: background 0.15s ease !important;
  box-shadow: none !important;
  margin-top: 4px !important;
  font-family: inherit !important;
  transform: none !important;
}

#auth-screen .auth-btn:hover {
  background: #b5b5b5 !important;
  transform: none !important;
  box-shadow: none !important;
}

#auth-screen .auth-btn:active {
  transform: none !important;
  background: #9e9e9e !important;
  box-shadow: none !important;
}

#auth-screen .auth-btn:disabled {
  opacity: 0.85 !important;
  cursor: not-allowed !important;
}

#auth-screen .auth-btn .auth-btn-spinner,
#auth-submit-btn .auth-btn-spinner,
#auth-continue-btn .auth-btn-spinner,
#auth-verify-btn .auth-btn-spinner {
  border: 2.5px solid rgba(0, 0, 0, 0.2) !important;
  border-top-color: #000000 !important;
}

#auth-screen #auth-verify-code {
  letter-spacing: 8px !important;
  text-align: center !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  padding: 10px 14px !important;
}

#auth-screen .auth-secondary-actions button {
  color: #a1a1aa !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: color 0.15s ease !important;
}

#auth-screen .auth-secondary-actions button:hover {
  color: #ffffff !important;
}

@media (max-width: 640px) {
  #auth-screen {
    padding: 16px !important;
  }
  #auth-screen .auth-box {
    max-width: 100% !important;
    padding: 32px 20px 28px !important;
    border-radius: 24px !important;
  }
}

/* ═════════════════════════════════════════════════════════════════════════════
   LIGHT THEME AUTHORITATIVE SUITE (No pure white, no dark overlays, clean UI)
   ═════════════════════════════════════════════════════════════════════════════ */

/* 1. Modal & Popup Overlays / Backdrops (Fix muddy grey screen in light mode) */
body.theme-light .settings-detail-screen.open.visible .settings-detail-backdrop,
html[data-theme="light"] .settings-detail-screen.open.visible .settings-detail-backdrop,
body.theme-light .celo-confirm-backdrop,
html[data-theme="light"] .celo-confirm-backdrop,
body.theme-light .modal-bg .modal-backdrop,
html[data-theme="light"] .modal-bg .modal-backdrop,
body.theme-light .chat-search-screen.open.visible .chat-search-backdrop,
html[data-theme="light"] .chat-search-screen.open.visible .chat-search-backdrop,
body.theme-light #overlay,
html[data-theme="light"] #overlay {
  background: rgba(17, 20, 24, 0.18) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

/* 2. Settings Modal Overhaul */
body.theme-light .settings-detail-box,
html[data-theme="light"] .settings-detail-box {
  background: #eaedf1 !important;
  border: 1px solid #c6ccd5 !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15) !important;
  color: #111418 !important;
}

body.theme-light .settings-detail-layout,
html[data-theme="light"] .settings-detail-layout {
  background: #eaedf1 !important;
}

body.theme-light .settings-sidenav,
html[data-theme="light"] .settings-sidenav {
  background: #dfe3e8 !important;
  border-right: 1px solid #c6ccd5 !important;
}

body.theme-light .settings-sidenav-item,
html[data-theme="light"] .settings-sidenav-item {
  color: #111418 !important;
}
body.theme-light .settings-sidenav-item svg,
html[data-theme="light"] .settings-sidenav-item svg {
  color: #5e6673 !important;
}
body.theme-light .settings-sidenav-item:hover,
html[data-theme="light"] .settings-sidenav-item:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #111418 !important;
}
body.theme-light .settings-sidenav-item.active,
html[data-theme="light"] .settings-sidenav-item.active {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #111418 !important;
  font-weight: 600 !important;
}
body.theme-light .settings-sidenav-item.active svg,
html[data-theme="light"] .settings-sidenav-item.active svg {
  color: #1f6feb !important;
}

body.theme-light .settings-detail-content,
html[data-theme="light"] .settings-detail-content {
  background: #eaedf1 !important;
  color: #111418 !important;
}

body.theme-light .settings-title,
html[data-theme="light"] .settings-title {
  color: #111418 !important;
  font-weight: 700 !important;
}

body.theme-light .settings-sub,
html[data-theme="light"] .settings-sub {
  color: #5e6673 !important;
}

body.theme-light .settings-textarea,
html[data-theme="light"] .settings-textarea {
  background: #dfe3e8 !important;
  border: none !important;
  border-width: 0 !important;
  color: #111418 !important;
}
body.theme-light .settings-textarea::placeholder,
html[data-theme="light"] .settings-textarea::placeholder {
  color: #7b8390 !important;
}

body.theme-light .settings-word-count,
html[data-theme="light"] .settings-word-count {
  color: #7b8390 !important;
}

body.theme-light .settings-detail-close,
html[data-theme="light"] .settings-detail-close {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111418 !important;
  border-radius: 8px !important;
}
body.theme-light .settings-detail-close:hover,
html[data-theme="light"] .settings-detail-close:hover {
  background: rgba(0, 0, 0, 0.12) !important;
  color: #111418 !important;
}
body.theme-light .settings-detail-close svg,
html[data-theme="light"] .settings-detail-close svg {
  stroke: #111418 !important;
}

body.theme-light .settings-detail-back,
html[data-theme="light"] .settings-detail-back {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111418 !important;
}
body.theme-light .settings-detail-back:hover,
html[data-theme="light"] .settings-detail-back:hover {
  background: rgba(0, 0, 0, 0.12) !important;
}

body.theme-light .settings-detail-content input:not([type="color"]):not(.profile-name-input),
body.theme-light .settings-detail-content select,
html[data-theme="light"] .settings-detail-content input:not([type="color"]):not(.profile-name-input),
html[data-theme="light"] .settings-detail-content select {
  background: #dfe3e8 !important;
  border: 1px solid #c6ccd5 !important;
  color: #111418 !important;
}

body.theme-light .settings-community-link,
html[data-theme="light"] .settings-community-link {
  color: #5e6673 !important;
}
body.theme-light .settings-community-link .settings-community-text,
html[data-theme="light"] .settings-community-link .settings-community-text,
body.theme-light .settings-community-link .discord-icon,
html[data-theme="light"] .settings-community-link .discord-icon {
  color: #5e6673 !important;
  fill: #5e6673 !important;
}
body.theme-light .settings-community-link:hover,
html[data-theme="light"] .settings-community-link:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}
body.theme-light .settings-community-link:hover .settings-community-text,
body.theme-light .settings-community-link:hover .discord-icon,
html[data-theme="light"] .settings-community-link:hover .settings-community-text,
html[data-theme="light"] .settings-community-link:hover .discord-icon {
  color: #111418 !important;
  fill: #111418 !important;
}

body.theme-light .usage-card,
html[data-theme="light"] .usage-card {
  background: rgba(0, 0, 0, 0.02) !important;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}
body.theme-light .usage-info-item,
html[data-theme="light"] .usage-info-item {
  background: rgba(0, 0, 0, 0.02) !important;
  border: none !important;
  border-color: transparent !important;
}

/* 3. Share Modal Light Mode */
body.theme-light .share-link-input-wrap,
html[data-theme="light"] .share-link-input-wrap {
  background: #f1f3f6 !important;
  border: none !important;
  border-radius: 16px !important;
}

body.theme-light .share-link-input-wrap:hover,
html[data-theme="light"] .share-link-input-wrap:hover {
  background: #e9ecf0 !important;
  border: none !important;
}

body.theme-light .share-link-text,
html[data-theme="light"] .share-link-text,
body.theme-light #open-link-url-text,
html[data-theme="light"] #open-link-url-text {
  color: #111418 !important;
}

body.theme-light .share-link-copy-icon,
html[data-theme="light"] .share-link-copy-icon {
  color: #5e6673 !important;
}

body.theme-light .share-link-input-wrap:hover .share-link-copy-icon,
html[data-theme="light"] .share-link-input-wrap:hover .share-link-copy-icon {
  color: #111418 !important;
}

/* 4. Popups, Dropdowns & Menus (Fix white text on white & pure white hovers) */
body.theme-light #model-menu,
html[data-theme="light"] #model-menu {
  background: #f1f3f6 !important;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.theme-light .ctx-menu,
html[data-theme="light"] .ctx-menu {
  background: #f1f3f6 !important;
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.theme-light .popup-item,
html[data-theme="light"] .popup-item {
  color: #111418 !important;
  background: transparent !important;
}
body.theme-light .popup-item svg,
body.theme-light .popup-item .popup-icon,
html[data-theme="light"] .popup-item svg,
html[data-theme="light"] .popup-item .popup-icon {
  color: #5e6673 !important;
}

/* Plus Popup & Model Dropdown Hover (Never pure white) */
body.theme-light #plus-popup .popup-item:hover,
html[data-theme="light"] #plus-popup .popup-item:hover,
body.theme-light .plus-popup .popup-item:hover,
html[data-theme="light"] .plus-popup .popup-item:hover,
body.theme-light #model-btn:hover,
html[data-theme="light"] #model-btn:hover,
body.theme-light #popup-web-search:hover,
html[data-theme="light"] #popup-web-search:hover,
body.theme-light #popup-deep-research:hover,
html[data-theme="light"] #popup-deep-research:hover,
body.theme-light #popup-image-gen:hover,
html[data-theme="light"] #popup-image-gen:hover,
body.theme-light .popup-item:hover,
html[data-theme="light"] .popup-item:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111418 !important;
}
body.theme-light #plus-popup .popup-item:hover *,
html[data-theme="light"] #plus-popup .popup-item:hover *,
body.theme-light .plus-popup .popup-item:hover *,
html[data-theme="light"] .plus-popup .popup-item:hover *,
body.theme-light #model-btn:hover *,
html[data-theme="light"] #model-btn:hover *,
body.theme-light #popup-web-search:hover *,
html[data-theme="light"] #popup-web-search:hover *,
body.theme-light #popup-deep-research:hover *,
html[data-theme="light"] #popup-deep-research:hover *,
body.theme-light #popup-image-gen:hover *,
html[data-theme="light"] #popup-image-gen:hover *,
body.theme-light .popup-item:hover *,
html[data-theme="light"] .popup-item:hover * {
  color: #111418 !important;
  stroke: #111418 !important;
}

/* Model Button Open State in Plus Menu */
body.theme-light #model-btn.open,
html[data-theme="light"] #model-btn.open {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111418 !important;
}
body.theme-light #model-btn.open *,
html[data-theme="light"] #model-btn.open * {
  color: #111418 !important;
  stroke: #111418 !important;
}

/* Selected / Active Accent Color in Light Mode */
body.theme-light .popup-item.active,
html[data-theme="light"] .popup-item.active,
body.theme-light #plus-popup .popup-item.active,
html[data-theme="light"] #plus-popup .popup-item.active,
body.theme-light .plus-popup .popup-item.active,
html[data-theme="light"] .plus-popup .popup-item.active,
body.theme-light #popup-web-search.active,
html[data-theme="light"] #popup-web-search.active,
body.theme-light #popup-deep-research.active,
html[data-theme="light"] #popup-deep-research.active {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 12%, transparent) !important;
  color: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .popup-item.active *,
html[data-theme="light"] .popup-item.active *,
body.theme-light #plus-popup .popup-item.active *,
html[data-theme="light"] #plus-popup .popup-item.active *,
body.theme-light .plus-popup .popup-item.active *,
html[data-theme="light"] .plus-popup .popup-item.active *,
body.theme-light #popup-web-search.active *,
html[data-theme="light"] #popup-web-search.active *,
body.theme-light #popup-deep-research.active *,
html[data-theme="light"] #popup-deep-research.active * {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .popup-item.active:hover,
html[data-theme="light"] .popup-item.active:hover,
body.theme-light #plus-popup .popup-item.active:hover,
html[data-theme="light"] #plus-popup .popup-item.active:hover,
body.theme-light .plus-popup .popup-item.active:hover,
html[data-theme="light"] .plus-popup .popup-item.active:hover,
body.theme-light #popup-web-search.active:hover,
html[data-theme="light"] #popup-web-search.active:hover,
body.theme-light #popup-deep-research.active:hover,
html[data-theme="light"] #popup-deep-research.active:hover {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 18%, transparent) !important;
  color: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .popup-item.active:hover *,
html[data-theme="light"] .popup-item.active:hover *,
body.theme-light #plus-popup .popup-item.active:hover *,
html[data-theme="light"] #plus-popup .popup-item.active:hover *,
body.theme-light .plus-popup .popup-item.active:hover *,
html[data-theme="light"] .plus-popup .popup-item.active:hover *,
body.theme-light #popup-web-search.active:hover *,
html[data-theme="light"] #popup-web-search.active:hover *,
body.theme-light #popup-deep-research.active:hover *,
html[data-theme="light"] #popup-deep-research.active:hover * {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}

body.theme-light .model-menu-cat,
html[data-theme="light"] .model-menu-cat {
  color: #6b7280 !important;
}
body.theme-light .model-opt,
html[data-theme="light"] .model-opt {
  color: #111418 !important;
  background: transparent !important;
}
body.theme-light .model-opt:hover,
html[data-theme="light"] .model-opt:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111418 !important;
}
body.theme-light .model-opt.selected,
html[data-theme="light"] .model-opt.selected {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 12%, transparent) !important;
  color: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .model-opt.selected *,
html[data-theme="light"] .model-opt.selected * {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .model-opt.selected:hover,
html[data-theme="light"] .model-opt.selected:hover {
  background: color-mix(in srgb, var(--accent-primary, #1f6feb) 18%, transparent) !important;
  color: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .model-opt.selected:hover *,
html[data-theme="light"] .model-opt.selected:hover * {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}
body.theme-light .model-opt.selected .check,
html[data-theme="light"] .model-opt.selected .check {
  color: var(--accent-primary, #1f6feb) !important;
  stroke: var(--accent-primary, #1f6feb) !important;
}

body.theme-light .ctx-item,
html[data-theme="light"] .ctx-item {
  color: #111418 !important;
  background: transparent !important;
}
body.theme-light .ctx-item:hover,
html[data-theme="light"] .ctx-item:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #111418 !important;
}
body.theme-light .ctx-item.danger,
html[data-theme="light"] .ctx-item.danger {
  color: #dc2626 !important;
}
body.theme-light .ctx-item.danger:hover,
html[data-theme="light"] .ctx-item.danger:hover {
  background: rgba(220, 38, 38, 0.08) !important;
  color: #b91c1c !important;
}
body.theme-light .ctx-item.danger svg,
html[data-theme="light"] .ctx-item.danger svg {
  stroke: #dc2626 !important;
  color: #dc2626 !important;
}
body.theme-light .ctx-item.danger:hover svg,
html[data-theme="light"] .ctx-item.danger:hover svg {
  stroke: #b91c1c !important;
  color: #b91c1c !important;
}

/* 5. Skeleton Loaders in Light Mode */
body.theme-light .chat-skeleton-bubble.user,
html[data-theme="light"] .chat-skeleton-bubble.user {
  background: #d5dae2 !important;
}
body.theme-light .chat-skeleton-bubble.user .full-skeleton-line,
body.theme-light .chat-skeleton-bubble.user .chat-skeleton-line,
html[data-theme="light"] .chat-skeleton-bubble.user .full-skeleton-line,
html[data-theme="light"] .chat-skeleton-bubble.user .chat-skeleton-line {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.14) 50%, rgba(0, 0, 0, 0.06) 100%) !important;
  background-size: 200% 100% !important;
}
body.theme-light .full-skeleton-line,
html[data-theme="light"] .full-skeleton-line,
body.theme-light .inline-skeleton-line,
html[data-theme="light"] .inline-skeleton-line,
body.theme-light .organic-skeleton-loader,
html[data-theme="light"] .organic-skeleton-loader,
body.theme-light .typewriter-trailing-line,
html[data-theme="light"] .typewriter-trailing-line,
body.theme-light .typewriter-ghost-trail,
html[data-theme="light"] .typewriter-ghost-trail,
body.theme-light .sidebar-skeleton-text,
html[data-theme="light"] .sidebar-skeleton-text,
body.theme-light .share-link-skeleton,
html[data-theme="light"] .share-link-skeleton,
body.theme-light .shared-skeleton-line,
html[data-theme="light"] .shared-skeleton-line {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.13) 50%, rgba(0, 0, 0, 0.05) 100%) !important;
  background-size: 200% 100% !important;
}
body.theme-light .image-gen-box-skeleton,
html[data-theme="light"] .image-gen-box-skeleton {
  background: rgba(0, 0, 0, 0.07) !important;
}

/* 6. General Elements & Hovers (Eliminate pure white hovers) */
body.theme-light .sb-search input,
html[data-theme="light"] .sb-search input {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #111418 !important;
}
body.theme-light .sb-search input:focus,
html[data-theme="light"] .sb-search input:focus {
  background: rgba(0, 0, 0, 0.08) !important;
}
body.theme-light .sb-search-collapsed-btn,
html[data-theme="light"] .sb-search-collapsed-btn {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #111418 !important;
}
body.theme-light .sb-search-collapsed-btn:hover,
html[data-theme="light"] .sb-search-collapsed-btn:hover {
  background: rgba(0, 0, 0, 0.09) !important;
  color: #111418 !important;
}

/* ─── Targeted Fixes for Light Theme & Borderless Usage Card ─── */

/* 1. User Edit Update Button in Light Theme */
body.theme-light .user-edit-btn.submit,
body.theme-light button.user-edit-btn.submit,
html[data-theme="light"] .user-edit-btn.submit,
html[data-theme="light"] button.user-edit-btn.submit {
  background: #d5dae2 !important;
  color: #8c93a0 !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}
body.theme-light .user-edit-btn.submit:not(:disabled),
body.theme-light button.user-edit-btn.submit:not(:disabled),
html[data-theme="light"] .user-edit-btn.submit:not(:disabled),
html[data-theme="light"] button.user-edit-btn.submit:not(:disabled) {
  background: #111418 !important;
  color: #ffffff !important;
  cursor: pointer !important;
  opacity: 1 !important;
}
body.theme-light .user-edit-btn.submit:hover:not(:disabled),
body.theme-light button.user-edit-btn.submit:hover:not(:disabled),
html[data-theme="light"] .user-edit-btn.submit:hover:not(:disabled),
html[data-theme="light"] button.user-edit-btn.submit:hover:not(:disabled) {
  background: #27272a !important;
}

/* 2. Borderless Usage Card across ALL themes */
.usage-card,
body.theme-light .usage-card,
html[data-theme="light"] .usage-card,
body.theme-midnight .usage-card,
html[data-theme="midnight"] .usage-card,
body.theme-oled .usage-card,
html[data-theme="oled"] .usage-card {
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

/* 3. Settings Sidenav Icons Stable Color on Hover & Active (White on dark, Dark on light) */
.settings-sidenav-item:not(.active) svg,
.settings-sidenav-item:not(.active):hover svg,
.settings-sidenav-item:not(.active) .data-control-icon,
.settings-sidenav-item:not(.active):hover .data-control-icon {
  color: var(--muted, #8e8ea0) !important;
  stroke: currentColor !important;
}
.settings-sidenav-item.active svg,
.settings-sidenav-item.active:hover svg,
.settings-sidenav-item.active .data-control-icon,
.settings-sidenav-item.active:hover .data-control-icon {
  color: #ffffff !important;
  stroke: currentColor !important;
}

body.theme-light .settings-sidenav-item:not(.active) svg,
body.theme-light .settings-sidenav-item:not(.active):hover svg,
body.theme-light .settings-sidenav-item:not(.active) .data-control-icon,
body.theme-light .settings-sidenav-item:not(.active):hover .data-control-icon,
html[data-theme="light"] .settings-sidenav-item:not(.active) svg,
html[data-theme="light"] .settings-sidenav-item:not(.active):hover svg,
html[data-theme="light"] .settings-sidenav-item:not(.active) .data-control-icon,
html[data-theme="light"] .settings-sidenav-item:not(.active):hover .data-control-icon {
  color: #5e6673 !important;
  stroke: currentColor !important;
}
body.theme-light .settings-sidenav-item.active svg,
body.theme-light .settings-sidenav-item.active:hover svg,
body.theme-light .settings-sidenav-item.active .data-control-icon,
body.theme-light .settings-sidenav-item.active:hover .data-control-icon,
html[data-theme="light"] .settings-sidenav-item.active svg,
html[data-theme="light"] .settings-sidenav-item.active:hover svg,
html[data-theme="light"] .settings-sidenav-item.active .data-control-icon,
html[data-theme="light"] .settings-sidenav-item.active:hover .data-control-icon {
  color: #111418 !important;
  stroke: currentColor !important;
}

/* 4. Settings Button Hover & Active in Light Theme */
body.theme-light .sb-cog-btn,
body.theme-light #settings-btn,
body.theme-light button#settings-btn,
body.theme-light .sb-collapsed-btn,
body.theme-light button.sb-collapsed-btn,
body.theme-light #sb-collapsed-settings-btn,
body.theme-light #sb-collapsed-auth-btn,
html[data-theme="light"] .sb-cog-btn,
html[data-theme="light"] #settings-btn,
html[data-theme="light"] button#settings-btn,
html[data-theme="light"] .sb-collapsed-btn,
html[data-theme="light"] button.sb-collapsed-btn,
html[data-theme="light"] #sb-collapsed-settings-btn,
html[data-theme="light"] #sb-collapsed-auth-btn {
  color: #5e6673 !important;
}
body.theme-light .sb-cog-btn:hover,
body.theme-light #settings-btn:hover,
body.theme-light #settings-btn.active,
body.theme-light button#settings-btn:hover,
body.theme-light button#settings-btn.active,
body.theme-light .sb-collapsed-btn:hover,
body.theme-light .sb-collapsed-btn.active,
body.theme-light #sb-collapsed-settings-btn:hover,
body.theme-light #sb-collapsed-settings-btn.active,
body.theme-light #sb-collapsed-auth-btn:hover,
html[data-theme="light"] .sb-cog-btn:hover,
html[data-theme="light"] #settings-btn:hover,
html[data-theme="light"] #settings-btn.active,
html[data-theme="light"] button#settings-btn:hover,
html[data-theme="light"] button#settings-btn.active,
html[data-theme="light"] .sb-collapsed-btn:hover,
html[data-theme="light"] .sb-collapsed-btn.active,
html[data-theme="light"] #sb-collapsed-settings-btn:hover,
html[data-theme="light"] #sb-collapsed-settings-btn.active,
html[data-theme="light"] #sb-collapsed-auth-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  background-color: rgba(0, 0, 0, 0.06) !important;
  color: #111418 !important;
}
body.theme-light .sb-cog-btn:hover svg,
body.theme-light #settings-btn:hover svg,
body.theme-light #settings-btn.active svg,
body.theme-light button#settings-btn:hover svg,
body.theme-light button#settings-btn.active svg,
body.theme-light .sb-collapsed-btn:hover svg,
body.theme-light .sb-collapsed-btn.active svg,
body.theme-light #sb-collapsed-settings-btn:hover svg,
body.theme-light #sb-collapsed-settings-btn.active svg,
body.theme-light #sb-collapsed-auth-btn:hover svg,
html[data-theme="light"] .sb-cog-btn:hover svg,
html[data-theme="light"] #settings-btn:hover svg,
html[data-theme="light"] #settings-btn.active svg,
html[data-theme="light"] button#settings-btn:hover svg,
html[data-theme="light"] button#settings-btn.active svg,
html[data-theme="light"] .sb-collapsed-btn:hover svg,
html[data-theme="light"] .sb-collapsed-btn.active svg,
html[data-theme="light"] #sb-collapsed-settings-btn:hover svg,
html[data-theme="light"] #sb-collapsed-settings-btn.active svg,
html[data-theme="light"] #sb-collapsed-auth-btn:hover svg {
  color: #111418 !important;
  stroke: #111418 !important;
}

body.theme-light .settings-item:hover,
html[data-theme="light"] .settings-item:hover,
body.theme-light #settings-popup .settings-item:hover,
html[data-theme="light"] #settings-popup .settings-item:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #111418 !important;
}

/* ─── Shake Animation for Auth & Unsaved Settings ─── */
@keyframes celoShake {
  0%, 100% {
    translate: 0 0;
    transform: translateX(0);
  }
  15%, 45%, 75% {
    translate: -10px 0;
    transform: translateX(-10px);
  }
  30%, 60%, 90% {
    translate: 10px 0;
    transform: translateX(10px);
  }
}

.shake-modal,
.settings-detail-screen.open.visible .settings-detail-box.shake-modal,
.settings-detail-screen .settings-detail-box.shake-modal,
.settings-detail-box.shake-modal,
#settings-popup.shake-modal,
#auth-screen.visible .auth-box.shake-modal,
#auth-screen .auth-box.shake-modal,
.auth-box.shake-modal {
  animation: celoShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
  transition: none !important;
}

/* ─── Custom CSS Tooltips ─── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1c1e22;
  color: #f3f4f6;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 999999;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
body.theme-light [data-tooltip]::after,
html[data-theme="light"] [data-tooltip]::after {
  background: #ffffff;
  color: #111418;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Position Temporary Chat and user prompt toggle tooltips to the left of the button */
#ghost-mode-btn[data-tooltip]::after,
#mobile-ghost-btn[data-tooltip]::after,
.user-prompt-toggle-pill[data-tooltip]::after {
  bottom: auto !important;
  top: 50% !important;
  left: auto !important;
  right: calc(100% + 8px) !important;
  transform: translateY(-50%) translateX(4px) !important;
  white-space: nowrap !important;
}

#ghost-mode-btn[data-tooltip]:hover::after,
#mobile-ghost-btn[data-tooltip]:hover::after,
.user-prompt-toggle-pill[data-tooltip]:hover::after {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(-50%) translateX(0) !important;
}

/* Position sidebar toggle button tooltip to the left (or right when collapsed) */
.sb-toggle[data-tooltip]::after {
  bottom: auto !important;
  top: 50% !important;
  left: auto !important;
  right: calc(100% + 10px) !important;
  transform: translateY(-50%) translateX(4px) !important;
  white-space: nowrap !important;
}
.sb-toggle[data-tooltip]:hover::after {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(-50%) translateX(0) !important;
}
#sidebar.collapsed .sb-toggle[data-tooltip]::after {
  right: auto !important;
  left: calc(100% + 10px) !important;
  transform: translateY(-50%) translateX(-4px) !important;
}
#sidebar.collapsed .sb-toggle[data-tooltip]:hover::after {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(-50%) translateX(0) !important;
}

/* Position Edit Email and Reset Password buttons tooltips to the left */
#auth-change-email-btn[data-tooltip]::after,
#auth-password-email-btn[data-tooltip]::after,
.auth-action-btn[data-tooltip]::after {
  bottom: auto !important;
  top: 50% !important;
  left: auto !important;
  right: calc(100% + 10px) !important;
  transform: translateY(-50%) translateX(4px) !important;
  white-space: nowrap !important;
}
#auth-change-email-btn[data-tooltip]:hover::after,
#auth-password-email-btn[data-tooltip]:hover::after,
.auth-action-btn[data-tooltip]:hover::after {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(-50%) translateX(0) !important;
}

/* Hide tooltip immediately when clicked / active / tray opened */
[data-tooltip]:active::after,
[data-tooltip].tooltip-hidden::after,
#plus-btn.active::after,
#plus-btn:active::after,
.sb-toggle:active::after,
#mobile-sidebar-fab:active::after,
.auth-action-btn:active::after {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: none !important;
}

/* Sidebar footer smooth transition helpers */
body.sb-footer-transitioning .sb-footer {
  overflow: hidden !important;
}
body.sb-footer-transitioning #sb-profile-row,
body.sb-footer-transitioning #guest-login-cta,
body.sb-footer-transitioning #sb-collapsed-auth-btn,
body.sb-footer-transitioning #sb-collapsed-settings-btn {
  pointer-events: none !important;
}
body:not(.sb-footer-transitioning) #guest-login-cta,
body:not(.sb-footer-transitioning) .guest-login-cta,
body:not(.sb-footer-transitioning) .guest-login-button,
body:not(.sb-footer-transitioning) #sb-collapsed-auth-btn {
  pointer-events: auto !important;
}
.sb-footer .guest-login-cta {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.sb-profile-row,
.guest-login-cta,
.sb-collapsed-btn {
  will-change: opacity, transform;
}

/* Guest Feature Popover Backdrop Disabled */
.guest-popover-backdrop {
  display: none !important;
  pointer-events: none !important;
}

/* CeloAPI Key Skeleton Loading */
.celoapi-key-wrap.celoapi-key-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 99px !important;
}
.celoapi-key-wrap.celoapi-key-skeleton #celoapi-key {
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}
.celoapi-key-wrap.celoapi-key-skeleton #celoapi-key::placeholder {
  color: transparent !important;
}
.celoapi-key-wrap.celoapi-key-skeleton::after {
  content: "";
  position: absolute;
  inset: 7px 42px 7px 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: celoapiSkeletonShimmer 1.5s infinite linear;
  border-radius: 99px !important;
  pointer-events: none;
}
@keyframes celoapiSkeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Smooth theme transition across UI components */
body,
#main,
#sidebar,
.bar,
.chat-search-container,
.settings-modal,
.settings-detail-box,
.user-msg,
.ai-msg,
.chat-msg-row,
.chat-item,
.usage-card,
.profile-name-input,
.celo-model-dropdown,
.model-menu-button,
.sidebar-section-header,
.settings-nav-item {
  transition: background-color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ── User Prompt Collapsible Pill & Dropdown ── */
.user-bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  opacity: 1;
  transition: opacity 0.12s ease-in-out !important;
}

.user-bubble-text.is-fading {
  opacity: 0 !important;
}

.user-bubble-text.is-collapsed {
  max-height: 112px !important;
  overflow: hidden !important;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 65%, transparent 100%) !important;
  mask-image: linear-gradient(180deg, #000 0%, #000 65%, transparent 100%) !important;
  position: relative !important;
  cursor: pointer;
}

.user-bubble-text.is-expanded {
  max-height: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

.message.user .bubble.is-collapsible,
.message.user .bubble.is-boxy {
  border-radius: 26px !important;
  padding: 14px 20px 14px 20px !important;
  position: relative !important;
  overflow: visible !important;
  min-width: 160px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: none !important;
  outline: none !important;
  backdrop-filter: blur(20px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
  box-shadow: none !important;
  transition: padding 0.15s ease !important;
}

.message.user .bubble.is-collapsible.is-expanded,
.message.user .bubble.is-boxy.is-expanded {
  padding-bottom: 34px !important;
  border-radius: 26px !important;
  overflow: visible !important;
}

.message.user .bubble.is-collapsible:has(.user-bubble-text.is-collapsed),
.message.user .bubble.is-boxy:has(.user-bubble-text.is-collapsed) {
  cursor: pointer !important;
}

.user-prompt-toggle-pill {
  position: absolute !important;
  bottom: 8px !important;
  right: 12px !important;
  width: 26px !important;
  height: 22px !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: rgba(255, 255, 255, 0.72) !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 12 !important;
  outline: none !important;
  transform: none !important;
  box-shadow: none !important;
  transition: color 0.15s ease !important;
}

.user-prompt-toggle-pill:hover {
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  transform: none !important;
  box-shadow: none !important;
}

.user-prompt-toggle-pill:active {
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  transform: none !important;
  box-shadow: none !important;
}

body.theme-light .user-prompt-toggle-pill,
html[data-theme="light"] .user-prompt-toggle-pill {
  background: transparent !important;
  border: none !important;
  color: rgba(0, 0, 0, 0.55) !important;
  box-shadow: none !important;
  transform: none !important;
}

body.theme-light .user-prompt-toggle-pill:hover,
html[data-theme="light"] .user-prompt-toggle-pill:hover {
  background: transparent !important;
  border: none !important;
  color: #000000 !important;
  transform: none !important;
}

body.theme-light .user-prompt-toggle-pill:active,
html[data-theme="light"] .user-prompt-toggle-pill:active {
  background: transparent !important;
  border: none !important;
  transform: none !important;
}

.user-prompt-chevron {
  display: block !important;
  pointer-events: none !important;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transform-origin: center center !important;
}

.bubble.is-expanded .user-prompt-chevron,
.user-prompt-toggle-pill.is-expanded .user-prompt-chevron {
  transform: rotate(180deg) !important;
}

body.theme-light .user-prompt-toggle-pill,
html[data-theme="light"] .user-prompt-toggle-pill {
  background: rgba(0, 0, 0, 0.12) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #374151 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
  transform: none !important;
}

body.theme-light .user-prompt-toggle-pill:hover,
html[data-theme="light"] .user-prompt-toggle-pill:hover {
  background: rgba(0, 0, 0, 0.2) !important;
  color: #111827 !important;
  transform: none !important;
}

body.theme-light .user-prompt-toggle-pill:active,
html[data-theme="light"] .user-prompt-toggle-pill:active {
  background: rgba(0, 0, 0, 0.26) !important;
  transform: none !important;
}

/* ── User Attachment Thumbnail & Clean Display ── */
.bubble-attachment-thumb {
  width: 56px !important;
  height: 56px !important;
  border-radius: 12px !important;
  object-fit: cover !important;
  display: block !important;
  cursor: pointer !important;
  transition: opacity 0.15s ease !important;
  transform: none !important;
}

.bubble-attachment-thumb:hover {
  opacity: 0.88 !important;
  transform: none !important;
}

.message.user .bubble-attachment-caption {
  display: none !important;
}

/* ── Clean Smooth Sidebar Transitions ── */
#sidebar {
  transition: width 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

#sidebar.collapsed .conv-title,
#sidebar.collapsed .conv-group-header,
#sidebar.collapsed .conv-group-label,
#sidebar.collapsed .new-chat-btn span,
#sidebar.collapsed .sb-footer-btn span,
#sidebar.collapsed .profile-info,
#sidebar.collapsed .sb-logo,
#sidebar.collapsed .sb-search-expanded-btn,
#sidebar.collapsed .guest-login-cta {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.08s ease !important;
}

#sidebar:not(.collapsed) .conv-title,
#sidebar:not(.collapsed) .conv-group-header,
#sidebar:not(.collapsed) .conv-group-label,
#sidebar:not(.collapsed) .new-chat-btn span,
#sidebar:not(.collapsed) .sb-footer-btn span,
#sidebar:not(.collapsed) .profile-info,
#sidebar:not(.collapsed) .sb-logo,
#sidebar:not(.collapsed) .sb-search-expanded-btn,
#sidebar:not(.collapsed) .guest-login-cta {
  opacity: 1;
  transition: opacity 0.12s ease 0.1s;
}

#sidebar .conv-item,
#sidebar .new-chat-btn,
#sidebar .sb-footer-btn,
#sidebar .profile-row {
  white-space: nowrap !important;
  overflow: hidden !important;
}

#sidebar .conv-item svg,
#sidebar .new-chat-btn svg,
#sidebar .sb-footer-btn svg,
#sidebar .avatar {
  flex-shrink: 0 !important;
}

/* Sidebar action buttons alignment (straight in both expanded and collapsed) */
#sidebar.collapsed .sb-actions {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 6px 0 0 !important;
  gap: 6px !important;
  width: 100% !important;
  margin: 0 !important;
}

#sidebar.collapsed .sb-actions .new-chat-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  gap: 0 !important;
}

#sidebar.collapsed .sb-actions .new-chat-btn svg {
  display: block !important;
  margin: 0 auto !important;
  flex-shrink: 0 !important;
  width: 16px !important;
  height: 16px !important;
}

#sidebar.collapsed .sb-actions .new-chat-btn span {
  display: none !important;
}

#sidebar:not(.collapsed) .sb-actions {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  padding: 6px 10px 0 !important;
  gap: 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#sidebar:not(.collapsed) .sb-actions .new-chat-btn {
  width: 100% !important;
  height: 36px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  border-radius: 20px !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}

#sidebar:not(.collapsed) .sb-actions .new-chat-btn svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
  display: block !important;
}

/* Reverted sidebar hover effect to original neutral translucency */
.sb-search-chats-btn:hover,
.sb-search-chats-btn:focus-visible,
.sb-search-expanded-btn:hover,
.sb-search-collapsed-btn:hover,
.sb-nav-btn:hover,
.sb-nav-btn:focus-visible,
#sb-connections-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

.sb-search-chats-btn:active,
.sb-search-expanded-btn:active,
.sb-search-collapsed-btn:active,
.sb-nav-btn:active,
.sb-nav-btn.active,
#sb-connections-btn:active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

body.theme-light .sb-search-chats-btn:hover,
html[data-theme="light"] .sb-search-chats-btn:hover,
body.theme-light .sb-search-expanded-btn:hover,
html[data-theme="light"] .sb-search-expanded-btn:hover,
body.theme-light .sb-search-collapsed-btn:hover,
html[data-theme="light"] .sb-search-collapsed-btn:hover,
body.theme-light .sb-nav-btn:hover,
html[data-theme="light"] .sb-nav-btn:hover,
body.theme-light #sb-connections-btn:hover,
html[data-theme="light"] #sb-connections-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #1a1a1a !important;
}

/* Ensure buttons never lift when hovering on them */
button:hover,
[role="button"]:hover,
.btn:hover,
.cookie-btn:hover,
.celo-btn-confirm:hover,
.celo-btn-cancel:hover,
.auth-btn:hover,
.auth-provider-btn:hover {
  transform: none;
}

/* ── Beta Environment Tag & Modal ── */
.beta-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: 8px;
  background: rgba(234, 179, 8, 0.16) !important;
  color: #facc15 !important;
  border: 1px solid rgba(234, 179, 8, 0.35) !important;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.18);
  vertical-align: middle;
  line-height: 1.2;
}

.beta-welcome-box {
  max-width: 440px !important;
  text-align: left;
}

.beta-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 12px;
  background: rgba(234, 179, 8, 0.16) !important;
  color: #facc15 !important;
  border: 1px solid rgba(234, 179, 8, 0.32) !important;
  width: fit-content;
}

.beta-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.beta-release-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e5e7eb !important;
  border-radius: 10px !important;
  padding: 8px 14px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.beta-release-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

.beta-continue-btn {
  border-radius: 10px !important;
  padding: 8px 16px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
}

/* Discord Widget */
#discord-widget {
  position: absolute;
  bottom: 16px;
  right: 20px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 11px;
  border-radius: 999px;
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--text, #f3f5f8);
  background: rgba(30, 31, 35, 0.84);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  border: none !important;
  outline: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity, background;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
              visibility 0.25s,
              background 0.2s ease,
              box-shadow 0.2s ease,
              color 0.2s ease !important;
}

#main.has-welcome #discord-widget {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

#main:not(.has-welcome) #discord-widget,
#main.input-is-fullscreen #discord-widget,
body.on-connections-page #discord-widget,
#overlay.show ~ #main #discord-widget {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(8px) scale(0.96) !important;
}

#discord-widget:hover {
  background: rgba(48, 50, 55, 0.94);
  border: none !important;
  outline: none;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  transform: translateY(-1.5px) scale(1.02);
  color: #ffffff;
}

#discord-widget:active {
  background: rgba(58, 60, 66, 0.96);
  transform: translateY(1px) scale(0.94) !important;
  transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.1s ease !important;
}

#discord-widget:active .discord-widget-icon {
  transform: scale(1);
}

#discord-widget:active .discord-widget-arrow {
  transform: translate(0, 0);
}

.discord-widget-icon {
  width: 18px;
  height: 18px;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #5865f2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#discord-widget:hover .discord-widget-icon {
  transform: scale(1.08);
}

.discord-widget-text {
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.discord-widget-arrow {
  color: #8c95a6;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
}

#discord-widget:hover .discord-widget-arrow {
  color: #ffffff;
  transform: translate(1.5px, -1.5px);
}

/* Light theme */
body.theme-light #discord-widget,
html[data-theme="light"] #discord-widget {
  background: rgba(235, 237, 240, 0.9);
  border: none !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  color: #1a1f2c;
}

body.theme-light #discord-widget:hover,
html[data-theme="light"] #discord-widget:hover {
  background: rgba(220, 222, 226, 0.96);
  border: none !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
  color: #111827;
}

body.theme-light .discord-widget-arrow,
html[data-theme="light"] .discord-widget-arrow {
  color: #7b8595;
}

body.theme-light #discord-widget:hover .discord-widget-arrow,
html[data-theme="light"] #discord-widget:hover .discord-widget-arrow {
  color: #111827;
}

/* Mobile responsive */
@media (max-width: 640px) {
  #discord-widget {
    bottom: max(12px, env(safe-area-inset-bottom));
    right: 12px;
    padding: 6px 11px 6px 9px;
    font-size: 12px;
    gap: 7px;
  }
  .discord-widget-icon {
    width: 16px;
    height: 16px;
  }
  .discord-widget-icon svg {
    width: 16px;
    height: 16px;
  }
  body.keyboard-open #discord-widget {
    display: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   LIGHT MODE FIXES & POLISH
   ───────────────────────────────────────────────────────────── */

/* 1. Message Action Buttons in Light Mode (Regenerate, Copy, Variants) */
body.theme-light .ai-msg-action-btn,
body.theme-light button.ai-msg-action-btn,
html[data-theme="light"] .ai-msg-action-btn,
html[data-theme="light"] button.ai-msg-action-btn {
  color: #5e6673 !important;
}

body.theme-light .ai-msg-action-btn:hover,
body.theme-light button.ai-msg-action-btn:hover,
html[data-theme="light"] .ai-msg-action-btn:hover,
html[data-theme="light"] button.ai-msg-action-btn:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  background-color: rgba(0, 0, 0, 0.08) !important;
  color: #111418 !important;
}

body.theme-light .ai-msg-action-btn svg,
body.theme-light button.ai-msg-action-btn svg,
html[data-theme="light"] .ai-msg-action-btn svg,
html[data-theme="light"] button.ai-msg-action-btn svg {
  stroke: currentColor !important;
}

body.theme-light .ai-variant-count,
html[data-theme="light"] .ai-variant-count {
  color: #5e6673 !important;
}

/* 2. Sidebar Recents & Pins in Light Mode */
body.theme-light .conv-group-header,
html[data-theme="light"] .conv-group-header,
body.theme-light .conv-group-label,
html[data-theme="light"] .conv-group-label,
body.theme-light .pinned-label,
html[data-theme="light"] .pinned-label {
  color: #64748b !important;
}

body.theme-light .conv-group-triangle,
html[data-theme="light"] .conv-group-triangle {
  color: #64748b !important;
}

body.theme-light .conv-group-header:hover,
html[data-theme="light"] .conv-group-header:hover,
body.theme-light .conv-group-header:hover .conv-group-label,
html[data-theme="light"] .conv-group-header:hover .conv-group-label {
  color: #0f172a !important;
}

body.theme-light .conv-group-header:hover .conv-group-triangle,
html[data-theme="light"] .conv-group-header:hover .conv-group-triangle {
  color: #0f172a !important;
  opacity: 1 !important;
}

body.theme-light .conv-item .conv-title,
html[data-theme="light"] .conv-item .conv-title {
  color: #334155 !important;
}

body.theme-light .conv-item:hover,
html[data-theme="light"] .conv-item:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

body.theme-light .conv-item:hover .conv-title,
html[data-theme="light"] .conv-item:hover .conv-title {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body.theme-light .conv-item.active,
html[data-theme="light"] .conv-item.active {
  background: rgba(0, 0, 0, 0.08) !important;
}

body.theme-light .conv-item.active .conv-title,
html[data-theme="light"] .conv-item.active .conv-title {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body.theme-light .conv-menu-btn,
html[data-theme="light"] .conv-menu-btn {
  color: #64748b !important;
}

body.theme-light .conv-menu-btn:hover,
html[data-theme="light"] .conv-menu-btn:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #0f172a !important;
}

/* 3. Search Screen in Light Mode */
body.theme-light .chat-search-input-wrap,
html[data-theme="light"] .chat-search-input-wrap {
  background: #ffffff !important;
  border: 1px solid #c6ccd5 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

body.theme-light .chat-search-input-wrap input,
html[data-theme="light"] .chat-search-input-wrap input {
  color: #111418 !important;
}

body.theme-light .chat-search-input-wrap input::placeholder,
html[data-theme="light"] .chat-search-input-wrap input::placeholder {
  color: #64748b !important;
}

body.theme-light .chat-search-input-icon,
html[data-theme="light"] .chat-search-input-icon {
  color: #64748b !important;
}

body.theme-light .chat-search-label,
html[data-theme="light"] .chat-search-label {
  color: #475569 !important;
  font-weight: 600 !important;
}

body.theme-light .chat-search-result,
html[data-theme="light"] .chat-search-result {
  color: #1e293b !important;
}

body.theme-light .chat-search-result:hover,
html[data-theme="light"] .chat-search-result:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #0f172a !important;
}

body.theme-light .chat-search-result-title,
html[data-theme="light"] .chat-search-result-title {
  color: #1e293b !important;
}

body.theme-light .chat-search-result:hover .chat-search-result-title,
html[data-theme="light"] .chat-search-result:hover .chat-search-result-title {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body.theme-light .chat-search-result-date,
html[data-theme="light"] .chat-search-result-date {
  color: #64748b !important;
}

body.theme-light .chat-search-results::-webkit-scrollbar-thumb,
html[data-theme="light"] .chat-search-results::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18) !important;
}

/* 4. Settings Pages Across All Panels in Light Mode */

/* Unblocker Page */
body.theme-light .unblocker-card,
html[data-theme="light"] .unblocker-card {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

body.theme-light .unblocker-card-title,
html[data-theme="light"] .unblocker-card-title {
  color: #111418 !important;
}

body.theme-light .unblocker-card-desc,
html[data-theme="light"] .unblocker-card-desc {
  color: #5e6673 !important;
}

body.theme-light .unblocker-preset-chip,
html[data-theme="light"] .unblocker-preset-chip {
  background: #dfe3e8 !important;
  color: #1e293b !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: none !important;
}

body.theme-light .unblocker-preset-chip:hover,
html[data-theme="light"] .unblocker-preset-chip:hover {
  background: #d3d8df !important;
  color: #000000 !important;
}

body.theme-light .unblocker-preset-chip.danger,
html[data-theme="light"] .unblocker-preset-chip.danger {
  background: #dfe3e8 !important;
  color: #dc2626 !important;
  border: none !important;
  border-width: 0 !important;
}

body.theme-light .unblocker-preset-chip.danger:hover,
html[data-theme="light"] .unblocker-preset-chip.danger:hover {
  background: #d3d8df !important;
  color: #b91c1c !important;
}

body.theme-light .unblocker-label,
html[data-theme="light"] .unblocker-label {
  color: #374151 !important;
}

body.theme-light .unblocker-input,
html[data-theme="light"] .unblocker-input {
  background: #dfe3e8 !important;
  color: #111418 !important;
  border: none !important;
  border-width: 0 !important;
}

body.theme-light .unblocker-input:focus,
html[data-theme="light"] .unblocker-input:focus {
  border: none !important;
  box-shadow: 0 0 0 1.5px var(--accent-primary, #1f6feb) !important;
}

body.theme-light .unblocker-input::placeholder,
html[data-theme="light"] .unblocker-input::placeholder {
  color: #7b8390 !important;
}

body.theme-light .panic-key-record-btn,
html[data-theme="light"] .panic-key-record-btn {
  background: #dfe3e8 !important;
  color: #111418 !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: none !important;
}

body.theme-light .panic-key-record-btn:hover,
html[data-theme="light"] .panic-key-record-btn:hover {
  background: #d3d8df !important;
}

body.theme-light #panic-key-display,
html[data-theme="light"] #panic-key-display {
  color: #111418 !important;
}

body.theme-light .panic-key-hint,
html[data-theme="light"] .panic-key-hint {
  color: #64748b !important;
}

/* Authentication Page */
body.theme-light .auth-section-heading,
html[data-theme="light"] .auth-section-heading {
  color: #111418 !important;
}

body.theme-light .auth-section-description,
html[data-theme="light"] .auth-section-description {
  color: #5e6673 !important;
}

body.theme-light .auth-credential-row,
body.theme-light .auth-method-row,
html[data-theme="light"] .auth-credential-row,
html[data-theme="light"] .auth-method-row {
  background: rgba(0, 0, 0, 0.035) !important;
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body.theme-light .auth-credential-copy label,
body.theme-light .auth-credential-copy strong,
html[data-theme="light"] .auth-credential-copy label,
html[data-theme="light"] .auth-credential-copy strong {
  color: #111418 !important;
}

body.theme-light .auth-credential-copy small,
html[data-theme="light"] .auth-credential-copy small {
  color: #5e6673 !important;
}

.auth-credential-copy input,
#auth-account-email-input,
.modal .auth-credential-copy input,
.modal #auth-account-email-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

body.theme-light .auth-credential-copy input,
body.theme-light #auth-account-email-input,
body.theme-light .modal .auth-credential-copy input,
body.theme-light .modal #auth-account-email-input,
html[data-theme="light"] .auth-credential-copy input,
html[data-theme="light"] #auth-account-email-input,
html[data-theme="light"] .modal .auth-credential-copy input,
html[data-theme="light"] .modal #auth-account-email-input {
  color: #111418 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

body.theme-light .auth-action-btn,
body.theme-light .auth-link-btn,
html[data-theme="light"] .auth-action-btn,
html[data-theme="light"] .auth-link-btn {
  background: #dfe3e8 !important;
  color: #111418 !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: none !important;
}

body.theme-light .auth-action-btn:hover,
body.theme-light .auth-link-btn:hover,
html[data-theme="light"] .auth-action-btn:hover,
html[data-theme="light"] .auth-link-btn:hover {
  background: #d3d8df !important;
  color: #000000 !important;
  box-shadow: none !important;
}

body.theme-light .auth-action-btn svg,
html[data-theme="light"] .auth-action-btn svg {
  color: #111418 !important;
  stroke: #111418 !important;
}

body.theme-light .auth-provider-name,
html[data-theme="light"] .auth-provider-name {
  color: #111418 !important;
}

/* Appearance Page */
body.theme-light .appearance-section-label,
html[data-theme="light"] .appearance-section-label {
  color: #475569 !important;
  font-weight: 700 !important;
}

body.theme-light .theme-card,
html[data-theme="light"] .theme-card,
body.theme-light .font-card,
html[data-theme="light"] .font-card {
  background: #dfe3e8 !important;
  background-color: #dfe3e8 !important;
  border: none !important;
  border-width: 0 !important;
  border-radius: 12px !important;
  color: #111418 !important;
  outline: none !important;
}

body.theme-light .theme-card:hover,
html[data-theme="light"] .theme-card:hover,
body.theme-light .font-card:hover,
html[data-theme="light"] .font-card:hover {
  background: #d3d8df !important;
  background-color: #d3d8df !important;
  border: none !important;
  outline: none !important;
}

body.theme-light .theme-card.active,
html[data-theme="light"] .theme-card.active,
body.theme-light .font-card.active,
html[data-theme="light"] .font-card.active {
  background: #cfd5dc !important;
  background-color: #cfd5dc !important;
  border: none !important;
  outline: none !important;
}

body.theme-light .theme-card.active .theme-label,
html[data-theme="light"] .theme-card.active .theme-label,
body.theme-light .font-card.active .font-label,
html[data-theme="light"] .font-card.active .font-label,
body.theme-light .font-card.active .font-preview,
html[data-theme="light"] .font-card.active .font-preview {
  color: var(--accent-primary, #1f6feb) !important;
  font-weight: 700 !important;
}

body.theme-light .theme-label,
html[data-theme="light"] .theme-label,
body.theme-light .font-label,
html[data-theme="light"] .font-label,
body.theme-light .font-preview,
html[data-theme="light"] .font-preview {
  color: #111418 !important;
}

body.theme-light .theme-preview-light,
html[data-theme="light"] .theme-preview-light {
  border: none !important;
}

body.theme-light .accent-custom-swatch,
html[data-theme="light"] .accent-custom-swatch {
  border: none !important;
  border-width: 0 !important;
  color: #111418 !important;
  background: #dfe3e8 !important;
  background-color: #dfe3e8 !important;
  outline: none !important;
}

body.theme-light .accent-custom-swatch:hover,
html[data-theme="light"] .accent-custom-swatch:hover {
  background: #d3d8df !important;
  background-color: #d3d8df !important;
  border: none !important;
}

.accent-custom-swatch.active {
  border: none !important;
  transform: scale(1.15);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4) !important;
}

body.theme-light .accent-custom-swatch.active,
html[data-theme="light"] .accent-custom-swatch.active {
  border-color: #111418 !important;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25) !important;
}

.custom-color-picker {
  position: fixed !important;
  z-index: 10050 !important;
  width: 228px !important;
  display: none !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  padding: 10px !important;
  border-radius: 14px !important;
  background: rgba(28, 31, 38, 0.65) !important;
  border: none !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(28px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(140%) !important;
  box-sizing: border-box !important;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transform-origin: top right !important;
  pointer-events: none;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.custom-color-picker.open {
  display: flex !important;
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
}

.custom-color-picker.closing {
  display: flex !important;
  opacity: 0 !important;
  transform: translateY(4px) scale(0.96) !important;
  pointer-events: none !important;
}

body.theme-light .custom-color-picker,
html[data-theme="light"] .custom-color-picker {
  background: rgba(255, 255, 255, 0.65) !important;
  border: none !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12) !important;
  backdrop-filter: blur(28px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(140%) !important;
}

.custom-color-native {
  width: 99px !important;
  min-width: 99px !important;
  max-width: 99px !important;
  height: 36px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 99px !important;
  background: transparent !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  outline: none !important;
  overflow: hidden !important;
  flex: 0 0 99px !important;
}

body.theme-light .custom-color-native,
html[data-theme="light"] .custom-color-native {
  border: none !important;
}

.custom-color-native::-webkit-color-swatch-wrapper {
  padding: 0 !important;
  border-radius: 99px !important;
  border: none !important;
}

.custom-color-native::-webkit-color-swatch {
  border: none !important;
  border-radius: 99px !important;
}

.custom-color-native::-moz-color-swatch {
  border: none !important;
  border-radius: 99px !important;
}

.custom-color-hex-row,
#custom-color-hex {
  display: none !important;
}

.custom-color-apply {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 99px !important;
  min-width: 99px !important;
  max-width: 99px !important;
  height: 36px !important;
  padding: 0 !important;
  border-radius: 99px !important;
  border: none !important;
  background: var(--accent-primary, #1f6feb) !important;
  color: #ffffff !important;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: filter 0.15s, opacity 0.15s !important;
  flex: 0 0 99px !important;
  box-shadow: none !important;
  transform: none !important;
}

.custom-color-apply:hover {
  filter: brightness(1.08) !important;
  transform: none !important;
}

.custom-color-apply:active {
  transform: none !important;
}

/* Notifications Page */
body.theme-light .notif-permission-bar,
html[data-theme="light"] .notif-permission-bar {
  background: #dfe3e8 !important;
  border: none !important;
}

body.theme-light .notif-permission-bar span,
body.theme-light #notif-permission-text,
html[data-theme="light"] .notif-permission-bar span,
html[data-theme="light"] #notif-permission-text {
  color: #111418 !important;
}

body.theme-light .notif-permission-icon,
html[data-theme="light"] .notif-permission-icon {
  color: var(--accent-primary, #1f6feb) !important;
}

body.theme-light .notif-permission-bar button,
body.theme-light #notif-permission-btn,
html[data-theme="light"] .notif-permission-bar button,
html[data-theme="light"] #notif-permission-btn {
  background: var(--accent-primary, #1f6feb) !important;
  color: #ffffff !important;
}

body.theme-light .notif-row,
html[data-theme="light"] .notif-row {
  background: #dfe3e8 !important;
  border-radius: 12px !important;
  border: none !important;
  border-bottom: none !important;
  padding: 12px 14px !important;
  margin-bottom: 8px !important;
}

body.theme-light .notif-row:hover,
html[data-theme="light"] .notif-row:hover {
  background: #d3d8df !important;
}

body.theme-light .notif-label,
html[data-theme="light"] .notif-label {
  color: #111418 !important;
}

body.theme-light .notif-slider,
html[data-theme="light"] .notif-slider {
  background-color: #c6ccd5 !important;
}

/* Developer Page */
body.theme-light .celoapi-section,
html[data-theme="light"] .celoapi-section {
  background: rgba(0, 0, 0, 0.035) !important;
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body.theme-light .celoapi-section-title,
html[data-theme="light"] .celoapi-section-title {
  color: #111418 !important;
}

body.theme-light .celoapi-row label,
html[data-theme="light"] .celoapi-row label {
  color: #374151 !important;
}

body.theme-light .celoapi-key-wrap,
html[data-theme="light"] .celoapi-key-wrap {
  background: #dfe3e8 !important;
  border: none !important;
  border-width: 0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

body.theme-light .celoapi-key-wrap:hover,
html[data-theme="light"] .celoapi-key-wrap:hover {
  box-shadow: none !important;
  transform: none !important;
}

body.theme-light .celoapi-key-input,
html[data-theme="light"] .celoapi-key-input {
  color: #111418 !important;
  background: transparent !important;
}

body.theme-light .celoapi-icon-copy,
html[data-theme="light"] .celoapi-icon-copy {
  color: #5e6673 !important;
}

body.theme-light .celoapi-language-tabs,
html[data-theme="light"] .celoapi-language-tabs {
  background: #dfe3e8 !important;
  border: none !important;
  border-width: 0 !important;
}

body.theme-light .celoapi-language-tabs button,
html[data-theme="light"] .celoapi-language-tabs button {
  color: #5e6673 !important;
}

body.theme-light .celoapi-language-tabs button.active,
html[data-theme="light"] .celoapi-language-tabs button.active {
  background: #ffffff !important;
  color: #111418 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
}

body.theme-light .celoapi-example-wrap pre,
html[data-theme="light"] .celoapi-example-wrap pre {
  background: #dfe3e8 !important;
  border: 1px solid #c6ccd5 !important;
  color: #111418 !important;
}

body.theme-light .celoapi-stats,
html[data-theme="light"] .celoapi-stats {
  color: #111418 !important;
}

/* Usage Page */
body.theme-light .usage-token-count,
html[data-theme="light"] .usage-token-count,
body.theme-light .usage-percentage,
html[data-theme="light"] .usage-percentage {
  color: #111418 !important;
}

body.theme-light .usage-footer-info,
html[data-theme="light"] .usage-footer-info {
  color: #5e6673 !important;
}

/* Profile Page */
body.theme-light #settings-panel-profile .profile-input-wrap,
html[data-theme="light"] #settings-panel-profile .profile-input-wrap {
  background: #dfe3e8 !important;
  border: none !important;
  border-width: 0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

body.theme-light #settings-panel-profile .profile-input-wrap:hover,
html[data-theme="light"] #settings-panel-profile .profile-input-wrap:hover {
  box-shadow: none !important;
  transform: none !important;
}

body.theme-light .profile-name-input,
html[data-theme="light"] .profile-name-input {
  color: #111418 !important;
  background: transparent !important;
}

body.theme-light .profile-char-count,
html[data-theme="light"] .profile-char-count {
  color: #7b8390 !important;
}

body.theme-light .profile-editor-initials,
html[data-theme="light"] .profile-editor-initials {
  color: #111418 !important;
}

/* BYOK Page */
body.theme-light .byok-section-label,
html[data-theme="light"] .byok-section-label {
  color: #475569 !important;
  font-weight: 700 !important;
}

body.theme-light .byok-get-key-btn,
html[data-theme="light"] .byok-get-key-btn {
  color: var(--accent-primary, #1f6feb) !important;
}

body.theme-light #settings-panel-byok .byok-key-field,
html[data-theme="light"] #settings-panel-byok .byok-key-field,
body.theme-light #settings-panel-byok .donor-key-field,
html[data-theme="light"] #settings-panel-byok .donor-key-field {
  background: #dfe3e8 !important;
  border: none !important;
  border-width: 0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

body.theme-light #settings-panel-byok .byok-key-field:hover,
html[data-theme="light"] #settings-panel-byok .byok-key-field:hover,
body.theme-light #settings-panel-byok .donor-key-field:hover,
html[data-theme="light"] #settings-panel-byok .donor-key-field:hover {
  box-shadow: none !important;
  transform: none !important;
}

body.theme-light .password-toggle,
html[data-theme="light"] .password-toggle {
  color: #5e6673 !important;
}

#settings-panel-data .settings-item {
  background: rgba(255, 255, 255, 0.045) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  margin-bottom: 8px !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  transition: background 0.15s ease !important;
}

#settings-panel-data .settings-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.theme-light #settings-panel-data .settings-item,
html[data-theme="light"] #settings-panel-data .settings-item {
  background: #dfe3e8 !important;
  background-color: #dfe3e8 !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  margin-bottom: 8px !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #111418 !important;
}

body.theme-light #settings-panel-data .settings-item:hover,
html[data-theme="light"] #settings-panel-data .settings-item:hover {
  background: #d3d8df !important;
}

body.theme-light #settings-panel-data .settings-item:hover,
html[data-theme="light"] #settings-panel-data .settings-item:hover {
  background: rgba(0, 0, 0, 0.07) !important;
}

body.theme-light #settings-panel-data .settings-item svg,
html[data-theme="light"] #settings-panel-data .settings-item svg {
  stroke: #111418 !important;
}

body.theme-light #settings-panel-data .settings-item.danger,
html[data-theme="light"] #settings-panel-data .settings-item.danger {
  color: #ef4444 !important;
}

body.theme-light #settings-panel-data .settings-item.danger svg,
html[data-theme="light"] #settings-panel-data .settings-item.danger svg {
  stroke: #ef4444 !important;
}

.shared-link-item,
body.theme-light .shared-link-item,
html[data-theme="light"] .shared-link-item {
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

body.theme-light .shared-link-item,
html[data-theme="light"] .shared-link-item {
  background: #dfe3e8 !important;
}

body.theme-light .shared-link-title,
html[data-theme="light"] .shared-link-title {
  color: #111418 !important;
}

body.theme-light .shared-link-date,
html[data-theme="light"] .shared-link-date {
  color: #5e6673 !important;
}

.shared-link-btn,
body.theme-light .shared-link-btn,
html[data-theme="light"] .shared-link-btn {
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

body.theme-light .shared-link-btn,
html[data-theme="light"] .shared-link-btn {
  color: #5e6673 !important;
  background: transparent !important;
}

body.theme-light .shared-link-btn:hover,
html[data-theme="light"] .shared-link-btn:hover {
  color: #111418 !important;
  background: rgba(0, 0, 0, 0.08) !important;
}

.shared-link-btn.copy-btn .action-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
}

.shared-link-btn.copy-btn .copy-icon,
.shared-link-btn.copy-btn .check-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px !important;
  height: 14px !important;
  display: block;
  transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1), transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.shared-link-btn.copy-btn .copy-icon {
  opacity: 1;
  pointer-events: auto;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.shared-link-btn.copy-btn .copy-icon rect,
.shared-link-btn.copy-btn .copy-icon path {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
}

.shared-link-btn.copy-btn .check-icon {
  opacity: 0;
  transform: scale(0.65);
  pointer-events: none;
  stroke: #22c55e !important;
}

.shared-link-btn.copy-btn.copied .copy-icon {
  opacity: 0;
  transform: scale(0.65);
}

.shared-link-btn.copy-btn.copied .check-icon {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Confirmation Popups (Import, Export, Delete All Chats, Delete Shared Link, Share Modal, etc.) in Light Mode */
body.theme-light .celo-confirm-box,
html[data-theme="light"] .celo-confirm-box,
body.theme-light #delete-chats-confirm-popup .celo-confirm-box,
html[data-theme="light"] #delete-chats-confirm-popup .celo-confirm-box,
body.theme-light #export-confirm-popup .celo-confirm-box,
html[data-theme="light"] #export-confirm-popup .celo-confirm-box,
body.theme-light #import-confirm-popup .celo-confirm-box,
html[data-theme="light"] #import-confirm-popup .celo-confirm-box,
body.theme-light #delete-shared-confirm-popup .celo-confirm-box,
html[data-theme="light"] #delete-shared-confirm-popup .celo-confirm-box {
  background: #ffffff !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid #c6ccd5 !important;
  color: #111418 !important;
}

body.theme-light .celo-confirm-title,
html[data-theme="light"] .celo-confirm-title,
body.theme-light #delete-chats-confirm-popup .celo-confirm-title,
html[data-theme="light"] #delete-chats-confirm-popup .celo-confirm-title,
body.theme-light #export-confirm-popup .celo-confirm-title,
html[data-theme="light"] #export-confirm-popup .celo-confirm-title,
body.theme-light #import-confirm-popup .celo-confirm-title,
html[data-theme="light"] #import-confirm-popup .celo-confirm-title {
  color: #111418 !important;
}

body.theme-light .celo-confirm-proceed,
html[data-theme="light"] .celo-confirm-proceed,
body.theme-light #delete-chats-confirm-popup .celo-confirm-proceed,
html[data-theme="light"] #delete-chats-confirm-popup .celo-confirm-proceed,
body.theme-light #export-confirm-popup .celo-confirm-proceed,
html[data-theme="light"] #export-confirm-popup .celo-confirm-proceed,
body.theme-light #import-confirm-popup .celo-confirm-proceed,
html[data-theme="light"] #import-confirm-popup .celo-confirm-proceed {
  color: #5e6673 !important;
}

body.theme-light .celo-confirm-bullets,
html[data-theme="light"] .celo-confirm-bullets,
body.theme-light .celo-confirm-bullets li,
html[data-theme="light"] .celo-confirm-bullets li,
body.theme-light #export-confirm-popup .celo-confirm-bullets li,
html[data-theme="light"] #export-confirm-popup .celo-confirm-bullets li,
body.theme-light #import-confirm-popup .celo-confirm-bullets li,
html[data-theme="light"] #import-confirm-popup .celo-confirm-bullets li {
  color: #5e6673 !important;
}

body.theme-light .celo-btn-cancel,
body.theme-light .celo-confirm-btn.cancel,
body.theme-light .celo-btn-confirm.secondary,
html[data-theme="light"] .celo-btn-cancel,
html[data-theme="light"] .celo-confirm-btn.cancel,
html[data-theme="light"] .celo-btn-confirm.secondary,
body.theme-light #delete-chats-confirm-popup .celo-btn-cancel,
html[data-theme="light"] #delete-chats-confirm-popup .celo-btn-cancel,
body.theme-light #export-confirm-popup .celo-btn-cancel,
html[data-theme="light"] #export-confirm-popup .celo-btn-cancel,
body.theme-light #import-confirm-popup .celo-btn-cancel,
html[data-theme="light"] #import-confirm-popup .celo-btn-cancel {
  background: #dfe3e8 !important;
  color: #111418 !important;
  border: 1px solid #c6ccd5 !important;
}

body.theme-light .celo-btn-cancel:hover,
body.theme-light .celo-confirm-btn.cancel:hover,
body.theme-light .celo-btn-confirm.secondary:hover,
html[data-theme="light"] .celo-btn-cancel:hover,
html[data-theme="light"] .celo-confirm-btn.cancel:hover,
html[data-theme="light"] .celo-btn-confirm.secondary:hover,
body.theme-light #delete-chats-confirm-popup .celo-btn-cancel:hover,
html[data-theme="light"] #delete-chats-confirm-popup .celo-btn-cancel:hover,
body.theme-light #export-confirm-popup .celo-btn-cancel:hover,
html[data-theme="light"] #export-confirm-popup .celo-btn-cancel:hover,
body.theme-light #import-confirm-popup .celo-btn-cancel:hover,
html[data-theme="light"] #import-confirm-popup .celo-btn-cancel:hover {
  background: #d3d8df !important;
  color: #000000 !important;
  border-color: #b8c0cb !important;
}

body.theme-light .celo-confirm-box .celo-btn-confirm.primary,
html[data-theme="light"] .celo-confirm-box .celo-btn-confirm.primary,
body.theme-light #export-confirm-popup .celo-btn-confirm.primary,
html[data-theme="light"] #export-confirm-popup .celo-btn-confirm.primary,
body.theme-light #import-confirm-popup .celo-btn-confirm.primary,
html[data-theme="light"] #import-confirm-popup .celo-btn-confirm.primary {
  background: var(--accent-primary, #1f6feb) !important;
  color: #ffffff !important;
  border: none !important;
}

body.theme-light .celo-confirm-box .celo-btn-confirm.primary:hover,
html[data-theme="light"] .celo-confirm-box .celo-btn-confirm.primary:hover,
body.theme-light #export-confirm-popup .celo-btn-confirm.primary:hover,
html[data-theme="light"] #export-confirm-popup .celo-btn-confirm.primary:hover,
body.theme-light #import-confirm-popup .celo-btn-confirm.primary:hover,
html[data-theme="light"] #import-confirm-popup .celo-btn-confirm.primary:hover {
  background: var(--accent-primary-hover, #1a60d6) !important;
  color: #ffffff !important;
}

body.theme-light .celo-confirm-box .celo-btn-confirm.danger,
html[data-theme="light"] .celo-confirm-box .celo-btn-confirm.danger,
body.theme-light #delete-chats-confirm-popup .celo-btn-confirm.danger,
html[data-theme="light"] #delete-chats-confirm-popup .celo-btn-confirm.danger,
body.theme-light #delete-shared-confirm-popup .celo-btn-confirm.danger,
html[data-theme="light"] #delete-shared-confirm-popup .celo-btn-confirm.danger {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: none !important;
}

body.theme-light .celo-confirm-box .celo-btn-confirm.danger:hover,
html[data-theme="light"] .celo-confirm-box .celo-btn-confirm.danger:hover,
body.theme-light #delete-chats-confirm-popup .celo-btn-confirm.danger:hover,
html[data-theme="light"] #delete-chats-confirm-popup .celo-btn-confirm.danger:hover,
body.theme-light #delete-shared-confirm-popup .celo-btn-confirm.danger:hover,
html[data-theme="light"] #delete-shared-confirm-popup .celo-btn-confirm.danger:hover {
  background: #b91c1c !important;
  color: #ffffff !important;
}

/* 5. Connection Icons in Light Mode */
body.theme-light .conn-page-card[data-conn="currency"] .conn-page-img,
html[data-theme="light"] .conn-page-card[data-conn="currency"] .conn-page-img {
  content: url("https://www.image2url.com/r2/default/images/1789253039423-5027ef25-bf39-46bc-a6cb-c9c11f307f46.png") !important;
}

body.theme-light .conn-page-card[data-conn="github"] .conn-page-img,
html[data-theme="light"] .conn-page-card[data-conn="github"] .conn-page-img {
  content: url("https://xmorse.gallerycdn.vsassets.io/extensions/xmorse/dark-theme-github/2.0.0/1565294235331/Microsoft.VisualStudio.Services.Icons.Default") !important;
}

body.theme-light .conn-page-card[data-conn="notion"] .conn-page-img,
html[data-theme="light"] .conn-page-card[data-conn="notion"] .conn-page-img {
  content: url("https://images.icon-icons.com/2389/PNG/512/notion_logo_icon_145025.png") !important;
}

body.theme-light #settings-panel-authentication .auth-oauth-list img[alt="GitHub"],
html[data-theme="light"] #settings-panel-authentication .auth-oauth-list img[alt="GitHub"],
body.theme-light .auth-method-row img[src*="github"],
html[data-theme="light"] .auth-method-row img[src*="github"] {
  content: url("https://xmorse.gallerycdn.vsassets.io/extensions/xmorse/dark-theme-github/2.0.0/1565294235331/Microsoft.VisualStudio.Services.Icons.Default") !important;
}

/* 6. Transparent borders for Authentication, Developer, and Unblocking tabs across all themes */
#settings-panel-authentication .auth-credential-row,
#settings-panel-authentication .auth-method-row,
#settings-panel-authentication .auth-settings-section,
#settings-panel-authentication .auth-method-list,
#settings-panel-authentication .auth-delete-btn,
#settings-panel-developer .celoapi-section,
#settings-panel-developer .celoapi-model-picker > button,
#settings-panel-developer .celoapi-model-picker > button:hover,
#settings-panel-developer .celoapi-model-picker > button[aria-expanded="true"],
#settings-panel-developer .celoapi-key-wrap,
#settings-panel-developer .celoapi-language-tabs,
#settings-panel-developer .celoapi-howto pre,
#settings-panel-developer .celoapi-example-wrap pre,
#settings-panel-developer .donor-key-save,
#settings-panel-developer .settings-save-btn,
#settings-panel-unblocker .unblocker-card,
#settings-panel-unblocker .unblocker-preset-chip,
#settings-panel-unblocker .unblocker-input,
#settings-panel-unblocker .panic-key-record-btn,
#settings-panel-unblocker .unblocker-btn,
body.theme-light #settings-panel-authentication .auth-credential-row,
body.theme-light #settings-panel-authentication .auth-method-row,
body.theme-light #settings-panel-authentication .auth-settings-section,
body.theme-light #settings-panel-authentication .auth-method-list,
body.theme-light #settings-panel-authentication .auth-delete-btn,
body.theme-light #settings-panel-developer .celoapi-section,
body.theme-light #settings-panel-developer .celoapi-model-picker > button,
body.theme-light #settings-panel-developer .celoapi-model-picker > button:hover,
body.theme-light #settings-panel-developer .celoapi-model-picker > button[aria-expanded="true"],
body.theme-light #settings-panel-developer .celoapi-key-wrap,
body.theme-light #settings-panel-developer .celoapi-language-tabs,
body.theme-light #settings-panel-developer .celoapi-howto pre,
body.theme-light #settings-panel-developer .celoapi-example-wrap pre,
body.theme-light #settings-panel-developer .donor-key-save,
body.theme-light #settings-panel-developer .settings-save-btn,
body.theme-light #settings-panel-unblocker .unblocker-card,
body.theme-light #settings-panel-unblocker .unblocker-preset-chip,
body.theme-light #settings-panel-unblocker .unblocker-input,
body.theme-light #settings-panel-unblocker .panic-key-record-btn,
body.theme-light #settings-panel-unblocker .unblocker-btn,
html[data-theme="light"] #settings-panel-authentication .auth-credential-row,
html[data-theme="light"] #settings-panel-authentication .auth-method-row,
html[data-theme="light"] #settings-panel-authentication .auth-settings-section,
html[data-theme="light"] #settings-panel-authentication .auth-method-list,
html[data-theme="light"] #settings-panel-authentication .auth-delete-btn,
html[data-theme="light"] #settings-panel-developer .celoapi-section,
html[data-theme="light"] #settings-panel-developer .celoapi-model-picker > button,
html[data-theme="light"] #settings-panel-developer .celoapi-model-picker > button:hover,
html[data-theme="light"] #settings-panel-developer .celoapi-model-picker > button[aria-expanded="true"],
html[data-theme="light"] #settings-panel-developer .celoapi-key-wrap,
html[data-theme="light"] #settings-panel-developer .celoapi-language-tabs,
html[data-theme="light"] #settings-panel-developer .celoapi-howto pre,
html[data-theme="light"] #settings-panel-developer .celoapi-example-wrap pre,
html[data-theme="light"] #settings-panel-developer .donor-key-save,
html[data-theme="light"] #settings-panel-developer .settings-save-btn,
html[data-theme="light"] #settings-panel-unblocker .unblocker-card,
html[data-theme="light"] #settings-panel-unblocker .unblocker-preset-chip,
html[data-theme="light"] #settings-panel-unblocker .unblocker-input,
html[data-theme="light"] #settings-panel-unblocker .panic-key-record-btn,
html[data-theme="light"] #settings-panel-unblocker .unblocker-btn {
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* 7. Transparent border for Settings Popup on dark theme */
body:not(.theme-light) #settings-popup.settings-popup,
html:not([data-theme="light"]) #settings-popup.settings-popup,
body.theme-dark #settings-popup.settings-popup,
body.theme-midnight #settings-popup.settings-popup,
html[data-theme="dark"] #settings-popup.settings-popup,
html[data-theme="midnight"] #settings-popup.settings-popup,
body:not(.theme-light) .settings-popup,
html:not([data-theme="light"]) .settings-popup,
body:not(.theme-light) #account-popup.settings-popup,
html:not([data-theme="light"]) #account-popup.settings-popup {
  border: 1px solid transparent !important;
  border-color: transparent !important;
}

/* 8. Temp Chat (Ghost Mode) button light theme styling */
body.theme-light #ghost-mode-btn,
html[data-theme="light"] #ghost-mode-btn {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #5e6673 !important;
  transition: background 0.2s, color 0.2s, transform 0.15s !important;
}

body.theme-light #ghost-mode-btn:hover,
html[data-theme="light"] #ghost-mode-btn:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #111418 !important;
}

body.theme-light #ghost-mode-btn:active,
html[data-theme="light"] #ghost-mode-btn:active {
  background: rgba(0, 0, 0, 0.12) !important;
  color: #111418 !important;
  transform: scale(0.95) !important;
}

body.theme-light #ghost-mode-btn.active,
html[data-theme="light"] #ghost-mode-btn.active,
body.theme-light.temporary-chat #ghost-mode-btn,
body.theme-light #main.temporary-chat #ghost-mode-btn,
html[data-theme="light"] body.temporary-chat #ghost-mode-btn,
html[data-theme="light"] #main.temporary-chat #ghost-mode-btn {
  background: rgba(0, 0, 0, 0.09) !important;
  color: #111418 !important;
}

body.theme-light #ghost-mode-btn svg,
html[data-theme="light"] #ghost-mode-btn svg {
  color: #5e6673 !important;
  stroke: currentColor !important;
}

body.theme-light #ghost-mode-btn:hover svg,
html[data-theme="light"] #ghost-mode-btn:hover svg {
  color: #111418 !important;
  stroke: currentColor !important;
}

body.theme-light #ghost-mode-btn.active svg,
html[data-theme="light"] #ghost-mode-btn.active svg,
body.theme-light #ghost-mode-btn:active svg,
html[data-theme="light"] #ghost-mode-btn:active svg,
body.theme-light.temporary-chat #ghost-mode-btn svg,
body.theme-light #main.temporary-chat #ghost-mode-btn svg,
html[data-theme="light"] body.temporary-chat #ghost-mode-btn svg,
html[data-theme="light"] #main.temporary-chat #ghost-mode-btn svg {
  color: #111418 !important;
  stroke: #111418 !important;
}

/* Mobile ghost button light theme styling */
body.theme-light #mobile-ghost-btn,
html[data-theme="light"] #mobile-ghost-btn {
  color: #5e6673 !important;
  background: transparent !important;
}

body.theme-light #mobile-ghost-btn:hover,
html[data-theme="light"] #mobile-ghost-btn:hover {
  color: #111418 !important;
  background: transparent !important;
}

body.theme-light #mobile-ghost-btn.active,
html[data-theme="light"] #mobile-ghost-btn.active,
body.theme-light #mobile-ghost-btn:active,
html[data-theme="light"] #mobile-ghost-btn:active,
body.theme-light.temporary-chat #mobile-ghost-btn,
html[data-theme="light"] body.temporary-chat #mobile-ghost-btn {
  color: #111418 !important;
  background: transparent !important;
}

body.theme-light #mobile-ghost-btn svg,
html[data-theme="light"] #mobile-ghost-btn svg {
  color: #5e6673 !important;
  stroke: currentColor !important;
}

body.theme-light #mobile-ghost-btn:hover svg,
html[data-theme="light"] #mobile-ghost-btn:hover svg,
body.theme-light #mobile-ghost-btn.active svg,
html[data-theme="light"] #mobile-ghost-btn.active svg,
body.theme-light #mobile-ghost-btn:active svg,
html[data-theme="light"] #mobile-ghost-btn:active svg,
body.theme-light.temporary-chat #mobile-ghost-btn svg,
html[data-theme="light"] body.temporary-chat #mobile-ghost-btn svg {
  color: #111418 !important;
  stroke: currentColor !important;
}

/* 9. Universal Copy Icon styling across all themes */
.copy-icon,
svg.copy-icon {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.copy-icon rect,
svg.copy-icon rect,
.copy-icon path,
svg.copy-icon path {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
}

body.user-logged-in #celo-public-entry-frame,
html.user-logged-in #celo-public-entry-frame,
body:not(.user-guest) #celo-public-entry-frame,
html:not(.user-guest) #celo-public-entry-frame {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* 10. Developer Tab Buttons Completely Rounded to 99px */
#settings-panel-developer button:not(.celoapi-icon-copy),
#settings-panel-developer .donor-key-save,
#settings-panel-developer .settings-save-btn,
#settings-panel-developer .celoapi-model-picker > button,
#settings-panel-developer .celoapi-language-tabs button,
.celoapi-section .settings-save-btn,
.celoapi-section .donor-key-save,
.donor-key-save {
  border-radius: 99px !important;
}

/* 11. Context Menu (Three-dot Popup) Completely Borderless Across All Themes */
#ctx-menu,
.ctx-menu,
body.theme-light #ctx-menu,
html[data-theme="light"] #ctx-menu,
body.theme-light .ctx-menu,
html[data-theme="light"] .ctx-menu {
  border: none !important;
  border-width: 0 !important;
  border-color: transparent !important;
  outline: none !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65) !important;
}
body.theme-light #ctx-menu,
html[data-theme="light"] #ctx-menu,
body.theme-light .ctx-menu,
html[data-theme="light"] .ctx-menu {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
}

/* 12. External Link Dotted Underline & Link Popups */
#open-link-url-text,
#open-link-confirm-modal .share-link-text,
.share-link-text,
.chat-inline-link,
.chat-inline-link-text,
.bubble a:not(.artifact-link):not(.button-link):not(.code-block-action):not(.source-item):not([class*="btn"]),
.markdown-body a:not(.artifact-link):not(.button-link):not(.code-block-action):not(.source-item):not([class*="btn"]) {
  text-decoration: underline dotted !important;
  text-underline-offset: 3.5px !important;
  text-decoration-thickness: 1.5px !important;
}

/* 13. Thinking Text & Bubble Unhighlightable */
.thinking-bubble,
.thinking-bubble *,
.thinking-text,
.thinking-dot {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}
.thinking-bubble::selection,
.thinking-bubble *::selection,
.thinking-text::selection {
  background: transparent !important;
  color: inherit !important;
}

/* ── BYOD Domain Notice Toast ── */
.byod-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999999;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  width: auto !important;
  max-width: calc(100vw - 48px) !important;
  padding: 10px 12px 10px 18px !important;
  background: rgba(26, 29, 34, 0.76) !important;
  backdrop-filter: blur(32px) saturate(1.25) !important;
  -webkit-backdrop-filter: blur(32px) saturate(1.25) !important;
  border: none !important;
  border-radius: 9999px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.2) !important;
  color: #f3f4f6;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  cursor: pointer;
  animation: byodToastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.22s ease, transform 0.22s ease;
  user-select: none;
}

@keyframes byodToastSlideIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.byod-toast-title {
  display: inline-flex !important;
  align-items: center !important;
  font-weight: 650 !important;
  font-size: 13.5px !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  letter-spacing: -0.1px !important;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.byod-toast-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  background: var(--accent-primary, #1f6feb) !important;
  color: #fff !important;
  border-radius: 50% !important;
  text-decoration: none !important;
  border: none !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease !important;
}

.byod-toast-btn:hover {
  background: var(--accent-primary-hover, #1a60d6) !important;
  filter: brightness(1.15) !important;
  transform: scale(1.08) !important;
}

.byod-toast.fade-out {
  animation: byodToastFadeOut 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  pointer-events: none !important;
}

@keyframes byodToastFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

.byod-toast,
.byod-toast *,
.byod-toast-btn {
  pointer-events: auto;
}

.byod-toast[data-tooltip]::before,
.byod-toast[data-tooltip]::after,
.byod-toast *[data-tooltip]::before,
.byod-toast *[data-tooltip]::after {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ── Floating Scroll-to-Bottom Button (Just a Down Arrow) ── */
.scroll-to-bottom-btn {
  position: absolute;
  bottom: 84px;
  right: 28px;
  left: auto;
  transform: translateY(10px) scale(0.92);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none !important;
  box-shadow: none !important;
  color: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.15s ease;
  outline: none;
  padding: 0;
}

.scroll-to-bottom-btn[data-tooltip]::before,
.scroll-to-bottom-btn[data-tooltip]::after,
#scroll-to-bottom-btn[data-tooltip]::before,
#scroll-to-bottom-btn[data-tooltip]::after {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.scroll-to-bottom-btn.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.scroll-to-bottom-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border: none !important;
  box-shadow: none !important;
  transform: translateY(0) scale(1) !important;
}

.scroll-to-bottom-btn:active {
  background: rgba(255, 255, 255, 0.22);
  border: none !important;
  box-shadow: none !important;
  transform: translateY(0) scale(0.96) !important;
}

body.theme-light .scroll-to-bottom-btn,
html[data-theme="light"] .scroll-to-bottom-btn {
  background: rgba(0, 0, 0, 0.06);
  border: none !important;
  box-shadow: none !important;
  color: #1f2937;
}

body.theme-light .scroll-to-bottom-btn:hover,
html[data-theme="light"] .scroll-to-bottom-btn:hover {
  background: rgba(0, 0, 0, 0.12);
  border: none !important;
  box-shadow: none !important;
  transform: translateY(0) !important;
}

/* ── Jev AI Decision Mode Input UI ── */
.bar.jev-mode {
  border-radius: 24px !important;
  gap: 8px !important;
  padding: 10px 14px 12px 12px !important;
}

#jev-question-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: inherit;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.45;
  resize: none;
  max-height: 120px;
  min-height: 24px;
  padding: 4px 0;
  box-sizing: border-box;
}

#jev-question-input::placeholder {
  color: var(--placeholder, rgba(255, 255, 255, 0.38));
}

.jev-options-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  animation: jevPanelFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes jevPanelFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.jev-options-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.jev-options-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.42);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
}

.jev-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06) !important;
  border: none !important;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-primary, #58a6ff);
  cursor: pointer;
  font-family: inherit;
  user-select: none;
  transition: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.jev-add-btn:hover,
.jev-add-btn:active {
  background: rgba(255, 255, 255, 0.06) !important;
  border: none !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

.jev-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-height: 125px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.jev-options-list::-webkit-scrollbar {
  width: 4px;
}
.jev-options-list::-webkit-scrollbar-track {
  background: transparent;
}
.jev-options-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.jev-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.jev-option-num {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.38);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  font-family: 'Manrope', sans-serif;
  user-select: none;
}

.jev-option-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.05) !important;
  border: none !important;
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 13.5px;
  color: #f3f4f6;
  outline: none !important;
  box-shadow: none !important;
  transition: background 0.18s;
  font-family: inherit;
  box-sizing: border-box;
}

.jev-option-input:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.jev-option-input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.jev-option-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.jev-option-remove:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

/* Jev Mode Light Theme */
body.theme-light .jev-options-panel,
html[data-theme="light"] .jev-options-panel {
  border-top-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .jev-options-label,
html[data-theme="light"] .jev-options-label {
  color: rgba(0, 0, 0, 0.45);
}

body.theme-light .jev-add-btn,
html[data-theme="light"] .jev-add-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  border: none !important;
  color: #1f6feb;
}

body.theme-light .jev-add-btn:hover,
html[data-theme="light"] .jev-add-btn:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  border: none !important;
  transform: none !important;
}

body.theme-light .jev-option-num,
html[data-theme="light"] .jev-option-num {
  color: rgba(0, 0, 0, 0.4);
}

body.theme-light .jev-option-input,
html[data-theme="light"] .jev-option-input {
  background: rgba(0, 0, 0, 0.04) !important;
  border: none !important;
  color: #111827;
}

body.theme-light .jev-option-input:focus,
html[data-theme="light"] .jev-option-input:focus {
  background: rgba(0, 0, 0, 0.06) !important;
  border: none !important;
  outline: none !important;
}

body.theme-light .jev-option-input::placeholder,
html[data-theme="light"] .jev-option-input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

body.theme-light .jev-option-remove,
html[data-theme="light"] .jev-option-remove {
  color: rgba(0, 0, 0, 0.35);
}

body.theme-light #jev-question-input::placeholder,
html[data-theme="light"] #jev-question-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

/* ── Jev Decision Response & Compact Styling ── */
.jev-decision-box {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 7px 12px;
  width: fit-content;
  max-width: 360px;
  margin: 2px 0 8px 0;
  border: none !important;
  box-shadow: none !important;
}

.jev-decision-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #f3f4f6;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.jev-decision-title strong {
  font-weight: 700;
  color: #ffffff;
}

.jev-decision-sep {
  color: rgba(255, 255, 255, 0.25);
  font-size: 11px;
}

.jev-decision-conf {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

.jev-progress-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 4px 0 6px 0;
  width: 100%;
  max-width: 360px;
}

.jev-progress-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: none !important;
  box-shadow: none !important;
  border-radius: 10px;
  padding: 7px 12px;
  transition: background 0.2s ease;
}

.jev-progress-item.chosen {
  background: rgba(255, 255, 255, 0.08);
  border: none !important;
  box-shadow: none !important;
}

.jev-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.jev-progress-name {
  font-weight: 600;
  font-size: 13px;
  color: #f3f4f6;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jev-progress-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  padding: 1.5px 6px;
  border-radius: 9999px;
  border: none !important;
}

.jev-progress-pct {
  font-weight: 700;
  font-size: 12.5px;
  color: #e5e7eb;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.jev-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  border: none !important;
}

.jev-progress-fill {
  height: 100%;
  background: #d1d5db;
  border-radius: 9999px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.jev-progress-item:not(.chosen) .jev-progress-fill {
  background: rgba(255, 255, 255, 0.22);
}

/* Jev Speed Footer */
.jev-footer {
  font-size: 10.5px;
  color: #8b949e;
  margin-top: 8px;
  letter-spacing: 0.2px;
  opacity: 0.85;
}

/* Ensure confidence box and blockquotes in Jev response are borderless, compact, and grey */
.message.ai.is-jev blockquote,
.bubble:has(.jev-progress-card) blockquote,
.bubble:has(.jev-decision-box) blockquote,
.bubble:has(.jev-footer) blockquote {
  border: none !important;
  border-left: none !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border-radius: 10px;
  color: #9ca3af;
  margin: 6px 0;
  padding: 6px 12px;
  max-width: 360px;
}

/* Make Jev AI replies completely unhighlightable */
.message.ai.is-jev,
.message.ai.is-jev *,
.message.ai:has(.jev-progress-card),
.message.ai:has(.jev-progress-card) *,
.message.ai:has(.jev-decision-box),
.message.ai:has(.jev-decision-box) *,
.message.ai:has(.jev-footer),
.message.ai:has(.jev-footer) *,
.bubble:has(.jev-progress-card),
.bubble:has(.jev-progress-card) *,
.bubble:has(.jev-decision-box),
.bubble:has(.jev-decision-box) * {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

/* Never show regenerate button on Jev messages */
.message.ai.is-jev .regen-btn,
.message.ai:has(.jev-progress-card) .regen-btn,
.message.ai:has(.jev-decision-box) .regen-btn,
.message.ai:has(.jev-footer) .regen-btn {
  display: none !important;
}

body.theme-light .jev-decision-box,
html[data-theme="light"] .jev-decision-box {
  background: rgba(0, 0, 0, 0.04);
}

body.theme-light .jev-decision-title,
html[data-theme="light"] .jev-decision-title {
  color: #1f2937;
}

body.theme-light .jev-decision-title strong,
html[data-theme="light"] .jev-decision-title strong {
  color: #111827;
}

body.theme-light .jev-decision-sep,
html[data-theme="light"] .jev-decision-sep {
  color: rgba(0, 0, 0, 0.25);
}

body.theme-light .jev-decision-conf,
html[data-theme="light"] .jev-decision-conf {
  color: #6b7280;
}

body.theme-light .jev-progress-item,
html[data-theme="light"] .jev-progress-item {
  background: rgba(0, 0, 0, 0.03);
  border: none !important;
  box-shadow: none !important;
}

body.theme-light .jev-progress-item.chosen,
html[data-theme="light"] .jev-progress-item.chosen {
  background: rgba(0, 0, 0, 0.07);
  border: none !important;
  box-shadow: none !important;
}

body.theme-light .jev-progress-name,
body.theme-light .jev-progress-pct,
html[data-theme="light"] .jev-progress-name,
html[data-theme="light"] .jev-progress-pct {
  color: #1f2937;
}

body.theme-light .jev-progress-badge,
html[data-theme="light"] .jev-progress-badge {
  background: rgba(0, 0, 0, 0.08);
  color: #374151;
}

body.theme-light .jev-progress-track,
html[data-theme="light"] .jev-progress-track {
  background: rgba(0, 0, 0, 0.06);
}

body.theme-light .jev-progress-fill,
html[data-theme="light"] .jev-progress-fill {
  background: #4b5563;
}

body.theme-light .jev-progress-item:not(.chosen) .jev-progress-fill,
html[data-theme="light"] .jev-progress-item:not(.chosen) .jev-progress-fill {
  background: rgba(0, 0, 0, 0.18);
}

body.theme-light .jev-footer,
html[data-theme="light"] .jev-footer {
  color: #6b7280;
}

body.theme-light .message.ai.is-jev blockquote,
body.theme-light .bubble:has(.jev-progress-card) blockquote,
body.theme-light .bubble:has(.jev-decision-box) blockquote,
body.theme-light .bubble:has(.jev-footer) blockquote,
html[data-theme="light"] .message.ai.is-jev blockquote,
html[data-theme="light"] .bubble:has(.jev-progress-card) blockquote,
html[data-theme="light"] .bubble:has(.jev-decision-box) blockquote,
html[data-theme="light"] .bubble:has(.jev-footer) blockquote {
  border: none !important;
  border-left: none !important;
  background: rgba(0, 0, 0, 0.04) !important;
  color: #6b7280;
}

/* ── Usage Limit Banner Above Input Box ── */
.usage-limit-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 16px;
  margin-bottom: 9px;
  border-radius: 18px;
  background: rgba(239, 68, 68, 0.12);
  border: none !important;
  color: #fca5a5;
  font-size: 13px;
  line-height: 1.45;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  animation: fadeUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 22;
}

body.theme-light .usage-limit-banner,
html[data-theme="light"] .usage-limit-banner {
  background: rgba(239, 68, 68, 0.08);
  border: none !important;
  color: #b91c1c;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.usage-limit-banner-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.usage-limit-banner-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: #ef4444;
}

.usage-limit-banner-text {
  flex: 1;
  min-width: 0;
  color: inherit;
}

.usage-limit-link {
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font-weight: 600;
  color: inherit;
}

.usage-limit-link:hover {
  opacity: 0.85;
}

.usage-limit-btn {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 9999px;
  border: none;
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.1s ease;
  white-space: nowrap;
}

.usage-limit-btn:hover {
  background: rgba(239, 68, 68, 0.35);
}

.usage-limit-btn:active {
  transform: scale(0.96);
}

body.theme-light .usage-limit-btn,
html[data-theme="light"] .usage-limit-btn {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
}

body.theme-light .usage-limit-btn:hover,
html[data-theme="light"] .usage-limit-btn:hover {
  background: rgba(239, 68, 68, 0.22);
}

@media (max-width: 640px) {
  .usage-limit-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px;
    gap: 8px;
    font-size: 12.5px;
  }
  .usage-limit-btn {
    align-self: flex-end;
  }
}

