.response-shell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  position: relative;
  padding-top: 2px;
}

.response-live-content[hidden] {
  display: none !important;
}

.response-live-content {
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.12s ease;
  width: 100%;
  min-height: 34px;
  will-change: opacity;
}

.response-shell.stream-visible .response-live-content {
  opacity: 1;
}

.thinking-shell {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0 0 4px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  transform: none;
  animation: none;
  transition: opacity 0.2s ease;
  will-change: auto;
}

.thinking-shell > :not([hidden]) {
  display: flex !important;
}

.thinking-live-web-root {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: min(100%, 520px);
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.thinking-live-web-line {
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #111111;
  line-height: 1.35;
  animation: none;
}

@keyframes zexiraiLiveWebLinePulse {
  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

.thinking-searching-for {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 480;
  color: var(--text-low);
  line-height: 1.45;
  max-width: 100%;
}

.thinking-pending-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  padding: 6px 0 8px;
  min-height: 34px;
}

.thinking-pending-dots span {
  display: none;
}

.thinking-pending-dots::before {
  content: "";
  box-sizing: border-box;
  width: 23px;
  height: 23px;
  border: 1.75px solid #111111;
  border-radius: 6px;
  background: transparent;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  transform-origin: 50% 50%;
  animation: zexiraiThinkingSquareSpinPulse 0.9s linear infinite;
  will-change: transform;
}

.thinking-shell-has-live-web .thinking-pending-dots {
  display: none !important;
}

@keyframes zexiraiThinkingSquareSpinPulse {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.response-shell.stream-visible .thinking-shell {
  opacity: 1;
  pointer-events: none;
}

.stream-status {
  font-size: 0.86rem;
  color: var(--text-low);
  margin: 2px 0 8px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.stream-status-primary {
  display: block;
}

.stream-status-search-detail {
  display: block;
  font-size: 0.82rem;
  font-weight: 480;
  color: #555555;
  line-height: 1.4;
  max-width: 100%;
}

.stream-status.searching-status {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 0;
  margin: 2px 0 8px;
  color: #111111;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-weight: 600;
  min-height: 0;
  overflow: visible;
}

.stream-status.searching-status .stream-status-primary {
  color: #111111;
  font-weight: 650;
}

.stream-status.searching-status .stream-status-search-detail {
  color: #333333;
  font-weight: 480;
}

.stream-status.searching-status::before,
.stream-status.searching-status::after {
  display: none !important;
}

.stream-status.searching-status .stream-status-primary,
.stream-status.searching-status .stream-status-search-detail {
  position: relative;
  z-index: 1;
}

.stream-plain {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  font-family: "Google Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  color: var(--text-high);
}

.stream-plain.typing::after {
  content: "|";
  margin-left: 1px;
  animation: streamCursorBlink 1s steps(1) infinite;
}

@keyframes streamCursorBlink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.stream-final {
  line-height: 1.7;
}

.response-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  width: fit-content;
}

.thinking-shell-analyzing-images .thinking-pending-dots {
  width: 34px;
  min-height: 34px;
  padding: 6px 0 8px;
  color: #111111;
}

.thinking-shell-searching .thinking-pending-dots {
  display: none !important;
}

.thinking-shell-analyzing-images .thinking-pending-dots::before,
.thinking-shell-searching .thinking-pending-dots::before {
  content: "";
  width: 23px;
  height: 23px;
  border: 1.75px solid #111111;
  border-radius: 6px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  animation: zexiraiThinkingSquareSpinPulse 0.9s linear infinite;
}

@keyframes zexiraiAnalyzingPulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.response-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: #5f6368;
}

.response-action-btn .material-symbols-rounded {
  font-size: 18px;
  line-height: 1;
  font-variation-settings:
    "FILL" 0,
    "wght" 425,
    "GRAD" 0,
    "opsz" 24;
}

.response-action-btn:hover .material-symbols-rounded {
  color: #202124;
}

.response-action-btn.selected .material-symbols-rounded {
  color: #000000;
  font-variation-settings:
    "FILL" 1,
    "wght" 425,
    "GRAD" 0,
    "opsz" 24;
}

.response-action-btn.locked {
  cursor: default;
}

#auth-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-sidebar-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #1f1f1f;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-sidebar-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 595;
  line-height: 1;
  text-transform: uppercase;
  padding-top: 3px;
  padding-left: 1px;
}

.tools-wrap {
  position: relative;
}

.tools-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: none;
  z-index: 1200;
}

.tools-menu.show {
  display: block;
  animation: composerMenuEnter 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tools-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-high);
  text-decoration: none;
  font-weight: 510;
  font-size: 0.9rem;
}

.tools-menu-item:hover {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
}

.chat-context-menu {
  position: fixed;
  z-index: 60000;
  min-width: 76px;
  width: max-content;
  background: #fefefe;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  opacity: 0;
  transform: none;
  transform-origin: top center;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease;
}

.chat-context-menu.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
  animation: composerMenuEnter 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chat-context-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-high);
  font-size: 0.88rem;
}

.chat-context-item:hover {
  background: var(--brand-primary-soft);
}

.chat-context-item.danger {
  color: #d93025;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 90000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  width: min(92vw, 420px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  padding: 20px;
}

.modal-title {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  color: #1f1f1f;
}

.modal-body-text {
  margin: 0 0 16px 0;
  color: #444746;
  font-size: 0.95rem;
}

.modal-input {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.edit-user-message-card {
  width: min(94vw, 560px);
  border-radius: 12px;
}

.edit-user-message-input {
  min-height: 180px;
  resize: vertical;
  line-height: 1.45;
}

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

.modal-btn-secondary {
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #1f1f1f;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
}

.modal-btn-primary {
  border: none;
  background: #000000;
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
}

.admin-panel-btn {
  gap: 6px;
}

.admin-panel-btn .material-symbols-rounded {
  font-size: 19px;
}

.admin-modal-card {
  width: min(94vw, 560px);
  padding: 18px;
}

.admin-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.admin-gate-grid,
.admin-panel-view,
.admin-panel-grant {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-panel-row {
  display: flex;
  gap: 8px;
}

.admin-panel-row .modal-input,
.admin-panel-grant .modal-input,
.admin-gate-grid .modal-input {
  margin-bottom: 0;
}

.admin-wide-btn {
  width: 100%;
  justify-content: center;
}

.admin-panel-message,
.admin-empty {
  color: #5f6368;
  font-size: 0.88rem;
  min-height: 18px;
}

.admin-user-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
}

.admin-user-row {
  width: 100%;
  border: 1px solid #ececec;
  background: #f8f8f8;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.admin-user-row:hover {
  background: #f1f1f1;
}

.admin-user-row span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-user-row strong,
.admin-user-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-row small {
  color: #6b6b6b;
}

.admin-user-row em {
  color: #1f1f1f;
  font-style: normal;
  font-weight: 595;
  white-space: nowrap;
}

#sidebar-history .history-chat-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100%;
  height: 38px;
  padding: 0 4px 0 12px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 10px !important;
  cursor: pointer;
  gap: 0;
}

#sidebar-history .history-chat-btn .nav-text {
  margin-left: 0 !important;
  font-size: 0.9rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 3px;
}

#sidebar-history .history-chat-btn .chat-pin-indicator {
  width: 16px;
  flex: 0 0 16px;
  margin-right: 4px;
  font-size: 15px;
  color: #5f6368;
}

#sidebar-top-nav {
  padding-top: 6px;
}

#sidebar-history .history-chat-btn:hover {
  background: var(--brand-primary-soft) !important;
}

#sidebar-history .history-chat-btn.active {
  background: var(--brand-primary-soft) !important;
  font-weight: 425;
}

#sidebar-history {
  padding: 0 6px 12px 16px !important;
}

#sidebar.collapsed .history-label {
  display: none !important;
}

#sidebar.collapsed #historyToggleBtn,
#sidebar.collapsed #sidebar-history {
  display: none !important;
}

#sidebar.collapsed #sidebar-history {
  display: none;
}

#sidebar.collapsed .sidebar-login-box {
  display: none !important;
}

#sidebar.collapsed .sidebar-bottom {
  padding: 12px 12px 10px;
}

#sidebar.collapsed .sidebar-auth-slot {
  width: 100%;
  min-height: 56px;
}

#sidebar.collapsed .sidebar-bottom-profile {
  width: 100%;
}

#sidebar.collapsed .sidebar-user-menu-wrap {
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
}

#sidebar.collapsed .sidebar-user-menu-panel {
  left: calc(100% + 12px);
  top: -6px;
  bottom: auto;
}

body.temporary-chat-mode .thinking-live-web-line {
  color: #f0f0f0;
  animation: none;
}

@keyframes zexiraiLiveWebLinePulseDark {
  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

body.temporary-chat-mode .thinking-searching-for {
  color: #b8b8b8;
}

body.temporary-chat-mode .thinking-pending-dots::before {
  border-color: #e8e8e8;
}

body.temporary-chat-mode .stream-status.searching-status {
  color: #f0f0f0;
  background: transparent;
  border: none;
  box-shadow: none;
}

body.temporary-chat-mode .stream-status.searching-status .stream-status-primary {
  color: #f0f0f0;
}

body.temporary-chat-mode .stream-status-search-detail {
  color: #c8c8c8;
}
