* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, sans-serif;
}

:root {
  --bg-main: #1e1e1e;
  --bg-panel: #171717;
  --bg-chat: #212121;
  --bg-chat-box: #1f1f1f;
  --line: #2a2a2a;
  --text-main: #e5e5e5;
  --text-soft: #aaa;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background-color 180ms ease, color 180ms ease;
}

.top-nav,
.sidebar,
.chat,
.chat-box,
.chat-header,
.messages,
.message,
.input-area,
input,
.send,
.suggested-prompts,
.suggested-prompt-card,
.nav-icon,
.list li,
.user-badge {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.top-nav {
  height: 50px;
  flex-shrink: 0;
  background: #111;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.top-left {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-icon {
  width: 24px;
  height: 24px;
  border: 1px solid #4a4a4a;
  border-radius: 50%;
  background: transparent;
  color: #d0d0d0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.nav-icon:hover {
  background: #2b2b2b;
}

.feedback-trigger {
  border-radius: 8px;
}

.feedback-icon-image {
  width: 14px;
  height: 14px;
  display: block;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(89%) sepia(2%) saturate(0%) hue-rotate(166deg) brightness(92%) contrast(89%);
}

.theme-toggle {
  font-size: 13px;
  font-weight: 700;
}

.nav-icon.dot {
  width: 18px;
  height: 18px;
  border: none;
  background: #bbb;
  opacity: 0.8;
  cursor: default;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #666;
}

.agency-block {
  min-width: 0;
  max-width: 220px;
  text-align: right;
  margin-right: 10px;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agency-block[hidden] {
  display: none;
}

.customer-block {
  min-width: 200px;
  text-align: right;
  margin-right: 10px;
  color: inherit;
}

.customer-label {
  font-size: 11px;
  color: var(--text-soft);
}

.customer-name {
  font-size: 13px;
}

.container {
  display: flex;
  flex: 0 0 calc(100vh - 50px);
  height: calc(100vh - 50px);
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 900px) {
}

.sidebar {
  width: 260px;
  min-width: 200px;
  max-width: 500px;
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-resize-handle {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 10;
  transition: background 120ms ease;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
  background: #4a4a4a;
}

.section-title {
  font-size: 11px;
  color: var(--text-soft);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.list {
  list-style: none;
}

.list li {
  padding: 5px 10px;
  margin-bottom: 2px;
  border-radius: 8px;
  cursor: pointer;
  color: #ccc;
  font-size: 14px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-label {
  display: inline-block;
}

.agent-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.agent-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}

.agent-picker-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 24px));
  max-height: min(72vh, 560px);
  overflow: auto;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.agent-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.agent-picker-header h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 600;
}

.agent-picker-close,
.agent-picker-cancel {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-main);
  border-radius: 8px;
  cursor: pointer;
}

.agent-picker-close {
  width: 32px;
  height: 32px;
  font-size: 20px;
}

.agent-picker-description {
  color: var(--text-soft);
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.agent-picker-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agent-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  min-height: 46px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
}

.agent-picker-item:hover,
.agent-picker-item.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.agent-picker-item .item-label {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.3;
}

.agent-picker-empty {
  padding: 10px 12px;
  color: var(--text-soft);
}

.agent-picker-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.agent-picker-cancel {
  padding: 8px 14px;
}

.agent-icon {
  width: 20px;
  height: 20px;
  color: var(--text-main);
  font-size: 14px;
  text-align: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.agent-icon-image {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(92%) sepia(7%) saturate(281%) hue-rotate(177deg) brightness(93%) contrast(90%);
}

.list li:hover,
.list li.active {
  background: #2a2a2a;
}

.chat-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.chat-search-wrapper {
  flex: 1;
  position: relative;
  min-width: 0;
}

.chat-search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: #666;
  pointer-events: none;
}

.chat-search-input {
  width: 100%;
  padding: 6px 10px 6px 28px;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  background: #0a0a0a;
  color: #ccc;
  font-size: 13px;
}

.chat-search-input::placeholder {
  color: #555;
}

.chat-search-input:focus {
  outline: none;
  border-color: #5a5a5a;
  background: #151515;
}

.chat-filter-wrapper {
  position: relative;
  flex-shrink: 0;
}

.chat-filter-button {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: transparent;
  color: #ccc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-filter-button:hover,
.chat-filter-button[aria-expanded="true"],
.chat-filter-button.filtered {
  background: #2a2a2a;
  border-color: #5a5a5a;
  color: #fff;
}

.chat-filter-button:focus {
  outline: none;
  border-color: #5a5a5a;
  background-color: #151515;
}

.chat-filter-icon {
  width: 15px;
  height: 15px;
}

.chat-filter-menu {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 320px;
  max-width: 360px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 6px;
  background: #171717;
  border: 1px solid #343434;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  z-index: 40;
}

.chat-filter-option {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #dedede;
  border-radius: 8px;
  padding: 9px 10px;
  text-align: left;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-filter-option-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-filter-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-filter-option-all-icon {
  width: 16px;
  height: 16px;
}

.chat-filter-agent-icon-image {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.chat-filter-option:hover,
.chat-filter-option.active {
  background: #262626;
}

.chat-filter-option.active {
  color: #fff;
}

.new-chat-button {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #ccc;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms ease;
}

.new-chat-button:hover {
  background: #2a2a2a;
  border-color: #5a5a5a;
  color: #fff;
}

.sessions-loading {
  color: var(--text-soft);
  font-size: 12px;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  position: relative;
  padding: 1px 10px;
  margin-bottom: 1px;
}

.session-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.session-open-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  width: 100%;
  min-width: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-agent-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}

.session-agent-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.session-agent-icon .agent-icon-image {
  filter: brightness(0) saturate(100%) invert(92%) sepia(7%) saturate(281%) hue-rotate(177deg) brightness(93%) contrast(90%);
}

.session-agent-icon-fallback {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(105, 201, 208, 0.25);
}

.session-direction-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.session-direction-indicator.outbound {
  color: #69C9D0;
}

.session-direction-indicator.inbound {
  color: #FF0050;
}

.session-actions-trigger {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #b4b4b4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
}

.session-item:hover .session-actions-trigger,
.session-item.active .session-actions-trigger,
.session-actions-trigger[aria-expanded="true"] {
  opacity: 1;
}

.session-actions-trigger:hover,
.session-actions-trigger[aria-expanded="true"] {
  background: #1f1f1f;
  border-color: #3f3f3f;
}

.session-actions-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 8px;
  width: 140px;
  padding: 6px;
  background: #1a1a1a;
  border: 1px solid #343434;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  z-index: 30;
}

.session-actions-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #dedede;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.session-actions-item:hover {
  background: #262626;
}

.session-actions-item.delete {
  color: #f0c2c2;
}

.session-actions-item.delete:hover {
  background: #3a1f1f;
  color: #ffd2d2;
}

.session-meta {
  display: block;
  font-size: 12px;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-chat);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  padding: 28px 32px;
  min-height: 0;
  overflow: hidden;
}

.chat-box {
  width: 100%;
  max-width: min(900px, 100%);
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--bg-chat-box);
  box-shadow: 0 0 0 1px var(--line);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  flex-shrink: 0;
  background: #1a1a1a;
  font-weight: 500;
}

.chat-header-label {
  color: var(--text-soft);
}

.messages {
  flex: 1;
  min-height: 0;
  padding: 20px;
  overflow-y: scroll;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #888 #2a2a2a;
}

.messages::-webkit-scrollbar {
  width: 16px;
}

.messages::-webkit-scrollbar-track {
  background: #2a2a2a;
  border-radius: 10px;
}

.messages::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 8px;
  border: 3px solid #2a2a2a;
}

.messages::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.message {
  max-width: 68%;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  font-size: 13px;
}

.message-model-used {
  font-size: 10px;
  line-height: 1.2;
  opacity: 0.75;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.light-theme .message-model-used {
  color: #526783;
}

.message.bot {
  white-space: normal;
}

.message.bot p {
  margin: 0 0 10px;
}

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

.message.bot ul,
.message.bot ol {
  margin: 0 0 10px 20px;
  padding: 0;
}

.message.bot table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13px;
}

.message.bot th,
.message.bot td {
  border: 1px solid #434343;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.message.bot th {
  background: #353535;
  color: #ffffff;
}

.message.bot tr:nth-child(even) td {
  background: #2f2f2f;
}

.message.bot code {
  background: #1f1f1f;
  border: 1px solid #3f3f3f;
  border-radius: 6px;
  padding: 1px 5px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.message.bot pre {
  background: #1f1f1f;
  border: 1px solid #3f3f3f;
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  margin: 8px 0;
}

.message.bot pre code {
  border: 0;
  padding: 0;
  background: transparent;
}

.message.bot a {
  color: #86b7ff;
}

.welcome-hero {
  width: 100%;
  max-width: min(900px, 100%);
  text-align: center;
  padding: 2px 0;
}

.welcome-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #465064;
  background: #2f3746;
  color: #cfd8e6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 10px;
}


.welcome-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  color: #e8edf6;
}

.welcome-subtitle {
  margin: 0;
  font-size: 14px;
  color: #c7d0dd;
}

.suggested-prompts {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  background: #1f1f1f;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  flex-shrink: 0;
}

.suggested-prompt-card {
  background: linear-gradient(180deg, #262b34 0%, #232831 100%);
  border: 1px solid #3a404c;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  text-align: left;
  color: #d7deea;
  cursor: pointer;
  min-height: 0;
}

.suggested-prompt-card:hover {
  border-color: #4f5a6d;
  background: linear-gradient(180deg, #29303a 0%, #252c36 100%);
}

.suggested-prompts.prompts-loading .suggested-prompt-card {
  opacity: 0.3;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.suggested-prompt-text {
  font-size: 12px;
  line-height: 1.3;
  color: #d0d7e3;
}

.chat-center.chat-started {
  gap: 8px;
}

.chat-center.chat-started .welcome-hero {
  display: none;
}

.chat-center.chat-started .chat-box {
  min-height: 0;
}


.user {
  background: #333;
  color: #fff;
  align-self: flex-end;
}

.bot {
  background: #2b2b2b;
  color: var(--text-main);
  align-self: flex-start;
}

.system {
  background: #4a2d00;
  color: #ffe9bf;
  align-self: center;
  max-width: 95%;
}

.input-area {
  padding: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

input {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #2b2b2b;
  color: #fff;
  outline: none;
}

.send {
  padding: 0 16px;
  border-radius: 10px;
  border: none;
  background: #444;
  color: white;
  cursor: pointer;
}

.send:hover {
  background: #555;
}

.send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* -----------------------------------------------------------------------
   Typing indicator (three-dot bounce)
   --------------------------------------------------------------------- */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  min-height: 36px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-soft);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* -----------------------------------------------------------------------
   Feedback modal
   --------------------------------------------------------------------- */

.feedback-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2200;
}

/* -----------------------------------------------------------------------
   Session actions modal (rename/delete)
   --------------------------------------------------------------------- */

.session-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2300;
}

.session-modal[hidden] {
  display: none;
}

.session-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.session-dialog {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100vw - 24px));
  border-radius: 14px;
  border: 1px solid #3a3a3a;
  background: #161616;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
  padding: 16px;
}

.session-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.session-dialog-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #f2f2f2;
}

.session-dialog-close {
  border: 1px solid #4a4a4a;
  background: transparent;
  color: #d7d7d7;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
  font-size: 18px;
}

.session-dialog-close:hover {
  background: #2d2d2d;
}

.session-dialog-description {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 12px;
  line-height: 1.4;
}

.session-dialog-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-dialog-label {
  font-size: 12px;
  color: var(--text-soft);
}

.session-dialog-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #3b3b3b;
  background: #202020;
  color: #f7f7f7;
  padding: 10px 12px;
  outline: none;
}

.session-dialog-input:focus,
.session-dialog-confirm:focus,
.session-dialog-cancel:focus,
.session-dialog-close:focus {
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.35);
}

.session-dialog-error {
  margin-top: 10px;
  border-radius: 8px;
  background: #4a1c1c;
  color: #ffcbcb;
  padding: 10px;
  font-size: 13px;
}

.session-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.session-dialog-confirm,
.session-dialog-cancel {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
}

.session-dialog-confirm {
  background: #0078d4;
  color: #fff;
  font-weight: 600;
}

.session-dialog-confirm:hover {
  background: #106ebe;
}

.session-dialog-confirm.danger {
  background: #a81e2a;
}

.session-dialog-confirm.danger:hover {
  background: #911824;
}

.session-dialog-cancel {
  background: #343434;
  color: #efefef;
}

.session-dialog-cancel:hover {
  background: #414141;
}

.feedback-modal[hidden] {
  display: none;
}

.feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.feedback-dialog {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid #3a3a3a;
  background: #161616;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
  padding: 16px;
  margin-left: 130px;
}

.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.feedback-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #f2f2f2;
}

.feedback-close {
  border: 1px solid #4a4a4a;
  background: transparent;
  color: #d7d7d7;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
  font-size: 18px;
}

.feedback-close:hover {
  background: #2d2d2d;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-label {
  font-size: 12px;
  color: var(--text-soft);
}

.feedback-textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #3b3b3b;
  background: #202020;
  color: #f7f7f7;
  resize: vertical;
  min-height: 120px;
  padding: 10px 12px;
  outline: none;
}

.feedback-textarea:focus,
.feedback-file:focus,
.feedback-submit:focus,
.feedback-secondary:focus,
.feedback-close:focus {
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.35);
}

.feedback-file {
  width: 100%;
  border-radius: 10px;
  border: 1px dashed #4c4c4c;
  background: #1f1f1f;
  color: #d6d6d6;
  padding: 10px;
}

.feedback-hint {
  font-size: 12px;
  color: var(--text-soft);
}

.feedback-preview {
  margin-top: 2px;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #3c3c3c;
  background: #0f0f0f;
}

.feedback-error {
  border-radius: 8px;
  background: #4a1c1c;
  color: #ffcbcb;
  padding: 10px;
  font-size: 13px;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.feedback-actions-two {
  gap: 8px;
  justify-content: center;
}

.feedback-submit,
.feedback-secondary {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
}

.feedback-submit {
  background: #0078d4;
  color: #fff;
  font-weight: 600;
}

.feedback-submit:hover {
  background: #106ebe;
}

.feedback-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.feedback-secondary {
  background: #343434;
  color: #efefef;
}

.feedback-secondary:hover {
  background: #414141;
}

.feedback-thankyou-title {
  text-align: center;
  font-size: 18px;
  color: #f2f2f2;
  margin: 6px 0 4px;
}

.feedback-thankyou-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 12px;
}

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30%            { transform: translateY(-6px); opacity: 1; }
}

/* -----------------------------------------------------------------------
   Streaming cursor while text is building
   --------------------------------------------------------------------- */

.message.bot.streaming::after {
  content: "▋";
  display: inline-block;
  margin-left: 1px;
  opacity: 1;
  animation: cursor-blink 0.65s steps(1) infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .chat-center {
    padding: 10px;
  }

  .chat-box {
    border-radius: 12px;
  }

  .message {
    max-width: 94%;
  }

  .suggested-prompts {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 8px 10px 10px;
  }

  .suggested-prompt-card {
    min-height: 0;
  }

  .feedback-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 14px;
    margin-left: 0;
  }

  .feedback-actions-two {
    flex-direction: column;
  }

  .feedback-actions-two .feedback-submit,
  .feedback-actions-two .feedback-secondary {
    width: 100%;
  }
}

/* -----------------------------------------------------------------------
   Login / Blocked pages
   --------------------------------------------------------------------- */

body.login-page {
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-main);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-main);
}

.login-heading {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  margin: 0;
}

.login-sub {
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
  margin-top: -8px;
}

.login-error {
  width: 100%;
  background: #4a1c1c;
  color: #ffbcbc;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.auth-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
}

.auth-field input {
  width: 100%;
}

.auth-field input[readonly] {
  background: #242424;
  color: #bdbdbd;
  cursor: default;
}

.auth-submit {
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  background: #0078d4;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.auth-submit:hover {
  opacity: 0.9;
}

.auth-note {
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.5;
}

.auth-helper {
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.5;
}

.auth-email {
  color: var(--text-main);
  font-weight: 600;
}

/* Blocked page */

.blocked-card {
  gap: 16px;
}

.blocked-icon {
  color: #888;
  width: 56px;
  height: 56px;
}

/* -----------------------------------------------------------------------
   User profile dropdown menu
   --------------------------------------------------------------------- */

.user-menu-wrapper {
  position: relative;
}

.project-dropdown-empty {
  padding: 12px 14px;
  color: #999;
  font-size: 12px;
}

.user-project-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-project-item.active {
  background: #2a2a2a;
  color: #fff;
}

.user-project-name {
  font-size: 13px;
}

.user-project-description {
  font-size: 11px;
  color: #9f9f9f;
}

.user-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0078d4;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  user-select: none;
}

.user-badge:hover {
  background: #106ebe;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 1000;
  overflow: hidden;
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
}

.user-dropdown-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0078d4;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-dropdown-email {
  font-size: 12px;
  color: #aaa;
  word-break: break-all;
}

.user-dropdown-divider {
  border: none;
  border-top: 1px solid #2a2a2a;
  margin: 4px 0;
}

.user-dropdown-section-label {
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  padding: 6px 16px 2px;
  letter-spacing: 0.05em;
}

.user-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 16px;
  background: none;
  border: none;
  color: #d0d0d0;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

.user-dropdown-item:hover {
  background: #2a2a2a;
  color: #fff;
}

.user-dropdown-item.active {
  background: #2a2a2a;
  color: #fff;
}

.user-dropdown-signout {
  color: #e07070;
}

.user-dropdown-signout:hover {
  color: #ff9090;
}

.blocked-icon svg {
  width: 56px;
  height: 56px;
}

.blocked-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
}

.blocked-sub {
  font-size: 14px;
  color: var(--text-soft);
  text-align: center;
}

.blocked-link {
  font-size: 13px;
  color: #888;
  text-decoration: underline;
  margin-top: 4px;
}

.blocked-link:hover {
  color: #bbb;
}

/* User badge (top nav) */

.user-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0078d4;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  user-select: none;
}

.signout-link {
  font-size: 12px;
  color: var(--text-soft);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
}

.signout-link:hover {
  background: #2a2a2a;
  color: var(--text-main);
}

/* ==========================================================================
  Light Theme
  ========================================================================== */

body.light-theme {
  --bg-main: #f5f7fb;
  --bg-panel: #ffffff;
  --bg-chat: #eef3f9;
  --bg-chat-box: #ffffff;
  --line: #d5dce8;
  --text-main: #1e2938;
  --text-soft: #5f6f87;
}

body.light-theme .top-nav {
  background: #f7f9fd;
}

body.light-theme .nav-icon {
  border-color: #aab7cb;
  color: #334155;
}

body.light-theme .nav-icon:hover {
  background: #dfe7f3;
}

body.light-theme .feedback-icon-image {
  filter: brightness(0) saturate(100%) invert(24%) sepia(11%) saturate(1044%) hue-rotate(178deg) brightness(94%) contrast(89%);
}

body.light-theme .chat-header {
  background: #f2f6fd;
}

body.light-theme .messages {
  scrollbar-color: #a8b8cd #e8eef8;
}

body.light-theme .messages::-webkit-scrollbar-track {
  background: #e8eef8;
}

body.light-theme .messages::-webkit-scrollbar-thumb {
  background: #a8b8cd;
  border-color: #e8eef8;
}

body.light-theme .messages::-webkit-scrollbar-thumb:hover {
  background: #8fa3bd;
}

body.light-theme .welcome-title {
  color: #1f2d45;
}

body.light-theme .welcome-subtitle {
  color: #435a7b;
}

body.light-theme .welcome-icon-badge {
  border-color: #b7c7df;
  background: #e7eef9;
  color: #2f476d;
}

body.light-theme .sidebar {
  background: #f5f7fb;
  border-right-color: #d5dce8;
}

body.light-theme .section-title {
  color: #7a8d9f;
}

body.light-theme .sessions-loading {
  color: #9ca3af;
}

body.light-theme .sidebar-resize-handle:hover,
body.light-theme .sidebar-resize-handle.dragging {
  background: #bfd1e3;
}

body.light-theme .list li {
  color: #334155;
}

body.light-theme .list li:hover,
body.light-theme .list li.active {
  background: #e7eef8;
}

body.light-theme .chat-search-icon {
  color: #94a3b8;
}

body.light-theme .new-chat-button {
  border-color: #dde6f4;
  color: #334155;
}

body.light-theme .new-chat-button:hover {
  background: #f0f4fb;
  border-color: #bfd1e3;
  color: #1f2937;
}

body.light-theme .chat-search-input {
  background: #f8fafc;
  border-color: #dde6f4;
  color: #334155;
}

body.light-theme .chat-search-input::placeholder {
  color: #9ca3af;
}

body.light-theme .chat-search-input:focus {
  background: #ffffff;
  border-color: #bfd1e3;
}

body.light-theme .chat-filter-button {
  background-color: transparent;
  border-color: #dde6f4;
  color: #334155;
}

body.light-theme .chat-filter-button:hover,
body.light-theme .chat-filter-button[aria-expanded="true"],
body.light-theme .chat-filter-button.filtered,
body.light-theme .chat-filter-button:focus {
  background-color: #f0f4fb;
  border-color: #bfd1e3;
}

body.light-theme .chat-filter-menu {
  background: #ffffff;
  border-color: #d6e0ee;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

body.light-theme .chat-filter-option {
  color: #1f2937;
}

body.light-theme .chat-filter-option:hover,
body.light-theme .chat-filter-option.active {
  background: #f1f5f9;
}

body.light-theme .chat-filter-option-all-icon {
  color: #64748b;
}

body.light-theme .agent-picker-dialog {
  background: #ffffff;
  border-color: #d6e0ee;
  box-shadow: 0 20px 44px rgba(30, 41, 59, 0.18);
}

body.light-theme .agent-picker-header h3 {
  color: #1f2937;
}

body.light-theme .agent-picker-description {
  color: #64748b;
}

body.light-theme .agent-picker-item {
  color: #1f2937;
}

body.light-theme .agent-picker-item:hover,
body.light-theme .agent-picker-item.active {
  background: #f1f5f9;
  border-color: #d6e0ee;
}

body.light-theme .agent-picker-item .item-label {
  color: #1f2937;
}

body.light-theme .agent-picker-close,
body.light-theme .agent-picker-cancel {
  border-color: #d6e0ee;
  color: #334155;
}

body.light-theme .agent-picker-close:hover,
body.light-theme .agent-picker-cancel:hover {
  background: #f1f5f9;
}

body.light-theme .session-meta {
  color: #64748b;
}

body.light-theme .session-actions-trigger {
  color: #5b6472;
}

body.light-theme .session-actions-trigger:hover,
body.light-theme .session-actions-trigger[aria-expanded="true"] {
  background: #f0f4fb;
  border-color: #cfd9e7;
}

body.light-theme .session-actions-menu {
  background: #ffffff;
  border-color: #d6e0ee;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

body.light-theme .session-actions-item {
  color: #1f2937;
}

body.light-theme .session-actions-item:hover {
  background: #f1f5f9;
}

body.light-theme .session-actions-item.delete {
  color: #b4232c;
}

body.light-theme .session-actions-item.delete:hover {
  background: #fef2f2;
  color: #991b1b;
}

body.light-theme .session-dialog {
  background: #ffffff;
  border-color: #d6e0ee;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

body.light-theme .session-dialog-header h3 {
  color: #1f2937;
}

body.light-theme .session-dialog-close {
  border-color: #cfd9e7;
  color: #475569;
}

body.light-theme .session-dialog-close:hover {
  background: #f1f5f9;
}

body.light-theme .session-dialog-description,
body.light-theme .session-dialog-label {
  color: #64748b;
}

body.light-theme .session-dialog-input {
  background: #f8fafc;
  border-color: #dde6f4;
  color: #334155;
}

body.light-theme .session-dialog-cancel {
  background: #e2e8f0;
  color: #1f2937;
}

body.light-theme .session-dialog-cancel:hover {
  background: #cfd8e3;
}

body.light-theme .session-dialog-confirm.danger {
  background: #b4232c;
}

body.light-theme .session-dialog-confirm.danger:hover {
  background: #991b1b;
}

body.light-theme .message.user {
  background: #1f3b67;
  color: #f8fbff;
}

body.light-theme .message.bot {
  background: #e8eef7;
  color: #1a2535;
}

body.light-theme .message.bot th,
body.light-theme .message.bot td {
  border-color: #c5d0e0;
  color: #1a2535;
}

body.light-theme .message.bot th {
  background: #cad5e8;
  color: #0f1b2d;
}

body.light-theme .message.bot tr:nth-child(even) td {
  background: #dde6f4;
}

body.light-theme .message.bot tr:nth-child(odd) td {
  background: #edf2fb;
}

body.light-theme .message.bot code {
  background: #f0f4fb;
  border-color: #c5d0e0;
  color: #1a2535;
}

body.light-theme .message.bot pre {
  background: #f0f4fb;
  border-color: #c5d0e0;
}

body.light-theme .message.bot a {
  color: #1a56b0;
}

body.light-theme input {
  background: #f4f7fc;
  color: #1f2937;
  border: 1px solid #ccd8ea;
}

body.light-theme .send {
  background: #2b5ea8;
}

body.light-theme .send:hover {
  background: #244f8f;
}

body.light-theme .suggested-prompts {
  background: #f6f9ff;
}

body.light-theme .suggested-prompt-card {
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fd 100%);
  border-color: #cfdaed;
  color: #21324f;
}

body.light-theme .suggested-prompt-card:hover {
  border-color: #9fb4d8;
  background: linear-gradient(180deg, #ffffff 0%, #eef3fb 100%);
}

body.light-theme .suggested-prompt-text {
  color: #2a3e61;
}

body.light-theme .user-badge {
  background: #2b5ea8;
}

body.light-theme .user-badge:hover {
  background: #244f8f;
}

body.light-theme .user-dropdown {
  background: #ffffff;
  border-color: #d6e0ee;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

body.light-theme .user-dropdown-email {
  color: #6f8098;
}

body.light-theme .user-dropdown-divider {
  border-top-color: #e1e8f2;
}

body.light-theme .user-dropdown-section-label,
body.light-theme .user-project-description,
body.light-theme .project-dropdown-empty {
  color: #7b8ba1;
}

body.light-theme .user-dropdown-item,
body.light-theme .user-project-item {
  color: #22324a;
}

body.light-theme .user-dropdown-item:hover,
body.light-theme .user-project-item:hover {
  background: #f1f5fb;
  color: #1f2d45;
}

body.light-theme .user-dropdown-item.active {
  background: #e8effb;
  color: #1f2d45;
}

body.light-theme .user-model-item.active,
body.light-theme .user-organization-item.active,
body.light-theme .user-project-item.active {
  background: #e8effb;
  color: #1f2d45;
}

body.light-theme .user-dropdown-signout {
  color: #c43b46;
}

body.light-theme .user-dropdown-signout:hover {
  background: #fef1f2;
  color: #a22a33;
}

body.light-theme .feedback-dialog {
  background: #ffffff;
  border-color: #d3dceb;
  box-shadow: 0 20px 44px rgba(30, 41, 59, 0.22);
}

body.light-theme .feedback-backdrop {
  background: rgba(44, 62, 85, 0.35);
}

body.light-theme .feedback-header h3 {
  color: #1f2d45;
}

body.light-theme .feedback-close {
  border-color: #c4d0e3;
  color: #334155;
}

body.light-theme .feedback-close:hover {
  background: #eff4fd;
}

body.light-theme .feedback-textarea {
  border-color: #cbd8ea;
  background: #f8fbff;
  color: #1f2d45;
}

body.light-theme .feedback-file {
  border-color: #b8c7df;
  background: #f7faff;
  color: #304764;
}

body.light-theme .feedback-preview {
  border-color: #c3d1e7;
  background: #f7fbff;
}

body.light-theme .feedback-error {
  background: #fde8e8;
  color: #8f1f1f;
}

body.light-theme .feedback-secondary {
  background: #e8edf7;
  color: #1f2d45;
}

body.light-theme .feedback-secondary:hover {
  background: #dde6f5;
}

body.light-theme .feedback-thankyou-title {
  color: #1f2d45;
}
