/**
 * Chatvora — chat.php Claude.ai layout (scoped to .sr-chat-page)
 */

html.sr-chat-page-html,
html.sr-chat-page-html body.sr-chat-page {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overflow-x: hidden;
  background: #0a0a0f;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/*
 * Mobile: lock document scroll so the OS/browser doesn’t scroll the whole page when
 * the keyboard opens on the composer (that jump looks like the input bar moved to the top).
 * Chat scrolling stays inside #sr-thread.
 */
@media (max-width: 767.98px) {
  html.sr-chat-page-html {
    height: 100%;
    overflow: hidden;
  }

  html.sr-chat-page-html body.sr-chat-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
}

.sr-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
}

.sr-app > nav.sr-navbar,
.sr-app > header {
  flex-shrink: 0;
}

/* --- Navbar (chat variant) --- */
nav.sr-navbar {
  height: 56px;
  min-height: 56px;
  flex-shrink: 0;
  z-index: 100;
  background: #0f0f17;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 16px;
  box-sizing: border-box;
}

.sr-navbar__brand {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff !important;
  text-decoration: none !important;
  flex-shrink: 0;
}

.sr-navbar__brand:hover {
  color: #e2e8f0 !important;
}

.sr-navbar__links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
  align-items: center;
}

@media (min-width: 768px) {
  .sr-navbar__links {
    display: flex;
  }
}

.sr-navbar__links a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none !important;
  font-size: 0.88rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
}

.sr-navbar__links a:hover,
.sr-navbar__links a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.sr-navbar__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.sr-navbar__actions .shop-button,
.sr-navbar__actions .search-button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.35rem;
  padding: 0.25rem;
  cursor: pointer;
  border-radius: 8px;
}

.sr-navbar__actions .shop-button:hover,
.sr-navbar__actions .search-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sr-navbar__cta {
  display: none;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff !important;
  border: 1px solid rgba(165, 180, 252, 0.35);
}

@media (min-width: 576px) {
  .sr-navbar__cta {
    display: inline-flex;
  }
}

.sr-navbar__cta:hover {
  filter: brightness(1.06);
  color: #fff !important;
}

.sr-navbar__menu-site {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

@media (min-width: 768px) {
  .sr-navbar__menu-site {
    display: none;
  }
}

/* --- Body row --- */
.sr-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

body.sr-chat-page .sr-body {
  overflow-x: hidden;
  overflow-y: visible;
}

/* --- Sidebar --- */
.sr-sidebar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  background: #0f0f17;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Logged-in chat: sidebar fixed below navbar so it stays visible; main clears it */
@media (min-width: 768px) {
  .sr-chat-page--logged-in .sr-sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    z-index: 50;
    flex: none;
  }

  .sr-chat-page--logged-in .sr-main {
    margin-left: 260px;
    flex: 1;
    width: calc(100% - 260px);
    max-width: calc(100% - 260px);
    box-sizing: border-box;
  }
}

.sr-sidebar-top {
  padding: 16px;
  flex-shrink: 0;
}

.sr-sidebar-new {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sr-sidebar-new:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sr-sidebar-search {
  flex-shrink: 0;
  padding: 0 12px 10px;
}

.sr-sidebar-search__field {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0 8px;
  min-height: 38px;
}

.sr-sidebar-search__icon {
  color: rgba(255, 255, 255, 0.35);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.sr-sidebar-search__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.82rem;
  padding: 8px 4px;
  outline: none;
}

.sr-sidebar-search__input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.sr-sidebar-search__clear {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.sr-sidebar-search__clear:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sr-sidebar-search__clear[hidden] {
  display: none !important;
}

.sr-sidebar-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px;
  min-height: 0;
}

.sr-sidebar-bottom {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sr-sidebar-user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sr-sidebar-user-meta {
  min-width: 0;
}

.sr-sidebar-user-email {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-sidebar-user-meta a {
  font-size: 0.72rem;
  color: rgba(147, 197, 253, 0.9);
  text-decoration: none;
}

.sr-sidebar-user-meta a:hover {
  text-decoration: underline;
}

.sr-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sr-sidebar-backdrop.is-visible {
  display: block;
  opacity: 1;
}

@media (max-width: 767.98px) {
  .sr-sidebar {
    display: flex !important;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    min-width: 260px;
    max-width: min(260px, 92vw);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    box-shadow: none;
    pointer-events: none;
  }

  .sr-chat-page--logged-in .sr-sidebar {
    top: 56px;
    height: calc(100dvh - 56px);
    max-height: calc(100dvh - 56px);
  }

  .sr-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
  }

  .sr-main {
    position: relative;
  }

  /*
   * Wins over base `.sr-main__top` (later in file) — avoids tall strip + mis-centered menu button.
   */
  .sr-chat-page .sr-main__top {
    position: relative;
    min-height: 48px !important;
    padding: 0 14px 0 52px !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box;
  }

  /* Global navbar already shows Chatvora — hide duplicate title on chat mobile */
  .sr-chat-page--logged-in .sr-main__title {
    display: none !important;
  }

  /* Below open sidebar (z-index 200); vertically centered between top/bottom borders */
  .sr-chat-page--logged-in .sr-main__menu-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 185;
  }

  /* Avoid smooth-scroll fighting the keyboard / growing textarea */
  .sr-chat-page .sr-thread {
    scroll-behavior: auto;
  }

  .sr-composer .sr-chat__input {
    font-size: 16px !important;
    /* Hard cap: global .form-control + WebKit can leave a huge effective height after send */
    max-height: min(9rem, 40dvh) !important;
    box-sizing: border-box !important;
  }

  .sr-composer .sr-chat__toolbar.sr-chat__toolbar--with-model {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .sr-composer .sr-chat__model-field {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Compact square send (icon-only on mobile); avoids full-width bar from generic mobile chat rules */
  .sr-composer .sr-chat__send.btn {
    display: inline-flex !important;
    position: relative !important;
    flex: 0 0 auto !important;
    width: 2.75rem !important;
    height: 2.75rem !important;
    min-width: 2.75rem !important;
    max-width: 2.75rem !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    line-height: 1 !important;
  }

  .sr-composer .sr-chat__send .sr-chat__send-spinner {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
  }

  .sr-composer .sr-chat__send-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* Boxicons glyphs can sit off-center in tight squares — lock icon to flex center */
  .sr-composer .sr-chat__send-icon.bx {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    font-size: 1.28rem !important;
    line-height: 1 !important;
  }

  .sr-composer .sr-chat__send-icon.bx::before {
    display: block;
    line-height: 1;
  }

  .sr-msg-time {
    font-size: 14px;
  }

  .sr-empty-state p {
    font-size: 14px;
  }

  .sr-bubble-assistant .sr-bubble-content,
  .sr-bubble-user .sr-bubble-content {
    font-size: 14px;
  }
}

@media (min-width: 768px) {
  .sr-composer .sr-chat__send-text {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: 0;
  }

  .sr-composer .sr-chat__send-icon {
    display: none !important;
  }
}

/* --- Main --- */
.sr-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  position: relative;
}

/* chat.php: persona dropdown sits above the composer — avoid clipping it off */
body.sr-chat-page .sr-main {
  overflow-x: hidden;
  overflow-y: visible;
}

.sr-main__top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #0a0a0f;
}

@media (min-width: 768px) {
  .sr-main__top {
    display: none;
  }
}

.sr-main__menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  font-size: 1.25rem;
}

.sr-main__menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sr-main__title {
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.sr-main__title--logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

.sr-main__title--logo .sr-main__logo-img {
  display: block;
  height: 22px;
  width: auto;
  max-width: min(140px, 42vw);
  object-fit: contain;
  object-position: left center;
}

.sr-thread-outer {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sr-thread-outer .sr-thread {
  flex: 1;
  min-height: 0;
}

.sr-thread {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 16px;
  scroll-behavior: smooth;
}

.sr-thread-inner {
  max-width: 760px;
  margin: 0 auto;
}

.sr-jump-bottom-pill {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.45);
  background: rgba(17, 17, 24, 0.95);
  color: #e0e7ff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, color 0.15s ease;
}

.sr-jump-bottom-pill:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
}

.sr-jump-bottom-pill[hidden] {
  display: none !important;
}

.sr-composer-wrap {
  flex-shrink: 0;
  padding: 24px 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background: #0a0a0f;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sr-chat__guest-hint {
  max-width: 760px;
  margin: 0 auto 10px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

.sr-chat__guest-hint a {
  color: #93c5fd;
}

.sr-composer {
  max-width: 760px;
  margin: 0 auto;
  background: #111118;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sr-composer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  width: 100%;
}

.sr-composer .sr-chat__toolbar,
.sr-composer .sr-composer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.sr-composer-bottom .sr-persona-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
  width: auto;
  height: auto;
  line-height: 1;
}

.sr-composer-bottom .sr-persona-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sr-composer-bottom .sr-persona-composer-slot {
  flex-shrink: 0;
  padding-top: 0;
}

.sr-composer .sr-chat__model-field {
  flex: 1 1 10rem;
  min-width: 0;
}

.sr-composer .sr-chat__input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  color: #fff !important;
  resize: none;
  font-size: 0.95rem;
  min-height: 2.5rem;
  max-height: 200px;
  padding: 0.25rem 0;
}

.sr-composer .sr-chat__model-select {
  width: 100%;
  background: #1a1a2e !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border-radius: 8px;
  font-size: 0.85rem;
  padding: 0.45rem 0.65rem;
}

.sr-composer .sr-chat__send {
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  border: 1px solid rgba(165, 180, 252, 0.35) !important;
  color: #fff !important;
}

.sr-composer .sr-chat__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sr-chat-charcount {
  text-align: right;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  margin: -0.25rem 0 0;
  min-height: 1rem;
}

.sr-chat-charcount.is-warn {
  color: #fdba74;
}

.sr-chat-charcount.is-danger {
  color: #fca5a5;
}

.sr-chat-charcount[hidden] {
  display: none !important;
}

.sr-chat__send-spinner {
  display: none;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.sr-chat__send.is-loading .sr-chat__send-spinner {
  display: inline-flex !important;
}

.sr-chat__send.is-loading .sr-chat__send-text,
.sr-chat__send.is-loading .sr-chat__send-icon {
  display: none !important;
}

/* --- Empty state --- */
.sr-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: min(50vh, 360px);
  padding: 2rem 1rem;
}

.sr-empty-state[hidden] {
  display: none !important;
}

.sr-empty-icon {
  font-size: 48px;
  line-height: 1;
  color: #818cf8;
  margin-bottom: 1rem;
}

.sr-empty-state h2 {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.5rem;
}

.sr-empty-state p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  max-width: 22rem;
  line-height: 1.5;
}

/* --- Bubbles --- */
.sr-chat-turn {
  margin-bottom: 16px;
}

.sr-bubble-user {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.sr-bubble-user__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  box-sizing: border-box;
  width: fit-content;
  max-width: min(560px, 85vw, 100%);
  min-width: min(13rem, calc(100vw - 48px));
  flex-shrink: 0;
}

.sr-bubble-user .sr-bubble-content {
  background: #2563eb;
  color: #ffffff;
  border-radius: 18px 18px 4px 18px;
  padding: 10px 16px;
  max-width: 100%;
  width: fit-content;
  min-width: min(12rem, 100%);
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  box-sizing: border-box;
}

.sr-bubble-assistant {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 16px;
  gap: 12px;
  align-items: flex-start;
}

.sr-bubble-assistant__stack {
  flex: 1;
  min-width: 0;
  max-width: calc(85% + 32px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.sr-bubble-assistant__stack .sr-bubble-content {
  max-width: 100%;
}

.sr-bubble-assistant .sr-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #ffffff;
  font-weight: 600;
}

.sr-bubble-assistant .sr-bubble-content {
  min-width: 0;
  background: #111118;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 4px 18px 18px 18px;
  padding: 12px 16px;
  max-width: 85%;
  line-height: 1.7;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.sr-bubble-assistant .sr-bubble-content .sr-chat__md pre {
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
}

/* Typing dots: see sr-chat.css (.sr-typing) */

/* --- Error --- */
.sr-error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  text-align: center;
  max-width: 560px;
  margin: 0 auto 16px;
}

.sr-error-msg[hidden] {
  display: none !important;
}

.sr-thread-fatal-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.sr-msg-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.2;
}

.sr-bubble-user__stack .sr-msg-time {
  text-align: right;
  width: 100%;
}

.sr-chat-turn.sr-msg--highlight {
  outline: 2px solid rgba(129, 140, 248, 0.9);
  outline-offset: 6px;
  border-radius: 14px;
  transition: outline-color 0.6s ease, outline-offset 0.6s ease;
}

/* Shell for chat JS */
.sr-chat-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

body.sr-chat-page .sr-chat-shell {
  overflow-x: hidden;
  overflow-y: visible;
}

/* Bubble hover actions (chat.php) */
.sr-bubble-wrap {
  position: relative;
  margin-bottom: 28px;
}

.sr-bubble-user.sr-bubble-wrap,
.sr-bubble-assistant.sr-bubble-wrap {
  margin-bottom: 28px;
}

.sr-home-bubble-wrap.sr-bubble-wrap {
  margin-bottom: 28px;
}

.sr-bubble-actions {
  display: none;
  position: absolute;
  bottom: -32px;
  right: 0;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px;
  gap: 2px;
  align-items: center;
  z-index: 10;
}

.sr-bubble-wrap--assistant .sr-bubble-actions {
  right: auto;
  left: 0;
}

@media (hover: hover) {
  .sr-bubble-wrap:hover .sr-bubble-actions {
    display: flex;
  }
}

.sr-bubble-wrap:focus-within .sr-bubble-actions {
  display: flex;
}

.sr-action-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.sr-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sr-bubble-edit-textarea {
  width: 100%;
  min-height: 72px;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font: inherit;
  resize: vertical;
}

.sr-bubble-edit-bar {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* Persona + composer extras */
.sr-persona-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.sr-persona-toggle {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sr-persona-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(99, 102, 241, 0.45);
  color: #fff;
}

.sr-persona-panel {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: rgba(15, 15, 22, 0.85);
}

.sr-persona-panel[hidden] {
  display: none !important;
}

.sr-persona-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.35rem;
}

.sr-persona-select {
  width: 100%;
  font-size: 0.88rem;
}

.sr-persona-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: rgba(199, 210, 254, 0.95);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.sr-persona-badge[hidden] {
  display: none !important;
}

.sr-persona-badge__clear {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 0.15rem;
}

.sr-persona-badge__clear:hover {
  color: #fff;
}

.sr-suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.25rem;
  max-width: 36rem;
}

.sr-suggest-chips[hidden] {
  display: none !important;
}

.sr-suggest-chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sr-suggest-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
}

.sr-chat__stop {
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(248, 113, 113, 0.45) !important;
  color: #fecaca !important;
}

.sr-chat__stop:hover {
  background: rgba(239, 68, 68, 0.28) !important;
}

.sr-chat__stop[hidden] {
  display: none !important;
}

.sr-composer .sr-chat__toolbar.sr-chat__toolbar--with-model {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sr-stopped-marker {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
  white-space: nowrap;
}

.sr-conv-title-input {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.5);
  background: #1a1a2e;
  color: #fff;
}

/* Long bubbles + code blocks */
.sr-bubble-scroll--clamped {
  max-height: 400px;
  overflow-y: auto;
}

.sr-bubble-scroll--expanded {
  max-height: none;
  overflow: visible;
}

.sr-bubble-show-more {
  display: block;
  margin: 6px 0 0;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 8px;
  cursor: pointer;
  width: fit-content;
}

.sr-bubble-show-more:hover {
  background: rgba(99, 102, 241, 0.22);
}

.sr-bubble-show-more[hidden] {
  display: none !important;
}

.sr-codeblock-wrap {
  position: relative;
  margin: 0.65rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
}

.sr-codeblock-wrap pre {
  margin: 0 !important;
  padding: 2.25rem 12px 12px !important;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.45;
}

.sr-code-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e0e7ff;
  cursor: pointer;
}

.sr-code-copy:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.45);
}

.sr-chat__md pre code {
  background: transparent !important;
}
