:root {

  --user-chat-width: 100%;

  --user-chat-height: 100%;

  --sidebar-width: 325px;

  --sidebar-height: 100%;
  --spacing: 1rem;


  --home-widgets-spacing: 0.15rem;
  --home-widgets-margins: 0.25rem;
  --home-widgets-text-size: 1em;

  --sidebar-button-width: 100%;
  --sidebar-logo-height: 55px;
  --sidebar-bottom-row-height: 46px;
  --sidebar-button-height: 40px;
  --sidebar-button-within-spacing: 0.65rem;
  --sidebar-button-margins: 0.5rem;
  --sidebar-button-text-size: 1.05em;
  --sidebar-collapsed-width: 55px;


  --chats-button-height: 35px;
  --chats-button-margins: 0rem;
  --chats-button-text-size: 0.925em;

  --app-accent: #8ca9ff;
  --app-accent-rgb: 140, 169, 255;
  --app-accent-strong: #5f89ff;
  --chat-shell-max-width: 750px;
  --font-sans: "Inter", sans-serif;
}


.inter-semibold{
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-style: normal;
}

@media (max-width: 640px) {


  .input-bar {
    padding-right: 8.5rem;

  }


  .input-container {
    display: flex;
  }
}

html,
body {
  height: 100%;
}

html {
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  color: white;
  box-sizing: border-box;
  font-family: var(--font-sans);
  color: #e6eef6;
  min-height: 100vh;
  overflow: hidden;
  overscroll-behavior: none;
}

body.app-accent-aurora {
  --app-accent: #8ca9ff;
  --app-accent-rgb: 140, 169, 255;
  --app-accent-strong: #5f89ff;
}

body.app-accent-sunset {
  --app-accent: #ff9a6f;
  --app-accent-rgb: 255, 154, 111;
  --app-accent-strong: #ff7e43;
}

body.app-accent-ocean {
  --app-accent: #62d4ff;
  --app-accent-rgb: 98, 212, 255;
  --app-accent-strong: #32baff;
}

body.app-accent-ember {
  --app-accent: #ff7979;
  --app-accent-rgb: 255, 121, 121;
  --app-accent-strong: #ff5a5a;
}

body.app-accent-mint {
  --app-accent: #69e7be;
  --app-accent-rgb: 105, 231, 190;
  --app-accent-strong: #3ad8a7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -999;
  transition: background 0.45s ease, filter 0.45s ease;
}

@media (prefers-color-scheme: dark) {
  .bg {
    background: linear-gradient(315deg, rgb(0, 0, 0), rgb(40, 40, 40));

    background: -webkit-linear-gradient(165deg, rgb(0, 0, 0), rgb(40, 40, 40));

    background: -moz-linear-gradient(315deg, rgb(0, 0, 0), rgb(40, 40, 40));
  }
}

@media (prefers-color-scheme: light) {
  .bg {
    background: linear-gradient(315deg, rgb(255, 255, 255), rgb(215, 215, 215));

    background: -webkit-linear-gradient(165deg,
        rgb(255, 255, 255),
        rgb(215, 215, 215));

    background: -moz-linear-gradient(315deg,
        rgb(255, 255, 255),
        rgb(215, 215, 215));
  }
}

body.app-background-deep-space .bg {
  background:
    radial-gradient(1000px 520px at 12% -8%, rgba(106, 157, 255, 0.22), transparent 62%),
    radial-gradient(800px 500px at 112% 105%, rgba(86, 220, 233, 0.16), transparent 64%),
    linear-gradient(160deg, #05070d 0%, #111522 48%, #0a0e18 100%) !important;
}

body.app-background-standard .bg {
  background: linear-gradient(315deg, rgb(0, 0, 0), rgb(40, 40, 40)) !important;
  background: -webkit-linear-gradient(165deg, rgb(0, 0, 0), rgb(40, 40, 40)) !important;
  background: -moz-linear-gradient(315deg, rgb(0, 0, 0), rgb(40, 40, 40)) !important;
  filter: none !important;
}

@media (prefers-color-scheme: light) {
  body.app-background-standard .bg {
    background: linear-gradient(315deg, rgb(255, 255, 255), rgb(215, 215, 215)) !important;
    background: -webkit-linear-gradient(165deg, rgb(255, 255, 255), rgb(215, 215, 215)) !important;
    background: -moz-linear-gradient(315deg, rgb(255, 255, 255), rgb(215, 215, 215)) !important;
    filter: none !important;
  }
}

body.app-background-aurora-grid .bg {
  background:
    linear-gradient(135deg, rgba(15, 31, 53, 0.93), rgba(9, 15, 28, 0.96)),
    radial-gradient(560px 360px at 18% 14%, rgba(114, 173, 255, 0.28), transparent 68%),
    radial-gradient(650px 460px at 86% 78%, rgba(89, 241, 226, 0.22), transparent 66%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0px, rgba(255, 255, 255, 0.028) 1px, transparent 1px, transparent 30px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0px, rgba(255, 255, 255, 0.022) 1px, transparent 1px, transparent 30px) !important;
}

body.app-background-sunrise-mist .bg {
  background:
    radial-gradient(620px 440px at 16% 6%, rgba(255, 173, 122, 0.35), transparent 64%),
    radial-gradient(760px 480px at 90% 86%, rgba(123, 158, 255, 0.24), transparent 66%),
    linear-gradient(155deg, #1a1d2a 0%, #211f35 46%, #1f2f42 100%) !important;
}

body.app-background-forest-haze .bg {
  background:
    radial-gradient(660px 420px at 80% 8%, rgba(80, 202, 168, 0.24), transparent 65%),
    radial-gradient(740px 460px at 16% 88%, rgba(66, 145, 113, 0.22), transparent 66%),
    linear-gradient(160deg, #071412 0%, #10231f 48%, #0a1a17 100%) !important;
}

body.app-theme-midnight .bg {
  filter: none;
}

body.app-theme-twilight .bg {
  filter: saturate(1.16) hue-rotate(9deg) brightness(1.02);
}

body.app-theme-daylight .bg {
  filter: saturate(0.94) brightness(1.16);
}

body.app-theme-onyx .bg {
  filter: contrast(1.18) brightness(0.78);
}


.main-whopper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: var(--user-chat-width);
  height: var(--user-chat-height);
  position: relative;
  /* background:rgba(255,255,255,0.1);
      border-radius:0.5em;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(5px);
      backdrop-filter: blur(5px);
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
      border: 1px solid rgba(255, 255, 255, 0.18);
      box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); */
}

.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  pointer-events: none;

  height: var(--sidebar-logo-height);
  transform: translateY(-8px);
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    backdrop-filter 0.3s ease,
    transform 0.3s ease,
    padding 0.3s ease;
}

body.chat-view-active .header.scrolled {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(0) !important;
}

.header-left {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
}

.header-center {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;

  align-items: center;

  justify-content: center;

  transform: translateX(-50%);
  pointer-events: auto;

  /* Smooth transitions when appearing/disappearing */
  opacity: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.header-center.hidden {
  opacity: 0;
  pointer-events: none;
}



.header-right {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  pointer-events: auto;
}

.main {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  gap: var(--spacing);
  margin: var(--spacing);
  height: calc(100% - var(--spacing) * 2);
}

body.chat-view-active .main {
  margin-right: 0;
}

.home-widgets {
  display: flex;
  flex-direction: column;
  border-radius: 0.5em;
  width: 100%;
}

.widget-row {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: fit-content;
  gap: var(--home-widgets-spacing);
}

.widget-item {
  display: flex;
  flex-direction: row;
  justify-content: left;
  align-items: center;
  padding: var(--home-widgets-margins);
  width: var(--sidebar-button-width);
  height: var(--sidebar-button-height);
  gap: var(--sidebar-button-within-spacing);
  border-radius: 0.5em;
  width: fit-content;
}

.widget-item-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5em;
  padding: 0.5em;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.widget-item-icon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.widget-item-icon:hover {
  cursor: pointer;
}

.widget-item-icon:hover::before {
  opacity: 1;
}

.widget-item-text {
  font-size: var(--home-widgets-text-size);
  font-weight: 500;
}

.sidebar-container {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.5em;
  backdrop-filter: blur(10px);
  height: var(--sidebar-height);
  width: 100%;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;


  transition:
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);

}

.sidebar-container.settings-open {
  overflow: visible;
}



.bottom-category {
  margin-top: auto;
  position: relative;
  z-index: 10;

}

.nav-shadow {
  position: absolute;
  bottom: var(--sidebar-bottom-row-height);
  left: 0;
  right: 0;
  height: 60px;


  background: linear-gradient(to top,
      rgb(20, 20, 20) 10%,
      rgba(20, 20, 20, 0.8) 40%,
      rgba(20, 20, 20, 0) 100%);

  pointer-events: none;
  z-index: 5;


  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}


.sidebar-container.history-overflowing .nav-shadow {
  opacity: 1;
}




.chats-bar.collapsed~.nav-shadow {
  opacity: 0 !important;
}


.bottom-category .nav-item,
.bottom-category .nav-item:has(.nav-item-text) {
  height: var(--sidebar-bottom-row-height) !important;
  padding: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}


.bottom-category .nav-item-icon:has(.nav-item-text) {
  height: 100%;
}

.sidebar {
  width: var(--sidebar-width);
  height: var(--sidebar-height);
  display: flex;
  flex-direction: column;
  gap: var(--spacing);
  position: relative;

  transition:
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),

    width 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  transform-origin: left center;
  /* PINS SIDEBAR TO LEFT EDGE */
  will-change: width, transform;

  z-index: 100;

  animation: fadeInScale 0.6s cubic-bezier(0.2, 0, 0, 1) backwards;

  /* FIX: Ensure sidebar does not grow beyond its set width */
  min-width: 0;
  flex-shrink: 0;
  flex-grow: 0;
}

.sidebar:not(.collapsed):not(.resizing):hover,
.sidebar.resizing {
  transform: none;
  border-color: rgba(255, 255, 255, 0.5);
}

body:has(.autocomplete-dropdown-wrapper.show) .sidebar:not(.resizing):hover {
  transform: none;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  /* min-width: var(--sidebar-collapsed-width);
    max-width: var(--sidebar-collapsed-width); */
  gap: var(--spacing);

}


.sidebar.collapsed .resize-handle {
  display: none;
  pointer-events: none;
}


.nav-item-text {
  opacity: 1;
  transition: opacity 0.2s ease;
  white-space: nowrap;

  overflow: hidden;
}

.sidebar.collapsed .nav-item-text {

  opacity: 0;
  max-width: 0;
  margin: 0;

}


.nav-item .nav-item-icon:nth-child(2),
.nav-item .nav-item-icon:last-child:not(:first-child) {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.sidebar.collapsed .nav-item .nav-item-icon:nth-child(2),
.sidebar.collapsed .nav-item .nav-item-icon:last-child:not(:first-child) {
  display: none;
  opacity: 0;
}


.chats-bar {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.sidebar.collapsed .chats-bar {
  display: flex !important;
  /* Force display */
  opacity: 1 !important;
  pointer-events: auto;
}

.sidebar.collapsed .chat-item .chat-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  /* Match standard .icon size */
  height: 18px;
  opacity: 1;

  /* CRITICAL FIX: Remove the margin that pushes it off-center */
  margin-right: 0;
  margin-left: 0;
}

.sidebar.collapsed .chat-item .chat-item-text {
  display: none;
}

.sidebar.collapsed .chat-item {
  padding: 0;
  /* Remove side padding */
  justify-content: center;
  /* Center content horizontally */
  width: 100%;
  height: 40px;
  /* Match sidebar-button-height */
}

.sidebar.collapsed .chat-item-options {
  display: none;
}


.sidebar.collapsed .chat-item-icon svg {
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.7);
}

.category-seperator {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.sidebar.collapsed .category-seperator {
  visibility: hidden;
  opacity: 0;
}


.sidebar.collapsed .nav-item {
  display: flex;
  align-items: center;

  padding: 0;
  transition: padding 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .nav-item-icon {
  display: flex;
  align-items: center;

  padding-right: 0;
  padding-top: 0.5em;
  padding-bottom: 0.5em;

  /* CALCULATED CENTERING: 
       Container (55px) - Icon (~18px) = 37px space. 
       37px / 2 = 18.5px padding needed on left. 
    */
  padding-left: 17.75px;

  width: 100%;
  overflow: visible;


  gap: 0;

  transition:
    opacity 0.2s ease,
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);

}

.sidebar-collapse-toggle {
  position: absolute;
  top: 50%;
  right: -16px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  z-index: 1000;
  transition: background 0.2s ease, color 0.2s ease;
  padding: 0;
}

.sidebar-collapse-toggle:hover {
  background: #2d2d2d;
}

.sidebar-collapse-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.sidebar-collapse-toggle:hover svg {
  transform: scale(1.15);
  filter: brightness(1.3) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.sidebar.collapsed .sidebar-collapse-toggle svg {
  transform: rotate(180deg);
}

.sidebar-nav {
  flex-grow: 1;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  transition:
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);

}

.category-seperator {
  font-size: 0.85em;
  font-weight: 400;
  opacity: 0.6;
  padding-left: 0.75em;
  padding-top: 1rem;
  padding-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 0.75em;
}

.history-toggle {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 4px;
}

.category-seperator:hover .history-toggle {
  opacity: 1;
}

/* Empty state for chat history */
.history-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  opacity: 0.6;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transition: opacity 0.2s ease;
}

/* Hide empty state when sidebar is collapsed */
.sidebar.collapsed .history-empty-state {
  opacity: 0;
  pointer-events: none;
}

.empty-chat-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.empty-chat-logo {
  color: #8e8ea0;
  opacity: 0.6;
  width: 80px;
  height: 80px;
}

.empty-state-text {
  color: #8e8ea0;
  font-size: 16px;
  margin: 0;
  font-weight: 400;
  text-align: center;
}

.history-toggle.collapsed {
  opacity: 1;
}

.history-toggle:hover {
  background: transparent;
}

.history-toggle svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.history-toggle:hover svg {
  transform: scale(1.1);
  filter: brightness(1.3) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.history-toggle.collapsed svg {
  transform: rotate(-90deg) scale(1.1);

}


.history-toggle.collapsed:hover svg {
  transform: rotate(-90deg) scale(1.1);
}


.title-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  border-radius: 0.5em;
  margin-left: 0.3rem;
  position: relative;
  overflow: hidden;
}

.title-toggle:hover {
  color: rgba(255, 255, 255, 0.9);
}

.header-center:hover .title-toggle {
  opacity: 1;
}

.title-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.title-toggle:hover svg {
  transform: scale(1.1);
  filter: brightness(1.3);
}

.title-toggle.active {
  transform: rotate(180deg);
  opacity: 1;
}


.chats-bar {
  overflow: hidden;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  transition: flex-grow 0.4s cubic-bezier(0.2, 0, 0, 1), opacity 0.3s ease;
  opacity: 1;
  position: relative;
}


/* .chats-bar::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.4) 20%,
        rgba(0, 0, 0, 0.2) 50%,
        transparent 100%);
    pointer-events: none;
    z-index: 5;
    opacity: 1;
    transition: opacity 0.2s ease;
  } */

.chats-bar.collapsed {
  flex-grow: 0.0001;
  opacity: 0;
  pointer-events: none;
}


.history {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1), filter 0.3s ease;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transform-origin: top center;
  padding-bottom: 1rem;
  position: relative;
}

.chats-bar.collapsed .history {
  transform: translateY(-10px) scale(0.98);
  filter: blur(5px);
}

.nav-item {
  display: flex;
  flex-direction: row;
  justify-content: left;
  align-items: center;
  vertical-align: center;
  padding: var(--sidebar-button-margins);
  width: var(--sidebar-button-width);
  height: var(--sidebar-logo-height);
  gap: var(--sidebar-button-within-spacing);
  border-radius: 0.5em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
  cursor: pointer;
  transition: justify-content 0s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.nav-item:has(.nav-item-text) {
  height: var(--sidebar-button-height);
  padding-left: 0;
  padding-right: 0;
  cursor: pointer;
  justify-content: space-between;
}


.nav-item .nav-item-icon:nth-child(2) {
  position: absolute;
  right: 0.5em;
  width: auto;
  padding: 0.3em;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
}


.nav-item .nav-item-icon:nth-child(2) .icon {
  width: 17px;
  height: 17px;
}


.nav-item .nav-item-icon:nth-child(2):hover .icon {
  transform: scale(1.1);
  filter: brightness(1.3);
}


.nav-item .nav-item-icon:nth-child(2):hover::before {
  opacity: 1;
}


.nav-item:has(.nav-item-text) {
  position: relative;
}

.nav-item-icon {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: row;
  background: none;

  border: none;
  border-radius: 0.5em;
  padding: 0.5em;

  position: relative;
  z-index: 1;
  overflow: hidden;
  flex-shrink: 0;
  font-size: var(--sidebar-button-text-size);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: white;
  font-family: var(--font-sans);
  gap: var(--sidebar-button-within-spacing);
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: padding, gap;
}


.nav-item-icon:has(.nav-item-text) {
  flex-grow: 1;
  justify-content: flex-start;
  cursor: pointer;
  padding-left: 0.75em;
}


.nav-item-icon:has(.nav-item-text):hover .nav-item-text {
  transform: scale(1.075);
  filter: brightness(1.3);
}

#settingsToggle:hover .nav-item-text,
#settingsToggle:hover .settings-account-username {
  transform: none;
  filter: none;
}


.icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;


  flex-shrink: 0;

  min-width: 18px;

  transform: translateZ(0);

  backface-visibility: hidden;



  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


.icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  color: white;
}


.nav-item-icon:has(.nav-item-text):hover .icon {
  transform: scale(1.085);
  filter: brightness(1.3);
}

.nav-item-icon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}



.nav-item-icon:has(.nav-item-text):hover::before {
  opacity: 1;
}

.nav-item-icon.nav-section-active::before {
  opacity: 1;
  background: linear-gradient(130deg,
      rgba(92, 194, 255, 0.28),
      rgba(255, 255, 255, 0.03));
}

.nav-item-icon.nav-section-active {
  color: #ffffff;
}

.nav-item-icon.nav-section-active .icon {
  filter: brightness(1.18);
}

.nav-item-icon.nav-section-active .nav-item-text {
  filter: brightness(1.12);
}


.logo-img {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.logo-img:hover {
  transform: scale(1.14);
  filter: brightness(1.3);
}

.nav-item-text {
  font-size: var(--sidebar-button-text-size);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;

  max-width: 200px;
  transition:
    opacity 0.2s ease,
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),

    margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);

}


.sidebar.resizing {
  transition: none !important;
  cursor: ew-resize;
  z-index: 1000;
  /* Ensure it stays on top while resizing */
  user-select: none;
}

.resize-handle {
  position: absolute;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
}

body.resizing {
  cursor: ew-resize;
  user-select: none;
}

body.resizing * {
  cursor: ew-resize !important;
}


.resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  z-index: 100;
  background: transparent;
  transition: background 0.2s ease;
}

.resize-handle:hover,
.resize-handle.active {
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.3) 50%,
      transparent 100%);
}

.resize-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 40px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.resize-handle:hover::after,
.resize-handle.active::after {
  opacity: 1;
}

.chat-item {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: var(--chats-button-height);
  padding: 0 0.75em;
  position: relative;
  overflow: hidden;
  color: white;
  flex-shrink: 0;
  border-radius: 0.5em;
  cursor: pointer;
}

.chat-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-item:hover::before,
.chat-item.active::before {
  opacity: 1;
}

.chat-item-text {
  font-size: var(--chats-button-text-size);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.chat-item:hover .chat-item-text,
.chat-item.active .chat-item-text {
  transform: scale(1.01);
  filter: brightness(1.3);

  mask-image: linear-gradient(to right, black 69%, transparent 89%);
  -webkit-mask-image: linear-gradient(to right, black 69%, transparent 89%);
}

.chat-item-options {
  position: absolute;
  right: 0.3em;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  transition: background 0.2s ease;
  z-index: 10;
  cursor: pointer;
  width: auto;
  padding: 0.3em;
  border-radius: 0.25em;
  color: white;
  background: transparent;

}

.chat-item:hover .chat-item-options,
.chat-item.active .chat-item-options {
  opacity: 1;
}

.chat-item-options .icon {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));

  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-item-options:hover .icon {
  transform: scale(1.1);
  filter: brightness(1.3) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.chat-item-options:hover {
  background: rgba(255, 255, 255, 0.1);
}

.chat-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 0.75rem;
  flex-shrink: 0;
  opacity: 0.7;
  transition: margin 0.3s ease;
}

.chat-item-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}


.history::-webkit-scrollbar {
  width: 5px;
}

.history::-webkit-scrollbar-track {
  background: transparent;
}

.history::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  transition: background 0.2s ease;
}

.history::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}


.history {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}


.version-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
  user-select: none;
  width: fit-content;



  animation: fadeInScale 0.6s cubic-bezier(0.2, 0, 0, 1) backwards;
}

.version-container:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.version-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5em;
  transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
}

.version-toggle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  /* background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0)); */
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.version-container:hover .version-toggle::before {
  opacity: 1;
}

.version-container:hover .version-toggle {
  color: rgba(255, 255, 255, 0.9);
}

.version-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.version-container:hover .version-toggle svg {
  transform: scale(1.1);
  filter: brightness(1.3);
}

.version-toggle.active {
  transform: rotate(180deg);
}

.version-selected-display {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.2s cubic-bezier(0.2, 0, 0, 1),
    transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.version-selected-display.changing {
  opacity: 0;
  transform: scale(0.95);
}

.version-selected-display .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.version-selected-display .icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.version-selected-text {
  font-weight: 500;
  white-space: nowrap;
}



.upgrade-button {
  background: radial-gradient(circle at 30% 22%,
      rgba(255, 243, 184, 0.98) 0%,
      rgba(255, 191, 88, 0.96) 48%,
      rgba(255, 137, 55, 0.9) 100%) !important;
  border: 1px solid rgba(255, 227, 160, 0.8) !important;
  border-radius: 50% !important;
  padding: 0 !important;
  width: 28px !important;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0 !important;
  aspect-ratio: auto;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(255, 129, 24, 0.35),
    0 0 0 1px rgba(255, 229, 162, 0.15);
  animation: upgrade-star-pulse 2.4s ease-in-out infinite;
}

.upgrade-button:hover {
  background: radial-gradient(circle at 30% 22%,
      rgba(255, 251, 220, 1) 0%,
      rgba(255, 210, 120, 0.98) 48%,
      rgba(255, 161, 76, 0.95) 100%) !important;
  border-color: rgba(255, 241, 196, 0.95) !important;
  box-shadow: 0 8px 18px rgba(255, 143, 41, 0.45),
    0 0 0 1px rgba(255, 241, 195, 0.28);
}

.upgrade-button::before {
  background: radial-gradient(circle at 28% 20%,
      rgba(255, 255, 255, 0.55),
      rgba(255, 255, 255, 0.08) 46%,
      rgba(255, 255, 255, 0) 72%) !important;
  opacity: 1 !important;
}

.upgrade-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: #fffef6;
  filter: drop-shadow(0 1px 2px rgba(94, 54, 0, 0.35));
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.upgrade-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.upgrade-button:hover .upgrade-icon {
  transform: scale(1.08);
}

@keyframes upgrade-star-pulse {
  0%,
  100% {
    box-shadow: 0 6px 14px rgba(255, 129, 24, 0.35),
      0 0 0 1px rgba(255, 229, 162, 0.15);
  }

  50% {
    box-shadow: 0 8px 20px rgba(255, 154, 63, 0.45),
      0 0 0 1px rgba(255, 235, 177, 0.24);
  }
}

.upgrade-button {
  min-height: 28px;
  min-width: 28px;
}



.version-dropdown {
  position: absolute;
  top: calc(100% - 0.25rem);
  left: 0;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.5rem;
  min-width: 182.5px;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0, 1),
    top 0.3s cubic-bezier(0.4, 0, 0, 1);
  z-index: 1000;
  font-size: 0.95rem;
  visibility: hidden;
}

body.chat-view-active .header.scrolled .version-dropdown {
  top: calc(100% + 0.5rem);
}

.version-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.version-option {
  padding: 0.4em 2.5em 0.4em 0.65em;
  cursor: pointer;
  border-radius: 0.5em;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.version-option .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  min-width: 18px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.version-option .icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  color: white;
}

.version-option-text {
  font-size: var(--sidebar-button-text-size);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.version-option::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.version-option:hover {
  color: rgba(255, 255, 255, 1);
}

.version-option:hover::before {
  opacity: 1;
}

.version-option:hover .icon {
  filter: brightness(1.3);
}

.version-option:hover .version-option-text {
  filter: brightness(1.3);
}


.version-checkmark {
  position: absolute;
  right: 0.75em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1),
    transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.version-checkmark svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  color: white;
}

.version-option.selected .version-checkmark {
  opacity: 1;
  transform: scale(1);
}


.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;

}

.title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;

}


.status-last {
  font-size: 0.8em;
  opacity: 0;

  max-height: 0;

  margin-top: 0;
  white-space: nowrap;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}


.header-center:hover .status-last {
  opacity: 0.7;
  max-height: 20px;
  margin-top: 2px;
}


.header-center:has(.title-dropdown.show) .status-last {
  opacity: 0.7;
  max-height: 20px;
  margin-top: 2px;
}


.title-dropdown {
  position: absolute;
  display: flex;
  flex-direction: column;
  top: calc(100%);
  left: auto;
  transform: translateY(-10px) scale(0.95);
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.5rem;
  padding: 0.4rem;
  width: max-content;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1),
    transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  z-index: 1000;
  font-size: 0.95rem;
}

.header.scrolled .title-dropdown {
  top: calc(100% + 0.5rem);
}

.title-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.title-option {
  padding: 0.4em 0.65em;
  cursor: pointer;
  border-radius: 0.5em;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title-option .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  min-width: 18px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.title-option .icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  color: white;
}

.title-option-text {
  font-size: var(--sidebar-button-text-size);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.title-option::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.title-option:hover {
  color: rgba(255, 255, 255, 1);
}

.title-option:hover::before {
  opacity: 1;
}

.title-option:hover .icon {
  filter: brightness(1.3);
}

.title-option:hover .title-option-text {
  filter: brightness(1.3);
}




.main-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}


.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  max-width: 800px;
  width: 100%;
  padding: 2rem;
  margin: 0 auto;
  /* 10vh offset for homepage */
  position: relative;
  height: 100%;
  /* Ensure it takes full height */
  flex-grow: 1;
  /* Allow it to grow */
  transform: translateY(-25px);
}

/* Push input container to the bottom */
.input-container {
  margin-top: auto;
  width: 100%;
  position: relative;
  z-index: 20;
}



/* Chat Deletion Animation - Slide out to bottom */
@keyframes fadeOutShrink {
  0% {
    opacity: 1;
    transform: translateY(0);
    max-height: 40px;
    margin-bottom: var(--chats-button-margins);
  }

  100% {
    opacity: 0;
    transform: translateY(10px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Prevent animation conflicts - higher specificity for delete animation */
.chat-item.deleting {
  animation: fadeOutShrink 0.25s ease-out forwards !important;
  pointer-events: none;
  overflow: hidden;
}

.chat-item.creating {
  animation: fadeInSlide 0.3s ease-out forwards;
  overflow: hidden;
}

/* Chat Creation Animation - Slide in from top */
@keyframes fadeInSlide {
  0% {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    max-height: 40px;
    margin-bottom: var(--chats-button-margins);
    padding-top: 0;
    padding-bottom: 0;
  }
}

.chat-item.active:not(.deleting):not(.creating) {
  /* Smooth transition when becoming active */
  animation: chatItemActivate 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.header-section {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  animation: fadeInScale 0.6s cubic-bezier(0.2, 0, 0, 1);
  cursor: default !important;
  user-select: none !important;
  -webkit-user-select: none !important;

  /* Smooth transition when hiding/showing */
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-section.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.center-logo {
  width: 61.5px;
  height: 61.5px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.center-logo:hover {
  transform: translateY(-1px) scale(1.1) rotate(5deg);
  filter: brightness(1.2) drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}


.center-title {
  font-size: 4rem;
  font-weight: 700;
  margin: 0;
  padding: 0.1em 0;
  background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
  line-height: 1.2;
  transition: text-shadow 0.4s cubic-bezier(0.2, 0, 0, 1), transform 0.4s cubic-bezier(0.2, 0, 0, 1);
  cursor: default !important;
  user-select: none !important;
  -webkit-user-select: none !important;


}

.center-title:hover {
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.3),

    0 0 20px rgba(255, 255, 255, 0.2),

    0 0 40px rgba(255, 255, 255, 0.1);

  transform: scale(1.02);
}



.greeting-rotator-container {
  display: flex;
  justify-content: center;

  max-height: 1.5em;

  overflow: hidden;
  margin: 0;


  font-size: 1.5rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  animation: fadeIn 1s cubic-bezier(0.2, 0, 0, 1) 0.2s backwards;
  height: 1.5em;

  /* Smooth transitions when hiding/showing */
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.greeting-rotator-container.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.workspace-hub {
  width: 100%;
  max-width: 1080px;
  min-height: 0;
  flex: 1 1 auto;
  margin-top: 0.75rem;
  display: flex;
  align-items: stretch;
}

.workspace-hub[hidden],
.workspace-view[hidden] {
  display: none !important;
}

.workspace-view {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at top right, rgba(112, 199, 255, 0.18), transparent 44%),
    rgba(8, 12, 22, 0.56);
  padding: 1rem;
  overflow: hidden;
}

.workspace-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.workspace-view-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
}

.workspace-view-title {
  margin: 0.2rem 0 0;
  font-size: 1.62rem;
  line-height: 1.12;
}

.workspace-view-copy {
  margin: 0.35rem 0 0;
  max-width: 680px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.96rem;
}

.workspace-primary-btn,
.workspace-ghost-btn {
  border: none;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.56rem 1rem;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.workspace-primary-btn {
  background: linear-gradient(130deg, #89deff, #47a7ff);
  color: #071323;
}

.workspace-primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.workspace-ghost-btn {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.workspace-ghost-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
}

.workspace-composer {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(5, 9, 18, 0.45);
  padding: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

.workspace-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 0.68rem;
}

.workspace-field {
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
}

.workspace-field span {
  font-size: 0.78rem;
  font-weight: 560;
  color: rgba(255, 255, 255, 0.78);
}

.workspace-field input,
.workspace-field textarea,
.workspace-field select,
.library-filter-row input,
.library-filter-row select {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(12, 17, 31, 0.88);
  color: #fff;
  padding: 0.58rem 0.72rem;
  font-size: 0.9rem;
  outline: none;
}

.workspace-field input:focus,
.workspace-field textarea:focus,
.workspace-field select:focus,
.library-filter-row input:focus,
.library-filter-row select:focus {
  border-color: rgba(140, 222, 255, 0.7);
  box-shadow: 0 0 0 2px rgba(140, 222, 255, 0.22);
}

.workspace-field textarea {
  resize: vertical;
  min-height: 74px;
}

.workspace-field-color input[type="color"] {
  width: 100%;
  min-height: 42px;
  padding: 0.28rem;
  cursor: pointer;
}

.workspace-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.library-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 0.6rem;
}

.workspace-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.74rem;
  padding-right: 0.18rem;
}

.workspace-empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  gap: 0.6rem;
}

.workspace-empty h3 {
  margin: 0;
  font-size: 1.1rem;
}

.workspace-empty p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  max-width: 430px;
}

.space-card,
.library-item-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(13, 20, 34, 0.78);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.space-card-header,
.library-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
}

.space-badge-row,
.library-type-row {
  display: flex;
  align-items: center;
  gap: 0.48rem;
}

.space-color-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.space-card h3,
.library-item-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.space-card p,
.library-item-card p {
  margin: 0;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.76);
}

.space-chat-count,
.library-type-pill {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.13rem 0.52rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.82);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.space-card-actions,
.library-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.42rem;
}

.workspace-text-btn {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  padding: 0.35rem 0.56rem;
  font-size: 0.77rem;
  cursor: pointer;
}

.workspace-text-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.workspace-text-btn.warn {
  color: #ffc5c5;
  background: rgba(255, 108, 108, 0.16);
}

.workspace-text-btn.warn:hover {
  background: rgba(255, 108, 108, 0.26);
}

.space-chat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.space-chat-chip {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 999px;
  font-size: 0.74rem;
  padding: 0.26rem 0.52rem;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.space-manage-chats {
  margin-top: 0.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.5rem;
}

.space-manage-chats summary {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.8rem;
}

.space-chat-options {
  margin-top: 0.42rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.28rem;
  max-height: 170px;
  overflow: auto;
  padding-right: 0.2rem;
}

.space-chat-option {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.24rem 0.36rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.space-chat-option input {
  margin: 0;
}

.space-chat-option span {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.9);
}

.library-item-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.library-item-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-preview-fallback {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.68);
  text-align: center;
  padding: 0.5rem;
}

.library-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.16rem;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.68);
}

.library-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

body.workspace-view-active .center-content {
  max-width: none;
  transform: none;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.75rem;
  padding-top: 1.45rem;
  padding-bottom: 1rem;
}

body.workspace-view-active .header-section,
body.workspace-view-active .greeting-rotator-container,
body.workspace-view-active .chat-stage,
body.workspace-view-active .input-container,
body.workspace-view-active .disclaimer-text,
body.workspace-view-active .suggestion-highway {
  display: none !important;
}

@media (max-width: 980px) {
  .workspace-view {
    padding: 0.82rem;
  }

  .workspace-view-header {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-form-grid,
  .library-filter-row {
    grid-template-columns: 1fr;
  }

  .workspace-grid,
  .library-grid {
    grid-template-columns: 1fr;
  }

  body.workspace-view-active .center-content {
    padding: 1rem 0.9rem;
  }
}


.greeting-text {

  margin: 0;
  padding: 0;
  transform: translateY(0);

  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1.0);
  will-change: transform;

  text-align: center;
}

.greeting-text-item {
  display: block;

  white-space: nowrap;

  line-height: 1.5;

  height: 1.5em;

  padding: 0;
  width: max-content;

  margin: 0 auto;

}




.placeholder-rotator-container {
  position: absolute;
  left: 3.25rem;
  right: 9.25rem;
  top: 50%;
  transform: translateY(calc(-50% + 1px));



  font-size: 1rem;
  font-family: var(--font-sans);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);


  max-height: 1.6em;

  overflow: hidden;


  display: flex;
  justify-content: flex-start;

  z-index: 20;
  pointer-events: none;

  transition: opacity 0.15s ease;
}


.placeholder-text-rotator {

  padding: 0;
  margin: 0;
  transform: translateY(0);

  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1.0);
  will-change: transform;
}

.placeholder-text-item {
  display: block;
  white-space: nowrap;
  line-height: 1.5;
  height: 1.5em;
  padding: 0;
}


.input-container.has-content .placeholder-rotator-container {
  opacity: 0;
}

.input-container[data-has-attachments="true"] .placeholder-rotator-container {
  opacity: 0;
}


.input-container.multiline .placeholder-rotator-container {

  left: 1.05rem;
  right: 1.05rem;

  top: 0.75rem;

  transform: none;
  justify-content: flex-start;
}

.input-container {
  --autocomplete-border-color: rgba(255, 255, 255, 0.18);
  --surface-tonal-start: rgb(44, 44, 47);
  --surface-tonal-mid: rgb(39, 39, 42);
  --surface-tonal-end: rgb(35, 35, 38);
  width: 100%;
  max-width: var(--chat-shell-max-width);
  display: block;
  position: relative;
  padding: 0.75rem;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.025) 0%,
      rgba(255, 255, 255, 0) 100%),
    linear-gradient(90deg,
      var(--surface-tonal-start) 0%,
      var(--surface-tonal-mid) 55%,
      var(--surface-tonal-end) 100%);
  border-radius: 2rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  animation: fadeInUp 1s cubic-bezier(0.2, 0, 0, 1) 0.3s backwards;
  margin-top: 0.9rem;
  min-height: fit-content;
  margin-left: auto;
  margin-right: auto;
  transition:
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.input-container.autocomplete-open,
.input-container.autocomplete-open:hover,
.input-container.autocomplete-open:focus-within {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.input-container.shadow-visible::after {
  opacity: 1;
}

.input-container::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;


  height: 6.5rem;


  background: linear-gradient(to top,
      rgb(20, 20, 20) 25%,

      rgba(20, 20, 20, 0.75) 50%,

      rgba(20, 20, 20, 0) 100%);

  border-bottom-left-radius: 1.5rem;
  border-bottom-right-radius: 1.5rem;
  pointer-events: none;
  z-index: 5;

  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.input-container.autocomplete-open::after {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}


.input-container .circular-btn,
.input-container .action-buttons {
  z-index: 10;
}


.input-container>.circular-btn {

  position: absolute;
  margin: 0;


  flex-shrink: 0;
}

.input-container>.input-bar {
  width: 100%;
  padding-left: 2.5rem;

  padding-right: 8.5rem;

  box-sizing: border-box;
}

.composer-attachment-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
}

.composer-attachment-tray[hidden] {
  display: none !important;
}

.composer-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: min(100%, 300px);
  padding: 0.34rem 0.52rem;
  border-radius: 0.62rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.composer-attachment-chip.is-clickable {
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.composer-attachment-chip.is-clickable:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

.composer-attachment-chip.is-clickable:focus-visible {
  outline: none;
  border-color: rgba(var(--app-accent-rgb), 0.65);
  box-shadow: 0 0 0 2px rgba(var(--app-accent-rgb), 0.35);
}

.composer-attachment-kind {
  flex: 0 0 auto;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.09rem 0.35rem;
}

.composer-attachment-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.composer-attachment-name {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-attachment-size {
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.6);
}

.composer-attachment-remove {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  line-height: 1;
  padding: 0;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.composer-attachment-remove:hover {
  color: rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.input-container.drag-over {
  box-shadow: 0 0 0 1px rgba(var(--app-accent-rgb), 0.5), 0 12px 34px rgba(0, 0, 0, 0.64);
}

.input-container.drag-over::before {
  content: "Drop file, photo, or video to attach";
  position: absolute;
  inset: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.5rem;
  border: 1px dashed rgba(var(--app-accent-rgb), 0.82);
  background: rgba(0, 0, 0, 0.46);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
  z-index: 14;
}

@media (max-width: 760px) {
  .composer-attachment-tray {
    padding-right: 0.4rem;
  }
}

.input-container>.action-buttons {

  position: absolute;
  bottom: 0.75rem;

  right: 0.75rem;

  margin: 0;
  padding: 0;


  flex-shrink: 0;
  transition: top 0.15s cubic-bezier(0.4, 0, 0.2, 1), bottom 0.15s cubic-bezier(0.4, 0, 0.2, 1), right 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-container:hover {
  box-shadow: 0 6px 28px 0 rgba(0, 0, 0, 0.55);
  transform: translateY(-2px);
}

.input-container:focus-within {
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.65);
  transform: translateY(-3px);
}

.circular-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;

  /* FIX: Purely anchor to bottom-left. No top, no transforms. */
  position: absolute;
  left: 0.75rem;
  bottom: 0.85rem;
  top: auto;
  transform: none;

  backface-visibility: hidden;
  -webkit-font-smoothing: subpixel-antialiased;
  flex-shrink: 0;
  z-index: 10;

  /* Smooth transition for position changes */
  transition:
    top 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    bottom 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.input-container.multiline .circular-btn {
  bottom: 0.75rem;
  transform: none;
}


.circular-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: transparent;
  color: white;
  /* Scale only - do not translate */
  transform: scale(1.1);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.circular-btn:active {
  transform: scale(0.95);
}

.input-container.multiline .circular-btn:hover {
  transform: scale(1.1);
}

.input-container.multiline .circular-btn:active {
  transform: scale(0.95);
}

.circular-btn .icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circular-btn .icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}


.input-bar {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 1rem;
  font-family: var(--font-sans);
  resize: none;
  overflow-y: hidden;
  max-height: 300px;
  line-height: 1.5;
  height: auto;
  min-height: auto;
  padding: 0;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-bar.scrollable {
  overflow-y: auto;
}

.input-bar::placeholder {
  color: rgba(255, 255, 255, 0.5);
}


.input-bar::-webkit-scrollbar {
  width: 4px;
}

.input-bar::-webkit-scrollbar-track {
  background: transparent;
}

.input-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.input-bar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}


.ghost-input {
  position: absolute;

  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;


  height: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: hidden;


  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;

  /* 2. Force the SINGLE-LINE padding constraints. 
       This ensures the ghost wraps at the exact same point as the input bar. */
  padding-left: 2.5rem;
  padding-right: 10rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;

  box-sizing: border-box;
  visibility: hidden;
  box-sizing: border-box;
  visibility: hidden;
  pointer-events: none;


  transition: none !important;
}


.ghost-input.measure-single {
  padding-left: 2.5rem !important;
  padding-right: 8.5rem !important;
  padding-top: 0.35rem !important;
  padding-bottom: 0.35rem !important;
}


.input-container.multiline .ghost-input {
  padding-left: 0.3rem;
  padding-right: 0.3rem;
  padding-bottom: 2.5rem;
}


.input-container.multiline .input-bar {
  padding-left: 0.3rem;
  padding-right: 0.3rem;
  padding-bottom: 2.5rem;

}


.action-buttons {
  display: flex;
  flex-direction: row;
  gap: 0.35rem;
  align-items: flex-end;
  justify-content: flex-end;
  height: auto;
  padding-bottom: 0;
  flex-shrink: 0;
  transition: top 0.15s cubic-bezier(0.4, 0, 0.2, 1), bottom 0.15s cubic-bezier(0.4, 0, 0.2, 1), right 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  backface-visibility: hidden;
  -webkit-font-smoothing: subpixel-antialiased;
  will-change: transform;
  transform: translateZ(0);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: transparent;
  color: white;
  transform: translateY(-2px) translateZ(0);
}

.action-btn:active {
  transform: translateY(0);
}

.action-btn.is-active {
  background: color-mix(in srgb, var(--app-accent) 24%, transparent 76%);
  border-color: color-mix(in srgb, var(--app-accent) 46%, white 54%);
  color: #dbeafe;
}

.action-btn.is-live {
  animation: voice-btn-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-btn-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--app-accent-rgb), 0.55);
  }

  75% {
    box-shadow: 0 0 0 10px rgba(var(--app-accent-rgb), 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(var(--app-accent-rgb), 0);
  }
}

.action-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.circular-btn svg,
.action-btn svg {
  shape-rendering: geometricPrecision;
}


.send-btn {
  background: linear-gradient(135deg,
      color-mix(in srgb, var(--app-accent) 70%, black 30%),
      color-mix(in srgb, var(--app-accent-strong) 72%, black 28%));
  border-color: color-mix(in srgb, var(--app-accent) 42%, white 58%);
}

.send-btn:hover {
  background: linear-gradient(135deg,
      color-mix(in srgb, var(--app-accent) 82%, black 18%),
      color-mix(in srgb, var(--app-accent-strong) 86%, black 14%));
  border-color: color-mix(in srgb, var(--app-accent) 56%, white 44%);
  box-shadow: 0 4px 12px rgba(var(--app-accent-rgb), 0.42);
}

/* Stop button state (when AI is generating) */
.send-btn.generating {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.6), rgba(220, 38, 38, 0.6));
  border-color: rgba(248, 113, 113, 0.3);
}

.send-btn.generating:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.8));
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.send-btn.generating:disabled {
  opacity: 1;
  cursor: pointer;
}

.send-btn .send-icon,
.send-btn .stop-icon {
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.send-btn.generating .send-icon {
  display: none;
}

.send-btn.generating .stop-icon {
  display: block !important;
}


@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}


@media (max-width: 768px) {
  .header-center {
    max-width: calc(100% - 120px);

  }

  .header-center:hover .status-last {
    opacity: 0;
    height: 0;
    margin: 0;
  }

  .center-title {
    font-size: 2rem;
  }

  .greeting-text {
    font-size: 1rem;
  }

  .center-logo {
    width: 53px;
    height: 53px;
  }

  .header-section {
    gap: 0.75rem;
  }

  .input-container {
    max-width: 100%;
  }
}

.disclaimer-text {
  font-size: 0.75em;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);


  margin-top: 0;

  text-align: center;
  user-select: none;
  position: relative;
  z-index: 1;

  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0.35rem;

  animation: fadeInUp 1s cubic-bezier(0.2, 0, 0, 1) 0.5s backwards;
}

.terms {
  text-decoration: underline;
  cursor: pointer;
  color: inherit;
  transition: color 0.2s ease;
}

.terms:hover {
  color: rgba(255, 255, 255, 1);
}

.autocomplete-dropdown-wrapper {
  z-index: 20;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-width: none;


  margin-top: 0;
  max-height: 420px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  border-radius: 0 0 2rem 2rem;
}

.autocomplete-dropdown-wrapper.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.autocomplete-dropdown {

  background:
    linear-gradient(180deg,
      rgba(0, 0, 0, 0.06) 0%,
      rgba(6, 6, 8, 0.2) 22%,
      rgba(5, 5, 7, 0.46) 54%,
      rgba(4, 4, 6, 0.75) 78%,
      rgba(3, 3, 5, 0.9) 100%),
    linear-gradient(90deg,
      var(--surface-tonal-start) 0%,
      var(--surface-tonal-mid) 55%,
      var(--surface-tonal-end) 100%);



  border-top: none;
  border-radius: 0 0 2rem 2rem;

  padding: 0.5rem;


  /* box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6),
      0 0 35px rgba(255, 255, 255, 0.1),
      0 0 20px rgba(255, 255, 255, 0.05),
      inset 0 0 10px rgba(255, 255, 255, 0.02); */

  list-style: none;
  max-height: 400px;

  overflow-y: auto;


  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.autocomplete-item {
  padding: 0.65rem 1rem;
  cursor: pointer;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0);
  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.18s ease,
    color 0.18s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  animation: autocompleteItemIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: transform, opacity;
}

.autocomplete-item b {
  font-weight: 400;

  color: rgba(255, 255, 255, 0.55);

}

.autocomplete-item:nth-child(1) {
  animation-delay: 0s;
}

.autocomplete-item:nth-child(2) {
  animation-delay: 0.02s;
}

.autocomplete-item:nth-child(3) {
  animation-delay: 0.04s;
}

.autocomplete-item:nth-child(4) {
  animation-delay: 0.06s;
}

.autocomplete-item:nth-child(5) {
  animation-delay: 0.08s;
}

.autocomplete-item:nth-child(6) {
  animation-delay: 0.1s;
}

.autocomplete-item:nth-child(7) {
  animation-delay: 0.12s;
}

@keyframes autocompleteItemIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.autocomplete-item:hover,
.autocomplete-item.active {
  color: rgba(255, 255, 255, 1);
  transform: translateX(3px);
  background: rgba(255, 255, 255, 0.08);
}


.autocomplete-item:active {
  transform: translateX(1px) scale(0.99);
  background: rgba(255, 255, 255, 0.12);
}


.tooltip {
  position: fixed;
  padding: 0.4rem 0.75rem;
  background: rgba(15, 15, 15, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 30000;
  opacity: 0;
  transform: scale(0.95) translateY(5px);
  transition: opacity 0.2s cubic-bezier(0.2, 0, 0, 1),
    transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.tooltip.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.tooltip.timeline-preview {
  padding: 0.56rem 0.68rem 0.62rem;
  border-radius: 0.72rem;
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(160deg,
      rgba(6, 8, 12, 0.96),
      rgba(12, 14, 20, 0.94));
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  white-space: normal;
}

.tooltip.timeline-preview .timeline-tooltip-meta {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  margin-bottom: 0.34rem;
  font-size: 0.66rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.56);
}

.tooltip.timeline-preview .timeline-tooltip-role {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 650;
}

.tooltip.timeline-preview .timeline-tooltip-time {
  color: rgba(255, 255, 255, 0.52);
  font-weight: 520;
}

.tooltip.timeline-preview .timeline-tooltip-sep {
  color: rgba(255, 255, 255, 0.34);
}

.tooltip.timeline-preview .timeline-tooltip-snippet {
  font-size: 0.82rem;
  line-height: 1.34;
  color: rgba(255, 255, 255, 0.95);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.chat-view-active .center-content {
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 60px;
  padding-bottom: 1rem;
  padding-left: 2rem;
  padding-right: 0;
  box-sizing: border-box;
  overflow: hidden;
  margin-bottom: 0;
  transform: none;
  max-width: none;
  width: 100%;
}

body.chat-view-active .input-container,
body.chat-view-active .disclaimer-text {
  margin-top: auto;
  width: 100%;
  max-width: var(--chat-shell-max-width);
  align-self: center;
}

body.chat-view-active .input-container {
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--chat-shell-max-width);
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  /* Remove extra spacing */
  position: relative;
  z-index: 20;
}

body.chat-view-active .disclaimer-text {
  flex: 0 0 auto;
  margin-top: 0.25rem !important;
}

.chat-stage {
  width: 100%;
}

body.chat-view-active .chat-stage {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}

body.chat-view-active .chat-stage::-webkit-scrollbar {
  width: 6px;
}

body.chat-view-active .chat-stage::-webkit-scrollbar-track {
  background: transparent;
}

body.chat-view-active .chat-stage::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

/* [NEW] Disabled state for action buttons */
.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  /* pointer-events: none; REMOVED to allow tooltip on hover */
}

.chat-options-dropdown {
  position: fixed;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.5rem;

  /* Reduced padding for smaller container */
  padding: 0.3rem;

  width: max-content;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateX(-10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1),
    transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  z-index: 10000;

  /* Slightly smaller font size */
  font-size: 0.9rem;
}

.chat-options-dropdown.show {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.chat-option {
  /* Tighter padding for smaller items */
  padding: 0.35em 0.6em;

  cursor: pointer;
  border-radius: 0.35em;
  /* Slightly tighter radius */
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-option .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  /* Reduced from 18px */
  height: 16px;
  /* Reduced from 18px */
  flex-shrink: 0;
  min-width: 16px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ... rest of hover effects remain the same ... */
.chat-option .icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  color: white;
}

.chat-option-text {
  font-size: inherit;
  /* Inherit from parent */
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-option::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-option:hover {
  color: rgba(255, 255, 255, 1);
}

.chat-option:hover::before {
  opacity: 1;
}

.chat-option:hover .icon {
  filter: brightness(1.3);
}

.chat-option:hover .chat-option-text {
  filter: brightness(1.3);
}

.title-option.option-with-submenu,
.chat-option.option-with-submenu {
  overflow: visible;
  padding-right: 0.35rem;
}

.submenu-caret {
  margin-left: auto;
  width: 0.75rem;
  height: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.72);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.submenu-caret svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.title-option.option-with-submenu:hover .submenu-caret,
.title-option.option-with-submenu:focus-within .submenu-caret,
.chat-option.option-with-submenu:hover .submenu-caret,
.chat-option.option-with-submenu:focus-within .submenu-caret {
  transform: translateX(1px);
  color: rgba(255, 255, 255, 0.95);
}

.option-submenu {
  position: absolute;
  top: -0.3rem;
  left: calc(100% - 0.15rem);
  min-width: 5.75rem;
  padding: 0.35rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px) scale(0.96);
  transform-origin: left center;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.title-option.option-with-submenu:hover>.option-submenu,
.title-option.option-with-submenu:focus-within>.option-submenu,
.chat-option.option-with-submenu:hover>.option-submenu,
.chat-option.option-with-submenu:focus-within>.option-submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.option-submenu-item {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-weight: 500;
  text-align: left;
  border-radius: 0.35em;
  padding: 0.32em 0.5em;
  cursor: pointer;
  transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-submenu-item:hover,
.option-submenu-item:focus-visible {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02));
  color: rgba(255, 255, 255, 1);
  outline: none;
}

#chatOptionDelete:hover {
  color: #ff6b6b;
}

#chatOptionDelete:hover .icon svg {
  color: #ff6b6b;
}

.title-option[data-value="delete"]:hover {
  color: #ff6b6b;
}

.title-option[data-value="delete"]:hover .icon svg {
  color: #ff6b6b;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20000;
  /* Highest z-index */

  /* The blurred margin effect */
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  display: flex;
  align-items: center;
  justify-content: center;

  /* Animation State: Hidden */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  /* Size with margin */
  width: 90%;
  height: 90%;
  max-width: 1200px;
  /* Optional max width */

  /* Glassmorphism Style (Matching Dropdowns) */
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1rem;
  box-shadow: 0 20px 50px 0 rgba(0, 0, 0, 0.5);

  position: relative;
  padding: 2rem;
  overflow: hidden;

  /* Animation State: Hidden */
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  transition:
    opacity 0.3s cubic-bezier(0.2, 0, 0, 1),
    transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

/* When overlay has .show, animate content in */
.modal-overlay.show .modal-content {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.modal-content.small {
  width: 100%;
  max-width: 480px;
  height: fit-content;
  padding: 1.5rem;
}

.attachment-preview-modal-overlay {
  z-index: 21010;
}

.attachment-preview-modal-content {
  width: min(96vw, 1100px);
  height: min(92vh, 860px);
  max-width: none;
  max-height: none;
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.attachment-preview-modal-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding-right: 2.7rem;
}

.attachment-preview-modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-preview-modal-meta {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-preview-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 0.65rem;
}

.attachment-preview-modal-media {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.55rem;
}

.attachment-preview-modal-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0.55rem;
  background: #fff;
}

.attachment-preview-modal-audio {
  width: min(100%, 560px);
}

.attachment-preview-modal-fallback {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
}

.attachment-preview-modal-fallback p {
  margin: 0;
}

.attachment-preview-modal-download {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  padding: 0.38rem 0.82rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.attachment-preview-modal-download:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
}

@media (max-width: 760px) {
  .attachment-preview-modal-content {
    width: 96vw;
    height: 90vh;
    padding: 0.75rem;
  }

  .attachment-preview-modal-body {
    padding: 0.45rem;
  }

  .attachment-preview-modal-title {
    font-size: 0.88rem;
  }
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.modal-close-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
}

.modal-close-btn:hover svg {
  transform: rotate(90deg);
}

.modal-inner-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  color: white;
  display: flex;
  /* NEW */
  flex-direction: column;
  /* NEW */
}

/* --- PRICING MODAL STYLES --- */

.pricing-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.pricing-title {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Personal/Business Toggle */
.billing-toggle-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  font-family: var(--font-sans);
}

.billing-toggle {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.25rem;
  border-radius: 2rem;
  display: flex;
  gap: 0.25rem;
  font-family: var(--font-sans);
}

.toggle-option {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.5rem 1.5rem;
  border-radius: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.toggle-option.active {
  background: rgba(60, 60, 60, 1);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hush-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 205, 120, 0.55);
  background: radial-gradient(circle at 28% 25%,
      rgba(255, 245, 209, 0.98) 0%,
      rgba(255, 201, 113, 0.95) 50%,
      rgba(255, 145, 66, 0.88) 100%);
  color: #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  font-family: var(--font-sans);
  box-shadow: 0 6px 15px rgba(238, 156, 40, 0.34);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.hush-toggle:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 10px 20px rgba(238, 156, 40, 0.42);
  filter: brightness(1.03);
}

.hush-toggle.active {
  border-color: rgba(255, 235, 186, 0.95);
  box-shadow: 0 0 0 2px rgba(255, 224, 156, 0.25), 0 10px 22px rgba(238, 156, 40, 0.48);
}

.pricing-cards-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;

  flex: 1;
  /* NEW: This pushes the footer down */
  align-items: stretch;
  /* NEW: This makes the cards stretch to full height */
  margin-bottom: 1rem;
  /* Reduced margin */
  min-height: 0;
  /* Fix for flexbox scrolling */
}

.pricing-card {
  flex: 1;
  min-width: 280px;
  max-width: 350px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;

  display: flex;
  /* NEW */
  flex-direction: column;
  /* NEW */

  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pricing-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-4px);
}

/* Popular Badge */
.pricing-card.popular {
  border-color: rgba(96, 165, 250, 0.4);
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0.05), rgba(255, 255, 255, 0.03));
}

.popular-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Card Content */
.card-header {
  margin-bottom: 1.5rem;
}

.plan-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: white;
}

.plan-price {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.price-value {
  display: inline-block;
  position: relative;
  transition:
    opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Initial State */
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.price-value.changing {
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  filter: blur(4px);
}


.price-period {
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
}

.price-period {
  transition: color 0.3s ease;
}

.switch input:checked~.slider {
  background-color: #3b82f6;
  /* Ensure this matches your existing blue */
}

.plan-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.5rem;
  line-height: 1.4;
  min-height: 2.5em;
  /* Align buttons */
}

/* Buttons */
.plan-btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
  border: none;
  font-family: var(--font-sans);
}

.plan-btn.current {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  cursor: default;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-sans);
}

.plan-btn.primary {
  background: linear-gradient(135deg, var(--app-accent), var(--app-accent-strong));
  color: white;
  box-shadow: 0 4px 12px rgba(var(--app-accent-rgb), 0.32);
}

.plan-btn.primary:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.plan-btn.secondary {
  background: white;
  color: black;
}

.plan-btn.secondary:hover {
  background: #f0f0f0;
  transform: scale(1.02);
}

.plan-btn.delete {
  background: #ef4444;
  color: white;
  width: auto;
  margin-bottom: 0;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
}

.plan-btn.delete:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.plan-btn.cancel {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  width: auto;
  margin-bottom: 0;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
}

.plan-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.02);
}

/* Features List */
.plan-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
  /* Makes features take up space */
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
}

.feature-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: white;
  /* Or use #3b82f6 for blue checks */
  margin-top: 0.15rem;
}

/* Footer Toggle */
.pricing-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;

  margin-top: 0;
  /* Reset margin */
  padding-bottom: 0;
  /* Reset padding */
  flex-shrink: 0;
  /* Prevent footer from squishing */
}

.modal-inner-content.private-pricing-mode .pricing-footer {
  display: none;
}

.footer-text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Toggle Switch (Slider) */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #3b82f6;
}

input:checked+.slider:before {
  transform: translateX(20px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .pricing-cards-container {
    flex-direction: column;
    align-items: center;
  }

  .pricing-card {
    width: 100%;
    max-width: 100%;
  }

  .pricing-title {
    font-size: 1.75rem;
  }

}

.pricing-card:last-child {
  background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.15);
}

.pricing-card:last-child:hover {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
}

/* --- SAVINGS BADGE STYLES --- */
.savings-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4ade80;
  /* Bright Green */

  /* Hidden State */
  max-height: 0;
  opacity: 0;
  transform: translateY(-5px);
  margin-top: 0;
  overflow: hidden;

  /* Smooth Transition matching the price blur */
  transition:
    max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.savings-badge.show {
  /* Visible State */
  max-height: 20px;
  /* Enough space for text */
  opacity: 1;
  transform: translateY(0);
  margin-top: 0.5rem;
}

/* --- COMPETITOR COMPARISON STYLES --- */

.comparison-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.comp-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.comp-price {
  text-decoration: line-through;
  color: rgba(255, 100, 100, 0.8);
  /* Red color for both $ and number */
  font-weight: 600;
  display: inline-flex;
  /* Keeps them connected tightly */
  align-items: center;
}

/* Ensure the animation still works on the inner number */
.comp-price .price-value {
  display: inline-block;
  text-decoration: inherit;
  /* Ensures the line goes through the number too */
  color: inherit;
}

/* --- PRICING VIEW SWITCHING --- */

.pricing-views-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Important for nested flex scrolling */
}

.pricing-view {
  display: none;
  /* Hidden by default */
  width: 100%;
}

.pricing-view.active {
  display: flex;
  /* Show only active */
  animation: fadeScaleView 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.private-access-view.pricing-view.active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
  align-content: stretch;
  flex: 1;
  min-height: 0;
  height: 100%;
  margin-bottom: 1rem;
}

.modal-inner-content.private-pricing-mode .private-access-view.pricing-view.active {
  margin-bottom: 0;
}

.private-entry-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 0;
  height: 100%;
  font-family: var(--font-sans);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.private-entry-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-4px);
}

.promo-entry-card {
  background:
    radial-gradient(140% 100% at 0% 0%, rgba(79, 143, 255, 0.22), rgba(79, 143, 255, 0) 52%),
    radial-gradient(120% 100% at 100% 100%, rgba(90, 220, 255, 0.14), rgba(90, 220, 255, 0) 58%),
    linear-gradient(130deg, rgba(59, 130, 246, 0.18), rgba(255, 255, 255, 0.03));
  border-color: rgba(96, 165, 250, 0.35);
}

.lifetime-entry-card {
  background:
    radial-gradient(130% 110% at 0% 0%, rgba(255, 211, 132, 0.2), rgba(255, 211, 132, 0) 54%),
    linear-gradient(130deg, rgba(245, 158, 11, 0.2), rgba(255, 255, 255, 0.03));
  border-color: rgba(251, 191, 36, 0.35);
}

.promo-entry-card::before,
.lifetime-entry-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.75;
}

.promo-entry-card::before {
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 40%),
    repeating-linear-gradient(135deg,
      rgba(160, 213, 255, 0.11) 0 1px,
      transparent 1px 12px);
}

.lifetime-entry-card::before {
  background-image:
    linear-gradient(120deg, rgba(255, 240, 207, 0.14), rgba(255, 240, 207, 0) 44%),
    radial-gradient(circle at center, rgba(247, 216, 162, 0.2) 0 1.1px, transparent 1.2px),
    repeating-conic-gradient(from 45deg at 50% 50%,
      rgba(247, 216, 162, 0.12) 0deg 12deg,
      transparent 12deg 24deg);
  background-size: auto, 26px 26px, 26px 26px;
  background-position: center, 0 0, 0 0;
  opacity: 0.38;
  mix-blend-mode: normal;
}

.private-entry-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  position: relative;
  z-index: 1;
}

.private-entry-emoji {
  font-size: 1.35rem;
  line-height: 1;
}

.private-entry-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.96);
  font-family: var(--font-sans);
  position: relative;
  z-index: 1;
}

.private-entry-desc {
  margin: 0;
  font-size: 0.96rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
  min-height: 2.6em;
  font-family: var(--font-sans);
  position: relative;
  z-index: 1;
}

.private-entry-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.private-entry-actions:hover {
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 6px 28px 0 rgba(0, 0, 0, 0.6),
    0 0 35px rgba(255, 255, 255, 0.15),
    0 0 20px rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.private-entry-actions:focus-within {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.7),
    0 0 50px rgba(255, 255, 255, 0.2),
    0 0 30px rgba(255, 255, 255, 0.12),
    inset 0 0 10px rgba(255, 255, 255, 0.03);
  transform: translateY(-2px);
}

.private-entry-input {
  flex: 1;
  min-width: 0;
  height: auto;
  min-height: auto;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 1rem;
  font-family: var(--font-sans);
  line-height: 1.5;
  padding: 0.35rem 0.1rem 0.35rem 0.5rem;
}

.private-entry-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  opacity: 1;
  transform: translateY(0);
  transform-origin: left center;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.private-entry-input:focus::placeholder {
  color: rgba(255, 255, 255, 0.35);
  opacity: 0;
  transform: translateY(-30%);
}

.private-entry-input:not(:placeholder-shown)::placeholder {
  opacity: 0;
  transform: translateY(-30%);
}

.private-entry-btn {
  height: 38px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 0.95rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #fff;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.private-entry-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.promo-entry-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: rgba(96, 165, 250, 0.55);
}

.lifetime-entry-btn {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border-color: rgba(251, 191, 36, 0.65);
}

@media (max-width: 900px) {
  .private-access-view.pricing-view.active {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
  }
}

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

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

/* --- LOGO VERSION TEXT STYLES --- */

/* Custom class for the logo button to adjust alignment and spacing */
.logo-nav-btn {
  align-items: flex-end !important;
  /* Aligns text to the bottom of the logo */
  gap: 0.75rem !important;
}

.version-text {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  /* Subtle grey */
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s ease;
}

/* Hide text when sidebar is collapsed */
.sidebar.collapsed .version-text {
  opacity: 0;
  display: none;
}

/* --- ATTACH DROPDOWN STYLES --- */

.attach-dropdown {
  position: absolute;
  bottom: calc(100% + 0.65rem);
  /* Keep the menu above the composer so it never covers attachment chips. */
  left: 0.15rem;

  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.5rem;
  padding: 0.4rem;

  width: max-content;
  min-width: 180px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

  /* Animation State: Hidden */
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1),
    transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  z-index: 100;
  font-size: 0.95rem;

  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(62vh, 420px);
  overflow-y: auto;
}

.attach-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.attach-dropdown.has-attachments {
  bottom: calc(100% + 0.85rem);
}

.attach-option {
  padding: 0.5em 0.75em;
  cursor: pointer;
  border-radius: 0.35em;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.attach-option .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.attach-option .icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  color: white;
}

.attach-option-text {
  font-size: inherit;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Effects */
.attach-option::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.attach-option:hover {
  color: rgba(255, 255, 255, 1);
}

.attach-option:hover::before {
  opacity: 1;
}

.attach-option:hover .icon {
  filter: brightness(1.3);
  transform: scale(1.1);
}

.attach-option:hover .attach-option-text {
  filter: brightness(1.3);
}

/* ========================================
     CHAT TRANSITION ANIMATIONS 
     ======================================== */

.chat-container {
  --snap-bottom-pad: 0px;
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  position: relative;
  overscroll-behavior-y: contain;
}

body.chat-view-active .chat-container {
  width: 100% !important;
  max-width: none !important;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
}

.chat-messages-track {
  width: 100%;
  max-width: var(--chat-shell-max-width);
  margin: 0 auto;
  padding-top: 1rem;
  padding-bottom: 2rem;
  padding-left: 0rem;
  padding-right: 0rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100%;
}

.chat-container.snap-active {
  padding-bottom: 0;
}

.chat-container.snap-active .chat-messages-track {
  min-height: 0;
  padding-bottom: var(--snap-bottom-pad, 0px);
}

.chat-container.loading {
  opacity: 0;
  transform: translateY(10px);
}

.chat-container.sending-message {
  padding-bottom: 0;
}

.chat-container.sending-message .chat-messages-track {
  padding-bottom: 10rem;
  transition: padding-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-container.chat-pref-compact .message-wrapper {
  margin-bottom: 0.9rem;
}

.chat-container.chat-pref-compact .message-wrapper .message {
  padding: 0.62rem 0.92rem !important;
  border-radius: 1.35rem !important;
  font-size: 0.9rem !important;
}

.chat-container.chat-pref-focus-assistant .message-wrapper.user-wrapper {
  opacity: 0.66;
}

.chat-container.chat-pref-focus-assistant .message-wrapper.bot-wrapper .bot-message {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  border-radius: 1.15rem;
}

.chat-container.chat-pref-show-timestamps .message-wrapper::after {
  content: attr(data-time-label);
  margin-top: 0.3rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.01em;
}

.chat-container.chat-pref-show-timestamps .message-wrapper.user-wrapper::after {
  align-self: flex-end;
  padding-right: 0.15rem;
}

.chat-container.chat-pref-show-timestamps .message-wrapper.bot-wrapper::after {
  align-self: flex-start;
  padding-left: 0.15rem;
}

.chat-side-panel {
  width: 320px;
  min-width: 56px;
  max-width: min(340px, calc(100vw - 96px));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.9rem;
  background: linear-gradient(165deg, rgba(18, 18, 18, 0.88), rgba(12, 12, 12, 0.78));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.2s ease;
  position: fixed;
  right: 0.9rem;
  top: 72px;
  bottom: 128px;
  z-index: 40;
  pointer-events: auto;
}

.chat-side-panel[hidden] {
  display: none !important;
}

.chat-side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.78rem 0.8rem 0.62rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-side-panel-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.02em;
}

.chat-side-panel-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.82);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.chat-side-panel-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
}

.chat-side-panel-toggle svg {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-side-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.chat-side-panel-body::-webkit-scrollbar {
  width: 6px;
}

.chat-side-panel-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.chat-side-panel.collapsed {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  top: 82px;
  bottom: auto;
}

.chat-side-panel.collapsed .chat-side-panel-header {
  justify-content: center;
  border-bottom: none;
  padding: 0;
  height: 100%;
}

.chat-side-panel.collapsed .chat-side-panel-title,
.chat-side-panel.collapsed .chat-side-panel-body {
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  overflow: hidden;
  padding: 0;
}

.chat-side-panel.collapsed .chat-side-panel-toggle svg {
  transform: rotate(180deg);
}

.chat-side-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.7rem;
  padding: 0.62rem;
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
  background: rgba(255, 255, 255, 0.03);
}

.chat-side-section h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.58);
}

.chat-side-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.chat-side-section-caption {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.42);
}

.chat-side-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.chat-side-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.58rem;
  padding: 0.44rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.chat-side-stat-wide {
  grid-column: 1 / -1;
}

.chat-side-stat .label {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.48);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-side-stat strong {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  word-break: break-word;
}

.chat-side-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.84);
  cursor: pointer;
}

.chat-side-toggle-row input {
  accent-color: #8ca9ff;
}

.chat-side-toggle-row input:disabled+span {
  opacity: 0.45;
}

.chat-timeline-rail {
  width: 36px;
  min-width: 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.6rem;
  position: fixed;
  top: 50%;
  right: clamp(1.25rem, 2.2vw, 1.9rem);
  transform: translateY(-50%);
  z-index: 41;
}

.chat-timeline-rail[hidden] {
  display: none !important;
}

.chat-timeline-nav {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.chat-timeline-nav:hover:not(:disabled) {
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.08);
}

.chat-timeline-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.chat-timeline-rail-track {
  width: 26px;
  max-height: min(56vh, 430px);
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.36rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.45rem 0 0.45rem 0;
  scrollbar-width: none;
}

.chat-timeline-rail-track::-webkit-scrollbar {
  display: none;
}

.chat-timeline-empty {
  width: 100%;
  text-align: right;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.32);
  line-height: 1.25;
}

.chat-timeline-tick {
  width: 24px;
  height: 14px;
  border: none;
  background: transparent;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 1;
}

.chat-timeline-tick::before {
  content: "";
  width: 14px;
  height: 2px;
  display: block;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  transform-origin: right center;
  transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.chat-timeline-tick.user::before {
  width: 10px;
  opacity: 0.62;
}

.chat-timeline-tick.bot::before {
  width: 18px;
  opacity: 0.86;
}

.chat-timeline-tick:hover::before {
  background: rgba(255, 255, 255, 0.88);
  opacity: 1;
  transform: scaleY(1.1);
}

.chat-timeline-tick.user:hover::before {
  width: 12px;
}

.chat-timeline-tick.bot:hover::before {
  width: 20px;
}

.chat-timeline-tick.active::before {
  height: 3px;
  background: rgba(255, 255, 255, 0.98);
  opacity: 1;
  transform: scaleY(1.12);
}

.chat-timeline-tick.user.active::before {
  width: 14px;
}

.chat-timeline-tick.bot.active::before {
  width: 22px;
}

.message-wrapper.timeline-jump-target .message {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.32), 0 0 16px rgba(255, 255, 255, 0.14);
}

@media (max-width: 1100px) {
  .chat-side-panel {
    width: 280px;
    max-width: 280px;
  }
}

@media (max-width: 980px) {
  body.chat-view-active .center-content {
    padding-right: 0.75rem;
  }

  .chat-side-panel {
    display: none !important;
  }

  .chat-timeline-rail {
    display: none !important;
  }

  body.chat-view-active .chat-stage {
    gap: 0;
  }
}

/* Message Fade-in Animations */
.message p {
  margin: 0 0 0.5rem 0;
}

.message p:last-child {
  margin-bottom: 0;
}

.message ul,
.message ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.message code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: var(--font-sans);
}

.message pre {
  background: #1e1e1e;
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
}

@keyframes messageFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* Stagger animation delay for consecutive messages */
.message:nth-child(1) {
  animation-delay: 0.05s;
}

.message:nth-child(2) {
  animation-delay: 0.1s;
}

.message:nth-child(3) {
  animation-delay: 0.15s;
}

.message:nth-child(4) {
  animation-delay: 0.2s;
}

.message:nth-child(5) {
  animation-delay: 0.25s;
}

.message:nth-child(n+6) {
  animation-delay: 0.3s;
}

/* Smooth transition for active chat highlighting */
.chat-item {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-item .chat-item-icon {
  display: none;
}

.chat-item .chat-item-text {
  display: block;
}

/* Smooth transition for .chat-item.active is handled by more specific rule above */

@keyframes chatItemActivate {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}


.suggestion-highway {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 0.325rem;
  margin-top: 0.5rem;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  pointer-events: auto;

  /* FIX: Re-enable the standard CSS animation */
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0, 0, 1) 0.5s backwards;

  /* Ensure visibility */
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

body.chat-view-active .suggestion-highway {
  display: none;
}

.highway-lane {
  width: 100%;
  overflow: hidden;
  display: flex;
  position: relative;
  padding: 4px 0;
  /* Space for shadow/hover growth */
}

.highway-track {
  display: flex;
  gap: 0.75rem;
  width: max-content;
  will-change: transform;
}

.suggestion-chip {
  /* Glassmorphism matching your screenshot */
  background: rgba(40, 40, 40, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);

  padding: 0.5rem 1.1rem;
  border-radius: 2rem;
  /* Full pill shape */

  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);

  white-space: nowrap;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.suggestion-chip span {
  font-size: 1.1em;
  /* Make emoji slightly larger */
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.suggestion-chip:hover {
  background: rgba(60, 60, 60, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateY(-3px) scale(1.05);
  /* Lift up slightly */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.suggestion-chip:active {
  transform: scale(0.96);
}

/* Animations */
@keyframes scrollLeft {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

@keyframes scrollRight {
  0% {
    transform: translateX(-50%);
  }

  100% {
    transform: translateX(0);
  }
}

.move-left {
  animation: scrollLeft 300s linear infinite;
}

.move-right {
  animation: scrollRight 300s linear infinite;
}

/* Pause animation when hovering over the LANE */
.highway-lane:hover .highway-track {
  animation-play-state: paused;
}

/* --- Delete Modal Styling --- */
.delete-modal-content {
  max-width: 400px;
  width: 90%;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.delete-modal-content .modal-inner-content {
  padding: 2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.delete-modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
}

.delete-modal-message {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.delete-chat-title-highlight {
  font-weight: 600;
  color: #fff;
}

.delete-modal-actions {
  display: flex;
  gap: 1rem;
  width: 100%;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.delete-modal-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  flex: 1;
  max-width: 120px;
}

.delete-modal-btn.cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.delete-modal-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}

.delete-modal-btn.confirm {
  background: #ef4444;
  color: #fff;
}

.delete-modal-btn.confirm:hover {
  background: #dc2626;
}

.delete-modal-checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

#deleteModalOverlay {
  z-index: 20005 !important;
}

#accountDeleteModalOverlay {
  z-index: 20006 !important;
}

#settingsModalOverlay {
  z-index: 20004 !important;
}

#searchModalOverlay {
  z-index: 10000 !important;
}

.settings-hub-modal-content {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: min(1120px, 94vw);
  height: min(780px, 90vh);
  max-width: 1120px;
  padding: 0;
  border: 1px solid rgba(164, 198, 255, 0.33);
  box-shadow:
    0 34px 95px rgba(2, 3, 7, 0.72),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  background:
    radial-gradient(1200px 600px at 120% -8%, rgba(130, 174, 255, 0.24), rgba(26, 24, 43, 0) 58%),
    radial-gradient(760px 560px at -8% 104%, rgba(92, 236, 232, 0.2), rgba(26, 24, 43, 0) 64%),
    linear-gradient(176deg, rgba(16, 18, 28, 0.985), rgba(8, 10, 16, 0.99));
  --settings-accent: #8ca9ff;
  --settings-accent-soft: rgba(140, 169, 255, 0.25);
  --settings-surface: rgba(255, 255, 255, 0.045);
  --settings-border: rgba(255, 255, 255, 0.12);
}

.settings-hub-modal-content.settings-accent-sunset {
  --settings-accent: #ff9a6f;
  --settings-accent-soft: rgba(255, 154, 111, 0.24);
}

.settings-hub-modal-content.settings-accent-ocean {
  --settings-accent: #62d4ff;
  --settings-accent-soft: rgba(98, 212, 255, 0.24);
}

.settings-hub-modal-content.settings-accent-ember {
  --settings-accent: #ff7979;
  --settings-accent-soft: rgba(255, 121, 121, 0.26);
}

.settings-hub-modal-content.settings-accent-mint {
  --settings-accent: #69e7be;
  --settings-accent-soft: rgba(105, 231, 190, 0.25);
}

.settings-hub-modal-content::before,
.settings-hub-modal-content::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(54px);
}

.settings-hub-modal-content::before {
  top: -230px;
  right: -120px;
  background: color-mix(in srgb, var(--settings-accent) 56%, transparent 44%);
  opacity: 0.24;
  animation: settingsGlowDrift 12s ease-in-out infinite alternate;
}

.settings-hub-modal-content::after {
  bottom: -270px;
  left: -140px;
  background: rgba(96, 238, 224, 0.38);
  opacity: 0.2;
  animation: settingsGlowDrift 14s ease-in-out infinite alternate-reverse;
}

@keyframes settingsGlowDrift {
  from {
    transform: translateY(0) scale(1);
  }

  to {
    transform: translateY(14px) scale(1.08);
  }
}

.settings-hub-modal-inner {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.12rem;
  padding: 1.18rem 1.18rem 1.22rem;
}

.settings-hub-header {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  position: relative;
  padding-right: 2.4rem;
}

.settings-hub-header::after {
  content: "";
  margin-top: 0.5rem;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.02) 75%);
}

.settings-hub-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: rgba(195, 219, 255, 0.78);
  font-weight: 620;
}

.settings-hub-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 1.95rem);
  line-height: 1.06;
  color: #fff;
  font-weight: 660;
  letter-spacing: 0.01em;
}

.settings-hub-subtitle {
  margin: 0.16rem 0 0;
  font-size: 0.93rem;
  max-width: 720px;
  color: rgba(225, 235, 255, 0.75);
}

.settings-hub-stats {
  margin-top: 0.46rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.settings-hub-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: rgba(229, 237, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
}

.settings-hub-stat::before {
  content: "";
  width: 0.43rem;
  height: 0.43rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--settings-accent) 72%, white 28%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--settings-accent) 22%, transparent 78%);
}

.settings-hub-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 1rem;
}

.settings-hub-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  padding: 0.52rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}

.settings-hub-tab {
  position: relative;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: rgba(228, 238, 255, 0.78);
  border-radius: 0.74rem;
  padding: 0.66rem 0.82rem 0.66rem 1rem;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 560;
  letter-spacing: 0.01em;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.settings-hub-tab::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0.78rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
  transition: height 0.2s ease, background-color 0.2s ease;
}

.settings-hub-tab:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(1px);
}

.settings-hub-tab.is-active {
  border-color: color-mix(in srgb, var(--settings-accent) 56%, white 44%);
  background: linear-gradient(135deg,
      color-mix(in srgb, var(--settings-accent) 42%, black 58%),
      color-mix(in srgb, var(--settings-accent) 24%, black 76%));
  color: #fff;
  box-shadow: 0 11px 24px color-mix(in srgb, var(--settings-accent) 35%, transparent 65%);
}

.settings-hub-tab.is-active::before {
  height: 1.14rem;
  background: #fff;
}

.settings-hub-tab:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--settings-accent) 62%, white 38%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--settings-accent) 28%, transparent 72%);
}

.settings-hub-panels {
  min-height: 0;
  border-radius: 0.98rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    linear-gradient(200deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  overflow: auto;
  padding: 1rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.025) inset,
    0 20px 40px rgba(0, 0, 0, 0.22);
}

.settings-hub-panels::-webkit-scrollbar {
  width: 10px;
}

.settings-hub-panels::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  background-color: rgba(255, 255, 255, 0.16);
}

.settings-hub-panels::-webkit-scrollbar-track {
  background: transparent;
}

.settings-panel {
  display: none;
}

.settings-panel.is-active {
  display: block;
  animation: settingsPanelIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-panel.is-active .settings-card {
  animation: settingsCardIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.settings-panel.is-active .settings-card:nth-child(2) {
  animation-delay: 0.05s;
}

.settings-panel.is-active .settings-card:nth-child(3) {
  animation-delay: 0.1s;
}

@keyframes settingsPanelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

@keyframes settingsCardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.88rem;
}

.settings-grid-account {
  grid-template-columns: 1.28fr 1fr;
}

.settings-grid-personalization {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018)),
    linear-gradient(185deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.74rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--settings-accent) 70%, white 30%), transparent 80%);
  opacity: 0.8;
}

.settings-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--settings-accent) 40%, white 60%);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.settings-card h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 630;
  line-height: 1.2;
  color: #fff;
}

.settings-card p {
  margin: 0;
  color: rgba(235, 242, 255, 0.77);
  font-size: 0.9rem;
  line-height: 1.44;
}

.settings-account-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--settings-accent) 36%, white 64%);
  background: linear-gradient(140deg,
      color-mix(in srgb, var(--settings-accent) 28%, black 72%),
      rgba(255, 255, 255, 0.05));
  border-radius: 0.95rem;
  padding: 0.96rem;
  display: flex;
  align-items: center;
  gap: 0.78rem;
  margin-bottom: 0.9rem;
}

.settings-account-hero::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  right: -70px;
  top: -120px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--settings-accent) 45%, transparent 55%);
  opacity: 0.2;
  filter: blur(20px);
}

.settings-account-avatar {
  width: 47px;
  height: 47px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg,
      color-mix(in srgb, var(--settings-accent) 84%, white 16%),
      color-mix(in srgb, var(--settings-accent) 70%, black 30%));
  color: #08111f;
  font-size: 0.88rem;
  font-weight: 760;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--settings-accent) 42%, transparent 58%);
}

.settings-account-details h3 {
  margin: 0;
  font-size: 1.08rem;
  color: #fff;
}

.settings-account-details p {
  margin: 0.1rem 0 0;
  color: rgba(220, 236, 255, 0.78);
  font-size: 0.89rem;
}

.settings-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.78rem;
  padding: 0.64rem 0.71rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.7rem;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.settings-control-row:hover {
  border-color: rgba(255, 255, 255, 0.17);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.settings-control-row strong {
  display: block;
  font-size: 0.9rem;
  color: #fff;
  font-weight: 580;
}

.settings-control-row span {
  display: block;
  margin-top: 0.15rem;
  color: rgba(227, 236, 255, 0.68);
  font-size: 0.8rem;
  line-height: 1.38;
}

.settings-switch {
  min-width: 56px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 650;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-switch[aria-pressed="true"] {
  border-color: var(--settings-accent-soft);
  background: linear-gradient(145deg,
      color-mix(in srgb, var(--settings-accent) 58%, black 42%),
      color-mix(in srgb, var(--settings-accent) 35%, black 65%));
  box-shadow: 0 5px 14px color-mix(in srgb, var(--settings-accent) 35%, transparent 65%);
}

.settings-switch:hover {
  transform: translateY(-1px) scale(1.02);
}

.settings-switch:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--settings-accent) 62%, white 38%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--settings-accent) 28%, transparent 72%);
}

.settings-link-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.settings-link-actions a {
  color: color-mix(in srgb, var(--settings-accent) 73%, white 27%);
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
  width: fit-content;
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.settings-link-actions a:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(1px);
}

.settings-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.settings-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(236, 242, 255, 0.84);
  padding: 0.46rem 0.74rem;
  border-radius: 999px;
  font-size: 0.81rem;
  font-weight: 570;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.settings-chip:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.settings-chip.is-active {
  border-color: var(--settings-accent-soft);
  background: color-mix(in srgb, var(--settings-accent) 22%, black 78%);
  color: #fff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--settings-accent) 21%, transparent 79%);
}

.settings-chip:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--settings-accent) 62%, white 38%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--settings-accent) 28%, transparent 72%);
}

.settings-segmented {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.settings-segmented-theme {
  width: 100%;
  border-radius: 0.72rem;
}

.settings-segmented-theme .settings-segment-btn {
  flex: 1 1 120px;
}

.settings-segment-btn {
  border: none;
  background: transparent;
  color: rgba(236, 242, 255, 0.76);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 560;
  padding: 0.48rem 0.74rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.settings-segment-btn.is-active {
  background: color-mix(in srgb, var(--settings-accent) 26%, black 74%);
  color: #fff;
}

.settings-segment-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--settings-accent) 62%, white 38%);
}

.settings-inline-list {
  margin: 0;
  padding-left: 1rem;
  color: rgba(225, 236, 255, 0.79);
  font-size: 0.86rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  line-height: 1.45;
}

.settings-danger-card {
  border-color: rgba(255, 113, 113, 0.35);
  background: linear-gradient(155deg, rgba(255, 104, 104, 0.16), rgba(255, 255, 255, 0.02));
}

.settings-danger-card::before {
  background: linear-gradient(90deg, rgba(255, 115, 115, 0.95), rgba(255, 115, 115, 0) 80%);
}

.settings-danger-btn {
  width: fit-content;
  margin-top: 0.2rem;
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.22);
}

.settings-danger-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

#settingsModalDangerHint {
  color: rgba(255, 204, 204, 0.88);
  font-size: 0.78rem;
  line-height: 1.4;
}

@media (max-width: 960px) {
  .settings-hub-layout {
    grid-template-columns: 1fr;
    gap: 0.82rem;
  }

  .settings-hub-tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.45rem;
    scrollbar-width: thin;
  }

  .settings-hub-tab {
    flex: 0 0 auto;
    min-width: 155px;
    text-align: center;
    padding-left: 0.82rem;
  }

  .settings-hub-tab::before {
    left: 0.5rem;
  }

  .settings-grid,
  .settings-grid-account {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .settings-hub-modal-content {
    width: 96vw;
    height: 91vh;
  }

  .settings-hub-modal-inner {
    padding: 0.9rem 0.78rem 0.96rem;
    gap: 0.72rem;
  }

  .settings-hub-header {
    padding-right: 2rem;
  }

  .settings-hub-stat {
    font-size: 0.7rem;
    padding: 0.24rem 0.52rem;
  }

  .settings-hub-panels {
    padding: 0.74rem;
  }

  .settings-hub-tab {
    min-width: 140px;
    padding: 0.57rem 0.66rem;
    font-size: 0.86rem;
  }

  .settings-card {
    padding: 0.88rem;
  }
}

.account-delete-modal-content {
  max-width: 430px;
  width: 100%;
}

.account-delete-modal-inner {
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.account-delete-title {
  margin: 0.2rem 0 0;
  font-size: 1.45rem;
  font-weight: 600;
  color: #fff;
}

.account-delete-message {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.98rem;
  line-height: 1.45;
}

.account-delete-message-subtle {
  color: rgba(255, 178, 178, 0.95);
}

.account-delete-confirm-input {
  width: 100%;
  height: 48px;
  margin-top: 0.25rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0 0.85rem;
  font-size: 0.96rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.account-delete-confirm-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.account-delete-confirm-input:focus-visible {
  outline: none;
  border-color: rgba(255, 128, 128, 0.65);
  box-shadow: 0 0 0 2px rgba(255, 96, 96, 0.2);
  background: rgba(255, 255, 255, 0.09);
}

.account-delete-actions {
  margin-top: 0.45rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

.account-delete-actions .plan-btn {
  margin-bottom: 0;
}

.account-delete-actions .plan-btn.delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.logout-confirm-modal-content {
  max-width: 430px;
  width: 100%;
}

.logout-confirm-modal-inner {
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0.78rem;
}

.logout-confirm-title {
  margin: 0.2rem 0 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
}

.logout-confirm-message {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.98rem;
  line-height: 1.45;
}

.logout-confirm-actions {
  margin-top: 0.42rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

.logout-confirm-actions .plan-btn {
  margin-bottom: 0;
}

.donation-modal-content {
  max-width: 620px;
  width: 100%;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(130% 110% at 0% 0%, rgba(97, 170, 255, 0.2), transparent 55%),
    radial-gradient(120% 95% at 100% 0%, rgba(255, 120, 120, 0.14), transparent 58%),
    linear-gradient(160deg, rgba(22, 29, 45, 0.95), rgba(20, 20, 24, 0.96));
  border: 1px solid rgba(165, 205, 255, 0.22);
}

.donation-modal-content::before,
.donation-modal-content::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.donation-modal-content::before {
  width: 210px;
  height: 210px;
  top: -110px;
  right: -80px;
  background: radial-gradient(circle, rgba(117, 204, 255, 0.34), rgba(117, 204, 255, 0) 72%);
}

.donation-modal-content::after {
  width: 190px;
  height: 190px;
  bottom: -110px;
  left: -70px;
  background: radial-gradient(circle, rgba(255, 137, 137, 0.2), rgba(255, 137, 137, 0) 72%);
}

.donation-modal-inner {
  position: relative;
  z-index: 1;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0.82rem;
}

.donation-modal-eyebrow {
  margin: 0;
  color: rgba(167, 223, 255, 0.96);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 650;
}

.donation-modal-title {
  margin: 0;
  font-size: 1.62rem;
  font-weight: 680;
  line-height: 1.18;
  color: #fff;
}

.donation-modal-message {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.96rem;
  line-height: 1.42;
}

.donation-modal-note {
  margin: 0;
  color: rgba(192, 216, 255, 0.75);
  font-size: 0.84rem;
  line-height: 1.4;
}

.donation-modal-options {
  margin-top: 0.36rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
}

.donation-modal-option {
  --tier-accent: rgba(137, 184, 255, 0.9);
  border: 1px solid color-mix(in srgb, var(--tier-accent) 54%, rgba(255, 255, 255, 0.22));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--tier-accent) 22%, rgba(255, 255, 255, 0.1)), rgba(255, 255, 255, 0.03)),
    rgba(18, 24, 36, 0.92);
  border-radius: 0.8rem;
  color: #fff;
  text-align: left;
  font-family: var(--font-sans);
  cursor: pointer;
  padding: 0.74rem 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.donation-modal-option-coffee {
  --tier-accent: rgba(210, 142, 74, 0.95);
}

.donation-modal-option-pizza {
  --tier-accent: rgba(255, 120, 120, 0.95);
}

.donation-modal-option-server {
  --tier-accent: rgba(84, 218, 196, 0.92);
}

.donation-modal-option-enterprise {
  --tier-accent: rgba(248, 196, 92, 0.95);
}

.donation-modal-option:hover,
.donation-modal-option:focus-visible {
  border-color: color-mix(in srgb, var(--tier-accent) 74%, white 26%);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--tier-accent) 35%, rgba(255, 255, 255, 0.11)), rgba(255, 255, 255, 0.05)),
    rgba(22, 30, 45, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32), 0 0 0 1px color-mix(in srgb, var(--tier-accent) 55%, transparent 45%);
  outline: none;
}

.donation-modal-option-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.38rem;
}

.donation-modal-option-title {
  font-size: 0.88rem;
  font-weight: 620;
  color: rgba(255, 255, 255, 0.95);
}

.donation-modal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tier-accent) 68%, rgba(255, 255, 255, 0.18));
  background: color-mix(in srgb, var(--tier-accent) 24%, rgba(255, 255, 255, 0.05));
  color: color-mix(in srgb, var(--tier-accent) 82%, white 18%);
  font-size: 0.63rem;
  letter-spacing: 0.04em;
  font-weight: 670;
  text-transform: uppercase;
  padding: 0.14rem 0.48rem;
}

.donation-modal-option-amount {
  margin-top: 0.04rem;
  font-size: 1.24rem;
  line-height: 1.15;
  font-weight: 700;
  color: color-mix(in srgb, var(--tier-accent) 72%, white 28%);
}

.donation-modal-option-copy {
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: rgba(225, 234, 251, 0.79);
  letter-spacing: 0.01em;
}

.donation-modal-trust-row {
  margin-top: 0.16rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.82rem;
  color: rgba(197, 213, 238, 0.68);
  font-size: 0.75rem;
}

.donation-modal-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.donation-modal-trust-row span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(136, 216, 255, 0.86);
  box-shadow: 0 0 0 3px rgba(136, 216, 255, 0.16);
}

.donation-modal-actions {
  margin-top: 0.38rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

.donation-modal-actions .plan-btn {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .donation-modal-title {
    font-size: 1.45rem;
  }

  .donation-modal-options {
    grid-template-columns: 1fr;
  }

  .donation-modal-trust-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.32rem;
  }
}

.delete-modal-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.delete-modal-checkbox-label:hover {
  color: rgba(255, 255, 255, 0.8);
}

.delete-modal-checkbox-label input {
  display: none;
}

.checkbox-custom {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.delete-modal-checkbox-label input:checked+.checkbox-custom {
  background: #3b82f6;
  border-color: #3b82f6;
}

.checkbox-custom::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.delete-modal-checkbox-label input:checked+.checkbox-custom::after {
  opacity: 1;
}

/* Custom Checkbox */
.custom-checkbox-container {
  display: inline-block;
  position: relative;
  width: 18px;
  height: 18px;
  cursor: pointer;
  font-size: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Hide the browser's default checkbox */
.custom-checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Create a custom checkbox */
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* On mouse-over, add a grey background color */
.custom-checkbox-container:hover input~.checkmark {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* When the checkbox is checked, add a blue background */
.custom-checkbox-container input:checked~.checkmark {
  background-color: #ef4444;
  border-color: #ef4444;
}

/* Create the checkmark/indicator (hidden when not checked) */
.checkmark:after {
  content: "";
  display: none;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
  margin-top: -2px;
  /* Slight optical adjustment */
}

/* Show the checkmark when checked */
.custom-checkbox-container input:checked~.checkmark:after {
  display: block;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.search-icon-modal {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.search-icon-modal svg {
  width: 100%;
  height: 100%;
}

.search-modal-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 1rem 1rem 1rem 3.25rem;
  /* Left padding for icon */
  font-size: 1.1rem;
  color: white;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-sans);
}

.search-modal-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.search-modal-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.search-results-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-content.search-view-modal {
  width: 90%;
  max-width: 1100px;
  height: 85vh;
  max-height: 800px;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: #121212;
  /* Deep dark background like Grok/ChatGPT */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Header Section */
.search-view-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 1rem;
  flex-shrink: 0;
}

.search-input-container {
  position: relative;
  flex-grow: 1;
}

.search-input-container .search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.search-view-input {
  width: 100%;
  background: none;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem 1.25rem 3.25rem;
  font-size: 1rem;
  color: white;
  outline: none;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.search-view-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.modal-close-btn.simple {
  /* Reset absolute positioning */
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn.simple:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: none;
}

/* Body Section (Split View) */
.search-view-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  /* Contain scrollbars */
}

.search-view-body.no-search-results .search-preview-pane {
  display: none;
}


.search-view-body.no-search-results .search-sidebar-container {
  width: 100%;
  max-width: none;
  min-width: 0;
  border-right: none;
  padding: 0;
}

/* Sidebar Container (holds list + footer) */
.search-sidebar-container {
  width: 35%;
  min-width: 300px;
  max-width: 400px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  transition: border-right 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Results List (inside container) */
.search-results-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  scroll-behavior: smooth;
  width: 100%;
}

/* Footer (inside container) */
.search-sidebar-footer {
  padding: 0.5rem;
  /* border-top: 1px solid rgba(255, 255, 255, 0.08); Optional: seamless look desired? */
  flex-shrink: 0;
  display: flex;
}

/* Resize Button */
.search-resize-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-resize-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.search-resize-btn svg {
  /* Removed 45deg rotation as new icon is already diagonal */
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  stroke: currentColor;
  stroke-width: 1.8px;
}

/* Compact Mode (List Only) */
.search-view-modal {
  transition:
    opacity 0.3s cubic-bezier(0.2, 0, 0, 1),
    transform 0.3s cubic-bezier(0.2, 0, 0, 1),
    width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    max-width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: width, max-width, opacity, transform;
}

.search-view-modal.compact {
  width: 450px;
  max-width: 90vw;
}

.search-view-modal.compact .search-sidebar-container {
  width: 100%;
  max-width: 100%;
  border-right: none;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    max-width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-right 0.3s ease;
}

.search-view-modal.compact .search-preview-pane {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
  width: 0;
  padding: 0;
  overflow: hidden;
}

.search-view-modal.compact .search-resize-btn svg {
  transform: rotate(180deg);
  /* Flip icon to point inwards */
}

.search-empty-state {
  flex: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  padding: 2rem;
  animation: fadeInEmptyState 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

.search-empty-state .empty-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.search-empty-state .empty-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.45);
}

.search-empty-state .empty-query {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.search-empty-state .empty-hint {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.35);
}

/* Scrollbar styling for sidebar */
.search-results-list::-webkit-scrollbar {
  width: 6px;
}

.search-results-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Date Headers */
.search-date-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  margin: 1rem 0.75rem 0.5rem 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-date-header:first-child {
  margin-top: 0.5rem;
}

.search-selection-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0.5rem 0.45rem;
  padding: 0.35rem 0.2rem 0.45rem;
  border: none;
  background: transparent;
  min-height: 28px;
}

.search-selection-select-all {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-selection-select-all-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.search-selection-select-all-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.search-selection-select-all-box::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.search-selection-select-all-input:checked+.search-selection-select-all-box {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(239, 68, 68, 0.98);
}

.search-selection-select-all-input:checked+.search-selection-select-all-box::after {
  opacity: 1;
}

.search-selection-select-all-input:indeterminate+.search-selection-select-all-box {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(239, 68, 68, 0.98);
}

.search-selection-select-all-input:indeterminate+.search-selection-select-all-box::after {
  opacity: 1;
  width: 8px;
  height: 0;
  border-width: 0 0 2px 0;
  transform: none;
}

.search-selection-select-all-input:disabled+.search-selection-select-all-box {
  opacity: 0.45;
  cursor: not-allowed;
}

.search-selection-count {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
  margin-right: auto;
  line-height: 1;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

.search-selection-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.18s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#searchModalContent.bulk-selection-active .search-selection-action {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-selection-action:hover:not(:disabled) {
  color: #ffffff;
}

.search-selection-action.search-selection-delete:hover:not(:disabled) {
  color: #ef4444;
}

.search-selection-action:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* Result Item */
.search-result-item {
  position: relative;
  /* For absolute positioning of actions */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  margin: 0 0.5rem;

  /* Smooth Transitions */
  transition: background-color 0.2s ease, transform 0.2s ease, border-left-color 0.2s ease;
  border-left: 3px solid transparent;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-result-item:hover .result-time {
  opacity: 0;
  transform: translateY(-5px);
}

.search-result-item:hover .result-actions {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.search-result-item.active {
  background: rgba(255, 255, 255, 0.12);
  border-left-color: #3b82f6;
}

.search-result-item.selected-for-bulk {
  background: transparent;
  border-left-color: rgba(239, 68, 68, 0.95);
}

.search-row-select-control {
  width: 24px;
  min-width: 24px;
  margin-left: -0.45rem;
  margin-right: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-row-checkbox {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-row-checkbox-input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.search-row-checkbox-ui {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.03);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.search-row-checkbox-ui::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.search-row-checkbox-input:checked+.search-row-checkbox-ui {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(239, 68, 68, 0.98);
}

.search-row-checkbox-input:checked+.search-row-checkbox-ui::after {
  opacity: 1;
}

#searchModalContent.bulk-selection-active .search-result-item .result-actions {
  display: none;
}

#searchModalContent.bulk-selection-active .search-result-item:hover .result-time {
  opacity: 1;
  transform: translateY(0);
}

.result-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
  flex: 1;
  margin-right: 1rem;
}

.result-title {
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.result-title-text {
  display: block;
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-rename-input {
  display: none;
  width: 100%;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  color: #ffffff;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  line-height: 1.2;
  outline: none;
  box-shadow: none;
  caret-color: #ffffff;
}

.search-result-item.renaming .result-title-text {
  display: none;
}

.search-result-item.renaming .search-rename-input {
  display: block;
}

.result-preview-text {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-meta-container {
  position: relative;
  height: 24px;
  /* Fixed height to contain buttons */
  min-width: 80px;
  /* Ensure space */
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.result-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  right: 0;
  opacity: 1;
  transform: translateY(0);
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  position: absolute;
  right: 0;
  opacity: 0;
  transform: translateY(5px);
  z-index: 20;
  pointer-events: auto !important;
  /* Force clicks to register */
  /* Prevent clicks when hidden */
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Right Pane (Preview) */
.search-preview-pane {
  flex: 1;
  background: #0a0a0a;
  /* Slightly darker than sidebar */
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    flex 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform, width;
}

.preview-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.2);
}

.preview-placeholder span {
  font-size: 1rem;
}

/* Chat Preview Content */
.preview-content {
  animation: fadeInPreview 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

@keyframes fadeInPreview {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

/* Smooth preview content update */
.preview-content.updating {
  opacity: 0;
  transform: translateY(4px);
}

.preview-content.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}


.preview-message {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-message.user {
  align-items: flex-end;
}

.preview-message.bot {
  align-items: flex-start;
}

.preview-bubble {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  max-width: 85%;
  line-height: 1.5;
  font-size: 0.95rem;
}

.preview-message.user .preview-bubble {
  background: #2d2d2d;
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.preview-message.bot .preview-bubble {
  background: transparent;
  color: #e0e0e0;
  padding-left: 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20, 20, 20, 0.95);
  color: #ffffff;
  padding: 0.6rem 0.9rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.preview-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
}

.preview-meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .search-preview-pane {
    display: none;
    /* Hide preview on mobile */
  }

  .search-results-sidebar {
    width: 100%;
    max-width: none;
    border-right: none;
  }

  .modal-content.search-view-modal {
    height: 100%;
    width: 100%;
    border-radius: 0;
  }
}

.search-new-chat-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0.5rem 0.5rem 0.5rem;
  /* Spacing above "Today" */
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  color: white;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.search-new-chat-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-new-chat-btn:active {
  transform: translateY(0);
}

.search-new-chat-btn svg {
  color: rgba(255, 255, 255, 0.7);
  stroke: currentColor;
  stroke-width: 1.8px;
  /* Refined for better visibility */
}

.search-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto !important;
  position: relative;
  z-index: 21;
}

.search-action-btn svg {
  stroke-width: 1.8px;
}

.search-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
}

.search-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  /* Red tint */
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Chat Rename Styles */
.chat-item.renaming .chat-item-text {
  display: none;
}

.chat-item.renaming .chat-item-options {
  display: none;
}

.chat-item.renaming .chat-item-rename {
  display: flex;
  align-items: center;
  flex: 1;
}

.chat-item-rename {
  display: none;
  position: relative;
}

.chat-rename-input {
  flex: 1;
  background: none;
  border: none;
  border-radius: 0.5rem;
  padding: 0.375rem 2.75rem 0.375rem 0rem;
  color: white;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.chat-rename-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chat-rename-actions {
  position: absolute;
  right: -0.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.chat-rename-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  opacity: 0.8;
}

.chat-rename-btn:hover {
  opacity: 1;
  color: white;
}

.chat-rename-btn.check:hover {
  color: #22c55e;
}

.chat-rename-btn.cancel:hover {
  color: #ef4444;
}

.chat-rename-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8px;
}

.header-center .title {
  max-width: 40ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  display: block;
  /* Ensures max-width applies correctly */
}

/* Style for the temporary input field in the header */
.header-rename-input {
  background: transparent;
  border: none;
  border-radius: 0.3rem;
  color: white;
  font-size: inherit;
  /* Inherit font size from header */
  font-weight: 600;
  font-family: var(--font-sans);
  padding: 0.1rem 0.5rem;
  text-align: center;
  width: 250px;
  outline: none;
}

.header-rename-input:focus {
  border-color: none;
  background: none;
}

.message-wrapper {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.8rem;
  position: relative;
  width: fit-content;
}

.message-wrapper.message-enter {
  opacity: 0;
  transform: translateY(10px) scale(0.992);
  filter: blur(3px);
}

.message-wrapper.message-enter.message-enter-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition: opacity 0.34s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.28s ease;
}

.message-wrapper:first-child {
  margin-top: 1rem;
}

.message-wrapper.user-wrapper {
  align-items: flex-end;
  /* Aligns content to the right */
  margin-left: 0;
  width: 100%;
  max-width: 100%;
}

.message-wrapper.bot-wrapper {
  align-items: flex-start;
  /* Aligns content to the left */
  margin-right: 0;
  width: 100%;
  max-width: 100%;
}

/* The buttons container */
.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 1px;
  padding-right: 4px;
  /* Slight offset for user messages */
  opacity: 0;
  /* Hidden by default */
  transform: translateY(-3px);
  /* Slight slide effect */
  min-height: 28px;
  transition: opacity 0.22s cubic-bezier(0.2, 0, 0, 1), transform 0.22s cubic-bezier(0.2, 0, 0, 1), filter 0.22s ease;
  pointer-events: none;
  /* Prevents accidental clicks when invisible */
  will-change: transform, opacity;
}

/* SHOW on hover */
.message-wrapper:hover .message-actions,
.message-wrapper:focus-within .message-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* The actual buttons */
.msg-action-btn {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.84);
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.22s ease, opacity 0.2s ease;
  transform: translateY(0);
}

.msg-action-btn:hover {
  color: rgba(255, 255, 255, 0.99);
  background: transparent;
  border-color: transparent;
  transform: translateY(-1px) scale(1.02);
  box-shadow: none;
}

.msg-action-btn:active {
  transform: translateY(0) scale(0.95);
}

.msg-action-btn:focus-visible {
  outline: none;
  border-color: rgba(var(--app-accent-rgb), 0.62);
  box-shadow: 0 0 0 1px rgba(var(--app-accent-rgb), 0.45), 0 0 0 4px rgba(var(--app-accent-rgb), 0.16);
}

.msg-action-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.msg-action-btn.like svg,
.msg-action-btn.dislike svg {
  fill: currentColor;
  stroke: none;
}

.msg-action-btn:hover svg {
  transform: scale(1.06);
}

/* Adjust the message bubble to reset margins since wrapper handles it */
.message-wrapper .message {
  margin: 0 !important;
  /* Override inline JS margins */
  max-width: 100% !important;
  /* Wrapper handles width */
  transition: box-shadow 0.28s ease;
}

.message-wrapper.user-wrapper .message {
  max-width: 75% !important;
}

.message-wrapper.bot-wrapper .message {
  max-width: min(86%, 860px) !important;
}

.user-message-text {
  white-space: pre-wrap;
}

.message-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.message-attachment-chip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.42rem;
  width: min(100%, 360px);
  min-width: min(100%, 220px);
  padding: 0.42rem 0.5rem;
  border-radius: 0.66rem;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.73rem;
  line-height: 1.2;
}

.message-attachment-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.message-attachment-kind {
  flex: 0 0 auto;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.62rem;
  border-radius: 999px;
  padding: 0.08rem 0.34rem;
  background: rgba(255, 255, 255, 0.1);
}

.message-attachment-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.94);
}

.message-attachment-size {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.66rem;
}

.message-attachment-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 62px;
  border-radius: 0.52rem;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.message-attachment-preview.is-clickable {
  cursor: zoom-in;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.message-attachment-preview.is-clickable:hover {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.message-attachment-preview.is-clickable:focus-visible {
  outline: none;
  border-color: rgba(var(--app-accent-rgb), 0.65);
  box-shadow: 0 0 0 2px rgba(var(--app-accent-rgb), 0.35);
}

.message-attachment-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  display: block;
}

.message-attachment-preview video {
  width: 100%;
  max-height: 240px;
  display: block;
  background: #000;
}

.message-attachment-preview audio {
  width: 100%;
}

.message-attachment-preview iframe {
  width: 100%;
  height: 240px;
  border: 0;
  background: #fff;
}

.message-attachment-preview-fallback {
  width: 100%;
  min-height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.4rem 0.55rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.69rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.message-attachment-open {
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.93);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.message-attachment-open:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
  color: rgba(255, 255, 255, 1);
}

.message-wrapper.bot-wrapper .bot-message {
  font-family: var(--font-sans);
}

.message-wrapper.bot-wrapper .bot-message.bot-loading-message {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.5rem;
  padding: 0.62rem 0.92rem;
  border: 1px solid rgba(var(--app-accent-rgb), 0.2);
  border-radius: 1.2rem;
  background:
    radial-gradient(92px 46px at 0% -30%, rgba(var(--app-accent-rgb), 0.33), rgba(var(--app-accent-rgb), 0)),
    linear-gradient(140deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.plerng-response-loader {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.plerng-response-loader-orbit {
  position: absolute;
  border-style: solid;
  border-radius: 999px;
  border-width: 1.4px;
}

.plerng-response-loader-orbit.orbit-a {
  inset: 0;
  border-color: rgba(var(--app-accent-rgb), 0.9) transparent rgba(var(--app-accent-rgb), 0.22);
  animation: plerngLoaderOrbitClockwise 1.05s linear infinite;
}

.plerng-response-loader-orbit.orbit-b {
  inset: 4px;
  border-color: rgba(255, 255, 255, 0.85) rgba(255, 255, 255, 0.18) transparent;
  animation: plerngLoaderOrbitCounter 0.9s linear infinite;
}

.plerng-response-loader-core {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.98), rgba(var(--app-accent-rgb), 0.94));
  box-shadow: 0 0 8px rgba(var(--app-accent-rgb), 0.6);
  animation: plerngLoaderCorePulse 1.2s ease-in-out infinite;
}

.plerng-response-loader-label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: rgba(235, 240, 255, 0.82);
  animation: plerngLoaderLabelPulse 1.5s ease-in-out infinite;
}

.message-wrapper.bot-wrapper .bot-message.bot-message-stream-reveal {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(4px);
}

.message-wrapper.bot-wrapper .bot-message.bot-message-stream-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition: opacity 0.34s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.24s ease;
}

.message-wrapper.bot-wrapper .bot-message > :first-child {
  margin-top: 0;
}

.message-wrapper.bot-wrapper .bot-message > :last-child {
  margin-bottom: 0 !important;
}

@keyframes plerngLoaderOrbitClockwise {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes plerngLoaderOrbitCounter {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-360deg);
  }
}

@keyframes plerngLoaderCorePulse {
  0%,
  100% {
    transform: scale(0.72);
    opacity: 0.72;
  }

  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes plerngLoaderLabelPulse {
  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 0.96;
  }
}

@media (prefers-reduced-motion: reduce) {
  .message-wrapper.message-enter,
  .message-wrapper.message-enter.message-enter-active,
  .message-wrapper.bot-wrapper .bot-message.bot-message-stream-reveal,
  .message-wrapper.bot-wrapper .bot-message.bot-message-stream-reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

  .plerng-response-loader-orbit,
  .plerng-response-loader-core,
  .plerng-response-loader-label {
    animation: none !important;
  }
}

.bot-message-actions {
  justify-content: flex-start;
  margin-top: 1px;
  padding-left: 1.1rem;
  padding-right: 4px;
  width: fit-content;
  max-width: min(86%, 860px);
  flex-wrap: wrap;
  row-gap: 6px;
}

.bot-message-actions .msg-action-btn {
  flex: 0 0 auto;
}

.msg-action-btn.is-active {
  color: rgba(var(--app-accent-rgb), 0.95);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.msg-action-btn.is-pending {
  opacity: 0.45;
  pointer-events: none;
}

/* --- Message Edit Mode Styles --- */

.message-edit-container {
  background-color: #404040;
  /* Dark grey background */
  border-radius: 2rem;
  padding: 20px 20px 15px 20px;
  width: 100%;
  min-width: 300px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  animation: fadeInScale 0.2s ease-out;
}

.edit-textarea {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-family: var(--font-sans);
  font-size: 0.925rem;
  line-height: 1.5;
  resize: none;
  width: 100%;
  min-height: 40px;
  overflow-y: hidden;
  /* Auto-grow logic handles height */
  padding: 0;
  margin-bottom: 10px;
}

.edit-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.edit-btn-action {
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.edit-btn-action.cancel {
  background-color: #2f2f2f;
  color: white;
  border: 1px solid transparent;
}

.edit-btn-action.cancel:hover {
  background-color: #454545;
}

.edit-btn-action.save {
  background-color: white;
  color: black;
}

.edit-btn-action.save:hover {
  background-color: #e0e0e0;
}

/* --- Edit Mode Layout Overrides --- */

/* When editing, force the wrapper to take full width */
.message-wrapper.is-editing {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  align-items: stretch !important;
}

/* Ensure the container inside fills the space */
.message-wrapper.is-editing .message-edit-container {
  width: 100%;
  margin: 0;
}

#incognitoBtn {
  transition: all 0.3s ease;
}

#incognitoBtn.active {
  color: #a855f7;
  /* Purple */
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.2);
}

#incognitoBtn.active .icon svg {
  filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.5));
}

body.chat-view-active #incognitoBtn {
  display: none;
}

body.incognito-active .input-container {
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.15),
    inset 0 0 10px rgba(168, 85, 247, 0.05) !important;
}

body.incognito-active .input-container:focus-within {
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.25),
    inset 0 0 10px rgba(168, 85, 247, 0.05) !important;
}

body.incognito-active .suggestion-highway,
body.incognito-active .autocomplete-dropdown-wrapper {
  opacity: 0 !important;
  transform: translateY(10px);
  pointer-events: none !important;
  visibility: hidden;
}

/* 4. Header Header adjustments */
body.incognito-active .header-center .title {
  color: #a855f7;
}

body.incognito-active #titleToggle {
  display: none !important;
}

body.incognito-active #titleDropdown {
  display: none !important;
}

body.incognito-active .disclaimer-text {
  color: rgba(168, 85, 247, 0.8);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

/* --- ATLAS STYLE SUGGESTIONS (Bottom Track) --- */

.atlas-carousel {
  display: flex;
  flex-direction: row;
  width: 100%;
  position: relative;
}

/* Carousel wrapper with nav buttons */
.carousel-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.5rem;
  position: relative;
}

/* Navigation buttons */
.carousel-nav {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(30, 30, 30, 0.8);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.carousel-nav:hover {
  background: rgba(50, 50, 50, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  transform: scale(1.1);
}

.carousel-nav:active {
  transform: scale(0.95);
}

/* Scrollable track */
.carousel-track {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  flex: 1;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;

  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.atlas-card {
  flex: 0 0 auto;
  width: 260px;
  scroll-snap-align: start;
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  height: 100%;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient overlay */
.atlas-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.atlas-card-icon {
  font-size: 1.5rem;
  opacity: 0.9;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
}

.atlas-card-text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

/* HOVER EFFECTS */
.atlas-card:hover {
  background: rgba(50, 50, 50, 0.8);
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.3),
    0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.atlas-card:hover::before {
  opacity: 1;
}

.atlas-card:hover .atlas-card-icon {
  transform: scale(1.1);
}

.atlas-card:hover .atlas-card-text {
  color: #fff;
}

.atlas-card:active {
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ANNOYING DONATION MODAL STYLES */
.annoying-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.5s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

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

.annoying-modal-content {
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  max-width: 800px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }

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

.annoying-modal-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.annoying-modal-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ff6b6b;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.annoying-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.annoying-modal-body {
  padding: 2rem;
  max-height: 60vh;
  overflow-y: auto;
}

.annoying-read-content h2 {
  color: #4ecdc4;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.annoying-read-content h3 {
  color: #ffe66d;
  font-size: 1.2rem;
  margin: 1.5rem 0 1rem;
  font-weight: 600;
}

.annoying-read-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.donation-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.donation-tier {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.donation-tier:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.donation-tier h4 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.donation-tier p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.donate-btn {
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.coffee-btn {
  background: linear-gradient(135deg, #d2691e, #a0522d);
  color: white;
}

.coffee-btn:hover {
  background: linear-gradient(135deg, #b8571f, #8b4513);
  transform: scale(1.05);
}

.pizza-btn {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: white;
}

.pizza-btn:hover {
  background: linear-gradient(135deg, #ff5252, #dc4545);
  transform: scale(1.05);
}

.server-btn {
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  color: white;
}

.server-btn:hover {
  background: linear-gradient(135deg, #26d0ce, #2e8b57);
  transform: scale(1.05);
}

.enterprise-btn {
  background: linear-gradient(135deg, #ffe66d, #ffb347);
  color: #333;
}

.enterprise-btn:hover {
  background: linear-gradient(135deg, #ffd700, #ffa500);
  transform: scale(1.05);
}

.annoying-stats {
  margin: 2rem 0;
}

.annoying-stats ul {
  list-style: none;
  padding: 0;
}

.annoying-stats li {
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.annoying-guilt-trip {
  background: rgba(255, 107, 107, 0.1);
  border-left: 4px solid #ff6b6b;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 8px;
}

.annoying-guilt-trip em {
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
}

.annoying-modal-footer {
  padding: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.annoying-timer {
  text-align: center;
  margin-bottom: 2rem;
}

.annoying-timer p {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffe66d;
  margin-bottom: 1rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4, #44a08d);
  width: 0%;
  transition: width 1s linear;
  border-radius: 4px;
}

.annoying-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.skip-btn {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: not-allowed;
  transition: all 0.3s ease;
}

.skip-btn:enabled {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.skip-btn:enabled:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.donate-main-btn {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: donatePulse 2s infinite;
}

@keyframes donatePulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
  }
}

.donate-main-btn:hover {
  background: linear-gradient(135deg, #ff5252, #dc4545);
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .annoying-modal-content {
    width: 95vw;
    margin: 1rem;
  }

  .annoying-modal-header h1 {
    font-size: 1.8rem;
  }

  .donation-options {
    grid-template-columns: 1fr;
  }

  .annoying-buttons {
    flex-direction: column;
  }

  .annoying-buttons button {
    width: 100%;
  }
}

/* Server Status Indicator */
.server-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}

.server-status.connected {
  background-color: #10b981;
  /* Green */
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.server-status.disconnected {
  background-color: #ef4444;
  /* Red */
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.server-status.error {
  background-color: #f59e0b;
  /* Yellow/Orange */
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.server-status.unknown {
  background-color: #6b7280;
  /* Gray */
  box-shadow: 0 0 6px rgba(107, 114, 128, 0.4);
}

/* --- Smart Suggestion Styles --- */

.autocomplete-item.smart-suggestion {
  padding: 10px 14px;
  /* Slightly larger padding for importance */
  background: rgba(255, 255, 255, 0.05);
  /* Subtle highlight */
  margin-bottom: 2px;
}

.autocomplete-item.smart-suggestion:hover {
  background: rgba(255, 255, 255, 0.1);
}

.autocomplete-item.smart-suggestion.expanded-smart-item {
  align-items: flex-start;
  min-height: 0;
  height: auto;
  padding-top: 0.62rem;
  padding-bottom: 0.62rem;
  border-radius: 0.95rem;
}

.autocomplete-item.smart-suggestion .expanded-smart-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.35;
  word-break: break-word;
}

.autocomplete-item.smart-suggestion .sports-smart-text {
  gap: 0.24rem;
}

.sports-score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
}

.sports-score-matchup {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.92rem;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sports-score-status {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.smart-result-topic {
  font-size: 0.73rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.62;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smart-result-body {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: normal;
}


.suggestion-content {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* STOCK LAYOUT */
.stock-item {
  display: flex !important;
  align-items: center !important;
  /* Gap is now handled by the margin on the iconContainer in JS, 
     but we keep a small gap here just in case */
  gap: 0 !important;
}

.stock-item .suggestion-content {
  flex: 1 !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

/* Stock logo image rendering */
.stock-logo-large {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
  box-sizing: border-box;
  padding: 0;
  display: block;
  image-rendering: auto;
  clip-path: inset(0 round 8px);
}

.stock-fallback-monogram {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.9);
}

.stock-fallback-icon-large {
  font-size: 19px;
  opacity: 0.7;
  color: #a0a0a0;
}

.stock-content-with-logo {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Fix vertical alignment */
  line-height: 1.2;
}

.stock-top-row {
  display: flex;
  align-items: center;
  font-size: 0.85em;
  /* Slightly smaller for cleaner look */
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2px;
}

.stock-symbol {
  font-weight: 600;
  color: #fff;
  margin-right: 4px;
}

.stock-bottom-row {
  display: flex;
  align-items: center;
  font-size: 1em;
  font-weight: 500;
}

.stock-price {
  margin-right: 8px;
  color: #fff;
}

.stock-change {
  font-size: 0.9em;
}

.stock-up {
  color: #4cd964;
  /* Green */
}

.stock-down {
  color: #ff3b30;
  /* Red */
}

/* MATH & KNOWLEDGE */
.autocomplete-item.smart-suggestion b {
  color: #fff;
}

@media (max-width: 640px) {
  .sports-score-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.08rem;
  }

  .sports-score-status {
    white-space: normal;
  }
}

/* Settings Drop-up */
.settings-menu {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  height: 100%;
  min-width: 0;
  width: 100%;
}

.settings-dropdown {
  position: absolute;
  display: flex;
  flex-direction: column;
  bottom: calc(100%);
  left: 0;
  right: 0;
  transform: translateY(10px) scale(1);
  transform-origin: 50% 100%;
  background: linear-gradient(180deg, rgba(34, 34, 34, 0.98) 0%, rgba(24, 24, 24, 0.96) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: none;
  border-radius: 0.65rem;
  padding: 0.45rem;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.035) inset;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1),
    transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  z-index: 1000;
  font-size: 0.95rem;
  gap: 2px;
}

.settings-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.settings-option {
  padding: 0.5em 0.6em;
  cursor: pointer;
  border-radius: 0.35em;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  appearance: none;
  -webkit-appearance: none;
}

.settings-option .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  min-width: 16px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-option .icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  color: white;
}

.settings-option-text {
  font-size: inherit;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-option::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-option:hover {
  color: rgba(255, 255, 255, 1);
}

.settings-option:hover::before {
  opacity: 1;
}

.settings-option:hover .icon {
  filter: brightness(1.3);
}

.settings-option:hover .settings-option-text {
  filter: brightness(1.3);
}

.settings-option-logout {
  color: rgba(255, 178, 178, 0.95);
}

.settings-option-logout .icon svg {
  color: rgba(255, 178, 178, 0.95);
}

.settings-option-logout:hover {
  color: rgba(255, 211, 211, 1);
}

.settings-option-delete-account {
  color: rgba(255, 146, 146, 0.98);
}

.settings-option-delete-account .icon svg {
  color: rgba(255, 146, 146, 0.98);
}

.settings-option-delete-account:hover {
  color: rgba(255, 190, 190, 1);
}

.settings-option-open-settings {
  color: rgba(168, 218, 255, 0.96);
}

.settings-option-open-settings .icon svg {
  color: rgba(168, 218, 255, 0.96);
  fill: currentColor;
}

.settings-option-open-settings:hover {
  color: rgba(216, 239, 255, 1);
}

.settings-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-option:disabled::before {
  opacity: 0 !important;
}

.settings-account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  gap: 1px;
  line-height: 1.05;
}

.settings-account-username {
  font-size: 0.73rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    opacity 0.2s ease,
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-account-monogram {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(88, 116, 255, 0.95), rgba(84, 220, 255, 0.88));
  color: #111;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Ensure bottom category has relative positioning for the absolute dropdown */
.bottom-category .nav-item {
  position: relative;
  overflow: visible;
}

#settingsToggle {
  width: 100%;
  height: 100%;
  margin: 0;
  flex: 1;
  padding: 0 3.15rem 0 0.75rem;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#settingsToggle::before {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.sidebar.collapsed #settingsToggle {
  padding-right: 0;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  padding-left: 17.75px;
  width: 100%;
  gap: 0;
  transition-delay: 0s;
}

.sidebar.collapsed .settings-account-username {
  opacity: 0;
  max-width: 0;
  margin: 0;
}

.bottom-category .upgrade-button {
  position: absolute;
  right: 0.5em;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
