/* Nexus AI - premium chat interface */
:root {
  --bg: #050507;
  --bg2: #0a0a0f;
  --bg3: #0f0f18;
  --coral: #ff4c4c;
  --coral2: #ff6b6b;
  --coral-dim: rgba(255, 76, 76, 0.12);
  --coral-glow: rgba(255, 76, 76, 0.35);
  --glass: rgba(255, 255, 255, 0.04);
  --glass2: rgba(255, 255, 255, 0.07);
  --glass3: rgba(255, 255, 255, 0.02);
  --border: rgba(255, 255, 255, 0.06);
  --border2: rgba(255, 76, 76, 0.25);
  --text: #f0f0f0;
  --text2: #9a9a9a;
  --text3: #9a9a9a;
  --user-bg: rgba(255, 76, 76, 0.08);
  --font-h: "Orbitron", sans-serif;
  --font-b: "Rajdhani", sans-serif;
  --font-c: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-lg: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--app-top, 0px);
  height: var(--app-h, 100dvh);
  display: flex;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.01em;
  background-image: radial-gradient(ellipse at top, rgba(255, 76, 76, 0.08), transparent 55%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
}

.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: -0.125em;
  display: inline-block;
}

/* Focus rings */
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
}

.sidebar-overlay.open {
  display: block;
}

/* Sidebar */
.sidebar {
  width: 272px;
  min-width: 272px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s ease;
  z-index: 100;
  position: relative;
}

.sidebar-top {
  padding: 16px 14px 12px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.sidebar-brand svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 6px var(--coral-glow));
}

.sidebar-brand-name {
  font-family: var(--font-h);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.sidebar-brand-name span {
  color: var(--coral);
}

.back-home {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text2);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  min-height: 44px;
  transition: background 0.15s, color 0.15s;
}

.back-home:hover,
.back-home:focus-visible {
  background: var(--glass2);
  color: var(--coral);
}

.back-home svg {
  flex-shrink: 0;
}

.new-chat-btn {
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius);
  transition: background 0.2s, border-color 0.2s;
  min-height: 44px;
}

.new-chat-btn:hover,
.new-chat-btn:focus-visible {
  background: var(--coral-dim);
  border-color: var(--coral);
}

.new-chat-btn svg {
  color: var(--coral);
}

.sidebar-section-label {
  padding: 12px 16px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-b);
}

.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 8px;
}

.chat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

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

.chat-item.active {
  background: var(--coral-dim);
  border-left-color: var(--coral);
}

.chat-item-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.chat-item.active .chat-item-text {
  color: var(--text);
}

.chat-delete {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  font-size: 14px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-item:hover .chat-delete,
.chat-item:focus-within .chat-delete {
  opacity: 1;
}

@media (pointer: coarse) {
  .chat-delete {
    opacity: 1;
  }
}

.chat-delete:hover,
.chat-delete:focus-visible {
  color: var(--coral);
}

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 44px;
  transition: background 0.15s, border-color 0.15s;
}

.wa-card:hover,
.wa-card:focus-visible {
  background: var(--glass2);
  border-color: var(--border2);
}

.wa-card svg {
  color: #25D366;
  flex-shrink: 0;
}

.sidebar-legal {
  display: flex;
  gap: 12px;
  padding: 0 4px;
  font-size: 13px;
  color: var(--text3);
}

.sidebar-legal a {
  color: var(--text3);
  text-decoration: none;
}

.sidebar-legal a:hover,
.sidebar-legal a:focus-visible {
  color: var(--coral);
}

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

/* Topbar */
.topbar {
  min-height: 52px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(5, 5, 7, 0.7);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.hamburger:hover,
.hamburger:focus-visible {
  color: var(--coral);
  background: var(--glass);
}

.back-to-site {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-b);
  font-size: 15px;
  font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 6px 8px;
  border-radius: 8px;
  min-height: 44px;
  align-items: center;
}

.back-to-site:hover,
.back-to-site:focus-visible {
  color: var(--coral);
}

.back-short {
  display: none;
}

.topbar-mobile-brand {
  display: none;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.topbar-mobile-name {
  font-family: var(--font-h);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-mobile-name span {
  color: var(--coral);
}

.topbar-convo-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-b);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-logo {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px var(--coral-glow));
}

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

.topbar-title {
  font-family: var(--font-h);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title span {
  color: var(--coral);
}

.topbar-sub {
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-profile {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), #ff8c00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #000;
  cursor: pointer;
  border: 2px solid var(--border2);
  overflow: hidden;
  font-family: var(--font-h);
  flex-shrink: 0;
  transition: box-shadow 0.3s;
  position: relative;
}

.topbar-profile:hover {
  box-shadow: 0 0 16px var(--coral-glow);
}

.topbar-profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  background: rgba(10, 10, 15, 0.96);
  backdrop-filter: blur(30px);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 8px;
  min-width: 200px;
  z-index: 200;
  display: none;
  animation: dropIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-dropdown.show {
  display: block;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-6px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.drop-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.drop-uname {
  font-family: var(--font-h);
  font-size: 0.78rem;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}

.drop-email {
  font-size: 12px;
  color: var(--text3);
}

.drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: var(--text2);
  transition: background 0.15s, color 0.15s;
}

.drop-item:hover,
.drop-item:focus-visible {
  background: var(--glass2);
  color: var(--text);
}

.drop-item svg {
  color: var(--coral);
}

.drop-item.danger:hover {
  color: var(--coral);
}

/* Messages area */
.messages-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.messages-inner {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 120px;
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Welcome */
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  margin: auto;
}

.welcome-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 16px var(--coral-glow));
}

.welcome h1 {
  font-family: var(--font-h);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: 0.01em;
  line-height: 1.15;
  max-width: 20ch;
}

.welcome h1 span {
  color: var(--coral);
}

.welcome p {
  color: var(--text2);
  font-size: 17px;
  max-width: 52ch;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* quick chips */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass2);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

@media (hover: hover) {
  .chip:hover {
    border-color: var(--border2);
    background: var(--coral-dim);
    transform: translateY(-1px);
  }
}

.chip:focus-visible {
  border-color: var(--border2);
  background: var(--coral-dim);
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.chip svg {
  width: 16px;
  height: 16px;
  color: var(--coral);
}

@media (pointer: coarse) {
  .chip {
    min-height: 44px;
  }
}

/* Messages */
.message-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  animation: msgIn 0.18s ease-out;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.msg-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
  overflow: hidden;
}

.msg-av.bot {
  background: linear-gradient(135deg, var(--coral), #ff8c00);
  color: #000;
}

.msg-av.bot svg {
  width: 18px;
  height: 18px;
}

.msg-av.usr {
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text2);
}

.msg-av.usr img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-content {
  flex: 1;
  max-width: 85%;
  min-width: 0;
  position: relative;
}

.message-row.user .msg-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.msg-name {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.message-row.user .msg-name {
  justify-content: flex-end;
}

.msg-name svg {
  width: 12px;
  height: 12px;
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 17px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  position: relative;
}

.msg-bubble.bot {
  background: transparent;
  color: var(--text);
  border: none;
  padding-left: 0;
}

.msg-bubble.usr {
  background: var(--user-bg);
  border: 1px solid rgba(255, 76, 76, 0.2);
  color: var(--text);
  border-radius: 16px 4px 16px 16px;
}

.msg-bubble a {
  color: var(--coral);
  text-decoration: none;
}

.msg-bubble a:hover {
  text-decoration: underline;
}

.msg-bubble code {
  font-family: var(--font-c);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

.msg-bubble pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
}

.msg-bubble pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
}

.msg-bubble p {
  margin: 0 0 8px;
}

.msg-bubble p:last-child {
  margin-bottom: 0;
}

.msg-bubble ul,
.msg-bubble ol {
  margin: 6px 0 8px 20px;
}

.msg-bubble li {
  margin: 2px 0;
}

/* Message action row */
.msg-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.action-btn:hover,
.action-btn:focus-visible {
  background: var(--glass2);
  color: var(--text);
}

.action-btn svg {
  width: 18px;
  height: 18px;
}

.copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (pointer: coarse) {
  .action-btn {
    padding: 6px;
  }
}

/* Typing */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  animation: pulse 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  40% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Project brief card */
.brief-card {
  background: var(--glass);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-width: 100%;
}

.brief-title {
  font-family: var(--font-h);
  color: var(--coral);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.brief-row {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}

.brief-row strong {
  color: var(--text2);
  font-weight: 600;
}

.brief-actions {
  margin-top: 14px;
}

.brief-btn {
  padding: 10px 16px;
  background: var(--coral);
  color: #000;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-b);
  font-size: 16px;
  font-weight: 600;
  min-height: 44px;
  transition: background 0.2s;
}

.brief-btn:hover,
.brief-btn:focus-visible {
  background: var(--coral2);
}

/* Composer */
.composer {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(5, 5, 7, 0.7);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
}

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

.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 6px 6px 6px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.composer-box:focus-within {
  border-color: var(--border2);
  box-shadow: 0 0 0 3px var(--coral-dim);
}

#messageInput {
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-b);
  font-size: 17px;
  line-height: 1.4;
  resize: none;
  padding: 10px 0;
  overflow-y: hidden;
}

#messageInput::-webkit-scrollbar {
  width: 6px;
}

#messageInput::-webkit-scrollbar-button {
  display: none;
}

#messageInput::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.char-counter-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
  min-height: 14px;
}

#messageInput::placeholder {
  color: var(--text3);
}

.send-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--coral);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  flex-shrink: 0;
  align-self: flex-end;
  transition: background 0.2s, opacity 0.2s, transform 0.2s;
}

.send-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
}

@media (pointer: coarse) {
  .send-btn::after {
    inset: -4px;
  }
}

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

.send-btn:not(:disabled):hover {
  background: var(--coral2);
  transform: scale(1.05);
}

.composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  min-height: 18px;
}

.char-counter {
  font-size: 12px;
  color: var(--text3);
}

.composer-legal {
  font-size: 12px;
  color: var(--text3);
  margin: 0;
  text-align: right;
}

.composer-legal a {
  color: var(--text3);
  text-decoration: underline;
}

.composer-legal a:hover {
  color: var(--coral);
}

/* Gallery/mission panels */
.panel {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
}

.panel.show {
  display: flex;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

.panel-title {
  font-family: var(--font-h);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--coral);
}

.panel-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-b);
  font-size: 16px;
  font-weight: 600;
  min-height: 36px;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 48px 24px;
}

/* Responsive */
@media (max-width: 899px) {
  .topbar-mobile-brand {
    display: flex;
  }

  .topbar-convo-title {
    display: none;
  }

  .back-short {
    display: inline;
  }

  .back-full {
    display: none;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .hamburger {
    display: inline-flex;
  }

  .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .topbar-sub {
    display: none;
  }

  .quick-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    justify-content: flex-start;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
    mask-image: linear-gradient(to right, #000 85%, transparent 100%);
  }

  .quick-chips::-webkit-scrollbar {
    display: none;
  }

  .chip {
    scroll-snap-align: start;
    flex: 0 0 auto;
  }

  .welcome-logo {
    width: 48px;
    height: 48px;
  }

  .welcome h1 {
    font-size: 1.6rem;
  }

  .composer {
    padding: 10px 12px 12px;
  }

  #messageInput {
    font-size: 16px;
  }

  .composer-legal {
    display: none;
  }
}

@media (max-width: 479px) {
  .topbar-sub {
    display: none;
  }
}

@media (max-width: 360px) {
  .messages-inner {
    padding: 20px 12px 16px;
  }

  .composer-box {
    padding: 6px 6px 6px 10px;
  }
}

@media (max-height: 600px) {
  .welcome-logo {
    display: none;
  }
}

body.kb-open .quick-chips {
  display: none;
}

body.kb-open .composer-legal {
  display: none;
}

body.kb-open .composer {
  padding-bottom: 8px;
}

body.kb-open .welcome-logo {
  display: none;
}

body.kb-open .welcome h1 {
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  margin-bottom: 8px;
}

body.kb-open .welcome p {
  font-size: 15px;
  margin-bottom: 12px;
}

@media (max-height: 560px) {
  .welcome-logo {
    display: none;
  }

  .welcome h1 {
    font-size: clamp(1.25rem, 5vw, 1.6rem);
  }

  .welcome p {
    font-size: 15px;
  }
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
}

.topbar {
  view-transition-name: site-header;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* Confirm dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.confirm-overlay[hidden] {
  display: none;
}

.confirm-dialog {
  width: 100%;
  max-width: 360px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.confirm-dialog h2 {
  font-family: var(--font-h);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 18px;
}

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

.confirm-btn {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.confirm-btn:hover,
.confirm-btn:focus-visible {
  background: var(--glass2);
  border-color: var(--border2);
}

.confirm-btn-primary {
  background: var(--coral);
  border-color: var(--coral);
  color: #000;
}

.confirm-btn-primary:hover,
.confirm-btn-primary:focus-visible {
  background: var(--coral2);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .welcome-logo {
    animation: none;
  }
}
