@font-face {
  font-family: "Slanter-Sans";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/Slanter-Sans-Serif-Book.woff2") format("woff2");
}

@font-face {
  font-family: "Slanter-Sans";
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/Slanter-Sans-Serif-Book-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "Slanter-Sans";
  font-style: normal;
  font-weight: 400 500 600 700;
  font-display: swap;
  src: url("fonts/Slanter-Sans-Serif-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "Slanter-Sans";
  font-style: italic;
  font-weight: 400 500 600 700;
  font-display: swap;
  src: url("fonts/Slanter-Sans-Serif-Bold-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "Slanter-Serif";
  font-style: normal;
  font-weight: 100 200;
  font-display: swap;
  src: url("fonts/Slanter-Serif-Extra-Light.woff2") format("woff2");
}

@font-face {
  font-family: "Slanter-Serif";
  font-style: italic;
  font-weight: 100 200;
  font-display: swap;
  src: url("fonts/Slanter-Serif-Extra-Light-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "Slanter-Serif";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/Slanter-Serif-Book.woff2") format("woff2");
}

@font-face {
  font-family: "Slanter-Serif";
  font-style: normal;
  font-weight: 400 500 600 700;
  font-display: swap;
  src: url("fonts/Slanter-Serif-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "Slanter-Serif";
  font-style: italic;
  font-weight: 400 500 600 700;
  font-display: swap;
  src: url("fonts/Slanter-Serif-Bold-Italic.woff2") format("woff2");
}

html, body, *, *::before, *::after {
  font-synthesis: none;
}

:root {
  --white: #F3F3F1;
  --white-50: #878784;
  --white-75: #b6b6b0;
  --black: #1B1B18;
  --black-hover-color: #00000058;
  --black-border-color: #32322d;
  --black-light: #3535314d;
  --black-blue-accent: #3a7ede;

  --background-color: #1B1B18;
  --input-bg: #282825;
  --input-bg-50: #28282580;
  --input-darker-bg: #242424;
  --input-lighter-bg: #30302D;
  --text-color: #DCDCD6;

  --text-color-sidebar: #a1a198;
  --dark-text: #70706b;

  --user-bubble: #0D0D0C;
  --border-color-darker: #595952;
  --border-color: #42423d96;
  --border-color-sharper: #42423d;
  --border-color-lighter: rgba(66, 66, 61, 0.5);
  --sidebar-color: #282825;
  --sidebar-color-rgb: 40, 40, 37;
  --contrast: #F3F3F1;
  --contrast-text: #000000;
  --contrast-color: #DCDCD6;
  --light-background: #EEEEEE;
  --light-background-hover: #c8c8c8;
  --med-dark-text: #DEDEDE;
  --med-text: #7B7B77;
  --med-light-text: #DCDCDC;
  --light-text:#9F9F9F;
  --sidebar-border-color: #2A2A2A;
  --black-shadow: rgba(0,0,0,0.14);
  --dark-light-bg: var(--black);
  --highlight-bg: #05244ab5;
  --highlight-text: #5b99e5;

  --switch-bg: var(--blue-accent);
  --switch-bg-off: #000;
  --switch-border: var(--border-color);

  --color-green-slanter: #969640;

  /*--mobile-button-inset: inset 0 0px 10px 0px rgba(255, 255, 255, 0.1);*/
  --file-btn-mobile-bg: #353531;
  --file-btn-mobile-bg-trans: rgba(53, 53, 49, 0.5);
  --code-ouput-bg: #2f2f2a;
  --code-paste-bg: #282c34;

  --light-box-question: #4F4F49;

  --mobile-quiz-bg: rgba(40, 40, 37, 0.4);
  --mobile-quiz-pill: rgba(220, 220, 214, 0.15);

  --thinking-gradient: rgba(100, 100, 100, 0.7);
  --thinking-shimmer: rgba(220, 220, 220, 0.9);

  --sidebar-controls: rgba(255, 255, 255, 0.35);

  --link-color: #2B7CBE;

  --image-controls: #333333;

  --circle-bg-correct: rgba(113, 196, 58, 0.3);
  --circle-bg-wrong: rgba(224, 62, 51, 0.3);
  
  --green-text: #71C43A;
  --green-border: rgba(113, 196, 58, 0.6);
  --green-bg-transp: rgba(113, 196, 58, 0.1);
  --green-bg-not-transp: #273A32;

  --blue-accent: #3a7ede;
  --blue-accent-light: rgba(43, 116, 217, 0.15);
  --blue-accent-med: rgba(43, 116, 217, 0.30);
  --blue-accent-med-bg: #1D3F5D;
  --blue-accent-dark: #3471c7;

  --input-box-bg: #3B3A3A;
  --input-border: #4F4F4F;
  --darker-box-bg: #3B3A3A;

  --lighter-hover-color: #fffff00f;
  --hover-color: #00000058;
  --hover-color-50: #00000029;
  --darker-hover-color: rgba(255, 255, 255, 0.14);
  --sidebar-hover-not-trans: #141412;

  --red-bg: #3D2523;
  --red-text: #de564d;
  --dark-red-text: #df9994; 
  --red-border: #691B0F;
  --red-bg-transp: rgba(224, 62, 51, 0.15);
  --red-bg-transp-2: rgba(224, 62, 51, 0.5);
  --red-bg-not-transp: #361C16;

  --red-text-light: #EE7E6C;

  --orange-text: #F49D15;
  --orange-border: rgba(155, 97, 7, 0.5);
  --orange-bg: #362A16;

  --disabled-bg: #3F3F3F;
  --disabled-text: #797979;
  --skeleton-base: #5D5D55;
  --skeleton-highlight: #8A8A7F;
  --invite-skeleton-base: #484842;
  --invite-skeleton-highlight: #5D5D55;

  --weblink-hover-grad: linear-gradient(90deg, #21283300 0%, #212833 50%);
}

:root[data-theme="light"] {
  --white: #F3F3F1;
  --black: #1B1B18;
  --black-hover-color: #00000058;
  --black-border-color: #32322d;
  --black-blue-accent: #3a7ede;

  --background-color: #F3F3F1;
  --input-bg: #ffffff;
  --input-bg-50: #ffffff80;
  --input-lighter-bg: #ffffff;
  --text-color: #292929;

  --text-color-sidebar: #535353;
  --dark-text: #8d8d8d;

  --user-bubble: #e3e3de;
  --border-color: #d9d9d3a8;
  --border-color-sharper: #d9d9d3;
  --border-color-lighter: rgba(204,204,204,0.5);
  --border-color-darker: #b3b3a8a8;
  --sidebar-color: #ECECE9;
  --sidebar-color-rgb: 236, 236, 233;
  --contrast: #1B1B18;
  --contrast-text: #ffffff;
  --contrast-color: #ffffff;
  --light-background: #292929;
  --light-background-hover: #303030;
  --med-dark-text: #262626;
  --med-text: #565656;
  --med-light-text: #747474;
  --light-text: #8e8e8e;
  --sidebar-border-color: #e3e3e3;
  --black-shadow: rgba(0, 0, 0, 0.05);
  --dark-light-bg: var(--input-bg);
  --highlight-bg: #0074ff29;
  --highlight-text: #104c96;

  --switch-bg: var(--blue-accent);
  --switch-bg-off: #1b1b1880;
  --switch-border: var(--background-color);

  --color-green-slanter: #969640;

  --mobile-button-inset: inset 0 0px 10px 0px rgba(255, 255, 255, 0.1);
  --file-btn-mobile-bg: #DCDCD6;
  --file-btn-mobile-bg-trans: rgba(220, 220, 214, 0.5);
  --code-paste-bg: #fafafa;

  --light-box-question: #d2d2cd6b;

  --mobile-quiz-bg: rgba(255, 255, 255, 0.35);
  --mobile-quiz-pill: rgba(41, 41, 41, 0.42);

  --thinking-gradient: rgba(255, 255, 255, 0.7);
  --thinking-shimmer: rgba(30, 30, 30, 0.7);

  --sidebar-controls: rgba(0, 0, 0, 0.35);
  
  --image-controls: #ffffff;

  --circle-bg-correct: rgba(113, 196, 58, 0.3);
  --circle-bg-wrong: rgba(224, 62, 51, 0.3);
  
  --green-text: #9ab535;
  --green-border: rgba(113, 196, 58, 0.6);
  --green-bg-transp: rgba(113, 196, 58, 0.1);
  --green-bg-not-transp: #DEF1E9;

  --blue-accent: #3471c7;
  --blue-accent-light: hsla(215, 70%, 51%, 0.15);
  --blue-accent-med: rgba(43, 116, 217, 0.30);
  --blue-accent-med-bg: #B3D5F4;
  --blue-accent-dark: #3471c7;

  --input-box-bg: #F6F6F7;
  --input-border: #E8E8E9;
  --darker-box-bg: #fff;

  --lighter-hover-color: rgba(0, 0, 0, 0.04);
  --hover-color: rgba(0, 0, 0, 0.08);
  --darker-hover-color: rgba(0, 0, 0, 0.14);
  --hover-color-50: #ffffff9a;
  --sidebar-hover-not-trans: #d9d9d7;

  --red-bg: #fde8e6;
  --red-text: #cf564e;
  --dark-red-text: #87332d; 
  --red-border: #B4220C;
  --red-bg-transp: rgba(224, 62, 51, 0.15);
  --red-bg-not-transp: #EFDFDB;

  --red-text-light: #B4220C;

  --orange-text: #7E4E06;
  --orange-border: rgba(126, 78, 6, 0.5);
  --orange-bg: #F9DDB2;

  --disabled-bg: #F2F2F2;
  --disabled-text: #4C4C4C;
  --skeleton-base: #e4e8ed;
  --skeleton-highlight: #f3f6f9;
  --invite-skeleton-base: #CECEC5;
  --invite-skeleton-highlight: #DCDCD6;

  --weblink-hover-grad: linear-gradient(90deg, #DFEAF900 0%, #DFEAF9 50%);
}

:root[data-theme="dark"] body:not(.mobile-active) {
  --sidebar-color: #1F1F1C;
  --sidebar-color-rgb: 31, 31, 28;
  --background-color: #20201D;
  --user-bubble: #171715;
}


html {
  color: var(--text-color);
  font-family: 'Slanter-Sans', sans-serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
}

html,  body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden !important;
}

/* Block browser pull-to-refresh on touch devices. */
@media (hover: none) and (pointer: coarse) {
  html,
  body {
    overscroll-behavior-y: none;
  }
}

body {
  background-color: var(--background-color);
  --sb-track-color: var(--background-color);
  --sb-thumb-color: var(--file-btn-mobile-bg);
  --sb-size: 8px;
}

/* --- INPUT + CHAT AREA --- */

.chat-scroll {
    flex: 1;
    width: 100%;               /* full width from sidebar to right edge */
    overflow-y: auto;          /* scrollbar HERE */
    box-sizing: border-box;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
}

.chat-scroll,
.PaymentPage,
.tool-scroll {
    --sb-size: 10px;
    scrollbar-gutter: stable;
}

.chat-scroll::-webkit-scrollbar,
.PaymentPage::-webkit-scrollbar,
.tool-scroll::-webkit-scrollbar {
    width: var(--sb-size);
}

.chat-scroll::-webkit-scrollbar-track,
.PaymentPage::-webkit-scrollbar-track,
.tool-scroll::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 11px;
}

.chat-scroll::-webkit-scrollbar-thumb,
.PaymentPage::-webkit-scrollbar-thumb,
.tool-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 11px;
    border: 1px solid var(--background-color);
}

@supports not selector(::-webkit-scrollbar) {
  .chat-scroll,
  .PaymentPage,
  .tool-scroll {
      scrollbar-color: var(--border-color) var(--background-color);
  }
}

.chat-scroll {
    --sb-size: 9px;
}

.chat-scroll::-webkit-scrollbar-thumb {
    background: var(--file-btn-mobile-bg);
    border: 1px solid var(--background-color);
}

@supports not selector(::-webkit-scrollbar) {
  .chat-scroll {
      scrollbar-color: var(--file-btn-mobile-bg) var(--background-color);
  }
}

.chat-inner {
    width: 100%;
    max-width: 765px;
    margin: 0 auto;            /* centers content */
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 0;
}

.skeleton_chat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skeleton_chat_user {
  background: var(--user-bubble);
  margin-left: auto;
  height: 51.15px;
  width: 50%;
  padding: 0px 16px;
  border-radius: 21px;
  background-image: linear-gradient(
    90deg,
    transparent 30%,
    rgba(255, 255, 255, 0.7) 50%,
    transparent 60%
  );
  background-size: 230% 100%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  mix-blend-mode: lighten;
  animation: textSweep 3s linear infinite;
}

.skeleton_chat_bot_stack {
  display: flex;
  flex-direction: column;
  margin-top: 21px;
  margin-left: 16px;
  gap: 12px;
  width: 80%;
  pointer-events: none;
}

.skeleton_chat_bot {
  background-color: var(--user-bubble);
  height: 23px;
  padding: 0px 16px;
  border-radius: 8px;
  box-sizing: border-box;
  background-image: linear-gradient(
    95deg,
    transparent 30%,
    rgba(255, 255, 255, 0.7) 50%,
    transparent 60%
  );
  background-size: 230% 100%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  mix-blend-mode: lighten;
  animation: textSweep 3s linear infinite;
}

.sidebarMenuButton > .skeleton_chat_bot {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  margin-left: 8px;
}

.sidebarMenuButton.chat > .skeleton_chat_bot {
  margin-left: 0;
}

#mobileRecentChatsList > .buttonMobileSidebar > .skeleton_chat_bot {
  margin-left: 0;
  width: 100%;
  max-width: none;
}


.input-container {
  width: 100% !important;
  max-width: 765px !important;
  margin: 0 auto !important;
  border: 1px solid transparent;
  border-radius: 21px;
  overflow: hidden;               /* makes everything look like 1 box */
  box-sizing: border-box;
  transition: all 0.2s ease;
  position: relative; /* default */
  background-color: var(--input-bg);
  box-shadow: 0 0 0 var(--black-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-container:has(#inputbox:focus){
  border-color: var(--border-color);
  box-shadow: 0 0 15px var(--black-shadow);
}

.input-disclaimer {
  max-width: 765px;
  margin: 4px auto 4px;
  padding: 0 8px;
  font-size: 0.8rem;
  color: #9b9b9b;
  text-align: center;
}

.input-disclaimer-link {
  color: var(--contrast);
  text-decoration: underline;
  cursor: pointer;
}
  

textarea {
  font-family: 'Slanter-Sans', sans-serif;
  font-weight: 300;
  width: 100%;
  min-height: 0px;
  padding: 20px 20px 8px 20px;
  border: none;
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
  font-size: 1rem;
  display: block;
  text-align: left;
  background-color: var(--input-bg);
  color: var(--text-color);
}

textarea:focus {
  outline: none;
}

.voice-live-overlay-active {
  color: transparent !important;
  caret-color: var(--text-color);
  -webkit-text-fill-color: transparent !important;
}

.voice-live-transcript-overlay {
  position: absolute;
  pointer-events: none;
  box-sizing: border-box;
  white-space: pre-wrap;
  overflow: hidden;
  overflow-wrap: break-word;
  color: var(--text-color);
  background: transparent;
  z-index: 3;
}

.voice-live-transcript-overlay .voice-live-spoken {
  color: var(--med-text);
  font-style: italic;
}

.chat-container {
  flex: 1;
  width: 80%;
  max-width: none;
  margin: 0;
  padding: 20px 20px 150px;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message {
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
  padding: 0px 16px;
  border-radius: 13px;
  font-size: 16px;
  line-height: 1.41;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  animation: fadeIn 0.2s ease;
}

.message.user {
  padding: 16px;
  margin-left: auto;
  background: var(--user-bubble);
  margin-right: 0;
  /*border-top-right-radius: 8px;*/
}

.message.bot {
  font-family: 'Slanter-Serif', serif;
  font-style: normal;
  font-weight: 300;
  margin-right: auto;
  background: transparent;
  margin-left: 0;
  line-height: 1.6;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  transition: background-color 220ms ease;
  will-change: background-color;
}

.message.bot.slanter-has-codeblock {
  overflow: visible;
}

:root[data-chat-font="serif"] .message.bot {
  font-family: 'Slanter-Serif', serif;
  font-weight: 100 !important;
  line-height: 1.5;
}

:root[data-chat-font="sans"] .message.bot {
  font-family: 'Satotshi', 'Slanter-Sans', sans-serif;
  font-weight: 300 !important;
  line-height: 1.41;
}

:root[data-chat-font="dislexic"] .message.bot {
  font-family: 'Open-Dyslexic', 'OpenDyslexic', sans-serif;
  font-style: normal;
  font-weight: normal;
}

.message.bot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--blue-accent-med);
  opacity: 0;
  pointer-events: none;
}

.message.bot.saved-message-highlight {
  background: var(--blue-accent-light);
}

.message.bot.saved-message-pulse-once::before {
  animation: savedMessagePulseOverlay 820ms ease-in-out 1;
}

@keyframes savedMessagePulseOverlay {
  0% { opacity: 0; }
  50% { opacity: 0.8; }
  100% { opacity: 0; }
}

/* Markdown tables inside messages */
.message table {
  width: 100%;
  border-collapse: collapse;
  background: var(--background-color);
  margin: 10px 0;
}

.message th,
.message td {
  border-bottom: 1px solid var(--light-text );
  padding: 6px 8px;
  text-align: left;
  color: var(--text-color);
}


.message th,
.message table thead th,
.message table tr:first-child th,
.message table tr:first-child td {
  font-weight: 900;
  color: var(--text-color);
}

.message th strong,
.message th b,
.message table tr:first-child td strong,
.message table tr:first-child td b {
  font-weight: 900;
}

.message .katex,
.message .katex-display {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.message .katex {
  display: inline-flex;
  flex-wrap: wrap;
  line-height: 1;
}

.message .katex-display {
  display: block;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bottom-bar {
  width: 100%;
  padding: 0 16px 16px 16px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  box-sizing: border-box;
}

/* Typing dots */
#typingIndicator {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  width: 80%;
  margin: 4px 0;
  align-self: flex-start;
}

.typing.hidden { display: none; }

.dot {
  width: 8px;
  height: 8px;
  background: #bbb;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
  0% { opacity: .2; }
  20% { opacity: 1; }
  100% { opacity: .2; }
}

/* Buttons */

.circle-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: var(--light-background);
  color: var(--contrast-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
  padding: 0;
  margin-left: 8px;
}

.circle-btn.wide {
  font-size: 0.9rem;
  width: auto;
  gap: 4px;
  padding: 0 10px 0 10px;
  margin-left: 8px;
}

.modelSwitch.mode {
  color: var(--light-text);
  margin-left: 2px;
}

.circle-btn .voice-btn {
  margin-right: 10px;
}

.circle-btn:disabled {
  background: var(--disabled-bg) !important;
  stroke: var(--disabled-text) !important;
  cursor: not-allowed;
}

.stop-btn {
  background: var(--contrast);
}

.hidden:not(.modal):not(.settings-modal) {
  display: none !important;
}

.circle-btn:hover {
  background: var(--light-background-hover);
}

.send-icon {
  width: 24px;
  height: 24px;
}

.send-icon.stop {
  width: 18px;
  height: 18px;
}

.send-icon.small {
  width: 15px;
  height: 15px;
}

.send-icon.light {
  color: var(--light-text);
}

.send-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--text-color) 32%, transparent);
  border-top-color: var(--text-color);
  border-radius: 999px;
  animation: authBtnSpinnerRotate 0.65s linear infinite;
}

#submitBtn.is-loading .send-icon {
  display: none;
}

#submitBtn.is-loading .send-btn-spinner {
  display: inline-block !important;
}

#submitBtn.is-loading {
  pointer-events: none;
}

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

/* Layout with sidebar */

.app-layout {
  --sidebar-w: 290px;
  display: flex;
  height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.app-layout.sidebar-collapsed {
  --sidebar-w: 54px;
}

/* Sidebar */

.sidebar {
  --sidebar-inline-pad: 12px;
  --sidebar-fixed-logo-h: 52px;
  --sidebar-fixed-menu-h: 148px;
  --sidebar-fixed-top-h: calc(var(--sidebar-fixed-logo-h) + var(--sidebar-fixed-menu-h));
  /*--sidebar-fixed-bottom-h: 70px;*/
  --sidebar-scroll-gutter: calc(var(--sb-size) + 4px);
  --sb-track-color: var(--sidebar-color);
  --sb-thumb-color: var(--border-color);
  --sb-size: 9px;
  width: var(--sidebar-w);
  background: var(--sidebar-color);
  border-right: 1px solid var(--border-color);
  padding: 0 4px 12px 9px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: width 0.25s ease, padding 0.25s ease, background 0.25s ease;
  height: calc(100vh - 67px); 
  overflow: hidden; 
  position: relative;
  z-index: 1000;
  overflow-y: auto;          
  overflow-x: hidden;       
  overscroll-behavior-y: contain;
}

.sidebar::-webkit-scrollbar {
  width: var(--sb-size);
}

.sidebar::-webkit-scrollbar-track {
  background: var(--sb-track-color);
  border-radius: 11px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--sb-thumb-color);
  border-radius: 11px;
  border: 1px solid var(--sidebar-color);
}

@supports not selector(::-webkit-scrollbar) {
  .sidebar {
    scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
  }
}

/* Sidebar top / footer */

.sidebar-top { 
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-footer {
  padding: 8px;
  display: flex;
  justify-content: center;
}

/* Logo row in sidebar */

.sidebar-logo-row {
  display: flex;
  padding-top: 3px;
  align-items: center;
  justify-content: flex-start;
  position: fixed;
  top: 0;
  min-height: 52px;
  left: var(--sidebar-inline-pad);
  width: calc(var(--sidebar-w) - (var(--sidebar-inline-pad) * 2));
  padding-right: calc(32px + var(--sidebar-scroll-gutter));
  z-index: 100002;
  background: var(--sidebar-color);
  box-sizing: border-box;
  transition: width 0.25s ease, left 0.25s ease, background-color 0.25s ease;
}

.sidebar-logo-btn {
  color: var(--text-color);
  width: 110px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 4px 6px;
  overflow: visible;
  transition: color 0.2s ease;
}

.logo-icon {
  width: 32px;
  height: 32px;
}


#sidebarLogoRive {
  align-self: center;
  display: block;
  width: 108px !important;
  height: 75px !important;
  min-width: 108px;
  min-height: 75px;
  max-width: 108px;
  max-height: 75px;
  flex: 0 0 108px;
  pointer-events: none;
}


/* two logo variants: default + menu */

.logo-menu {
  display: none;
  visibility: visible !important;
  cursor: e-resize;
  margin: auto 0;
}

.logo-text {
  font-weight: 600;
  font-size: 1.1rem;
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  opacity: 1;
  transition: max-width 0.22s ease, opacity 0.18s ease;
}

/* Close button inside sidebar when open */

.sidebar-close-btn {
  visibility: visible !important;
  margin-left: auto;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.close-icon {
  width: 20px;
  height: 20px;
}

/* Logout icon button */

.logout-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #e9e9e9;
  cursor: pointer;
}
.sidebarMenuButton {
    font-family: 'Slanter-Sans', sans-serif;
    font-weight: 300;
    margin-top: 0;
    width: 100%;
    height: 30px;
    min-height: 30px;
    border-radius: 8px;
    border: none;
    background: none;
    padding: 0 9px;
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color-sidebar);
    text-align: left;
    box-sizing: border-box;
}

.sidebarMenuButton.Contrast {
  background-color: var(--light-background);
  color: var(--contrast-text);
}

.sidebarMenuButton.Contrast:hover {
  background-color: var(--light-background-hover);
  color: var(--contrast-text);
}

.sidebarMenuButton:hover {
  background: var(--hover-color);
}

.sidebarMenuButton.chat:hover {
  color: var(--text-color);
  background: var(--hover-color);
}

.sidebarMenuButton.chat:hover .threeDotsMenu {
  visibility: visible;
}

.sidebarMenuButton:active {
  transform: none;
}

.sidebar-menu-list {
    position: fixed;
    top: var(--sidebar-fixed-logo-h);
    width: calc(var(--sidebar-w) - (var(--sidebar-inline-pad) * 2));
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 100002;
    background: var(--sidebar-color);
    box-sizing: border-box;
    padding-bottom: 8px;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.sidebar.collapsed .sidebar-menu-list {
    top: var(--sidebar-fixed-logo-h);
    background: var(--background-color);
}

.sidebar-chat-list {
    padding-top: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: padding-top 0.16s cubic-bezier(0.22, 1, 0.36, 1), gap 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-folder-list {
    padding-top: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: padding-top 0.16s cubic-bezier(0.22, 1, 0.36, 1), gap 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-folder-items,
.sidebar-chat-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overscroll-behavior-y: contain;
}

/* Keep sidebar dropdown menus visible while sections are expanded. */
.sidebar-folder-list:not(.is-collapsed) .sidebar-folder-items,
.sidebar-chat-list:not(.is-collapsed) .sidebar-chat-items {
    overflow: visible;
}

.temp-folder-preview {
    display: none !important;
}


.sidebar-menu-highlight {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    width: var(--highlight-w, 0px);
    height: var(--highlight-h, 0px);
    transform: translate(var(--highlight-x, 0), var(--highlight-y, 0px));
    border-radius: 8px;
    background: var(--hover-color);
    opacity: 0;
    transition: transform 0.2s ease-out, width 0.04s ease-out, height 0.2s ease-out, border-radius 0.2s ease-out, background-color 0.18s ease, opacity 0.18s ease;
    z-index: 0;
    pointer-events: none;
    will-change: transform, height, opacity;
}

body.sidebar-highlight-initializing .sidebar-menu-highlight {
    transition: none !important;
}

.sidebar-menu-highlight.active {
    background: var(--contrast);
    opacity: 1;
}

.sidebar-menu-highlight.hover {
    background: var(--darker-hover-color);
    opacity: 0;
}

.sidebar-menu-list.is-visible .sidebar-menu-highlight {
    opacity: 1;
}

.sidebar-menu-item {
    position: relative;
    z-index: 1;
    background: none;
}

.sidebar-menu-item:hover {
  background-color: var(--hover-color);
  color: var(--text-color);
}

.sidebarMenuButton .new-chat-text,
.sidebarMenuButton .organize-text {
  display: inline-block;
  margin-left: 8px;
  max-width: 195px;
  opacity: 1;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.2s ease-out, opacity 0.16s ease-out;
}

.sidebarMenuButton .organize-text.chat {
  margin-left: 0;
}


/* Organize button (under New chat) */
.organize-btn {
    margin-top: 8px;
    width: 100%;
    border-radius: 8px;
    border: none;
    background: none;
    padding: 8px 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--contrast);
    transition: all 0.2s ease;
    text-align: left;
}

.sidebarSVG.organize-icon {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    flex: 0 0 16px;
    display: block;
    align-self: center;
}

.sidebarSVG.folder-open-icon {
    transform: translateX(1.4px) scale(1.15);
    transform-origin: center;
}


.organize-btn:hover {
    background: transparent;
}

.organize-btn:active {
  transform: scaleX(0.95);
}

.organize-text {
    white-space: nowrap;
}

/* Folders list at top of scroll area */
.folder-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.folder-item:hover {
    background: #ececf1;
}

.folder-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.folder-name {
    font-size: 0.86rem;
    color: #111827;
}

.folder-count {
    font-size: 0.78rem;
    color: #6b7280;
}

/* Color preset grid in folder popup */
.color-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    margin-top: 6px;
}

.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    outline: none;
    background-clip: padding-box;
}

.color-swatch.selected {
    border-color: #111827;
}

/* Ensure modal labels look nice */
.modal-label {
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.Folderpopup {
  display: flex;
  flex-direction: column;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  gap: 16px;
  border-radius: 13px;
  padding: 12px;
  width: 400px;
  box-sizing: border-box;
}

.inputrowfolder {
  display: flex;
  align-items: center;
}

.RoleIconEdit {
  color: var(--disabled-text);
  background-color: var(--input-box-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  min-height: 42px;
  aspect-ratio: 1;
  margin-right: 12px;
  position: relative;
}

#folderIconTrigger.roleEditPopupIcon {
  position: relative;
  cursor: pointer;
}

#folderIconTrigger.roleEditPopupIcon svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 25px;
  height: 25px;
  transform: translate(-50%, -50%);
  aspect-ratio: 1;
  align-self: center;
  max-width: 25px;
  max-height: 25px;
}

#folderIconTrigger .roleEditIconDefault {
  opacity: 1;
}

#folderIconTrigger .roleEditIconHover {
  opacity: 0;
}

#folderIconTrigger .roleEditIconDefault *,
#folderIconTrigger .roleEditIconHover * {
  vector-effect: non-scaling-stroke;
}

#folderIconTrigger:hover .roleEditIconDefault {
  opacity: 0;
}

#folderIconTrigger:hover .roleEditIconHover {
  opacity: 1;
}

#folderIconTrigger[data-role-icon-selected="false"]:hover .roleEditIconDefault {
  opacity: 0 !important;
}

#folderIconTrigger[data-role-icon-selected="false"]:hover .roleEditIconHover {
  opacity: 1 !important;
}

.Folderpopup .createRoleName {
  background-color: #F6F6F7;
  border: none;
  padding: 10px;
  border-radius: 8px;
  outline: none;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.FolderCarousel {
  margin-top: 8px;
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  min-height: 38px;
}

.FolderCarousel::before,
.FolderCarousel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  z-index: 2;
}

.FolderCarousel::before {
  left: 0;
  background: linear-gradient(to right, var(--background-color) 0%, transparent 100%);
}

.FolderCarousel::after {
  right: 0;
  background: linear-gradient(to left, var(--background-color) 0%, transparent 100%);
}

.FolderCarouselTrack {
  display: flex;
  gap: 8px;
  width: max-content;
  will-change: transform;
}

.IconFolderCarousel {
  display: flex;
  width: 20px;
}

.folder-custom-icon,
.folder-custom-icon [fill]:not([fill="none"]) { fill: none !important; }

.folder-custom-icon [stroke],
.folder-closed-icon [stroke],
#folderIconTrigger .roleEditIconDefault [stroke],
#roleIconSelectorPopup .roleIconBtn [stroke],
.chat-folder-option-icon [stroke],
.TabTooltipFolderIcon [stroke] {
  stroke-width: 1.5px !important;
}

.FolderCarouselItem {
  display: flex;
  flex: 0 0 auto;
  border: none;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  gap: 9px;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}

.Folderpopup .settingsBtnBlack {
  font-size: 0.9rem;
  margin-left: auto;
  display: flex;
  align-self: start;
  align-items: center;
  background-color: var(--contrast);
  border: none;
  color: var(--contrast-text);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.1s ease;
}

#folderPopup.folder-edit-mode #folderCarouselWrap {
  display: none;
}

.closebuttonfolder {
  margin-left: auto;
  padding: 4px;
  width: 26px;
  aspect-ratio: 1;
  border: none;
  background-color: transparent;
  color: var(--med-text);
  display: flex;
  align-content: center;
  cursor: pointer;
}

.roleIconBtn {
  width: 22px;
  height: 22px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.roleIconBtn svg {
  display: block;
  width: 100%;
  height: 100%;
}

.roleIconSelectorPopup {
  width: 230px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 13px;
  padding: 12px;
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  position: fixed;
  z-index: 130600;
  box-shadow: 0 12px 28px var(--black-shadow);
}

.roleColorSelector {
  --role-hover-w: 30px;
  --role-hover-h: 30px;
}

.roleIconSelector {
  padding-top: 4px;
  --role-hover-w: 30px;
  --role-hover-h: 30px;
}

.roleColorSelector,
.roleIconSelector {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  position: relative;
  --role-hover-x: 0px;
  --role-hover-y: 0px;
}

.roleColorSelector::before,
.roleIconSelector::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--role-hover-w);
  height: var(--role-hover-h);
  transform: translate(var(--role-hover-x), var(--role-hover-y));
  box-sizing: border-box;
  border-radius: 8px;
  background: var(--hover-color);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.roleColorSelector.is-hovering::before,
.roleIconSelector.is-hovering::before {
  opacity: 1;
}

.roleColorSelector.has-selected::before,
.roleIconSelector.has-selected::before {
  opacity: 1;
}

.roleColorSelector > *,
.roleIconSelector > * {
  justify-self: center;
  position: relative;
  z-index: 1;
}

.roleColorSelectorColor {
  width: 22px;
  aspect-ratio: 1;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: visible;
  display: grid;
  place-items: center;
}

.roleColorSelectorColor svg {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

.roleColorSelectorColor.is-selected {
  background-color: transparent !important;
  border-radius: 0;
}

.roleColorSelectorColor.Black { background-color: #FFFFFF; }
:root[data-theme="light"] .roleColorSelectorColor.Black { background-color: #1F2933; }
.roleColorSelectorColor.Red { background-color: #e47067; }
.roleColorSelectorColor.Orange { background-color: #e59e5b; }
.roleColorSelectorColor.Yellow { background-color: #e0bd4a; }
.roleColorSelectorColor.Green { background-color: #87c481; }
.roleColorSelectorColor.Blue { background-color: #6186c7; }
.roleColorSelectorColor.Purple { background-color: #ab84d5; }
.roleColorSelectorColor.Pink { background-color: #cd8ecc; }

/* New chat button */

.new-chat-btn {
    margin-top: 8px;
    width: 100%;
    border-radius: 6px;
    border: none;
    background: var(--contrast);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--background-color);
    transition: all 0.2s ease;
    text-align: left;
}

.new-chat-btn:hover {
    background: #272727;
}

.new-chat-btn:active {
  transform: scaleX(0.95);
}

.new-chat-btn:active .plus-icon {
  stroke: black;
}

.plus-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* Chat list sidebar */

.chat-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  padding-bottom: 90px; /* create space for fixed box */  
  flex-direction: column;
  gap: 4px;
}

.chat-item-wrapper {
  display: flex;
  align-items: center;
  min-width: 0; /* CRITICAL: allows ellipsis to work */
}

.chat-item {
  width: 100%;
  border-radius: 8px;
  border: none;
  padding: 8px 10px;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  background: transparent;
  color: var(--text-color-sidebar);
  min-width: 0; /* required for child text truncation */
  position: relative;
}

/* Sidebar chat title — single line, overflow revealed via hover marquee instead of ellipsis */
.chat-item-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  max-width: 100%;
  transition: none !important;
}

.chat-item.chat-item-overflowing::after {
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--sidebar-color) 100%);
  position: absolute;
  top: 0;
  right: 31px;
  width: 25px;
  height: 100%;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.chat-item.chat-item-scrolled-end::after {
  opacity: 0;
}

.chat-item.chat-item-overflowing::before {
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, var(--sidebar-color) 0%, transparent 100%);
  position: absolute;
  top: 0;
  left: 10px;
  width: 25px;
  height: 100%;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.chat-item.chat-item-revealed-left::before {
  opacity: 1;
}

.chat-item.chat-item-overflowing.active::after,
.chat-item.chat-item-overflowing:hover::after {
  background: linear-gradient(90deg, transparent 0%, var(--sidebar-hover-not-trans) 100%);
  right: 39px;
}

.chat-item.chat-item-overflowing.active::before,
.chat-item.chat-item-overflowing:hover::before {
  background: linear-gradient(90deg, var(--sidebar-hover-not-trans) 0%, transparent 100%);
}

.chat-item-title-inline-input {
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  margin: 0;
}

.chat-item-wrapper.renaming .chat-item-title-inline-input {
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  display: block !important;
  position: relative;
  z-index: 2;
  opacity: 1 !important;
  visibility: visible !important;
}

.chat-item-wrapper.renaming .chat-item-status-dot {
  display: none !important;
}

.chat-item-wrapper.renaming .chat-item {
  display: flex !important;
  align-items: center !important;
}

body.mobile-active .chat-item-wrapper.renaming .chat-item-title-inline-input {
  color: var(--contrast-text) !important;
  -webkit-text-fill-color: var(--contrast-text) !important;
  caret-color: var(--contrast-text) !important;
}

.TopbarTabs .TabFace.topbar-inline-rename-host .chat-item-title-inline-input {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 240px !important;
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.mobile-active .mobiletopbartab.topbar-inline-rename-host .chat-item-title-inline-input {
  width: 100% !important;
  text-align: center !important;
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
  pointer-events: auto !important;
}

body.mobile-active .mobiletopbartab.topbar-inline-rename-host,
body.mobile-active .mobiletopbartab.topbar-inline-rename-host * {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

.chat-item:hover {
  background: var(--hover-color);
}

body.mobile-active .chat-item:hover {
  background: transparent;
}

.chat-item-wrapper.force-hover .chat-item {
  color: var(--text-color);
  background: var(--hover-color);
}

.chat-item.active {
  background: var(--hover-color);
  color: var(--contrast);
}

.delete-chat-btn {
  margin-left: auto;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
}

.delete-chat-btn:hover {
  opacity: 1;
}

.trash-icon {
  width: 16px;
  height: 16px;
}

/* Main area */

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    --chat-scrollbar-shift: 0px;
    overflow: hidden;         /* keep chat input pinned, chat-scroll handles overflow */
    position: relative;       /* required for pinned input */
    overflow-x: hidden !important;
    transition: margin-right 0.24s ease;
}


/* center containers in main area */

.main-area .chat-container {
    flex: 1;
    width: calc(100% - 260px);      /* expanded sidebar */
    margin-left: 260px;
    max-width: none;
    overflow-y: auto;
    padding: 20px 20px 150px;
    box-sizing: border-box;
}


.main-area .input-container {
   width: min(calc(100% - 24px), 765px) !important;
    margin: 0 auto !important;      /* CENTER IT */
    padding-left: 0;
    padding-right: 0;
}

/* Make chat content visually continue behind the bottom input bar */
.main-area:not(.empty-chat) {
  --chat-input-underlap: 24px;
  --chat-input-cover-h: 96px;
}

.main-area:not(.empty-chat) .chat-scroll {
  padding-bottom: calc(var(--chat-input-underlap) + var(--chat-input-cover-h));
}

.main-area:not(.empty-chat) .input-container {
  position: relative;
  z-index: 6;
  margin-top: calc(-1 * var(--chat-input-underlap)) !important;
  transform: translateX(calc(var(--chat-scrollbar-shift) * -0.5));
}

body:not(.mobile-active) .main-area:not(.empty-chat) #chatView {
  position: relative;
}

body:not(.mobile-active) .main-area:not(.empty-chat) #chatView > .chat-scroll {
  padding-bottom: calc(var(--chat-input-cover-h));
}

body:not(.mobile-active) .main-area:not(.empty-chat) #chatView > .input-container {
  position: absolute;
  left: 50%;
  bottom: 24px;
  margin: 0 !important;
  z-index: 7;
  transform: translateX(calc(-50% + (var(--chat-scrollbar-shift) * -0.5)));
}

body:not(.mobile-active) .main-area:not(.empty-chat) #chatView > .input-disclaimer {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: min(100%, 765px);
  margin: 0;
  transform: translateX(-50%);
  z-index: 7;
}

.chat-scroll,
.chat-inner,
.main-area .chat-container {
    min-width: 0;
}

.chat-scroll {
    overflow-x: hidden;
}

/* Collapse logic */

.sidebar.collapsed {
  width: 54px;
background-color: var(--background-color);
}

.sidebar.collapsed .sidebar-scroll {
  background-color: var(--background-color);
}

.sidebar.collapsed + .main-area .chat-container {
    width: calc(100% - var(--sidebar-w));
    margin-left: var(--sidebar-w);
}

/* When collapsed, hide text, keep icons */

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

.sidebar.collapsed .logo-text {
  max-width: 0;
  opacity: 0;
}

.sidebar.collapsed .new-chat-text,
.sidebar.collapsed .shortcut-text,
.sidebar.collapsed .organize-text {
  display: inline-block !important;
  max-width: 0;
  opacity: 0;
}


.sidebar.compact .sidebarMenuButton {
    width: 30px;
    height: 30px;
    min-height: 30px;
    margin: 0;
    margin-left: 2px;
    padding: 0 0 0 7px;
    border-radius: 8px;
    justify-content: flex-start;
    gap: 0;
    overflow: hidden;
}

.sidebar.compact .sidebar-menu-highlight {
  border-radius: 8px;
}

/* Only show close button when expanded */

.sidebar.compact .sidebar-close-btn {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}



.sidebar.compact:not(.sidebar-close-transition):hover .logo-menu {
  display: flex;
}

.sidebar:not(.compact) .logo-menu{
  display: none;
}

.sidebar.compact .logo-menu{
  display: none;
}

.sidebar.compact:not(.sidebar-close-transition):hover #sidebarLogoBtn{
  display: none;
}

.sidebar:not(.compact) #sidebarLogoBtn{
  display: flex;
}


.logo-default {
  display: inline-block;
}

/* The app layout class is used for some width adjustments */

.app-layout.sidebar-collapsed .chat-container {
  width: calc(100% - var(--sidebar-w));
  margin-left: var(--sidebar-w);
}


/* Small screens: full-width chat, sidebar overlay on open */
@media (max-width: 900px) {
  .chat-container {
    width: 100%;
    max-width: none;
  }

/* Mobile sidebar should overlay and not take layout space */
.sidebar.mobile-open {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 260px !important;
    height: 100%;
    z-index: 999 !important;
    transform: none !important;
}

/* ---------------------------------------------------
   MOBILE SIDEBAR OPEN FIX: prevent chatbar from shifting
   --------------------------------------------------- */
.sidebar.mobile-open ~ .main-area .input-container {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    max-width: 765px !important;
    margin: 0 !important;
    z-index: 500 !important;
}
} 

.chat-menu-btn {
    margin-left: auto;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
}

.chat-menu-btn:hover {
    opacity: 1;
}

.chat-popup-menu {
    position: absolute;
    right: 10px;
    top: 32px;
    background: var(--background-color);
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    box-shadow: 0 4px 10px #0002;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.chat-popup-menu.hidden {
    display: none;
}

.popup-item {
    padding: 8px 12px;
    width: 120px;
    text-align: left;
    border: none;
    background: var(--background-color);
    cursor: pointer;
    font-size: 0.9rem;
}

.popup-item:hover {
    background: #efefef;
}

/* Chat dropdowns (new UI) */
.ChatDropdown,
.ChatFolderDropdown {
  z-index: 99999;
  position: fixed;
  cursor: default;
  background-color: var(--input-bg);
  height: fit-content;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: 13px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 8px 20px var(--black-shadow);
}

.ChatDropdown {
  width: 160px;
}

.ChatDropdown.in-collection {
  width: 200px;
}

.ChatFolderDropdown {
  width: fit-content;
  min-width: 160px;
}

.ChatFolderDropdown.topbar-recent-dropdown {
  z-index: 100000;
}

.ChatFolderDropdown.chat-folder-dropdown {
  z-index: 100000;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  max-height: min(380px, calc(100vh - 24px));
  overflow: hidden;
  overscroll-behavior: contain;
  padding: 0;
  gap: 0;
  align-items: stretch;
}

.ChatFolderDropdown.chat-folder-dropdown .chat-folder-dropdown-header {
  width: 100%;
  padding: 8px 8px 0;
  box-sizing: border-box;
}

.ChatFolderDropdown.chat-folder-dropdown .chat-folder-dropdown-header-divider {
  width: 100%;
  padding-top: 8px;
  border-bottom: 1px solid var(--border-color);
}

.ChatFolderDropdown.chat-folder-dropdown .chat-folder-dropdown-scroll {
  --sidebar-scroll-gutter: calc(var(--sb-size) + 4px);
  --sb-track-color: var(--background-color);
  --sb-thumb-color: var(--hover-color);
  --sb-size: 9px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 8px;
  min-height: 0;
  width: 100%;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 8px;
  padding-right: 4px;
  margin-right: 0;
  background: var(--input-bg);
  transition: none;
  scrollbar-width: auto;
  scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
  scrollbar-gutter: stable;
  box-sizing: border-box;
}

.ChatFolderDropdown.chat-folder-dropdown::-webkit-scrollbar,
.ChatFolderDropdown.chat-folder-dropdown .chat-folder-dropdown-scroll::-webkit-scrollbar {
  width: var(--sb-size);
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.ChatFolderDropdown.chat-folder-dropdown::-webkit-scrollbar-track,
.ChatFolderDropdown.chat-folder-dropdown .chat-folder-dropdown-scroll::-webkit-scrollbar-track {
  background: var(--sb-track-color) !important;
  border-radius: 8px;
  border: none;
  box-shadow: none;
}

.ChatFolderDropdown.chat-folder-dropdown::-webkit-scrollbar-thumb,
.ChatFolderDropdown.chat-folder-dropdown .chat-folder-dropdown-scroll::-webkit-scrollbar-thumb {
  background: var(--sb-thumb-color) !important;
  border-radius: 8px;
  border: 1px solid #282825 !important;
  box-shadow: none;
}

@supports not selector(::-webkit-scrollbar) {
  .ChatFolderDropdown.chat-folder-dropdown,
  .ChatFolderDropdown.chat-folder-dropdown .chat-folder-dropdown-scroll {
    scrollbar-color: var(--sb-thumb-color) var(--sb-track-color) !important;
  }
}

.ChatFolderDropdown.chat-folder-dropdown .ChatDropdownOption.folder-item {
  min-width: 0;
}

.ChatFolderDropdown.chat-folder-dropdown .chat-folder-option-icon {
  flex: 0 0 18px;
}

.ChatFolderDropdown.chat-folder-dropdown .chat-folder-dropdown-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ChatDropdown.hidden,
.ChatFolderDropdown.hidden {
  display: none;
}

.chat-item-wrapper.menu-open {
  z-index: 100001;
}

.ChatDropdownOption {
  height: 34px;
  border-radius: 8px;
  background-color: transparent;
  border: none;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  width: 100%;
  color: var(--med-dark-text);
  cursor: pointer;
  text-align: left;
}

.ChatDropdownOption.tall {
  height: 55px;
  box-sizing: border-box;
}

.ChatDropdownOption.tall:hover .upgrade_small{
  background-color: var(--highlight-bg);
  color: var(--highlight-text);
}

.ChatDropdownOption.Red {
  height: 34px;
  border-radius: 8px;
  background-color: transparent;
  border: none;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  width: 100%;
  color: var(--red-text);
  cursor: pointer;
  text-align: left;
}

.ChatDropdownOption:hover {
  background-color: var(--hover-color);
  color: var(--text-color);
}

.ChatDropdownOption.is-open {
  background-color: var(--hover-color);
  color: var(--text-color);
}

.ChatDropdownOption.Red:hover {
  background-color: var(--red-text);
  color: var(--white);
}

.ChatDropdownOption.active {
  background-color: var(--hover-color);
  color: var(--text-color);
}

.ChatDropdownOption.on {
  color: var(--highlight-text)
}

.ChatDropdownOption.on:hover {
  background-color: var(--highlight-bg);
}

.ChatDropdownOnCheckmark{
  color: var(--blue-accent);
  width: 18px;
  height: 18px;
  margin-left: auto;
  display: none;
  justify-content: center;
  align-items: center;
}

.ChatDropdownOption.on .ChatDropdownOnCheckmark,
.ChatDropdownOnCheckmark.on{
  display: flex;
}

#addFileDropdownBottomMenu,
.add-file-collection-dropdown,
.add-file-tools-dropdown {
  gap: 6px;
  padding: 6px;
  width: 200px;
}

#modelSelectDropdown {
  gap: 6px;
  padding: 6px;
  width: 290px;
}

.add-file-bottom-dropdown {
  z-index: 999999;
}

.add-file-tools-dropdown {
  z-index: 999999;
}

.ChatDropdownArrowIcon {
  width: 18px;
  display: flex;
  opacity: 0.5;
  margin-left: auto;
  transition: opacity 0.2s ease;
}

.ChatDropdownOption:hover .ChatDropdownArrowIcon {
  opacity: 1;
}

.ChatDropdownIcon {
  width: 14px;
  display: flex;
  margin-right: 8px;
}

.ChatDropdownIcon.ml {
  margin-left: auto;
  margin-right: 0;
}

body.mobile-active .ChatDropdownOption {
  padding: 12px 8px;
  font-size: 1.1rem;
}

body.mobile-active .ChatDropdownOptionRed {
  font-size: 1.1rem;
}

body.mobile-active .ChatDropdownIcon {
  width: 20px;
}

body.mobile-active .ChatDropdown.chat-dropdown {
  border-radius: 21px;
  width: fit-content !important;
}

/* Disable hover-only chat action feedback on touch/mobile. */
body.mobile-active .ChatDropdownOption:hover,
body.mobile-active .ChatDropdownOptionRed:hover,
body.mobile-active .folder-popup-menu .popup-item:hover,
body.mobile-active .folder-item:hover {
  background-color: transparent !important;
  color: inherit !important;
}

body.mobile-active .ChatDropdownOption:hover .ChatDropdownArrowIcon {
  visibility: hidden !important;
}

body.mobile-active .threeDotsMenu:hover {
  color: inherit !important;
}

body.mobile-active .folder-row:hover {
  background: transparent !important;
}

.ChatDropdownIconPlus {
  width: 18px;
  display: flex;
  margin-right: 14px;
}

.BreakLine {
  border-bottom: 1px solid var(--border-color-lighter);
  width: calc(100% - 18px);
}

.user-dropdown {
  width: 260px;
}

.user-dropdown.mid{
  width: 200px;
}

.user-text-dropdown{
  width: 100%;
  box-sizing: border-box;
  font-size: 0.84rem;
  color: var(--light-text);
  padding: 6px 12px;
  text-align: left;
  display: flex;
}

.topbar-dropdown {
  width: 191px;
}

.topbar-recent-dropdown {
  width: 220px;
}

.chat-dropdown-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.create-folder-item {
  padding-bottom: 7px;
}

/* --- Modal Overlay --- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0s linear 0s;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.modal > * {
    transform: scale(1);
    transition: transform 0.2s ease;
}

.modal.hidden > * {
    transform: scale(0.95);
}

/* --- Modal Box --- */
.modal-box {
    background: var(--background-color);
    padding: 20px;
    border-radius: 16px;
    width: 300px;
    box-shadow: 0 6px 20px #0003;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-box h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-input {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    border: none;
}

.modal-btn.cancel {
    background: transparent;
    color: var(--contrast);
}

.modal-btn.cancel:hover {
    background: var(--hover-color);
}

.modal-btn.save {
    background: var(--contrast);
    color: var(--background-color);
}

.modal-btn.save:hover {
    background: var(--light-background-hover);
}

.modal-btn.delete {
    background: var(--red-text);
    color: var(--contrast-color);
}

.modal-btn.delete:hover {
    background: var(--red-text);
}

.academic-honesty-warning-box {
    width: min(92vw, 420px);
}

.academic-honesty-warning-box p {
    margin: 0;
    color: var(--light-text);
    line-height: 1.45;
}

/* Improved 3-dot popup menu */
.chat-popup-menu {
    position: fixed;
    width: 150px;                 /* <--- Set fixed width */
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px #0003;
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    animation: fadeIn 0.15s ease-out;
    z-index: 99999;
    pointer-events: auto;
}

.popup-item {
    padding: 10px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    background: none;
    border: none;
    text-align: left;
    width: 150px;
}

.popup-item:hover {
    background: var(--border-color);
}

.chat-menu-btn {
    margin-left: auto;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px;
    opacity: 0.7;
}

.chat-menu-btn:hover {
    opacity: 1;
}

.chat-item-wrapper {
    position: relative; /* <--- ADD THIS */
}

/* --- USER BOX --- */
.user-box {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 67px;
    /*width: calc(var(--sidebar-w) - 1px);*/
    width: var(--sidebar-w);
    background: var(--sidebar-color);
    padding: 6px;
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    z-index: 9999;
    transition: width 0.25s ease, padding 0.25s ease, background 0.2s ease ;
    user-select: none;
    box-sizing: border-box;
    overflow: hidden;
  }

  .user-box:hover {
    background-color: var(--hover-color);
  }

  .user-box:hover .collection_btn {
    background-color: var(--hover-color);
  }

.sidebar.collapsed .user-box { 
  background-color: var(--background-color);
}

.sidebar.collapsed .user-box:hover { 
  background-color: var(--hover-color);
}

.user-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 8px;
    padding-left: 8px;
    min-height: 48px;
    cursor: pointer;
}

.user-info {
    min-width: 0;
    max-width: 100%;
    opacity: 1;
    transform: translateX(0);
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.2s ease-out, opacity 0.16s ease-out, transform 0.2s ease-out;
}

.sidebar.collapsed .user-info {
    max-width: 0;
    opacity: 0;
    transform: translateX(-4px);
    pointer-events: none;
}

/* Disable user-box hover when hovering Get Plus */
.user-inner:has(.get-plus-btn:hover) {
    background: transparent !important;
}

.user-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    background: #4a4a4a;
    border-radius: 8px;
    color: #000;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 14px;   /* smaller text */
}

.sidebar.collapsed .user-avatar {
    margin-right: 0;
}

.user-name {
    font-size: 1rem;
    font-weight: 300;
}


/* Popup menu */
.user-menu {
    position: absolute;
    bottom: 70px;
    left: 14px;
    width: 180px;
    background: var(--background-color);  /* ensure popup stays clean white */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    z-index: 99999;
}

.user-menu-item {
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu-item:hover {
    background: var(--hover-color);
}

.logout-item {
    color: var(--red-text);
    font-weight: 600;
}

.sidebar.collapsed {
    overflow-y: hidden;

}

.sidebar.collapsed .user-box {
    padding: 6px;
}

.sidebar.collapsed .chat-list {
    display: none;
}

.sidebar.collapsed #userMenu {
    left: 70px;  /* small offset from the collapsed bar */
}

.sidebar.collapsed .chat-menu-btn {
    display: none !important;
}

.sidebar.collapsed .chat-popup-menu {
    display: none !important;
}

/* COLLAPSED USER BOX — FIXED HEIGHT + TIGHT HOVER */
.sidebar.collapsed .user-inner {
    justify-content: flex-start;
    padding: 8px;
    margin: 0;
}


/* Remove shadow-space from scroll area when empty */
.main-area.empty-chat .chat-scroll {
    padding-bottom: 0 !important;
}

.input-container-centered.hidden {
    display: none;
}


.Greeting {
  padding-bottom: 24px;
    position: absolute;
    top: calc(var(--slanter-topbar-h, 50px) + ((100vh - var(--slanter-topbar-h, 50px)) * 0.46) - 58px);
    left: 50%;
    transform: translateX(-50%);
    font-family: "artifex-cf", serif;
    font-weight: 300;
    color: #292929;
    font-size: 2.3rem;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

body:not(.mobile-active) .Greeting.inputbarGreeting .mobileGreetingText,
body:not(.mobile-active) .Greeting.inputbarGreeting .mobileGreetingMessage {
    white-space: nowrap;
    text-wrap: nowrap;
}

.mobileGreeting{
    display: none;
    position: relative;
    font-family: "artifex-cf", serif;
    font-weight: 600;
    color: #292929;
    font-size: 1.7rem;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

.mobileGreetingText{
    display: inline-block;
    position: relative;
    user-select: none;
    text-align: center;
    white-space: normal;
    min-height: 17px;
    line-height: 1.25;
    width: auto;
    max-width: calc(100vw - 120px);
    text-wrap: wrap;
}

.mobileGreetingMessage {
    color: var(--text-color);
    display: block;
    max-width: 100%;
    white-space: normal;
}

.logosidegreeting{
    color: var(--color-green-slanter);
    width: 20px;
    position: absolute;
    left: -16px;
    bottom: -8px;
    transform: translate(-35%, 35%);
}

.logosidegreetingrota{
    transform: rotate(180deg);
    color: var(--color-green-slanter);
    width: 20px;
    position: absolute;
    right: -16px;
    top: -8px;
    transform: translate(35%, -35%) rotate(180deg);
}

.input-container-centered.collection {
  top: 0;
}

.input-container-centered {
    transition: box-shadow 0.25s ease;
    position: absolute;
    top: calc(var(--slanter-topbar-h, 50px) + ((100vh - var(--slanter-topbar-h, 50px)) * 0.46));
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 765px;

    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 21px;
    box-shadow: 0 0 0 var(--black-shadow);

    padding: 0;                     /* SAME as bottom bar */
    overflow: hidden;               /* SAME */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;         /* SAME */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-container-centered textarea {
    width: 100%;
    border: none;
    resize: none;
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.4;
    box-sizing: border-box;
}

.input-container-centered:has(#inputCenteredBox:focus){
  border-color: var(--border-color);
  box-shadow: 0 0 15px var(--black-shadow);
}

.empty-chat-composer-stack {
    display: none;
}

.empty-chat-composer-stack.collection {
    display: flex;
    position: relative;
    top: 0;
    width: min(100%, 765px);
    max-width: 765px;
    margin: 0 auto;
    flex-direction: column;
    align-items: stretch;
}

.empty-chat-composer-stack.collection .collection-live-composer-host {
    width: 100%;
}

.main-area.empty-chat .empty-chat-composer-stack.collection {
    position: relative;
    top: 0;
    left: auto;
    transform: none;
    width: 100%;
    align-items: stretch;
}

.empty-chat-composer-stack.collection .inputbarGreeting,
.empty-chat-composer-stack.collection .mobileGreeting {
    display: none !important;
}

.empty-chat-composer-stack.collection #filePreviewRow {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
}

.empty-chat-composer-stack.collection .input-container-centered {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100%;
    max-width: 765px;
}

.main-area.empty-chat .empty-chat-composer-stack {
    position: absolute;
    top: calc(var(--slanter-topbar-h, 50px) + ((100vh - var(--slanter-topbar-h, 50px)) * 0.46));
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(calc(100% - 24px), 765px);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 8;
}

.main-area.empty-chat .empty-chat-composer-stack .inputbarGreeting {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    margin-bottom: 20px;
}

.main-area.empty-chat .empty-chat-composer-stack .mobileGreeting {
    display: none;
}

.main-area.empty-chat .empty-chat-composer-stack #filePreviewRow {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
}

.main-area.empty-chat .empty-chat-composer-stack .input-container-centered {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
}

.centered-bottom-bar {
    width: 100%;
    background: var(--input-bg);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    box-sizing: border-box;
}


/* Auto-grow until max height, then scroll */
#inputbox,
#inputCenteredBox {
    min-height: 50px;
    max-height: 500px;
    overflow-y: hidden;      /* JS toggles when needed */
    resize: none;
}

#inputbox {
    max-height: 320px;
}

#inputCenteredBox {
    color: var(--text-color);
    -webkit-text-fill-color: currentColor;
    max-height: calc(1.4em * 10 + 24px);
}

/* Block-model contenteditable chat input: .line (plain prose) + .code-block (highlighted code) */
.editable-chat-input {
    --sb-track-color: var(--input-bg);
    --sb-thumb-color: var(--file-btn-mobile-bg);
    --sb-size: 9px;
    font-family: 'Slanter-Sans', sans-serif;
    font-weight: 300;
    width: 100%;
    min-height: 0px;
    padding: 20px 20px 8px 20px;
    border: none;
    box-sizing: border-box;
    font-size: 1rem;
    display: block;
    text-align: left;
    background-color: var(--input-bg);
    color: var(--text-color);
    white-space: pre-wrap;
    overflow-wrap: break-word;
    outline: none;
    cursor: text;
    position: relative;
}

.editable-chat-input::-webkit-scrollbar {
    width: var(--sb-size);
}

.editable-chat-input::-webkit-scrollbar-track {
    background: var(--sb-track-color);
    border-radius: 11px;
}

.editable-chat-input::-webkit-scrollbar-thumb {
    background: var(--sb-thumb-color);
    border-radius: 11px;
    border: 1px solid var(--input-bg);
}

@supports not selector(::-webkit-scrollbar) {
    .editable-chat-input {
        scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
    }
}

.editable-chat-input .line {
    background: transparent;
    white-space: pre-wrap;
    min-height: 1.4em;
}

/* Empty "Enter" lines have no text/<br> content, so the browser's native
   ::selection never paints across them. line-selection-marker.js toggles
   .line-selected on lines covered by the current selection, and this shows
   a small highlighted block (like a selected space character) so blank
   lines don't look skipped when a multi-line selection passes through them. */
.editable-chat-input .line.line-selected.line-empty::after {
    content: "";
    display: inline-block;
    width: 0.55em;
    height: 1.1em;
    vertical-align: text-bottom;
    background: var(--highlight-bg);
}

.editable-chat-input .code-block {
    background: var(--code-paste-bg);
    margin: 6px 0;
    padding: 10px 12px;
    border-radius: 8px;
}

.editable-chat-input .code-block code {
    background: transparent !important;
    color: var(--text-color);
    font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
    font-size: 0.85em;
    display: block;
}

.editable-chat-input .code-block .code-line {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    min-height: 1.3em;
}

.editable-chat-input.is-placeholder-empty::before {
    content: attr(data-placeholder);
    position: absolute;
    left: 20px;
    top: 20px;
    right: 20px;
    color: var(--med-text);
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 440ms ease;
}

.editable-chat-input.is-placeholder-fading.is-placeholder-empty::before {
    opacity: 0;
}

.scroll-down {
    position: fixed;
    /* --chat-input-cover-h tracks the bottom input bar's actual rendered
       height (grows with multi-line content), kept in sync by
       syncChatInputCoverSpace(). Sit just above it instead of a fixed guess. */
    bottom: calc(var(--chat-input-cover-h, 90px) + 15px);
    transition: bottom 160ms ease;

    /* Center relative to the chat column (expanded sidebar) */
    left: calc(260px + (100% - 260px) / 2);
    transform: translateX(-50%) translateY(0);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--input-bg);
    border-radius: 13px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--black-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;

    z-index: 10050;
    isolation: isolate;
    will-change: transform, opacity;
    backface-visibility: hidden;
    /* smooth movement */
    opacity: 1;
    visibility: visible;
}


/* Center correctly when sidebar is collapsed */
.app-layout.sidebar-collapsed .scroll-down {
    left: calc(60px + (100% - 60px) / 2);
}

.scroll-down.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0ms, 0ms, 320ms, 0ms;
}

.scroll-down:hover {
  background-color: var(--input-box-bg);
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  z-index: 10051;
}

.scroll-down:focus-visible {
  opacity: 1 !important;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  z-index: 10051;
}

body.mobile-active #scrollDownBtn {
    left: 50% !important;
    right: auto !important;
    bottom: calc(
        env(safe-area-inset-bottom, 0px)
        + 12px
        + var(--mobile-inputbar-height, 64px)
        + 10px
    );
    transform: translateX(-50%) translateY(calc(-1 * var(--mobile-keyboard-shift, 0px)));
    width: 45px;
    height: 45px;
    border-radius: 16px;
    padding: 11px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    box-shadow: var(--mobile-button-inset);
    transition:
        transform 260ms ease,
        opacity 320ms cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0ms linear 0ms,
        background-color 0.2s ease;
}

body.mobile-active #scrollDownBtn.is-hidden {
    transform: translateX(-50%) translateY(calc(-1 * var(--mobile-keyboard-shift, 0px)));
}

body.mobile-active #scrollDownBtn:hover,
body.mobile-active #scrollDownBtn:focus-visible {
    transform: translateX(-50%) translateY(calc(-1 * var(--mobile-keyboard-shift, 0px)));
}

body.mobile-active #scrollDownBtn:active:not(:disabled),
body.mobile-active #scrollDownBtn.mobilebutton-pressed:not(:disabled) {
    transform: translateX(-50%) translateY(calc(-1 * var(--mobile-keyboard-shift, 0px))) scale(1.3);
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;

    padding-top: var(--sidebar-fixed-top-h);
    padding-bottom: var(--sidebar-fixed-bottom-h);
    padding-right: var(--sidebar-scroll-gutter);
    margin-right: 0;

    background: var(--sidebar-color);
    scrollbar-width: thin;
    transition: all 0.25s ease;
}

/* chrome scrollbar styling */
.sidebar-scroll::-webkit-scrollbar-track {
    background: var(--sb-track-color);
    border-radius: 11px;
    border: none;
    box-shadow: none;
}

.sidebar-scroll::-webkit-scrollbar {
    width: var(--sb-size);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: var(--sb-thumb-color);
    border-radius: 11px;
    border: none;
    box-shadow: none;
    border: 1px solid var(--sidebar-color);
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--sb-thumb-color);
}

@supports not selector(::-webkit-scrollbar) {
  .sidebar,
  .sidebar-scroll {
    scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
  }
}

.top-box,
.top-box-Dash {
    position: relative;
    width: 100%;
    background: var(--sidebar-color);
    padding: 0 0 var(--sidebar-fixed-bottom-h) 0;
    padding-top: var(--sidebar-fixed-top-h);
    /*padding-right: var(--sidebar-scroll-gutter);*/
    box-sizing: border-box;
    border-bottom: none;
    z-index: auto;
    transition: all 0.25s ease;
}

.sidebar.collapsed .top-box,
.sidebar.collapsed .top-box-Dash {
    width: 54px;
    background-color: var(--background-color);
    border-bottom: none;
}

.sidebar.collapsed .chat-list {
    display: none;
}

/* Hide conversation names when collapsed */
.sidebar.collapsed .chat-item-title {
    display: none !important;
}

.sidebar.collapsed .chat-item-subtitle {
    display: none !important;
}

/* Center logo + new-chat when compact */
.sidebar.compact .top-box,
.sidebar.compact .top-box-Dash {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.sidebar.compact .logo-text {
    display: inline-block;
}

.sidebar.compact #collapseBtn {
    display: none;
}


/* Expanded = pill button */
.sidebar:not(.collapsed) #newChatBtn {
    width: 100%;
    border-radius: 8px;
    height: auto;
    padding: 8px 9px;
    justify-content: flex-start;
}

#newChatBtn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebarSVG {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  flex: 0 0 16px;
}

.sidebar.collapsed #newChatBtn {
    margin: 0 auto;
}

.sidebar.collapsed #newChatBtn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 8px;
    justify-content: center !important;
}

.sidebar.collapsed .logo-section img {
    margin: 0 auto;
}
/* Center logo container when collapsed */
.sidebar.collapsed .logo-section {
    width: 100%;
    display: flex;
    justify-content: center !important;
    align-items: center !important;
    padding: 0;
}

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

/* Center the entire logo row when collapsed */
.sidebar.collapsed .sidebar-logo-row {
    left: 0;
    width: 53px;
    justify-content: center !important;
    align-items: center;
    background: var(--background-color);
    padding-top: 0;
    padding-right: 0;
}

/* Hide the close button when collapsed */
.sidebar.collapsed #sidebarCloseBtn {
    display: none !important;
}

/* Deterministic collapsed centering for logo/open button */
.sidebar.collapsed .sidebar-logo-row {
    display: grid;
    place-items: center;
}

.sidebar.collapsed .sidebar-logo-btn {
    width: 110px !important;
    left: 10px !important;
    justify-content: center !important;
}

.sidebar.collapsed .logo_text {
  fill: none;
}

/* Remove the close button so it doesn't push logo away */
.sidebar.collapsed .sidebar-close-btn {
    display: none !important;
}

#sidebarLogoBtn {
  margin-left: 0;
  padding: 0;
  justify-content: flex-start;
  gap: 0;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: left 0.25s ease;
}

/* Hide entire chat list (names + buttons) */
.sidebar.collapsed #chatList {
    display: none !important;
}

/* Hide the "Past Conversations" label */
.sidebar.collapsed .sidebar-section-label {
    display: none !important;
  }

.sidebar.collapsed .sidebar-folder-list,
.sidebar.collapsed .sidebar-chat-list {
    display: none !important;
}

  .sidebar-section-label {
    color: var(--med-light-text);
    font-size: 0.8rem;
    font-weight: 500;
  }

.chat-item-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-item-status-dot {
    width: 12px;
    height: 12px;
    aspect-ratio: 1;
    position: absolute;
    right: 13px;
    top: 50%;
    margin-top: -6px;
    border-radius: 999px;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: scale(0.8);
}

@keyframes chat-item-status-spin {
    to {
        transform: rotate(360deg);
    }
}

.chat-item-background-complete .chat-item-status-dot {
    background: var(--blue-accent);
    opacity: 1;
    transform: scale(1);
}

.chat-item-background-pending .chat-item-status-dot {
    background: transparent;
    border: 2px solid color-mix(in srgb, var(--blue-accent) 35%, transparent);
    border-top-color: var(--blue-accent);
    opacity: 1;
    transform: none;
    animation: chat-item-status-spin 0.9s linear infinite;
}

.chat-item.active .chat-item-status-dot {
    opacity: 0 !important;
    transform: scale(0.8);
}

.chat-item.chat-item-background-pending:hover .chat-item-status-dot,
.chat-item.chat-item-background-complete:hover .chat-item-status-dot,
.chat-item-wrapper.force-hover .chat-item.chat-item-background-pending .chat-item-status-dot,
.chat-item-wrapper.force-hover .chat-item.chat-item-background-complete .chat-item-status-dot {
    opacity: 0;
    transform: scale(0.8);
    animation-play-state: paused;
}

.chat-item-dots {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0 4px;
    visibility: hidden;
    opacity: 0%;
    transition: opacity 0.2s;
}

.chat-item.active .chat-item-dots {
    opacity: 70%;
    visibility: visible;
}

.chat-item.chat-item-background-pending .chat-item-dots,
.chat-item.chat-item-background-complete .chat-item-dots {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.chat-item:hover .chat-item-dots {
    opacity: 70%;
    visibility: visible;
}

.chat-item-wrapper.force-hover .chat-item .chat-item-dots {
    opacity: 70%;
    visibility: visible;
}

.chat-item.chat-item-background-pending:hover .chat-item-dots,
.chat-item.chat-item-background-complete:hover .chat-item-dots,
.chat-item-wrapper.force-hover .chat-item.chat-item-background-pending .chat-item-dots,
.chat-item-wrapper.force-hover .chat-item.chat-item-background-complete .chat-item-dots {
    opacity: 70%;
    visibility: visible;
    pointer-events: auto;
}

.chat-item-wrapper.renaming .chat-item .chat-item-dots {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.chat-item.active .chat-item-dots .threeDotsMenu,
.chat-item.chat-item-background-pending .chat-item-dots .threeDotsMenu,
.chat-item.chat-item-background-complete .chat-item-dots .threeDotsMenu,
.chat-item:hover .chat-item-dots .threeDotsMenu,
.chat-item-wrapper.force-hover .chat-item .chat-item-dots .threeDotsMenu,
.folder-row:hover .folder-dots-btn .threeDotsMenu,
.pinned-folder-row:hover .folder-dots-btn .threeDotsMenu {
    visibility: visible;
}

.pinned-folder-row .folder-dots-btn {
    flex-shrink: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0 4px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.pinned-folder-row:hover .folder-dots-btn {
    opacity: 0.7;
    visibility: visible;
    pointer-events: auto !important;
}

.pinned-folder-row .folder-dots-btn:hover {
    opacity: 1;
    pointer-events: auto !important;
}

.chat-item-dots:hover {
    opacity: 100%;
}

/* Remove old external 3-dot button */
.chat-menu-btn {
    display: none !important;
}

/* Make dots white when chat is selected */
.chat-item.active .chat-item-dots {
    color: var(--contrast) !important;
    opacity: 1 !important;
}



/* Folders at top of chat list */

.folder-row {
    border-radius: 12px;
    padding: 8px 10px;
    margin-left: 1px;
    margin-right: 4px;
    cursor: pointer;
    user-select: none;          /* prevent text selection */
    -webkit-user-select: none;
    -ms-user-select: none;
    align-items: center;
    position: relative;
}

.folder-left {
  display: flex;
  align-items: center;
  gap: 6px;
}


/* SVG circle wrapper */
.folder-color-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.folder-color-svg-el {
    width: 10px;
    height: 10px;
}
/* Folder text slightly bigger */
.folder-name {
  font-size: 0.95rem;      /* was smaller before */
  display: block;
  flex: 1 1 auto;
  max-width: 100%;
  color: var(--text-color);
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: none !important;
}

/* count on the right */
.folder-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.folder-count {
  user-select: none;
  font-size: 0.8rem;
  color: #6b7280;
}


.chat-item-dots {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0 4px;
    visibility: hidden;
    opacity: 0%;
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 300ms ease, box-shadow 420ms cubic-bezier(0.22, 1, 0.36, 1), background-color 300ms ease;
}

.chat-item.active .chat-item-dots {
    opacity: 70%;
    visibility: visible;
}

.chat-item.chat-item-background-pending .chat-item-dots,
.chat-item.chat-item-background-complete .chat-item-dots {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.chat-item:hover .chat-item-dots {
    opacity: 70%;
    visibility: visible;
}

.chat-item-dots:hover {
    opacity: 100%;
}

.chat-item.chat-item-background-pending .chat-item-dots .threeDotsMenu,
.chat-item.chat-item-background-complete .chat-item-dots .threeDotsMenu {
    visibility: visible;
}

.chat-item.chat-item-background-pending:hover .chat-item-dots,
.chat-item.chat-item-background-complete:hover .chat-item-dots {
    opacity: 70%;
    visibility: visible;
    pointer-events: auto;
}

/* 3-dot menu button on folder */
.folder-dots-btn {
    pointer-events: none;
}

.folder-row:hover .folder-dots-btn,
.folder-row:focus-within .folder-dots-btn {
    visibility: visible;
    opacity: 70%;
    pointer-events: auto;
}

.folder-row.active .folder-dots-btn {
    opacity: 70%;
    visibility: visible;
    pointer-events: auto;
}


.folder-dots-btn:hover {
    opacity: 100%;
    visibility:visible;
}

/* Drag-drop line indicators */

.chat-item-wrapper {
  position: relative;
}

.chat-item-wrapper.drop-top::before,
.chat-item-wrapper.drop-bottom::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: #3b82f6;
  border-radius: 999px;
}

.chat-item-wrapper.drop-top::before {
  top: 0;
}

.chat-item-wrapper.drop-bottom::after {
  bottom: 0;
}

/* Folder drop highlight + plus hint */

.folder-row.folder-drop-target {
    background: rgba(59, 130, 246, 0.10);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
    position: relative;
}

.folder-row.folder-drop-target::after {
    content: "+";
    position: absolute;
    right: 12px;
    font-size: 14px;
    color: #2563eb;
    font-weight: 700;
}

.folder-popup-menu {
  position: absolute;
  background: var(--background-color);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 0;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  z-index: 40;
}

.folder-popup-menu.hidden {
  display: none;
}

.folder-popup-menu .popup-item {
  width: 100%;
  padding: 6px 12px;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
}

.folder-popup-menu .popup-item:hover {
  background: #f3f4f6;
}

.folder-row {
    padding: 8px 10px;
    margin: 4px 10px;
    border-radius: 8px;   
    background: none;      
    transition: background 0.15s ease;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-left: 0;
    position: relative;
    min-width: 0;
}

.folder-toggle-btn {
    width: 100%;
    min-width: 0;
}

.folder-row:hover {
    background: var(--hover-color);
}

.folder-group {
    border-radius: 8px;
    overflow: visible;
}

.folder-group.is-open {
    background: var(--hover-color);
    padding: 0;
}

.folder-group .folder-row {
    margin: 0;
    padding: 8px 10px;
}

.folder-group.is-open .folder-row {
    background: transparent;
}

.folder-group-child {
    padding: 0;
}

.folder-group .folder-group-child + .folder-group-child {
    margin-top: 4px;
}

.folder-group.is-open .folder-group-child .chat-item {
    background: transparent;
}

.folder-group.is-open .folder-group-child .chat-item:hover {
    background: var(--hover-color);
}

body.mobile-active .folder-group.is-open .folder-group-child .chat-item:hover {
    background: transparent;
}

.folder-group.is-open .folder-group-child .chat-item.active {
    background: var(--hover-color);
}

.folder-drop-target {
    border: 2px dashed #3b82f6;
    background: #eff6ff;
    border-radius: 12px;
}

.chat-item-wrapper.drop-top::before,
.chat-item-wrapper.drop-bottom::before {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    height: 3px;
    background: #3b82f6;
    border-radius: 3px;
}

.chat-item-wrapper.drop-top::before {
    top: -2px;
}

.chat-item-wrapper.drop-bottom::before {
    bottom: -2px;
}

/* Dot SVG sizing */
.folder-color-svg {
    display: flex;
    align-items: center;
    margin-right: 6px;
}

.folder-color-svg-el {
    width: 12px;
    height: 12px;
}

.chat-removed-animation {
    animation: removedFade 0.35s ease-out forwards;
}

@keyframes removedFade {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(-10px); }
}

.unfoldered-zone-highlight {
    outline: 2px dashed #3b82f6;   /* blue */
    border-radius: 8px;
    padding: 4px;
    animation: glowOut 0.25s ease-out forwards;
}

@keyframes glowOut {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* chat removal animation */
.chat-remove-animation {
    animation: removeFade 0.25s ease-out forwards;
}

@keyframes removeFade {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(-6px); }
}

.folder-drop-target {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    border-radius: 8px;
}

.root-drop-target {
    outline: 2px dotted #3b82f6;
    outline-offset: -2px;
    border-radius: 8px;
}

.unfoldered-zone-highlight {
    outline: 2px dashed #3b82f6;
    border-radius: 8px;
}

.chat-remove-animation {
    animation: chatRemovePulse 0.25s ease-out;
}

@keyframes chatRemovePulse {
    0%   { box-shadow: 0 0 0 0 rgba(59,130,246,0.6); }
    100% { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}

.unfolder-drop-zone {
    border: 2px dashed #4c8aff;
    background: rgba(76,138,255,0.05);
    border-radius: 8px;
    margin: 4px 8px;
    padding: 6px;
}

.root-drop-zone {
  margin: 8px 14px 12px 12px;   /* ⬅️ creates gap on the right side */
  min-height: 500px;            /* big area like in your red box */
  border: 2px dashed #3b82f6;
  border-radius: 16px;
  background: #eff6ff;
  display: flex;
  align-items: flex-start;
  padding: 12px;
  font-size: 0.9rem;
  color: #2563eb;
  pointer-events: none;         /* important: let chatListEl handle the drop */
}

.root-drop-zone.hidden {
  display: none;
}

/* Collapse: shrink JUST the width so they become circles */
.sidebar.collapsed .new-chat-btn,
.sidebar.collapsed .organize-btn {
    width: 32px !important;   /* ← matches existing height (38px) */
    aspect-ratio: 1;
    padding-left: 0 !important;
    padding-right: 0 !important;
    justify-content: center !important;
}

/* hide text ONLY */
.sidebar.collapsed .new-chat-text,
.sidebar.collapsed .organize-text {
    display: none !important;
}

/* keep icon centered, same size */
.sidebar.collapsed .new-chat-btn svg,
.sidebar.collapsed .organize-btn svg {
    margin: 0 auto !important;
}

/* Add 2px spacing between logo and New Chat in collapsed mode */
.sidebar.collapsed #newChatBtn {
    margin-top: 5px !important;
}

/* Center the Organize button under New Chat */
.sidebar.collapsed #organizeBtn {
    margin-left: auto !important;
    margin-right: auto !important;
}

.voice-btn svg path {
    fill: var(--contrast-color);
}

.recording .voice-btn {
    background: red !important;
}

.voice-ui {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
}

.voice-timer {
    font-size: 0.9rem;
    color: #222;
}


.voice-ui {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
}

.voice-ui.hidden {
    display: none;
}

.bar {
    width: 4px;
    background: var(--contrast); 
    border-radius: 50px;
    margin: 0 2px;
    height: 6px;                   /* VERY LOW baseline height */
    transition: height 0.12s ease; /* smooth motion instead of jitter */
}

.voice-ui {
    width: 100%;
    padding: 0 12px;
}

.voice-visualizer {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.voice-visualizer .bar {
    width: 6px;
    background: var(--contrast);
    border-radius: 4px;
    height: 3px;        /* initial height */
    transition: height 0.1s ease;   /* JS animates height */
    animation: none !important;     /* override old rules */
}

.voiceVisualizer {
  --voice-lane-h: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  width: 100%;
  height: var(--voice-lane-h);
  min-height: var(--voice-lane-h);
  max-height: var(--voice-lane-h);
  overflow: hidden;
  position: relative;
}

.voiceBar {
  width: 2px;
  flex: 0 0 2px;
  background-color: var(--text-color);
  transform: scaleY(0);
  transform-origin: center;
  animation: barGrow 0.35s ease-out forwards;
  opacity: 1;
  transition: transform 120ms cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 100px;
  will-change: transform;
}

.desktop-voice-stop {
  width: fit-content;
  min-width: 112px;
  gap: 8px;
  padding: 0;
}

.desktop-voice-ui {
  display: flex;
  align-items: center;
  width: 70px;
  min-width: 70px;
  height: 18px;
  margin-left: 7px;
  overflow: hidden;
}

.desktop-voice-visualizer {
  --voice-bar-step: 6px;
  --voice-lane-h: 18px;
  width: 100%;
  height: 10px;
  min-height: 10px;
  max-height: 10px;
}

.desktop-voice-stop .send-icon {
  width: 18px;
  height: 18px;
  margin-left: auto;
  margin-right: 7px;
  flex: 0 0 18px;
}

.voiceBar.voiceBar-ghost {
  position: absolute;
  margin: 0 !important;
  animation: none;
  transform: translateY(-50%) scaleY(1);
  transform-origin: center;
  top: 50%;
  bottom: auto;
  pointer-events: none;
  z-index: 4;
  opacity: 1;
  will-change: transform;
}

.voiceBar.is-removing {
  animation: voiceBarExit 140ms cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
  transition: none !important;
  pointer-events: none;
}

@keyframes voiceBarExit {
  0% {
    opacity: 1;
    transform: translateY(-50%) scaleY(1);
  }
  100% {
    opacity: 1;
    transform: translateY(-50%) scaleY(0);
  }
}

@keyframes barGrow {
  to {
    transform: scaleY(1);
  }
}

/* === FILE PREVIEW ROW (ABOVE COMPOSER) === */
.file-preview-stack {
    width: 100%;
    max-width: 765px;
    margin: 0 auto;
    box-sizing: border-box;
}

.file-preview-row {
    --file-preview-edge-fade: 28px;
    display: none;
    align-items: flex-end;
    gap: 12px;
    overflow-x: scroll;
    overflow-y: hidden;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb-color) var(--background-color);
    scrollbar-gutter: stable;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
}

.file-preview-row::before,
.file-preview-row::after,
.mobile-file-row::before,
.mobile-file-row::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: var(--sb-size);
    width: var(--file-preview-edge-fade);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 120548;
}

.file-preview-row::before,
.mobile-file-row::before {
    left: 0;
    background: linear-gradient(to right, var(--background-color) 0%, transparent 100%);
}

.file-preview-row::after,
.mobile-file-row::after {
    right: 0;
    background: linear-gradient(to left, var(--background-color) 0%, transparent 100%);
}

.file-preview-row.can-scroll-left::before,
.mobile-file-row.can-scroll-left::before {
    opacity: 1;
}

.file-preview-row.can-scroll-right::after,
.mobile-file-row.can-scroll-right::after {
    opacity: 1;
}

.file-preview-row:not(.has-files) {
    display: none !important;
}

.main-area.empty-chat #filePreviewRow {
    display: flex;
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    transform: none;
    z-index: 8;
}

.empty-chat-composer-stack.collection #filePreviewRow.has-files {
    display: flex !important;
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    transform: none;
    z-index: 8;
}

.file-preview-row::-webkit-scrollbar {
    height: var(--sb-size);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.file-preview-row::-webkit-scrollbar-track {
    background: var(--sb-track-color);
    border-radius: 11px;
    border: none;
    box-shadow: none;
}

.file-preview-row::-webkit-scrollbar-thumb {
    background: var(--sb-thumb-color);
    border-radius: 11px;
    border: 1px solid var(--sidebar-color);
    box-shadow: none;
}

.file-preview-row::-webkit-scrollbar-thumb:hover {
    background: var(--sb-thumb-color);
}

.file-preview-row.has-files {
    padding-top: 16px;
}

:is(.file-preview-row, .mobile-file-row) .file-chip {
    flex-shrink: 0;
    position: relative;
}

:is(.file-preview-row, .mobile-file-row) .file-chip.loading,
:is(.file-preview-row, .mobile-file-row) .file-chip.loading * {
    cursor: progress !important;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-media-file {
    width: 60px;
    height: 60px;
    margin-left: 1px;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-new {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 21px;
    display: flex;
    align-items: center;
    align-self: flex-end;
    width: 300px;
    height: 66px;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-box {
    width: 60px;
    height: 60px;
    min-width: 50px;
    object-fit: cover;
    border-radius: 18px;
    display: block;
    transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-title {
    color: var(--text-color);
    font-weight: 600;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Without this, clicking the title starts a native text selection —
       selected text inside a clipped/nowrap element renders unclipped in
       most browsers, which visually looks like the ellipsis "disappears". */
    user-select: none;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-sub {
    color: var(--med-text);
    font-size: 0.9rem;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-close {
    width: 20px;
    aspect-ratio: 1;
    display: flex;
    background-color: transparent;
    border-radius: 13px;
    padding: 5px;
    align-self: flex-start;
    margin: 8px 8px 8px auto;
    cursor: pointer;
    color: var(--med-text);
    transition: all 0.15s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-close:hover {
    background-color: var(--hover-color);
    color: var(--text-color);
}

:is(.file-preview-row, .mobile-file-row) .file-chip-image-new-file {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 21px;
    align-items: center;
    align-self: flex-end;
    width: 66px;
    height: 66px;
    position: relative;
    display: flex;
    overflow: hidden;
    --image-overlay-bg: rgba(255, 255, 255, 0.72);
    --image-overlay-bg-hover: rgba(255, 255, 255, 0.9);
    --image-overlay-fg: #111111;
    --image-overlay-track: rgba(255, 255, 255, 0.28);
    --image-overlay-shadow: rgba(0, 0, 0, 0.18);
}

:is(.file-preview-row, .mobile-file-row) .file-chip-media-image {
    width: 100%;
    height: 100%;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-box-image-file {
    width: 58px;
    height: 58px;
    aspect-ratio: 1;
    object-fit: cover;
    margin: 4px;
    border-radius: 16px;
    clip-path: inset(0 round 16px);
    filter: blur(0);
    transition: filter 0.35s ease, transform 0.35s ease, opacity 0.35s ease;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-close-image {
    width: 20px;
    height: 20px;
    background-color: var(--image-overlay-bg);
    border-radius: 13px;
    padding: 5px;
    align-self: flex-start;
    cursor: pointer;
    color: var(--image-overlay-fg);
    transition: all 0.15s ease;
    position: absolute;
    display: flex;
    right: 0;
    margin: 8px;
    box-shadow: 0 4px 14px var(--image-overlay-shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-close-image:hover {
    color: var(--image-overlay-fg);
    background: var(--image-overlay-bg-hover);
}

:is(.file-preview-row, .mobile-file-row) .file-chip.upload-complete .file-chip-close,
:is(.file-preview-row, .mobile-file-row) .file-chip.upload-complete .file-chip-close-image {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-image-new {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 21px;
    align-items: center;
    align-self: flex-end;
    width: calc(var(--image-chip-display-width, 150px) + 8px);
    height: fit-content;
    position: relative;
    display: flex;
    overflow: hidden;
    --image-overlay-bg: rgba(255, 255, 255, 0.72);
    --image-overlay-bg-hover: rgba(255, 255, 255, 0.9);
    --image-overlay-fg: #111111;
    --image-overlay-track: rgba(255, 255, 255, 0.28);
    --image-overlay-shadow: rgba(0, 0, 0, 0.18);
}

:is(.file-preview-row, .mobile-file-row) .file-chip-box-image {
    width: var(--image-chip-display-width, 150px);
    max-width: min(240px, 50vw);
    height: 150px;
    object-fit: cover;
    margin: 4px;
    border-radius: 17px;
    clip-path: inset(0 round 17px);
    display: block;
    filter: blur(0);
    transition: filter 0.35s ease, transform 0.35s ease, opacity 0.35s ease;
    cursor: zoom-in;
    will-change: filter;
}

:is(.file-preview-row, .mobile-file-row) .file-chip.loading.preview-ready .file-chip-box-image,
:is(.file-preview-row, .mobile-file-row) .file-chip.loading.preview-ready .file-chip-box-image-file {
    filter: blur(4px);
    transform: scale(1.008);
    opacity: 0.96;
}

:is(.file-preview-row, .mobile-file-row) .file-chip.loading .file-chip-box {
    filter: blur(2px);
    opacity: 0.88;
    transform: scale(1.01);
}

:is(.file-preview-row, .mobile-file-row) .file-chip-box-image-file {
    cursor: zoom-in;
}

@keyframes imageAnalysisSweep {
  0% {
    background-position: 180% 50%;
  }
  100% {
    background-position: -180% 50%;
  }
}

.file-chip.analysis-pending .file-chip-media-image {
    position: relative;
    overflow: hidden;
}

.file-chip.analysis-pending .file-chip-media-image::after {
    content: "";
    position: absolute;
    inset: var(--analysis-overlay-inset, 4px);
    border-radius: var(--analysis-overlay-radius, 16px);
    pointer-events: none;
    background: linear-gradient(135deg, rgba(86, 86, 86, 0) 30%, rgba(174, 174, 174, 0.47) 50%, rgba(86, 86, 86, 0) 70%);    background-size: 260% 260%;
    background-repeat: no-repeat;
    z-index: 120548;
    animation: imageAnalysisSweep 3s cubic-bezier(0.22, 1, 0.36, 1) infinite;
    will-change: background-position;
}

.file-chip.file_upload_chip.upload-complete:hover{
  background-color: var(--file-btn-mobile-bg);
  border-color: var(--border-color-darker);

}

.fullscreenfileimageoverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 130700;
  padding: 24px;
  box-sizing: border-box;
}

.fullscreenfileimageoverlay.has-gallery {
  padding: 24px;
}

.fullscreenfileimageoverlay.hidden {
  display: none;
}

.mobileimageview{
  display: none;
  flex-direction: column;
  position: relative;
  background-color: transparent;
  z-index: 2;
}

.mobileimagebackdrop{
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 520ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 1;
}

.mobileimageviewtop{
  width: 100%;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  padding-top: 16px;
  color: #DCDCD6;
  z-index: 2;
}

.mobileimageviewbottom{
  width: 100%;
  box-sizing: border-box;
  position: absolute;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 12px;
  z-index: 2;
}

.iamgecarouselmobile{
  display: flex;
  gap: 6px;
  margin: 0 auto;
}

.iamgecarouselmobileimg{
  width: 30px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  opacity: 0.5; 
}

.iamgecarouselmobileimg.active{
  width: 45px;
  height: 45px;
  opacity: 1;
}

.mobileimageview .mobilebutton.dark{
  background-color: #282825;
  border: 1px solid #42423D;
  color: #DCDCD6;
  box-shadow: inset 0 0px 10px 0px rgba(255, 255, 255, 0.1);
}

.mobileimageview .mobilebutton.xtreme{
  margin-left: auto;
}

.mobileimageviewstage{
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
}

.mobileimageviewimg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  margin: auto 0;
  object-fit: contain;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.mobileimageviewimg-neighbor{
  display: none;
  opacity: 0;
  pointer-events: none;
}

.mobileimageviewimg-neighbor.is-visible{
  display: flex;
}

body.mobile-active #fullscreenFileImageOverlay {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background-color: transparent;
  transition: none;
}

.fullscreenfileimageoverlay.mobile-preview-open {
  background-color: transparent !important;
}

.fullscreenfileimageoverlay.mobile-preview-open .mobileimagebackdrop{
  display: block;
}

.fullscreenfileimageoverlay.mobile-preview-open:not(.mobile-backdrop-visible) .mobileimagebackdrop{
  background-color: rgba(0, 0, 0, 0);
}

.fullscreenfileimageoverlay.mobile-preview-open.mobile-backdrop-visible .mobileimagebackdrop{
  background-color: rgba(0, 0, 0, 1);
}

body.mobile-active #fullscreenFileImageOverlay .fullscreenfileimagepopup {
  display: none;
}

body.mobile-active #fullscreenFileImageOverlay .mobileimageview {
  display: flex;
  position: fixed;
  inset: 0;
}

body.mobile-active #fullscreenFileImageOverlay .mobileimageviewtop,
body.mobile-active #fullscreenFileImageOverlay .mobileimageviewbottom,
body.mobile-active #fullscreenFileImageOverlay .mobileimageviewimg {
  opacity: 1;
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mobile-active #fullscreenFileImageOverlay .mobileimageview.is-opening .mobileimageviewtop,
body.mobile-active #fullscreenFileImageOverlay .mobileimageview.is-opening .mobileimageviewbottom {
  opacity: 0;
}

body.mobile-active #fullscreenFileImageOverlay .mobileimageview.zoom-ui-hidden .mobileimageviewtop,
body.mobile-active #fullscreenFileImageOverlay .mobileimageview.zoom-ui-hidden .mobileimageviewbottom {
  opacity: 0;
  pointer-events: none;
}

body.mobile-active #fullscreenFileImageOverlay .mobileimageview.is-opening .mobileimageviewimg,
body.mobile-active #fullscreenFileImageOverlay .mobileimageview.media-opening .mobileimageviewimg {
  opacity: 0;
}

.mobileimageview-open-ghost{
  position: fixed;
  object-fit: cover;
  z-index: 130702;
  pointer-events: none;
  will-change: left, top, width, height, border-radius, opacity;
}

.fullscreenfileimagepopup {
  --fullscreen-gallery-space: 0px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  max-width: min(100%, 1100px);
  max-height: calc(100vh - 48px);
}

.fullscreenfileimagepopup.has-gallery {
  --fullscreen-gallery-space: 120px;
}

.fullscreenimage {
  display: flex;
  max-width: min(100vw - 48px, 1100px);
  max-height: min(700px, calc(100vh - 48px - var(--fullscreen-gallery-space)));
  border-radius: 8px;
  object-fit: contain;
  background: var(--background-color);
}

.controlsimagepopup {
  gap: 8px;
  z-index: 2;
  position: absolute;
  display: flex;
  top: 16px;
  right: 16px;
}

.circle-btn.control {
  margin: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  flex: 0 0 40px;
  border-radius: 13px;
  border: none;
  background: var(--image-controls);
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
  padding: 0;
  box-sizing: border-box;
  line-height: 1;
  font-size: 0;
  appearance: none;
  -webkit-appearance: none;
  transform: none !important;
}

.circle-btn.control:hover {
  background: var(--input-border);
  transform: none !important;
}

.circle-btn.control:active {
  transform: none !important;
}

.circle-btn.outline{
  background-color: transparent;
  border: 1px solid var(--border-color-lighter);
  color: var(--text-color);
}

.circle-btn.outline:hover{
  background: var(--hover-color);
  border-color: transparent;
}

.send-icon {
  width: 20px;
  height: 20px;
}

.send-icon2 {
  width: 18px;
  height: 18px;
}

.imagepreviewbtn {
  background-color: transparent;
  border: none;
  border-radius: 13px;
  height: 95px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: background-color 0.2s ease;
  flex: 0 0 auto;
  cursor: pointer;
}

.imagepreviewbtn:hover,
.imagepreviewbtn.is-active {
  background-color: var(--image-controls);
}

.imagepreviewbtn:hover .imagepreview {
  outline: none;
}

.imagepreview {
  outline: 1px solid #fff;
  border-radius: 8px;
  display: flex;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.imagepreviewbtn.is-active .imagepreview {
  outline: none;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-progress-shell {
    position: absolute;
    top: 50%;
    left: 49%;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%) rotate(-90deg);
    display: none;
    z-index: 3;
    pointer-events: none;
    overflow: visible;
    filter: drop-shadow(0 4px 12px var(--image-overlay-shadow, rgba(0, 0, 0, 0.2)));
}

:is(.file-preview-row, .mobile-file-row) .file-chip-progress-track,
:is(.file-preview-row, .mobile-file-row) .file-chip-progress-ring {
    fill: none;
    stroke-width: 2.5;
    cx: 18;
    cy: 18;
    r: 15;
}

:is(.file-preview-row, .mobile-file-row) .file-chip-progress-track {
    stroke: var(--image-overlay-track, rgba(255, 255, 255, 0.24));
}

:is(.file-preview-row, .mobile-file-row) .file-chip-progress-ring {
    stroke: var(--image-overlay-fg, #ffffff);
    stroke-linecap: round;
    stroke-dasharray: 94.2478;
    stroke-dashoffset: 94.2478;
    transition: stroke-dashoffset 0.18s ease;
}

:is(.file-preview-row, .mobile-file-row) .file-chip.loading .file-chip-progress-shell {
    display: block;
}

.add-file-btn {
  background-color: transparent;
  color: var(--text-color);
}
/* Add-file button styling */
.add-file-btn:hover {
    background: var(--hover-color);
}

/* ===== CENTERED 400×500 DROP ZONE ===== */
.file-drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25); /* translucent backdrop */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 120200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

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

.file-drop-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    gap: 16px;
}

.file-drop-content .file_dropdown_svg {
    height: 142px;
    width: 129px;
}

.file-drop-text {
    font-size: 20px;
    font-weight: 600;
}

/* ===========================
   RED FILE TYPE ERROR BOX
=========================== */

.file-type-error-overlay {
    position: fixed;
    top: 0; left: 0; right:0; bottom:0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.file-type-error-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.file-error-content {
    width: 380px;
    height: 150px;
    background: #ffe5e5;
    border: 3px dashed #d10000;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.file-error-content svg {
    width: 50px;
    height: 50px;
    color: #d10000;
}

.file-error-text {
    font-size: 18px;
    font-weight: 600;
    color: #b00000;
    text-align: center;
}

.chat-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.chat-file-item {
    background: rgba(0,0,0,0.05);
    padding: 6px 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-file-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: rgba(0,0,0,0.7);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.chat-file-item:not(.loading) .chat-file-spinner {
    display: none;
}

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

.chat-attachments {
    display: flex;
    margin-left: auto;
    flex-direction: column;
    max-width: 440px;
    width: 100%;
    gap: 10px;
    margin-bottom: 2px;
}

.chat-attachment {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.05);
    padding: 10px;
    border-radius: 12px;
}

.chat-attachment-name {
    font-weight: 600;
}

.chat-attachment-type {
    font-size: 12px;
    opacity: 0.6;
}

.chat-attachments.chat-attachments-new {
    gap: 8px;
    margin-bottom: 2px;
}

.chat-attachments.chat-attachments-new .chat-attachment-image-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
}

.message.bot .chat-attachments.generated-image-attachment {
    margin-left: 0;
    margin-right: auto;
    align-self: flex-start;
}

.chat-attachments.chat-attachments-new .chat-attachment-image-grid.is-multi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
}

.message.bot .chat-attachments.generated-image-attachment .chat-attachment-image-grid {
    margin-left: 0;
    margin-right: auto;
}

.chat-attachments.chat-attachments-new .chat-attachment-file-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, 98px);
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    justify-content: flex-end;
}

.chat-attachments.chat-attachments-new .file-chip.file-chip-image-new,
.chat-attachments.chat-attachments-new .file-chip.file-chip-image-new-file,
.chat-attachments.chat-attachments-new .file-chip.file-chip-new {
    position: relative;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    border-radius: 21px;
    overflow: hidden;
}

.chat-attachments.chat-attachments-new .file-chip.file-chip-image-new {
    display: inline-block;
    width: auto;
    max-width: 100%;
}

.chat-attachments.chat-attachments-new .file-chip.file-chip-image-new-file {
    display: block;
    width: 100%;
    border-radius: 16px;
}

.chat-attachments.chat-attachments-new .file-chip-media-image {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    overflow: hidden;
}

.chat-attachments.chat-attachments-new .file-chip-box-image {
    width: auto;
    max-width: calc(100% - 8px);
    height: auto;
    max-height: 320px;
    object-fit: contain;
    border-radius: 17px;
    clip-path: inset(0 round 17px);
    margin: 4px;
    cursor: zoom-in;
    display: block;
    position: relative;
    z-index: 1;
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

.chat-attachments.chat-attachments-new .file-chip-box-image-file {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    clip-path: inset(0 round 12px);
    margin: 0;
    cursor: zoom-in;
    display: block;
    position: relative;
    z-index: 1;
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

.chat-attachments.chat-attachments-new .chat-attachment-image-placeholder {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
      96deg,
      var(--skeleton-base) 0%,
      var(--skeleton-highlight) 50%,
      var(--skeleton-base) 100%
    );
    background-size: 260% 100%;
    animation: skeletonShimmer 1.85s linear infinite;
    overflow: hidden;
    clip-path: inset(0 round inherit);
    z-index: 120548;
    opacity: 1;
    transition: opacity 360ms ease, filter 360ms ease;
    will-change: opacity, filter;
}

.chat-attachments.chat-attachments-new .chat-attachment-image-placeholder.is-single {
    inset: 4px;
    border-radius: 17px;
}

.chat-attachments.chat-attachments-new .chat-attachment-image-placeholder.is-multi {
    inset: 0;
    border-radius: 12px;
}

.chat-attachments.chat-attachments-new .chat-attachment-image-placeholder.is-generating-image {
    inset: 4px;
    border-radius: 17px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(2px);
    background: transparent;
    animation: none;
}

.chat-attachments.chat-attachments-new .chat-attachment-image-placeholder.is-generating-image .generated-image-noise {
    opacity: 1;
}

.chat-attachments.chat-attachments-new .generated-image-frame {
    width: 100%;
    max-height: 320px;
    min-height: 170px;
    position: relative;
}

.chat-attachments.chat-attachments-new .generated-image-noise {
    width: 100%;
    height: 100%;
    display: block;
    filter: blur(8px) saturate(0.8);
    transform: scale(1.12);
    transform-origin: center;
    animation: generatedNoiseDrift 2.6s ease-in-out infinite alternate;
    opacity: 0.92;
    transition: opacity 360ms ease, filter 360ms ease, transform 360ms ease;
    will-change: opacity, filter, transform;
}

@keyframes generatedNoiseDrift {
    from { transform: scale(1.12) translate3d(-2%, -1%, 0); }
    to { transform: scale(1.15) translate3d(2%, 1%, 0); }
}

.chat-attachments.chat-attachments-new .file-chip.is-image-loading .file-chip-box-image,
.chat-attachments.chat-attachments-new .file-chip.is-image-loading .file-chip-box-image-file {
    opacity: 0;
    filter: blur(12px);
    transform: scale(1.015);
}

.chat-attachments.chat-attachments-new .file-chip.is-image-loading.is-reveal-transition .file-chip-box-image,
.chat-attachments.chat-attachments-new .file-chip.is-image-loading.is-reveal-transition .file-chip-box-image-file {
    opacity: 1;
    filter: blur(11px);
    transform: scale(1.01);
}

.chat-attachments.chat-attachments-new .file-chip.is-image-loading.is-reveal-transition.is-reveal-active .file-chip-box-image,
.chat-attachments.chat-attachments-new .file-chip.is-image-loading.is-reveal-transition.is-reveal-active .file-chip-box-image-file {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

.chat-attachments.chat-attachments-new .file-chip .file-chip-box-image,
.chat-attachments.chat-attachments-new .file-chip .file-chip-box-image-file {
    transition: opacity 420ms ease, filter 480ms ease, transform 480ms ease;
}

.chat-attachments.chat-attachments-new .chat-attachment-image-placeholder.is-fading-out {
    opacity: 0;
    filter: blur(10px);
}

.chat-attachments.chat-attachments-new .chat-attachment-image-placeholder.is-fading-out .generated-image-noise {
    opacity: 0;
    filter: blur(14px) saturate(0.9);
    transform: scale(1.02);
}

.chat-attachments.chat-attachments-new .file-chip.file-chip-new {
    display: flex;
    align-items: center;
    width: 300px;
    max-width: 100%;
    min-height: 66px;
    padding-right: 8px;
    margin-left: auto;
}

.chat-attachments.chat-attachments-new .file-chip-media-file {
    width: 60px;
    height: 60px;
    margin-left: 1px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-attachments.chat-attachments-new .file-chip-box {
    width: 60px;
    height: 60px;
    min-width: 50px;
    object-fit: cover;
    border-radius: 18px;
    display: block;
}

.chat-attachments.chat-attachments-new .file-chip-title {
    color: var(--text-color);
    font-weight: 600;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
}

.chat-attachments.chat-attachments-new .file-chip-sub {
    color: var(--med-text);
    font-size: 0.9rem;
}

.file-chip-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent, #d1d1d1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.chat-attachment-chips {
   display: flex;
    margin-left: auto;
    flex-direction: column;
    max-width: 400px;
    gap: 10px;
    margin-bottom: 10px;
}

.file-chip-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chip-svg {
    width: 18px;
    height: 18px;
    color: var(--contrast-color);
}

/* Colors */
.file-doc {
    background-color: #3b82f6; /* Blue */
}

.file-xls {
    background-color: #22c55e; /* Green */
}

.file-img {
    background-color: #ec4899; /* Pink */
}

.file-txt {
    background-color: #64748b; /* Gray */
}

.disabled-btn {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

/* Prevent overflow for bot messages */
.message.bot {
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Also fix markdown rendering of long content */
.message.bot * {
    max-width: 100%;
    overflow-wrap: break-word;
}

.message pre {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
    max-width: 100%;
}

.slanter-codeblock {
    margin: 12px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: visible;
    position: relative;
    background: var(--input-bg);
    max-width: 100%;
}

.slanter-codeblock.thinking {
    box-sizing: border-box;
    margin: 0;
    font-size: 0.82rem;
}

.slanter-codeblock-io-block {
    margin: 8px;
    background: var(--file-btn-mobile-bg-trans);
    overflow: hidden;
    border-radius: 5px;
}

.slanter-codeblock-io-block .slanter-codeblock-header {
    background: transparent;
}

.slanter-codeblock-io-block pre code {
    /* .message code (a less specific but later-declared rule elsewhere)
       sets white-space: pre-wrap globally for any <code> inside a message —
       since this block never overrode white-space itself, that wrap value
       won by default despite this selector's higher specificity (the
       cascade resolves per-property, not per-rule-block). That's what was
       causing long lines to wrap inside the panel instead of scrolling
       horizontally via the overflow-x:auto already set up below. */
    white-space: pre !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-height: 200px;
    background: transparent !important;
    --sb-track-color: transparent !important;
}

.slanter-codeblock-io-block pre code::-webkit-scrollbar-thumb {
  border-color: var(--code-ouput-bg) !important;
}


.slanter-codeblock:hover .slanter-codeblock-copy.collection_box_threedot{
  visibility: visible;
}

.slanter-codeblock-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    min-height: 38px;
    padding: 8px 14px 6px 14px;
    background: var(--input-bg);
    user-select: none;
    border-radius: 10px 10px 0 0;
}

.slanter-codeblock-language {
    font-family: 'Slanter-Sans', sans-serif;
    font-weight: 300;
    color: var(--light-text);
    font-size: 0.8rem;
    text-transform: lowercase;
}

.slanter-codeblock-sticky-actions {
    position: sticky;
    top: var(--codeblock-copy-sticky-top, 0px);
    right: 0;
    z-index: 9;
    width: 100%;
    height: 38px;
    margin-bottom: -38px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 8px 8px 0 0;
    box-sizing: border-box;
    pointer-events: none;
}

body.mobile-active .slanter-codeblock-sticky-actions {
    top: calc(var(--mobile-top-fade-h, 78px) + env(safe-area-inset-top, 0px) + 8px);
}

.slanter-codeblock-copy.collection_box_threedot {
    background: var(--input-bg);
    margin-left: 0;
    transform: none;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

.slanter-codeblock-copy.collection_box_threedot:hover {
  background-color: var(--sidebar-color) !important;
}

.slanter-codeblock-copy .slanter-copy-icon,
.slanter-codeblock-copy .slanter-copy-check {
  position: absolute;
  margin: auto;
  width: 20px;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.slanter-codeblock-copy .slanter-copy-icon {
  opacity: 1;
  transition: opacity 0.1s ease;
}

.slanter-codeblock-copy .slanter-copy-check {
  width: 80%;
  height: 80%;
  transform: scale(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.slanter-codeblock-copy.is-copied .slanter-copy-icon {
  opacity: 0;
}

.slanter-codeblock-copy.is-copied .slanter-copy-check {
  transform: scale(1);
}

.slanter-codeblock-copy.collection_box_threedot.is-copied {
  visibility: visible;
}

.slanter-codeblock pre {
    margin: 0;
    border: 0;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.message code {
    font-family: "JetBrains Mono", "Consolas", monospace;
    white-space: pre-wrap;
    font-size: 0.9rem;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--sidebar-color);
    color: var(--dark-red-text);
}

.message pre code {
    display: block;
    padding: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 0 0 10px 10px;
    background-clip: padding-box;
    --sb-track-color: var(--input-bg);
    --sb-thumb-color: var(--sidebar-color);
    --sb-size: 13px;
}

.message pre code::-webkit-scrollbar {
  width: 0;
  height: var(--sb-size);
}

.message pre code::-webkit-scrollbar-track {
  background: var(--sb-track-color);
  border-radius: 9px;
}

.message pre code::-webkit-scrollbar-thumb {
  background: var(--sb-thumb-color);
  border-radius: 9px;
  border: 3px solid var(--input-bg);
}

.hljs {
    background: var(--input-bg) !important;
}

.message pre code.hljs {
    border: none !important;
    display: block;
    color: var(--text-color);
    padding: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 0 0 10px 10px;
}

@supports not selector(::-webkit-scrollbar) {
  .message pre code {
    scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
  }
}

/* =========================
   ACCOUNT SETTINGS OVERLAY
   ========================= */

#settingsPanel {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);   /* dark glass over chat */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

#settingsPanel.open {
  opacity: 1;
  pointer-events: auto;
}

.settings-panel-inner {
  background: var(--background-color);
  border-radius: 24px;
  padding: 22px 24px 18px;
  width: 520px;
  max-width: calc(100% - 40px);
  max-height: 90vh;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* header + description */

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.settings-header h2 {
  margin: 0;
  font-size: 1.1rem;
}
.settings-header p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}
/* pill buttons (back / cancel / save) */

.settings-back-btn,
.settings-pill-btn {
  border-radius: 999px;
  padding: 7px 16px;
  border: 1px solid #e5e7eb;
  background: var(--background-color);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.settings-back-btn:hover,
.settings-pill-btn:hover {
  background: #f3f4f6;
}

/* black primary pill (Save / Next) */

.settings-pill-btn.primary {
  background: var(--contrast);
  border-color: var(--contrast);
  color: var(--background-color);
}

.settings-pill-btn.primary:hover {
  background: #111827;
}

/* sections (Profile / Appearance / Password / Danger) */

.settings-section {
  background: var(--background-color);
  border-radius: 24px;
  border: 1px solid #f3f4f6;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.settings-section h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

/* layout inside sections */

.settings-grid {
  display: flex;
  gap: 12px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.settings-field label,
.settings-row label {
  font-size: 0.8rem;
  color: #6b7280;
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* inputs */

.settings-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 0.9rem;
  box-sizing: border-box;
  background: var(--background-color);
}

.settings-input:focus {
  outline: none;
  border-color: #111827;
}

/* email + theme controls */

.email-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.settings-toggle-row {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.toggle-pill {
  border-radius: 999px;
  padding: 5px 18px;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  cursor: pointer;
}

.toggle-pill.active {
  background: var(--contrast);
  color: var(--background-color);
}

/* avatar color dots */

.color-dot-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
}

.color-dot.selected {
  border-color: #111827;
}

.settings-hint {
  font-size: 0.75rem;
  color: #6b7280;
}

/* footer buttons row */

.settings-footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Danger zone */

.danger-zone {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.danger-btn {
  align-self: flex-start;
  border-radius: 999px;
  padding: 9px 18px;
  border: 1px solid #d93025;
  background: transparent;
  color: #d93025;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.danger-btn:hover {
  background: rgba(217, 48, 37, 0.06);
}

/* subviews (Change email / password / delete) */

.settings-subview {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#settingsMainView.hidden,
#settingsEmailView.hidden,
#settingsPasswordView.hidden,
#settingsDeleteView.hidden {
  display: none;
}

#settingsMainView {
  max-height: 70vh;
  overflow-y: auto;
}

.subview-title {
  margin: 4px 0 2px;
  font-size: 1rem;
}

.subview-subtitle,
.settings-danger-text {
  font-size: 0.82rem;
  color: #6b7280;
}

/* Change email button */
#settingsChangeEmailBtn {
    border-radius: 999px;
    padding: 7px 18px;
    font-size: 0.85rem;
    background: var(--contrast);
    color: var(--background-color);
    border: none;
}

#settingsChangeEmailBtn:hover {
    background: #111;
}

/* Red pill button inside delete subpage */
#deleteNext {
    border-radius: 999px;
    padding: 8px 20px;
    background: var(--red-text);
    color: var(--contrast-color);
    border: 1px solid var(--red-text);
    font-weight: 500;
    font-size: 0.9rem;
}

#deleteNext:hover {
    background: var(--red-text);
}

/* Make subpages match main settings card size */
#settingsEmailView,
#settingsPasswordView,
#settingsDeleteView {
    width: 100%;
    flex: 1;
}

/* Make subpages match main view height */
.settings-panel-inner {
    display: flex;
    flex-direction: column;
}

.settings-subview {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* unified card wrapper for main view + subviews */
.settings-content-card {
    background: var(--background-color);
    border-radius: 24px;
    border: 1px solid #f3f4f6;
    padding: 26px 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    box-sizing: border-box;
}

/* =========================
   ACCOUNT SETTINGS OVERLAY
   ========================= */

.settings-panel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

/* open state */
.settings-panel.open {
    opacity: 1;
    pointer-events: auto;
}

/* main card */
.settings-panel-inner {
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 80px);
    background: var(--background-color);
    border-radius: 24px;
    padding: 24px 24px 18px;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.33);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* header row */
.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.settings-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.settings-header p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* shared card area (main + subpages) */
.settings-content-card {
    background: #fafafa;
    border-radius: 24px;
    padding: 22px 20px;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
}

/* sections inside card */
.settings-section {
    background: var(--background-color);
    border-radius: 20px;
    padding: 18px 18px 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-section h3 {
    margin: 0;
    font-size: 1.02rem;
}

/* grid for first/last name */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

/* simple row (email, etc.) */
.settings-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-field label {
    font-size: 0.82rem;
    font-weight: 500;
}

/* input style matches site */
.settings-input {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    font-size: 0.9rem;
    outline: none;
    background: var(--background-color);
}

.settings-input:disabled {
    background: #f3f4f6;
    color: #6b7280;
}

.settings-input:focus {
    border-color: #111827;
}

/* email row (input + button) */
.email-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* theme pills */
.settings-toggle-row {
    display: flex;
    padding: 4px;
    border-radius: 999px;
    background: #f3f4f6;
    gap: 4px;
}

.toggle-pill {
    flex: 1;
    border-radius: 999px;
    padding: 7px 10px;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    background: transparent;
}

.toggle-pill.active {
    background: var(--contrast);
    color: var(--background-color);
}

/* avatar colors */
.color-dot-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.color-dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
}

.color-dot.selected {
    border-color: var(--contrast);
}

.settings-hint {
    font-size: 0.78rem;
    color: var(--text-light);
}

/* footer buttons (cancel/save) */
.settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* back + pill buttons */
.settings-back-btn,
.settings-pill-btn {
    border-radius: 999px;
    padding: 9px 16px;
    border: 1px solid #e5e7eb;
    background: var(--background-color);
    font-size: 0.86rem;
    cursor: pointer;
}

.settings-back-btn {
    white-space: nowrap;
}

/* primary pill */
.settings-pill-btn.primary {
    background: var(--contrast);
    color: var(--background-color);
    border-color: var(--contrast);
}

/* red pill for delete / send code */
.settings-pill-btn.danger {
    background: var(--red-bg);
    border-color: var(--red-text);
    color: var(--red-text);
}

/* password & danger sections */
.password-section .settings-pill-btn.primary {
    width: 100%;
    justify-content: center;
}

.danger-zone {
    border-top: 1px solid #e5e5e5;
    margin-top: 10px;
    padding-top: 10px;
}

/* main delete button */
.danger-btn {
    width: 180px;
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--background-color);
    color: var(--red-text);
    border: 1px solid var(--red-bg);
    font-size: 0.86rem;
    cursor: pointer;
}

/* responsive */
@media (max-width: 640px) {
    .settings-panel {
        padding: 24px 10px;
    }

    .settings-panel-inner {
        padding: 18px 16px 14px;
        border-radius: 20px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .email-row {
        flex-direction: column;
        align-items: stretch;
    }

    .danger-btn {
        width: 100%;
    }
}

/* Toast popups */
.toast-container {
  position: fixed;
  z-index: 1300000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast-container-limit {
  left: 50%;
  transform: translateX(-50%);
  width: min(765px, calc(100vw - 32px));
}

body.mobile-active .toast-container-limit {
  left: 50%;
  transform: translateX(-50%);
  width: min(765px, calc(100vw - 24px));
}

.toast-container-top {
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(765px, calc(100vw - 32px));
}

.toast-container-top-right {
  top: calc(var(--slanter-topbar-h, 64px) + 12px);
  right: 24px;
  width: min(365px, calc(100vw - 32px));
  align-items: flex-end;
}

.Toast {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 21px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  max-width: 765px;
  width: 100%;
  box-sizing: border-box;
  pointer-events: auto;
  opacity: 0;
  transform: translate3d(0, -6px, 0);
  transition: opacity 160ms ease, transform 160ms ease;
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.Toast.show {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.Toast.ChatComplete {
  gap: 4px;
  border-radius: 13px;
  max-width: 365px;
  transform: translate3d(120%, 0, 0);
  transition: opacity 190ms ease, transform 190ms ease;
  cursor: pointer;
}

.Toast.ChatComplete.show {
  transform: translate3d(0, 0, 0);
}

.Toast.ChatComplete .ToastChatCompleteTitle,
.Toast.ChatComplete .ToastChatCompletePreview {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.Toast.ChatComplete:hover {
  background-color: var(--input-darker-bg);
}

.Toast.Limit {
  flex-direction: row;
  align-items: center;
  gap: clamp(8px, 2vw, 16px);
  min-width: 0;
  max-width: none;
}

.ToastText {
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.35;
}

.ToastText.Bold {
  font-weight: 600;
}

.ToastText.Sub {
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--med-text);
}

.ToastText.Error {
  color: var(--red-text);
}

.linktext {
  font-size: 1rem;
  color: var(--link-color);
  cursor: pointer;
}

.linktext:hover {
  text-decoration: underline;
}

.ToastErrorBottom {
  align-items: center;
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.ToastErrorSvg {
  color: var(--red-bg-transp-2);
  width: 18px;
  display: flex;
  flex: 0 0 18px;
}

.ToastText.ErrorMSG {
  color: var(--red-bg-transp-2);
}

.ToastLimitLeft {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.ToastLimitRight {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.CTABlack {
  height: 40px;
  color: var(--contrast-text);
  background-color: var(--contrast);
  border: none;
  border-radius: 13px;
  padding: 10px 15px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.Toast.Error.mobile{
  background-color: var(--red-bg-not-transp);
  border: 1px solid rgba(224, 62, 51, 0.3);
  width: 100%;
  max-width: none;
  border-radius: 24px;
  box-sizing: border-box;
  justify-self: center;
}

.Toast.Limit.mobile{
  flex-direction: column;
  width: 100%;
  gap: 12px;
  border-radius: 24px;
  box-sizing: border-box;
  justify-self: center;
}

.Toast.mobile {
  position: relative;
}

.Toast.mobile::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 44px;
  pointer-events: auto;
}

.ToastText.mobile{
  font-size: 1.1rem;
}

.ToastLimitRight.mobile{
  flex-wrap: nowrap;
  margin: 0;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
}

.CTABlack.mobile{
  display: flex;
  width: 100%;
  height: 45px;
  border-radius: 16px;
  border: none;
  background-color: var(--contrast);
  font-size: 1.1rem;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--contrast-text);
  justify-content: center;
}

.CTABlack.mobile.Grey{
  background-color: var(--file-btn-mobile-bg);
  color: var(--text-color);
}

.CTABlack.mobile.Grey{
  margin-top: auto;
}

.CTABlack.mobile.Red {
  background-color: var(--red-text);
  color: var(--contrast-color);
}

@media (max-width: 700px) {
  .Toast.Limit {
    flex-direction: column;
    align-items: stretch;
  }

  .ToastLimitRight {
    margin-left: 0;
    justify-content: flex-start;
  }
}

.message.bot.toast-inline-host {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
  border-radius: 0;
  line-height: 1.2;
  overflow: visible;
  animation: none;
}

.message.bot.toast-inline-host::before {
  display: none;
}

.message.bot.toast-inline-host .Toast {
  max-width: none;
}

.toast-test-panel {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 1000000;
  display: flex;
  gap: 8px;
}

.toast-test-btn {
  height: 34px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-color);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.toast-test-btn:hover {
  background: var(--hover-color);
}

/* --- Bot message actions (copy / regenerate / dislike) --- */

.bot-actions-row {
    display: flex !important;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 12px;
    opacity: 1 !important;
    height: auto !important;
}

/* -------- BOT ACTION BUTTONS (copy / regen / dislike) -------- */

.bot-actions-row {
    display: flex !important;
    gap: 10px;
    margin: 8px 0 14px 0;
    padding-left: 4px;
    align-items: center;
}

/* Filled dislike state */
.bot-action-btn.liked svg {
    fill: #e53935 !important;
    stroke: #e53935 !important;
    opacity: 1 !important;
}

.user-tier {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

/* -------- BOT ACTION BUTTONS (copy / regen / dislike) -------- */

.bot-actions-row {
    display: flex !important;
    gap: 10px;
    margin: 8px 0 14px 0;
    align-items: center;

}

/* Filled dislike state */
.bot-action-btn.liked svg {
    fill: #e53935 !important;
    stroke: #e53935 !important;
    opacity: 1 !important;
}

.user-tier {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

/* =========================
   MLA Citation Pill (stacked)
========================= */

.citation-pill {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.citation-pill-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    max-height: 16px;
    padding: 12px 9px;
    padding-right: 12px;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: var(--background-color);
    transition: background 0.15s ease, transform 0.1s ease;
    width: fit-content;
    cursor: pointer;
}

.citation-pill-inner:hover {
  background-color: var(--border-color);
}

.citation-pill-inner:hover .citation-favicon {
  border-color: var(--border-color);
}

.citation-favicon-stack {
  margin-left: 12px;
  display: flex;
  align-items: center;
}

.citation-favicon {
  align-self: center;
  display: flex;
  width: 18px;
  height: 18px;
  border-radius: 8px;
  border: 3px solid var(--background-color);
  background: #fff;
  margin-left: -13px;
  transition: margin 0.15s ease, transform 0.15s ease, border 0.15s ease;
}

.citation-label {
  display: flex;
  color: var(--med-light-text);
  font-size: 14px;
  white-space: nowrap;
}


.citation-pill-open {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 20;
}

.citation-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.citation-label-text {
  display: inline-flex;
  color: var(--contrast);
  font-size: 14px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.citation-label-text:hover {
  color: var(--contrast);
  text-decoration: underline;
  cursor: pointer;
}

.citation-link-icon {
  color: var(--med-light-text);
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.citation-link-button {
  display: inline-flex;
  align-items: center;
  background-color: var(--background-color);
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.15s ease;
}

.citation-link-button:hover {
  background-color: var(--hover-color);
}

.citation-link-button:hover .citation-label {
 color: var(--contrast);
}

.citation-link-button:hover .citation-link-icon {
 color: var(--contrast);
}

.bot-actions-row .citation-pill {
    margin-left: 2px !important;
}

body:not(.mobile-active) .mobileFileSlideupRoot {
  display: none !important;
}

/* ================================
   MOBILE-ONLY CHAT INPUT + SIDEBAR
================================ */
@media (max-width: 900px) {

  .mobile-sources-action-row {
    display: flex;
    margin: 2px 0 0 0;
  }

  .mobileSourcesBtn{
    user-select: none;
    background-color: transparent;
    border-radius: 16px;
    display: flex;
    border: 1px solid var(--border-color);
    align-items: center;
    margin-left: 16px;
    padding: 10px;
    width: fit-content;
    gap: 10px;
    height: 21px;
    align-items: center;
    cursor: pointer;
    transform: scale(1);
    transition: transform 0.14s ease;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
  }

  body.mobile-active .mobileSourcesBtn:active {
    transform: scale(1.2);
  }

  body.mobile-active .bot-action-btn {
    transform: scale(1);
    transition: background 0.15s ease, color 0.15s ease, transform 0.14s ease;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
  }

  body.mobile-active .bot-action-btn:hover {
    background: transparent;
    color: var(--light-text);
    opacity: 1;
  }

  body.mobile-active .bot-action-btn:active {
    transform: scale(1.3);
  }

  .mobileSourcesicons{
    display: flex;
  }

  .mobileSourcesfavicon{
    display: flex;
    border: 3px solid var(--background-color);
    background-color: #fff;
    border-radius: 8px;
    margin-left: -17px;
    width: 18px;
    height: 18px;
    object-fit: cover;
  }

  .mobileSourcesfavicon.first{
    margin-left: -1px;
  }

  .mobileSourcesBtnText {
    color: var(--med-light-text);
    font-size: 0.95rem;
    line-height: 1;
  }

  body.mobile-active .file-preview-stack {
      display: none !important;
  }

  /* Hide desktop inputs only when mobile UI mode is active */
  body.mobile-active .input-container,
  body.mobile-active .input-container-centered {
      display: none !important;
  }

  /* Show mobile bar only in mobile UI mode */
  body.mobile-active #mobileInputBar {
      display: block;
  }

  /* Fixed bottom pill */
  #mobileInputBar {
      position: fixed;
      left: 0;
      bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
      top: auto;
      transform: none;
      width: 100vw;
      padding: 0 10px;
      box-sizing: border-box;
      z-index: 5000;
  }

  body.mobile-active #mobileInputBar {
      padding-bottom: 0;
  }

  .mobiletopbar{
      width: 100%;
      background-color: transparent;
      display: flex;
      flex-direction: row;
      gap: 10px;
      align-items: center;
  }

  .mobilebutton{
    align-items: center;
    justify-content: center;
      aspect-ratio: 1;
      height: 45px;
      border-radius: 40px;
      border: none;
      padding: 11px;
      display: flex;
      transform: scale(1);
      transform-origin: center;
      transition: transform 0.14s ease;
      will-change: transform;
      -webkit-tap-highlight-color: transparent;
      tap-highlight-color: transparent;
      -webkit-appearance: none;
      appearance: none;
  }

  .mobilebutton:active:not(:disabled),
  .mobilebutton.mobilebutton-pressed:not(:disabled) {
      transform: scale(1.3);
  }

  .mobilebutton:focus,
.mobilebutton:focus-visible {
      outline: none;
  }

  #mobileTopbarMenuBtn:disabled svg {
      opacity: 0.5;
  }

  .mobilebutton.grey{
      background-color: var(--input-bg);
      border: 1px solid var(--border-color);
      color: var(--text-color);
      box-shadow: var(--mobile-button-inset);
  }

  .mobilebutton.transp{
      background-color: transparent;
      color: #000;
  }

  .mobilebutton.transp.small{
      padding: 15px;
      height: 100px;
      background-color: transparent;
      color: #000;
  }

  .mobilebutton.black{
      background-color: #000;
      color: #ffffff;
  }

  .mobilebutton.red{
      padding: 8px;
      border: 1px solid rgba(233, 76, 76, 0.3);
      background-color: rgba(233, 76, 76, 0.15);
      color: #E94C4C;
  }

  .mobilebutton.black.small{
      padding: 20px;
      height: 100px;
      background-color: #000;
      color: #ffffff;
  }

  .mobilebutton.black.small.xtreme{
      padding: 20px;
      height: 100px;
      background-color: #000;
      color: #ffffff;
      margin-left: auto;
  }

  .mobiletopbartab{
      border: 1px solid var(--border-color);
      color: var(--text-color);
      font-size: 1.15rem;
      height: 45px;
      border-radius: 15px;
      justify-content: center;
      align-items: center;
      display: flex;
      flex-grow: 1;
  }

  .mobileinputbar{
      gap: 8px;
      display: flex;
      border: 1px solid #ccc;
      border-radius: 60px;
      padding: 15px;
      align-items: center;
  }

  .mobileinputbar.open{
      gap: 8px;
      display: flex;
      flex-direction: column;
      border: 1px solid #ccc;
      border-radius: 60px;
      padding: 15px;
      align-items: center;
  }

  .mobileinputbottom{
      display: flex;
      width: 100%;
  }

  .mobileinput{
      align-items: center;
      display: flex;
      flex-grow: 1;
      border: none;
      font-size: 3rem;
      outline: none;
      width: 100%;
      box-sizing: border-box;
  }

  .mobileinputplace{
      flex-grow: 1;
      font-size: 3rem;
      color: #a9a9a9;
  }

  #mobileInputBar .mobileinputbarclosedrow {
      display: flex;
      width: 100%;
      align-items: center;
      gap: 8px;
      max-height: 140px;
      opacity: 1;
      transform: translateY(0);
      transition:
          max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
          opacity 320ms cubic-bezier(0.33, 1, 0.68, 1),
          transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  #mobileInputBar.is-open .mobileinputbarclosedrow {
      max-height: 0;
      opacity: 0;
      transform: translateY(-10px);
      pointer-events: none;
  }

  .mobile-file-row {
      --file-preview-edge-fade: 28px;
      display: flex;
      align-items: flex-end;
      gap: 8px;
      overflow-x: scroll;
      overflow-y: hidden;
      scrollbar-width: thin;
      scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
      scrollbar-gutter: stable;
      margin-bottom: 6px;
      position: relative;
  }

  .mobile-pill {
      display: flex;
      align-items: flex-end;
      gap: 6px;
      background: var(--input-bg, var(--background-color));
      border-radius: 28px;
      border: 1px solid rgba(0,0,0,0.15);
      padding: 8px 10px;
      box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  }

  .mobile-pill-btn {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      border: none;
      background: transparent;
      padding: 0;
  }

  .mobile-pill-btn svg {
      width: 22px;
      height: 22px;
  }

  #mobileTextbox {
      flex: 1;
      border: none;
      resize: none;
      background: transparent;
      font-size: 16px;
      line-height: 20px;
      padding: 4px 0;
      max-height: 260px;         /* auto-grow up to here */
      overflow-y: auto;          /* scroll after this */
  }

  #mobileTextbox:focus {
      outline: none;
  }

  #mobileTextbox::-webkit-scrollbar {
      width: 0;
      height: 0;
  }

  #mobileSendBtn.hidden,
  #mobileVoiceBtn.hidden {
      display: none;
  }

  body.mobile-active.mobile-file-slideup-open #mobileInputBar,
  body.mobile-active.mobile-file-slideup-open #mobileFileRow,
  body.mobile-active.mobile-quiz-slideup-open #mobileInputBar,
  body.mobile-active.mobile-quiz-slideup-open #mobileFileRow,
  body.mobile-active.mobile-sources-slideup-open #mobileInputBar,
  body.mobile-active.mobile-sources-slideup-open #mobileFileRow {
      opacity: 0;
      pointer-events: none;
      transform: translateY(14px);
      transition: opacity 180ms ease, transform 220ms ease;
  }

  .mobileFileSlideupRoot {
      position: fixed;
      inset: 0;
      z-index: 120560;
      pointer-events: none;
      opacity: 0;
      transition: opacity 200ms ease;
  }

  .mobileFileSlideupRoot.open {
      pointer-events: auto;
      opacity: 1;
  }

  .mobileFileSlideupBackdrop {
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.24);
      opacity: 0;
      transition: opacity 200ms ease;
  }

  .mobileFileSlideupRoot.open .mobileFileSlideupBackdrop {
      opacity: 1;
  }

  .mobileFileSlideupPopup {
      --mobile-slideup-offset: calc(100% + 36px);
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      transform: translateY(var(--mobile-slideup-offset));
      transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
      font-size: 1.1rem;
      box-sizing: border-box;
      width: 100%;
      max-height: calc(100vh - 18px - env(safe-area-inset-top, 0px));
      overflow-y: hidden;
      background-color: var(--background-color);
      border-top-left-radius: 32px;
      border: 1px solid var(--border-color);
      border-top-right-radius: 32px;
      box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.12);
      padding: 16px;
      padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
      display: flex;
      flex-direction: column;
      touch-action: auto;
      border-bottom: none;
      will-change: transform;
  }

  .mobileFileSlideupPopup .mobilefilepopup_top {
    touch-action: none;
    flex: 0 0 auto;
    min-height: 45px;
    position: relative;
    z-index: 5;
  }

  .mobileFileSlideupListWrap {
    margin-top: 0;
    width: 100%;
    align-self: stretch;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    z-index: 1;
  }

  .mobileFileSlideupScrollList {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
    position: relative;
    z-index: 1;
  }

  .mobileFileSlideupPopup.no-transition {
      transition: none !important;
  }

  .mobilebutton.grey.absolute{
    position: absolute;
    top: 0px;
    left: 0px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
  }

  .mobilebutton.grey.right{
    position: absolute;
    top: 0px;
    right: 0px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
  }

  .mobilefilepopup_top_text{
    font-size: 1.3rem;
    color: var(--text-color);
    align-self: center;
  }

  .mobilefilepopup_top{
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .mobilefilepopup_mid{
    margin-top: 16px;
    display: flex;
    gap: 12px;
  }

  .mobilefilepopup_btm{
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    width: 100%;
    align-self: stretch;
  }

  .mobilefilepopup_optionbtn{
    color: var(--text-color);
    background-color: var(--file-btn-mobile-bg);
    border: none;
    border-radius: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    justify-content: center;
    gap: 4px;
    min-height: 85px;
    font-size: 1rem;
  }

  .mobilefilepopup_optionbtn_svg{
    width: 22px;
    height: 22px;
  }

  .mobilefilepopup_optionsection{
    width: 100%;
    gap: 12px;
    color: var(--text-color);
    border: none;
    background-color: transparent;
    border-top: 1px solid var(--border-color);
    padding: 20px 8px;
    font-size: 1.1rem;
    box-sizing: border-box;
    align-items: center;
    display: flex;
  }

  .mobilefilepopup_optionsection.bottom{
    border-bottom: 1px solid var(--border-color);
  }

  .mobileswitch{
    margin-left: auto;
  }

  .TextButtonMobile{
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--med-text);
    margin-left: auto;
  }

  .mobileCollectionSlideupRoot {
    z-index: 2147483608;
  }

  body.mobile-active.mobile-collection-slideup-open .main-area,
  body.mobile-active.mobile-collection-slideup-open .sidebar,
  body.mobile-active.mobile-collection-slideup-open #mobileSidebarOverlay {
    pointer-events: none !important;
  }

  body.mobile-active.mobile-collection-slideup-open #mobileCollectionSlideupRoot {
    pointer-events: auto !important;
  }

  .mobileSettingsSlideupRoot {
    z-index: 2147483609;
  }

  .mobileQuizSlideupRoot {
    z-index: 2147483610;
  }

  .mobileSourcesSlideupRoot {
    z-index: 2147483611;
  }

  body.mobile-active.mobile-quiz-slideup-open .main-area,
  body.mobile-active.mobile-quiz-slideup-open .sidebar,
  body.mobile-active.mobile-quiz-slideup-open #mobileSidebarOverlay {
    pointer-events: none !important;
  }

  body.mobile-active.mobile-quiz-slideup-open #mobileQuizSlideupRoot {
    pointer-events: auto !important;
  }

  body.mobile-active.mobile-sources-slideup-open .main-area,
  body.mobile-active.mobile-sources-slideup-open .sidebar,
  body.mobile-active.mobile-sources-slideup-open #mobileSidebarOverlay {
    pointer-events: none !important;
  }

  body.mobile-active.mobile-sources-slideup-open #mobileSourcesSlideupRoot {
    pointer-events: auto !important;
  }

  .mobileSourcesSlideupPopup {
    --mobile-slideup-offset: calc(100% + 36px);
    padding-bottom: 5px;
    overflow-y: hidden;
    touch-action: auto;
  }

  .mobileSourcesSlideupPopup .mobilefilepopup_top {
    touch-action: none;
    flex: 0 0 auto;
    min-height: 45px;
    position: relative;
    z-index: 5;
  }

  .mobileSourcesSlideupOption {
    cursor: pointer;
    text-align: left;
    border-top: 1px solid var(--border-color);
  }

  .mobileSourceSlideupTitle {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobileSourcesfaviconSmall{
    display: flex;
    border-radius: 6px;
    height: 18px;
    width: 18px;
    background-color: #fff;
    object-fit: cover;
  }

  .SmallerSlideUpText.sources{
    gap: 8px;
    display: flex;
    font-size: 0.95rem;
    align-items: center;
    color: #9F9F9F;
    margin-top: 2px;
  }

  .mobileQuizSlideupPopup {
    --mobile-slideup-offset: calc(100% + 36px);
    padding-bottom: 16px;
    touch-action: pan-y;
    overflow: hidden;
    overflow-x: hidden;
  }

  .mobileQuizSlideupPopup .mobilefilepopup_top{
    flex: 0 0 45px;
    min-height: 45px;
  }

  #mobileQuizSlideupContent {
    width: 100%;
    overflow: visible;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
  }

  .mobileQuizSlideupPopup .mobilefilepopup_btm {
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
    display: flex;
  }

  .quizboxmobile{
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 34px;
    background-color: var(--mobile-quiz-bg);
    box-shadow: 0 0 15px var(--black-shadow);
    padding: 16px;
    justify-items: center;
    gap: 16px;
    will-change: transform, opacity;
  }

  .mobilequizlayout{
    --mobile-quiz-side-pad: 16px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 16px;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: visible;
  }

  .mobilequizswipestage{
    position: relative;
    overflow: visible;
    touch-action: pan-y;
    --mobile-quiz-swipe-gap: 22px;
    margin-inline: calc(-1 * var(--mobile-quiz-side-pad));
    padding-inline: var(--mobile-quiz-side-pad);
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
  }

  .mobilequizswipestage.is-animating .mobilequizpage,
  .mobilequizswipestage.is-swiping .mobilequizpage{
    pointer-events: none !important;
  }

  .mobilequizswipestage.is-swiping .mobilequizpage{
    transition: none !important;
  }

  .mobilequizswipestage.swipe-bounce-left{
    animation: mobileQuizSwipeBounceLeft 260ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mobilequizswipestage.swipe-bounce-right{
    animation: mobileQuizSwipeBounceRight 260ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mobilequizpage{
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
    will-change: transform, opacity;
    width: 100%;
    box-sizing: border-box;
    height: 100%;
  }

  .quizboxmobile.mobilequizpage{
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .mobilequizpage.prev,
  .mobilequizpage.next{
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--mobile-quiz-side-pad);
    right: var(--mobile-quiz-side-pad);
    width: auto;
    pointer-events: none;
    z-index: 1;
  }

  .mobilequizpage.prev{
    transform: translate3d(calc(-100% - var(--mobile-quiz-swipe-gap)), 0, 0);
    opacity: 0.34;
  }

  .mobilequizpage.next{
    transform: translate3d(calc(100% + var(--mobile-quiz-swipe-gap)), 0, 0);
    opacity: 0.34;
  }

  .mobilequizpage.current{
    position: relative;
    z-index: 2;
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }

  .quizoptionsmobile{
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 0 0 auto;
  }

  .quiztitlemobile{
    font-family: "artifex-cf", serif;
    color: var(--text-color);
    word-break: auto-phrase;
    font-size: clamp(1rem, calc(0.96rem + 0.32vh), 1.1rem);
    text-align: center;
    line-height: 1.35;
    margin-block-start: auto;
    margin-block-end: auto;
  }

  .quiztitlemobile > p{
    margin-block-start: 0;
    margin-block-end: 0;
  }

  .mobilequizlayout.mobilequizlayout-summary{
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
  }

  .mobilequizsummarybox{
    gap: 14px;
    height: 100%;
    min-height: 0;
    justify-content: center;
    text-align: center;
  }

  .quiztitlemobile.justify{
    font-family: "artifex-cf", serif;
    text-align: justify;
    line-height: 120%;
    margin-block-start: 0;
    margin-block-end: 0;
  }

  .quiztitlemobile.justify > p{
    margin: 0;
  }

  .quizsummarystats{
    display: flex;
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    flex-direction: column;
    align-items: center;
    margin-top: 12px;
    padding-top: 16px;
    gap: 10px;
  }

  .quizsummarystatsbox{
    padding: 12px 0;
    display: flex;
  }

  .quizsummarystat{
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
    align-items: center;
    padding: 0 16px;
    padding-left: 0;
    border-right: 1px solid var(--border-color);
  }

  .quizsummarystat.noborder{
    border-right: none;
    padding-left: 16px;
  }

  .quizsummarystatnumb{
    font-size: 1.3rem;
    color: var(--text-color);
  }

  .mobilequizoption{
    display: flex;
    color: var(--text-color);
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 11.5px 0 rgba(0, 0, 0, 0.05);
    width: 100%;
    padding: 16px;
    min-height: 60px;
    font-size: 1.1rem;
    align-items: center;
    border-radius: 21px;
    text-align: left;
    transition: transform 160ms ease, background-color 200ms ease, border-color 200ms ease, color 200ms ease;
  }

  .mobilequizoption:active{
    transform: scale(0.99);
  }

  .mobilequizoption:disabled{
    cursor: default;
  }

  .mobilequizoption [data-md]{
    display: block;
    width: 100%;
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    opacity: 1 !important;
    visibility: visible !important;
    white-space: normal;
    line-height: 1.35;
  }

  .mobilequizoption [data-md] > p{
    margin: 0;
  }

  .mobilequizoption.is-muted{
    opacity: 0.5;
  }

  .mobilequizoption.wrong{
    color: var(--red-text);
    background-color: var(--red-bg);
    border: 1px solid var(--red-border);
  }

  .mobilequizoption.correct{
    color: var(--green-text);
    background-color: var(--green-bg-transp);
    border: 1px solid var(--green-border);
  }

  .mobilequizoption.is-wrong-shake{
    animation: mobileQuizOptionWrongShake 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .mobilequizprogress{
    align-self: center;
    display: flex;
    gap: 6px;
  }

  .mobilequizprogress.mobilequizprogress-fixed{
    position: relative;
    z-index: 3;
    margin-bottom: 4px;
    flex: 0 0 auto;
    width: max-content;
    margin-inline: auto;
    justify-self: center;
    align-self: center;
  }

  .mobilequizstatus{
    height: 10px;
    width: 20px;
    border-radius: 20px;
    background-color: var(--mobile-quiz-pill);
    will-change: width, background-color;
    transition: width 220ms cubic-bezier(0.22, 1, 0.36, 1), background-color 220ms ease;
  }

  .mobilequizstatus.active{
    width: 60px;
    background-color: var(--text-color);
  }

  .mobilequizstatus.wrong{
    background-color: var(--circle-bg-wrong);
  }

  .mobilequizstatus.correct{
    background-color: var(--circle-bg-correct);
  }

  .mobilequizstatus.active.wrong{
    background-color: var(--red-bg-transp-2, var(--red-border));
  }

  .mobilequizstatus.active.correct{
    background-color: var(--green-border);
  }

  .mobilequizstatus.summary.is-entering{
    animation: mobileQuizSummaryPillCreate 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes mobileQuizSummaryPillCreate {
    0% {
      width: 0;
      opacity: 0;
      transform: scale(0.88);
    }
    56% {
      width: 68px;
      opacity: 1;
      transform: scale(1.03);
    }
    100% {
      width: 60px;
      opacity: 1;
      transform: scale(1);
    }
  }

  body.mobile-active.mobile-settings-slideup-open .main-area,
  body.mobile-active.mobile-settings-slideup-open .sidebar,
  body.mobile-active.mobile-settings-slideup-open #mobileSidebarOverlay {
    pointer-events: none !important;
  }

  body.mobile-active.mobile-settings-slideup-open #mobileSettingsSlideupRoot {
    pointer-events: auto !important;
  }

  .mobileSettingsSlideupPopup {
    padding-bottom: 0;
    padding-left: 16px;
    padding-right: 0;
    overflow: hidden;
    touch-action: auto;
  }

  .mobileSettingsSlideupPopup .mobilefilepopup_top {
    touch-action: none;
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    min-height: 45px;
    z-index: 8;
  }

  .mobileSettingsPagesHost {
    margin-top: 0;
    width: 100%;
    align-self: stretch;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
  }

  .mobileSettingsPagesHost .mobileCollectionListFade {
    z-index: 6;
  }

  .mobileSettingsPagesHost .mobileCollectionListFade.top {
    top: var(--mobile-settings-header-offset, 55px);
  }

  .mobileSettingsPagesHost .mobilefilepopup_btm {
    margin-top: 0;
    height: auto;
    min-height: 0;
    padding-bottom: 0;
  }

  .mobileSettingsPage {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--mobile-settings-header-offset, 55px);
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    background: var(--background-color);
    padding-right: 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
    will-change: transform;
  }

  .mobileSettingsPage.is-active,
  .mobileSettingsPage.is-behind {
    display: flex;
  }

  .mobileSettingsPage.is-behind {
    opacity: 0.94;
  }

  .mobileSettingsPage.is-swiping {
    transition: none !important;
  }

  #mobileSettingsSwipeBackgroundLayer,
  #mobileSettingsSwipeFrontLayer {
    display: none;
  }

  .mobileSettingsSlideupPopup > #mobileSettingsSwipeBackgroundLayer,
  .mobileSettingsSlideupPopup > #mobileSettingsSwipeFrontLayer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
  }

  body.mobile-active.mobile-settings-slideup-open.mobile-settings-back-swipe-dragging #mobileSettingsSwipeBackgroundLayer,
  body.mobile-active.mobile-settings-slideup-open.mobile-settings-back-swipe-dragging #mobileSettingsSwipeFrontLayer {
    display: block;
  }

  body.mobile-active.mobile-settings-slideup-open.mobile-settings-back-swipe-dragging #mobileSettingsSwipeBackgroundLayer {
    z-index: 3;
  }

  body.mobile-active.mobile-settings-slideup-open.mobile-settings-back-swipe-dragging #mobileSettingsSwipeBackgroundLayer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--mobile-settings-bg-dim, 0));
    pointer-events: none;
    z-index: 1;
  }

  body.mobile-active.mobile-settings-slideup-open.mobile-settings-back-swipe-dragging #mobileSettingsSwipeFrontLayer {
    z-index: 4;
    box-shadow: -1px 0 0 rgba(0, 0, 0, 0.12), -6px 0 12px rgba(0, 0, 0, 0.12);
  }

  @keyframes mobileQuizSwipeBounceLeft {
    0% { transform: translateX(0); }
    48% { transform: translateX(-22px); }
    100% { transform: translateX(0); }
  }

  @keyframes mobileQuizSwipeBounceRight {
    0% { transform: translateX(0); }
    48% { transform: translateX(22px); }
    100% { transform: translateX(0); }
  }

  @keyframes mobileQuizOptionWrongShake {
    0% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(7px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
  }

  .mobileSettingsPage.mobileSettingsSwipeSourceHidden {
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .mobileSettingsSlideupPopup.mobile-settings-back-swipe-sources-hidden .mobileSettingsPagesHost {
    visibility: hidden !important;
  }

  #mobileSettingsSwipeBackgroundLayer .mobileSettingsSwipeLayerPage,
  #mobileSettingsSwipeFrontLayer .mobileSettingsSwipeLayerPage {
    display: flex !important;
    position: absolute;
    left: var(--mobile-settings-content-left, 0px);
    top: var(--mobile-settings-content-top, 0px);
    right: auto;
    bottom: auto;
    width: var(--mobile-settings-content-width, 100%);
    height: var(--mobile-settings-content-height, 100%);
    min-height: 0;
    margin-top: 0 !important;
    padding-top: var(--mobile-settings-layer-padding-top, 55px);
    box-sizing: border-box;
    max-width: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    background: var(--background-color);
    pointer-events: none;
    z-index: 2;
  }

  #mobileSettingsSwipeBackgroundLayer .mobileSettingsSwipeLayerPage {
    transform-origin: 50% 50%;
  }

  #mobileSettingsSwipeBackgroundLayer .mobileSettingsSwipeLayerSurface,
  #mobileSettingsSwipeFrontLayer .mobileSettingsSwipeLayerSurface {
    position: absolute;
    inset: 0;
    background: var(--background-color);
    overflow: hidden;
  }

  .mobileSettingsNavRow {
    font: inherit;
    text-align: left;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }

  .mobileSettingsNavRow:active {
    background-color: var(--file-btn-mobile-bg);
  }

  .mobileCollectionSlideupPopup {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    overflow-y: hidden;
    touch-action: auto;
  }

  .mobileCollectionSlideupPopup[data-view="list"] {
    padding-bottom: 5px;
  }

  .mobileCollectionSlideupPopup .mobilefilepopup_top {
    touch-action: none;
    flex: 0 0 auto;
    min-height: 45px;
    position: relative;
    z-index: 5;
  }

  .mobileCollectionSlideupListWrap {
    margin-top: 12px;
    width: 100%;
    align-self: stretch;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    z-index: 1;
  }

  .mobileCollectionSlideupList {
    margin-top: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-height: 100%;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
    position: relative;
    z-index: 1;
  }

  .mobileCollectionListFade {
    position: absolute;
    left: 0;
    right: 0;
    height: 22px;
    pointer-events: none;
    opacity: 0;
    z-index: 2;
    transition: opacity 140ms ease;
  }

  .mobileCollectionListFade.top {
    top: 0;
    background: linear-gradient(to bottom, var(--background-color) 0%, rgba(0, 0, 0, 0) 100%);
  }

  .mobileCollectionListFade.bottom {
    bottom: 0;
    background: linear-gradient(to top, var(--background-color) 0%, rgba(0, 0, 0, 0) 100%);
  }

  .mobileCollectionSlideupListWrap.can-scroll-up .mobileCollectionListFade.top,
  .mobileFileSlideupListWrap.can-scroll-up .mobileCollectionListFade.top,
  .mobileSettingsPagesHost.can-scroll-up .mobileCollectionListFade.top {
    opacity: 1;
  }

  .mobileCollectionSlideupListWrap.can-scroll-down .mobileCollectionListFade.bottom,
  .mobileFileSlideupListWrap.can-scroll-down .mobileCollectionListFade.bottom,
  .mobileSettingsPagesHost.can-scroll-down .mobileCollectionListFade.bottom {
    opacity: 1;
  }

  .mobileCollectionCreateView {
    margin-top: 12px;
    width: 100%;
    align-self: stretch;
    gap: 8px;
  }

  .mobileCollectionIconPickerView {
    margin-top: 12px;
    width: 100%;
    align-self: stretch;
    gap: 0;
  }

  .toppreviewiconmobile {
    width: 55px;
    height: 55px;
    display: flex;
    margin: 8px auto 26px;
    align-items: center;
    justify-content: center;
  }

  .toppreviewiconmobile svg {
    width: 100%;
    height: 100%;
  }

  .foldericonmobilepreview {
    width: 100%;
    height: 100%;
    flex: 0 0 100%;
  }

  .roleColorSelectorColorMobile {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    aspect-ratio: 1;
    border-radius: 13px;
    cursor: pointer;
    position: relative;
    overflow: visible;
    display: grid;
    place-items: center;
    transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
    touch-action: pan-x;
  }

  .roleColorSelectorColorMobile svg {
    width: 40px;
    height: 40px;
    display: block;
    pointer-events: none;
  }

  .roleColorSelectorColorMobile.is-selected {
    background-color: transparent !important;
    border-radius: 0;
  }

  .roleColorSelectorColorMobile:active {
    transform: scale(1.2);
  }

  .roleColorSelectorColorMobile.is-selected.should-pop svg {
    animation: mobilePickerSelectedPop 220ms cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: center;
  }

  @keyframes mobilePickerSelectedPop {
    0% {
      opacity: 0;
      transform: scale(1.2);
    }
    70% {
      opacity: 1;
      transform: scale(0.9);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }

  .roleColorSelectorColorMobile.Black { background-color: #FFFFFF; }
  :root[data-theme="light"] .roleColorSelectorColorMobile.Black { background-color: #1F2933; }
  .roleColorSelectorColorMobile.Red { background-color: #e47067; }
  .roleColorSelectorColorMobile.Orange { background-color: #e59e5b; }
  .roleColorSelectorColorMobile.Yellow { background-color: #e0bd4a; }
  .roleColorSelectorColorMobile.Green { background-color: #87c481; }
  .roleColorSelectorColorMobile.Blue { background-color: #6186c7; }
  .roleColorSelectorColorMobile.Purple { background-color: #ab84d5; }
  .roleColorSelectorColorMobile.Pink { background-color: #cd8ecc; }

  .mobilefilepopup_bar {
    width: 100%;
    border-top: 1px solid var(--border-color);
    margin-bottom: 16px;
  }

  .iconSelectorMobile {
    box-sizing: border-box;
    width: 100%;
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    justify-items: center;
    align-items: center;
    margin-bottom: 8px;
  }

  .roleIconBtnMobile {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-color);
    border: none;
    background: transparent;
    padding: 0;
    transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .roleIconBtnMobile.is-selected {
    opacity: 0.6;
  }

  .roleIconBtnMobile:active {
    transform: scale(1.2);
  }

  .foldericonmobilepicker {
    width: 40px;
    height: 40px;
  }

  .mobilecollectioninputbar {
    width: 100%;
    box-sizing: border-box;
    transition: border-color 320ms ease, box-shadow 420ms ease;
  }

  .mobileCollectionCreateInput {
    border: none;
    outline: none;
    width: 100%;
    min-width: 0;
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
  }

  .mobileCollectionCreateInput::placeholder {
    color: #9f9f9f;
  }

  .mobilebutton.transp.small.foldericon {
    align-items: center;
    justify-content: center;
    display: flex;
    padding: 8px;
    width: 40px;
    height: 40px;
    background-color: transparent;
    color: #a1a1a1;
    border: 1px solid transparent;
  }

  .titlemobileinput {
    color: #9f9f9f;
    font-size: 1rem;
    margin-bottom: 4px;
    margin-left: 16px;
  }

  .titlemobileinput.under {
    margin: 0 8px;
  }

  .settingsinputmobile {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
  }

  .mobilefilepopup_optionsection_inner {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
  }

  .mobilefilepopup_optionsection.und {
    padding-bottom: 12px;
  }

  .mobilefilepopup_optionsection.und2 {
    padding-bottom: 4px;
  }

  .mobilefilepopup_optionsection.nobar {
    border-top: none;
    padding-top: 0;
  }

  .horizontalbar {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
  }

  .mobileinput.alone {
    padding-left: 8px;
    font-size: 1.2rem;
    color: var(--text-color);
  }

  .mobileinput.alone:disabled {
    color: var(--med-text);
    -webkit-text-fill-color: var(--med-text);
  }

  .mobileinput.alone.large {
    padding-top: 8px !important;
    font-family: 'Slanter-Sans', sans-serif;
    font-optical-sizing: auto;
    font-weight: 300;
    align-items: center;
    display: flex;
    min-height: 120px;
    height: auto;
    flex-grow: 1;
    border: none;
    font-size: 1.2rem;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    resize: none;
    color: var(--text-color);
  }

  .mobileinput.alone.large::placeholder {
    color: #A1A1A1;
  }

  .themeRow.mobile {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding: 0 12px;
    flex-wrap: wrap;
  }

  .themeBtn.mobile.active .themeImg {
    outline: 2px solid var(--blue-accent);
    outline-offset: 2px;
  }

  .themeImg.mobile {
    border-radius: 13px;
  }

  .themeText.mobile {
    color: var(--text-color);
    text-align: center;
    padding-top: 8px;
    font-size: 1.1rem;
  }

  .CTABlack.margTop {
    margin-top: 12px;
  }

  .mobilefoldersuggest {
    margin-top: 12px;
    height: 45px;
    padding: 12px;
    gap: 12px;
    width: fit-content;
    border-radius: 13px;
    background-color: transparent;
    color: #000;
    border: 1px solid #cccccc;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex: 0 0 auto;
    transition: transform 160ms ease;
    touch-action: pan-x;
  }

  .mobilefoldersuggest:active {
    transform: scale(1.04);
  }

  .mobilefoldersuggest.is-selected {
    transform: scale(0.985);
  }

  .mobilefoldersuggest.is-muted-selected {
    filter: grayscale(1);
    opacity: 0.46;
    pointer-events: none;
  }

  .foldericonmobilesuggestion {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
  }

  .mobilefoldersuggestions {
    display: flex;
    gap: 12px;
    overflow-x: scroll;
    overflow-y: hidden;
    align-items: center;
    padding: 4px 2px 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
  }

  .mobilefoldersuggestions::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .mobilefoldersuggest-ghost-shell {
    position: fixed;
    pointer-events: none;
    z-index: 2147483646;
    box-sizing: border-box;
    will-change: left, top, width, height, border-radius, opacity;
  }

  .mobilefoldersuggest-ghost-icon {
    position: fixed;
    pointer-events: none;
    z-index: 2147483647;
    will-change: transform, opacity;
  }

  .mobilefoldersuggest-ghost-text {
    position: fixed;
    pointer-events: none;
    z-index: 2147483647;
    will-change: transform, opacity;
  }

  .mobilebutton.grey.right.mobilebutton-disabled {
    opacity: 0.42;
  }

  .mobilefilepopup_optionsection.collection-option {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    inline-size: 100%;
    min-inline-size: 100%;
    max-inline-size: 100%;
    align-self: stretch;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: background-color 140ms ease;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
  }

  .mobilefilepopup_optionsection.collection-option .mobileCollectionOptionIcon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
  }

  .mobilefilepopup_optionsection.collection-option .collectionSlideupBox {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
  }

  .mobilefilepopup_optionsection.collection-option .TextButtonMobile {
    margin-left: auto;
    flex: 0 0 auto;
  }

  @supports (-webkit-touch-callout: none) {
    .mobileCollectionSlideupList {
      width: -webkit-fill-available;
      min-width: -webkit-fill-available;
      max-width: -webkit-fill-available;
    }

    .mobilefilepopup_optionsection.collection-option {
      width: -webkit-fill-available;
      min-width: -webkit-fill-available;
      max-width: -webkit-fill-available;
      inline-size: -webkit-fill-available;
      min-inline-size: -webkit-fill-available;
      max-inline-size: -webkit-fill-available;
    }
  }

  .mobilefilepopup_optionsection.collection-option:active {
    background-color: var(--file-btn-mobile-bg);
  }

  .mobilefilepopup_optionsection.collection-option:hover {
    background-color: transparent;
  }

  .mobilefilepopup_optionsection.collection-option:disabled {
    opacity: 0.6;
  }

  .mobileCollectionsSwipeRowShell {
    --mobile-collections-snap-duration: 360ms;
    --mobile-collections-snap-ease: cubic-bezier(0.2, 0.82, 0.2, 1);
    --mobile-collections-delete-gap: 16px;
    position: relative;
    width: 100%;
    border-radius: 13px;
    overflow: visible;
    touch-action: pan-y;
  }

  .mobileCollectionsSwipeRowShell.delete-popup-dimmed .mobilefilepopup_optionbtn_svg.mobileCollectionOptionIcon,
  .mobileCollectionsSwipeRowShell.delete-popup-dimmed .collectionSlideupBox {
    opacity: 0.3 !important;
  }

  .mobileCollectionsSwipeRowShell.is-swiping .mobileCollectionsSwipeRow {
    transition: none !important;
  }

  .mobileCollectionsSwipeRowShell.is-swiping .mobileCollectionsSwipeAction,
  .mobileCollectionsSwipeRowShell.is-swiping .mobileCollectionsSwipeDeleteBtn.mobilebutton.red {
    transition: none !important;
  }

  .mobileCollectionsSwipeRowShell.is-swiping .mobileCollectionsSwipeRow::before {
    transition: none !important;
  }

  .mobileCollectionsSwipeRowShell.is-open .mobileCollectionsSwipeRow {
    border-radius: 21px;
  }

  .mobileCollectionsSwipeRowShell.is-context-open .mobileCollectionsSwipeRow {
    border-radius: 21px;
    border-top-color: transparent;
    border-bottom-color: transparent;
    transform: translate3d(calc(-1 * var(--mobile-collections-row-shift, 0px)), 0, 0) scale3d(1.03, 1.03, 1);
  }

  .mobileCollectionsSwipeRowShell.is-longpress-pressing .mobileCollectionsSwipeRow {
    border-radius: 21px;
    border-top-color: transparent;
    border-bottom-color: transparent;
    animation: mobileChatContextHoldGrow var(--mobile-collections-row-hold-ms, 460ms) cubic-bezier(0.15, 0.86, 0.28, 1) forwards;
  }

  .mobileCollectionsSwipeRowShell.is-swiping .mobileCollectionsSwipeRow,
  .mobileCollectionsSwipeRowShell.is-open .mobileCollectionsSwipeRow {
    border-top-color: transparent;
    border-bottom-color: transparent;
  }

  .mobileCollectionsSwipeRowShell.is-swiping + .mobileCollectionsSwipeRowShell .mobileCollectionsSwipeRow,
  .mobileCollectionsSwipeRowShell.is-open + .mobileCollectionsSwipeRowShell .mobileCollectionsSwipeRow {
    border-top-color: transparent;
  }

  .mobileCollectionsSwipeRowShell.is-context-open + .mobileCollectionsSwipeRowShell .mobileCollectionsSwipeRow {
    border-top-color: transparent;
  }

  .mobileCollectionsSwipeRowShell.is-longpress-pressing + .mobileCollectionsSwipeRowShell .mobileCollectionsSwipeRow {
    border-top-color: transparent;
  }

  .mobileCollectionsSwipeRow {
    position: relative;
    z-index: 2;
    transform: translate3d(calc(-1 * var(--mobile-collections-row-shift, 0px)), 0, 0);
    transition: transform var(--mobile-collections-snap-duration) var(--mobile-collections-snap-ease), background-color var(--mobile-collections-snap-duration) var(--mobile-collections-snap-ease);
    will-change: transform;
  }

  /* Prevent iOS text highlight on collection/chat swipe rows. */
  body.mobile-active #mobileCollectionsPage .mobilefilepopup_optionsection.collection-option.mobileCollectionsPageRow,
  body.mobile-active #mobileCollectionsPage .mobilefilepopup_optionsection.collection-option.mobileCollectionsPageRow *,
  body.mobile-active #mobileCollectionsPage .mobileCollectionsSwipeRowShell,
  body.mobile-active #mobileCollectionsPage .mobileCollectionsSwipeRowShell *,
  body.mobile-active #mobileCollectionsPage .mobileCollectionsSwipeRow,
  body.mobile-active #mobileCollectionsPage .mobileCollectionsSwipeRow * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent;
  }

  /* Temporary hard lock while touching collection rows to stop full-page iOS selection flicker. */
  body.mobile-active.mobile-collections-page-open.mobile-collections-selection-lock,
  body.mobile-active.mobile-collections-page-open.mobile-collections-selection-lock *:not(input):not(textarea):not([contenteditable="true"]) {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
  }

  .mobileCollectionsSwipeRow::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 21px;
    background-color: var(--hover-color);
    opacity: var(--mobile-collections-row-hover-opacity, 0);
    pointer-events: none;
    transition: opacity var(--mobile-collections-snap-duration) var(--mobile-collections-snap-ease);
  }

  .mobileCollectionsSwipeRowShell.is-context-open .mobileCollectionsSwipeRow::before {
    opacity: 1;
    animation: none;
  }

  .mobileCollectionsSwipeRowShell.is-context-enter .mobileCollectionsSwipeRow {
    animation: mobileChatContextCloneFluidIn 340ms cubic-bezier(0.18, 0.9, 0.24, 1.15) both;
  }

  .mobileCollectionsSwipeAction {
    position: absolute;
    right: 0;
    top: 50%;
    height: 45px;
    width: var(--mobile-collections-delete-width, 45px);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: stretch;
    padding-right: 0;
    box-sizing: border-box;
    z-index: 1;
    transform: translate3d(
      var(
        --mobile-collections-delete-translate-x,
        calc(var(--mobile-collections-delete-width, 45px) + var(--mobile-collections-delete-gap, 16px))
      ),
      -50%,
      0
    );
    transition: transform var(--mobile-collections-snap-duration) var(--mobile-collections-snap-ease), width var(--mobile-collections-snap-duration) var(--mobile-collections-snap-ease), opacity var(--mobile-collections-snap-duration) var(--mobile-collections-snap-ease);
    opacity: 0;
    pointer-events: none;
  }

  .mobileCollectionsSwipeRowShell.is-open .mobileCollectionsSwipeAction {
    opacity: 1;
    pointer-events: auto;
  }

  .mobileCollectionsSwipeDeleteBtn.mobilebutton.red {
    height: 45px;
    width: 100%;
    min-width: 0;
    margin-left: 0;
    border-radius: 13px;
    padding: 0;
    box-sizing: border-box;
    border: 1px solid rgba(233, 76, 76, 0.3);
    background-color: rgba(233, 76, 76, 0.15);
    color: #E94C4C;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity var(--mobile-collections-snap-duration) var(--mobile-collections-snap-ease);
  }

  .mobileCollectionsSwipeDeleteBtn.mobilebutton.red svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
  }

  .mobileCollectionOptionIcon {
    flex-shrink: 0;
  }

  .mobileCollectionOptionIcon svg {
    width: 100%;
    height: 100%;
  }

  .mobileCollectionsFolderHero {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 8px 14px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
    margin-top: 10px;
  }

  .mobileCollectionsFolderHeroIcon {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
  }

  .mobileCollectionsFolderHeroText .SmallerSlideUpText {
    color: var(--med-text);
  }

  .mobileCollectionsBackRow .mobileCollectionsBackIcon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: var(--med-text);
  }

  .mobileCollectionsPageChatRow {
    gap: 0;
  }

  .mobileCollectionsPageChatRow .collectionSlideupBox {
    width: 100%;
  }

  .collectionSlideupBox{
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
  }

  .collectionSlideupBox span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .SmallerSlideUpText{
    font-size: 0.95rem;
    color: #9F9F9F;
  }

  .TextButtonMobile.check{
    display: flex;
    align-items: center;
    height: 25px;
    width: 25px;
    gap: 8px;
    color: #2B74D9;
    margin-left: auto;
  }

  .mobileCollectionSlideupEmpty {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 8px;
    color: var(--med-text);
    font-size: 0.98rem;
  }

  .mobileSidebar{
      box-sizing: border-box;
      background-color: var(--sidebar-color);
      display: flex;
      flex-direction: column;
      --mobile-sidebar-pad-x: 10px;
      padding: 0 var(--mobile-sidebar-pad-x);
      padding-bottom: 10px;
  }

  .logorowmobile{
      color: var(--text-color);
      height: 33px;
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 12px 0;
  }

  .logorowmobile svg:first-child{
      width: 33px;
      flex-shrink: 0;
  }

  .logorowmobile svg:last-child{
      width: auto;
      flex-shrink: 1;
  }

  body.mobile-active.mobile-startup-pending::before{
      content: "";
      position: fixed;
      inset: 0;
      background: var(--background-color);
      z-index: 2147483000;
  }

  body.mobile-active.mobile-startup-pending .sidebar{
      display: block !important;
      opacity: 1 !important;
      visibility: visible !important;
      pointer-events: none !important;
      border-right: none !important;
      background: transparent !important;
      padding: 0 !important;
      overflow: visible !important;
      z-index: 2147483001 !important;
  }

  body.mobile-active.mobile-startup-pending .sidebar > :not(#mobileSidebarCustom){
      display: none !important;
  }

  body.mobile-active.mobile-startup-pending #mobileSidebarCustom{
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: transparent !important;
      padding: 0 !important;
      z-index: 2147483001;
  }

  body.mobile-active.mobile-startup-pending #mobileSidebarCustom > :not(.logorowmobile){
      display: none !important;
  }

  body.mobile-active.mobile-startup-pending #mobileSidebarCustom .logorowmobile{
      width: min(84vw, 360px);
      height: 33px;
      margin: 0;
      color: var(--contrast-color);
  }

  body.mobile-active.mobile-startup-pending #mobileSidebarCustom .logorowmobile svg:first-child path{
      fill: #A9A963 !important;
  }

  .mobileSidebarButtons{
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 4px;
  }

  #mobileRecentChatsList{
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 4px;
      align-items: stretch;
  }

  .recentChatSidebarMobile{
      margin-top: 12px;
      margin-left: 12px;
      color: #AFAFAF;
      font-size: 0.9rem;
  }

  .buttonMobileSidebar{
      display: flex;
      width: 100%;
      height: 45px;
      border-radius: 16px;
      border: none;
      background-color: transparent;
      font-size: 1.1rem;
      align-items: center;
      gap: 12px;
      padding: 12px;
      color: var(--text-color);
      -webkit-tap-highlight-color: transparent;
      transition: background-color 140ms ease, color 140ms ease;
  }

  @media (hover: hover) and (pointer: fine) {
      .buttonMobileSidebar:hover{
          background-color: var(--hover-color);
      }
  }

  .buttonMobileSidebar.black{
      background-color: var(--contrast);
      color: var(--contrast-text);
  }

  .mobileSidebarSVG{
      height: 18px;
      width: 18px;
  }

  .userboxmobile{
      display: flex;
      background-color: var(--input-bg);
      border: 1px solid var(--border-color);
      border-radius: 21px;
      padding: 8px;
      align-items: center;
      gap: 8px;
  }

  .usericonmobile{
    color: #000;
      background-color: #677E69;
      border: none;
      border-radius: 13px;
      height: 40px;
      aspect-ratio: 1;
      display: flex;
      justify-content: center;
      align-items: center;
      font-weight: 600;
  }

  .usericontextmobile{
      color: var(--text-color);
  }

.userboxmobileUpgrade{
    background-color: var(--contrast-color);
    color: var(--contrast-text);
      height: 40px;
      border: none;
      border-radius: 13px;
      padding: 0 16px;
      font-size: 1rem;
      margin-left: auto;
  }

  body.mobile-active .sidebar-folder-list {
      display: none !important;
  }

  body.mobile-active .sidebar-chat-list .sidebarsectionheader {
      display: none !important;
  }

  body.mobile-active .threeDotsMenu,
  body.mobile-active .chat-item-dots,
  body.mobile-active .folder-dots-btn {
      display: none !important;
  }

  body.mobile-active #sidebarLogoBtn,
  body.mobile-active #sidebarCloseBtn,
  body.mobile-active #sidebarLogoRive {
      display: none !important;
  }

  /* Sidebar mobile overlay */
  body.mobile-active {
      --mobile-sidebar-width: 100vw;
      --mobile-chat-peek: 44px;
      --mobile-sidebar-content-width: calc(95vw - var(--mobile-chat-peek));
      --mobile-chat-shift: var(--mobile-sidebar-content-width);
  }

  .mobile-sidebar-overlay {
      position: fixed;
      inset: 0;
      background: transparent;
      z-index: 120540;
  }
  .mobile-sidebar-overlay.hidden {
      display: none;
  }

  body.mobile-active .sidebar.mobile-open,
  body.mobile-active .sidebar.mobile-closing {
      --mobile-sidebar-content-dim: 0;
      display: flex !important;
      position: fixed !important;
      top: 0;
      left: 0;
      right: 0;
      height: 100%;
      width: var(--mobile-sidebar-width);
      min-width: 100vw;
      max-width: none;
      z-index: 120545;
      transform-origin: left center;
      transform: scale(1) !important;
      overflow: hidden;
      box-shadow: none;
      transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
      will-change: transform, opacity;
      backface-visibility: hidden;
      border-right: none !important;
      padding: 0 !important;
      margin: 0 !important;
      gap: 0 !important;
      background: transparent !important;
      isolation: isolate;
      pointer-events: auto;
  }

  body.mobile-active .sidebar.mobile-open::before,
  body.mobile-active .sidebar.mobile-closing::before {
      content: "";
      position: absolute;
      inset: 0;
      background: var(--sidebar-color);
      z-index: 0;
      pointer-events: none;
  }

  body.mobile-active .sidebar.mobile-open::after,
  body.mobile-active .sidebar.mobile-closing::after {
      content: "";
      position: absolute;
      inset: 0;
      background: transparent;
      z-index: 2;
      pointer-events: none;
  }

  body.mobile-active .sidebar.mobile-open .sidebar-logo-row,
  body.mobile-active .sidebar.mobile-open .sidebar-menu-list,
  body.mobile-active .sidebar.mobile-closing .sidebar-logo-row,
  body.mobile-active .sidebar.mobile-closing .sidebar-menu-list {
      width: calc(var(--mobile-sidebar-content-width) - (var(--sidebar-inline-pad) * 2));
  }

  body.mobile-active .main-area {
      position: relative;
      z-index: 120546;
      transform: none;
      opacity: 1;
      background: var(--background-color);
      box-shadow: none !important;
      transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 300ms ease, box-shadow 420ms cubic-bezier(0.22, 1, 0.36, 1), background-color 300ms ease;
      will-change: transform, opacity, box-shadow;
      backface-visibility: hidden;
  }

  body.mobile-active .main-area > #chatView {
      opacity: var(--mobile-main-content-opacity, 1);
      transition: opacity 300ms ease;
      will-change: opacity;
      backface-visibility: hidden;
  }

  body.mobile-active.mobile-sidebar-dragging .main-area,
  body.mobile-active.mobile-sidebar-dragging #mobileSidebarOverlay,
  body.mobile-active.mobile-sidebar-dragging .sidebar.mobile-open {
      transition: none !important;
  }

  body.mobile-active.mobile-sidebar-dragging .main-area {
      z-index: 120560;
  }

  body.mobile-active.mobile-sidebar-dragging.mobile-collections-page-open #mobileCollectionsSearchBar {
      transition: none !important;
      z-index: 120561 !important;
      display: flex !important;
      visibility: visible !important;
  }

  body.mobile-active.mobile-sidebar-dragging .main-area > #chatView {
      transition: none !important;
  }

  body.mobile-active.mobile-sidebar-open .main-area {
      transform: translate3d(var(--mobile-chat-shift), 0, 0);
      --mobile-main-content-opacity: 0.48;
      --mobile-main-surface-bg: #F7F7F8;
      box-shadow: -1px 0 0 rgba(0, 0, 0, 0.12), -6px 0 12px rgba(0, 0, 0, 0.12) !important;
      pointer-events: none !important;
  }

  body.mobile-active.mobile-collections-page-open.mobile-sidebar-open:not(.mobile-collections-searchbar-linked) #mobileCollectionsSearchBar {
      transform: translateY(calc(-1 * var(--mobile-keyboard-shift, 0px)));
      z-index: 120561 !important;
      display: flex !important;
      visibility: visible !important;
  }

  body.mobile-active.mobile-collections-page-open.mobile-sidebar-closing #mobileCollectionsSearchBar {
      z-index: 120561 !important;
      display: flex !important;
      visibility: visible !important;
  }

  /* Prevent collections bottom mask from visually interfering with the sidebar fade layer. */
  body.mobile-active.mobile-collections-page-open.mobile-sidebar-open #mobileCollectionsBottomMask,
  body.mobile-active.mobile-collections-page-open.mobile-sidebar-closing #mobileCollectionsBottomMask,
  body.mobile-active.mobile-collections-page-open.mobile-sidebar-dragging #mobileCollectionsBottomMask {
      display: none !important;
      opacity: 0 !important;
      visibility: hidden !important;
  }

  body.mobile-active.mobile-sidebar-closing .main-area {
      --mobile-main-content-opacity: 1;
      --mobile-main-surface-bg: #FAFAF9;
      box-shadow: -1px 0 0 rgba(0, 0, 0, 0.12), -6px 0 12px rgba(0, 0, 0, 0.12) !important;
  }

  /* Keep shadow while dragging so it moves with the translated chat surface. */
  body.mobile-active.mobile-sidebar-dragging .main-area {
      box-shadow: -1px 0 0 rgba(0, 0, 0, 0.12) !important;
  }

  body.mobile-active.mobile-sidebar-open #mobileSidebarOverlay {
      left: var(--mobile-sidebar-content-width);
      background: transparent;
      z-index: 120547;
  }

  body.mobile-active:not(.mobile-sidebar-open):not(.mobile-sidebar-closing) .main-area {
      box-shadow: none !important;
      opacity: 1 !important;
   }

  body.mobile-active.mobile-sidebar-closing .sidebar.mobile-open,
  body.mobile-active.mobile-sidebar-closing .sidebar.mobile-closing {
      transform: none !important;
      opacity: 1;
  }

  /* Ensure sidebar is hidden by default in mobile mode */
  body.mobile-active .sidebar {
      display: none !important;
      opacity: 0 !important;
      visibility: hidden !important;
      pointer-events: none !important;
  }

  body.mobile-active.mobile-sidebar-open .sidebar.mobile-open,
  body.mobile-active.mobile-sidebar-closing .sidebar.mobile-open,
  body.mobile-active.mobile-sidebar-closing .sidebar.mobile-closing {
      display: flex !important;
      opacity: 1 !important;
      visibility: visible !important;
      pointer-events: auto !important;
  }
}


/* =========================
   REAL MOBILE MODE
========================= */
body.mobile-active .input-container,
body.mobile-active .input-container-centered {
    display: none !important;
}

html.mobile-active {
    height: 100%;
    overflow: hidden !important;
    overscroll-behavior-y: none;
}

body.mobile-active {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden !important;
    overscroll-behavior-y: none;
}

html.mobile-composer-focused,
body.mobile-active.mobile-composer-focused {
    overflow: hidden !important;
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
}

body.mobile-active .app-layout {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}

#mobileTopbar {
    display: none;
}

#mobileInputBar {
    display: none;
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    top: auto;
    transform: translateY(calc(-1 * var(--mobile-keyboard-shift, 0px)));
    left: 0;
    width: 100vw;
    padding: 0 12px;
    z-index: 120550;
    box-sizing: border-box;
}

body.mobile-active #mobileInputBar {
    display: flex !important;
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
    top: auto;
    transform: translateY(calc(-1 * var(--mobile-keyboard-shift, 0px)));
    width: 100vw;
    padding: 0 12px;
    z-index: 120550;
    align-items: flex-end;
    justify-content: center;
}

body.mobile-active #mobileTopbar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--mobile-top-fade-h, 78px) + env(safe-area-inset-top, 0px));
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
    box-sizing: border-box;
    z-index: 120551;
    isolation: isolate;
    overflow: visible;
    background: transparent;
}

body.mobile-active #mobileTopbar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-color: transparent;
    background-image: linear-gradient(to bottom, var(--background-color) 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.95) 18%,
        rgba(0, 0, 0, 0.72) 44%,
        rgba(0, 0, 0, 0.40) 72%,
        rgba(0, 0, 0, 0.12) 90%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.95) 18%,
        rgba(0, 0, 0, 0.72) 44%,
        rgba(0, 0, 0, 0.40) 72%,
        rgba(0, 0, 0, 0.12) 90%,
        transparent 100%
    );
    -webkit-backdrop-filter: blur(var(--mobile-fade-blur, 2px));
    backdrop-filter: blur(var(--mobile-fade-blur, 2px));
}

body.mobile-active #mobileTopbar > * {
    position: relative;
    z-index: 2;
}

body.mobile-active #mobileTopbar > :not(.mobilebutton) {
    transform: translateZ(0);
}

body.mobile-active #mobileTopbar .mobilebutton.grey,
body.mobile-active #mobileTopbar .mobiletopbartab {
    background-color: var(--input-bg);
}

body.mobile-active #chatView > .chat-topbar {
    display: none;
}

body.mobile-active .input-disclaimer {
    display: none !important;
}

body.mobile-active .main-area {
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden;
}

body.mobile-active #chatView {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.mobile-active .main-area.empty-chat .empty-chat-composer-stack {
    top: var(--mobile-empty-chat-center-y, 50%);
    transform: translate(-50%, -50%);
    transition: top 220ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: top;
}

body.mobile-active .main-area.empty-chat .empty-chat-composer-stack .inputbarGreeting {
    display: none;
}

body.mobile-active .main-area.empty-chat .empty-chat-composer-stack .mobileGreeting {
    display: flex;
}

body.mobile-active #chatView > .chat-scroll {
    flex: 1;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    padding-top: calc(var(--mobile-top-fade-h, 78px) + env(safe-area-inset-top, 0px));
    scroll-padding-top: calc(var(--mobile-top-fade-h, 78px) + env(safe-area-inset-top, 0px));
    /* Override desktop chat underlap spacing with mobile-specific bottom inset. */
    padding-bottom: calc(var(--mobile-bottom-fade-h, 84px) + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(var(--mobile-bottom-fade-h, 84px) + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

.mobileCollectionsPage,
.mobileCollectionsSearchBar,
.mobileCollectionsBottomMask {
    display: none;
}

body.mobile-active #mobileCollectionsSwipeFrontLayer {
    display: none;
}

body.mobile-active #mobileCollectionsSwipeBackgroundDimmer {
    display: none;
}

body.mobile-active #mobileCollectionsPage {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

body.mobile-active #mobileCollectionsPageList {
    height: 100%;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    padding-top: calc(var(--mobile-top-fade-h, 78px) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

body.mobile-active #mobileCollectionsPageList.is-empty-state {
    position: relative;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0;
}

body.mobile-active #mobileCollectionsPageList.is-empty-state .mobileEmptySearch,
body.mobile-active #mobileCollectionsPageList.is-empty-state .mobileEmptyChatlist {
    position: absolute;
    top: var(--mobile-empty-state-top, calc(var(--mobile-top-fade-h, 78px) + env(safe-area-inset-top, 0px)));
    bottom: var(--mobile-empty-state-bottom, calc(88px + env(safe-area-inset-bottom, 0px)));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    width: min(calc(100% - 32px), 420px);
}

.mobileEmptySearchText{
    position: relative;
    font-family: "artifex-cf", serif;
    font-weight: 300;
    color: var(--contrast);
    font-size: 1.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.mobileEmptySearchText.search{
  padding: 25px 0;
}

#collectionEmptyState {
    display: flex;
    align-items: center;
    margin-top: 50px;
    justify-content: center;
}

#collectionEmptyState.hidden {
    display: none;
}

.mobileEmptySearchSVG{
  color: #969640;
  width: 40px;
  height: 40px;
}

.mobileEmptyChatlistSVG{
  color: #969640;
  width: 45px;
  height: 45px;
}

.mobileEmptySearch,
.mobileEmptyChatlist{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  user-select: none;
}

body.mobile-active #mobileCollectionsSearchBar {
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    width: 100vw;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
    transform: translateY(calc(-1 * var(--mobile-keyboard-shift, 0px)));
    transform-origin: 50% 100%;
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 300ms ease, box-shadow 420ms cubic-bezier(0.22, 1, 0.36, 1), background-color 300ms ease;
    will-change: transform;
    padding: 0 12px;
    z-index: 120550;
    box-sizing: border-box;
    align-items: flex-end;
    justify-content: center;
}

body.mobile-active.mobile-collections-searchbar-linked #mobileCollectionsSearchBar {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 120561 !important;
}

body.mobile-active #mobileCollectionsSearchBar .mobileinputbar {
    width: 100%;
}

body.mobile-active #mobileCollectionsSearchInput.mobileinput {
    padding: 0;
    margin: 0;
    min-height: 40px;
    max-height: none;
    overflow: visible;
    font-size: 1.1rem;
    line-height: 1.25;
}

body.mobile-active.mobile-collections-page-open #chatView > .chat-scroll,
body.mobile-active.mobile-collections-page-open #chatView > #chatBottomMask,
body.mobile-active.mobile-collections-page-open #chatView > .chat-bottom-mask,
body.mobile-active.mobile-collections-page-open #chatView > .empty-chat-composer-stack,
body.mobile-active.mobile-collections-page-open #chatView > .file-preview-stack,
body.mobile-active.mobile-collections-page-open #scrollDownBtn,
body.mobile-active.mobile-collections-page-open #typingIndicator,
body.mobile-active.mobile-collections-page-open #mobileInputBar,
body.mobile-active.mobile-collections-page-open #mobileFileRow {
    display: none !important;
}

body.mobile-active.mobile-collections-page-open #mobileCollectionsPage {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 120548;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    background-color: var(--background-color);
}

body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsSwipeFrontLayer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 120552;
    overflow: hidden;
    pointer-events: none;
    box-shadow: -1px 0 0 rgba(0, 0, 0, 0.12), -6px 0 12px rgba(0, 0, 0, 0.12);
}

body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsSwipeBackgroundDimmer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 120549;
    pointer-events: none;
    background: rgba(0, 0, 0, var(--mobile-collections-bg-dim, 0));
}

body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsSwipeFrontLayer > #mobileCollectionsPage,
body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsSwipeFrontLayer > #mobileCollectionsBottomMask {
    transform: translate3d(var(--mobile-collections-swipe-front-shift, 0px), 0, 0) !important;
}

/* Keep fixed chrome above the swiping collections surface. */
body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileTopbar {
    z-index: 120554 !important;
}

body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsSearchBar,
body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileInputBar {
    z-index: 120553 !important;
}

body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsPage:not([data-swipe-front-clone="1"]),
body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsBottomMask:not([data-swipe-front-clone="1"]) {
    transform: scale(var(--mobile-collections-bg-scale, 1)) !important;
    transition: none !important;
}

body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsPage:not([data-swipe-front-clone="1"]) {
    transform-origin: 50% 50%;
}

body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsBottomMask:not([data-swipe-front-clone="1"]) {
    transform-origin: 50% 100%;
}

body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileTopbar,
body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsPage,
body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsSearchBar,
body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsBottomMask {
    pointer-events: none !important;
}

/* Keep the collections search bar visible + interactive even during folder swipe transitions. */
body.mobile-active.mobile-collections-page-open.mobile-collections-detail-swipe-dragging #mobileCollectionsSearchBar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 120555 !important;
}

body.mobile-active.mobile-collections-page-open #mobileCollectionsSearchBar {
    display: flex !important;
    position: fixed !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

body.mobile-active.mobile-collections-page-open #mobileCollectionsBottomMask {
    display: block !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--mobile-bottom-fade-h, 84px);
    background-color: transparent;
    background-image: linear-gradient(
        to top,
        var(--background-color) 0%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to top,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.95) 18%,
        rgba(0, 0, 0, 0.72) 44%,
        rgba(0, 0, 0, 0.40) 72%,
        rgba(0, 0, 0, 0.12) 90%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to top,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.95) 18%,
        rgba(0, 0, 0, 0.72) 44%,
        rgba(0, 0, 0, 0.40) 72%,
        rgba(0, 0, 0, 0.12) 90%,
        transparent 100%
    );
    -webkit-backdrop-filter: blur(var(--mobile-fade-blur, 2px));
    backdrop-filter: blur(var(--mobile-fade-blur, 2px));
    z-index: 120549;
    pointer-events: none;
}

body.mobile-active.mobile-collections-page-open.mobile-collection-slideup-open #mobileCollectionsPage,
body.mobile-active.mobile-collections-page-open.mobile-collection-slideup-open #mobileCollectionsSearchBar,
body.mobile-active.mobile-collections-page-open.mobile-collection-slideup-open #mobileCollectionsBottomMask {
    pointer-events: none !important;
}

body.mobile-active.mobile-collections-page-open .main-area,
body.mobile-active.mobile-collections-page-open #chatView {
    height: 100vh !important;
    min-height: 100vh !important;
}

body.mobile-active #mobileCollectionsPage .mobileCollectionsPageRow {
    cursor: pointer;
}

body.mobile-active #mobileCollectionsPage .mobileCollectionsPageRow:active {
    background-color: var(--file-btn-mobile-bg);
}

/* Swipe rows manage their own fade/curve via .mobileCollectionsSwipeRow::before */
body.mobile-active #mobileCollectionsPage .mobileCollectionsSwipeRowShell .mobileCollectionsPageRow {
    transition: transform var(--mobile-collections-snap-duration) var(--mobile-collections-snap-ease),
                background-color var(--mobile-collections-snap-duration) var(--mobile-collections-snap-ease) !important;
}

body.mobile-active #mobileCollectionsPage .mobileCollectionsSwipeRowShell.is-swiping .mobileCollectionsPageRow {
    transition: none !important;
}

body.mobile-active #mobileCollectionsPage .mobileCollectionsSwipeRowShell .mobileCollectionsPageRow:active {
    background-color: transparent !important;
}

/* When mobile composer is open on an empty/new chat, lock chat scrolling. */
body.mobile-active.mobile-composer-open .main-area.empty-chat #chatView > .chat-scroll {
    overflow-y: hidden;
    overscroll-behavior-y: none;
    touch-action: none;
}

body.mobile-active #mobileSidebarCustom {
    touch-action: pan-y;
}

body.mobile-active.mobile-sidebar-dragging #chatView > .chat-scroll,
body.mobile-active.mobile-sidebar-dragging #mobileSidebarCustom {
    touch-action: none;
}

body.mobile-active #chatView > .chat-scroll > .chat-inner,
body.mobile-active #chatContainer.chat-inner {
    box-sizing: border-box;
    padding-left: 4px;
    padding-right: 12px;
}

body.mobile-active #chatView > #chatBottomMask,
body.mobile-active #chatView > .chat-bottom-mask {
    height: var(--mobile-bottom-fade-h, 84px);
    background-color: transparent;
    background-image: linear-gradient(
        to top,
        var(--background-color) 0%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to top,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.95) 18%,
        rgba(0, 0, 0, 0.72) 44%,
        rgba(0, 0, 0, 0.40) 72%,
        rgba(0, 0, 0, 0.12) 90%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to top,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.95) 18%,
        rgba(0, 0, 0, 0.72) 44%,
        rgba(0, 0, 0, 0.40) 72%,
        rgba(0, 0, 0, 0.12) 90%,
        transparent 100%
    );
    -webkit-backdrop-filter: blur(var(--mobile-fade-blur, 2px));
    backdrop-filter: blur(var(--mobile-fade-blur, 2px));
}

#mobileInputBar {
    overflow: hidden;
    transform-origin: 50% 100%;
    transition: transform 260ms ease;
}

/* While the virtual keyboard is animating, follow visualViewport in lock-step. */
body.mobile-active.mobile-keyboard-tracking #mobileInputBar,
body.mobile-active.mobile-keyboard-tracking #mobileCollectionsSearchBar {
    transition: none !important;
}

#mobileInputBar.is-open {
    overflow: visible;
}

#mobileInputBar #mobileInputMorphBar {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0;
    box-sizing: border-box;
    margin-top: auto;
    transform-origin: 50% 100%;
    transition:
        border-radius 420ms cubic-bezier(0.22, 1, 0.36, 1),
        padding 420ms cubic-bezier(0.22, 1, 0.36, 1),
        gap 420ms cubic-bezier(0.22, 1, 0.36, 1),
        min-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

#mobileInputBar #mobileTextbox {
    width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: none;
    pointer-events: none;
    transition:
        max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 320ms cubic-bezier(0.33, 1, 0.68, 1),
        margin 420ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, max-height;
    backface-visibility: hidden;
}

#mobileInputBar #mobileTextboxScrollWrap {
    position: relative;
    width: 100%;
    min-width: 0;
}

#mobileInputBar #mobileTextboxScrollWrap .mobileCollectionListFade {
    height: 16px;
    z-index: 3;
}

#mobileInputBar #mobileTextboxScrollWrap .mobileCollectionListFade.top {
    background: linear-gradient(to bottom, var(--input-bg) 0%, rgba(0, 0, 0, 0) 100%);
}

#mobileInputBar #mobileTextboxScrollWrap .mobileCollectionListFade.bottom {
    background: linear-gradient(to top, var(--input-bg) 0%, rgba(0, 0, 0, 0) 100%);
}

#mobileInputBar #mobileTextboxScrollWrap.can-scroll-up .mobileCollectionListFade.top {
    opacity: 1;
}

#mobileInputBar #mobileTextboxScrollWrap.can-scroll-down .mobileCollectionListFade.bottom {
    opacity: 1;
}

#mobileInputBar:not(.is-open) #mobileTextbox {
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
}

#mobileInputBar.is-open #mobileInputMorphBar {
    gap: 8px;
}

body.mobile-active #mobileInputBar.voice-open #mobileInputMorphBar {
    gap: 0;
    padding-top: 0;
}

#mobileInputBar.is-open #mobileTextbox {
    max-height: 260px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

#mobileInputBar.is-open #mobileTextbox {
    padding-top: 0;
    padding-bottom: 0;
    scroll-padding-top: 8px;
}

#mobileInputBar .mobileinputplace,
#mobileInputBar .mobileinput {
    transition: opacity 220ms cubic-bezier(0.33, 1, 0.68, 1);
    will-change: opacity;
    backface-visibility: hidden;
}

/* Keep mobile attachments above the composer, not inside it */
#mobileFileRow {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    width: 100vw;
    padding: 0 12px 2px;
    box-sizing: border-box;
    bottom: var(--mobile-file-row-bottom, calc(env(safe-area-inset-bottom, 0px) + var(--mobile-inputbar-height, 64px) + 12px));
    transform: translate3d(0, 10px, 0);
    z-index: 120549;
    margin: 0;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    gap: 8px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
    touch-action: pan-x;
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
    scrollbar-gutter: stable both-edges;
    transition:
        max-height 300ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 220ms cubic-bezier(0.33, 1, 0.68, 1),
        transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mobile-active #mobileFileRow {
    display: flex;
}

body.mobile-active #mobileFileRow:not(:empty) {
    max-height: min(260px, 38vh);
    opacity: 1;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
}

body.mobile-active #mobileFileRow::before,
body.mobile-active #mobileFileRow::after {
    display: none;
}

body.mobile-active #mobileFileRow .filemobile {
    box-shadow: 0 0 15px var(--black-shadow);
    position: relative;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    padding: 6px;
    width: 100px;
    height: 100px;
}

body.mobile-active #mobileFileRow .topfilemobile {
    display: flex;
    align-items: center;
    padding-left: 6px;
    padding-bottom: 6px;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
}

body.mobile-active #mobileFileRow .topfilemobile.img {
    position: absolute;
    right: 06px;
}

body.mobile-active #mobileFileRow .FileTypeText {
    color: #9F9F9F;
    font-size: 0.9rem;
}

body.mobile-active #mobileFileRow .removefilemobile {
    display: flex;
    margin-left: auto;
    background-color: var(--contrast);
    border: none;
    align-items: center;
    width: 30px;
    padding: 4px;
    color: var(--contrast-text);
    border-radius: 50%;
    height: 30px;
}

body.mobile-active #mobileFileRow .FileText {
    color: var(--text-color);
    display: flex;
    margin-top: auto;
    padding-left: 6px;
    padding-bottom: 6px;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-all;
}

body.mobile-active #mobileFileRow .filemobileimage {
    display: flex;
    aspect-ratio: 1;
    border-radius: 19px;
    scale: 105%;
}

body.mobile-active #mobileFileRow .file-chip.filemobile.file-chip-new {
    align-self: auto;
    width: 100px;
    height: 100px;
    border-radius: 24px;
}

body.mobile-active #mobileFileRow .file-chip.filemobile.file-chip-image-new,
body.mobile-active #mobileFileRow .file-chip.filemobile.file-chip-image-new-file {
    align-self: auto;
    width: 100px;
    height: 100px;
    border-radius: 24px;
}

body.mobile-active #mobileFileRow .file-chip.filemobile .file-chip-media,
body.mobile-active #mobileFileRow .file-chip.filemobile .file-chip-media-file,
body.mobile-active #mobileFileRow .file-chip.filemobile .file-chip-media-image {
    position: static;
    width: 100%;
    height: 100%;
    margin: 0;
}

body.mobile-active #mobileFileRow .file-chip.filemobile .file-chip-box,
body.mobile-active #mobileFileRow .file-chip.filemobile .file-chip-box-image,
body.mobile-active #mobileFileRow .file-chip.filemobile .file-chip-box-image-file {
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border-radius: 19px;
    object-fit: cover;
}

body.mobile-active #mobileFileRow .file-chip.filemobile .file-chip-close,
body.mobile-active #mobileFileRow .file-chip.filemobile .file-chip-close-image {
    position: static;
    right: auto;
    top: auto;
    margin: 0 0 0 auto;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.mobile-active #mobileFileRow .file-chip.filemobile .file-chip-progress-shell {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
}

body.mobile-active #mobileFileRow .file-chip.filemobile.loading .file-chip-box,
body.mobile-active #mobileFileRow .file-chip.filemobile.loading .file-chip-box-image,
body.mobile-active #mobileFileRow .file-chip.filemobile.loading .file-chip-box-image-file,
body.mobile-active #mobileFileRow .file-chip.filemobile.loading .FileText,
body.mobile-active #mobileFileRow .file-chip.filemobile.loading .FileTypeText {
    filter: blur(2px);
    opacity: 0.72;
}

#mobileInputBar .mobileinputbottom .mobileinputplace {
    display: flex;
    align-items: center;
    min-height: 20px;
    padding: 4px 0;
    opacity: 1;
    transform: none;
    transition: opacity 220ms cubic-bezier(0.33, 1, 0.68, 1);
}

#mobileInputBar.is-open .mobileinputbottom .mobileinputplace {
    transform: none;
    opacity: 0;
    pointer-events: none;
}

#mobileInputBar.is-open .mobileinput {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

/* Mobile UI style system (applies whenever mobile mode is active, regardless of width) */
body.mobile-active .mobiletopbar{
    width: 100%;
    background-color: transparent;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    padding: 12px;
    box-sizing: border-box;
}

body.mobile-active .mobiletopbartab {
    min-width: 0;
}

body.mobile-active .mobiletopbartab > div {
    width: min(100%, 227px);
    max-width: 227px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: center;
    margin: 0 auto;
}

body.mobile-active #mobileTopbarTitle {
    width: min(100%, 227px);
    max-width: 227px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.mobile-active #mobileTopbarTitle.mobiletopbar-folder-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: normal;
}

body.mobile-active #mobileTopbarTitle.mobiletopbar-folder-title .mobileCollectionOptionIcon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

body.mobile-active #mobileTopbarTitle.mobiletopbar-folder-title .mobileCollectionOptionIcon svg {
    width: 100%;
    height: 100%;
    display: block;
}

body.mobile-active #mobileTopbarTitle.mobiletopbar-folder-title .mobiletopbar-folder-label {
    min-width: 0;
    max-width: calc(100% - 24px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.mobile-active .mobilebutton{
    aspect-ratio: 1;
    height: 45px;
    border-radius: 16px;
    border: none;
    padding: 11px;
    display: flex;
    transform: scale(1);
    transform-origin: center;
    transition: transform 0.14s ease;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}

body.mobile-active .mobilebutton:active:not(:disabled),
body.mobile-active .mobilebutton.mobilebutton-pressed:not(:disabled) {
    transform: scale(1.3);
}

body.mobile-active .mobilebutton:focus,
body.mobile-active .mobilebutton:focus-visible {
    outline: none;
}

body.mobile-active #mobileTopbarMenuBtn:disabled svg {
    opacity: 0.5;
}

body.mobile-active .mobilebutton.grey{
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    box-shadow: var(--mobile-button-inset);
}

body.mobile-active .mobilebutton.transp{
    background-color: transparent;
    color: var(--text-color);
}

body.mobile-active .mobilebutton.transp.small{
    padding: 8px;
    height: 40px;
    background-color: transparent;
    color: var(--text-color);
}

body.mobile-active .mobilebutton.black{
    background-color: var(--contrast-color);
    color: var(--contrast-text);
}

body.mobile-active .mobilebutton.red{
    padding: 8px;
    border: 1px solid rgba(233, 76, 76, 0.3);
    background-color: rgba(233, 76, 76, 0.15);
    color: #E94C4C;
}

body.mobile-active .mobilebutton.black.small{
    padding: 9px;
    height: 40px;
    background-color: var(--contrast-color);
    color: var(--contrast-text);
}

body.mobile-active .mobilebutton.black.small.xtreme{
    padding: 9px;
    height: 40px;
    background-color: var(--contrast);
    color: var(--contrast-text);
    margin-left: auto;
}

body.mobile-active .mobilebutton.red.small{
    padding: 8px;
    height: 40px;
    border: 1px solid rgba(233, 76, 76, 0.3);
    background-color: rgba(233, 76, 76, 0.15);
    color: #E94C4C;
}

body.mobile-active .mobilebutton.red.small.msg{
    padding: 8px;
    height: 40px;
    width: 130px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    border: 1px solid rgba(233, 76, 76, 0.3);
    background-color: rgba(233, 76, 76, 0.15);
    color: #E94C4C;
}

body.mobile-active .mobilebutton.red.small.msg svg{
    width: 24px;
    min-width: 24px;
}

body.mobile-active .mobileVoiceText{
    font-size: 0.9rem;
    color: var(--text-color);
    display: flex;
    align-self: center;
    margin-left: auto;
    margin-right: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mobile-active .mobileVoiceText.red{
    color: #E94C4C;
    margin-right: 0;
}

body.mobile-active #mobileVoiceBtn .icon-send {
    opacity: 0;
    transform: scale(0.82);
}

body.mobile-active #mobileVoiceBtn.is-release-send .icon-voice {
    opacity: 0;
    transform: scale(0.82);
}

body.mobile-active #mobileVoiceBtn.is-release-send .icon-send {
    opacity: 1;
    transform: scale(1);
}

body.mobile-active #mobileVoiceBtn .icon-voice,
body.mobile-active #mobileVoiceBtn .icon-send {
    grid-area: 1 / 1;
    transition: opacity 140ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mobile-active #mobileInputBar.voice-open #mobileVoiceUI {
    opacity: 1;
    max-height: 40px;
    min-height: 40px;
    align-self: center;
    width: calc(100% - 8px);
    margin: 8px 8px 8px;
    transform: translateY(0);
    pointer-events: auto;
}

body.mobile-active #mobileInputBar #mobileTextbox.voice-textbox-hidden {
    max-height: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    pointer-events: none !important;
}

body.mobile-active #mobileInputBar.voice-open #mobileVoiceReleaseHint {
    opacity: 1;
    transform: translateX(0);
}

body.mobile-active #mobileInputBar.voice-open.voice-delete-armed #mobileVoiceReleaseHint {
    opacity: 0;
    transform: translateX(18px);
    pointer-events: none;
}

body.mobile-active .mobile-voice-ui {
    display: flex;
    width: 100%;
    min-height: 0;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
    opacity: 0;
    max-height: 0;
    transform: translateY(8px);
    pointer-events: none;
    overflow: hidden;
    transition:
        opacity 190ms ease,
        max-height 240ms cubic-bezier(0.22, 1, 0.36, 1),
        min-height 240ms cubic-bezier(0.22, 1, 0.36, 1),
        padding 240ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mobile-active .mobile-voice-ui.hidden {
    display: none;
}

body.mobile-active #mobileInputBar #mobileVoiceUI.is-mobile-hidden {
    display: none;
}

body.mobile-active #mobileInputBar #mobileVoiceUI.is-mobile-visible {
    display: flex;
}

#mobileSidebarCustom{
    --mobile-logo-row-space: 70px;
    --mobile-userbox-space: 70px;
    --mobile-top-fade-h: 78px;
    --mobile-bottom-fade-h: 84px;
    --mobile-fade-blur: 2px;
    display: none;
    width: var(--mobile-sidebar-content-width);
    max-width: var(--mobile-sidebar-content-width);
    height: 100%;
    min-height: 100%;
    padding-top: var(--mobile-logo-row-space);
    padding-bottom: var(--mobile-userbox-space);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

body.mobile-active .sidebar.mobile-open #mobileSidebarCustom .mobileSidebarButtons,
body.mobile-active .sidebar.mobile-open #mobileSidebarCustom #mobileRecentChatsList,
body.mobile-active .sidebar.mobile-open #mobileSidebarCustom .recentChatSidebarMobile,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom .mobileSidebarButtons,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom #mobileRecentChatsList,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom .recentChatSidebarMobile {
    transform-origin: left top;
    transform: scale(var(--mobile-sidebar-scroll-scale, 1));
    opacity: var(--mobile-sidebar-scroll-opacity, 1);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
    will-change: transform, opacity;
}

body.mobile-active #mobileSidebarCustom::before,
body.mobile-active #mobileSidebarCustom::after {
    content: "";
    position: fixed;
    left: var(--mobile-sidebar-pad-x, 10px);
    width: calc(var(--mobile-sidebar-content-width) - (var(--mobile-sidebar-pad-x, 10px) * 2));
    pointer-events: none;
    z-index: 120542;
    background-color: transparent;
    -webkit-backdrop-filter: blur(var(--mobile-fade-blur));
    backdrop-filter: blur(var(--mobile-fade-blur));
}

body.mobile-active #mobileSidebarCustom::before {
    top: 0;
    height: var(--mobile-top-fade-h);
    background-image: linear-gradient(to bottom, rgba(var(--sidebar-color-rgb), 1) 30%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.95) 18%, rgba(0, 0, 0, 0.72) 44%, rgba(0, 0, 0, 0.40) 72%, rgba(0, 0, 0, 0.12) 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 70%, transparent 100%);
}

body.mobile-active #mobileSidebarCustom::after {
    bottom: -1px;
    height: var(--mobile-bottom-fade-h);
    background-image: linear-gradient(
        to top,
        rgba(var(--sidebar-color-rgb), 0.98) 0%,
        rgba(var(--sidebar-color-rgb), 0.90) 16%,
        rgba(var(--sidebar-color-rgb), 0.74) 34%,
        rgba(var(--sidebar-color-rgb), 0.52) 52%,
        rgba(var(--sidebar-color-rgb), 0.30) 70%,
        rgba(var(--sidebar-color-rgb), 0.14) 86%,
        rgba(var(--sidebar-color-rgb), 0.06) 94%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to top,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.95) 18%,
        rgba(0, 0, 0, 0.72) 44%,
        rgba(0, 0, 0, 0.40) 72%,
        rgba(0, 0, 0, 0.12) 90%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to top,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.95) 18%,
        rgba(0, 0, 0, 0.72) 44%,
        rgba(0, 0, 0, 0.40) 72%,
        rgba(0, 0, 0, 0.12) 90%,
        transparent 100%
    );
}

body.mobile-active #mobileSidebarCustom .logorowmobile {
    position: fixed;
    top: 0;
    left: var(--mobile-sidebar-pad-x, 10px);
    width: calc(var(--mobile-sidebar-content-width) - (var(--mobile-sidebar-pad-x, 10px) * 2));
    max-width: calc(var(--mobile-sidebar-content-width) - (var(--mobile-sidebar-pad-x, 10px) * 2));
    z-index: 120543;
    margin: 0;
    padding: 16px 0;
    background: transparent;
    transform-origin: left top;
    transform: scale(var(--mobile-sidebar-scroll-scale, 1));
    opacity: var(--mobile-sidebar-scroll-opacity, 1);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
    will-change: transform, opacity;
}

body.mobile-active #mobileSidebarCustom .userboxmobile {
    position: fixed;
    bottom: 12px;
    left: var(--mobile-sidebar-pad-x, 10px);
    width: calc(var(--mobile-sidebar-content-width) - (var(--mobile-sidebar-pad-x, 10px) * 2));
    max-width: calc(var(--mobile-sidebar-content-width) - (var(--mobile-sidebar-pad-x, 10px) * 2));
    z-index: 120548;
    margin: 0;
    box-sizing: border-box;
    background: var(--input-bg);
    transform-origin: left bottom;
    transform: scale(var(--mobile-sidebar-scroll-scale, 1));
    opacity: var(--mobile-sidebar-scroll-opacity, 1);
    box-shadow: var(--mobile-button-inset);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
    will-change: transform, opacity;
}

body.mobile-active .sidebar.mobile-open #mobileSidebarCustom,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom{
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Prevent iOS long-press text highlight/selection while mobile sidebar is open. */
body.mobile-active.mobile-sidebar-open #mobileSidebarCustom,
body.mobile-active.mobile-sidebar-open #mobileSidebarCustom *:not(input):not(textarea):not([contenteditable="true"]) {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

/* Allow inline chat rename input to actually receive/edit text on mobile. */
body.mobile-active.mobile-sidebar-open #mobileSidebarCustom .chat-item-title-inline-input {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

/* iOS can ignore input-level user-select overrides when ancestors are locked. */
body.mobile-active.mobile-sidebar-open #mobileSidebarCustom .chat-item-wrapper.renaming,
body.mobile-active.mobile-sidebar-open #mobileSidebarCustom .chat-item-wrapper.renaming * {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

body.mobile-active .sidebar.mobile-open #mobileSidebarCustom .mobileSidebarButtons,
body.mobile-active .sidebar.mobile-open #mobileSidebarCustom #mobileRecentChatsList,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom .mobileSidebarButtons,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom #mobileRecentChatsList{
    width: calc(var(--mobile-sidebar-content-width) - (var(--mobile-sidebar-pad-x, 10px) * 2));
    max-width: calc(var(--mobile-sidebar-content-width) - (var(--mobile-sidebar-pad-x, 10px) * 2));
    margin-right: auto;
    box-sizing: border-box;
}

body.mobile-active .sidebar.mobile-open #mobileSidebarCustom #mobileRecentChatsList,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom #mobileRecentChatsList {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
}

body.mobile-active .sidebar.mobile-open #mobileSidebarCustom #mobileRecentChatsList > .sidebarMenuButton,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom #mobileRecentChatsList > .sidebarMenuButton,
body.mobile-active .sidebar.mobile-open #mobileSidebarCustom #mobileRecentChatsList > .chat-item-wrapper,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom #mobileRecentChatsList > .chat-item-wrapper,
body.mobile-active .sidebar.mobile-open #mobileSidebarCustom #mobileRecentChatsList .chat-item-wrapper .sidebarMenuButton.chat-item,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom #mobileRecentChatsList .chat-item-wrapper .sidebarMenuButton.chat-item {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    align-self: stretch;
}

body.mobile-active .sidebar.mobile-open #mobileSidebarCustom #mobileRecentChatsList > .sidebarMenuButton.buttonMobileSidebar.chat.sidebar-menu-item,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom #mobileRecentChatsList > .sidebarMenuButton.buttonMobileSidebar.chat.sidebar-menu-item {
    -webkit-appearance: none;
    appearance: none;
}

body.mobile-active .sidebar.mobile-open #mobileSidebarCustom .buttonMobileSidebar:hover,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom .buttonMobileSidebar:hover {
    background-color: transparent !important;
}

body.mobile-active .sidebar.mobile-open #mobileSidebarCustom .buttonMobileSidebar.black:hover,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom .buttonMobileSidebar.black:hover {
    background-color: var(--contrast-color) !important;
    color: var(--contrast-text) !important;
}

body.mobile-active .sidebar.mobile-open #mobileSidebarCustom .buttonMobileSidebar:not(.black):active,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom .buttonMobileSidebar:not(.black):active {
    background-color: var(--hover-color);
}

body.mobile-active .sidebar.mobile-open #mobileSidebarCustom #mobileRecentChatsList > .sidebarMenuButton .organize-text.chat,
body.mobile-active .sidebar.mobile-closing #mobileSidebarCustom #mobileRecentChatsList > .sidebarMenuButton .organize-text.chat {
    flex: 1;
    min-width: 0;
    max-width: none;
}

body.mobile-active.mobile-sidebar-dragging .sidebar.mobile-open #mobileSidebarCustom .mobileSidebarButtons,
body.mobile-active.mobile-sidebar-dragging .sidebar.mobile-open #mobileSidebarCustom #mobileRecentChatsList,
body.mobile-active.mobile-sidebar-dragging .sidebar.mobile-open #mobileSidebarCustom .recentChatSidebarMobile,
body.mobile-active.mobile-sidebar-dragging #mobileSidebarCustom .logorowmobile,
body.mobile-active.mobile-sidebar-dragging #mobileSidebarCustom .userboxmobile,
body.mobile-active.mobile-sidebar-dragging .sidebar.mobile-closing #mobileSidebarCustom .mobileSidebarButtons,
body.mobile-active.mobile-sidebar-dragging .sidebar.mobile-closing #mobileSidebarCustom #mobileRecentChatsList,
body.mobile-active.mobile-sidebar-dragging .sidebar.mobile-closing #mobileSidebarCustom .recentChatSidebarMobile {
    transition: none !important;
}

body.mobile-active.mobile-sidebar-closing .sidebar.mobile-open #mobileSidebarCustom,
body.mobile-active.mobile-sidebar-closing .sidebar.mobile-closing #mobileSidebarCustom{
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.mobile-active .sidebar.mobile-open > .top-box-Dash,
body.mobile-active .sidebar.mobile-open > .sidebar-scroll,
body.mobile-active .sidebar.mobile-open > .user-box,
body.mobile-active .sidebar.mobile-closing > .top-box-Dash,
body.mobile-active .sidebar.mobile-closing > .sidebar-scroll,
body.mobile-active .sidebar.mobile-closing > .user-box{
    display: none !important;
}

body.mobile-active .mobiletopbartab{
    box-shadow: var(--mobile-button-inset);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    height: 45px;
    border-radius: 16px;
    justify-content: center;
    align-items: center;
    display: flex;
    flex-grow: 1;
    transform: scale3d(1, 1, 1);
    transform-origin: center center;
    will-change: transform;
    transition: transform 170ms cubic-bezier(0.22, 1, 0.36, 1);
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

body.mobile-active .mobiletopbartab.mobile-3dtouch-pressing {
    animation: mobileChatContextHoldGrow var(--mobile-chat-press-hold-ms, 460ms) cubic-bezier(0.15, 0.86, 0.28, 1) forwards;
}

body.mobile-active .mobiletopbartab.mobile-3dtouch-active {
    transform: scale3d(1.03, 1.03, 1);
    background-color: #fff !important;
    color: #000 !important;
}

body.mobile-active .mobiletopbartab.mobile-3dtouch-active > div {
    color: #000 !important;
}

body.mobile-active .mobiletopbartab.mobile-topbar-title-fluid-enter {
    animation: mobileChatContextCloneFluidIn 340ms cubic-bezier(0.18, 0.9, 0.24, 1.15) both;
}

body.mobile-active .mobileinputbar{
    gap: 8px;
    display: flex;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    -webkit-box-shadow: 0px 0px 0px 0px rgba(0,0,0,0); 
    box-shadow: 0px 0px 0px 0px rgba(0,0,0,0);
    box-shadow: var(--mobile-button-inset);
    border-radius: 24px;
    padding: 8px;
    align-items: center;
}

body.mobile-active .mobileinputbar.open{
    gap: 8px;
    display: flex;
    flex-direction: column;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    -webkit-box-shadow: 0px 0px 12px 0px rgba(0,0,0,0.1); 
    box-shadow: 0px 0px 12px 0px rgba(0,0,0,0.1);
    box-shadow: var(--mobile-button-inset);
    border-radius: 24px;
    padding: 8px;
    align-items: center;
    transition: box-shadow 0.2s ease;
}

body.mobile-active .mobileinputbottom{
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    width: 100%;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    position: relative;
}

body.mobile-active .mobileinput{
    background-color: transparent;
    padding: 16px;
    padding-bottom: 0;
    display: block;
    flex-grow: 1;
    border: none;
    font-size: 1.1rem;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    font-weight: 300;
    line-height: 1.3;
    resize: none;
    overflow-y: hidden;
    max-height: 180px;
}

.mobileinput.alone{    
  min-height: 40px;
  padding: 0 12px !important;
}

body.mobile-active .mobileinputplace{
    align-content: center;
    font-size: 1.1rem;
    color: #a9a9a9;
    min-width: 0;
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileAddFile,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceScrapBtn {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileInlinePlaceholder,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceReleaseHint {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileInlinePlaceholder {
    justify-self: stretch;
    width: 100%;
    margin-left: 0;
    display: flex;
    align-items: center;
    padding-left: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 220ms cubic-bezier(0.33, 1, 0.68, 1),
        transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileInlinePlaceholder.has-draft {
    color: var(--text-color);
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceReleaseHint {
    justify-self: end;
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceBtn,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileSendBtn {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
    display: grid;
    place-items: center;
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileAddFile,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceScrapBtn,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceBtn,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileSendBtn,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileInlinePlaceholder {
    opacity: 0;
    transform: translateY(7px) scale(0.96);
    pointer-events: none;
    transition:
        opacity 190ms ease,
        transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
        width 250ms cubic-bezier(0.22, 1, 0.36, 1),
        max-width 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileInlinePlaceholder {
    opacity: 1;
    transform: none;
    pointer-events: none;
}

body.mobile-active #mobileInputBar.is-open .mobileinputbottom > #mobileInlinePlaceholder {
    opacity: 0;
    transform: none;
    pointer-events: none;
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileAddFile.is-mobile-visible,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceScrapBtn.is-mobile-visible,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceBtn.is-mobile-visible,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileSendBtn.is-mobile-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileAddFile.is-mobile-hidden,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceScrapBtn.is-mobile-hidden,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceBtn.is-mobile-hidden,
body.mobile-active #mobileInputBar .mobileinputbottom > #mobileSendBtn.is-mobile-hidden {
    opacity: 0;
    transform: translateY(7px) scale(0.96);
    pointer-events: none;
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceReleaseHint {
    opacity: 0;
    transform: translateX(18px);
    pointer-events: none;
    transition:
        opacity 190ms ease,
        transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceReleaseHint.is-mobile-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

body.mobile-active #mobileInputBar .mobileinputbottom > #mobileVoiceReleaseHint.is-mobile-hidden {
    opacity: 0;
    transform: translateX(18px);
    pointer-events: none;
}

body.mobile-active #mobileInputBar #mobileVoiceScrapBtn {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px;
}

body.mobile-active #mobileInputBar #mobileVoiceScrapBtn > svg {
    width: 24px;
    height: 24px;
    min-width: 24px;
}

body.mobile-active #mobileInputBar.voice-open.voice-delete-armed #mobileVoiceScrapBtn {
    width: 168px;
    max-width: 168px;
}

body.mobile-active #mobileInputBar #mobileVoiceDeleteText {
    margin-left: 0;
    margin-right: 0;
    opacity: 0;
    transform: translateX(-8px);
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition:
        opacity 180ms ease,
        transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
        max-width 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mobile-active #mobileInputBar.voice-open.voice-delete-armed #mobileVoiceDeleteText.is-mobile-visible {
    opacity: 1;
    transform: translateX(0);
    max-width: 120px;
}

/* MOBILE BUTTONS – same style as desktop */
#mobileVoiceBtn.mobile-pill-btn,
#mobileStopBtn.mobile-pill-btn,
#mobileSendBtn.mobile-pill-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--contrast);
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
}

#mobileVoiceBtn.mobile-pill-btn svg,
#mobileStopBtn.mobile-pill-btn svg,
#mobileSendBtn.mobile-pill-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--background-color);
    stroke: var(--background-color);
}

#mobileVoiceBtn.mobile-pill-btn,
#mobileStopBtn.mobile-pill-btn {
    position: absolute;
    right: 10px;         /* SAME SPOT */
    top: 50%;
    transform: translateY(-50%);
}

.mobile-pill {
    position: relative;
}

textarea#mobileTextbox {
    display: block;
    margin: 0;
    line-height: 1.3;
    font-size: 1.1rem;
    padding-top: 10px;
    padding-bottom: 10px;

    /* Prevent iOS/Android from snapping to top-left */
    vertical-align: middle;
}

.mobile-hamburger {
    border: 0px;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 120551;
    background: var(--background-color);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.thinking-step-ephemeral {
    color: #4f5b66 !important;
    font-style: italic !important;
    font-size: 13px !important;
    margin: 6px 0 !important;
    padding: 4px 10px !important;
    opacity: 0.9 !important;
    pointer-events: none !important;
    display: inline-block !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, #f1f3f4 0%, #e7f0ff 50%, #f1f3f4 100%) !important;
    background-size: 200% 100% !important;
    animation: searchStepShimmer 1.4s linear infinite !important;
}

@keyframes searchStepShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.search-step-inline {
    font-family: 'Slanter-Sans', sans-serif;
    font-weight: 300;
    user-select: none;
    margin: 6px 0;
}

.search-step-inline .file-download-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    user-select: text;
}

.quiz-thinking-panel.search-step-inline {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 6px 0 8px;
    padding: 0;
}

.quiz-thinking-panel .slanter-codeblock.thinking {
    width: 100%;
    max-width: 100%;
}

.quiz-thinking-panel .quiz-thinking-label {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.search-step-inline .Thinking,
.search-thinking {
    display: flex;
    flex-direction: column;
}

/* ── Per-row layout: icon + vbar on left, text on right ── */
.search-thinking-row {
    display: flex;
    gap: 8px;
    color: var(--dark-text);
}

.search-row-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: 22px;
}

.search-thinking-vbar {
    width: 1.5px;
    background-color: currentColor;
    opacity: 0.55;
    flex-grow: 1;
    min-height: 8px;
}

.search-thinking-row-last .search-thinking-vbar {
    display: none;
}

.search-row-right {
    flex: 1;
    min-width: 0;
    padding-bottom: 14px;
}

.search-thinking-row-last .search-row-right {
    padding-bottom: 0;
}

.search-step-inline .iconthiningstep {
    width: 18px;
    height: 18px;
    padding: 2.25px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.search-thinking-icon-step{
  display: flex;
  width: 18px;
  height: 18px;
  padding: 2.25px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.search-step-inline .TopTextThink:hover .CollapseThinking,
.search-top-text-think:hover .search-collapse-thinking{
    visibility: visible;
}

.search-step-inline .TopTextThink,
.search-top-text-think {
    gap: 4px;
    display: flex;
    width: 100%;
    align-items: center;
    cursor: pointer;
    width: fit-content;
}

.search-text-steps {
    overflow: hidden;
    max-height: none;
    transition: max-height 420ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: max-height;
}

.search-text-steps-inner {
    display: flex;
    flex-direction: column;
}

.search-step-inline .Text,
.search-text {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1rem;
    width: 100%;
    color: var(--dark-text);
    line-height: 1.35;
}

@property --sidebar-w {
    syntax: "<length>";
    inherits: true;
    initial-value: 290px;
}

@property --shimmer-pos {
    syntax: "<percentage>";
    inherits: true;
    initial-value: 200%;
}

@property --shimmer-pos-2 {
    syntax: "<percentage>";
    inherits: true;
    initial-value: 200%;
}

/* Animations live on the panel itself (its `content` never changes), so the
   shimmer keeps progressing smoothly even when streamed text re-creates the
   ::after pseudo-elements that read these custom properties below. */
.search-thinking:not(.is-done) {
    animation: textSweepVar 3s linear infinite, textSweepVar2 2.4s linear infinite;
}

.search-thinking:not(.is-done) .Text::after,
.search-thinking:not(.is-done) .search-header-text::after,
.search-thinking:not(.is-done) .search-text-active::after {
    content: attr(data-text);
    position: absolute;
    inset: 0 0 0 0;
    background: linear-gradient(90deg, transparent 30%, var(--thinking-shimmer) 50%, transparent 70%);
    background-size: 230% 100%;
    background-repeat: no-repeat;
    background-position: var(--shimmer-pos) 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    mix-blend-mode: normal;
    pointer-events: none;
}

.search-thinking.kind-thinking:not(.is-done) .search-text-query::after {
    content: none;
}

.quiz-thinking-panel .search-thinking:not(.is-done) .search-text-query::after {
    inset: 2px auto auto 0;
    width: fit-content;
    max-width: 100%;
    height: 1.35em;
}

@keyframes textSweep {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@keyframes textSweepVar {
    from { --shimmer-pos: 200%; }
    to { --shimmer-pos: -200%; }
}

@keyframes textSweepVar2 {
    from { --shimmer-pos-2: 200%; }
    to { --shimmer-pos-2: -200%; }
}

.search-step-inline .CollapseThinking,
.search-collapse-thinking {
    transform: rotate(90deg);
    display: flex;
    color: var(--med-text);
    height: 16px;
    min-width: 16px;
    visibility: hidden;
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.word-thinking-panel .search-collapse-thinking {
    visibility: visible;
}

/* Suppress broad shimmer on all word rows */
.word-thinking-panel .search-thinking:not(.is-done) .Text::after {
    content: none;
}

/* Shimmer only on the label text, not the codeblock */
.word-thinking-panel .search-thinking:not(.is-done) .word-step-label {
    position: relative;
    display: inline;
}

.word-thinking-panel .search-thinking:not(.is-done) .word-step-label::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 30%, var(--thinking-shimmer, rgba(150,150,150,0.35)) 50%, transparent 70%);
    background-size: 230% 100%;
    background-repeat: no-repeat;
    background-position: var(--shimmer-pos-2) 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    mix-blend-mode: normal;
    pointer-events: none;
}

.search-collapse-thinking.is-collapsed {
    transform: rotate(0deg);
}

.search-step-inline .Text.top:hover {
    color: var(--med-text);
}

.search-step-inline .Text:hover::after,
.search-header-text:hover::after,
.search-text-active:hover::after {
    background: linear-gradient(90deg, transparent 40%, transparent 50%, transparent 60%);
}

.search-text-completed {
    color: var(--dark-text);
}

.search-thinking.is-done .search-text-active::after,
.search-thinking.is-done .search-header-text::after {
    animation: none;
}

.search-thinking.is-collapsed .search-verticalbar,
.search-thinking.is-collapsed .search-thinking-vbar {
    opacity: 0;
}

.quiz-thinking-panel .search-thinking-row {
    transition:
        opacity 360ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-thinking-panel .quiz-thinking-row-success,
.quiz-thinking-panel .quiz-thinking-row-done {
    display: none;
}

.quiz-thinking-panel[data-quiz-thinking-stage="success"] .quiz-thinking-row-success,
.quiz-thinking-panel[data-quiz-thinking-stage="done"] .quiz-thinking-row-success,
.quiz-thinking-panel[data-quiz-thinking-stage="done"] .quiz-thinking-row-done {
    display: flex;
}

.quiz-thinking-panel .search-thinking.is-finalizing .search-thinking-row.quiz-step-waiting {
    opacity: 0.52;
    transform: translateY(2px);
}

.quiz-thinking-panel .search-thinking.is-finalizing .search-thinking-row.quiz-step-complete {
    opacity: 1;
    transform: translateY(0);
}

.word-thinking-panel .search-thinking-row {
    transition:
        opacity 360ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.word-thinking-panel .word-thinking-row-render,
.word-thinking-panel .word-thinking-row-attach,
.word-thinking-panel .word-thinking-row-done {
    display: none;
}

.word-thinking-panel[data-word-thinking-stage="render"] .word-thinking-row-render,
.word-thinking-panel[data-word-thinking-stage="attach"] .word-thinking-row-render,
.word-thinking-panel[data-word-thinking-stage="done"] .word-thinking-row-render,
.word-thinking-panel[data-word-thinking-stage="attach"] .word-thinking-row-attach,
.word-thinking-panel[data-word-thinking-stage="done"] .word-thinking-row-attach,
.word-thinking-panel[data-word-thinking-stage="done"] .word-thinking-row-done {
    display: flex;
}

.search_result_Box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    max-width: min(520px, 100%);
}

.search_result_item {
    padding: 6px;
    display: flex;
    gap: 8px;
    align-items: center;
    border-radius: 6px;
    transition: background 0.2s ease;
    text-decoration: none;
    min-width: 0;
}

.search_result_item:hover {
    color: var(--text-color) !important;
    background-color: var(--sidebar-color);
}

.favicon_search_result_item {
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.favicon_search_result_item img {
    display: block;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.favicon_search_result_fallback {
    color: var(--med-text);
    font-size: 0.72rem;
    line-height: 1;
    position: absolute;
}

.search_result_item_text {
    color: var(--med-text);
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.search_result_item_text.normal {
    font-size: 0.92rem;
    opacity: 0.8;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.search_result_item_text.small {
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.5;
    flex: 0 0 auto;
    max-width: 34%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search_result_item:hover .search_result_item_text.normal {
    opacity: 1;
}

.search_result_item:hover .search_result_item_text.small {
    opacity: 0.8;
}

.circle-btn.add-file-btn {
    margin-left: 0px;
}

#deletePopup.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto; /* IMPORTANT */
}

#deletePopup .modal-box {
    pointer-events: auto; /* Make buttons clickable */
    z-index: 999999;
}

#deletePopup.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* --- FIX MOBILE MIC/SEND ALIGNMENT TO MATCH FILE BUTTON --- */
@media (max-width: 900px) {
  #mobileVoiceBtn,
  #mobileStopBtn,
  #mobileSendBtn {
      position: static !important;      /* no absolute centering */
      transform: scale(1) !important;
      margin-left: 4px;                 /* tiny gap between buttons */
  }

  #mobileVoiceBtn:active:not(:disabled),
  #mobileStopBtn:active:not(:disabled),
  #mobileSendBtn:active:not(:disabled),
  #mobileVoiceBtn.mobilebutton-pressed:not(:disabled),
  #mobileStopBtn.mobilebutton-pressed:not(:disabled),
  #mobileSendBtn.mobilebutton-pressed:not(:disabled) {
      transform: scale(1.3) !important;
  }

  .mobile-pill {
      align-items: flex-end;            /* keep everything pinned to bottom */
  }
}

.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0s linear 0s;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.modal-content {
    background: var(--bg);
    padding: 20px;
    border-radius: 12px;
    width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-close-btn {
    margin-top: 20px;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: var(--contrast-color);
    cursor: pointer;
}

.copy-icon-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.copy-icon-btn:hover svg {
    opacity: 0.75;
}

/* Remove focus outline box */
.copy-icon-btn:focus {
    outline: none;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stream-inline-thinkdot {
  display: inline-flex;
  width: 30px;
  height: 30px;
  margin-left: 4px;
  vertical-align: text-bottom;
  pointer-events: none;
}

.stream-inline-thinkdot-canvas,
.stream-inline-thinkdot-lottie {
  width: 100%;
  height: 100%;
  display: block;
}

.thinking-dot-icon-slot {
  position: relative;
}

.thinking-dot-icon-slot .stream-inline-thinkdot {
  width: 100%;
  height: 100%;
  margin-left: 0;
}

.search-text-query-line {
  display: inline;
}

.thinking-dot-inline-slot {
  display: inline-flex;
  vertical-align: text-bottom;
}

.stream-word-fade {
  opacity: 0;
  display: inline-block;
  line-height: inherit;
  animation: streamWordFadeIn 190ms cubic-bezier(0.22, 0.72, 0.2, 1) forwards;
  will-change: opacity;
}

@keyframes streamWordFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.typing-indicator.hidden {
  display: none;
}

.analysis-text {
  font-size: 13px;
  color: #888;
  margin-left: 6px;
  white-space: nowrap;
}

.analysis-text.hidden {
  display: none;
}

.analysis-text {
  display: block;
  font-size: 13px;
  color: #888;
}

.analysis-text.hidden {
  display: none;
}

.bot-actions-row {
    gap: 4px; /* tighter spacing overall */
}

.bot-action-btn {
  border: none;
  background: transparent;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--light-text);
  margin-right: 0; /* remove extra gaps if present */
}

.bot-action-btn:hover {
  background: var(--border-color);
  color: var(--contrast);
  opacity: 1;
}

.bot-action-btn svg {
  width: 18px;
  height: 18px;
  transition: color 0.15s ease;
}

.bot-action-btn.saved {
  color: var(--light-text);
}

@media (min-width: 901px) and (hover: hover) and (pointer: fine) {
  .bot-actions-row {
    opacity: 0 !important;
    pointer-events: auto;
    padding-top: 4px;
    margin-top: -2px !important;
    position: relative;
    transition: opacity 0.14s ease;
  }

  .message.bot + .bot-actions-row::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
  }

  .message.bot:hover + .bot-actions-row,
  .message.bot:focus-within + .bot-actions-row,
  .bot-actions-row:hover,
  .bot-actions-row:focus-within {
    opacity: 1 !important;
  }
}

.chat-item-wrapper {
    transition: opacity 120ms ease;
}

body.mobile-active .chat-item-wrapper {
    transition: opacity 120ms ease, transform 170ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mobile-active .chat-item-wrapper .chat-item {
    transition: transform 170ms cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: left center;
    will-change: transform;
}

body.mobile-active .chat-item-wrapper.mobile-3dtouch-pressing .chat-item {
    animation: mobileChatContextHoldGrow var(--mobile-chat-press-hold-ms, 460ms) cubic-bezier(0.15, 0.86, 0.28, 1) forwards;
}

body.mobile-active .chat-item-wrapper.mobile-3dtouch-active .chat-item {
    transform: scale3d(1.03, 1.03, 1);
    background-color: #fff !important;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    transition: none !important;
}

body.mobile-active .chat-item-wrapper.mobile-3dtouch-active .chat-item .chat-item-title,
body.mobile-active .chat-item-wrapper.mobile-3dtouch-active .chat-item svg,
body.mobile-active .chat-item-wrapper.mobile-3dtouch-active .chat-item .organize-text.chat {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
}

@keyframes mobileChatContextHoldGrow {
    0% {
        transform: scale3d(1, 1, 1);
    }
    46% {
        transform: scale3d(1.016, 0.996, 1);
    }
    100% {
        transform: scale3d(1.03, 1.03, 1);
    }
}

/* Keep rename text visible with explicit contrast pairing while editing. */
body.mobile-active .chat-item-wrapper.renaming {
    position: relative;
    z-index: 2147483605;
}

body.mobile-active.mobile-inline-rename-active .sidebar.mobile-open,
body.mobile-active.mobile-inline-rename-active .sidebar.mobile-closing {
    --mobile-sidebar-scroll-scale: 1 !important;
    --mobile-sidebar-scroll-opacity: 1 !important;
    overflow: visible;
}

body.mobile-active.mobile-inline-rename-active #mobileSidebarCustom,
body.mobile-active.mobile-inline-rename-active #mobileSidebarCustom .mobileSidebarButtons,
body.mobile-active.mobile-inline-rename-active #mobileSidebarCustom #mobileRecentChatsList {
    overflow-x: visible;
}

body.mobile-active.mobile-inline-rename-active #mobileSidebarCustom .chat-item-wrapper.renaming .chat-item {
    width: calc(100% + 10px);
    max-width: none !important;
    margin-right: -10px;
    transform: scale3d(1.03, 1.03, 1) !important;
    transition: none !important;
    animation: none !important;
}

body.mobile-active.mobile-chat-context-open .chat-item-wrapper.mobile-chat-context-source > .chat-item {
    visibility: hidden !important;
    pointer-events: none !important;
}

body.mobile-active.mobile-chat-context-open .chat-item-wrapper.mobile-3dtouch-active .ChatDropdown.chat-dropdown {
    position: fixed !important;
    z-index: 2147483605 !important;
}

body.mobile-active.mobile-chat-context-open .ChatFolderDropdown.chat-folder-dropdown {
    z-index: 2147483606 !important;
}

.mobile-chat-context-layer {
    position: fixed;
    inset: 0;
    z-index: 2147483600;
    pointer-events: none;
    display: none;
    isolation: isolate;
}

body.mobile-active.mobile-chat-context-open.mobile-collections-row-context-open .mobile-chat-context-layer {
    z-index: 2147483610;
}

.mobile-chat-context-layer.is-visible {
    display: block;
}

.mobile-chat-context-dim {
    position: fixed;
    inset: 0;
    z-index: 1;
    border: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
}

/* Dim background for collections row long-press context menus. */
body.mobile-active.mobile-chat-context-open.mobile-collections-row-context-open .mobile-chat-context-dim {
    background: rgba(0, 0, 0, 0.22);
}

body.mobile-active.mobile-chat-context-open.mobile-collections-row-context-open .mobileCollectionsSwipeRowShell.is-longpress-pressing,
body.mobile-active.mobile-chat-context-open.mobile-collections-row-context-open .mobileCollectionsSwipeRowShell.is-context-open {
    position: relative;
    z-index: 2147483602;
}

body.mobile-active.mobile-chat-context-open.mobile-collections-row-context-open .mobileCollectionsSwipeRowShell.is-longpress-pressing .mobileCollectionsSwipeRow,
body.mobile-active.mobile-chat-context-open.mobile-collections-row-context-open .mobileCollectionsSwipeRowShell.is-context-open .mobileCollectionsSwipeRow {
    position: relative;
    z-index: 2147483603;
}

.mobile-chat-context-clone-host .mobileCollectionsSwipeRowShell.mobile-collections-context-shell-clone {
    position: fixed !important;
    margin: 0 !important;
    z-index: 2147483602;
    pointer-events: none;
}

.mobile-chat-context-clone-host .mobileCollectionsSwipeRowShell.mobile-collections-context-shell-clone .mobileCollectionsSwipeRow {
    position: relative;
    z-index: 2147483603;
}

.mobile-chat-context-menu-host .mobileCollectionsSwipeRowShell.mobile-collections-context-shell-clone {
    position: fixed !important;
    margin: 0 !important;
    z-index: 2147483604 !important;
    pointer-events: none;
}

.mobile-chat-context-menu-host .mobileCollectionsSwipeRowShell.mobile-collections-context-shell-clone .mobileCollectionsSwipeRow {
    position: relative;
    z-index: 2147483605 !important;
    background: #fff !important;
    color: #000 !important;
    opacity: 1 !important;
    filter: none !important;
}

.mobile-chat-context-menu-host .mobileCollectionsSwipeRowShell.mobile-collections-context-shell-clone .mobileCollectionsSwipeRow::before,
.mobile-chat-context-clone-host .mobileCollectionsSwipeRowShell.mobile-collections-context-shell-clone .mobileCollectionsSwipeRow::before {
    opacity: 0 !important;
    animation: none !important;
}

.mobile-chat-context-menu-host .mobileCollectionsSwipeRowShell.mobile-collections-context-shell-clone .collectionSlideupBox,
.mobile-chat-context-menu-host .mobileCollectionsSwipeRowShell.mobile-collections-context-shell-clone .collectionSlideupBox *,
.mobile-chat-context-menu-host .mobileCollectionsSwipeRowShell.mobile-collections-context-shell-clone .mobileCollectionOptionIcon,
.mobile-chat-context-menu-host .mobileCollectionsSwipeRowShell.mobile-collections-context-shell-clone .mobileCollectionOptionIcon *,
.mobile-chat-context-menu-host .mobileCollectionsSwipeRowShell.mobile-collections-context-shell-clone .SmallerSlideUpText {
    opacity: 1 !important;
    filter: none !important;
}

/* In collections-row context mode, keep the topbar behind the dim. */
body.mobile-active.mobile-chat-context-open.mobile-collections-row-context-open #mobileTopbar {
    z-index: 2147483599 !important;
}

body.mobile-active.mobile-chat-context-open.mobile-collections-row-context-open #mobileTopbar::after {
    content: none !important;
    display: none !important;
}

/* While inline-renaming from topbar, force the topbar dim back on. */
body.mobile-active.mobile-chat-context-open.mobile-collections-row-context-open.mobile-topbar-inline-rename-active #mobileTopbar::after,
body.mobile-active.mobile-chat-context-open.mobile-topbar-inline-rename-active #mobileTopbar::after,
body.mobile-active.mobile-topbar-inline-rename-active #mobileTopbar::after {
    content: "" !important;
    display: block !important;
    position: absolute;
    height: 100vh;
    inset: 0;
    background: rgba(0, 0, 0, 0.22);
    pointer-events: none;
    z-index: 2147483606;
}

/* While inline-renaming from topbar, keep topbar stack above page dim. */
body.mobile-active.mobile-topbar-inline-rename-active #mobileTopbar {
    z-index: 2147483607 !important;
    pointer-events: auto !important;
}

body.mobile-active.mobile-topbar-inline-rename-active #mobileTopbar .mobiletopbartab {
    position: relative;
    z-index: 2147483608 !important;
}

.mobile-chat-context-clone-host {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

body.mobile-active.mobile-inline-rename-active .mobile-chat-context-clone-host {
    pointer-events: none;
}

.mobile-chat-context-menu-host {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.mobile-chat-context-topbar-host {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.mobile-chat-context-menu-host .ChatDropdown.mobile-chat-context-portaled,
.mobile-chat-context-menu-host .ChatFolderDropdown.mobile-chat-context-portaled {
    position: fixed !important;
    z-index: 2147483605 !important;
    pointer-events: auto;
}

.mobile-chat-context-menu-host .ChatFolderDropdown.mobile-chat-context-portaled {
    z-index: 2147483606 !important;
}

.mobile-chat-context-menu-host .ChatDropdown.mobile-chat-context-portaled.mobile-chat-context-enter,
.mobile-chat-context-menu-host .ChatFolderDropdown.mobile-chat-context-portaled.mobile-chat-context-enter {
    animation: mobileChatContextMenuSlideUp 260ms cubic-bezier(0.22, 0.9, 0.24, 1) both;
    will-change: transform, opacity;
}

.mobile-chat-context-menu-host .ChatDropdown.mobile-chat-context-portaled.mobile-topbar-context-menu.mobile-chat-context-enter,
.mobile-chat-context-menu-host .ChatFolderDropdown.mobile-chat-context-portaled.mobile-topbar-context-menu.mobile-chat-context-enter {
    animation: mobileChatContextMenuSlideDown 260ms cubic-bezier(0.22, 0.9, 0.24, 1) both;
}

@keyframes mobileChatContextMenuSlideUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 14px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes mobileChatContextMenuSlideDown {
    0% {
        opacity: 0;
        transform: translate3d(0, -14px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.mobile-chat-context-clone {
    position: fixed !important;
    margin: 0 !important;
    transform: scale3d(1.03, 1.03, 1);
    transform-origin: left center;
    background: var(--contrast-color) !important;
    color: #000 !important;
    z-index: 130010;
    pointer-events: none;
    box-sizing: border-box;
}

.mobile-chat-context-clone.mobile-chat-context-clone-enter {
    animation: mobileChatContextCloneFluidIn 340ms cubic-bezier(0.18, 0.9, 0.24, 1.15) both;
}

@keyframes mobileChatContextCloneFluidIn {
    0% {
        transform: scale3d(1.01, 0.9, 1);
    }
    40% {
        transform: scale3d(1.05, 1.06, 1);
    }
    70% {
        transform: scale3d(1.022, 0.99, 1);
    }
    100% {
        transform: scale3d(1.03, 1.03, 1);
    }
}

.mobile-chat-context-clone.is-inline-rename {
    pointer-events: auto;
    transform: scale3d(1.03, 1.03, 1) !important;
    transition: none !important;
    animation: none !important;
    touch-action: manipulation;
}

.mobile-chat-context-topbar-host .mobile-topbar-context-clone {
    position: fixed !important;
    margin: 0 !important;
    z-index: 2147483607;
    pointer-events: none;
}

/* Keep the topbar title pill above the mobile context dim layer. */
body.mobile-active.mobile-chat-context-open #mobileTopbar {
    z-index: 2147483607 !important;
    pointer-events: auto !important;
}

body.mobile-active.mobile-chat-context-open #mobileTopbar::after {
    content: "";
    position: absolute;
    height: 100vh;
    inset: 0;
    background: rgba(0, 0, 0, 0.22);
    pointer-events: none;
    z-index: 2147483606;
}

body.mobile-active.mobile-chat-context-open #mobileTopbar > :not(.mobiletopbartab) {
    position: relative;
    z-index: 2147483605 !important;
}

body.mobile-active.mobile-chat-context-open #mobileTopbar .mobiletopbartab {
    position: relative;
    z-index: 2147483607 !important;
}

body.mobile-active.mobile-chat-context-open #mobileTopbar .mobiletopbartab.mobile-3dtouch-active {
    position: relative;
    z-index: 2147483608 !important;
}

/* Use custom context dim, not sidebar's built-in dim layer, while chat context menu is open. */
body.mobile-active.mobile-chat-context-open .sidebar.mobile-open::after,
body.mobile-active.mobile-chat-context-open .sidebar.mobile-closing::after {
    background: transparent !important;
}

body.mobile-active.mobile-chat-context-open #mobileSidebarOverlay {
    background: transparent !important;
    pointer-events: none !important;
}

body.mobile-active.mobile-chat-context-open #mobileSidebarCustom {
    overflow: hidden;
}

/* ===============================
   INPUT TOOL EXPANDING PILLS
   (MATCH INPUT BAR BUTTON SIZE)
================================ */

.input-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Base pill = SAME SIZE as circle buttons */
.input-tool {
    color: var(--blue-accent);
    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    gap: 10px;

    border-radius: 8px;
    border: none;
    background: var(--blue-accent-light);

    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    justify-content: center;  

    transition:
        max-width 0.25s ease,
        background 0.15s ease,
        border-color 0.15s ease;
}

.input-tool:not(.active):hover {
    color: var(--blue-accent);
}

/* Icon size matches other buttons */
.input-tool svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Label hidden until expanded */
.input-tool span {
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* Expanded pill */
.input-tool.active {
    max-width: 180px;
    background: var(--highlight-bg);
    color: var(--highlight-text);
}

.input-tool.active span {
    opacity: 1;
}

/* =========================================
   INPUT BAR: LEFT TOOLS, RIGHT ACTIONS
   FINAL FIX (NO HACKS)
========================================= */

/* Both bars align from the left */
.bottom-bar,
.centered-bottom-bar {
    justify-content: flex-start !important;
    position: relative;
}

/* Pills sit immediately after + */
.input-tools {
    margin-left: 8px;
}

.model-switch-btn {
  margin-right: 8px;
}

/* Push mic + everything after it to the right */
.model-switch-btn {
    margin-left: auto !important;
}

#voiceBtn,
#voiceCenteredBtn {
    transition: opacity 0.4s ease;
}

#voiceBtn.composer-action-voice-hidden,
#voiceCenteredBtn.composer-action-voice-hidden {
    opacity: 0;
    pointer-events: none;
}

#submitBtn.composer-action-send-prep,
#inputCenteredSend.composer-action-send-prep {
    opacity: 0;
    position: absolute;
    right: 16px;
    bottom: -1px;
    margin-left: 0 !important;
    transform: translateX(10px) translateY(-50%);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0, 0, 0, 1.64);
}

#submitBtn.composer-action-send-visible,
#inputCenteredSend.composer-action-send-visible {
    position: absolute;
    right: 16px;
    bottom: -1px;
    margin-left: 0 !important;
    opacity: 1;
    transform: translateX(0) translateY(-50%);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0, 0, 0.14, 0.97);
}

/* ===============================
   GLOBAL TOOLTIP (UNCLIPPABLE)
================================ */

#globalTooltip {
    position: fixed;
    z-index: 12020000;
    background: var(--contrast);
    color: var(--contrast-text);
    font-size: 0.8rem;
    font-weight: 300;
    padding: 4px 6px;
    border-radius: 6px;
    white-space: pre;
    pointer-events: none;

    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    box-shadow: var(--black-shadow);
}

#globalTooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===============================
   GET PLUS BUTTON (USER BOX)
================================ */

.user-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.get-plus-btn {
  color: var(--contrast-text);
  background-color: var(--light-background);
  border: none;
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.get-plus-btn:hover {
    background: var(--light-background-hover);
}


.get-plus-btn.hidden {
    display: none !important;
}

/* Hide when sidebar collapsed */
.sidebar.collapsed .get-plus-btn {
    display: none !important;
}

/* ===============================
   USER BOX LAYOUT ADJUSTMENTS
================================ */

/* Make inner row stretch full width */
.user-inner {
    display: flex;
    align-items: center;
    width: 100%;
    transition: padding 0.2s ease;
}

/* User info grows, pushing Get Plus right */
.user-info {
    flex: 1;
}

/* Row with username + button */
.user-name-row {
    display: flex;
    align-items: center;
}

/* Push Get Plus to the far right */
#getPlusBtn {
    margin-left: auto;
}

/* =========================================================
   MOBILE: FULL-WIDTH EXPANDING PILL FROM THE + BUTTON
   -  stays next to +
   - expanded panel matches width of the normal mobile pill
   - no icon bleed when closed
========================================================= */

@media (max-width: 900px) {

  /* keep wrapper in the row so textarea is always beside it */
  .mobile-tools-wrapper {
    position: relative;
    flex: 0 0 auto;
    z-index: 6001; /* above the pill contents */
  }

  /* + button: NO background when closed */
  #mobileAddFile.mobile-pill-btn {
    background: transparent !important;
  }

  /* panel is anchored to the FULL .mobile-pill width */
  .mobile-pill { position: relative; } /* already true, but ensure */

  .mobile-tools-panel {
    position: absolute;

    /* FULL WIDTH of the mobile input pill */
    left: 0;
    right: 0;

    /* Grow upward from the pill */
    bottom: calc(100% + 8px);

    /* match your pill rounding/feel */
    background: var(--input-bg, var(--background-color));
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 28px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.20);

    /* stack buttons */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;

    padding: 12px;

    /* CLOSED STATE (hidden cleanly) */
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
  }

  /* open */
  .mobile-tools-wrapper.open .mobile-tools-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity 0.14s ease, transform 0.14s ease;
  }

  /* HARD prevent bleed-through when closed */
  .mobile-tools-wrapper:not(.open) .mobile-tools-panel * {
    display: none !important;
  }

  /* tool buttons (circle) */
  .mobile-tool-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #f4f4f5;

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

  /* Tool SVG sizing */
.mobile-tool-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
}

  /* ===============================
   MOBILE TOOL ACTIVE STATES
   (MATCH DESKTOP INPUT TOOLS)
================================ */

.mobile-tool-btn {
  border: 1px solid transparent;
}

/* Flashcards */
.mobile-tool-btn.flashcards.active {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

/* Web */
.mobile-tool-btn.web.active {
  background: #ecfeff;
  border-color: #67e8f9;
  color: #0e7490;
}

/* Study */
.mobile-tool-btn.study.active {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

/* Quiz */
.mobile-tool-btn.quiz.active {
  background: #fff7ed;
  border-color: #fdba74;
    color: #9a3412;
}

  /* + to X */
  #mobilePlusIcon { transition: transform 0.18s ease; }
  .mobile-tools-wrapper.open #mobilePlusIcon { transform: rotate(45deg); }
}

/* ===============================
   MOBILE TOOL PANEL – SLIM CAPSULE
================================ */

@media (max-width: 900px) {

  .mobile-tools-panel {
    left: 50%;
    transform: translateX(-50%) translateY(4px);

    width: max-content;
    min-width: 44px;

    padding: 10px 10px;          /* 🔥 MUCH tighter */
    padding-right: 8px;
    gap: 6px;                 /* tighter vertical spacing */

    border-radius: 999px;
  }

  .mobile-tools-wrapper.open .mobile-tools-panel {
    transform: translateX(-50%) translateY(0);
  }

}

#chatTopBar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 28px;
  background: var(--background-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}

.chat-title {
  font-weight: 600;
  font-size: 15px;
}

.chat-tools {
  display: flex;
  gap: 8px;
}

.topbar-btn {
  border: none;
  background: #f3f3f3;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}

.topbar-btn.active {
  background: #e6f0ff;
}

.flashcard-bg {
  background: radial-gradient(circle at top left, #ff9a9e, #a18cd1);
  padding: 40px;
  border-radius: 24px;
  color: var(--background-color);
  position: relative;
}

.flashcard {
  font-size: 32px;
  text-align: center;
  cursor: pointer;
  background: transparent;
}

.flashcard.flipped {
  background: var(--border-color);
  color: var(--contrast);
  padding: 40px;
  border-radius: 16px;
}

.flashcard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

/* ============================
   TOOL OVERLAY
============================ */

#toolOverlay {
  position: fixed;
  inset: 0;
  background: var(--background-color);
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
}

#toolOverlay[hidden] {
  display: none;
}

#toolOverlayContent {
  width: 90%;
  max-width: 900px;
}

.tool-message-btn {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f3f3f3;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

/* =========================
   TOOL OVERLAY (GLOBAL)
========================= */
#toolOverlay {
  position: fixed;
  inset: 0;
  background: var(--background-color);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

#toolOverlay[hidden] { display: none !important; }

#toolOverlayContent {
  width: min(940px, 94vw);
}

/* top bar button active */
.topbar-btn.active {
  background: #111 !important;
  color: var(--background-color) !important;
  border-color: #111 !important;
}

/* =========================
   FLASHCARDS UI
========================= */
.flashcard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flashcard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flashcard-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.flashcard-close {
  border: 1px solid #e5e7eb;
  background: var(--background-color);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.flashcard-stage {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.flashcard-bg {
  position: absolute;
  inset: 0;
  filter: blur(28px);
  transform: scale(1.25);
  opacity: 0.95;
}

.flashcard-card {
  position: relative;
  min-height: 280px;
  border-radius: 22px;
  padding: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.flashcard-card.front {
  color: #0b0b0b;
}

.flashcard-card.back {
  background: #f3f4f6;
  color: #0b0b0b;
}

.flashcard-text {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
  max-width: 90%;
}

.flashcard-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.flashcard-nav button {
  flex: 1;
  border: 1px solid #e5e7eb;
  background: var(--background-color);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  font-weight: 600;
}

/* =========================
   QUIZ UI
========================= */
.quiz-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quiz-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-close {
  border: 1px solid #e5e7eb;
  background: var(--background-color);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.quiz-stage {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.quiz-bg {
  position: absolute;
  inset: 0;
  filter: blur(28px);
  transform: scale(1.25);
  opacity: 0.95;
}

.quiz-card {
  width: min(520px, 86%);
  height: 420px;               /* 👈 ADD */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quiz-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 10px 0;
}

.quiz-option {
  display: grid;
  gap: 10px;
}

.quiz-option {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  font-weight: 600;
}

.quiz-option.correct {
  background: var(--green-bg-transp);
  border-color: var(--green-text);
}

.quiz-option.wrong {
  background: var(--red-bg-transp);
  border-color: var(--red-text);
}

.quiz-result {
  position: relative;
  background: var(--background-color);
  border: none;
  border-radius: 13px;
  padding: 22px;
  margin: 18px;
}

/* ============ TOP BAR ============ */
.chat-topbar{
  --topbar-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: sticky;
  top: 0;
  padding: 0 8px 0 0;
  z-index: 120000;
  background: var(--sidebar-color);
  border-bottom: none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  overflow: visible;
  isolation: isolate;
}

.chat-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border-color);
  pointer-events: none;
  z-index: 0;
}
.chat-topbar-title{
  font-size: 18px;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.chat-topbar-title::before,
.chat-topbar-title::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 1px;
  width: 34px;
  pointer-events: none;
  z-index: 35;
  opacity: 0;
  transition: opacity 220ms var(--topbar-ease);
}

.chat-topbar-title::before {
  left: 0;
  background: linear-gradient(to right, var(--sidebar-color) 0%, transparent 100%);
}

.chat-topbar-title::after {
  right: 0;
  background: linear-gradient(to left, var(--sidebar-color) 0%, transparent 100%);
}

.chat-topbar-title.has-overflow-left::before {
  opacity: 1;
}

.chat-topbar-title.has-overflow-right::after {
  opacity: 1;
}
.chat-topbar-actions{
  background-color: transparent;
  display:flex;
  gap:10px;
  position: relative;
  flex-shrink: 0;
  flex: 0 0 auto;
  z-index: 20;
}

.chat-topbar-actions.topbar-actions-placeholder {
  width: 44px;
  min-width: 44px;
  pointer-events: none;
}

body.topbar-tab-dragging .chat-topbar-title {
  z-index: 40;
}

body.topbar-tab-dragging .chat-topbar-actions {
  z-index: 20;
}
.topbar-text-btn{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #c9c4bd;
  background:#f2eee9;
  color:#2b2a29;
  cursor:pointer;
  transition:
    transform 140ms var(--topbar-ease),
    background-color 220ms var(--topbar-ease);
}
.topbar-text-btn:hover{
  background:#e8e2da;
}
.topbar-text-btn:active{
  transform: translateY(1px);
}
.topbar-icon-btn{
  width:36px;
  height:36px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background:var(--background-color);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:
    border-color 220ms var(--topbar-ease),
    background-color 220ms var(--topbar-ease),
    color 220ms var(--topbar-ease);
}
.topbar-icon-btn.active{
  border-color:#111;
}

.topbar-menu-btn.toast{
  z-index: 0;
  width: 40px;
  height: 40px;
  padding: 7px;
  border-radius: 13px;
  margin-left: 4px;
}

.topbar-menu-btn{
  width:36px;
  height:36px;
  border-radius: 8px;
  margin-left: 8px;
  z-index: 21;
  border: none;
  background:none;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color: var(--text-color);
}
.topbar-menu-btn:hover{
  background:var(--hover-color);
}

/* Keep tab rail position stable when menu button is unavailable on non-chat tabs. */
.chat-topbar-actions > .topbar-menu-btn.hidden {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

/* ============ OVERLAY ============ */
#toolOverlay{
  position: fixed;
  inset: 0;
  background: var(--background-color);
  z-index: 50;
  display:flex;
  justify-content:center;
  align-items:flex-start;
}
#toolOverlayContent{
  width: 92%;
  max-width: 1100px;
}

.tool-page{ padding: 10px 10px 20px; }
.tool-backrow{ display:flex; justify-content:flex-start; margin-bottom: 8px; }
.tool-backbtn{
  border:none;
  background: transparent;
  font-weight:600;
  cursor:pointer;
}
.tool-title{ font-weight:700; margin: 10px 0 12px; }

.tool-gradient-panel{
  position: relative;
  border-radius: 22px;
  padding: 18px;
  min-height: 420px;
  overflow:hidden;
}

.tool-progress{
  position:absolute;
  top:16px;
  left:16px;
  display:flex;
  gap:10px;
  align-items:center;
  color:var(--background-color);
}
.progress-circle{
  width:18px;
  height:18px;
  border-radius:50%;
  border: 2px solid rgba(255,255,255,0.9);
}
.progress-text{ font-weight:600; }

.tool-nav{
  position:absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display:flex;
  justify-content:space-between;
}
.tool-navbtn{
  width:42px;
  height:42px;
  border-radius: 14px;
  border:none;
  background: rgba(255,255,255,0.25);
  color:var(--background-color);
  font-size: 18px;
  cursor:pointer;
}

/* Flashcard */
.flashcard{
  width:100%;
  height: 360px;
  border-radius: 18px;
  border:none;
  background: transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.flashcard.flipped{
  background: var(--border-color);
}
.flashcard-text{
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 1px;
  color:var(--background-color);
  text-align:center;
  padding: 0 30px;
}
.flashcard.flipped .flashcard-text{
  color:#111;
}

/* Quiz */
.quiz-card{
  width: 420px;
  max-width: 100%;
  background:var(--background-color);
  border-radius: 18px;
  padding: 18px;
  margin: 60px auto;
}
.quiz-q{
  font-weight:700;
  text-align:center;
  margin-bottom: 10px;
}
.quiz-tip {
  text-align: center;
  font-size: 13px;
  color: #777;
  min-height: 18px;
  margin-bottom: 14px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.quiz-tip.show{ 
  opacity: 1; 
}

.quiz-options{ display:flex; flex-direction:column; gap:12px; margin-top: 14px; }
.quiz-option{
  border:none;
  border-radius: 12px;
  background:var(--border-color);
  padding: 14px;
  text-align:left;
  cursor:pointer;
  position: relative;
}
.quiz-option.correct{
  background: var(--green-bg-not-transp);
}
.quiz-option.wrong{
  background: var(--red-bg-not-transp);
}

/* mini input under tool */
.tool-miniinput{
  margin-top: 16px;
  display:flex;
  gap:10px;
  align-items:center;
}
.tool-miniinput input{
  flex:1;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 12px 16px;
}
.tool-miniinput button{
  width:42px;
  height:42px;
  border-radius: 999px;
  border:none;
  background:#111;
  color:var(--background-color);
  cursor:pointer;
}

/* tool result button in chat */
.tool-result-btn{
  display:flex;
  gap:12px;
  align-items:center;
  border:1px solid var(--border-color);
  background:var(--background-color);
  padding: 14px 16px;
  border-radius: 18px;
  cursor:pointer;
  max-width: 320px;
}
.tool-result-icon{
  width:42px; height:42px;
  border-radius: 14px;
  display:flex; align-items:center; justify-content:center;
  background:#f4f4f5;
  font-weight:700;
}
.tool-result-title{ font-weight:700; }
.tool-result-sub{ font-size: 12px; color:#777; }

.logo-default .cls-1 {
  fill: #0d0d0d;
  fill-rule: evenodd;
}

.inline-tool-card {
  font-family: 'Slanter-Sans', sans-serif;
  font-weight: 300;
}

.slanter-eikon-host {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 420px;
  height: 420px;
  margin-top: 12px;
  border: none;
  border-radius: 16px;
  background: transparent;
  overflow: visible;
}

.slanter-eikon-stream-anchor {
  display: block;
  width: 100%;
}

.slanter-eikon-host::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.08) 45%, transparent 100%);
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.slanter-eikon-host.is-loading::before {
  opacity: 1;
  animation: slanterEikonShimmer 1.25s linear infinite;
}

.slanter-eikon-host.is-ready::before {
  animation: none;
  opacity: 0;
}

.slanter-eikon-host.is-loading .slanter-eikon-frame {
  opacity: 0;
}

.slanter-eikon-host.is-ready .slanter-eikon-frame {
  opacity: 1;
}

.slanter-eikon-frame {
  display: block;
  width: 100%;
  min-height: 420px;
  height: 100%;
  border: 0;
  background: transparent;
  opacity: 0;
  transition: opacity 180ms ease;
  will-change: opacity;
}

@keyframes slanterEikonShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(130%);
  }
}

.inline-tool-card-generating {
  display: flex;
  gap: 14px;
  padding: 0 0 0 7px;
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 27px;
  background: var(--input-bg);
  transition: background 0.15s ease, transform 0.1s ease;
  max-width: 420px !important;
  flex-direction: column;
}

.inline-tool-icon {
  font-size: 45px;
  line-height: 0.8;
  padding-top: 16px;
  padding-left: 8px;
  padding-right: 8px;
}

.inline-tool-title {
  font-weight: 600;
  padding-top: 16px;
}

.inline-tool-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
}

.inline-tool-top {
    display: flex;
    width: 100%;
    height: fit-content;
}

.inline-tool-btm {
    display: flex;
    align-items: center;
    padding-left: 9px;
}

.inline-tool-btn {
    color: var(--text-color);
    border: none;
    background: none;
    display: flex;
    width: 30px;
    margin: 0;
    aspect-ratio: 1;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

/* Keep all full-screen popup backdrops above topbar tabs/chrome. */
.modal,
.settings-modal {
  z-index: 130500 !important;
}

.inline-tool-btn:hover {
    background-color: var(--hover-color);
}

.inline-tool-start-btn {
    display: flex;
    align-items: center;
    border: none;
    background-color: var(--contrast);
    color: var(--background-color);
    border-radius: 8px;
    padding: 7px 13px;
    cursor: pointer;
}

.inline-tool-btm-right {
    display: flex;
    margin-left: auto;
    gap: 10px;
    padding-right: 16px;
}

.statusText {
    font-weight: 600;
    color: var(--med-text);
}

.statusTextProgress {
    font-weight: 600;
    color: #BB840D;
}

.statusTextComplete {
    font-weight: 600;
    color: #358547;
}

.inline-tool-sideBox {
    display: flex;
    flex-direction: column;
    align-items: end;
    margin-left: auto;
    padding: 12px;
    padding-top: 15px;
    padding-right: 16px;
    border-radius: 0 27px 0 27px;
    background-color: var(--hover-color);
}

.inline-tool-sideBox-generating {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 14px 16px 14px 10px;
    border-radius: 0 27px 27px 0;
    background-color: transparent;
}

.quiz-gen-completion,
.quiz-gen-blocks {
    display: block;
    image-rendering: auto;
    background: transparent;
}

.quiz-gen-completion {
    width: 145px;
    height: 15px;
}

.quiz-gen-blocks {
    width: 45px;
    height: 45px;
}

.inline-tool-sideBox-top {
  font-size: 0.8rem;
  color: var(--med-text);
}

.inline-tool-sideBox-btm {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  margin-top: 3px;
  color: var(--med-text);
}

.inline-tool-sideBox-btm-small {
  font-size: 0.9rem;
}

.inline-tool-sideBox-progress {
    display: flex;
    flex-direction: column;
    align-items: end;
    margin-left: auto;
    padding: 12px;
    padding-top: 15px;
    padding-right: 16px;
    border-radius: 0 27px 0 27px;
    background-color: #FFE7B5;
    height: fit-content;
}

.inline-tool-sideBox-top-progress {
  font-size: 0.8rem;
  color: #BB840D;
}

.inline-tool-sideBox-btm-progress {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  margin-top: 3px;
  color: #BB840D;
}

.inline-tool-resume-btn {
    display: flex;
    align-items: center;
    border: none;
    background-color: #FFE7B5;
    color: #BB840D;
    border-radius: 8px;
    padding: 7px 13px;
    cursor: pointer;
}

.inline-tool-restart-btn {
    display: flex;
    align-items: center;
    border: none;
    background-color: var(--hover-color);
    margin-left: 10px;
    color: var(--med-text);
    border-radius: 8px;
    padding: 7px 13px;
    cursor: pointer;
}

.inline-tool-sideBox-complete {
    display: flex;
    flex-direction: column;
    align-items: end;
    margin-left: auto;
    padding: 12px;
    padding-top: 15px;
    padding-right: 16px;
    border-radius: 0 27px 0 27px;
    background-color: #C8E9C3;
}

.inline-tool-sideBox-top-complete {
  font-size: 0.8rem;
  color: #358547;
}

.inline-tool-sideBox-btm-complete {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  margin-top: 3px;
  color: #358547;
}

.inline-tool-results-btn {
    display: flex;
    align-items: center;
    border: none;
    background-color: #C8E9C3;
    color: #358547;
    border-radius: 8px;
    padding: 7px 13px;
    cursor: pointer;
}

.inline-tool-card.inline-flash {
  align-items: center;
  flex-direction: row;
  padding: 14px 16px;
  border-radius: 14px;
  cursor: pointer;
}

.inline-tool-card.inline-flash:hover {
  background: #f9fafb;
}

.inline-tool-card.inline-flash:active {
  transform: scale(0.98);
}

.inline-tool-card.inline-flash .inline-tool-icon {
  font-size: 26px;
  padding: 0;
}

.inline-tool-card.inline-flash .inline-tool-title {
  padding-top: 0;
}

/* =========================
   TOOL OVERLAY (QUIZ / FC)
   Covers ONLY main area (not sidebar/topbar)
========================= */

:root{
  --slanter-sidebar-w: 260px;   /* adjust if your sidebar width differs */
  --slanter-topbar-h: 50px;     /* adjust if your topbar height differs */
}

/* TOOL OVERLAY (QUIZ / FLASHCARDS) */
.tool-overlay {
  position: fixed;
  top: 64px;
  left: var(--sidebar-offset, 260px);
  right: 0;
  bottom: 0;
  background: var(--background-color);
  z-index: 2000;
  overflow-y: auto;
  margin-left: var(--sidebar-offset, 260px);
  transition: margin-left 0.15s;
}

/* THIS is the only visibility toggle */
.tool-overlay.hidden {
  display: none;
}

.tool-overlay-inner{
  position: absolute;
  top: var(--slanter-topbar-h);
  left: var(--slanter-sidebar-w);
  right: 0;
  bottom: 0;
  background: var(--background-color);
  padding: 24px;
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: auto;
}

/* gradient blob */
.tool-gradient-bg{
  position: absolute;
  inset: 24px;
  border-radius: 32px;
  filter: blur(60px);
  opacity: 0.90;
  z-index: 0;
}

/* main content (center stage) */
.tool-content{
  position: relative;
  z-index: 1;
  height: calc(100% - 170px); /* room for bottom chat */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 6px;
  box-sizing: border-box;
}

/* bottom chat */
.tool-chat{
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 20px;
  z-index: 2;
  background: transparent;
}

.tool-chat-scroll{
  max-height: 120px;
  overflow-y: auto;
  padding: 0 4px 10px 4px;
}

.tool-chat-input{
  display: flex;
  gap: 10px;
  align-items: center;
}

.tool-chat-input input{
  flex: 1;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 0 16px;
  font-size: 14px;
  outline: none;
  background: var(--background-color);
}

.tool-chat-input button{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: var(--background-color);
  cursor: pointer;
}

/* shared panel */
.tool-panel{
  width: min(980px, 92%);
  position: relative;
  overflow: hidden;
  min-height: 420px;
}

/* flashcard big stage */
.flashcard-stage{
  position: relative;
  width: 100%;
  height: 520px;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flashcard-card{
  width: 88%;
  height: 78%;
  border-radius: 26px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--background-color);
  text-align: center;
  padding: 24px;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  transition: transform 180ms ease, background 220ms ease, color 220ms ease;
}

.flashcard-card:active{ transform: scale(0.99); }

.flashcard-card.answer{
  background: var(--border-color) !important;
  color: #111 !important;
}

.flashcard-nav{
  position: absolute;
  bottom: 18px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.flashcard-nav button{
  pointer-events: auto;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.9);
  cursor: pointer;
}

/* progress ring */
.progress-ring{
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--background-color);
  font-weight: 600;
}

.progress-ring svg{
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
}

.progress-ring .track{
  stroke: rgba(255,255,255,0.45);
  stroke-width: 3;
  fill: none;
}

.progress-ring .fill{
  stroke: var(--background-color);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 260ms ease;
}

/* quiz panel */
.quiz-stage{
  position: relative;
  width: 100%;
  min-height: clamp(380px, 56vh, 520px);
  height: auto;
  border-radius: 28px;
  border: 1px solid var(--input-border);
  overflow: hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.tool-loading-stage{
  width: 100%;
  min-height: clamp(380px, 56vh, 520px);
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-card{
  width: min(380px, 78%);
  background: var(--background-color);
  border-radius: 18px;
  padding: 18px;
  box-sizing: border-box;
  height: auto;
}

.quiz-q{
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
}

.quiz-option{
  display: grid;
  gap: 12px;
}

.quiz-option{
  background: #f3f3f3;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
  display:flex;
  justify-content: space-between;
  align-items:center;
  font-weight: 600;
}

.quiz-option:active{ transform: scale(0.99); }

.quiz-option.correct{
  background: var(--green-bg-transp);
  border-color: var(--green-text);
}

.quiz-option.wrong{
  background: var(--red-bg-not-transp);
  border-color: var(--red-text);
}

/* assessment */
.assess-card{
  width: min(980px, 92%);
  background: var(--background-color);
  border-radius: 22px;
  padding: 22px;
  box-sizing: border-box;
  max-height: 520px;
  overflow: auto;
}

.assess-title{
  font-weight: 800;
  text-align: center;
  margin-bottom: 18px;
}

.assess-q{
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 8px;
}

.assess-input{
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 0 14px;
  box-sizing: border-box;
  outline: none;
  background: var(--background-color);
}

.assess-submit{
  margin-top: 18px;
  width: 220px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #111;
  color: var(--background-color);
  font-weight: 700;
  cursor: pointer;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.tool-chat-input{
  background: var(--background-color);
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  align-items: center;
}

.tool-chat-input input{
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
}

.tool-chat-input button{
  background: #111;
  color: var(--background-color);
  border: none;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.tool-inner {
  position: relative;
  height: 100%;
  padding: 24px;
}

.tool-gradient {
  position: absolute;
  inset: 24px;
  border-radius: 32px;
  filter: blur(60px);
  opacity: 0.85;
  z-index: 0;
}

.tool-content {
  position: relative;
  z-index: 1;
  height: 70%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.flashcard {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: var(--contrast-color);
  cursor: pointer;
}

.flashcard.answer {
  background: var(--border-color) !important;
  color: black;
  font-size: 22px;
}


/* =========================================================
   TOOL OVERLAY + TOOL CHAT (overrides)
   - white background
   - sidebar remains visible (overlay offset via CSS variables)
========================================================= */
:root{
  --slanter-sidebar-w: 260px;
  --slanter-topbar-h: 50px;
  --topbar-height: var(--slanter-topbar-h, 50px);
  --tool-overlay-pad: 18px;
  --tool-overlay-offset: calc(var(--slanter-sidebar-w, 0px) + (var(--tool-overlay-pad) * 2));
}

#toolOverlay.tool-overlay{
  position: absolute;
  inset: auto;
  top: var(--slanter-topbar-h);
  left: var(--slanter-sidebar-w, 0px);
  right: 0;
  bottom: 0;
  margin-left: 0 !important;
  background: var(--background-color);
  z-index: 900;
  overflow: hidden;
  overflow-x: hidden;
  padding-left: var(--tool-overlay-pad, 18px);
  padding-right: var(--tool-overlay-pad, 18px);
  box-sizing: border-box;
}

.tool-overlay{
  position: absolute;
}

#toolOverlay.tool-overlay.split-embedded{
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  z-index: 7;
}

#toolOverlay.tool-overlay.split-embedded .tool-content,
#toolOverlay.tool-overlay.split-embedded .tool-chatlog,
#toolOverlay.tool-overlay.split-embedded #toolChatbar,
#toolOverlay.tool-overlay.split-embedded #toolInputDisclaimer{
  max-width: 765px;
  padding-left: 0;
  padding-right: 0;
}

#toolOverlay.tool-overlay.split-embedded .tool-scroll{
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
}

.chat-main-page-pane.is-split-tool-host{
  position: relative;
  overflow: hidden;
}

.tool-inner{
  position: relative;
  height: 100%;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.tool-gradient{
  display: none; /* remove second gradient container */
}

.tool-scroll{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: calc(var(--chat-input-cover-h, 96px) + 44px);
  box-sizing: border-box;
}

.tool-panel{
  width: 100%;
  margin: 0 auto;
}

.tool-content{
  width: min(calc(100% - 32px), 765px);
  max-width: none;
  height: auto;
  min-height: 520px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  display: flex;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

.tool-chatlog{
  width: min(calc(100% - 32px), 765px);
  margin: 0 auto;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 12px;
  max-width: none;
  box-sizing: border-box;
  overflow-x: hidden;
}

.tool-msg{
  display: flex;
  min-width: 0;
}

.tool-msg.user{
  justify-content: flex-end;
}

.tool-msg.assistant{
  justify-content: flex-start;
}

.tool-msg .bubble{
  max-width: 70%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.35;
  background: var(--border-color);
  color: #111;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tool-msg.user .bubble{
  background: #e9e9e9;
}

.tool-typing-indicator{
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  width: 80%;
  margin: 4px 0;
  align-self: flex-start;
}

#toolChatbar{
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: min(calc(100% - 32px), 765px) !important;
  max-width: min(calc(100% - 32px), 765px) !important;
  margin: 0 !important;
  transform: translateX(calc(-50% + (var(--chat-scrollbar-shift, 0px) * -0.5)));
  z-index: 7;
  flex: 0 0 auto;
}

#toolFilePreviewHost {
  position: absolute;
  left: 50%;
  bottom: 116px;
  width: min(calc(100% - 32px), 765px);
  max-width: min(calc(100% - 32px), 765px);
  transform: translateX(calc(-50% + (var(--chat-scrollbar-shift, 0px) * -0.5)));
  z-index: 7;
  pointer-events: none;
}

#toolFilePreviewHost > #toolFilePreviewRowBottom {
  display: flex;
  width: 100%;
  max-width: 100%;
  pointer-events: auto;
}

#toolFilePreviewHost > #toolFilePreviewRowBottom:not(.has-files) {
  display: none !important;
}

#toolChatbar.expanded{
  padding-bottom: 0;
}

#toolChatbar .voice-ui{
  padding: 0 12px;
  border-radius: 0;
  background: transparent;
}

#toolChatbar .voice-visualizer{
  min-height: 40px;
}

#toolChatbar textarea{
  width: 100%;
}

#toolChatbar .bottom-bar{
  width: 100%;
  padding: 8px 12px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  box-sizing: border-box;
}

.tool-chat-bottom-mask{
  left: 0;
  right: var(--chat-scrollbar-shift, 0px);
  width: auto;
  transform: none;
  bottom: 0;
  z-index: 5;
}

#toolInputDisclaimer{
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: min(calc(100% - 32px), 765px);
  margin: 0;
  transform: translateX(calc(-50% + (var(--chat-scrollbar-shift, 0px) * -0.5)));
  z-index: 7;
}

#toolVoiceBtn{
  margin-left: auto !important;
}

.voice-btn:hover {
  background-color: var(--light-background-hover);
}

.tool-voice-btn{
  background: var(--light-background);
  border-color: var(--light-background);
  color: var(--contrast-text);
}

.tool-stop-btn{
  background: var(--light-background);
  border-color: var(--light-background);
  color: var(--contrast-text);
}

.tool-send-btn{
  background: var(--light-background);
  border-color: var(--light-background);
  color: var(--contrast-text);
}

.tool-send-btn.is-active{
  background: var(--light-background);
  border-color: var(--light-background);
  color: var(--contrast-text);
}

.tool-circle-btn.active{
  background: var(--light-background);
  border-color: var(--light-background);
  color: var(--contrast-text);
}

.tool-circle-btn:disabled{
  border-color: var(--disabled-bg);
  border-color: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
}

.circle-btn:disabled .send-icon{
  color: var(--disabled-text);
}

.tool-icon{
  width: 18px;
  height: 18px;
}

/* =========================================================
   FLASHCARDS (single stage + grey on answer)
========================================================= */
.flashcard-stage{
  width: 100%;
  height: clamp(380px, 56vh, 520px);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  perspective: 1200px;
}

.flashcard-stage.generate{
  cursor: default;
}

.flashcard-body{
  padding: 48px;
  text-align: center;
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 800;
  letter-spacing: 0.02em;
  user-select: none;
  max-width: 80%;
}

.flashcard-body.answer{
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 700;
}

.flashcard-corner-btn{
  position: absolute;
  bottom: 16px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.flashcard-corner-btn.prev{ left: 16px; }
.flashcard-corner-btn.next{ right: 16px; }

.flashcard-corner-btn:hover{
  background: rgba(255,255,255,0.24);
}

.flashcard-generate-btn{
  border: none;
  background: rgba(255,255,255,0.9);
  color: #111;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.flashcard-stage.flashcard-turn{
  animation: flashcardTurn 0.35s ease;
}

.flashcard-stage.flashcard-advance{
  animation: flashcardAdvance 0.35s ease;
}

.flashcard-stage.flashcard-rewind{
  animation: flashcardRewind 0.35s ease;
}

@keyframes flashcardTurn{
  0%{ transform: rotateY(0deg); }
  50%{ transform: rotateY(90deg); }
  100%{ transform: rotateY(0deg); }
}

@keyframes flashcardAdvance{
  0%{ transform: translateX(0); opacity: 1; }
  45%{ transform: translateX(-12px); opacity: 0.4; }
  100%{ transform: translateX(0); opacity: 1; }
}

@keyframes flashcardRewind{
  0%{ transform: translateX(0); opacity: 1; }
  45%{ transform: translateX(12px); opacity: 0.4; }
  100%{ transform: translateX(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce){
  .flashcard-stage.flashcard-turn,
  .flashcard-stage.flashcard-advance,
  .flashcard-stage.flashcard-rewind{
    animation: none;
  }
}

/* =========================================================
   QUIZ: show hint only when present
========================================================= */
.quiz-tip:empty{
  display: none;
}

.quiz-summary-card{
  width: min(520px, 86%);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-color);
  border-radius: 20px;
  padding: 22px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-summary-text{
  font-size: 14px;
  line-height: 1.5;
  color: var(--med-dark-text);
}

.quiz-summary-text p,
.quiz-summary-text li,
.quiz-summary-text strong,
.quiz-summary-text span{
  color: inherit;
}

.quiz-summary-text a{
  color: var(--blue-accent);
}

.quiz-summary-wrong{
  background: var(--darker-box-bg);
  border: 1px solid var(--input-border);
  color: var(--text-color);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
}

.quiz-summary-wrong ul{
  margin: 8px 0 0;
  padding-left: 18px;
}

.quiz-summary-title{
  font-weight: 700;
  color: var(--text-color);
}

.quiz-question{
  color: var(--text-color);
}

.quiz-summary-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quiz-generate-btn{
  border: 1px solid var(--contrast);
  background: var(--contrast);
  color: var(--contrast-text);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.quiz-generate-btn:hover{
  opacity: 0.88;
}

.quizcontent{
  display: flex;
  position: relative;
  max-width: 765px;
  width: 100%;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  border-radius: 21px;
  overflow: hidden;
}

.backgroundimagequiz{
  user-select: none;
  z-index: 0;
  position: absolute;
  inset: 0;
  border-radius: 13px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  object-fit: cover;
  opacity: 0.52;
}

.quiztopprogress{
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translate(-50%);
  z-index: 2;
}

.progress-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.circleprogress {
  --circle-bg: var(--sidebar-controls);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--circle-bg);
  transition: background-color 220ms ease;
}

.circleprogress.correct {
  --circle-bg: var(--green-text);
  background-color: var(--circle-bg);
}

.circleprogress.wrong {
  --circle-bg: var(--red-text);
  background-color: var(--circle-bg);
}

.circleprogress.active {
  width: 55px;
  border-radius: 999px;
  background-color: var(--white);
}

.circleprogress.active.active-correct {
  background-color: var(--green-text);
}

.circleprogress.active.active-wrong {
  width: 55px;
  border-radius: 999px;
  background-color: var(--red-text);
}

.circleprogress.review-nav{
  cursor: pointer;
}

.circleprogress.is-expanding {
  animation: quizProgressExpand 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.circleprogress.is-contracting {
  animation: quizProgressContract 280ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.quizsideprogress{
  display: flex;
  flex-direction: column;
  position: absolute;
  right: 32px;
  top: 26px;
  z-index: 2;
}

.quizprogresstext{
  text-align: end;
}

.quizprogresstext.is-obscured{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.quizsideprogress.is-obscured{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.quizprogresstext-sep{
  border-bottom: 1px solid var(--sidebar-controls);
  padding-bottom: 8px;
}

.quizprogresstext-score{
  margin-top: 4px;
}

.toptextquizsmall{
  font-size: 0.9rem;
  color: var(--text-color);
}

.bottomtextquizlarge{
  color:var(--text-color);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
}

.bottomtextquizlarge-number{
  display: inline-block;
}

.bottomtextquizlarge-number.value-change-in{
  animation: quizRightValueIn 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bottomtextquizsmall{
  font-size: 1rem;
}

.quizcenterquiz{
  width: min(383px, calc(100% - 48px));
  background-color: var(--input-bg);
  border-radius: 21px;
  border: 1px solid var(--input-border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-self: center;
  margin: auto;
  font-size: 1rem;
  z-index: 2;
  overflow: visible;
  transform-origin: 50% 50%;
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: pan-y;
  isolation: isolate;
}

.quizcenterquiz.quizcenterquiz-question{
  height: 394px;
  min-height: 394px;
  max-height: 394px;
  --quiz-q-pad-top: 12px;
  --quiz-q-pad-bottom: 20px;
  margin: auto auto;
}

.quizcenterquiz.quizcenterquiz-question.question-density-short{
  --quiz-q-pad-top: 24px;
  --quiz-q-pad-bottom: 28px;
}

.quizcenterquiz.quizcenterquiz-question.question-density-medium{
  --quiz-q-pad-top: 14px;
  --quiz-q-pad-bottom: 20px;
}

.quizcenterquiz.quizcenterquiz-question.question-density-long{
  --quiz-q-pad-top: 8px;
  --quiz-q-pad-bottom: 10px;
}

.quizcenterquiz.quiz-transition-in{
  animation: quizQuestionIn 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.quizcenterquiz.quiz-transition-out{
  animation: quizQuestionOut 360ms cubic-bezier(0.4, 0, 0.2, 1) both;
}


.quizquestion{
  font-family: 'Slanter-Serif', serif;
  font-size: 1.2rem;
  margin: 16px 0 32px;
  text-align: center;
}

.quizcenterquiz.quizcenterquiz-question .quizquestion{
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--quiz-q-pad-top) 0 var(--quiz-q-pad-bottom);
  min-height: 0;
  overflow: auto;
  position: relative;
  z-index: 4;
}

.quizcenterquiz.quizcenterquiz-question .quizquestion > *{
  width: 100%;
  margin: 0;
}

.quizanswers{
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: visible;
  z-index: 2;
}

.quizcenterquiz.quizcenterquiz-question .quizanswers{
  margin-top: auto;
}

.quizanswer{
  position: relative;
  font-size: 1rem;
  padding: 8px 12px;
  height: 54px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: transparent;
  cursor:pointer;
  transition: all 0.2s ease;
  color: var(--text-color);
  z-index: 1;
  overflow: visible;
}

.quizanswer::before{
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: inherit;
  background: inherit;
  z-index: 4;
  pointer-events: none;
}

.quizanswer.disabled,
.quizanswer:disabled{
  opacity: 0.5;
}

.quizanswer.wrong{
  color: var(--red-text);
  border: 1px solid var(--red-text);
  background-color: var(--red-bg-transp);
}

.quizanswer.correct{
  color: var(--green-text);
  border: 1px solid var(--green-text);
  background-color: var(--green-bg-transp);
}

.quizanswer.has-expander{
  z-index: 2;
}

.quizanswers .quizanswer.has-expander:last-child{
  z-index: 0;
}

.quizanswer:hover:not(.disabled):not(:disabled){
  background-color: var(--hover-color);
}

.quizanswer:active:not(.disabled):not(:disabled){
  transform: scale(0.99);
}

.quizanswertext{
  display: flex;
  font-size: 1rem;
  position: relative;
  z-index: 5;
  text-align: left;
  height: 100%;
  align-items: center;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.quizanswerexpander{
  box-sizing: border-box;
  position: absolute;
  background-color: var(--red-bg-not-transp);
  border-radius: 10px;
  border: 1px solid var(--red-text);
  z-index: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  top: -1px;
  left: -1px;
  right: -1px;
  width: auto;
  min-height: 54px;
  padding: 62px 12px 8px;
  pointer-events: none;
  transform-origin: top center;
  clip-path: inset(0 0 calc(100% - 54px) 0 round 10px);
  animation: quizExpanderReveal 360ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.quizanswerexpander.correct{
  background-color: var(--green-bg-not-transp);
  border: 1px solid var(--green-text);
}

.quizanswerexpander.correct.pinned-open{
  animation: none;
  clip-path: inset(0 0 0 0 round 13px);
}

.quizanswerexpander.correct.pinned-open > *{
  animation: none;
  opacity: 1;
  filter: none;
}

.quizanswerexpander > *{
  opacity: 0;
  filter: blur(8px);
  animation: quizExpanderContentIn 220ms ease-out 360ms forwards;
}

.quizanswerexpander.closing{
  clip-path: inset(0 0 0 0 round 13px);
  animation: quizExpanderHide 280ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.quizanswerexpander.closing > *{
  opacity: 1;
  filter: blur(0);
  animation: quizExpanderContentOut 120ms ease-in forwards !important;
}

.quiztextbold{
  display: flex;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--red-text);}

.quizTiptext{
  display: flex;
  font-size: 0.9rem;
  color: var(--red-text);
  text-align: left;
}

.quizTiptext.correct{
  color: var(--green-text);
}

.quizcontent .katex,
.quizcontent .katex-display,
.assessment-stage .katex,
.assessment-stage .katex-display{
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.quizcontent .katex,
.assessment-stage .katex{
  display: inline-flex;
  flex-wrap: wrap;
  line-height: 1.1;
}

.quizcontent .katex-display,
.assessment-stage .katex-display{
  display: block;
  margin: 0.35rem 0;
}

.quizquestion .katex-display,
.quizsummarytext .katex-display,
.assessment-title .katex-display,
.assessment-q .katex-display{
  text-align: center;
}

.quizanswertext .katex-display,
.quizTiptext .katex-display{
  text-align: left;
  margin: 0.2rem 0;
}

.UserTextLarge.quizsummarytitle{
  align-self: center;
  margin-top: 4px;
}

.quizbottomrow{
  border-top: 1px solid rgba(224, 62, 51, 0.4);
  padding-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.quizbottomrow.correct{
  border-top: none;
  padding-top: 0;
}

.iconquizresult{
  color: var(--red-text);
  width: 20px;
  min-width: 20px;
}

.iconquizresult.correct{
  color: var(--green-text);
}

.quizsummarytext{
  text-align: left;
  margin-bottom: 12px;
  color: var(--text-color);
}

.quizsummaryactions{
  gap: 12px;
}

.quizcontrol{
  display: flex;
  justify-content: center;
  padding: 9px;
  font-size: 0.9rem;
  border: 1px solid var(--input-border);
  background-color: var(--darker-box-bg);
  color: var(--text-color);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.quizcontrol:hover{
  background-color: var(--hover-color);
}

.quizcontrol.black{
  background-color: var(--contrast);
  color: var(--contrast-text);
  border-color: var(--contrast);
}

@keyframes quizExpanderReveal{
  0%{
    clip-path: inset(0 0 calc(100% - 54px) 0 round 10px);
  }
  100%{
    clip-path: inset(0 0 0 0 round 10px);
  }
}

@keyframes quizQuestionIn{
  0%{
    opacity: 0;
    transform: translate3d(-148px, 172px, 0) scale(0.93) rotate(-6.2deg);
    filter: blur(14px);
  }
  28%{
    opacity: 0.7;
    transform: translate3d(-92px, 104px, 0) scale(0.955) rotate(-3.8deg);
    filter: blur(10px);
  }
  62%{
    opacity: 1;
    transform: translate3d(12px, -10px, 0) scale(1.012) rotate(1.1deg);
    filter: blur(2.2px);
  }
  82%{
    opacity: 1;
    transform: translate3d(4px, -3px, 0) scale(1.005) rotate(0.25deg);
    filter: blur(0.9px);
  }
  100%{
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    filter: blur(0);
  }
}

@keyframes quizQuestionOut{
  0%{
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    filter: blur(0);
  }
  24%{
    opacity: 0.98;
    transform: translate3d(18px, -9px, 0) scale(0.997) rotate(-1.2deg);
    filter: blur(1px);
  }
  58%{
    opacity: 0.88;
    transform: translate3d(78px, 56px, 0) scale(0.966) rotate(3.1deg);
    filter: blur(5px);
  }
  78%{
    opacity: 0.52;
    transform: translate3d(118px, 126px, 0) scale(0.945) rotate(4.8deg);
    filter: blur(9px);
  }
  100%{
    opacity: 0;
    transform: translate3d(164px, 184px, 0) scale(0.92) rotate(6.4deg);
    filter: blur(14px);
  }
}


@keyframes quizRightValueIn{
  0%{
    opacity: 0.45;
    transform: translateY(6px) scale(0.97);
    filter: blur(8px);
  }
  55%{
    opacity: 1;
    transform: translateY(-1px) scale(1.02);
    filter: blur(1.8px);
  }
  100%{
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes quizProgressExpand{
  0%{
    width: 10px;
    border-radius: 50%;
    background-color: var(--circle-bg);
  }
  100%{
    width: 55px;
    border-radius: 999px;
    background-color: var(--contrast);
  }
}

@keyframes quizProgressContract{
  0%{
    width: 55px;
    border-radius: 999px;
    background-color: var(--contrast);
  }
  100%{
    width: 10px;
    border-radius: 50%;
    background-color: var(--circle-bg);
  }
}

@keyframes quizExpanderHide{
  0%{
    clip-path: inset(0 0 0 0 round 13px);
  }
  100%{
    clip-path: inset(0 0 calc(100% - 54px) 0 round 13px);
  }
}

@keyframes quizExpanderContentIn{
  0%{
    opacity: 0;
    filter: blur(8px);
  }
  100%{
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes quizExpanderContentOut{
  0%{
    opacity: 1;
    filter: blur(0);
  }
  100%{
    opacity: 0;
    filter: blur(6px);
  }
}

@media (prefers-reduced-motion: reduce){
  .quizcenterquiz.quiz-transition-in,
  .quizcenterquiz.quiz-transition-out{
    animation: none;
  }
  .bottomtextquizlarge-number.value-change-in{
    animation: none;
  }
  .circleprogress.is-expanding,
  .circleprogress.is-contracting{
    animation: none;
  }
  .quizanswerexpander{
    animation: none;
    clip-path: inset(0 0 0 0 round 13px);
  }
  .quizanswerexpander > *{
    animation: none;
    opacity: 1;
    filter: none;
  }
}

.inline-tool-card.inline-pending:not(.inline-tool-card-generating) {
  position: relative;
  display: flex;
  flex-direction: column;

  align-items: flex-start;   /* ← CHANGE THIS */
  text-align: left;          /* ← ADD THIS */

  overflow: hidden;
  min-height: 45.5px !important; /* ← give it breathing room */
  padding: 14px 16px;
  line-height: 1;
}

.inline-tool-card.inline-pending .pending-title {
  font-weight: 700;
}

.inline-tool-card.inline-pending .pending-status {
  font-style: italic;
  color: rgba(0,0,0,0.55);
  font-size: 14px;
}

.inline-tool-card.inline-pending .pending-steps{
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
}

.inline-tool-card.inline-pending .pending-step{
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.inline-tool-card.inline-pending .step-label{
  font-size: 13px;
  color: rgba(0,0,0,0.7);
  font-weight: 600;
}

.inline-tool-card.inline-pending .step-bar{
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.inline-tool-card.inline-pending .step-bar-fill{
  height: 100%;
  width: 0%;
  background: #22c55e;
  opacity: 0.25;
  transition: width 240ms ease, background 240ms ease, opacity 240ms ease;
}

.inline-tool-card.inline-pending .pending-step.is-active .step-bar-fill{
  width: 60%;
  background: #22c55e;
  opacity: 0.75;
}

.inline-tool-card.inline-pending .pending-step.is-done .step-label{
  color: #16a34a;
}

.inline-tool-card.inline-pending .pending-step.is-done .step-bar-fill{
  width: 100%;
  background: #22c55e;
  opacity: 1;
}

/* Animated sweeping gradient */
.inline-tool-card.inline-pending::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

background: linear-gradient(
  120deg,
  rgba(0,0,0,0.00) 0%,
  rgba(0,0,0,0.02) 25%,
  rgba(0,0,0,0.05) 40%,
  var(--hover-color) 50%,
  rgba(0,0,0,0.05) 60%,
  rgba(0,0,0,0.02) 75%,
  rgba(0,0,0,0.00) 100%
);

  transform: translateX(-100%);
  animation: inlinePendingSweep 2.2s ease-in-out infinite;
}

/* Sweep timing */
@keyframes inlinePendingSweep {
  0% {
    transform: translateX(-110%);
  }
  50% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(110%);
  }
}

/* ==============================
   Dashboard main content layout
   ============================== */

.nav-btn {
  margin-top: 23px;
}

.active-btn {
  margin-top: 23px;
  width: 100%;
  border-radius: 9px;
  border: 1px solid #1d1d1d;
  background: var(--contrast);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--background-color);
  transition: background 0.15s ease, border-color 0.15s ease;
  text-align: left;
}

.nav-link {
  text-decoration: none;
}

.active-btn:hover {
  background: #494949;
  border-color: #363636;
}

.otherbuttons {
  margin-top: 23px;
  width: 100%;
  border-radius: 9px;
  border: none;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  background-color: var(--sidebar-color);
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--contrast);
  transition: background 0.15s ease, border-color 0.15s ease;
  text-align: left;
}

.otherbuttons:hover {
  background: #dadada;
  color: var(--contrast);
}

.side-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

.content {
  width: min(1000px, 100% - 80px);
  align-self: center;
  margin: 30px auto 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.dashboard-main {
  overflow: hidden;
}

.dashboard-scroll {
  flex: 1;
  overflow-y: auto;
}

.main-scroll {
  flex: 1;
  overflow-y: auto;
}

.page-panel {
  display: none;
}

.page-panel.is-active {
  display: flex;
}

.dashboard-hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.7rem;
  color: #8c8c8c;
  margin: 0;
}

.dashboard-hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
  letter-spacing: -0.02em;
  color: #1f1f1f;
}

.hero-subtitle {
  margin: 0;
  color: #6f6f6f;
  max-width: 60ch;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.meta-item {
  background: var(--sidebar-color);
  border: 1px solid #e5e5e5;
  padding: 14px 16px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.meta-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--hover-color);
}

.meta-label {
  font-size: 0.75rem;
  color: #6f6f6f;
}

.meta-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #141414;
}

.meta-note {
  font-size: 0.75rem;
  color: #4b4b4b;
}

.content-divider {
  border-top: 1px solid #ededed;
}

.split-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  align-items: center;
}

.split-card.reverse {
  grid-auto-flow: dense;
}

.split-text h2 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
}

.split-text p {
  margin: 0 0 10px;
  color: #6c6c6c;
}

.split-text .muted {
  color: #9a9a9a;
}

.image-placeholder {
  width: 100%;
  min-height: 220px;
  border-radius: 16px;
  background: #3f3f3f;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-placeholder:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
}

.pill-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: #0d0d0d;
  color: var(--background-color);
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.pill-button:hover {
  background: #292929;
  transform: translateY(-1px);
}

.pill-arrow {
  font-size: 1rem;
}

.limits-card {
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 18px;
  background: var(--background-color);
  box-shadow: 0 8px 22px var(--hover-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.limits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.limits-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.limits-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.ghost-button {
  border: 1px solid #e0e0e0;
  background: #f8f8f8;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ghost-button:hover {
  background: #ececec;
  border-color: #cfcfcf;
}

.limit-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.limit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #585858;
  font-size: 0.85rem;
}

.limit-bar {
  width: 100%;
  height: 12px;
  background: #efefef;
  border-radius: 999px;
  overflow: hidden;
}

.limit-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #111 0%, #3f3f3f 100%);
  transition: width 0.8s ease;
}

.limit-row.is-ready .limit-fill {
  width: var(--limit, 0%);
}

.limit-caption {
  margin: 0;
  font-size: 0.7rem;
  color: #9b9b9b;
}

.need-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.need-more h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
}

.need-more .muted {
  margin: 0;
  color: #8f8f8f;
}

.alert-dot {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: var(--background-color);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 999px;
  border: 2px solid var(--background-color);
}

.topbar-icon-btn {
  position: relative;
}

@media (max-width: 900px) {
  .content {
    width: min(100%, 560px);
  }

  .need-more {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .content {
    width: min(100%, 90%);
  }
}

/* ==============================
   Usage page layout
   ============================== */

.usage-content {
  gap: 24px;
}

.usage-header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 2rem);
}

.usage-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.usage-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.usage-card,
.usage-stat-card {
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  background: var(--background-color);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.usage-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.usage-label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f1f1f;
}

.usage-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1f1f1f;
}

.usage-subtitle {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: #9a9a9a;
}

.usage-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e0e0e0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fafafa;
}

.usage-chip {
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.usage-dropdown {
  font-size: 0.8rem;
  color: #666;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.usage-stat-card.tall {
  min-height: 280px;
}

.usage-chart-placeholder {
  width: 100%;
  min-height: 180px;
  border-radius: 12px;
  background: #f3f3f3;
  border: 1px solid #ededed;
}

.usage-stat-card.tall .usage-chart-placeholder {
  min-height: 240px;
}

@media (max-width: 700px) {
  .usage-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .usage-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==============================
   Rules page layout
   ============================== */

.rules-content {
  gap: 28px;
}

.rules-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
}

.rules-hero p {
  margin: 0 0 8px;
  color: #6f6f6f;
  max-width: 70ch;
}

.rules-divider {
  border-top: 1px solid #ededed;
}

.rules-overview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rules-overview-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.rules-overview-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f1f1f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.rules-overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.rules-overview-card {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--background-color);
  box-shadow: 0 6px 16px var(--hover-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rules-overview-label {
  font-size: 0.75rem;
  color: #8a8a8a;
}

.rules-overview-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: #111;
}

.rules-editor {
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  background: var(--background-color);
  padding: 18px;
  box-shadow: 0 8px 22px var(--hover-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rules-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rules-editor-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.rules-editor-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #f1f1f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.rules-roles {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.role-card {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  overflow: hidden;
  background: var(--background-color);
  box-shadow: 0 4px 14px var(--hover-color);
  --role-color: #ee8f5a;
}

.role-header {
  background: var(--role-color);
  color: var(--background-color);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.role-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 600;
}

.role-name {
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.role-name.is-placeholder:empty::before {
  content: attr(data-placeholder);
  opacity: 0.5;
}

.role-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.role-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.2);
  color: var(--background-color);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.role-save-btn,
.role-undo-btn,
.role-cancel-btn {
  display: none;
}

.role-card.is-editing .role-edit-btn {
  display: none;
}

.role-card.is-editing .role-save-btn,
.role-card.is-editing .role-undo-btn {
  display: inline-flex;
}

.role-cancel-btn.is-visible {
  display: inline-flex;
}

.role-undo-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.role-body {
  padding: 12px;
}

.role-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.role-column h4 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: #1f1f1f;
}

.role-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: #5f5f5f;
}

.role-column.disabled h4,
.role-column.disabled ul {
  color: #e1504a;
}

.role-column ul li {
  display: flex;
  align-items: center;
  gap: 4px;
}

.role-column h4 + ul {
  padding-right: 12px;
  border-right: 1px solid #efefef;
}

.role-edit {
  display: none;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 18px;
}

.role-card.is-editing .role-summary {
  display: none;
}

.role-card.is-editing .role-edit {
  display: grid;
}

.role-permissions h4,
.role-customization h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: #1f1f1f;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #9b9b9b;
  margin-bottom: 6px;
}

.switch-row input {
  display: none;
}

.role-customization {
  border-left: 1px solid #efefef;
  padding-left: 12px;
}

.role-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #4f4f4f;
  margin-bottom: 6px;
}

.role-color-button {
  border: none;
  background: var(--contrast);
  color: var(--background-color);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.7rem;
  cursor: pointer;
  width: 100%;
}

.role-color-button:hover {
  background: var(--role-color);
}

.role-delete-btn {
  border: none;
  background: #e6e6e6;
  color: #111;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.7rem;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  display: none;
}

.role-card.is-editing .role-delete-btn {
  display: block;
}

.role-delete-btn:hover {
  background: #d3d3d3;
}

.role-color-palette {
  display: none;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.role-card.palette-open .role-color-palette {
  display: grid;
}

.role-card.palette-open .role-color-button {
  display: none;
}

.role-card.palette-open .role-delete-btn {
  display: none;
}

.role-color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  background: var(--swatch-color, #ddd);
  transition: transform 0.2s ease;
}

.role-color-swatch:hover {
  transform: scale(1.05);
}

.rules-add-role {
  width: fit-content;
  border: none;
  border-radius: 8px;
  background: var(--contrast);
  color: var(--background-color);
  padding: 8px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}

.rules-add-role:hover {
  background: #2a2a2a;
}

.rules-add-role.is-disabled,
.rules-add-role:disabled {
  background: #d3d3d3;
  color: #7b7b7b;
  cursor: not-allowed;
}

.users-content {
  gap: 28px;
}

.users-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
}

.users-hero p {
  margin: 0 0 8px;
  color: #6f6f6f;
  max-width: 70ch;
}

.users-divider {
  border-top: 1px solid #ededed;
}

.users-manage {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.users-manage-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.users-manage-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f1f1f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.users-manage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.users-manage-card {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--background-color);
  box-shadow: 0 6px 16px var(--hover-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.users-manage-label {
  font-size: 0.75rem;
  color: #8a8a8a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.users-manage-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: #111;
}

.users-manage-button {
  cursor: pointer;
}

.users-manage-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
}

.users-placeholder-icon {
  width: 20px;
  height: 20px;
}

.users-add-icon {
  width: 16px;
  height: 16px;
}

.users-panel {
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  background: var(--background-color);
  padding: 16px;
  box-shadow: 0 8px 22px var(--hover-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.users-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.users-panel-header h2 {
  margin: 0;
  font-size: 1rem;
}

.users-selected-text {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: #9b9b9b;
}

.users-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.users-filter-wrap {
  transition: margin-right 0.25s ease;
}

.users-controls.bulk-active .users-filter-wrap {
  margin-right: 8px;
}

.users-search,
.users-bulk-btn,
.users-sort-btn,
.users-filter-btn {
  border: 1px solid #e0e0e0;
  background: var(--background-color);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.users-search svg,
.users-bulk-btn svg,
.users-filter-btn svg,
.users-sort-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.users-filter-btn.is-open svg,
.users-sort-btn.is-open svg {
  transform: rotate(180deg);
}

.users-search {
  color: #b2b2b2;
  gap: 6px;
  transition: width 0.2s ease;
}

.users-search svg {
  transition: color 0.2s ease;
  pointer-events: none;
}

.users-search:hover svg {
  color: #111;
}

.users-search input {
  border: none;
  outline: none;
  background: transparent;
  width: 60px;
  font-size: 0.75rem;
  color: #b2b2b2;
  transition: width 0.2s ease;
}

.users-search.is-open {
  padding: 6px 14px;
}

.users-search.is-open input {
  width: 160px;
  color: #111;
}

.users-bulk-btn {
  display: inline-flex;
  max-width: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(0.96);
  filter: blur(6px);
  overflow: hidden;
  padding: 6px 0;
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease, visibility 0.25s ease, max-width 0.25s ease, padding 0.25s ease;
}

.users-bulk-btn.is-visible {
  max-width: 140px;
  padding: 6px 12px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.users-filter-wrap,
.users-sort-wrap {
  position: relative;
}

.users-filter-menu,
.users-sort-menu {
  position: absolute;
  top: 36px;
  right: 0;
  background: var(--background-color);
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  filter: blur(6px);
  pointer-events: none;
  z-index: 1000;
  min-width: 280px;
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.users-filter-menu {
  width: 420px;
}

.users-filter-menu.is-open,
.users-sort-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.users-filter-menu h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
}

.users-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.users-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.users-filter-options button {
  border: 1px solid #f0c2a4;
  background: #f6e2d4;
  color: #c65d1d;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.7rem;
  cursor: pointer;
}

.users-filter-options button:hover,
.users-filter-all:hover,
.users-filter-row:hover {
  background: var(--border-color);
}

.users-filter-options button:hover,
.users-filter-all:hover,
.users-filter-row:hover {
  background: var(--border-color);
}

.users-filter-options button.is-active {
  box-shadow: inset 0 0 0 2px #111;
  color: var(--background-color);
}

.users-sort-menu button {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 0 6px 28px;
  text-align: left;
  cursor: pointer;
  font-size: 0.8rem;
  position: relative;
}

.users-sort-menu button:hover {
  background: var(--border-color);
}

.users-sort-menu button.is-selected::before {
  content: "✓";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #111;
}

.users-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.users-filter-pill {
  border: 1px solid #9ebdf6;
  background: #e8f0ff;
  color: #2e63d5;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  filter: blur(6px);
}

.users-filter-pill.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.users-filter-pill-role {
  color: var(--background-color);
}

.users-filter-pill-grade {
  background: #e8f0ff;
  color: #2e63d5;
}

.users-filter-pill-alert {
  background: #ffe4e2;
  color: #e1504a;
}

.pill-icon {
  position: relative;
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.pill-icon svg {
  width: 12px;
  height: 12px;
}

.users-filter-pill:hover .pill-icon {
  color: transparent;
}

.users-filter-pill:hover .pill-icon svg {
  opacity: 0;
}

.users-filter-pill:hover .pill-icon::after {
  content: "×";
  position: absolute;
  color: #2e63d5;
}

.users-filter-more {
  position: relative;
  font-size: 0.7rem;
  color: #6f6f6f;
  cursor: default;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  filter: blur(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.users-filter-more.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.users-filter-more-pop {
  position: absolute;
  top: 20px;
  left: 0;
  background: var(--background-color);
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1000;
  min-width: 140px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.users-filter-more-pop ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.7rem;
  color: #4f4f4f;
}

.users-filter-more:hover .users-filter-more-pop {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.users-filter-pill-compact {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.72rem;
  gap: 6px;
}

.users-filter-pill-compact .pill-remove {
  margin-left: 4px;
  font-size: 0.75rem;
  opacity: 0.6;
}

.users-list {
  display: flex;
  flex-direction: column;
}

.user-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: opacity 0.35s ease, transform 0.35s ease, filter 0.35s ease, background 0.2s ease;
  cursor: pointer;
  user-select: none;
  position: relative;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  filter: blur(6px);
}

.user-row.is-loaded {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.user-row + .user-row {
  margin-top: 8px;
}

.user-row + .user-row::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 12px;
  right: 12px;
  border-top: 1px solid #efefef;
}

.user-row:hover {
  background: var(--border-color);
}

.user-row.is-selected {
  background: #f0f6ff;
  border-color: #cfe1ff;
}

.users-list .user-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
  margin-right: 0;
}

.user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name {
  font-size: 0.95rem;
  max-width: 108px;
  color: var(--text-color);
}

.user-name.small{
  font-size: 0.8rem;
  color: var(--light-text);
}

.user-name-stack{
  display: flex;
  flex-direction: column;
}

.user-alert {
  color: #e1504a;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: #8a8a8a;
}

.user-role-pill {
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--background-color);
  font-size: 0.7rem;
}

.user-unverified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fff3bf;
  color: #a16a00;
  font-size: 0.7rem;
  position: relative;
}

.user-unverified svg {
  width: 12px;
  height: 12px;
}

.user-unverified-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--background-color);
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  font-size: 0.7rem;
  color: #4f4f4f;
  width: 220px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.user-unverified:hover .user-unverified-pop {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-edit-btn {
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  background: #111;
  color: var(--background-color);
  font-size: 0.75rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.user-row:hover .user-edit-btn,
.user-row:focus-within .user-edit-btn {
  display: inline-flex;
}

.user-edit-btn svg {
  width: 14px;
  height: 14px;
}

.user-edit-btn:hover {
  background: var(--contrast);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.user-edit-btn:active {
  transform: translateY(1px);
}

.users-load-more {
  align-self: center;
  border: none;
  background: var(--contrast);
  color: var(--background-color);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}

.users-load-more.is-disabled,
.users-load-more:disabled {
  background: #d3d3d3;
  color: #7b7b7b;
  cursor: not-allowed;
}

.users-edit-modal .modal-box {
  width: auto;
  background: transparent;
  box-shadow: none;
  padding: 0;
  transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}

.users-edit-modal {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
}

.users-edit-modal.hidden {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(0);
}

.users-edit-modal.hidden .modal-box {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  filter: blur(10px);
}

.users-edit-modal:not(.hidden) .modal-box {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.add-user-modal .modal-box {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.add-user-modal .addnewuserpop {
  width: 450px;
  border-color: #d9d9d9;
  border-width: 1px;
  border-style: solid;
  display: block;
  border-radius: 15px;
  padding: 15px;
  justify-content: center;
  background: var(--background-color);
}

.add-user-modal .addnewusermanual {
  width: 450px;
  border-color: #d9d9d9;
  border-width: 1px;
  border-style: solid;
  display: block;
  border-radius: 15px;
  padding: 15px;
  justify-content: center;
  background: var(--background-color);
}

.add-user-modal .addnewuserfile {
  width: 450px;
  border-color: #d9d9d9;
  border-width: 1px;
  border-style: solid;
  display: block;
  border-radius: 15px;
  padding: 15px;
  justify-content: center;
  background: var(--background-color);
}

.add-user-modal .addnewuserpop .toprow {
  display: inline-flex;
}

.add-user-modal .addnewusermanual .toprow {
  display: flex;
}

.add-user-modal .addnewuserfile .toprow {
  display: inline-flex;
}

.add-user-modal .titletext2 {
  margin-top: 3px;
  margin-left: 10px;
}

.add-user-modal .adduser-button {
  width: 100%;
  display: flex;
  padding: 8px 11px;
  border-radius: 15px;
  border-color: #d9d9d9;
  border-style: solid;
  border-width: 1px;
  background-color: var(--background-color);
  margin-top: 15px;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.1s;
}

.add-user-modal .svg1 {
  width: 20px;
  display: inline-block;
  align-self: start;
}

.add-user-modal .penicon {
  width: 25px;
  margin-left: auto;
}

.add-user-modal .toptext {
  font-size: 1rem;
  text-align: left;
}

.add-user-modal .describtor {
  font-size: 0.8rem;
  text-align: left;
  margin-top: 2px;
  color: #9f9f9f;
  transition: color 0.1s;
}

.add-user-modal .saiicon {
  margin-left: auto;
  width: 35px;
}

.add-user-modal .adduser-button:hover {
  background-color: #f1f1f1;
}

.add-user-modal .adduser-button:hover .describtor {
  color: #5c5c5c;
}

.add-user-modal .adduser-button:active {
  transform: scaleX(1.02);
}

.add-user-modal .addnewusermanual .inputbox {
  margin-top: 15px;
}

.add-user-modal .texttop2 {
  font-size: 0.8rem;
  color: #303030;
  margin-bottom: 5px;
}

.add-user-modal .inputusers {
  width: 95%;
  padding: 12px;
  color: var(--contrast);
  border-radius: 15px;
  border-style: solid;
  border-width: 1px;
  border-color: #c7c7c7;
}

.add-user-modal .adduserfin {
  border: none;
  border-radius: 15px;
  background-color: var(--contrast);
  color: var(--background-color);
  display: flex;
  padding: 9px 17px;
  margin-left: auto;
  cursor: pointer;
}

.add-user-modal .bottom-row {
  display: flex;
  margin-top: 15px;
  justify-content: center;
  align-items: center;
}

.add-user-modal .adduserprev {
  border: #d9d9d9;
  border-width: 1px;
  border-radius: 15px;
  border-style: solid;
  background-color: var(--background-color);
  color: var(--contrast);
  display: flex;
  padding: 9px 17px;
  width: 20%;
  justify-content: center;
  cursor: pointer;
  margin-right: auto;
}

.add-user-modal .addusernext {
  border: #d9d9d9;
  border-width: 1px;
  border-radius: 15px;
  border-style: solid;
  background-color: var(--background-color);
  color: var(--contrast);
  display: flex;
  padding: 9px 17px;
  width: 20%;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
}

.add-user-modal .outof {
  color: #929292;
  font-size: 0.9rem;
}

.add-user-modal .adduserprev:disabled,
.add-user-modal .addusernext:disabled {
  background: #efefef;
  color: #b3b3b3;
  cursor: not-allowed;
}

.add-user-modal .uploadbox {
  margin-top: 15px;
}

.add-user-modal .upload {
  border-color: #d9d9d9;
  border-width: 1px;
  border-style: solid;
  border-radius: 15px;
  padding: 15px;
  height: 120px;
  background-color: #d4d4d47c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.add-user-modal .file-preview-row {
  padding: 0;
  overflow: hidden;
}

.add-user-modal .adduser-file-chip {
  width: 100%;
  margin-top: 12px;
  background: var(--background-color);
  box-shadow: 0 6px 16px var(--hover-color);
  flex: 1;
  align-items: center;
}

.add-user-modal .adduser-file-chip .file-chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.35);
  position: relative;
}

.add-user-modal .adduser-file-chip .file-chip-progress {
  width: 0%;
  transition: width 1s linear;
}

.add-user-modal .adduser-file-chip .file-chip-text {
  display: flex;
  flex-direction: column;
  min-height: 46px;
}

.add-user-modal .adduser-file-chip .file-chip-time {
  font-size: 0.7rem;
  color: #c0c0c0;
  margin-top: 2px;
  text-align: left;
}

.add-user-modal .adduser-file-chip .file-chip-time.is-importing {
  background: linear-gradient(90deg, #c7c7c7 0%, #9b9b9b 50%, #c7c7c7 100%);
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: addUserImportShimmer 2s linear infinite;
}

.add-user-modal .adduser-file-chip.is-complete .file-chip-time {
  color: #4f4f4f;
}

.add-user-modal .adduser-file-chip .file-chip-type {
  margin-top: 2px;
}

.add-user-modal .adduser-file-chip.is-importing .file-chip-type {
  display: none;
}

.add-user-modal .adduser-file-chip.is-complete .file-chip-type {
  display: none;
}
@keyframes addUserImportShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.add-user-modal .adduserfin:disabled {
  background: #d2d2d2;
  color: #9b9b9b;
  cursor: not-allowed;
}

.add-user-modal .upload-svg {
  width: 30px;
  margin-right: 7px;
}

.add-user-modal .bottomtextupload {
  color: #858585;
}

.add-user-modal .adduserimport {
  border: none;
  border-radius: 15px;
  background-color: #d2d2d2;
  color: #606060;
  display: flex;
  padding: 9px 17px;
  cursor: not-allowed;
  justify-content: center;
  width: 100%;
}

.add-user-modal .adduserimport.is-ready {
  background: var(--contrast);
  color: var(--background-color);
  cursor: pointer;
}

.add-user-modal .adduser-file-progress {
  margin-top: 12px;
}

.add-user-modal .adduser-file-progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e5e5;
  border-radius: 999px;
  overflow: hidden;
}

.add-user-modal .adduser-file-progress-fill {
  height: 100%;
  width: 0%;
  background: #111;
  transition: width 1s linear;
}

.add-user-modal .adduser-file-progress-text {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #b3b3b3;
  text-align: right;
}

.add-user-modal .adduser-file-chip.is-importing .file-chip-delete {
  display: none;
}

.add-user-modal .adduser-file-chip.is-importing .file-chip-icon span {
  opacity: 0.4;
}

.add-user-modal.hidden {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.add-user-modal {
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
}

.add-user-modal .modal-box {
  transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}

.add-user-modal.hidden .modal-box {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  filter: blur(10px);
}

.add-user-modal:not(.hidden) .modal-box {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.users-edit-box .main {
  width: 550px;
  border-color: #d9d9d9;
  border-width: 1px;
  border-style: solid;
  border-radius: 15px;
  background: var(--background-color);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.users-edit-box .top {
  display: block;
  padding: 11px 11px 1px 11px;
}

.users-edit-box .edit {
  border-color: #d9d9d9;
  border-width: 1px;
  border-style: solid;
  display: block;
  border-radius: 13px;
  margin: 11px;
  padding: 11px;
}

.users-edit-box .close {
  width: 20px;
  float: right;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
}

.users-edit-box .leftedit {
  width: 46%;
  display: inline-block;
  vertical-align: top;
}

.users-edit-box .rightedit {
  width: 46%;
  margin-left: 35px;
  display: inline-block;
  vertical-align: top;
  position: relative;
}

.users-edit-box .texttop {
  font-size: 0.8rem;
  color: #adadad;
  margin-bottom: 5px;
}

.users-edit-box .input {
  padding: 9px;
  color: var(--contrast);
  border-radius: 6px;
  border-style: solid;
  border-width: 1px;
  border-color: #c7c7c7;
  margin-bottom: 15px;
  width: 91%;
}

.users-edit-box .sendnew {
  background-color: var(--contrast);
  border: none;
  width: 100%;
  color: var(--background-color);
  padding: 9px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.users-edit-box .sendnew svg {
  transition: transform 0.4s ease;
  transform-origin: center;
}

.users-edit-box .sendtext {
  vertical-align: top;
  display: inline-block;
  margin-top: 1px;
}

.users-edit-box .Role {
  background-color: #eb8f5e;
  border: none;
  color: var(--background-color);
  padding: 5px 10px;
  border-radius: 6px;
  margin-bottom: 21px;
  margin-top: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.users-edit-role-panel {
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  background: var(--background-color);
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  z-index: 3;
}

.users-edit-role-panel.is-open {
  display: flex;
}

.users-edit-role-option {
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--background-color);
  cursor: pointer;
  text-align: left;
  font-size: 0.75rem;
}

.users-edit-box .grades {
  display: flex;
  gap: 8px;
}

.users-edit-box .gradebut {
  background-color: #d5d5d5;
  border: none;
  color: #818181;
  padding: 5px 10px;
  border-radius: 6px;
  margin-bottom: 40px;
  margin-top: 4px;
  cursor: pointer;
}

.users-edit-box .gradebut.is-active {
  background: #111;
  color: var(--background-color);
}

.users-edit-box .update {
  background-color: var(--contrast);
  border: none;
  width: 46%;
  color: var(--background-color);
  padding: 9px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.2s ease;
}

.users-edit-box .update.is-saved {
  background: #2ecc71;
}

.users-edit-box .cancel {
  background-color: var(--background-color);
  border: solid;
  margin-left: 10px;
  border-color: #d2d2d2;
  border-width: 1px;
  width: 46%;
  color: var(--contrast);
  padding: 9px;
  border-radius: 6px;
  cursor: pointer;
}

.users-edit-box .middle {
  display: block;
  padding: 11px;
  margin-top: 25px;
}

.users-edit-box .svg1 {
  width: 20px;
  display: inline-block;
}

.users-edit-box .title {
  display: inline-block;
  vertical-align: top;
  margin-top: 2px;
}

.users-edit-box .svg2 {
  width: 13px;
  display: inline-block;
  vertical-align: top;
  margin-top: 3px;
}

.users-edit-box .alert {
  color: #e94c4c;
  display: inline-block;
  font-size: 0.7rem;
  vertical-align: top;
  margin-top: 4px;
}

.users-edit-box .Activity {
  border-color: #d9d9d9;
  border-width: 1px;
  border-style: solid;
  display: block;
  border-radius: 13px;
  margin: 1px 11px 11px 11px;
  padding: 11px;
}

.users-edit-box .number {
  font-weight: 900;
  font-size: 2rem;
}

.users-edit-box .alert2 {
  color: #e94c4c;
  margin-top: 6px;
}

.users-edit-box .bottom {
  display: block;
  padding: 11px;
  margin-top: 25px;
}

.users-edit-box .Archive {
  border-color: #d9d9d9;
  border-width: 1px;
  border-style: solid;
  display: block;
  border-radius: 13px;
  margin: 1px 11px 11px 11px;
  padding: 11px;
}

.users-edit-box .info1 {
  border-color: #d9d9d9;
  width: 70%;
  border-width: 1px;
  border-style: solid;
  display: inline-block;
  border-radius: 6px;
  padding: 11px;
  color: #898989;
}

.users-edit-box .icon {
  width: 16px;
  display: inline-block;
  stroke: currentColor;
}

.users-edit-box .archbut {
  background-color: var(--background-color);
  border: solid;
  margin-left: 10px;
  border-color: #d2d2d2;
  border-width: 1px;
  color: var(--contrast);
  padding: 9px;
  width: 21.5%;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.users-edit-box .archbut:hover {
  border-color: #e94c4c;
  box-shadow: 0 0 0 2px rgba(233, 76, 76, 0.2);
}

.users-edit-box .buttontext {
  vertical-align: top;
  display: inline-block;
  margin-top: 1px;
  transition: color 0.15s;
}

.users-edit-box .archbut.is-archived {
  background-color: var(--red-text);
  border-color: var(--red-text);
  color: var(--contrast-color);
}

.users-edit-box .sendnew.is-sent svg {
  transform: rotate(-12deg);
}

.users-edit-modal.is-bulk input:disabled {
  background: #f1f1f1;
  color: #9b9b9b;
}

.users-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.users-edit-box label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
}

.users-edit-box input {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 6px 8px;
}

.users-edit-pill {
  border-radius: 8px;
  background: #f0f0f0;
  padding: 6px 8px;
}

.users-edit-activity {
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f7f7f7;
}

.users-edit-metric {
  font-size: 1.4rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .users-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .users-controls {
    flex-wrap: wrap;
  }
}
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #666;
  font-size: 0.7rem;
  line-height: 1;
}

.info-tooltip-pop {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--background-color);
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 10px;
  width: 180px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
}

.info-tooltip:hover .info-tooltip-pop {
  display: flex;
}

.info-tooltip-title {
  font-weight: 600;
  font-size: 0.75rem;
  color: #111;
}

.info-tooltip-text {
  font-size: 0.7rem;
  color: #5f5f5f;
}

.info-tooltip-image {
  width: 100%;
  height: 60px;
  border-radius: 8px;
  background: #e9e9e9;
}

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

  .role-customization {
    border-left: none;
    padding-left: 0;
  }
}
.users-filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: #6b6b6b;
  cursor: pointer;
}

.users-filter-row:first-of-type {
  border-top: none;
}

.users-filter-all {
  border: none;
  background: transparent;
  color: #6b6b6b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  width: 100%;
  justify-content: flex-end;
}

.users-filter-all svg {
  width: 14px;
  height: 14px;
}

.users-filter-panel {
  display: block;
  visibility: hidden;
  padding: 10px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: var(--background-color);
  position: absolute;
  z-index: 1200;
  width: 240px;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  filter: blur(8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}

.users-filter-panel.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.users-filter-actions {
  display: flex;
  justify-content: flex-end;
}

.users-filter-actions button {
  border: none;
  background: var(--contrast);
  color: var(--background-color);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}

.institutioninviteModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120100;
  padding: 20px;
  box-sizing: border-box;
}

@keyframes gradientMove {
  0% { background-color: #C7C7C7; }
  50% { background-color: #9b9b9b; }
  100% { background-color: #C7C7C7; }
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 50%; }
  100% { background-position: -200% 50%; }
}

.bootOverlayText,
#bootOverlayText {
  width: 100px;
  background: linear-gradient(
    96deg,
    var(--invite-skeleton-base) 0%,
    var(--invite-skeleton-highlight) 50%,
    var(--invite-skeleton-base) 100%
  );
  background-size: 260% 100%;
  display: flex;
  height: 20px;
  border-radius: 8px;
  animation: skeletonShimmer 1.85s linear infinite;
}

.bootOverlayInputButton {
  height: 32px;
  background: linear-gradient(
    96deg,
    var(--invite-skeleton-base) 0%,
    var(--invite-skeleton-highlight) 50%,
    var(--invite-skeleton-base) 100%
  );
  background-size: 260% 100%;
  display: flex;
  border-radius: 8px;
  animation: skeletonShimmer 1.85s linear infinite;
}

.institutioninvite {
  display: flex;
  width: 400px;
  max-width: 100%;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 13px;
  padding: 12px;
  gap: 8px;
  background: var(--background-color);
  box-sizing: border-box;
}

.UserTextLarge {
  display: flex;
  color: var(--contrast);
  font-size: 1.2rem;
  font-weight: 500;
}

.UserTextLarge.IntitutionTitle{
  display: inline-block;
}


.settingsText {
  color: var(--med-text);
  display: flex;
  font-size: 1rem;
}

.BoldTextNormal {
  color: var(--contrast);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 12px 0 12px;
}

.institutioninviteBox {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 4px;
}

.PaymentPageFieldRow {
  display: flex;
  align-items: center;
}

.PaymentPageFieldIcons {
  display: flex;
  width: 19px;
  color: var(--med-text);
  margin-right: 8px;
}

.smallTextPayment {
  display: flex;
  color: var(--med-text);
  font-size: 0.9rem;
  font-weight: 500;
}

.smallTextPayment.BlueText {
  color: var(--blue-accent);
}

.PaymentPageFieldList {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.institutioninviteControls {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.AcceptInvBtn {
  font-size: 0.9rem;
  display: flex;
  align-self: start;
  align-items: center;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--contrast);
  color: var(--background-color);
}

.AcceptInvBtn:hover {
  background-color: var(--med-text);
  color: var(--background-color);
}

.DeclineInvBtn {
  font-size: 0.9rem;
  display: flex;
  align-self: start;
  align-items: center;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--red-bg);
  color: var(--red-text);
}

.DeclineInvBtn:hover {
  background-color: var(--red-text);
  color: var(--contrast-color);
}

.DeclineInvBtn:disabled,
.AcceptInvBtn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 620px) {
  .institutioninvite {
    width: 100%;
  }

  .institutioninviteControls {
    margin-left: 0;
    justify-content: flex-end;
  }
}

/* ===============================
   SETTINGS VIEW (NEW)
================================ */
.main-view {
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

#chatView {
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  min-height: 0;
  position: relative;
}

.chat-main-page-pane {
  display: none;
  width: 50%;
  max-width: 50%;
  min-height: 0;
  overflow: hidden;
}

#chatView.is-main-page-ui .chat-main-page-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#chatView.is-main-page-ui .chat-main-page-pane {
  position: absolute;
  top: var(--topbar-height, var(--slanter-topbar-h, 64px));
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
}

#chatView.is-main-page-ui > .chat-scroll,
#chatView.is-main-page-ui > .input-container,
#chatView.is-main-page-ui > .input-container-centered,
#chatView.is-main-page-ui > .inputbarGreeting,
#chatView.is-main-page-ui > .input-disclaimer,
#chatView.is-main-page-ui > .chat-bottom-mask,
#chatView.is-main-page-ui > .scroll-down {
  display: none !important;
}

/* Hide tool chat, input bar, and bottom padding when quiz/flashcards are shown in a tab host */
.is-split-tool-host #toolChatLog,
.is-split-tool-host #toolChatbar,
.is-split-tool-host #toolInputDisclaimer,
.is-split-tool-host #toolBottomMask,
.is-split-tool-host .tool-chatpad {
  display: none !important;
}

.chat-bottom-mask {
  position: absolute;
  left: 0;
  right: var(--chat-scrollbar-shift, 0px);
  width: auto;
  align-self: stretch;
  bottom: 0;
  height: 112px;
  background: var(--background-color);
  pointer-events: none;
  z-index: 5;
}

/* Keep all composer containers above visual bottom masks. */
#chatView > .input-container,
#chatView > .input-container-centered,
#toolChatbar {
  z-index: 12 !important;
}

.settings-view {
  background: var(--background-color);
  overflow: hidden;
  flex-direction: column;
}

.saves-view {
  background: var(--background-color);
  flex-direction: column;
  justify-content: flex-start;
}

.settings-topbar {
  flex: 0 0 auto;
}

.settings-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  margin: auto;
  max-width: 1530px;
  display: flex;
}

.saved-body {
  max-width: 763px;
  box-sizing: border-box;
  width: 100%;
  align-self: center;
  display: flex;
  flex-direction: column;
  margin: 24px 12px 0 12px;
  padding: 0 12px;
  padding-top: 24px;
  transition: all 0.1s ease;
  gap: 24px;
  overflow: visible;
  padding-bottom: 18px;
}

#CollectionView,
#CollectionItemView {
  width: 100% !important;
  max-width: 100% !important;
  align-self: stretch !important;
  flex-direction: column;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
}

#CollectionView .saved-body,
#CollectionItemView .saved-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  margin: 0;
  padding: 24px 12px 26px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-gutter: stable !important;
}

#CollectionView .saved-body::-webkit-scrollbar,
#CollectionItemView .saved-body::-webkit-scrollbar {
  width: 10px !important;
}

#CollectionView .saved-body::-webkit-scrollbar-track,
#CollectionItemView .saved-body::-webkit-scrollbar-track {
  background: var(--background-color) !important;
  border-radius: 11px !important;
}

#CollectionView .saved-body::-webkit-scrollbar-thumb,
#CollectionItemView .saved-body::-webkit-scrollbar-thumb {
  background: var(--border-color) !important;
  border-radius: 11px !important;
  border: 1px solid var(--background-color) !important;
}

@supports not selector(::-webkit-scrollbar) {
  #CollectionView .saved-body,
  #CollectionItemView .saved-body {
    scrollbar-color: var(--border-color) var(--background-color) !important;
  }
}

#CollectionView .saved-body > *,
#CollectionItemView .saved-body > * {
  width: min(100%, 765px);
  max-width: 765px;
  margin-left: auto;
  margin-right: auto;
}

/* Match split chat horizontal inset/centering for Saved surfaces in both panes. */
#chatView.is-main-page-ui .chat-main-page-pane > .saved-body.split-mounted-surface {
  width: min(calc(100% - 32px), 700px);
  max-width: min(calc(100% - 32px), 700px);
  margin-left: auto;
  margin-right: auto;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
}

.settings-pane {
  flex: 1;
  display: flex;
}

.settings-sidebar {
  width: 180px;
  display: flex;
  padding: 18px;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  background: var(--background-color);
}

.settings-mobile-nav {
  display: none;
  width: 100%;
  position: relative;
  padding: 18px 18px 0;
  box-sizing: border-box;
}

.settings-sb-btn.settings-mobile-trigger {
  position: relative;
  background-color: var(--hover-color);
}

.settings-sb-btn.settings-mobile-trigger .settingsBtnIcon {
  margin-left: auto;
}

.settings-sb-btn.settings-mobile-trigger::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -20px;
  border-bottom: 1px solid var(--border-color);
  pointer-events: none;
}

.SettingDropDown.settings-mobile-dropdown {
  width: calc(100% - 36px);
  position: absolute;
  inset: auto auto auto 18px;
  top: calc(100% - 2px);
  z-index: 150;
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100%;
}

.settings-mobile-option.is-active {
  background-color: var(--hover-color);
}

.settings-sb-btn {
  display: flex;
  align-items: center;
  padding: 14px 8px;
  gap: 14px;
  height: 35px;
  background-color: transparent;
  width: 100%;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-color-sidebar);
}

.settings-sb-btn:hover {
  background-color: var(--hover-color);
  color: var(--text-color);
}

.settings-sb-btn.is-active {
  background-color: var(--hover-color);
  color: var(--text-color);
}

.settings-sb-text {
  display: flex;
  align-self: center;
}

.settings-sb-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-self: center;
}

.settings-back-btn {
  margin-top: auto;
  background: var(--border-color);
  color: #555;
}

.settingsWindow {
  display: flex;
  padding: 18px;
  width: 100%;
  flex-direction: column;
}

.settings-body.settings-use-mobile-nav {
  flex-direction: column;
  overflow-x: hidden;
}

.settings-body.settings-use-mobile-nav .settings-sidebar {
  display: none;
}

.settings-body.settings-use-mobile-nav .settings-mobile-nav {
  display: flex;
}

.settings-body.settings-use-mobile-nav .settingsWindow {
  padding-top: 32px;
}

@media (max-width: 720px) {
  #settingsView .settings-body {
    flex-direction: column;
    overflow-x: hidden;
  }

  #settingsView .settings-sidebar {
    display: none;
  }

  #settingsView .settings-mobile-nav {
    display: flex;
  }

  #settingsView .settingsWindow {
    padding-top: 32px;
  }
}

.settingsTextBox {
  display: flex;
  flex-direction: column;
}

.themeRow {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.themeBtn {
  opacity: 0.7;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  outline-offset: 0;
  transition: transform 0.2s ease, outline  0.2s ease, opactiy  0.2s ease;
}

.themeBtn.mobile:hover .themeImg {
  outline: 1px solid var(--light-text );
}

.themeBtn.mobile.active .themeImg {
  outline: 2px solid var(--blue-accent);
  outline-offset: 2px;
}

.themeImg.mobile {
  border-radius: 13px;
}

.themeText {
  color: var(--text-color);
  text-align: center;
  padding-top: 8px;
}

.settingsText {
  color: var(--med-text);
  display: flex;
}

.settingsBlock {
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  width: 100%;
  padding-top: 16px;
  display: flex;
  align-items: center;
}

.settingsSubText {
  color: var(--light-text);
  font-size: 0.8rem;
  width: 250px;
  padding-top: 4px;
}

.settingsBtn {
  color: var(--text-color);
  font-size: 0.9rem;
  margin-left: auto;
  display: flex;
  align-items: center;
  background-color: var(--background-color);
  gap: 5px;
  border: none;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.1s ease, box-shadow 0.14s ease;
}

.settingsBtn:hover {
  background-color: var(--hover-color);
}

.settings-btn-disabled,
.settings-btn-disabled:hover {
  background-color: var(--border-color);
  color: #9b9b9b;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.settings-btn-disabled .settingsBtnIconEdit {
  display: none;
}

.settingsBtnIcon {
  width: 18px;
  display: flex;
}

.settingsBtnText {
  font-size: 0.9rem;
}

.customPrompt {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-top: 12px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: block;
  width: 100% !important;
  height: 100px;
  padding: 10px;
  box-sizing: border-box;
  resize: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.settingsinputfield{
  position: relative;
  width: 100%;
}

.settingsCharCount {
  position: absolute;
  bottom: 8px;
  right: 8px;
  margin-top: 6px;
  margin-left: auto;
  color: #8e8e8e;
  font-size: 0.72rem;
}

.nickname {
  margin-top: 12px;
  background-color: var(--input-box-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  display: flex;
  max-width: 390px;
  height: 42px;
  padding: 10px;
  box-sizing: border-box;
}

.switchBtn {
  position: relative;
  background-color: var(--darker-hover-color);
  border: none;
  width: 32px;
  height: 18px;
  border-radius: 8px;
  margin-left: auto;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.switchBtnShape {
  position: absolute;
  top: 2px;
  left: 2px;
  background-color: var(--background-color);
  border-radius: 5px;
  height: 14px;
  width: 15px;
  transition: transform 0.2s ease;
}

.switchBtn.is-on {
  background-color: var(--switch-bg);
}

.switchBtn.is-on .switchBtnShape {
  transform: translateX(13px);
}

.settingsBtnRed {
  font-size: 0.9rem;
  margin-left: auto;
  display: flex;
  align-items: center;
  background-color: var(--red-bg);
  border: 1px solid var(--red-bg);
  color: var(--red-text);
  gap: 5px;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, transform 0.1s ease, box-shadow 0.14s ease;
}

.settingsBtnRed:hover {
  background-color: var(--red-text);
  color: var(--contrast-color);
}

.SettingPaymentSide {
  display: flex;
  flex-direction: column;
}

.settingsBtnBlack {
  font-size: 0.9rem;
  margin-left: auto;
  display: flex;
  align-self: start;
  align-items: center;
  background-color: var(--contrast);
  border: none;
  color: var(--background-color);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.1s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.settingsBtnBlack:hover {
  background-color: var(--med-text);
}

.settingsBtnBlack:disabled,
.settingsBtnBlack.is-disabled {
  background-color: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
}

.settingsBtnBlack:disabled:hover,
.settingsBtnBlack.is-disabled:hover {
  background-color: var(--disabled-bg);
}

.settings-save-btn {
  margin-left: 0;
  align-self: flex-start;
  margin-top: 10px;
}

.settings-save-btn.is-loading {
  opacity: 0.9;
  pointer-events: none;
}

.settingsTextLarge {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  margin: 8px 0;
}

.settingsTierDescription {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settingsTierDescriptor {
  display: flex;
  color: var(--med-text);
  font-size: 0.95rem;
}

.settingsTierDescriptorIcon {
  width: 19px;
  margin-right: 8px;
}

.settingsBtnIconEdit {
  width: 14px;
  display: flex;
  margin-left: 4px;
}

.emailRowSettings {
  display: flex;
  align-items: center;
  width: 100%;
}

.settingsBtnWhite {
  margin-left: auto;
  display: flex;
  align-items: center;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  color: var(--contrast);
  gap: 5px;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.1s ease, box-shadow 0.14s ease;
}

.settingsBtnWhite:hover {
  background-color: var(--border-color);
}

.SettingDropDown {
  width: 200px;
  position: fixed;
  background-color: var(--background-color);
  height: fit-content;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 13px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  z-index: 5000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  right: 16px;
}

.SettingDropDown.hidden {
  display: none;
}

.SettingDropDownOption {
  border-radius: 8px;
  gap: 14px;
  background-color: var(--background-color);
  border: none;
  padding: 8px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  font-size: 1rem;
  width: 100%;
  color: var(--med-text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.SettingDropDownOption:hover {
  background-color: var(--hover-color);
  color: var(--contrast);
}

.SettingDropDownSelectedIcon {
  width: 20px;
  display: flex;
  margin-left: auto;
}

.mobile-settings-select-dropdown {
  z-index: 2147483610;
  max-height: min(340px, calc(100vh - 80px));
  overflow-y: auto;
  width: 191px !important;
  min-width: 191px !important;
  max-width: 191px !important;
  transform-origin: var(--mobile-settings-select-origin-x, calc(100% - 12px)) var(--mobile-settings-select-origin-y, calc(100% - 12px));
}

.mobile-settings-select-dropdown .mobile-settings-select-option {
  justify-content: flex-start;
  gap: 8px;
}

.mobile-settings-select-dropdown .mobile-settings-select-option.active,
.mobile-settings-select-dropdown .mobile-settings-select-option.active:hover {
  background-color: transparent !important;
  color: var(--med-dark-text) !important;
}

.mobile-settings-select-dropdown .mobile-settings-select-option .TextButtonMobile.check {
  margin-left: auto;
}

.mobile-settings-select-dropdown.mobile-settings-select-enter {
  animation: mobileSettingsSelectFluidIn 320ms cubic-bezier(0.18, 0.88, 0.24, 1) both;
  will-change: transform, opacity;
}

.mobile-settings-select-dropdown.mobile-settings-select-exit {
  animation: mobileSettingsSelectFluidIn 280ms cubic-bezier(0.18, 0.88, 0.24, 1) reverse both;
  will-change: transform, opacity;
  pointer-events: none;
}

@keyframes mobileSettingsSelectFluidIn {
  0% {
    opacity: 0;
    transform: translate3d(0, var(--mobile-settings-select-from-y, 18px), 0) scale3d(0.965, 0.87, 1);
  }
  54% {
    opacity: 1;
    transform: translate3d(0, -1px, 0) scale3d(1.012, 1.028, 1);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
  }
}

#settingsLanguageDropdown {
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
}

.settings-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0s linear 0s;
}

.settings-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.settings-modal > * {
  transform: scale(1);
  transition: transform 0.2s ease;
}

.settings-modal.hidden > * {
  transform: scale(0.95);
}

.SettingPopupVerify,
.SettingPopupInput {
  font-size: 1rem;
  width: 400px;
  position: relative;
  background-color: var(--background-color);
  height: fit-content;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.SettingPopupButtonRow {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.settingsBtnGrey {
  margin-left: auto;
  display: flex;
  align-items: center;
  background-color: transparent;
  border: none;
  color: var(--contrast);
  gap: 5px;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.1s ease, box-shadow 0.14s ease;
}

.settingsBtnGrey:hover {
  background-color: var(--hover-color);
}

.popupinput {
  color: var(--text-color);
  font-size: 1rem;
  margin-top: 12px;
  background-color: var(--input-box-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  display: block;
  width: 100%;
  height: 42px;
  padding: 8px 10px;
  box-sizing: border-box;
}

.popupinput.folder {
  margin-top: 0;
}

.popupinput:focus {
  outline: 2px solid var(--contrast);
}

.settings-pane .popupinput {
  margin-top: 0;
}

.payment-view {
  background: var(--background-color);
  overflow: hidden;
  flex-direction: column;
}

.payment-topbar {
  flex: 0 0 auto;
}

.PaymentPage {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0 16px 32px;
}

.main-view2 {
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
}

.PaymentHeader {
  font-size: 1.5rem;
  align-self: center;
  color: var(--contrast);
  margin-bottom: 20px;
  margin-top: 48px;
}

.PaymentPageFields {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.PaymentPageField {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 21px;
  padding: 16px;
  flex: 0 1 350px;
  height: 600px;
  position: relative;
  background: var(--input-bg);
}

.PaymentPageIcon {
  display: flex;
  width: 80px;
  margin: 10px 0 20px 0;
}

.PaymentPageIconPlus {
  display: flex;
  width: 80px;
  margin: 6px 0 20px 0;
}

.largeTextPayment {
  display: flex;
  font-weight: 700;
  font-size: 1.5rem;
}

.largeTextPaymentNum {
  display: flex;
  font-weight: 700;
  font-size: 1.5rem;
  margin-top: 16px;
}

.smallTextPayment {
  display: flex;
  color: var(--med-text);
  font-size: 0.9rem;
  font-weight: 500;
}

.PaymentButtonFree {
  display: flex;
  width: 100%;
  margin: 16px 0 16px 0;
  padding: 12px;
  font-size: 1rem;
  justify-content: center;
  border: none;
  border-radius: 13px;
  cursor: pointer;
  color: var(--contrast);
  background-color: var(--hover-color);
  transition: background-color 0.2s ease;
}

.PaymentButtonFree:hover {
  background-color: var(--darker-hover-color);
}

.PaymentButtonPlus {
  display: flex;
  width: 100%;
  margin: 16px 0 16px 0;
  padding: 12px;
  font-size: 1rem;
  justify-content: center;
  border: none;
  border-radius: 13px;
  cursor: pointer;
  color: var(--contrast-text);
  background-color: var(--light-background);
  transition: background 0.2s ease;
}

.PaymentButtonPlus:hover{
  background-color: var(--light-background-hover);
}

.PaymentPageFieldList {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.mediumTextPayment {
  display: flex;
  border-top: 1px solid #CCCCCC;
  padding-top: 16px;
  font-weight: 600;
  color: var(--med-text);
}

.PaymentPageFieldRow {
  display: flex;
  align-items: center;
}

.PaymentPageFieldIcons {
   display: flex;   
   width: 19px;
   color: var(--med-text);
   margin-right: 8px;
}

.PeriodSelectorPayment {
  gap: 18px;
  display: flex;
  background-color: var(--border-color);
  border: none;
  border-radius: 13px;
  width: fit-content;
  position: absolute;
  right: 16px;
  transition: all 0.15s ease;
}

.SelectorPayment {
  background-color: var(--light-background);
  position: absolute;
  width: 134px;
  height: 33px;
  right: 1px;
  margin: 4px;
  border-radius: 11px;
  transform: translateX(0); /* yearly position */
  transition: all 0.15s ease;
}

.PeriodSelectorPayment.is-monthly .SelectorPayment {
  transform: translateX(-131px); /* monthly position */
  width: 75px;
}

.PeriodSelectorPayment.is-monthly .blueText{
  color: var(--blue-accent);
}

.smallTextPaymentSelector {
  display: flex;
  color: var(--contrast);
  font-size: 0.9rem;
  z-index: 2;
  padding: 12px 0 12px 15px;
  cursor: pointer;
}

.smallTextPaymentSelected {
  display: flex;
  color: var(--background-color);
  font-size: 0.9rem;
  z-index: 2;
  padding: 12px 15px 12px 0;
  cursor: pointer;
}

.smallTextPaymentSelectorMonthly {
  display: flex;
  color: var(--background-color);
  font-size: 0.9rem;
  z-index: 2;
  padding: 12px 0 12px 15px;
  cursor: pointer;
}

.smallTextPaymentSelectedMonthly {
  display: flex;
  color: var(--contrast);
  font-size: 0.9rem;
  z-index: 2;
  padding: 12px 15px 12px 0;
  cursor: pointer;
}

.plansmobile{
  display: none;
}

body.mobile-active .payment-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.mobile-active #PaymentView > .payment-topbar {
  display: none !important;
}

body.mobile-active.mobile-payment-open #PaymentView {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: calc(var(--mobile-top-fade-h, 78px) + env(safe-area-inset-top, 0px));
  z-index: 120540;
}

body.mobile-active.mobile-payment-open #mobileTopbar {
  display: flex !important;
  z-index: 120552 !important;
  background: var(--background-color) !important;
}

body.mobile-active.mobile-payment-open #mobileTopbar::before {
  background: var(--background-color) !important;
  background-image: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.mobile-active.mobile-payment-open #mobileInputBar {
  display: none !important;
}

body.mobile-active .payment-view .PaymentHeader,
body.mobile-active .payment-view .PaymentPageFields {
  display: none;
}

body.mobile-active .payment-view .PaymentPage {
  padding: 10px 12px 0;
}

body.mobile-active.mobile-payment-open .payment-view .PaymentPage {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 220px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

body.mobile-active .payment-view .plansmobile {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  padding: 0 12px;
}

body.mobile-active .payment-view .mobilepluspoints {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0;
}

body.mobile-active .payment-view .plansmobilebtm {
  margin-top: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 14px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, var(--background-color) 24px);
}

body.mobile-active.mobile-payment-open .payment-view .plansmobilebtm {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  margin-top: 0;
  z-index: 120553;
}

body.mobile-active .payment-view .plansmobileprice {
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  padding-bottom: 8px;
  display: flex;
  font-size: 2.5rem;
  color: var(--contrast);
}

body.mobile-active .payment-view .plansmobilepriceside {
  display: flex;
  font-size: 0.9rem;
  color: var(--med-text);
  max-width: 120px;
  line-height: 1.2;
}

body.mobile-active .payment-view .mobilepluspoint {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  color: var(--med-text);
}

body.mobile-active .payment-view .mobilepluspointicon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: #A9A963;
}

body.mobile-active .payment-view .mobileplanicon {
  width: 75px;
  height: auto;
  display: flex;
  align-self: center;
  color: #A9A963;
}

body.mobile-active .payment-view .mobileplantitle {
  font-size: 1.4rem;
  font-family: "artifex-cf", serif;
  color: var(--contrast);
  align-self: center;
}

body.mobile-active .payment-view .mobileplanblue {
  font-size: 1.1rem;
  font-family: "artifex-cf", serif;
  color: #2B74D9;
  align-self: center;
}

body.mobile-active .payment-view .plansmobiledisclaimer {
  font-size: 0.9rem;
  color: var(--med-text);
  align-self: center;
  text-align: center;
  padding-top: 8px;
}

body.mobile-active .payment-view .plansmobiledisclaimer.light {
  color: #A6A6A5;
  padding-top: 4px;
}

.threeDotsMenu {
  width: 18px;
  margin-left: auto;
  border: none;
  background-color: transparent;
  display: flex;
  color: var(--med-light-text);
  transition: color 0.2s ease;
  cursor: pointer;
  visibility: hidden;
}
.threeDotsMenu:hover{
  color: var(--contrast);
}

.sidebarchevron{
  width: 15px;
  visibility: visible;
  opacity: 0.55;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.sidebarsectionheader{
  user-select: none;
  padding-left: 9px;
  color: var(--med-text);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  gap: 4px;
  transition: color 0.2s ease;
  align-items: center;
}

.sidebarsectionheader:hover {
  color: var(--light-text);
}

.sidebarsectionheader:hover .sidebarchevron {
  opacity: 0.95;
}

.sidebar-folder-items,
.sidebar-chat-items {
  max-height: 4200px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.14s linear;
}

.sidebar-folder-list.is-collapsed .sidebar-folder-items,
.sidebar-chat-list.is-collapsed .sidebar-chat-items {
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.sidebar-folder-list.is-collapsed .sidebarsectionheader .sidebarchevron,
.sidebar-chat-list.is-collapsed .sidebarsectionheader .sidebarchevron {
  transform: rotate(-90deg);
  opacity: 0.9;
}

#PinnedCollections .collectionList,
#AllCollections .collectionList {
  max-height: 4200px;
  opacity: 1;
  /* overflow: hidden;
  overflow-x: visible !important; */
  transition: max-height 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.14s linear;
}

#PinnedCollections.is-collapsed .collectionList,
#AllCollections.is-collapsed .collectionList {
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
}

#PinnedCollections.is-collapsed .sidebarsectionheader .sidebarchevron,
#AllCollections.is-collapsed .sidebarsectionheader .sidebarchevron {
  transform: rotate(-90deg);
  opacity: 0.9;
}

#PinnedCollections.no-pinned {
  display: none;
}

.blueText {
color: var(--blue-accent-dark);
}

.UsersBox {
  display: flex;
  flex-direction: column;
}

.userSeparator {
  height: 1px;
  background-color: var(--border-color);
  width: 100%;
  transition: opacity 0.18s ease;
  opacity: 1;
}

.SavedRow{
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  min-height: 52px;
  display: flex;
  border-radius: 0;
  align-items: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.SavedRow.chat-search-row {
  max-width: 100%;
  overflow: hidden;
}

.SavedRow.chat-search-row .TopRow {
  min-width: 0;
}

.SavedRow.chat-search-row .UserText {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.SavedRow.chat-search-row .UserTextSmall.Time,
.SavedRow.chat-search-row .UserTextSmall.Time.search,
.SavedRow.chat-search-row:hover .UserTextSmall.Time,
.SavedRow.chat-search-row:hover .UserTextSmall.Time.search {
  left: 0;
  margin-right: 0;
  flex: 0 0 auto;
}

.SavedRow.chat-search-row .SavedSubtitle {
  max-width: 100%;
}


.SavedRow:hover{
  display: flex;
  border-radius: 13px;
  background-color: var(--file-btn-mobile-bg-trans);
  align-items: center;
}

.SavedRow:hover .SavedRowEditBtn{
  visibility: visible;
}

/* hide separator below hovered row */
.SavedRow:hover + .userSeparator {
  opacity: 0;
}

/* hide separator above hovered row */
.userSeparator:has(+ .SavedRow:hover) {
  opacity: 0;
}

.userSeparator.is-hidden-adjacent-hover,
.userSeparator.is-hidden-adjacent-selected {
  opacity: 0;
}

.userInfo {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-start;
  min-width: 0;
}

.SavedRow .TopRow .UserText{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.TopRow {
  width: 100%;
  display: flex;
  align-items: baseline;
}

.UserText {
  display: flex;
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 500;
}

.UserTextSmall {
  display: flex;
  color: var(--med-text);
  font-size: 0.9rem;
  font-weight: 500;
}

.UserTextSmall.X{
  font-size: 0.8rem;
}

.UserTextSmall.Time {
  margin-left: auto;
  margin-right: 12px;
  position: relative;
  left: 44px;
  transition: all 0.2s ease;
}


.UserTextSmall.Time.search {
  left: 59px;
}

.SavedRow:hover .UserTextSmall.Time.search {
  left: 12px;
}

.SavedRow:hover .UserTextSmall.Time {
  left: 0;
}

/* Keep Saved date labels stable in split-mounted Saved surfaces. */
#chatView.is-main-page-ui .chat-main-page-pane > .saved-body.split-mounted-surface .UserTextSmall.Time,
#chatView.is-main-page-ui .chat-main-page-pane > .saved-body.split-mounted-surface .UserTextSmall.Time.search,
#chatView.is-main-page-ui .chat-main-page-pane > .saved-body.split-mounted-surface .SavedRow:hover .UserTextSmall.Time,
#chatView.is-main-page-ui .chat-main-page-pane > .saved-body.split-mounted-surface .SavedRow:hover .UserTextSmall.Time.search {
  left: 0;
  margin-right: 0;
  transition: none;
}

.BottomRow {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 26px;
  min-height: 26px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.SavedBottomRowTool {
  align-items: baseline;
  position: relative;
  top: 3px;
}

.SavedSubtitle {
  min-width: 0;
  max-width: calc(100% - 2px);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  flex: 1 1 auto;
  line-height: 1.2;
}

.SavedSubtitleTool {
  width: auto;
  max-width: none;
  flex: 0 1 auto;
}

.UserRowStatus {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #2B74D9;
  background-color: rgba(43, 116, 217, 0.33);
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: 6px;
  min-width: 0;
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 0 auto;
}

.SavedRowEditBtn {
  visibility: hidden;
  display: flex;
  aspect-ratio: 1;
  border: none;
  background-color: rgba(0, 0, 0, 0);
  color: var(--med-text);
  border-radius: 8px;
  padding: 10px;
  pointer-events: auto;
  cursor: pointer;
  margin-left: auto;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.SavedRowEditBtn:hover {
  background-color: var(--darker-hover-color);
  color: var(--text-color);
}


.EditIcon{
  width: 18px;
  display: flex;
}

.UsersSearchSlot {
  position: relative;
  flex: 1;
  min-height: 49px;
  z-index: 20;
  overflow: visible;
}

.UsersSearchFloatingHost {
  position: fixed;
  left: 0;
  top: 0;
  width: min(765px, calc(100vw - 48px));
  z-index: 1200000;
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
  transition:
    opacity 320ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 420ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.UsersSearchFloatingHost.hidden {
  display: none;
}

.UsersSearchFloatingHost.is-visible {
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
}

.searchbartop:has(.SearchBarInput:focus) {
  outline: 2px solid var(--blue-accent);
  outline-offset: 2px;
}

.searchbartop {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  border-radius: 13px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  transition: outline 0.1s ease, outline-offset 0.1s ease;
}

.SearchAutofillTrap {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.SearchAutofillTrap input {
  position: absolute;
  width: 1px;
  height: 1px;
  border: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
}

.SearchBarExpanded {
  border-radius: 21px;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  box-sizing: border-box;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  transform-origin: top center;
  transform: scaleY(1);
  transition:
    border-radius 560ms cubic-bezier(0.22, 1.28, 0.32, 1),
    box-shadow 420ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 560ms cubic-bezier(0.22, 1.3, 0.3, 1);
  will-change: border-radius;
  backface-visibility: hidden;
}

.SearchBarForm {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.SearchBarExpanded.is-floating-search .SearchBarInput {
  font-size: 1.2rem; 
}

.SearchBarExpanded.is-floating-search {
  position: relative;
  left: 0;
  top: 0;
  right: auto;
  border-radius: 13px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24), 0 3px 10px rgba(0, 0, 0, 0.12);
  --floating-search-collapsed-width: 400px;
  --floating-search-expanded-width: min(675px, 100%);
  width: var(--floating-search-collapsed-width);
  max-width: 100%;
  margin: 0 auto;
  transition:
    width 460ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0ms linear,
    box-shadow 420ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 560ms cubic-bezier(0.22, 1.3, 0.3, 1);
}

.SearchBarExpanded.is-floating-search.is-wide {
  width: var(--floating-search-expanded-width);
  border-radius: 21px;
}

.SearchBarExpanded.is-floating-search .searchbartop {
  cursor: grab;
}

.searchbarBottom {
  display: flex;
  flex-direction: column;
  background-color: var(--input-bg);
  max-height: var(--searchbar-bottom-max-height, 360px);
  opacity: 1;
  overflow: hidden;
  transform-origin: top center;
  transform: translateY(0) scaleY(1);
  transition:
    height 560ms cubic-bezier(0.22, 1.2, 0.32, 1),
    max-height 560ms cubic-bezier(0.22, 1.2, 0.32, 1),
    opacity 260ms ease,
    transform 560ms cubic-bezier(0.22, 1.34, 0.3, 1);
  will-change: height, max-height, opacity, transform;
}

.SearchBarExpanded.is-collapsed{
  border-radius: 13px;
}

.SearchBarExpanded.is-collapsed .searchbartop {
  border-bottom-color: transparent;
}

.SearchBarExpanded.is-collapsed .searchbarBottom {
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px) scaleY(0.9);
  pointer-events: none;
}

.SearchBarExpanded:not(.is-collapsed) {
  animation: usersSearchShellSpringOpen 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes usersSearchShellSpringOpen {
  0% { transform: scaleY(0.968); }
  58% { transform: scaleY(1.018); }
  100% { transform: scaleY(1); }
}

.SearchBarInputWrap {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 6px;
  flex-wrap: wrap;
}

.SearchFilterTokens {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.SearchFilterTokens:empty {
  display: none;
}

.SearchFilterToken {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  padding-right: 4px;
  user-select: text;
  -webkit-user-select: text;
}

.SearchFilterTokenLabel {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.SearchFilterTokenIcon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.SearchFilterTokenRemove {
  font-size: 12px;
  line-height: 1;
  opacity: 0.75;
}

.SearchFilterToken:hover .SearchFilterTokenRemove {
  opacity: 1;
}

.SearchFilterToken.is-text-selected {
  outline: 3px solid #82adfa;
  outline-offset: 1px;
  border-radius: 6px;
}

.SearchreslutCategories {
  padding: 8px 12px;
  display: grid;
  grid-template-columns: repeat(var(--search-category-columns, 2), minmax(0, 1fr));
  gap: 8px;
}

.SearchreslutCategory {
  border: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 0;
  color: var(--med-text);
  font-size: 0.9rem;
  background-color: var(--darker-hover-color);
  transition: all 0.2s;
}

.SearchreslutCategory:hover {
  color: var(--text-color);
  background-color: var(--hover-color);
}

.SearchreslutCategory.is-active {
  color: var(--background-color);
  background-color: var(--sidebar-controls);
}

.SearchreslutCategory:disabled {
  opacity: 0.45;
  cursor: default;
}

.searchresults {
  display: flex;
  flex-direction: column;
  padding: 0 8px 8px;
  overflow-y: hidden;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-padding-bottom: 8px;
  --sb-size: 0px;
  max-height: var(--search-results-max-height, 300px);
  min-height: 52px;
  transition:
    height 560ms cubic-bezier(0.22, 1.2, 0.32, 1),
    max-height 560ms cubic-bezier(0.22, 1.2, 0.32, 1);
  scrollbar-width: none;
  scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
  box-sizing: border-box;
}

.searchresults.chats {
  padding: 8px; 
}

.searchresults:not(.has-overflow) {
  overflow-y: hidden !important;
  overscroll-behavior: none;
  scrollbar-width: none !important;
}

.searchresults:not(.has-overflow)::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

.SearchBarExpanded.is-scroll-ready .searchresults.has-overflow {
  overflow-y: auto;
  --sb-size: 8px;
  scrollbar-width: thin;
}

.searchresults.noresults {
  overflow-y: hidden;
  scrollbar-width: none;
}

.searchresults.noresults::after {
  display: none !important;
}

.searchresults.noresults::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.searchresults::-webkit-scrollbar {
  width: var(--sb-size);
}

.searchresults::-webkit-scrollbar-track {
  background: var(--sb-track-color);
  border-radius: 11px;
  transition: background-color 220ms ease;
}

.searchresults::-webkit-scrollbar-thumb {
  background: var(--sb-thumb-color);
  border-radius: 11px;
  transition: background-color 220ms ease;
}

.searchresultsEmpty {
  padding: 4px 8px;
  color: #8e8e8e;
  font-size: 0.85rem;
}

.searchresultsNoState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.searchresults.noresults {
  padding: 0;
}

.topneuralNetSearch,
.bottomneuralNetSearch {
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
  user-select: none;
  position: absolute;
}

.bottomneuralNetSearch{
  bottom: -1px;
  left: 0;
  right: auto;
  justify-content: flex-start;
}

.bottomneuralNetSearch.top {
  top: 0;
}

.topneuralNetSearch {
  top: 0;
  right: 0;
  left: auto;
  justify-content: flex-end;
}

.topneuralNetSearch > svg,
.bottomneuralNetSearch > svg {
  width: auto;
  max-width: none;
  display: block;
}

.topneuralNetSearchSVG {
  display: block;
}

.NoResultsSearchText{
  max-width: 300px;
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-color);
  font-weight: 500;
  display: flex;
  align-self: center;
  position: absolute;
}

.searchresults.noresults .searchresultsNoState .topneuralNetSearch {
  opacity: 0;
  transform: translateY(-8px);
  animation: searchNeuralInTop 0.6s ease forwards;
}

.searchresults.noresults .searchresultsNoState .bottomneuralNetSearch {
  opacity: 0;
  transform: translateY(8px);
  animation: searchNeuralInBottom 0.7s ease 0.08s forwards;
}

.searchresults.noresults .searchresultsNoState .NoResultsSearchText {
  opacity: 0;
  transform: translateY(5px);
  animation: searchNeuralTextIn 0.45s ease 0.12s forwards;
}

.neuralNeuron {
  opacity: 0.7;
  pointer-events: none;
}

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

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

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

.searchResultSeparator {
  height: 1px;
  background-color: var(--border-color);
  width: calc(100% - 20px);
  margin: 0 10px;
  flex: 0 0 1px;
  transition: opacity 120ms ease;
  opacity: 1;
}

.searchResultSeparator.is-hidden-adjacent {
  opacity: 0;
}

.searchResultRow {
  border: none;
  background: var(--input-bg);
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  width: 100%;
  text-align: left;
  border-radius: 13px;
  padding: 8px 10px;
  transition: background-color 0.2s ease;
}

.searchresults .SavedRow,
.searchresults .searchResultRow {
  flex-shrink: 0;
}

.searchResultRow:hover {
  background-color: var(--hover-color);
}

.searchresults.search-loading-skeleton .searchResultRowLoading {
  pointer-events: none;
  cursor: default;
}

.searchresults.search-loading-skeleton .searchResultRowLoading:hover {
  background-color: var(--input-bg);
}

.searchResultRow .userInfo {
  flex: 1;
}

.searchResultRow .UserIcon,
.searchResultRow .roleIcon {
  margin-right: 0;
}

.searchResultRow .UserIcon {
  font-size: 1rem;
  line-height: 1;
  width: 41px;
  height: 41px;
  padding: 0;
  flex: 0 0 41px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.searchResultRow .RoleRowUser {
  color: var(--med-text);
  max-width: 210px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.searchStatusRow .roleIcon .icon_rolerow.searchStatusRoleIcon {
  width: 100%;
  height: 100%;
}

.searchStatusRow .roleIcon .icon_rolerow.searchStatusRoleIcon path {
  stroke-width: 2;
}

.searchResultRow .searchResultUserEditBtn,
.searchResultRow .searchResultRoleEditBtn {
  display: flex;
  visibility: visible;
  opacity: 0;
  transition: opacity 180ms ease, color 180ms ease, background-color 180ms ease;
}

.searchResultRow:hover .searchResultUserEditBtn,
.searchResultRow:hover .searchResultRoleEditBtn {
  opacity: 1;
}

.searchResultRow .userRowEditBtn.searchResultUserEditBtn {
  visibility: visible;
  opacity: 0;
  margin-left: auto;
}

.searchResultRow:hover .userRowEditBtn.searchResultUserEditBtn {
  opacity: 1;
}

.searchResultRow .userRowEditBtn.searchResultUserEditBtn.Rect {
  padding: 6px 10px;
  font-size: 0.84rem;
  border-radius: 8px;
  aspect-ratio: unset;
}

.searchResultRow .userRowEditBtn.searchResultUserEditBtn.Black {
  background-color: #000000;
  color: #ffffff;
}

.searchResultRow .userRowEditBtn.searchResultUserEditBtn.Black:hover {
  background-color: #252525;
  color: #ffffff;
}

.searchResultRow .userRowEditBtn.searchResultUserEditBtn.Red {
  background-color: #FDE8E6;
  color: #E03E33;
}

.searchResultRow .userRowEditBtn.searchResultUserEditBtn.Red:hover {
  background-color: #E03E33;
  color: #ffffff;
}

.searchResultRow .userRowEditBtn.searchResultUserEditBtn.Disabled {
  background-color: #E3E3E3;
  color: #676767;
  cursor: not-allowed;
}

.searchResultRow .userRowEditBtn.searchResultUserEditBtn.Disabled:hover {
  background-color: #E3E3E3;
  color: #676767;
}

.searchResultMeta {
  color: #8e8e8e;
  font-size: 0.8rem;
}

.searchIcon {
  color: var(--text-color);
  width: 15px;
  opacity: 0.5;
  display: flex;
}

.SearchBarInput {
  color: var(--text-color);
  display: block;
  background-color: transparent;
  border: none;
  font-size: 1rem;
  min-width: 120px;
  width: auto;
  flex: 1;
  outline: none;
}

.NoStateBox {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 190px;
  width: 100%;
  overflow: hidden;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.topneuralNetData,
.bottomneuralNetData {
  position: absolute;
  display: flex;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.bottomneuralNetData{
  bottom: 0px;
  left: 0px;
}

.topneuralNetData{
  top: 0px;
  right: 0px;
}

.NoStateBox .NoResultsSearchText {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  position: relative;
  z-index: 2;
}

.NoStateBox .NoResultsSearchText .settingsBtnBlack {
  margin-left: 0;
  align-self: center;
}

.noresults .searchresultsNoState .topneuralNetData,
.noresults .searchresultsNoState .topneuralNetSearch {
  animation: searchNeuralInTop 0.6s ease both;
}

.noresults .searchresultsNoState .bottomneuralNetData,
.noresults .searchresultsNoState .bottomneuralNetSearch {
  animation: searchNeuralInBottom 0.7s ease 0.08s both;
}

.noresults .searchresultsNoState .NoResultsSearchText {
  animation: searchNeuralTextIn 0.45s ease 0.12s both;
}

.ClearInputBar {
  width: 20px;
  height: 20px;
  background: transparent;
  border-radius: 4px;
  padding: 0;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--med-text);
  cursor: pointer;
  transition: color 0.2s ease;
}

.ClearInputBar:hover {
  color: var(--text-color);
}

.topbaricon{
  width: 18px;
  height: 18px;
}

.TopbarTabs {
  display: flex;
  align-items: flex-end;
  gap: 0;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  align-self: stretch;
  position: relative;
  z-index: 30;
  height: 50px;
}

.chat-topbar > .topbar-menu-btn {
  flex-shrink: 0;
}

.TopbarTabs::-webkit-scrollbar {
  display: none;
}

.TopbarTabs::after {
  content: none;
}

.TopbarTabsEndDivider {
  position: relative;
  flex: 0 0 1px;
  align-self: stretch;
  pointer-events: none;
  z-index: 7;
}

.TopbarTabsEndDivider::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border-color);
}

.TopbarTabsEndDivider.is-hidden::before {
  content: none;
}

.TopbarTabs::before {
  content: none;
}

.TopbarTabs.is-dragging-tabs {
  user-select: none;
  overflow-y: visible;
}

.Tab {
  --tab-girth: 13px;
  --tab-overlay-inset-x: 13px;
  --tab-overlay-top: 1px;
  --tab-overlay-bottom: 1px;
  --tab-overlay-border-bottom: 1.5px;
  padding: 0;
  margin: 0;
  width: 230px;
  display: flex;
  align-items: stretch;
  position: relative;
  height: 50px;
  cursor: pointer;
  z-index: 1;
  color: var(--med-text);
  flex: 0 0 auto;
}

.Tab.is-dragging {
  position: fixed;
  pointer-events: none;
  cursor: grabbing;
  z-index: 120300;
}

.Tab.is-dragging.is-detached {
  opacity: 0.95;
}

.Tab.is-dragging.is-detached::before,
.Tab.is-dragging.is-detached::after {
  content: none !important;
}

.Tab.is-dragging.is-detached .TabFace {
  margin-left: 0 !important;
  margin-right: 0 !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 13px !important;
  background: var(--background-color) !important;
  clip-path: none !important;
}

.Tab.drag-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.Tab::before {
  content: none;
  position: absolute;
  inset: 0 0 1.5px 0;
  background: var(--border-color);
  z-index: 1;
  pointer-events: none;
  clip-path: shape(
    from bottom left,
    curve to var(--tab-girth) calc(100% - var(--tab-girth)) with var(--tab-girth) 100%,
    vline to var(--tab-girth),
    curve to calc(var(--tab-girth) * 2) 0 with var(--tab-girth) 0,
    hline to calc(100% - calc(var(--tab-girth) * 2)),
    curve to calc(100% - var(--tab-girth)) var(--tab-girth) with calc(100% - var(--tab-girth)) 0,
    vline to calc(100% - var(--tab-girth)),
    curve to 100% 100% with calc(100% - var(--tab-girth)) 100%
  );
}

.Tab + .Tab {
  margin-left: -1px;
}

.Tab:not([aria-selected="true"])::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border-color);
  pointer-events: none;
  z-index: 3;
}

.TopbarTabs .Tab:not([aria-selected="true"]) .TabFace {
  border: none;
}

.TopbarTabs .Tab:not([aria-selected="true"]):not(:first-child) .TabFace::after {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border-color);
  pointer-events: none;
  z-index: 2;
  opacity: 1;
  transition: opacity 220ms var(--topbar-ease);
}

.TopbarTabs .Tab.is-before-active .TabFace::after,
.TopbarTabs .Tab.is-after-active .TabFace::after {
  opacity: 0;
}

.TopbarTabs .Tab[aria-selected="true"] + .Tab .TabFace::after,
.TopbarTabs .Tab.is-active + .Tab .TabFace::after {
  opacity: 0;
}

.TopbarTabs .Tab:not([aria-selected="true"])::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  bottom: 8px;
  pointer-events: none;
  z-index: 9;
  clip-path: none;
  opacity: 0;
  transition: opacity 220ms var(--topbar-ease);
  background:
    linear-gradient(
      to right,
      var(--sidebar-color) 0 2px,
      transparent 2px calc(100% - 2px),
      var(--sidebar-color) calc(100% - 2px)
    );
}

.TopbarTabs.is-dragging-tabs .Tab:not([aria-selected="true"])::before {
  opacity: 1;
  background:
    linear-gradient(
      to right,
      var(--border-color) 0 1px,
      transparent 1px calc(100% - 1px),
      var(--border-color) calc(100% - 1px)
    );
}

.TabFace {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  padding-left: 18px;
  height: 100%;
  width: 100%;
  min-height: 50px;
  margin: 0;
  color: inherit;
  background: var(--sidebar-color);
  border: 1px solid var(--border-color);
  border-top-left-radius: var(--tab-girth);
  border-top-right-radius: var(--tab-girth);
  z-index: 2;
  clip-path: none;
  overflow: hidden;
}

.TabFace::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 8px;
  background: var(--hover-color);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.TabText,
.closebuttontab {
  position: relative;
  z-index: 1;
}

@supports not (clip-path: shape(from top left, hline to 0)) {
  .Tab::before {
    content: none;
  }

  .TabFace {
    clip-path: none;
    border: 1px solid var(--border-color);
    margin: 0;
    height: 100%;
    min-height: 50px;
    padding-inline: 22px;
    border-top-left-radius: var(--tab-girth);
    border-top-right-radius: var(--tab-girth);
  }
}

.TabText {
  user-select: none;
  display: block;
  color: inherit;
  font-size: 0.98rem;
  font-weight: 300;
  max-width: 165px;
  width: 165px;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.TabText::before {
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, var(--sidebar-color) 0%, transparent 100%);
  position: absolute;
  top: 0;
  left: 0;
  width: 25px;
  height: 100%;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.TabText::after {
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--sidebar-color) 100%);
  position: absolute;
  top: 0;
  right: 0;
  width: 25px;
  height: 100%;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.Tab:hover .TabText::after {
  background: linear-gradient(90deg, transparent 0%, var(--sidebar-hover-not-trans) 100%);
}

.Tab:hover .TabText::before {
  background: linear-gradient(90deg, var(--sidebar-hover-not-trans) 0%, transparent 100%);
}


.Tab.is-active .TabText::before {
  background: linear-gradient(90deg, var(--background-color) 0%, transparent 100%);
}

.Tab.is-active .TabText::after {
  background: linear-gradient(90deg, transparent 0%, var(--background-color) 100%);
}

.TabText.tab-text-overflowing::after {
  opacity: 1;
}

.TabText.tab-text-overflowing.tab-text-scrolled-end::after {
  opacity: 0;
}

.TabText.tab-text-overflowing.tab-text-revealed-left::before {
  opacity: 1;
}

/* Suppresses the opacity fade-in for the very first time overflow state is
   established on a freshly-created row (e.g. the whole tab strip re-rendering
   on click) — otherwise every overflowing row replays the fade transition. */
.TabText.marquee-no-transition::after,
.TabText.marquee-no-transition::before,
.chat-item.marquee-no-transition::after,
.chat-item.marquee-no-transition::before {
  transition: none !important;
}

.TabToolTip{
  position: fixed;
  left: 0;
  top: 0;
  transform: translateY(-4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  background-color: var(--input-bg);
  border-radius: 13px;
  border: 1px solid var(--input-border);
  max-width: 240px;
  min-width: 220px;
  padding: 8px 11px;
  gap: 8px;
  z-index: 120100;
  box-shadow: 0 8px 20px var(--black-shadow);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  overflow: hidden;
}

.Tab.has-tab-tooltip:hover .TabToolTip{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.TabToolTip::before,
.TabToolTip::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 2;
}

.TabToolTip::before {
  left: calc(var(--tooltip-fade-left-offset, 0px) - 1px);
  background: linear-gradient(to right, var(--input-bg) 0%, transparent 100%);
}

.TabToolTip::after {
  right: calc(var(--tooltip-fade-right-offset, 0px) - 1px);
  background: linear-gradient(to left, var(--input-bg) 0%, transparent 100%);
}

.TabToolTip.is-clipped-left::before {
  opacity: 1;
}

.TabToolTip.is-clipped-right::after {
  opacity: 1;
}

.TabToolTip > * {
  position: relative;
  z-index: 1;
}

.topbar-tab-dragging .TabToolTip,
.TopbarTabs.is-dragging-tabs .TabToolTip {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-4px) !important;
}

.TabToolTipTopRow{
  align-items: center;
  display: flex;
  gap: 8px;
}

.TabToolTipCenter{
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
  line-height: 1.35;
}

.TabToolTipBottomRow{
  color: var(--med-text);
  font-size: 0.9rem;
  font-weight: 500;
}

.TabTooltipFolderIcon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
}

.TabTooltipFolderIcon .sidebarSVG.organize-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  flex: 0 0 18px;
  display: block;
  align-self: center;
}

.closebuttontab{
  margin-left: auto;
  padding: 4px 0 4px 8px;
  padding: 4px;
  width: 24px;
  min-width: 24px;
  aspect-ratio: 1;
  border: none;
  background-color: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.8;
  border-radius: 6px;
  transition:
    background-color 220ms var(--topbar-ease),
    color 220ms var(--topbar-ease),
    opacity 220ms var(--topbar-ease);
}

.closebuttontab.right{
  margin-left: 8px;
}

.closebuttontab:hover{
  background-color: var(--darker-hover-color);
}

.Tab:hover{
  background-color: transparent;
}

.Tab:hover .closebuttontab{
  color: var(--text-color);
}

.Tab:hover .TabText{
  color: var(--text-color);
}

.TopbarTabs .Tab:not([aria-selected="true"]):hover .TabFace::before {
  opacity: 1;
}

.TopbarTabs .Tab[aria-selected="true"] {
  color: var(--text-color);
  z-index: 40;
}

.TopbarTabs .Tab:not([aria-selected="true"]) {
  z-index: 1;
}

.TopbarTabs .Tab[aria-selected="true"]::before {
  content: "";
  inset: 0 -13px var(--tab-overlay-border-bottom) -13px;
  z-index: 3;
  bottom: 3px;
  transform: translateY(3px);
}

.TopbarTabs .Tab[aria-selected="true"] .TabFace {
  background: transparent;
  border: none;
  height: 100%;
  min-height: 50px;
  margin: 0;
  clip-path: none;
  z-index: 5;
}

.TopbarTabs .Tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset:
    var(--tab-overlay-top)
    -12px
    calc(var(--tab-overlay-bottom) + var(--tab-overlay-border-bottom))
    -12px;
  background: var(--background-color);
  pointer-events: none;
  z-index: 4;
  transform: translateY(3px);
  clip-path: shape(
    from bottom left,
    curve to var(--tab-girth) calc(100% - var(--tab-girth)) with var(--tab-girth) 100%,
    vline to var(--tab-girth),
    curve to calc(var(--tab-girth) * 2) 0 with var(--tab-girth) 0,
    hline to calc(100% - calc(var(--tab-girth) * 2)),
    curve to calc(100% - var(--tab-girth)) var(--tab-girth) with calc(100% - var(--tab-girth)) 0,
    vline to calc(100% - var(--tab-girth)),
    curve to 100% 100% with calc(100% - var(--tab-girth)) 100%
  );
}

@supports not (clip-path: shape(from top left, hline to 0)) {
  .TopbarTabs .Tab[aria-selected="true"]::before {
    content: none;
  }

  .TopbarTabs .Tab[aria-selected="true"]::after {
    content: none;
  }

  .TopbarTabs .Tab[aria-selected="true"] .TabFace {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    margin: 0;
    height: 100%;
    min-height: 50px;
    clip-path: none;
  }
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked #bootOverlay {
  display: none !important;
}

.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(2px);
}

.auth-gate-overlay.hidden {
  display: none;
}

.LoginPopup.auth-gate-popup {
  position: relative;
  display: flex;
  width: min(360px, calc(100vw - 28px));
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 21px;
  padding: 16px;
  background: var(--input-bg);
  box-sizing: border-box;
  overflow: hidden;
}

.auth-gate-step.hidden {
  display: none;
}

.auth-gate-popup .divider {
  display: flex;
  align-items: center;
  color: var(--darker-hover-color);
  font-weight: 300;
  font-size: 0.9rem;
}

.auth-gate-popup .divider::before,
.auth-gate-popup .divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--darker-hover-color);
}

.auth-gate-popup .divider span {
  margin: 0 10px;
}

.auth-gate-popup .loginOptions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-gate-popup .LoginOption {
  min-height: 40px;
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid var(--darker-hover-color);
  background-color: var(--darker-box-bg);
  cursor: pointer;
  color: var(--text-color);
}

#authGateGoogleBtn,
#authGateMicrosoftBtn,
#authGateAppleBtn {
  position: relative;
  isolation: isolate;
  overflow: visible;
}

#authGateGoogleBtn .socialicon,
#authGateGoogleBtn .ButtontextLogin,
#authGateMicrosoftBtn .socialicon,
#authGateMicrosoftBtn .ButtontextLogin,
#authGateAppleBtn .socialicon,
#authGateAppleBtn .ButtontextLogin {
  position: relative;
  z-index: 2;
}

#authGateGoogleBtn,
#authGateMicrosoftBtn,
#authGateAppleBtn {
  --auth-gradient-stops: 
    #ffffff 0%,
    #f1511b 26.9231%,
    #00adef 53.8462%,
    #80cc28 79.2691%,
    #fbbc09 100%;
}

#authGateMicrosoftBtn {
  --auth-gradient-stops:
    #ffffff 0%,
    #4285f4 26.9231%,
    #00ac47 53.8462%,
    #ffba00 79.2691%,
    #ea4435 100%;
}

#authGateAppleBtn {
  --auth-gradient-stops:
    #ffffff 0%,
    #d9d9d9 32%,
    #9c9c9c 64%,
    #f0f0f0 100%;
}

@property --auth-grad-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

#authGateGoogleBtn::before,
#authGateMicrosoftBtn::before,
#authGateAppleBtn::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  opacity: 0;
  border-radius: inherit;
  --auth-grad-x: calc(50% + 45% * cos(var(--auth-grad-angle)));
  --auth-grad-y: calc(50% + 45% * sin(var(--auth-grad-angle)));
  background: radial-gradient(
    136.371% 924.296% at var(--auth-grad-x) var(--auth-grad-y),
    var(--auth-gradient-stops)
  );
  filter: blur(0px);
  transition: opacity 0.18s ease, filter 0.18s ease;
  will-change: --auth-grad-angle, filter, opacity;
  pointer-events: none;
}

#authGateGoogleBtn::after,
#authGateMicrosoftBtn::after,
#authGateAppleBtn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--darker-box-bg);
  pointer-events: none;
}

#authGateGoogleBtn:hover::before,
#authGateMicrosoftBtn:hover::before,
#authGateAppleBtn:hover::before {
  opacity: 1;
  filter: blur(4px);
  animation: authGoogleGradientOrbit 2.1s linear infinite;
}

@keyframes authGoogleGradientOrbit {
  0% {
    --auth-grad-angle: 0deg;
  }
  100% {
    --auth-grad-angle: 360deg;
  }
}

.auth-gate-popup .socialicon {
  height: 20px;
  width: 20px;
  display: flex;
}

.auth-gate-popup .ButtontextLogin {
  font-size: 0.9rem;
  color: var(--text-color);
}

.auth-gate-popup .LoginContinue {
  position: relative;
  background: var(--contrast);
  color: var(--contrast-text);
  font-size: 1rem;
  min-height: 42px;
  border: none;
  border-radius: 13px;
  cursor: pointer;
}

.auth-gate-popup .LoginContinue:disabled {
  opacity: 0.72;
  cursor: default;
}

.auth-gate-popup .inputLogin {
  min-height: 24px;
  border: 1px solid var(--input-border);
  border-radius: 13px;
  font-size: 0.9rem;
  padding: 8px;
  outline: none;
  background: var(--input-box-bg);
  color: var(--text-color);
}

.auth-gate-popup .inputLogin.warning {
  border: 1px solid var(--red-text);
  background-color: var(--red-bg);
}

.auth-gate-popup .inputLogin:focus {
  outline: 2px solid var(--contrast);
}

.auth-gate-popup .inputLogin:-webkit-autofill,
.auth-gate-popup .inputLogin:-webkit-autofill:hover,
.auth-gate-popup .inputLogin:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-color);
  box-shadow: 0 0 0 1000px var(--input-box-bg) inset;
  -webkit-box-shadow: 0 0 0 1000px var(--input-box-bg) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.auth-gate-popup .inputField {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-gate-popup .inputField.disabled .inputLogin {
  background: var(--disabled-bg);
  color: var(--disabled-text);
  padding-right: 66px;
}

.auth-gate-popup .SmallFieldTitle {
  font-size: 0.9rem;
  color: var(--text-color);
}

.auth-gate-popup .UserTextLarge.Login {
  align-items: center;
  justify-self: center;
  display: flex;
  color: var(--text-color);
  font-size: 1.4rem;
  font-weight: 600;
  align-self: center;
  margin: 28px 0;
}

.auth-gate-popup .auth-gate-neural {
  position: absolute;
  top: -10px;
  right: 0;
  pointer-events: none;
}

.auth-gate-neural-host {
  background: transparent !important;
  width: 330px;
  min-height: 150px;
  border-radius: 0;
  padding: 0;
}

.auth-gate-neural-host .auth-gate-neural-state {
  min-height: 150px;
}

.auth-gate-neural-host .topneuralNetSearch {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

.auth-gate-neural-host .topneuralNetSearch > svg {
  width: 330px;
  height: 150px;
}

.auth-gate-popup .editbuttonemail {
  position: absolute;
  top: 31px;
  right: 5px;
  background-color: var(--blue-accent-light);
  color: var(--blue-accent);
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-gate-popup .editbuttonemail:hover {
  position: absolute;
  top: 31px;
  right: 5px;
  background-color: var(--blue-accent);
  color: var(--contrast-colo);
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.auth-gate-popup .editbuttonpassword {
  position: absolute;
  align-items: center;
  height: 31.5px;
  aspect-ratio: 1;
  top: 31px;
  right: 5px;
  background-color: transparent;
  color: var(--med-text);
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.auth-gate-popup .editbuttonpassword:hover {
  background-color: var(--hover-color);
  color: var(--text-color);
}


.auth-gate-popup .forgotpassword {
  margin-top: 6px;
  color: var(--light-text);
  cursor: pointer;
  align-self: center;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.auth-gate-popup .forgotpassword:hover {
  text-decoration: underline;
  color: var(--text-color);
}

.auth-gate-popup .inputLogin.warning ~ .forgotpassword {
  color: var(--text-color);
}

.auth-gate-link-btn {
  border: none;
  padding: 0;
  background: transparent;
}

.auth-gate-popup .WarningMessageLogin {
  display: flex;
  font-size: 0.8rem;
  color: var(--red-text);
  margin-left: auto;
  gap: 4px;
}

.auth-gate-popup .WarningMessageLogin.hidden {
  display: none;
}

.auth-gate-popup .inputFieldTopRow {
  display: flex;
  align-items: center;
}

.auth-gate-popup .warningIconLogin {
  width: 14px;
  aspect-ratio: 1;
  display: flex;
}

.auth-gate-popup .OptionalText {
  font-size: 0.7rem;
  color: var(--med-text);
}

.eyeIcon{
  width: 15.5px;
  height: 15.5px;
}

.auth-gate-popup .lastaccount {
  width: 100%;
  align-items: center;
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid var(--input-border);
  background-color: var(--darker-box-bg);
  cursor: pointer;
  text-align: left;
}

.auth-gate-popup .lastaccount:hover {
  background-color: var(--hover-color);
}

.auth-gate-popup .userTextSmall2 {
  font-size: 0.9rem;
  color: var(--text-color);
}

.auth-gate-popup .user-avatarLogin {
  display: flex;
  background-color: #6A2E8C;
  width: 30px;
  aspect-ratio: 1;
  padding: 8px;
  font-size: 1rem;
  font-weight: 300;
  color: var(--contrast-color);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
}

.auth-gate-popup .userInfo {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.control-input {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.control-input::-webkit-slider-runnable-track {
  background-color: #565656;
  height: 1.8px;
}

.control-input::-webkit-slider-thumb {
  background-color: #ccc;
  border: 1px solid #565656;
  height: 20px;
  border-radius: 50%;
  width: 20px;
  -webkit-appearance: none;
}

.switch.short{
    width: 43px;
    height: 19px;
}

.switchicon.short{
    width: 25px;
    height: 19px;
}

.switch{
    border: 1px solid var(--switch-border);
    margin-left: auto;
    width: 53px;
    border-radius: 25px;
    height: 22px;
    padding: 2px;
    cursor: pointer;
    background-color: var(--switch-bg);
    transition: background 0.2s ease;
    position: relative;
}

.switch.disabled{
  opacity: 0.6;
  cursor: not-allowed;
}

.switch.disabled:active .switchicon{
    scale: 1 !important;
    opacity: 1 !important;
}

.switch.black{
  border: 1px solid var(--black-border-color);
  background: var(--black-blue-accent);
}

.switchicon{
    background-color: var(--white);
    border-radius: 25px;
    width: 35px;
    height: 22px;
    box-sizing: border-box;
    position: absolute;
    left: 20px;
    top: 2px;
    transition: left 0.1s ease, scale 0.1s ease, border 0.1s ease, opacity 0.1s ease;
    border: none;
}
.switch:active .switchicon{
    scale: 1.4;
    opacity: 0.8;
}

.switch.off{
  background: var(--switch-bg-off);
}

.switchicon.off{
    left: 2px;
}

.intext_weblink_wrap {
    display: inline-flex;
    position: relative;
    vertical-align: middle;
}

.intext_weblink {
    font-family: 'Slanter-Sans', sans-serif;
    font-weight: 300;
    transition: border 0.2s ease, background 0.2s ease;
    position: relative;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 4.5px;
    display: flex;
    gap: 6px;
    width: fit-content;
    align-items: center;
    height: 15px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
}

.intext_weblink::before {
  content: "";
  transition: opacity 0.2s ease, right 0.2s ease;
  opacity: 0;
  position: absolute;
  right: -30px;
  height: 30px;
  width: 35px;
  z-index: 1;
  background: var(--weblink-hover-grad);
}

.favicon_intext{
  background-color: white;
  border-radius: 4px;
  height: 14px;
  display: flex;
  width: 14px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  flex: 0 0 14px;
}

.intext_weblink_text{
  transition: color 0.2s ease;
  color: var(--light-text);
  font-size: 0.8rem;
  font-weight: 300;
}

.intext_arrow{
  transition: opacity 0.2s ease, right 0.2s ease;
  opacity: 0;
  position: absolute;
  right: -20px;
  z-index: 2;
  color: var(--blue-accent);
  height: 18px;
  width: 18px;
}

.intext_weblink:hover {
  border-color: var(--blue-accent-med);
  background-color: var(--blue-accent-light);
}

.intext_weblink:hover .intext_arrow{
  right: 2px;
  opacity: 1;

}

.intext_weblink:hover::before{
  right: 0;
  opacity: 1;
}

.intext_weblink:hover .intext_weblink_text{
color: var(--med-dark-text);
}

.intext_weblink_popup{
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 13px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 270px;
  position: fixed;
  top: -9999px;
  left: -9999px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 1200;
}

.intext_weblink_popup.is-visible{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.intext_weblink_popup_text{
  color: var(--text-color);
  font-size: 1rem;
}

.intext_weblink_popup_btm{
  display: flex;
  gap: 6px;
  align-items: center;
}

span.highlight {
    padding: 4px;
    border-radius: 6px;
    background: var(--blue-accent-light);
}

.Source_subtab_host {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2100;
}

body:not(.mobile-active).source-subtab-open .main-area {
  margin-right: calc(var(--source-subtab-panel-width, min(100vw, 420px)) + 1px);
}

.Source_subtab_host.is-open {
  pointer-events: none;
  opacity: 1;
}

.Source_subtab_backdrop {
  display: none;
}

.Source_subtab {
  display: flex;
  flex-direction: column;
  width: var(--source-subtab-panel-width, min(100vw, 420px));
  height: 100dvh;
  background-color: var(--background-color);
  border-left: 1px solid var(--border-color);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  pointer-events: auto;
}

.Source_subtab_host.is-open .Source_subtab {
  transform: translateX(0);
}

.Source_subtab_header{
  display: flex;
  align-items: center;
  font-family: 'Slanter-Sans', sans-serif;
  font-weight: 300;
  gap: 6px;
  font-size: 0.98rem;
  color: var(--text-color);
  padding: 0 14px;
  height: 49px;
  border-bottom: 1px solid var(--border-color);
}

.Source_subtab_list{
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  padding: 6px 10px 14px;
}

.Source_subtab_item{
  display: flex;
  flex-direction: column;
  border: none;
  max-height: 72px;
  border-radius: 13px;
  width: 100%;
  text-align: left;
  padding: 14px 12px;
  background-color: transparent;
  transition: background 0.2s ease, opacity 0.2s ease;
  gap: 6px;
  cursor: pointer;
}

.Source_subtab_item.file{
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.Source_subtab_list:has(.Source_subtab_item:hover) .Source_subtab_item{
  opacity: 0.7;
}

.Source_subtab_item:hover{
  background-color: var(--file-btn-mobile-bg-trans);
  opacity: 1 !important;
}

.Source_subtab_title{
  display: block;
  font-family: 'Slanter-Sans', sans-serif;
  font-weight: 300;
  font-size: 1rem;
  color: var(--text-color);
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.Source_subtab_info{
  display: flex;
  align-items: center;
  gap: 8px;
}

.Source_subtab_icon{
  border-radius: 6px;
  height: 16px;
  min-width: 16px;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.Source_subtab_icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.Source_subtab_small_text{
  display: flex;
  color: var(--light-text);
  font-size: 0.9rem;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  align-items: center;
  gap: 0;
}

.Source_subtab_small_text_type {
  flex: 0 0 auto;
  margin-right: 4px;
}

.Source_subtab_small_text_site {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.Source_subtab_line{
  width: 100%;
  height: 1px;
  margin: 0 auto;
  background-color: var(--border-color);
  opacity: 1;
  transition: opacity 0.2s ease;
}

.Source_subtab_item:hover + .Source_subtab_line,
.Source_subtab_line:has(+ .Source_subtab_item:hover) {
  opacity: 0;
}

.Source_subtab_item_left{
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
}

.Source_subtab_item_right{
  display: flex;
  flex: 0 0 auto;
  margin-left: auto;
}

.Source_subtab_preview{
  height: 44px;
  width: 44px;
  min-width: 44px;
  border-radius: 8px;
  margin-right: 4px;
  background-color: #fff;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.Source_subtab_preview img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.Source_subtab_svg{
  height: 16px;
  min-width: 16px;
  display: flex;
  align-items: center;
  justify-self: center;
  overflow: hidden;
  color: var(--light-text);
}

/* ── Quiz subtab side panel ── */
.Quiz_subtab {
  width: var(--quiz-subtab-panel-width, min(100vw, 520px));
  max-width: calc(100vw - var(--quiz-sidebar-right, 0px));
  position: relative;
}

/* In expanded mode CSS owns the width — never needs JS recompute */
.Quiz_subtab_host.is-expanded .Quiz_subtab {
  width: calc(100vw - var(--quiz-sidebar-right, 0px));
  max-width: calc(100vw - var(--quiz-sidebar-right, 0px));
}

/* Raise above the topbar (z-index 120000) so the panel header is visible */
.Quiz_subtab_host.is-expanded {
  z-index: 120001;
}

body:not(.mobile-active).quiz-subtab-open .main-area {
  margin-right: calc(var(--quiz-subtab-panel-width, min(100vw, 520px)) + 1px);
}

/* In expanded mode the panel overlays the chat rather than pushing it,
   so margin-right stays 0 and the sidebar never sees a narrow viewport. */
body:not(.mobile-active).quiz-subtab-open.quiz-subtab-expanded .main-area {
  margin-right: 0 !important;
}

body.quiz-subtab-resizing .main-area {
  transition: none !important;
}

body.quiz-subtab-resizing .Source_subtab.Quiz_subtab {
  transition: none !important;
}

/* Header title */
.Source_subtab_header .quiz-subtab-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The list hosts .tool-panel > .quizcontent directly */
.Quiz_subtab_list {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 !important;
  position: relative;
  display: flex;
  flex-direction: column;
}

.Quiz_subtab_list .tool-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.Quiz_subtab_list .quizcontent {
  flex: 1;
  min-height: 0;
  height: auto !important;
  border-radius: 0 !important;
  max-width: none !important;
}

.Quiz_subtab_list .backgroundimagequiz {
  border-radius: 0 !important;
}

/* Drag-to-resize handle on left edge */
.Quiz_subtab_resize_handle {
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 10;
  transition: background 0.15s;
}

.Source_subtab.Quiz_subtab:has(.Quiz_subtab_resize_handle:hover),
.Source_subtab.Quiz_subtab:has(.Quiz_subtab_resize_handle.is-resizing) {
  border-left: 1px solid var(--blue-accent);
}

/* Guest-mode viewers can't manage the chat — the quiz panel stays
   permanently expanded with no way to collapse or close it. */
#quizSubtabHost.is-guest-locked .quiz-subtab-expand-btn,
#quizSubtabHost.is-guest-locked .quiz-subtab-close-btn,
#quizSubtabHost.is-guest-locked .Quiz_subtab_resize_handle {
  display: none !important;
}

/* ── Overlay sidebar at ≤1020px ── */
/* Collapsed 60px icon bar stays in flow. Expanded sidebar lifts above content. */
@media (max-width: 1020px) {
  /* The collapsed 60px icon bar always reserves space in .main-area.
     Expanding never changes that reservation — it only overlays on top. */
  .app-layout {
    --sidebar-w: 60px;
  }

  /* .sidebar is taken out of flow below (always fixed), so .main-area itself
     must reserve the 60px icon-bar width — nothing else does it anymore.
     Excluded in true mobile mode, which has its own full-width .main-area rules. */
  body:not(.mobile-active) .main-area {
    margin-left: 54px !important;
    width: calc(100% - 60px) !important;
  }

  /* Lift the sidebar out of flow entirely (collapsed or expanded) so toggling
     it never resizes .main-area — only the fixed 60px above is reserved.
     Excluded in true mobile mode, which hides/positions .sidebar itself. */
  body:not(.mobile-active) .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: calc(100vh - 67px) !important;
    z-index: 130000;
  }

  .sidebar.collapsed {
    --sidebar-w: 54px;
    height: 100vh !important;
  }

  .sidebar:not(.collapsed) {
    --sidebar-w: 290px;
    width: var(--sidebar-w) !important;
  }

  /* Custom-property values only interpolate through transitions when the
     property is registered via @property with an animatable syntax — that
     registration may not be present/supported everywhere, so pin these
     descendants to literal widths here too (matching the --sidebar-w values
     above) to guarantee a smooth native `width` transition regardless. */
  .sidebar.collapsed .sidebar-logo-row {
    width: 53px !important;
  }

  .sidebar:not(.collapsed) .sidebar-logo-row,
  .sidebar:not(.collapsed) .sidebar-menu-list {
    width: 267px !important;
  }

  .sidebar.collapsed .user-box {
    width: 54px !important;
  }

  .sidebar:not(.collapsed) .user-box {
    width: 290px !important;
  }

  .sidebar::after {
    content: "";
    position: fixed;
    top: calc(100vh - 67px);
    left: 0;
    width: var(--sidebar-w);
    height: 67px;
    background: var(--sidebar-color);
    z-index: 0;
    pointer-events: none;
    transition: width 0.25s ease, background 0.25s ease;
  }

  .sidebar.collapsed::after {
    width: 54px;
  }

  /* #sidebarLogoBtn is 110px wide (left:12px) and absolutely positioned
     against .sidebar-logo-row (not .sidebar), so its hover-slide reveal can
     extend past the 60px icon rail — harmless when the collapsed sidebar
     sits in flow with empty space beside it, but it leaks ~62px of
     hoverable/clickable area into .main-area now that the sidebar overlays
     directly on top of the chat with a very high z-index. Clip at the
     logo-row itself (its actual containing block), not the whole .sidebar —
     clipping the whole sidebar also clipped unrelated fixed-position
     overlays like the #userMenu dropdown that legitimately need to render
     outside the 60px collapsed width. */
  .sidebar.collapsed .sidebar-logo-row {
    overflow: hidden;
    clip-path: inset(0);
  }

  /* The sidebar overlay must always sit above the Quiz_subtab panel,
     collapsed or expanded, in either of its own states. */
  .Quiz_subtab_host {
    z-index: 2100;
  }

  .Quiz_subtab_host.is-expanded {
    z-index: 120001;
  }

  .sidebar {
    z-index: 130000 !important;
  }

  /* Below 735px of available chat width there's no room for the panel to
     sit alongside the chat at all — force it fully expanded and hide the
     now-meaningless expand/collapse toggle. */
  body.quiz-subtab-narrow-main #quizSubtabHost .quiz-subtab-expand-btn {
    display: none !important;
  }

  .sidebar:not(.collapsed) .user-box {
    z-index: 130001;
  }
}

.sidebar.collapsed .user-inner {
  padding: 8px 5px !important;
}

#PinnedCollections{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#AllCollections {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.collectionList{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.collectionList.grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  row-gap: 16px;
}

.collection_box{
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 140px;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  border-radius: 13px;
  border: 1px solid var(--border-color-lighter);
  background-color: var(--input-bg-50);
  padding: 16px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.collection_box:hover{
  box-shadow: 0px 0px 11.5px 0px var(--black-shadow);
  border-color: var(--border-color);
  background-color: var(--input-bg);
}

.collection_box_top{
  display: flex;
  align-items: center;
  gap: 8px;
}

.collection_title_icon{
  stroke-width: 1.2;
  width: 18px;
  height: 18px;
  display: flex;
}

.collection_title_icon [fill]{
  fill: none !important;
  fill-opacity: 0 !important;
}

.collection_title_text{
  display: flex;
  color: var(--text-color);
  font-size: 1rem;
}

.collection_box_threedot{
  cursor: pointer;
  visibility: hidden;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 3px;
  border-radius: 6px;
  background-color: transparent;
  color: var(--med-text);
  width: 25px;
  height: 25px;
  aspect-ratio: 1;
  opacity: 1;
  transition: background 0.2s ease ;
}

.collection_box_threedot.refresh .refresh_svg{
  transform: rotate(0);
  transition: transform 0s;
}

.collection_box_threedot.refresh:active .refresh_svg{
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.collection_box_threedot.opacity{
  color: currentColor;
  opacity: 0.5;
}

.collection_box_threedot.large{
  width: 28px;
  height: 28px;
  padding: 4px;
}

.pad-6{
  padding: 6px !important;
}

.pad-7{
  padding: 7px !important;
}

.collection_box_threedot.large.disabled{
  opacity: 0.4 !important;
  cursor: default;
  background-color: transparent !important;
  color: var(--med-text) !important;
}

.collection_box_threedot.large:hover{
  background-color: var(--hover-color);
}

.collection_box_threedot.vis{
  visibility: visible;
}

.collection_box_threedot.white{
  color: var(--white-75);
}

.collection_box_threedot.top_right-06{
  z-index: 2;
  position: absolute;
  top: 6px;
  right: 6px;
}

.collection_box_threedot.is-dropdown-open{
  visibility: visible;
  background-color: var(--hover-color);
  color: var(--text-color);
}

.collection_box_threedot.vis.nm{
  margin-left: 0;
}

.collection_box:hover .collection_box_threedot {
  visibility: visible;
}

.collection_box_threedot:hover{
  background-color: var(--hover-color);
  color: var(--text-color);
}

.collection_box_threedot.opacity:hover{
  color: currentColor;
  opacity: 1;
}

.collection_box_threedot.white:hover{
  color: var(--white);
}

.collection_box_bottom{
  display: flex;
  margin-top: auto;

}

.collection_box_small_light{
  color: var(--med-light-text);
  font-size: 0.92rem;
}

.collection_box_chat_cards{
  display: flex;
  position: relative;
  right: 30px;
  bottom: -55px;
}

.collection_box_chat_cards.small{
  right: 20px;
}


.collection_box_chat_card{
  position: absolute;
  user-select: none;
  flex-direction: column;
  opacity: 0.8;
  display: flex;
  border: 1px solid var(--border-color);
  gap: 4px;
  background-color: var(--input-bg-50);
  padding: 12px;
  border-radius: 8px;
  width: 95px;
  height: 95px;
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, bottom 0.2s ease;
  bottom: 0;
}

.collection_box_chat_card.first{
  right: 230px;
  transform: rotate(2deg);
}

.collection_box_chat_card.mid{
  right: 115px;
  transform: rotate(-6deg);
  z-index: 1;
}

.collection_box_chat_card.last{
  right: 0;
  transform: rotate(3deg);
}

.collection_box_chat_card.small{
  right: 0;
  transform: rotate(-6deg);
}

.collection_box_chat_card:hover{
  border-color: var(--border-color-darker);
  box-shadow: 0px 0px 11.5px 0px var(--black-shadow);
  opacity: 1;
  z-index: 3;
  bottom: 23px;
}

.collection_box_chat_card.small:hover .collection_box_threedot{
  visibility: hidden !important;
}

.collection_box_chat_scribble{
  display: flex;
  width: 95%;
  height: 50px;
  color: var(--med-light-text);
  opacity: 0.7;
}

.TopBarRoles{
  width: 100%;
  display: flex;
  gap: 8px;
}

.collection_btn{
  margin-left: auto;
  height: 34px;
  align-items: center;
  border: none;
  font-size: 0.9rem;
  display: flex;
  border-radius: 8px;
  background-color: var(--contrast);
  color: var(--contrast-text);
  gap: 8px;
  padding: 0 10px;
  cursor: pointer;
  transition: opacity 0.2s ease, width 0.2s ease, background 0.2s ease, border 0.2s ease;
}

.collection_btn.contrast {
  color: var(--black) !important;
  background-color: var(--white);
}

.collection_btn.outline.contrast {
  color: var(--white) !important;
  background: transparent !important;
  border-color: var(--white-50) !important;
}

.collection_btn.outline.contrast:hover {
  background: var(--black-hover-color) !important;

}

.collection_btn.link{
  height: 30px;
  right: 5px;
  z-index: 2;
  border-radius: 5px;
  display: flex;
  position: absolute;
}

.collection_btn.outline{
  margin-left: 0;
  border: 1px solid var(--border-color);
  background-color: transparent;
  color: var(--text-color);
}

.collection_btn.outline:hover{
  opacity: 1;
  border-color: var(--text-color);
}

.collection_btn:hover{
  opacity: 0.8;
}

.collection_btn_icon{
  width: 18px;
  min-width: 18px;
  height: 18px;
}

.top_title_action{
  width: 100%;
  display: flex;
  align-items: center;
}

.Title_serif{
  font-family: 'Slanter-Serif', serif;
  color: var(--text-color);
  font-size: 1.5rem;
}

.Title_serif.contrast {
  color: var(--white);
}

.TopBarRoles{
  margin-bottom: 8px;
}

.top_collection{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.top_collection_top{
  height: 28px;
  width: 100%;
  display: flex;
  gap: 8px;
}

.light_text_normal{
  width: calc(100% - 100px);
  color: var(--text-color);
  opacity: 50%;
  font-size: 1rem;
}

.light_text_small{
  color: var(--text-color);
  opacity: 50%;
  font-size: 1rem;
}

.collection_large_title_icon{
  display: flex;
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.left_SavedRow{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.left_SavedRow.loading {
  height: 43.5px;
  justify-content: center;
}

.SavedRow:hover .collection_box_threedot.large{
  visibility: visible;
}

.input_block{
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: opacity 0.2s ease;
}

.input_bar{
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    font-family: 'Slanter-Sans', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.3;
    height: 42px;
    padding: 10px 15px;
    width: 100%;
    box-sizing: border-box;
    transition: outline 0.1s ease, outline-offset 0.1s ease;
    outline: none;
    outline-color: var(--blue-accent);
    color: var(--text-color);
    outline-offset: 0;
}

.input_bar.large{
  height: 346px;
  padding: 0;
}

.input_bar.nofill{
  border: none !important;
  outline: none !important;
  background: none !important;
  width: 100%;
  padding-left: 8px;
  box-sizing: border-box;
}

.input_bar.link{
  margin-top: 5px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

.input_bar.link::before {
    content: "";
    position: absolute;
    right: 0;
    width: 150px;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0) 0%, var(--input-bg) 50%);
    z-index: 1;
}

.input_block_row {
  display: flex;
  gap: 12px;
}

.input_bar.mt{
  margin-top: 5px;
}

.input_bar.fh{
  height: 100px;
  resize: none;
}

.input_bar::placeholder{
    color: var(--text-color);
    opacity: 0.6;
}

.input_bar,
select,
.input_settings,
.customPrompt{
    outline: 0px solid var(--blue-accent);
    outline-offset: 0;
    transition: outline 0.1s ease, outline-offset 0.1s ease;
}

.input_bar:focus,
select:focus,
.input_settings:focus,
.customPrompt:focus{
    outline: 2px solid var(--blue-accent);
    outline-offset: 2px;
}

.input_icon_collection_block{
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  height: 42px;
  min-width: 42px;
  box-sizing: border-box;
  transition: outline 0.1s ease, outline-offset 0.1s ease;
  outline: none;
  outline-color: var(--blue-accent);
  outline-offset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#folderIconTrigger.input_icon_collection_block{
  color: var(--text-color);
}

.input_icon_collection_block_update_icon{
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  justify-content: center;
  align-items: center;
  color: var(--text-color);
  width: 20px;
  height: 20px;
}

.input_icon_collection_block:hover .input_icon_collection_block_update_icon{
  opacity: 1;
}

.input_icon_collection_block:hover .input_icon_collection{
  filter: blur(4px);
}

.input_icon_collection{
  width: 20px;
  height: 20px;
  transition: filter 0.2s ease;
}

.input_icon_collection svg{
  display: block;
  width: 100%;
  height: 100%;
}

#folderIconTrigger.input_icon_collection_block .roleEditIconDefault{
  opacity: 1 !important;
}

#folderIconTrigger.input_icon_collection_block:hover .roleEditIconDefault{
  opacity: 1 !important;
}

.collection_create_popup{
  justify-self: center;
  align-self: center;
  width: 500px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: 21px;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  gap: 26px;
}

.collection_create_popup_top{
  display: flex;
  gap: 8px;
  align-items: center;
}

.two_block_input_block{
  display: flex;
  gap: 12px;
  margin-top: 5px;
  align-items: center;
}

.input_block_row_left{
    display: flex;
    flex-direction: column;
    padding-top: 2px;
    gap: 4px;
}

.input_block_row_right{
    margin-left: auto;
}


.cta_btn{
    height: 34px;
    width: fit-content;
    display: flex;
    border: none;
    background: var(--contrast);
    color: var(--contrast-text);
    padding: 8px 25px;
    border-radius: 8px;
    font-size: 0.95rem;
    gap: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    align-items: center;
    transition: scale 0.15s ease, background 0.15s ease, opacity 0.2s ease;
    z-index: 4;
}

.cta_btn.fw{
    width: 100%;
    justify-content: center;
}


.cta_btn.fw:disabled{
    opacity: 0.6;
    cursor: not-allowed;
}

.cta_btn.fw:disabled:hover{
  opacity: 0.6;
  background: var(--contrast);
}

.cta_btn.fw:disabled:active{
    scale: 1;
}


.cta_btn.not_allowed{
    opacity: 0.6;
    cursor: not-allowed;
}

.cta_btn.not_allowed:hover{
    opacity: 0.6;
    background: var(--contrast);
}

.cta_btn.not_allowed:active{
    scale: 1;
}

.cta_btn:hover{
    background-color: var(--light-background-hover);
}

.cta_btn:active{
    scale: 0.97;
}

.serif{
  font-family: 'Slanter-Serif', serif;
  color: var(--text-color);
  font-size: 1rem;
}

.sans_serif {
    position: relative;
    font-family: 'Slanter-Sans', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.3;
    transition: color 0.2s ease;
}

.sans_serif.semibold {
  font-weight: 600;
}

.sans_serif.larger {
  font-size: 1.1rem;
}

.sans_serif.size09rem {
    font-size: 0.9rem;
    color: currentColor;
}

.sans_serif.light_small {
  color: var(--light-text);
  font-size: 0.9rem;
}

.sans_serif.size08rem {
    font-size: 0.8rem;
}

.sans_serif.size07rem {
    font-size: 0.7rem;
}

.sans_serif.center {
  text-align: center;
  max-width: 360px;
  margin: 0 auto;
}

.light_sans-serif{
  color: var(--white-50);
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.light_sans-serif.link{
  text-underline-offset: 2px;
  cursor: pointer;
  text-decoration: underline;
}

.light_sans-serif.link:hover{
  color: var(--white);
}

.small-sans-serif{
  font-size: 0.7rem;
  color: var(--white);
}

.small-sans-serif.op-50{
  color: var(--white-50);
}

.QuizBtn{
  font-family: 'Slanter-Sans', sans-serif;
  font-weight: 300;
  cursor: pointer;
  overflow: hidden;
  padding-right: 16px;
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: 13px;
  background-color: var(--dark-light-bg);
  height: 83px;
  align-items: center;
  user-select: none;
  transition: background 0.2s ease !important;
    box-shadow: 0 0 15px var(--black-shadow);
}

.QuizBtn.warning.orange {
  background: var(--orange-bg);
  border-color: var(--orange-border);
  color: var(--orange-text);
}

.QuizBtn.warning.orange:hover {
  background-color: initial !important;
}

.QuizBtn.warning {
  padding: 8px;
  padding-left: 20px;
  height: auto;
  margin-top: 24px;
  margin-bottom: 10px;
  background-color: var(--dark-light-bg);
}

.message.bot .QuizBtn.warning {
  width: 100%;
  gap: 0;
  cursor: default;
}

.message.bot[data-turn-status] {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

.message.bot[data-turn-status] .bot-body {
  width: 100%;
}

.message.bot[data-turn-status] .turn-status-banner {
  width: 100%;
}

.message.bot[data-turn-status] .QuizBtn.warning {
  width: 100%;
  height: 52px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.message.bot .QuizBtn.warning .QuizBtnRight {
  flex: 1 1 auto;
  min-width: 0;
}

.message.bot .QuizBtn.warning .QuizBtntext {
  overflow-wrap: anywhere;
}

.QuizBtnlefticon {
    width: 20px;
    display: flex;
}

.QuizBtn.warning:hover {
  background-color: var(--dark-light-bg) !important;
}

.message.bot .QuizBtn.warning .collection_btn {
  white-space: nowrap;
}

.QuizBtn:hover{
  background-color: var(--hover-color-50);
}

.QuizBtn:hover .QuizBtnleft.file{
  transform: rotate(-3deg);
  scale: 1.03;
}

.QuizBtnleft{
  height: 50px;
  width: 80px;
  font-size: 1.7rem;
  display: flex;
  position: relative;
  left: -1px;
  background-color:  var(--background-color);
  border: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 8px 8px 0;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease, scale 0.2s ease;
    box-shadow: 0 0 15px var(--black-shadow);
}

.QuizBtnleft.file{
  height: 78px;
  width: 53px;
  transform: rotate(-8deg);
  font-size: 2rem;
  bottom: -15px;
  display: flex;
  position: relative;
  left: 27px;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 11.5px 0 rgba(0, 0, 0, 0.1);
}

.QuizBtnleftIcon{
  position: relative;
  top: -10px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 20px;
  height: 20px;
}

.QuizBtnleftIcon.warn{
  top: 0;
  width: 18px;
  height: 18px;
}

.QuizBtnEmoji{
  mix-blend-mode: luminosity;
}

.QuizBtnRight{
  display: flex;
  margin-left: 20px;
  flex-direction: column;
}

.QuizBtnRight.file{
  margin-left: 48px;
}

.QuizBtntext{
  font-size: 1.1rem;
  color: var(--text-color);
}

.QuizBtntext.warn{
  font-size: 1rem;
  color: currentColor;
}


.QuizBtntext.small{
  font-size: 0.90rem;
  color: var(--light-text);
}

.collection_btn.outline.ml {
    text-decoration: none !important;
    margin-left: auto;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-color);
    transition: border 0.2s ease,background 0.2s ease;
}

.collection_btn.outline.ml.grey {
    border: none;
    background-color: var(--lighter-hover-color);
}

.collection_btn.outline.ml:hover {
    border: 1px solid transparent;
    background-color: var(--hover-color);
    color: var(--text-color);
}

.collection_btn.outline.ml.grey:hover {
    border: none;
    background-color: var(--hover-color);
    color: var(--text-color);
}

/* ---- Share-quiz guest mode (visited /share/:id without auth) ---- */
html.share-guest .sidebar-menu-list .sidebarMenuButton:not([data-view="usage"]),
html.share-guest .sidebar-menu-item[data-view="roles"],
html.share-guest .sidebar-menu-item[data-view="collections"],
html.share-guest .sidebar-menu-item[data-view="users"],
html.share-guest .sidebar-menu-item[data-view="training"],
html.share-guest .sidebar-folder-list,
html.share-guest .sidebar-folder-list.is-collapsed,
html.share-guest .sidebar-chat-list,
html.share-guest .sidebar-chat-list.is-collapsed,
html.share-guest .sidebarsectionheader,
html.share-guest .empty-chat-composer-stack,
html.share-guest .input-container-centered,
html.share-guest #inputCentered,
html.share-guest .input-container-stack,
html.share-guest .input-container,
html.share-guest .tool-chatbar,
html.share-guest .inputbar,
html.share-guest .chat-input,
html.share-guest .chat-input-wrap,
html.share-guest .composer,
html.share-guest .composer-wrap,
html.share-guest .bottom-bar,
html.share-guest #getPlusBtn,
html.share-guest #quizGenerateMore,
html.share-guest #quizClose,
html.share-guest .tool-chatpad,
html.share-guest .tool-chat,
html.share-guest .topbar-menu-btn,
html.share-guest .closebuttontab,
html.share-guest #authGateOverlay {
  display: none !important;
}

.user-avatar-shape{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #969640;
}

.collection_box_loading{
  background: linear-gradient(
    96deg,
    var(--invite-skeleton-base) 0%,
    var(--invite-skeleton-highlight) 50%,
    var(--invite-skeleton-base) 100%
  );
  background-size: 260% 100%;
  display: flex;
  height: 11px;
  border-radius: 8px;
  animation: skeletonShimmer 3s linear infinite;
  max-width: 80%;
}

.collection_box_loading.xxsmall{
  max-width: 100%;
  width: 40px;
}

.collection_box_loading.xsmall{
  max-width: 100%;
  width: 72px;
}

.collection_box_loading.top{
  width: 230px;
}

.collection_box_loading.long{
  width: 450px;
}

.collection_box_loading.med{
  width: 300px;
}

.collection_box_loading.bottom{
  width: 140px;
}

.collection_box_loading.thick{
  border-radius: 6px;
  height: 20px;
}

.collection_box_loading.mt{
  margin: auto 0;
}

#AllCollections.is-loading .sidebarsectionheader,
#AllCollections.is-loading .collection_box {
  pointer-events: none;
}
#AllCollections.is-loading .sidebarchevron {
  display: none;
}
#CollectionView .saved-body:has(#AllCollections.is-loading) {
  overflow: hidden !important;
}
#CollectionItemView.is-loading .saved-body {
  overflow: hidden !important;
}

.top_collection_description_loading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 21.5px;
}

.pin_hint.hidden{
  display: none;
}
.pin_hint{
  width: 100%;
  height: 30px;
  border: none;
  background: none;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--light-text);
  text-align: left;
  box-sizing: border-box;
}

.pin_hint_svg{
  display: flex;
  width: 14px;
  height: 14px;
}

body:not(.mobile-active) .input-container-centered.limit,
body:not(.mobile-active) .input-container.limit {
  box-shadow: 0px -50px 0px 0px var(--user-bubble), 0 2px 5px rgba(0,0,0,0.04);
}

body:not(.mobile-active) .input-container-centered.limit:has(#inputCenteredBox:focus),
body:not(.mobile-active) .input-container.limit:has(#inputbox:focus) {
  box-shadow: 0px -50px 0px 0px var(--user-bubble), 0 2px 5px rgba(0,0,0,0.04);
}

body:not(.mobile-active) #chatView > .input-limit-banner {
  display: none;
}

body:not(.mobile-active) .main-area:not(.empty-chat) #chatView > .input-limit-banner {
  display: flex;
  position: absolute;
  bottom: calc(var(--chat-input-cover-h, 0px));
  left: 50%;
  transform: translateX(calc(-50% + (var(--chat-scrollbar-shift, 0px) * -0.5)));
  width: min(calc(100% - 24px), 765px);
  z-index: 29;
}

body:not(.mobile-active) #chatView:has(.input-container.limit) > .chat-scroll {
  padding-bottom: calc(var(--chat-input-cover-h) + 50px);
}

/* Lift the scroll-to-bottom button by the same amount the limit banner adds
   to .chat-scroll's padding-bottom above, so it doesn't end up sitting
   underneath/overlapping the banner once it's shown. */
body:not(.mobile-active) #chatView:has(.input-container.limit) > #scrollDownBtn {
  bottom: calc(var(--chat-input-cover-h, 90px) + 50px + 15px);
}

body:not(.mobile-active) .input-limit-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  color: var(--med-text);
  font-size: 1rem !important;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  animation: limitBannerOpen 0.25s ease forwards;
}

body:not(.mobile-active) .input-limit-banner.hiding {
  animation: limitBannerClose 0.25s ease forwards;
}

@keyframes limitBannerOpen {
  from { height: 0; opacity: 0; }
  to { height: 50px; opacity: 1; }
}

@keyframes limitBannerClose {
  from { height: 50px; opacity: 1; }
  to { height: 0; opacity: 0; }
}

/* Academic-honesty "warn" banner — same component as the usage-limit banner
   above (container gets the shared .limit class, same box-shadow/padding/
   animation mechanics), with .warn layered on top only to override the color
   and the slightly taller 55px height. */
body:not(.mobile-active) .input-container-centered.limit.warn,
body:not(.mobile-active) .input-container.limit.warn {
  box-shadow: 0px -55px 0px 0px var(--red-bg-not-transp), 0 2px 5px rgba(0,0,0,0.04);
}

body:not(.mobile-active) .input-container-centered.limit.warn:has(#inputCenteredBox:focus),
body:not(.mobile-active) .input-container.limit.warn:has(#inputbox:focus) {
  box-shadow: 0px -55px 0px 0px var(--red-bg-not-transp), 0 2px 5px rgba(0,0,0,0.04);
}

body:not(.mobile-active) #chatView:has(.input-container.limit.warn) > .chat-scroll {
  padding-bottom: calc(var(--chat-input-cover-h) + 55px);
}

body:not(.mobile-active) #chatView:has(.input-container.limit.warn) > #scrollDownBtn {
  bottom: calc(var(--chat-input-cover-h, 90px) + 55px + 15px);
}

/* The base usage-limit banner is positioned via `#chatView > .input-limit-banner`
   absolute placement above the *bottom* composer — that math doesn't apply
   when the warn banner fires on a chat's first message, because
   .empty-chat-composer-stack (the centered composer's parent) is itself
   absolutely positioned around the vertical middle of the viewport, not the
   bottom. In that case the banner is inserted as a normal flex child right
   above .input-container-centered instead, so it just stacks in flow. */
body:not(.mobile-active) .empty-chat-composer-stack > .input-limit-banner.warn.centered {
  position: relative;
  width: 100%;
  max-width: 765px;
}

body:not(.mobile-active) .input-limit-banner.warn {
  color: var(--red-text-light);
  font-size: 0.85rem !important;
}

body:not(.mobile-active) .input-limit-banner.warn {
  animation: warnBannerOpen 0.25s ease forwards;
}

body:not(.mobile-active) .input-limit-banner.warn.hiding {
  animation: warnBannerClose 0.25s ease forwards;
}

@keyframes warnBannerOpen {
  from { height: 0; opacity: 0; }
  to { height: 55px; opacity: 1; }
}

@keyframes warnBannerClose {
  from { height: 55px; opacity: 1; }
  to { height: 0; opacity: 0; }
}

.hover_link{
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
  cursor: pointer;
  transition: text-decoration-color 0.2s ease;
}

.hover_link:hover{
text-decoration-color: color-mix(in srgb, currentColor 100%, transparent);
}

.sidebarMenuButton:hover .shortcut-text{
  opacity: 0.5;
}

.ChatDropdownOption:hover .shortcut-text{
  opacity: 0.5 !important;
  max-width: initial !important;
}


.shortcut-text{
  font-family: -apple-system-body, "ui-sans-serif", -apple-system, "system-ui", Segoe UI, Helvetica, Apple Color Emoji, Arial, "sans-serif", Segoe UI Emoji, Segoe UI Symbol;
  transition: opacity 0.2s ease;
  overflow: hidden;
}

.shortcut-text.ask{
  visibility: hidden;
  opacity: 0.5;
}

.shortcut-text.key{
  user-select: none;
  background-color: var(--user-bubble);
  color: var(--text-color);
  border-radius: 5px;
  height: 30px;
  display: flex;
  width: 30px;
  align-items: center;
  justify-content: center;
}

.shortcut-text.key.large{
  width: fit-content;
  padding: 0 8px;
}

.shortcut-text.ml{
  opacity: 0;
  margin-left: auto;
}

.shortcut-text.tt{
  opacity: 0.5;
  margin-left: 4px;
}

.margin-left-8{
  margin-left: 8px;
}

.margin-left{
  margin-left: auto;
}

.margin-bottom{
  margin-bottom: auto;
}

.margin-btm-9{
  margin-bottom: 9px;
}

.margin-top{
  margin-top: auto;
}

.margin-left-0{
  margin-left: 0;
}

.flex {
  display: flex;
}

.gap5 {
  gap: 5px;
}

.gap8 {
  gap: 8px;
}

.gap28 {
  gap: 28px;
}

.gap40 {
  gap: 40px;
}

.padding-btm-12{
  padding-bottom: 12px;
}


.flex-direction-column{
  flex-direction: column;
}

.overflow-wrap{
  overflow-wrap: break-word;
  word-break: break-word;
}

.pointer-events-none {
  pointer-events: none;
}

.shortcut_row{
  display: flex;
  align-items: center;
  color: var(--med-text);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color-lighter);
}

.shortcut_row.last{
  border: none;
}

.anim-svg-input{
  width:24px;
  height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
}

#voiceLottieContainer svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
  overflow: visible;
}

#voiceLottieContainerBottom svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
  overflow: visible;
}

#voiceLottieContainer svg path[stroke] {
  stroke: currentColor !important;
  stroke-width: 28px !important;
}

#voiceLottieContainerBottom svg path[stroke] {
  stroke: currentColor !important;
  stroke-width: 28px !important;
}

textarea.voice-live-overlay-active,
input.voice-live-overlay-active,
#inputbox.voice-live-overlay-active,
#inputCenteredBox.voice-live-overlay-active,
#mobileTextbox.voice-live-overlay-active,
#toolChatInput.voice-live-overlay-active {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  caret-color: var(--text-color) !important;
}

.align-center{
  align-items: center;
}

.align-baseline{
  align-items: baseline;
}

.border-bottom{
  border-bottom: 1px solid var(--border-color);
}

.border-box{
  box-sizing: border-box;
}

.pad-x-15{
  padding-left: 15px;
  padding-right: 15px;
}

.pad-x-10{
  padding-left: 10px;
  padding-right: 10px;
}

.pad-y-2{
  padding-top: 2px;
  padding-bottom: 2px;
}

.pad-y-4{
  padding-top: 4px;
  padding-bottom: 4px;
}

.pad-btm-8{
  padding-bottom: 8px;
}

.pad-left-12{
  padding-left: 12px;
}

.collection_move_list_folder_svg{
  width: 18px;
  height: 18px;
  display: flex;
  justify-content: center;
  padding: 0 2px;
}

.collection_move_list{
  --sb-track-color: transparent;
  --sb-thumb-color: var(--hover-color);
  --sb-size: 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 2px 5px 5px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 293px;
  scrollbar-width: 9px;
  scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
  scrollbar-gutter: stable;
}

.collection_move_list::-webkit-scrollbar {
  width: var(--sb-size);
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.collection_move_list::-webkit-scrollbar-track {
  background: var(--sb-track-color) !important;
  border-radius: 8px;
  border: none;
  box-shadow: none;
}

.collection_move_list::-webkit-scrollbar-thumb {
  background: var(--sb-thumb-color) !important;
  border-radius: 8px;
  border: 1px solid #282825 !important;
  box-shadow: none;
}

@supports not selector(::-webkit-scrollbar) {
  .collection_move_list {
    scrollbar-color: var(--sb-thumb-color) var(--sb-track-color) !important;
  }
}

.collection_move_list_item{
  display: flex;
  width: 100%;
  padding: 5px 10px;
  min-height: 40px;
  align-items: center;
  box-sizing: border-box;
  border-radius: 8px;
  cursor: pointer;
  gap: 8px;
}

.collection_move_list_item:hover{
  background-color: var(--hover-color);
}

.collection_move_list_item.added{
  color: var(--highlight-text);
}

.collection_move_list_item.added:hover{
  background-color: var(--highlight-bg);
}

.settings-masked-input {
  -webkit-text-security: disc;
}

.cookies_modal{
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 999999999;
  border: 1px solid var(--black-border-color);
  display: flex;
  flex-direction: column;
  gap: 18px;
  background-color: var(--black);
  color: var(--white);
  width: 350px;
  border-radius: 21px;
  padding: 24px;
}

.cookies_modal.hidden{
  display: none;
}

.cookies_modal_buttons{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cookies_modal_buttons_row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  width: 100%;
}

.cookies_modal_settings_box{
  padding: 14px 14px;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  background-color: var(--black-light);
}

.justify-content{
  justify-content: center;
}

.width100{
  width: 100%;
}

.height16{
  height: 16px;
}

.input_settings{
  width: 200px;
  margin-left: auto;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-color);
}

.Avatar_switch{
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  display: flex;.
  align-items: center;
  justify-content: center;
  background: var(--file-btn-mobile-bg);
  color: #000;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px; 
  cursor: pointer;
  margin-left: auto;
  overflow: hidden;
}

.initials{
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  transition: filter 0.2s ease;
  background-color: inherit;
}

.Avatar_switch:hover .input_icon_collection_block_update_icon{
  opacity: 1;
}

.Avatar_switch:hover .initials{
  filter: blur(4px);
}

.negative_margin_top.px20{
  margin-top: -20px;
}

a:-webkit-any-link {
  color: var(--text-color) !important;
}

::-moz-selection {
  background: var(--highlight-bg);
  color: var(--highlight-text);
}

::selection {
  background: var(--highlight-bg);
  color: var(--highlight-text);
}

.slanter-codeblock::selection,
.slanter-codeblock ::selection {
  background: var(--blue-accent);
  color: var(--white);
}

.upgrade_small{
  margin-top: 5px;
  display: flex;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--blue-accent);
  background-color: transparent;
  border-radius: 10px;
  padding: 3px 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.upgrade_small:hover{
  background-color: var(--highlight-bg);
  color: var(--highlight-text);
}

.ask_user_panel{
  box-sizing: border-box;
  padding: 10px;
  border-radius: 21px;
  border: 1px solid var(--border-color);
  background-color: var(--input-lighter-bg);
  position: fixed;
  z-index: 8;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.ask_user_panel.hidden{
  display: none;
}

.ask_user_option.dimmed{
  opacity: 0.5;
}

.ask_user_option{
  width: 100%;
  display: flex;
  align-items: center;
  background: transparent;
  border-radius: 13px;
  height: 42px;
  padding: 6px;
  padding-right: 18px;
  color: var(--light-text);
  border: none;
  font-size: 1rem;
  gap: 8px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.ask_user_option.div{
  padding-right: 6px;
}

.ask_user_option:focus,
.ask_user_option:hover{
  outline: none;
  color: var(--text-color);
  background-color: var(--lighter-hover-color);
}

.ask_user_option:focus .shortcut-text.ask,
.ask_user_option:hover .shortcut-text.ask{
  visibility: visible;
}

.ask_user_option_icon{
  width: 30px;
  height: 30px;
  min-width: 30px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light-box-question);
  border-radius: 8px;
}

.input_ask_user{
  width: 100%;
  font-size: 1rem;
  background-color: transparent;
  border: none;
  outline: none;
}

.input_ask_user::placeholder{
  opacity: 0.5;
}

.btn_light_small{
  height: 30px;
  padding: 4px 12px;
  background-color: var(--lighter-hover-color);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-color);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.btn_light_small.send{
  height: 30px;
  min-width: 30px;
  width: 30px;
  padding: 6px;
  background-color: var(--contrast);
  color: var(--contrast-text);
}

.btn_light_small.send:hover{
  background-color: var(--light-background-hover);
}

.btn_light_small:hover{
  background-color: var(--light-box-question);
}

.question_cycle_text{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  font-size: 0.9rem;
  color: var(--med-text);
}

.themeImg {
  border-radius: 8px;
}

.themeBtn {
  opacity: 0.7;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  outline-offset: 0;
  transition: transform 0.2s ease, outline  0.2s ease, opacity 0.2s ease;
}
.themeBtn.active,
.themeBtn:hover{
  opacity: 1;
}

.themeBtn.active .themeImg {
  outline: 2px solid var(--blue-accent);
  outline-offset: 2px;
}

.usage_left{
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 240px;
}

.usage_right{
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.bar{
  max-width: 500px;
  margin-left: auto;
  width: 100%;
  background-color: var(--file-btn-mobile-bg-trans);
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
}

.bar_level{
  background-color: var(--blue-accent);
  height: 10px;
  border-radius: 10px;
}

.bar_level.low{
  background-color: var(--red-text);
  height: 10px;
  border-radius: 10px;
}

.chat_skeleton{
  display: none;
  position: absolute;
  top: calc(50px + 28px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 31;
  max-width: 765px;
  flex-direction: column;
  gap: 8px;
  width: min(calc(100% - 48px), 765px);
  pointer-events: none;
}

body:not(.mobile-active) #chatView.is-chat-loading > .chat_skeleton{
  display: flex;
}

body:not(.mobile-active) #chatView.is-chat-loading > .chat-scroll,
body:not(.mobile-active) #chatView.is-chat-switching > .chat-scroll{
  opacity: 0;
}

body:not(.mobile-active) #chatView > .chat-scroll{
  opacity: 1;
}

body:not(.mobile-active) #chatContainer > .skeleton_chat,
body:not(.mobile-active) #chatContainer > .rate-limit-skeleton-message{
  display: none !important;
}

body:not(.mobile-active) #chatView.is-chat-loading > .input-container,
body:not(.mobile-active) #chatView.is-chat-loading > .input-disclaimer,
body:not(.mobile-active) #chatView.is-chat-loading > .file-preview-stack,
body:not(.mobile-active) #chatView.is-chat-loading > .empty-chat-composer-stack,
body:not(.mobile-active) #chatView.is-chat-loading > #chatBottomMask,
body:not(.mobile-active) #chatView.is-chat-loading > #scrollDownBtn{
  display: none !important;
}

body.mobile-active #chatView > .chat_skeleton{
  display: none !important;
}

.user_message_skeleton{
  margin-left: auto;
  margin-bottom: 22px;
  width: 200px;
  border-radius: 13px;
  height: 54.5px;
  background-color: var(--user-bubble);
}

.bot_message_skeleton{
  height: 15px;
  border-radius: 4px;
  background-color: var(--user-bubble);
  width: 100%;
}

.bot_message_skeleton.light{
  background-color: var(--invite-skeleton-base);
}

.bot_message_skeleton.l{
  max-width: 650px;
  width: 80%;
}

.bot_message_skeleton.m{
  max-width: 520px;
  width: 65%;
}

.bot_message_skeleton.s{
  max-width: 400px;
  width: 55%;
}

.bot_message_skeleton.xs{
  max-width: 330px;
  width: 38%;
}

.bot_message_skeleton.xxs{
  max-width: 170px;
  width: 28%;
}

.bot_message_skeleton.xxxs{
  max-width: 70px;
  width: 10%;
}

.toast-container-new-right{
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 9999999999;
  pointer-events: none;
}

.toast-container-new-right .toast_new{
  pointer-events: auto;
}

.toast_new{
  display: flex;
  gap: 16px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 13px;
  padding: 8px;
  color: var(--text-color);
  align-items: center;
  width: fit-content;
  max-width: 360px;
  padding-left: 16px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast_new.show{
  opacity: 1;
  transform: none;
}

.toast_new.warning{
  background-color: var(--orange-bg);
  color: var(--orange-text);
  border-color: var(--orange-border);
}

.toast_new.error{
  background-color: var(--red-bg-not-transp);
  color: var(--red-text-light);
  border-color: var(--red-border);
}

.toast_new_icon{
  padding: 6px 0;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
}

.decor_special{
  position: absolute;
  top: 60px;
  left: 16px;
  right: 16px;
  overflow: hidden;
  pointer-events: none;
  display: flex;
}

.decor_special img{
  display: block;
  width: 100%;
  height: 41px;
  object-fit: none; 
  object-position: right;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.input-container-centered.collection .decor_special{
  visibility: hidden;
  display: none;
}

.file_upload_chip_row_overflow_wrapper{
  position: relative;
}

.file_upload_chip_row_overflow_wrapper::before{
  content: "";
  position: absolute;
  background: linear-gradient(90deg,var(--input-bg) 0%, transparent 100%);
  height: 98px;
  z-index: 1000;
  width: 40px;
  left: 16px;
  bottom: 0;
  visibility: hidden;
}

.file_upload_chip_row_overflow_wrapper::after{
  content: "";
  position: absolute;
  background: linear-gradient(90deg,transparent 0%, var(--input-bg) 100%);
  height: 98px;
  width: 40px;
  right: 16px;
  bottom: 0;
  visibility: hidden;
}

.file_upload_chip_row{
  position: relative;
  margin: 0 16px;
  display: flex;
  gap: 16px;
  align-items: start;
  overflow-y: hidden;
  overflow-x: scroll;
  scrollbar-width: none;
}

.file_upload_chip{
  position: relative;
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--file-btn-mobile-bg-trans);
  display: flex;
  flex-direction: column;
  padding: 8px;
  overflow: hidden;
}

.file_upload_chip_preview{
  left: 0;
  top: 0;
  position: absolute;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file_upload_chip.skeleton{
  justify-content: center;
  gap: 6px;
}

.file_upload_chip .file_upload_chip_close{
  flex-shrink: 0;
}

.file_upload_chip[data-is-image="true"].doc .file_upload_chip_preview{
  cursor: pointer;
}

.file_upload_chip .sans_serif.margin-top.size09rem{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  user-select: none;
}

button:focus{
  outline: none;
}

button:focus-visible{
  outline: 2px solid var(--blue-accent);
  outline-offset: 2px;
}

.file_dropdown_overlay{
  z-index: 999999999999;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-color);
  justify-content: center;
}

.file_dropdown_svg{
  height: 142px;
  width: 129px;
}

.file_dropdown_overlay::before{
  position: absolute;
  top: 0;
  left: 0;
  content: "";
  height: 100%;
  z-index: -1;
  width: 100%;
  background-color: var(--background-color);
  opacity: 0.90;
}

#globalSearchModal{
  background: transparent;
  backdrop-filter: blur(0);
}

.search_modal{
  width: 600px;
  max-height: 500px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color-sharper);
  border-radius: 21px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#globalSearchModal {
  align-items: flex-start;
  padding-top: 18vh;
}

.search_row{
  cursor: pointer;
  width: 100%;
  background-color: transparent;
  display: flex;
  align-items: center;
  color: var(--light-text);
  border-radius: 8px;
  height: 38px;
  gap: 8px;
  padding: 8px 12px;
  box-sizing: border-box;
}

.search_row:hover{
  background-color: var(--hover-color);
  color: var(--text-color);
}

.search_modal_input{
  padding: 20px 24px;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-color-sharper);
}

.search_list{
  transition: max-height 0.3s ease;
  width: 100%;
  overflow-y: auto;
  padding: 8px;
  flex: 1;
  box-sizing: border-box;
}

.search_list::-webkit-scrollbar {
  width: var(--sb-size);
}

.search_list::-webkit-scrollbar-track {
  background: var(--input-bg);
  border-radius: 11px;
}

.search_list::-webkit-scrollbar-thumb {
  background: var(--sb-thumb-color);
  border-radius: 11px;
  border: 1px solid var(--input-bg);
}

@supports not selector(::-webkit-scrollbar) {
  .search_list {
    scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
  }
}

.user-avatar-icon {
  mix-blend-mode: color-burn;
  filter: contrast(0.5) !important;
  width: 19px;
  height: 19px;
}

#userAvatar .user-avatar-icon {
  width: 16px;
  height: 16px;
}

.DebugPanel{
  width: 500px;
  height: 300px;
  display: none;
  background-color: var(--code-ouput-bg);
  color: var(--white);
  padding: 8px;
  font-size: 0.85rem;
  overflow-y: auto;
  overflow-x: hidden;
  word-break: break-all;
  overflow-wrap: break-word;
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  border: 1px solid var(--border-color-sharper);
  border-radius: 8px;
}