.chat-body {
  height: 100vh;
  overflow: hidden;
  background-color: transparent;
}

.chat-shell {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  width: 100%;
}

.chat-body .backdrop {
  transition: opacity 1.4s ease;
}
.chat-body .backdrop-grain,
.chat-body .beam {
  transition: opacity 1.2s ease;
}
.chat-body.backdrop-settled .aurora {
  animation-play-state: running;
  transition:
    opacity 2.5s ease,
    transform 2.5s ease;
  opacity: 0.6;
}
.chat-body.backdrop-settled .beam {
  opacity: 0.5;
}
.chat-body.backdrop-settled .backdrop-grain {
  opacity: 0.12;
}
.chat-body.backdrop-settled #constellation {
  opacity: 0.55;
  transition: opacity 2.5s ease;
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  width: 280px;
  min-width: 280px;
  height: 100%;
  padding: 1rem 0.75rem;
  background-color: color-mix(in oklab, var(--card) 68%, transparent);
  backdrop-filter: blur(20px);
  color: var(--foreground);
  border-right: 1px solid var(--border);
  box-shadow: 1px 0 0 color-mix(in oklab, var(--background) 40%, transparent);
  transition: margin-left 0.3s ease;
  z-index: 40;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem 1rem;
}

.sidebar-brand img {
  width: 195px;
  display: block;
}

.sidebar-collapse-btn,
.mobile-sidebar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.sidebar-collapse-btn:hover,
.mobile-sidebar-btn:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}
.sidebar-collapse-btn i,
.mobile-sidebar-btn i {
  width: 1.15rem;
  height: 1.15rem;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.4rem;
  border: 1px solid transparent;
  border-radius: 0.85rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.new-chat-btn:hover {
  transform: translateY(-1px);
}
.new-chat-btn .icon {
  width: 1rem;
  height: 1rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.sidebar-item:hover {
  background-color: var(--accent);
  /* color: var(--accent-foreground); */
}
.sidebar-item .icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.sidebar-section-label {
  margin: 1.1rem 0.85rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ember);
}

.chat-history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-bottom: 0.5rem;
}
.chat-history-list::-webkit-scrollbar {
  width: 6px;
}
.chat-history-list::-webkit-scrollbar-thumb {
  background-color: var(--navy-100);
  border-radius: 999px;
}

.history-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: 2.8rem;
  padding: 0.6rem 0.85rem;
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.history-item span.history-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item:hover {
  background-color: var(--muted);
  color: var(--foreground);
}
.history-item.active {
  background-color: var(--ember);
  color: var(--background);
  font-weight: bold;
}
.history-item .history-delete {
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1rem;
  border: none;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--muted-foreground);
  flex-shrink: 0;
  cursor: pointer;
}
.history-item:hover .history-delete {
  display: inline-flex;
}
.history-item .history-delete:hover {
  background-color: color-mix(in oklab, var(--ember) 18%, transparent);
  color: var(--ember);
}
.history-item .history-delete i {
  width: 0.9rem;
  height: 0.9rem;
}

.sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  color: var(--muted-foreground);
  text-align: center;
}
.sidebar-empty .icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--primary);
}
.sidebar-empty p {
  font-size: 0.8rem;
}

.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.account-item {
  gap: 0.65rem;
}
.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.6rem;
  color: var(--primary-foreground);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.account-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}
.account-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-plan {
  font-size: 0.7rem;
  color: var(--muted-foreground);
}
.account-chevron {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background-color: color-mix(in oklab, var(--navy-900) 45%, transparent);
}
.sidebar-scrim.active {
  display: block;
}

.chat-main {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  background-color: color-mix(in oklab, var(--background) 55%, transparent);
  backdrop-filter: blur(6px);
}

.chat-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background-color: color-mix(in oklab, var(--background) 45%, transparent);
  backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.mobile-sidebar-btn {
  display: none;
  color: var(--foreground);
}

.chat-topbar-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-topbar-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.6rem;
  color: var(--muted-foreground);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.chat-topbar-exit:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}
.chat-topbar-exit i {
  width: 1.1rem;
  height: 1.1rem;
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem 8rem;
}

.chat-empty-state {
  max-width: 42rem;
  margin: 3rem auto 0;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  animation: chatFadeIn 0.6s ease forwards;
}
.empty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  background-color: var(--accent);
  color: var(--accent-foreground);
  box-shadow: var(--shadow-glow);
}
.empty-badge .icon {
  width: 1.5rem;
  height: 1.5rem;
}
.chat-empty-state h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--foreground);
}
.chat-empty-state .lede {
  max-width: 34rem;
  margin: 1rem auto 0;
}

.prompt-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
  text-align: left;
}
@media (max-width: 640px) {
  .prompt-suggestions {
    grid-template-columns: 1fr;
  }
}
.prompt-chip {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background-color: color-mix(in oklab, var(--card) 60%, transparent);
  backdrop-filter: blur(8px);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.prompt-chip:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--primary) 40%, transparent);
  box-shadow: var(--shadow-lift);
}
.prompt-chip .icon-sm {
  width: 1rem;
  height: 1rem;
  color: var(--primary);
  flex-shrink: 0;
}

/* ============ MESSAGE LIST ============ */
.message-list {
  max-width: 65rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-block: 0.5rem;
}

.msg {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(14px);
  animation: chatFadeIn 0.4s ease forwards;
}

.msg.user {
  flex-direction: row-reverse;
}

/* ---------- avatar ---------- */
.msg-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 0.7rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.msg-avatar i {
  width: 1rem;
  height: 1rem;
}

.msg.user .msg-avatar {
  background-color: var(--navy-900);
  color: var(--background);
}

.msg.assistant .msg-avatar {
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-glow);
}

/* ---------- content column ---------- */
.msg-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: min(78%, 62ch);
  min-width: 0;
}

.msg.user .msg-content {
  align-items: flex-end;
}

/* ---------- bubble ---------- */
.msg-bubble {
  padding: 0.85rem 1.1rem;
  border-radius: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.msg.user .msg-bubble {
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-glow);
  border-top-right-radius: 0.35rem;
}

/* .msg.assistant .msg-bubble {
  background-color: color-mix(in oklab, var(--card) 88%, transparent);
  color: var(--foreground);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  border-top-left-radius: 0.35rem;
  box-shadow:
    0 1px 2px color-mix(in oklab, var(--navy-900) 5%, transparent),
    0 12px 30px -22px color-mix(in oklab, var(--navy-900) 35%, transparent);
} */

.msg.assistant.interrupted .msg-bubble {
  border-style: dashed;
  background-color: color-mix(in oklab, var(--muted) 60%, transparent);
}

/* ---------- interrupted label ---------- */
.msg-interrupted {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
  padding-left: 0.15rem;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--muted-foreground);
}

.msg-interrupted i {
  width: 0.8rem;
  height: 0.8rem;
}

/* ---------- attachments ---------- */
.msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.msg-attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border-radius: 0.5rem;
  background-color: color-mix(in oklab, currentColor 12%, transparent);
  font-size: 0.7rem;
}

.msg-attachment i {
  width: 0.75rem;
  height: 0.75rem;
}

/* ---------- thinking indicator ---------- */
.msg.thinking .msg-bubble {
  display: inline-flex;
  align-items: center;
  padding: 0.9rem 1.15rem;
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 0.85rem;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
  opacity: 0.45;
  animation: thinkingBounce 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.thinking-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes thinkingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.msg-actions-image {
  margin-top: -1.5rem;
  padding-left: 0.45rem;
}

.msg-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: -0.55rem;
  padding-left: 1rem;
  opacity: 1;
  transform: translateY(-3px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.msg-action svg {
  width: 20px;
}
.msg.assistant:focus-within .msg-actions {
  opacity: 1;
  transform: none;
}

@media (hover: none) {
  .msg-actions {
    opacity: 1;
    transform: none;
  }
}

.msg-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.msg-action:hover {
  color: var(--primary);
}

.msg-action i {
  width: 0.85rem;
  height: 0.85rem;
}

.msg-action.is-copied {
  color: var(--primary);
  background: var(--accent);
}

.chat-composer-wrap {
  flex-shrink: 0;
  padding: 0.75rem 1.5rem 1.25rem;
  background: linear-gradient(
    to top,
    color-mix(in oklab, var(--background) 55%, transparent) 60%,
    transparent
  );
}

.chat-composer {
  max-width: 46rem;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.6rem 0.6rem 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  background-color: color-mix(in oklab, var(--card) 78%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lift);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.chat-composer:focus-within {
  border-color: color-mix(in oklab, var(--primary) 45%, transparent);
  box-shadow: var(--shadow-glow);
}

.composer-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border: none;
  border-radius: 0.7rem;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.composer-icon-btn:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}
.composer-icon-btn i {
  width: 1.15rem;
  height: 1.15rem;
}

.composer-input {
  flex: 1;
  max-height: 10rem;
  padding: 0.5rem 0.25rem;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--foreground);
}
.composer-input::placeholder {
  color: var(--muted-foreground);
}

.composer-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border: none;
  border-radius: 0.7rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    box-shadow 0.15s ease;
}
.composer-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.composer-send-btn:not(:disabled) {
  box-shadow: var(--shadow-glow);
}
.composer-send-btn:not(:disabled):hover {
  transform: translateY(-1px);
}
.composer-send-btn i {
  width: 1.05rem;
  height: 1.05rem;
}

.composer-hint {
  max-width: 46rem;
  margin: 0.6rem auto 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted-foreground);
}

@media (max-width: 900px) {
  .chat-sidebar {
    position: fixed;
    inset-block: 0;
    left: 0;
    margin-left: -280px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  }
  .chat-sidebar.mobile-open {
    margin-left: 0;
  }
  .sidebar-collapse-btn {
    display: none;
  }
  .mobile-sidebar-btn {
    display: inline-flex;
  }
}

@media (max-width: 560px) {
  .chat-scroll {
    padding: 1.25rem 1rem 1rem;
  }
  .chat-composer-wrap {
    padding: 0.6rem 1rem 1rem;
  }
  .msg-bubble {
    max-width: 88%;
  }
}

@keyframes chatFadeIn {
  to {
    opacity: 1;
    transform: none;
  }
}

.splat-thinking {
  width: 100%;
  height: 100%;
  display: block;
}

.thinking-shimmer {
  background: linear-gradient(
    90deg,
    var(--navy-400) 0%,
    var(--ember) 50%,
    var(--navy-400) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 1.6s linear infinite;
  font-weight: 500;
  font-family: var(--font-sans);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.4rem 0.2rem;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splat-thinking .splat-layer,
  .splat-thinking text,
  .typing-dots span {
    animation: none !important;
  }
}

/* ============ COMPOSER SHELL ============ */
.chat-composer-wrap {
  flex-shrink: 0;
  padding: 0.75rem 1.5rem 1.25rem;
  background: linear-gradient(
    to top,
    color-mix(in oklab, var(--background) 62%, transparent) 60%,
    transparent
  );
}

/* ============ PROMPT BAR ============ */
.prompt-bar {
  --pb-bg: color-mix(in oklab, var(--card) 84%, transparent);
  --pb-ink: var(--foreground);
  --pb-menu: color-mix(in oklab, var(--card) 97%, transparent);
  --pb-spark: var(--primary);
  --pb-hover: color-mix(in oklab, var(--foreground) 7%, transparent);
  --pb-muted: color-mix(in oklab, var(--foreground) 52%, transparent);
  --pb-ease: cubic-bezier(0.23, 1, 0.32, 1);

  position: relative;
  width: min(46rem, 100%);
  margin: 0 auto;
  color: var(--pb-ink);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 22px;
}

/* ---------- popover menu ---------- */
.prompt-bar__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 30;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--pb-menu);
  backdrop-filter: blur(20px);
  box-shadow:
    var(--shadow-lift),
    0 10px 30px -12px color-mix(in oklab, var(--navy-900) 35%, transparent);
  transform-origin: bottom center;
  animation: prompt-bar-pop 180ms var(--pb-ease) both;
}
.prompt-bar__menu[data-kind="model"] {
  right: auto;
  width: 15rem;
  transform-origin: bottom left;
}
.prompt-bar__menu[data-kind="effort"] {
  right: auto;
  width: 15.5rem;
  padding: 12px 14px 14px;
  transform-origin: bottom left;
}

@keyframes prompt-bar-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

.prompt-bar__row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 140ms ease;
}
.prompt-bar__row[aria-selected="true"] {
  background: var(--accent);
}
.prompt-bar__row-icon {
  display: inline-flex;
  flex: none;
  justify-content: center;
  width: 20px;
  color: var(--pb-muted);
}
.prompt-bar__row-icon i {
  width: 15px;
  height: 15px;
}
.prompt-bar__row-name {
  flex: none;
  font-size: 0.85rem;
  font-weight: 500;
}
.prompt-bar__row-desc {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--pb-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.prompt-bar__row-tag {
  flex: none;
  margin-left: auto;
  color: var(--pb-muted);
  font-size: 0.7rem;
}
.prompt-bar__row-check {
  display: inline-flex;
  flex: none;
  justify-content: center;
  width: 16px;
  opacity: 0;
  color: var(--primary);
}
.prompt-bar__row-check[data-on] {
  opacity: 1;
}
.prompt-bar__row-check i {
  width: 13px;
  height: 13px;
}
.prompt-bar__empty {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 10px;
  color: var(--pb-muted);
  font-size: 0.78rem;
}

/* ---------- effort slider ---------- */
.prompt-bar__effort-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  line-height: 18px;
}
.prompt-bar__effort-title {
  color: var(--pb-muted);
}
.prompt-bar__effort-level {
  font-weight: 600;
  color: var(--primary);
}
.prompt-bar__effort-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--pb-muted);
  font-size: 0.72rem;
  line-height: 16px;
}
.prompt-bar__effort-track {
  position: relative;
  height: 22px;
  margin-top: 8px;
  border-radius: 11px;
  background: var(--pb-hover);
  cursor: pointer;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.prompt-bar__effort-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--pb-effort-fill, 50%);
  border-radius: 11px;
  background: color-mix(in oklab, var(--foreground) 16%, transparent);
  transition:
    width 220ms var(--pb-ease),
    background-color 300ms ease;
}
.prompt-bar__effort-dot {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--foreground) 28%, transparent);
}
.prompt-bar__effort-thumb {
  position: absolute;
  top: -3px;
  left: var(--pb-effort-x, 50%);
  width: 14px;
  height: 28px;
  margin-left: -7px;
  border-radius: 7px;
  background: var(--pb-ink);
  box-shadow: 0 2px 6px color-mix(in oklab, var(--navy-900) 30%, transparent);
  transition:
    left 220ms var(--pb-ease),
    background-color 300ms ease;
}
.prompt-bar[data-max] .prompt-bar__effort-fill {
  background: color-mix(in oklab, var(--pb-spark) 35%, transparent);
}
.prompt-bar[data-max] .prompt-bar__effort-thumb {
  background: var(--pb-spark);
}

/* ---------- field ---------- */
.prompt-bar__field {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 1.35rem;
  background: var(--pb-bg);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lift);
  cursor: text;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.prompt-bar__field:focus-within {
  border-color: color-mix(in oklab, var(--primary) 45%, transparent);
  box-shadow: var(--shadow-glow);
}
.prompt-bar__field::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(
    140% 120% at 0% 100%,
    color-mix(in oklab, var(--pb-spark) 22%, transparent),
    transparent 62%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}
.prompt-bar__field[data-max]::before {
  opacity: 1;
}
.prompt-bar__sparks {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
}

/* ---------- attachment chips ---------- */
.prompt-bar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prompt-bar__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 4px 0 8px;
  border-radius: 8px;
  background: var(--accent);
  font-size: 0.72rem;
  animation: prompt-bar-pop 200ms var(--pb-ease) both;
}
.prompt-bar__chip i {
  width: 12px;
  height: 12px;
  color: var(--primary);
}
.prompt-bar__chip-name {
  max-width: 9rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.prompt-bar__chip-x {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  transition:
    opacity 120ms ease,
    background-color 120ms ease;
}
.prompt-bar__chip-x:hover {
  background: color-mix(in oklab, var(--foreground) 10%, transparent);
  opacity: 1;
}
.prompt-bar__chip-x i {
  width: 10px;
  height: 10px;
  color: inherit;
}

/* ---------- input ---------- */
.prompt-bar__input {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  line-height: 22px;
  resize: none;
  outline: none;
  overflow-wrap: anywhere;
}
.prompt-bar__input::placeholder {
  color: color-mix(in oklab, var(--foreground) 42%, transparent);
}
@media (pointer: coarse) {
  .prompt-bar__input {
    font-size: 16px;
  }
}

/* ---------- toolbar ---------- */
.prompt-bar__bar {
  display: flex;
  align-items: center;
  gap: 4px;
}
.prompt-bar__spacer {
  flex: 1 1 auto;
}
.prompt-bar__tool,
.prompt-bar__pick,
.prompt-bar__send {
  flex: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.prompt-bar__tool {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  background: transparent;
  color: color-mix(in oklab, var(--foreground) 58%, transparent);
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 160ms var(--pb-ease);
}
.prompt-bar__tool i {
  width: 15px;
  height: 15px;
}
.prompt-bar__tool:active {
  transform: scale(0.94);
}
.prompt-bar__pick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  border-radius: 9px;
  background: transparent;
  color: color-mix(in oklab, var(--foreground) 68%, transparent);
  font-size: 0.75rem;
  font-weight: 500;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}
.prompt-bar__pick i {
  width: 12px;
  height: 12px;
}
.prompt-bar__tool[data-on],
.prompt-bar__pick[data-on] {
  background: var(--accent);
  color: var(--primary);
}
@media (hover: hover) and (pointer: fine) {
  .prompt-bar__tool:hover,
  .prompt-bar__pick:hover {
    background: var(--accent);
    color: var(--primary);
  }
}
.prompt-bar__pick[data-max] {
  color: var(--primary);
}

/* ---------- mic equaliser ---------- */
.prompt-bar__eq {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 13px;
}
.prompt-bar__eq i {
  display: block;
  width: 2.5px;
  height: 100%;
  border-radius: 999px;
  background: currentColor;
  animation: prompt-bar-eq 900ms ease-in-out infinite;
}
.prompt-bar__eq i:nth-child(2) {
  animation-delay: 150ms;
}
.prompt-bar__eq i:nth-child(3) {
  animation-delay: 300ms;
}
@keyframes prompt-bar-eq {
  0%,
  100% {
    transform: scaleY(0.35);
  }
  50% {
    transform: scaleY(1);
  }
}

/* ---------- send / stop ---------- */
.prompt-bar__send {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  background: color-mix(in oklab, var(--foreground) 10%, transparent);
  color: color-mix(in oklab, var(--foreground) 45%, transparent);
  transition:
    background-color 200ms ease,
    color 200ms ease,
    transform 160ms var(--pb-ease);
}
.prompt-bar__send:disabled {
  cursor: default;
}
.prompt-bar__send[data-armed] {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-glow);
}
.prompt-bar__send[data-pressed] {
  transform: scale(0.94);
}
.prompt-bar__glyph {
  display: block;
  width: 16px;
  height: 16px;
  transform-origin: 50% 50%;
}

/* ---------- hint ---------- */
.composer-hint {
  max-width: 46rem;
  margin: 0.6rem auto 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted-foreground);
}

@media (prefers-reduced-motion: reduce) {
  .prompt-bar__menu,
  .prompt-bar__chip {
    animation: none;
  }
  .prompt-bar__effort-fill,
  .prompt-bar__effort-thumb {
    transition: background-color 300ms ease;
  }
  .prompt-bar__tool:active,
  .prompt-bar__send[data-pressed] {
    transform: none;
  }
}

/* ============ SIDEBAR (base) ============ */
.chat-sidebar {
  display: flex;
  flex-direction: column;
  width: 280px;
  min-width: 280px;
  height: 100%;
  padding: 1rem 0.75rem;
  background-color: color-mix(in oklab, var(--card) 68%, transparent);
  backdrop-filter: blur(20px);
  color: var(--foreground);
  border-right: 1px solid var(--border);
  box-shadow: 1px 0 0 color-mix(in oklab, var(--background) 40%, transparent);
  z-index: 40;
  overflow: hidden;
  transition:
    width 0.3s ease,
    min-width 0.3s ease,
    padding 0.3s ease,
    border-right-width 0.3s ease;
}

/* Desktop: collapsed = truly zero-width */
@media (min-width: 901px) {
  .chat-sidebar.collapsed {
    width: 0;
    min-width: 0;
    padding-inline: 0;
    border-right-width: 0;
    box-shadow: none;
  }
}

/* Mobile: off-canvas drawer, .collapsed is neutralised */
@media (max-width: 900px) {
  .chat-sidebar {
    position: fixed;
    inset-block: 0;
    left: 0;
    margin-left: -280px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
    transition: margin-left 0.3s ease;
    overflow: visible;
  }
  .chat-sidebar.mobile-open {
    margin-left: 0;
  }
  .chat-sidebar.collapsed {
    width: 280px;
    min-width: 280px;
    padding: 1rem 0.75rem;
    border-right-width: 1px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  }
  .sidebar-collapse-btn {
    display: none;
  }
}

/* ============ TOPBAR ============ */
.chat-topbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background-color: color-mix(in oklab, var(--background) 45%, transparent);
  backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.chat-topbar-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 0.6rem;
  transition: background-color 0.2s ease;
}

.chat-topbar-brand img {
  width: 2.5rem;
  height: 2rem;
  display: block;
}

.chat-topbar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.chat-topbar-toggle:hover {
  background-color: var(--accent);
  color: var(--primary);
}
.chat-topbar-toggle i {
  width: 1.1rem;
  height: 1.1rem;
}

.chat-topbar-title {
  flex: 1;
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 0.5rem;
  outline: none;
  cursor: text;
  transition: background-color 0.15s ease;
}
.chat-topbar-title:hover {
  background-color: color-mix(in oklab, var(--foreground) 4%, transparent);
}
.chat-topbar-title[contenteditable="true"] {
  background-color: var(--accent);
  color: var(--primary);
  text-overflow: clip;
  cursor: text;
}
/* ============ TOPBAR VISIBILITY ============ */
/* Desktop: hide brand + toggle while the sidebar is expanded.
   They appear only when the sidebar is collapsed. */
@media (min-width: 901px) {
  .chat-topbar-brand,
  .chat-topbar-toggle {
    display: none;
  }
  .chat-body.sidebar-collapsed .chat-topbar-brand,
  .chat-body.sidebar-collapsed .chat-topbar-toggle {
    display: inline-flex;
  }
}

/* Fix: honour the [hidden] attribute on the sidebar empty state */
.sidebar-empty[hidden] {
  display: none !important;
}

/* Rename button — appears on hover, matches delete button */
.history-item .history-rename {
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--muted-foreground);
  flex-shrink: 0;
  cursor: pointer;
}
.history-item:hover .history-rename {
  display: inline-flex;
}
.history-item .history-rename:hover {
  background-color: color-mix(in oklab, var(--primary) 15%, transparent);
  color: var(--primary);
}
.history-item .history-rename i {
  width: 0.85rem;
  height: 0.85rem;
}

/* Inline rename input — matches sidebar font */
.history-rename-input {
  flex: 1;
  min-width: 0;
  padding: 0.1rem 0.4rem;
  border: 1px solid color-mix(in oklab, var(--primary) 55%, transparent);
  border-radius: 0.4rem;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  line-height: 1.2;
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 15%, transparent);
}

/* ============ ACCOUNT MENU ============ */
.account-menu {
  position: fixed;
  z-index: 100;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background-color: color-mix(in oklab, var(--card) 97%, transparent);
  backdrop-filter: blur(20px);
  box-shadow:
    0 20px 50px -20px color-mix(in oklab, var(--navy-900) 45%, transparent),
    0 1px 2px color-mix(in oklab, var(--navy-900) 8%, transparent);
  transform-origin: bottom left;
  animation: account-menu-pop 180ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes account-menu-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

.account-menu__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.7rem 0.55rem;
}

.account-menu__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.7rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.account-menu__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.account-menu__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu__email {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu__divider {
  height: 1px;
  margin: 0.25rem 0.35rem;
  background-color: var(--border);
}

.account-menu__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.account-menu__item:hover {
  background-color: var(--accent);
  color: var(--primary);
}

.account-menu__item i {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.account-menu__item--danger {
  color: var(--muted-foreground);
}

.account-menu__item--danger:hover {
  background-color: color-mix(in oklab, var(--ember) 15%, transparent);
  color: var(--ember);
}

/* ============ HISTORY ROW ACTIONS ============ */
.history-item .history-actions {
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--muted-foreground);
  flex-shrink: 0;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.history-item:hover .history-actions,
.history-item.menu-open .history-actions,
.history-item.active .history-actions {
  display: inline-flex;
}
.history-item .history-actions:hover,
.history-item.menu-open .history-actions {
  background-color: color-mix(in oklab, var(--foreground) 14%, transparent);
  color: var(--foreground);
  height: 26px;
}
.history-item.active .history-actions {
  color: color-mix(in oklab, var(--background) 80%, transparent);
}
.history-item .history-actions i {
  width: 1rem;
  height: 1rem;
}
@media (hover: none) {
  .history-item .history-actions {
    display: inline-flex;
  }
}

/* Pinned indicator */
.history-item .history-pin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  color: var(--ember);
}
.history-item.active .history-pin-icon {
  color: color-mix(in oklab, var(--background) 85%, transparent);
}
.history-item .history-pin-icon i {
  width: 0.85rem;
  height: 0.85rem;
}

/* ============ HISTORY CONTEXT MENU ============ */
.history-menu {
  position: fixed;
  z-index: 120;
  min-width: 11rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background-color: color-mix(in oklab, var(--card) 97%, transparent);
  backdrop-filter: blur(20px);
  box-shadow:
    0 20px 50px -20px color-mix(in oklab, var(--navy-900) 45%, transparent),
    0 1px 2px color-mix(in oklab, var(--navy-900) 8%, transparent);
  animation: history-menu-pop 160ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes history-menu-pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
  }
}

.history-menu__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.history-menu__item:hover {
  background-color: var(--accent);
  color: var(--primary);
}
.history-menu__item i {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}
.history-menu__item--danger {
  color: var(--muted-foreground);
}
.history-menu__item--danger:hover {
  background-color: color-mix(in oklab, var(--ember) 15%, transparent);
  color: var(--ember);
}

.history-menu__divider {
  height: 1px;
  margin: 0.25rem 0.35rem;
  background-color: var(--border);
}

/* ============================================================
   MARKDOWN BODY  (assistant messages)
   ============================================================ */
.md-body {
  /* kill the bubble's pre-wrap — markdown HTML needs normal flow */
  white-space: normal;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--foreground);
  overflow-wrap: break-word;
  word-break: normal;
}

/* Trim outer margins so bubbles don't have dead space */
.md-body > *:first-child {
  margin-top: 0;
}
.md-body > *:last-child {
  margin-bottom: 0;
}

/* ---------- headings ---------- */
.md-body h1,
.md-body h2,
.md-body h3,
.md-body h4,
.md-body h5,
.md-body h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--foreground);
  margin: 1.3em 0 0.55em;
}
.md-body h1 {
  font-size: 1.4rem;
}
.md-body h2 {
  font-size: 1.22rem;
}
.md-body h3 {
  font-size: 1.08rem;
}
.md-body h4 {
  font-size: 0.98rem;
}
.md-body h5 {
  font-size: 0.92rem;
}
.md-body h6 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}

/* ---------- paragraphs ---------- */
.md-body p {
  margin: 0.75em 0;
}

/* ---------- links ---------- */
.md-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: text-decoration-thickness 0.15s ease;
}
.md-body a:hover {
  text-decoration-thickness: 2px;
}

/* ---------- strong / em / del ---------- */
.md-body strong {
  font-weight: 700;
  color: var(--foreground);
}
.md-body em {
  font-style: italic;
}
.md-body del {
  text-decoration: line-through;
  opacity: 0.65;
}

/* ---------- inline code ---------- */
.md-body .md-code {
  padding: 0.12em 0.42em;
  margin: 0 0.05em;
  border-radius: 0.4rem;
  background: color-mix(in oklab, var(--foreground) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--foreground) 6%, transparent);
  font-family: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  color: color-mix(in oklab, var(--foreground) 92%, transparent);
}

/* user bubble inline code (inverted colors on ember bg) */
.msg.user .msg-bubble .md-code {
  background: color-mix(in oklab, var(--primary-foreground) 20%, transparent);
  border-color: color-mix(in oklab, var(--primary-foreground) 14%, transparent);
  color: var(--primary-foreground);
}

/* ---------- code block ---------- */
.md-codeblock {
  margin: 1em 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: color-mix(in oklab, var(--navy-900) 5%, transparent);
  overflow: hidden;
}
.md-codeblock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.85rem;
  background: color-mix(in oklab, var(--foreground) 5%, transparent);
  border-bottom: 1px solid var(--border);
}
.md-codeblock__lang {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.md-codeblock__copy {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  background: transparent;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.md-codeblock__copy:hover,
.md-codeblock__copy.is-copied {
  color: var(--primary);
  border-color: color-mix(in oklab, var(--primary) 45%, transparent);
  background: var(--accent);
}

.md-pre {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.62;
  color: var(--foreground);
  tab-size: 2;
}
.md-pre code {
  font-family: inherit;
  white-space: pre;
  background: none;
  border: 0;
  padding: 0;
}

/* scrollbar for long code blocks */
.md-pre::-webkit-scrollbar {
  height: 8px;
}
.md-pre::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--foreground) 20%, transparent);
  border-radius: 999px;
}

/* ---------- lists ---------- */
.md-body ul,
.md-body ol {
  margin: 0.75em 0;
  padding-left: 1.6em;
}
.md-body ul {
  list-style: disc;
}
.md-body ol {
  list-style: decimal;
}
.md-body li {
  margin: 0.3em 0;
  padding-left: 0.15em;
  line-height: 1.7;
}
.md-body li::marker {
  color: var(--primary);
  font-weight: 600;
}
.md-body ul ul,
.md-body ul ol,
.md-body ol ul,
.md-body ol ol {
  margin: 0.3em 0;
}

/* ---------- blockquote ---------- */
.md-body blockquote {
  margin: 1em 0;
  padding: 0.65em 1em;
  border-left: 3px solid var(--primary);
  border-radius: 0 0.55rem 0.55rem 0;
  background: color-mix(in oklab, var(--primary) 6%, transparent);
  color: var(--muted-foreground);
  font-style: italic;
}
.md-body blockquote p {
  margin: 0.35em 0;
}
.md-body blockquote > *:first-child {
  margin-top: 0;
}
.md-body blockquote > *:last-child {
  margin-bottom: 0;
}

/* ---------- horizontal rule ---------- */
.md-body hr {
  margin: 1.5em 0;
  border: none;
  height: 1px;
  background: var(--border);
}

/* ---------- table ---------- */
.md-table-wrap {
  margin: 1em 0;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  overflow: hidden auto;
  max-width: 100%;
}
.md-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.md-table-wrap th,
.md-table-wrap td {
  padding: 0.6rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.md-table-wrap th {
  background: color-mix(in oklab, var(--foreground) 5%, transparent);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.md-table-wrap tr:last-child td {
  border-bottom: none;
}
.md-table-wrap tr:hover td {
  background: color-mix(in oklab, var(--primary) 4%, transparent);
}

/* ---------- images ---------- */
.md-img {
  display: block;
  max-width: 60%;
  height: auto;
  margin: 0.9em 0;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
}

/* ---------- thinking dots inside md-body ---------- */
.md-body .thinking-dots {
  margin: 0.15rem 0;
}

/* ============================================================
   REASONING PANEL — slightly tighter markdown
   ============================================================ */
/* ============================================================
   THINKING / REASONING — redesigned (text-only, no SVG)
   ============================================================ */

/* ---------- collapsible reasoning block ---------- */
.msg-reasoning {
  margin-bottom: -0.6rem;
  /* border: 1  px solid var(--border); */
  /* border-left: 3px solid var(--primary); */
  border-radius: 0.75rem;
  /* background-color: color-mix(in oklab, var(--muted) 55%, transparent); */
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.msg-reasoning[open] {
  background-color: color-mix(in oklab, var(--muted) 60%, transparent);
}
.msg-reasoning__body {
  max-height: 260px;
  overflow-y: auto;
}
.msg-reasoning.is-live {
  border-left: 3px solid var(--primary);
}

.msg-reasoning summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  list-style: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted-foreground);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: color 0.15s ease;
}
.msg-reasoning summary::-webkit-details-marker {
  display: none;
}
.msg-reasoning summary:hover {
  color: var(--primary);
}

.msg-reasoning summary::before {
  content: "";
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent currentColor;
  opacity: 0.6;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.msg-reasoning[open] summary::before {
  transform: rotate(90deg);
  opacity: 0.9;
}

.msg-reasoning summary i[data-lucide="brain"] {
  display: none;
}

.msg-reasoning summary span {
  line-height: 1;
}

.msg-reasoning.is-live summary span::after {
  content: "";
  display: inline-block;
  width: 1.1em;
  text-align: left;
  animation: reasoning-ellipsis 1.2s steps(4, end) infinite;
}

@keyframes reasoning-ellipsis {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
  100% {
    content: "";
  }
}

.msg-reasoning__body {
  padding: 0 0.95rem 0.9rem 1.35rem;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--muted-foreground);
  border-top: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  margin-top: -0.05rem;
  padding-top: 0.7rem;
}
.msg-reasoning__body > *:first-child {
  margin-top: 0;
}
.msg-reasoning__body > *:last-child {
  margin-bottom: 0;
}

/* ---------- pre-text "thinking" loading state (no text yet) ---------- */
.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 1.4rem;
  padding: 0.1rem 0;
}
/* 
.thinking-dots::before {
  content: "Thinking";
  font-size: 0.85rem;
  font-weight: 500;
  background: linear-gradient(
    90deg,
    var(--muted-foreground) 0%,
    var(--primary) 50%,
    var(--muted-foreground) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 1.6s linear infinite;
} */

.thinking-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--primary);
  opacity: 0.45;
  animation: thinkingBounce 1.2s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.thinking-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

/* ---------- vertical alignment fix with the assistant avatar ---------- */
.msg.assistant .msg-content {
  padding-top: 0.05rem;
}
.msg.thinking .msg-bubble,
.msg.assistant .msg-bubble:has(.thinking-dots) {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.55rem 1.1rem;
}

@media (prefers-reduced-motion: reduce) {
  .thinking-dots::before,
  .thinking-dots span,
  .msg-reasoning.is-live summary span::after {
    animation: none !important;
  }
}
/* ============================================================
   BUBBLE TWEAKS — give markdown room to breathe
   ============================================================ */
/* ---------- content column — role-aware widths ---------- */
.msg-content {
  max-width: min(78%, 62ch);
}

/* Assistant bubbles get more room — for markdown tables/code/images */
.msg.assistant .msg-content {
  width: 100%;
  max-width: min(94%, 82ch);
}

/* User bubbles stay compact on the right */
.msg.user .msg-content {
  max-width: min(72%, 60ch);
}

/* ---------- assistant bubble ---------- */
.msg.assistant .msg-bubble {
  padding: 1rem 1.15rem;
  font-size: 0.92rem;
  color: var(--foreground); /* was `black` — breaks dark mode */
}
.msg.user .msg-bubble {
  padding: 0.85rem 1.1rem;
}

/* Slightly wider content column so tables/code don't squeeze */
@media (min-width: 700px) {
  .msg-content {
    max-width: min(82%, 68ch);
  }
}

/* ============================================================
   IMAGE GENERATING — dot field loader
   ============================================================ */
.image-loading {
  position: relative;
  width: 260px;
  height: 260px;
  max-width: 100%;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid color-mix(in oklab, var(--navy-200) 60%, #fff);
  background: linear-gradient(
    165deg,
    #fff 0%,
    color-mix(in oklab, var(--navy-50) 88%, #fff) 60%,
    color-mix(in oklab, var(--navy-100) 65%, #fff) 100%
  );
  box-shadow:
    0 1px 2px rgba(19, 24, 51, 0.05),
    0 20px 40px -26px rgba(19, 24, 51, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.image-loading__aura {
  position: absolute;
  inset: -30%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 55%,
    color-mix(in oklab, var(--ember) 22%, transparent),
    transparent 55%
  );
  filter: blur(46px);
  animation: image-aura 9s ease-in-out infinite;
}
.image-loading__aura::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 62% 38%,
    color-mix(in oklab, var(--ember) 18%, transparent),
    transparent 48%
  );
  filter: blur(32px);
  animation: image-aura-b 13s ease-in-out infinite;
}

.image-loading__dots {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(
    ellipse 78% 78% at 50% 50%,
    #000 20%,
    transparent 85%
  );
  mask-image: radial-gradient(
    ellipse 78% 78% at 50% 50%,
    #000 20%,
    transparent 85%
  );
}
.image-loading__dots .d {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ember);
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.image-loading__core {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.image-loading__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--ember);
  background: radial-gradient(
    circle at 32% 28%,
    #fff 0%,
    color-mix(in oklab, var(--ember-soft) 92%, #fff) 60%,
    color-mix(in oklab, var(--ember) 12%, #fff) 100%
  );
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 1px color-mix(in oklab, var(--ember) 22%, transparent),
    0 12px 24px -14px color-mix(in oklab, var(--ember) 55%, transparent);
  animation: image-icon 4.4s ease-in-out infinite;
}
.image-loading__icon svg {
  width: 20px;
  height: 20px;
}
.image-loading__icon::before,
.image-loading__icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--ember) 40%, transparent);
  animation: image-halo 4.4s cubic-bezier(0.25, 0.7, 0.4, 1) infinite;
}
.image-loading__icon::after {
  animation-delay: 2.2s;
}

.image-loading__label {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--card) 85%, transparent);
  backdrop-filter: blur(8px);
  color: var(--muted-foreground);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  z-index: 6;
}

@keyframes image-aura {
  0%,
  100% {
    transform: translate(-6%, -4%) scale(1);
    opacity: 0.7;
  }
  33% {
    transform: translate(7%, 3%) scale(1.12);
    opacity: 1;
  }
  66% {
    transform: translate(2%, 8%) scale(0.94);
    opacity: 0.85;
  }
}
@keyframes image-aura-b {
  0%,
  100% {
    transform: translate(5%, 7%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-8%, -5%) scale(1.18);
    opacity: 0.9;
  }
}
@keyframes image-icon {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}
@keyframes image-halo {
  0% {
    transform: scale(0.85);
    opacity: 0.75;
  }
  70% {
    opacity: 0.1;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

/* ============================================================
   Rendered images — click to zoom
   ============================================================ */
.md-body .md-img {
  cursor: zoom-in;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.md-body .md-img:hover {
  transform: translateY(-1px);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 18px 40px -22px rgba(0, 0, 0, 0.35);
}

/* ============================================================
   Image lightbox
   ============================================================ */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: color-mix(in oklab, var(--navy-900) 82%, transparent);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 220ms ease;
  cursor: zoom-out;
}
.image-lightbox.is-open {
  opacity: 1;
}
.image-lightbox__img {
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.8);
  transform: scale(0.96);
  transition: transform 260ms cubic-bezier(0.23, 1, 0.32, 1);
  cursor: default;
}
.image-lightbox.is-open .image-lightbox__img {
  transform: scale(1);
}
.image-lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background-color 0.15s ease;
}
.image-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.15);
}
.image-lightbox__close i {
  width: 1.1rem;
  height: 1.1rem;
}
.image-lightbox__hint {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.02em;
}

.image-loading {
  position: relative;
  width: 320px; /* was 260px */
  height: 320px; /* was 260px */
  max-width: 100%;
  border-radius: 22px; /* was 18px */
  overflow: hidden;
  isolation: isolate;
  border: 1px solid color-mix(in oklab, var(--navy-200) 60%, #fff);
  background: linear-gradient(
    165deg,
    #fff 0%,
    color-mix(in oklab, var(--navy-50) 88%, #fff) 60%,
    color-mix(in oklab, var(--navy-100) 65%, #fff) 100%
  );
  box-shadow:
    0 1px 2px rgba(19, 24, 51, 0.05),
    0 24px 60px -30px rgba(19, 24, 51, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);

  /* Slow, calm entrance */
  opacity: 0;
  transform: scale(0.88);
  animation: image-loader-in 800ms cubic-bezier(0.23, 1, 0.32, 1) 60ms forwards;
}

@keyframes image-loader-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Icon a touch bigger to match */
.image-loading__icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}
.image-loading__icon svg {
  width: 24px;
  height: 24px;
}

.image-loading__aura {
  background: radial-gradient(
    circle at 50% 55%,
    color-mix(in oklab, var(--ember) 26%, transparent),
    transparent 58%
  );
}

/* Action rail inside the lightbox */
.image-lightbox__actions {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.image-lightbox__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.5rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
}
.image-lightbox__btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}
.image-lightbox__btn:active {
  transform: scale(0.97);
}
.image-lightbox__btn i {
  width: 0.95rem;
  height: 0.95rem;
}
.image-lightbox__btn[data-on] {
  background: color-mix(in oklab, var(--primary) 55%, transparent);
  border-color: color-mix(in oklab, var(--primary) 75%, transparent);
}
.image-lightbox__btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.sidebar-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.6rem 0.25rem 0;
}

.sidebar-search i,
.sidebar-search svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 0.9rem;
  height: 0.9rem;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.sidebar-search input {
  flex: 1;
  width: 100%;
  padding: 0.55rem 0.8rem 0.55rem 2.1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: color-mix(in oklab, var(--card) 70%, transparent);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-search input:focus {
  border-color: color-mix(in oklab, var(--primary) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 12%, transparent);
}
.sidebar-nomatch {
  padding: 1rem 0.85rem;
  font-size: 0.78rem;
  color: var(--muted-foreground);
}
.account-avatar { overflow: hidden; }
.account-menu__avatar { overflow: hidden; }
.account-menu__avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- profile modal ---------- */
.profile-modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: color-mix(in oklab, var(--navy-900) 45%, transparent);
  backdrop-filter: blur(6px);
  animation: chatFadeIn 0.2s ease both;
}
.profile-modal {
  width: min(26rem, 100%);
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  background: color-mix(in oklab, var(--card) 97%, transparent);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  animation: prompt-bar-pop 220ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
.profile-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.profile-modal__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
}
.profile-modal__close {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.profile-modal__close:hover { background: var(--accent); color: var(--primary); }
.profile-modal__close i { width: 1rem; height: 1rem; }

.profile-modal__body {
  display: grid;
  gap: 1.1rem;
  padding: 1.25rem;
}
.profile-avatar {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
}
.profile-avatar__preview {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-glow);
}
.profile-avatar__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar__actions { display: flex; gap: 0.5rem; }
.profile-avatar__hint { font-size: 0.7rem; color: var(--muted-foreground); }

.profile-field { display: grid; gap: 0.35rem; }
.profile-field__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.profile-field__input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.profile-field__input:focus {
  border-color: color-mix(in oklab, var(--primary) 50%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 14%, transparent);
}
.profile-field__input:disabled { opacity: 0.6; cursor: not-allowed; }

.profile-modal__status {
  padding: 0.55rem 0.8rem;
  border-radius: 0.7rem;
  font-size: 0.78rem;
  background: var(--muted);
  color: var(--muted-foreground);
}
.profile-modal__status[data-kind="success"] {
  background: color-mix(in oklab, oklch(68% 0.16 155) 14%, transparent);
  color: oklch(45% 0.12 155);
}
.profile-modal__status[data-kind="error"] {
  background: color-mix(in oklab, var(--ember) 12%, transparent);
  color: var(--ember);
}
.profile-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem 1.1rem;
  border-top: 1px solid var(--border);
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}
.profile-btn i { width: 0.9rem; height: 0.9rem; }
.profile-btn--sm { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
.profile-btn--ghost { border-color: var(--border); background: transparent; color: var(--foreground); }
.profile-btn--ghost:hover { background: var(--muted); }
.profile-btn--primary { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-glow); }
.profile-btn--primary:hover { transform: translateY(-1px); }
.profile-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.account-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1rem 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in oklab, #e4483c 40%, transparent);
  background: color-mix(in oklab, #e4483c 10%, transparent);
  color: color-mix(in oklab, #e4483c 90%, black);
  font-size: 0.9rem;
  line-height: 1.5;
}
.account-banner svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; margin-top: 0.1rem; }
.account-banner strong { display: block; margin-bottom: 0.15rem; }
.account-banner p { margin: 0; opacity: 0.85; font-size: 0.83rem; }

[data-theme="dark"] .account-banner {
  color: #ffb4ac;
  border-color: color-mix(in oklab, #e4483c 45%, transparent);
  background: color-mix(in oklab, #e4483c 14%, transparent);
}

.composer .is-disabled,
#chatInput.is-disabled,
#sendBtn.is-disabled,
#plusBtn.is-disabled,
#effortBtn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.account-banner {
  flex: 0 0 auto;      /* do not shrink or grow */
  order: -1;           /* always first, even if prepended after other elements */
}

.account-banner__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.account-banner__cta {
  margin-top: 0.35rem;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  background: #e4483c;
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
}
.account-banner__cta:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.account-banner__cta svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
}
/* ============================================================
   BLOCKED ACCOUNT OVERLAY
   ============================================================ */

/* Blur + dim the whole app behind the overlay */
body.is-blocked .chat-shell {
  filter: blur(6px) saturate(0.9);
  pointer-events: none;
  user-select: none;
  transition: filter 0.3s ease;
}

/* Backdrop */
.account-banner-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: color-mix(in oklab, var(--navy-900) 45%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: account-banner-fade 240ms ease both;
}

@keyframes account-banner-fade {
  from {
    opacity: 0;
  }
}

/* Card — small, centered, works everywhere */
.account-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;

  width: min(22rem, 100%);
  max-width: 22rem;

  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 97%, transparent);
  color: var(--foreground);
  box-shadow:
    0 30px 70px -30px color-mix(in oklab, var(--navy-900) 55%, transparent),
    0 1px 2px color-mix(in oklab, var(--navy-900) 8%, transparent);

  animation: account-banner-pop 260ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes account-banner-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}

/* Round ember icon at the top */
.account-banner__icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: color-mix(in oklab, #e4483c 14%, transparent);
  color: #e4483c;
  box-shadow:
    inset 0 0 0 1px color-mix(in oklab, #e4483c 25%, transparent),
    0 10px 24px -14px color-mix(in oklab, #e4483c 55%, transparent);
}
.account-banner__icon svg,
.account-banner__icon i {
  width: 1.35rem;
  height: 1.35rem;
  stroke: currentColor;
  fill: none;
}

/* Title */
.account-banner__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

/* Body copy */
.account-banner__text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted-foreground);
}

/* Action row */
.account-banner__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

/* Primary CTA */
.account-banner__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  background: #e4483c;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 12px 24px -14px color-mix(in oklab, #e4483c 65%, transparent);
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.account-banner__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -14px color-mix(in oklab, #e4483c 75%, transparent);
}
.account-banner__cta:active {
  transform: translateY(0);
  opacity: 0.9;
}
.account-banner__cta svg,
.account-banner__cta i {
  width: 0.95rem;
  height: 0.95rem;
  stroke: currentColor;
  fill: none;
}

/* Dark theme tweak */
[data-theme="dark"] .account-banner {
  border-color: color-mix(in oklab, #e4483c 22%, var(--border));
}
[data-theme="dark"] .account-banner__icon {
  background: color-mix(in oklab, #e4483c 22%, transparent);
  color: #ffb4ac;
  box-shadow:
    inset 0 0 0 1px color-mix(in oklab, #e4483c 35%, transparent),
    0 10px 24px -14px color-mix(in oklab, #e4483c 65%, transparent);
}

/* Keep the composer dimming rules (they still apply) */
.composer .is-disabled,
#chatInput.is-disabled,
#sendBtn.is-disabled,
#plusBtn.is-disabled,
#effortBtn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}