:root {
  --bg-dark: #07090e;
  --bg-workspace: #0b0f17;
  --bg-sidebar: #0e131d;
  --bg-card: #131926;
  --bg-card-hover: #192132;
  --bg-input: #101623;
  --border: #1c2637;
  --border-light: #25334a;
  
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.25);
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --danger: #ef4444;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-sans: "Plus Jakarta Sans", "Noto Sans Sinhala", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, ui-monospace, monospace;
}

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

html, body {
  height: 100%;
  width: 100%;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Layout */
.layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* Collapsible Sidebar */
.sidebar {
  width: 290px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s ease;
  z-index: 40;
  flex-shrink: 0;
}

.sidebar.collapsed {
  transform: translateX(-100%);
  margin-right: -290px;
}

.sidebar-header {
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #07090e;
  display: grid;
  place-items: center;
  box-shadow: 0 0 15px var(--accent-green-glow);
}

.brand-text h2 {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #ffffff, #a7f3d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text .subtext {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.btn-new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-new-chat:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 182, 212, 0.28));
  border-color: var(--accent-green);
  box-shadow: 0 0 12px var(--accent-green-glow);
  transform: translateY(-1px);
}

.sidebar-search {
  margin: 0 16px 10px;
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar-search svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
}

.sidebar-search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px 8px 34px;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.sidebar-search input:focus {
  border-color: var(--accent-green);
}

/* Conversations List */
.conv-history {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conv-history::-webkit-scrollbar {
  width: 4px;
}
.conv-history::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.history-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 30px 10px;
}

.conv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
}

.conv-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.conv-item.active {
  background: var(--bg-card);
  border-color: rgba(16, 185, 129, 0.35);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--accent-green);
}

.conv-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  flex: 1;
  margin-right: 8px;
}

.conv-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.conv-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.conv-model-tag {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.conv-actions {
  display: none;
  align-items: center;
  gap: 2px;
}

.conv-item:hover .conv-actions,
.conv-item.active .conv-actions {
  display: flex;
}

.conv-btn-del, .conv-btn-edit {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s;
}

.conv-btn-del:hover {
  color: var(--danger);
}
.conv-btn-edit:hover {
  color: var(--accent-cyan);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 15, 23, 0.7);
}

.db-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.db-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.db-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 99px;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Buttons */
.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-icon:hover {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

/* Main Workspace */
.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 75% 10%, rgba(16, 185, 129, 0.07) 0%, transparent 50%),
              radial-gradient(circle at 20% 85%, rgba(6, 182, 212, 0.05) 0%, transparent 45%),
              var(--bg-workspace);
  overflow: hidden;
  height: 100vh;
}

/* Topbar */
.topbar {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle-btn {
  padding: 7px;
  border: 1px solid var(--border);
}

/* Model Selector Component */
.model-picker {
  position: relative;
}

.model-select-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 99px;
  padding: 6px 14px 6px 10px;
  cursor: pointer;
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.2s ease;
}

.model-select-btn:hover {
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.18);
}

.model-badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.model-badge-dot.dot-blue {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.model-badge-dot.dot-cyan {
  background: #06b6d4;
  box-shadow: 0 0 8px #06b6d4;
}

.model-badge-dot.dot-purple {
  background: var(--accent-purple);
  box-shadow: 0 0 8px var(--accent-purple);
}

.model-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.model-title {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.1;
}

.model-tag {
  font-size: 0.68rem;
  color: var(--accent-green);
  font-weight: 600;
}

.chevron {
  color: var(--text-muted);
  transition: transform 0.2s;
}

.model-picker.open .chevron {
  transform: rotate(180deg);
}

/* Model Dropdown Menu */
.model-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 50;
  backdrop-filter: blur(16px);
}

.model-picker.open .model-menu {
  display: flex;
  animation: fadeInDown 0.18s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 8px 2px;
  letter-spacing: 0.8px;
}

.model-option {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.model-option:hover {
  background: var(--bg-card);
  border-color: var(--border);
}

.model-option.selected {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
}

.option-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.opt-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
}

.opt-badge {
  font-size: 0.62rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  padding: 2px 6px;
  border-radius: 4px;
}

.opt-badge.opt-temco {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
}

.opt-badge.opt-cyan {
  background: rgba(6, 182, 212, 0.2);
  color: #06b6d4;
}

.opt-badge.opt-locked {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 800;
  letter-spacing: 0.4px;
}

.model-option.locked {
  opacity: 0.68;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.model-option.locked:hover {
  opacity: 0.95;
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.35);
}

.opt-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding-left: 17px;
  line-height: 1.35;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.dot-cyan { background: #06b6d4; box-shadow: 0 0 6px #06b6d4; }
.dot-blue { background: var(--accent-cyan); box-shadow: 0 0 6px var(--accent-cyan); }
.dot-purple { background: var(--accent-purple); box-shadow: 0 0 6px var(--accent-purple); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-badge {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-top {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-top:hover {
  border-color: var(--accent-green);
  color: var(--text-primary);
}

.btn-admin-link {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.12));
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent-green);
}
.btn-admin-link:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(6, 182, 212, 0.22));
  box-shadow: 0 0 10px var(--accent-green-glow);
}

.btn-key-pill {
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
}
.btn-key-pill.has-key {
  background: rgba(6, 182, 212, 0.1);
}

/* Chat Feed */
.chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scroll-behavior: smooth;
}

.chat-feed::-webkit-scrollbar {
  width: 6px;
}
.chat-feed::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}

/* Empty Hero Section */
.empty-hero {
  margin: auto;
  max-width: 760px;
  text-align: center;
  padding: 40px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-green);
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 18px;
}

.hero-spark {
  color: #34d399;
}

.empty-hero h2 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  line-height: 1.3;
}

.hero-desc {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 620px;
  margin-bottom: 32px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

.prompt-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: inherit;
  font-family: inherit;
}

.prompt-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.card-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.card-content h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
}

.card-content p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Chat Messages */
.message-row {
  display: flex;
  gap: 12px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  align-items: flex-start;
  transition: opacity 0.2s ease;
}

.message-row.user {
  justify-content: flex-end;
  align-items: flex-start;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  user-select: none;
}

.message-row.user .msg-avatar {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  color: #ffffff;
  order: 2;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.message-row.assistant .msg-avatar {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #07090e;
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}

.msg-bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: min(82%, 700px);
  min-width: 0;
}

.message-row.user .msg-bubble-wrap {
  align-items: flex-end;
}

.msg-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.model-tag-pill {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.model-tag-pill.pill-temco {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.3);
}

.msg-bubble {
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 0.94rem;
  line-height: 1.62;
  word-break: break-word;
  position: relative;
}

.message-row.user .msg-bubble {
  background: linear-gradient(145deg, #1e293b 0%, #151d2f 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22), 0 1px 2px rgba(0, 0, 0, 0.12);
  white-space: pre-wrap;
  display: inline-block;
  width: fit-content;
  max-width: 100%;
}

.message-row.assistant .msg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-top-left-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  width: 100%;
}

/* User Message Actions Toolbar */
.msg-user-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  padding-right: 2px;
}

.message-row.user:hover .msg-user-toolbar,
.message-row.user:focus-within .msg-user-toolbar {
  opacity: 1;
}

.msg-user-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  user-select: none;
}

.msg-user-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

/* Typing cursor animation */
.streaming-cursor::after {
  content: "▋";
  color: var(--accent-green);
  margin-left: 2px;
  animation: blink 0.9s infinite;
}

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

/* Markdown typography in bubble */
.msg-bubble p {
  margin-bottom: 12px;
}
.msg-bubble p:last-child {
  margin-bottom: 0;
}

.msg-bubble h1, .msg-bubble h2, .msg-bubble h3, .msg-bubble h4 {
  color: #ffffff;
  margin: 16px 0 8px;
  font-weight: 700;
}

.msg-bubble ul, .msg-bubble ol {
  margin: 8px 0 12px 22px;
}

.msg-bubble li {
  margin-bottom: 4px;
}

.msg-bubble code:not(pre code) {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.88em;
}

/* Code Blocks with header & copy button */
.code-block-wrapper {
  margin: 14px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: #0d1117;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #161b22;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.code-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-preview-ui {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(6, 182, 212, 0.22));
  border: 1px solid var(--accent-green);
  color: #a7f3d0;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-preview-ui:hover {
  background: var(--accent-green);
  color: #07090e;
  box-shadow: 0 0 12px var(--accent-green-glow);
}

.code-copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.code-copy-btn:hover {
  background: var(--bg-card);
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.code-block-wrapper pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.5;
}

.code-block-wrapper pre code {
  background: transparent !important;
  padding: 0 !important;
}

/* Message Actions Toolbar */
.msg-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.msg-tool-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}

.msg-tool-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.msg-tool-btn.active {
  color: var(--accent-green);
}

/* Message Error state */
.msg-bubble.error-state {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

/* Composer / Input Area */
.composer-container {
  padding: 12px 20px 18px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

.quick-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

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

.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 99px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 0.76rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s;
}

.chip:hover {
  border-color: var(--accent-green);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.input-card {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-card:focus-within {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18), 0 10px 25px rgba(0, 0, 0, 0.4);
}

#promptInput {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.96rem;
  line-height: 1.55;
  max-height: 180px;
}

#promptInput::placeholder {
  color: var(--text-muted);
}

.input-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.active-model-indicator {
  color: var(--accent-green);
  font-weight: 600;
}

.send-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #07090e;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px var(--accent-green-glow);
}

.send-action-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.send-action-btn.btn-stop {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* Settings Modal & Overlays */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal-overlay.open {
  display: grid;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.modal-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-section h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.section-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.endpoint-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.ep-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ep-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.ep-green { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.ep-blue { background: rgba(6, 182, 212, 0.2); color: var(--accent-cyan); }

.ep-header code {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ep-details {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.db-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.db-actions {
  display: flex;
  gap: 10px;
}

.btn-secondary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  border-color: var(--accent-green);
}

.btn-danger {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--danger);
}

#systemPromptInput {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

#systemPromptInput:focus {
  border-color: var(--accent-green);
}

.section-save-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.btn-primary {
  background: var(--accent-green);
  border: none;
  color: #07090e;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.save-status {
  font-size: 0.76rem;
  color: var(--accent-green);
}

/* ==========================================
   ATTACHMENTS & FILE/IMAGE UPLOADS
   ========================================== */
.input-left-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-tool-attach {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.btn-tool-attach:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
  transform: scale(1.05);
  box-shadow: 0 0 10px var(--accent-green-glow);
}

.attachments-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.attachment-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 0.76rem;
  color: var(--text-primary);
  max-width: 220px;
  position: relative;
  animation: fadeIn 0.15s ease-out;
}

.attachment-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.attachment-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.attachment-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 1px;
}

.attachment-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.attachment-size {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.attachment-ocr-badge {
  font-size: 0.62rem;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
  margin-left: 2px;
}

.attachment-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.attachment-del-btn:hover {
  color: var(--danger);
}

/* Chat bubble attachments */
.msg-attachments-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.msg-attachment-image {
  max-width: 280px;
  max-height: 220px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.msg-attachment-image:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  border-color: var(--accent-green);
}

.msg-attachment-file {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.msg-attachment-file .file-icon {
  font-size: 1.2rem;
}

/* Drag and Drop Overlay */
.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(10px);
  z-index: 120;
  display: none;
  place-items: center;
}

.drop-overlay.active {
  display: grid;
  animation: fadeIn 0.15s ease-out;
}

.drop-card {
  background: var(--bg-card);
  border: 2px dashed var(--accent-green);
  border-radius: var(--radius-lg);
  padding: 40px 60px;
  text-align: center;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 30px var(--accent-green-glow);
}

.drop-card svg {
  color: var(--accent-green);
  animation: bounce 1s infinite alternate ease-in-out;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

/* Image Lightbox Modal */
.image-lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: none;
  place-items: center;
  padding: 30px;
}

.image-lightbox-modal.open {
  display: grid;
  animation: fadeIn 0.15s ease-out;
}

.image-lightbox-modal img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-light);
}

.btn-close-lightbox {
  position: absolute;
  top: 24px;
  right: 28px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  font-size: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.btn-close-lightbox:hover {
  background: var(--danger);
}

/* Web UI Live Preview Modal */
.web-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 250;
  display: none;
  place-items: center;
  padding: 20px;
}

.web-preview-modal.open {
  display: grid;
  animation: fadeIn 0.15s ease-out;
}

.web-preview-container {
  width: 95vw;
  height: 92vh;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.web-preview-header {
  height: 54px;
  padding: 0 18px;
  background: #111724;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-device-switch {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.btn-device {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-device:hover {
  color: var(--text-primary);
}

.btn-device.active {
  background: var(--accent-green);
  color: #07090e;
  font-weight: 700;
}

.web-preview-iframe-wrapper {
  flex: 1;
  background: #07090e;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#webPreviewIframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
  transition: width 0.25s ease;
  border-radius: 2px;
}

/* Continue Generation Styles */
.continue-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(16, 185, 129, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: #f1f5f9;
  animation: fadeIn 0.2s ease;
  gap: 12px;
}

.btn-continue-msg {
  color: var(--accent-green) !important;
  font-weight: 700 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.btn-continue-msg:hover {
  background: var(--accent-green) !important;
  color: #07090e !important;
  box-shadow: 0 0 10px var(--accent-green-glow);
}

/* Member Dashboard Link Pill */
.btn-member-dash {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(16, 185, 129, 0.16));
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #67e8f9 !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-member-dash:hover {
  background: var(--accent-cyan);
  color: #07090e !important;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

/* User Account & Live Token Badge Styles */
.btn-user-account {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #ffffff;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-user-account:hover {
  border-color: var(--accent-green);
  box-shadow: 0 0 12px var(--accent-green-glow);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(6, 182, 212, 0.18));
}

.user-avatar-mini {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-green);
  color: #07090e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.user-avatar-lg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
  color: #07090e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
}

.token-pill-badge {
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topup-chip {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topup-chip:hover {
  color: #ffffff;
  border-color: var(--border-light);
}

.topup-chip.active {
  background: var(--accent-green);
  color: #07090e;
  border-color: var(--accent-green);
}

/* Sidebar Backdrop - Strictly Mobile Only (Completely Hidden on Desktop) */
.sidebar-backdrop {
  display: none !important;
}

/* Mobile responsive refinements */
@media (max-width: 768px) {
  .sidebar-backdrop {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-backdrop.active {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.85);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .sidebar:not(.collapsed) {
    transform: translateX(0);
  }

  /* Compact Non-Overlapping Mobile Topbar */
  .topbar {
    padding: 0 8px !important;
    height: 52px !important;
    gap: 6px !important;
    justify-content: space-between;
    overflow-x: hidden;
    max-width: 100vw;
  }

  .topbar-left {
    gap: 6px !important;
    flex-shrink: 1;
    min-width: 0;
  }

  .topbar-right {
    gap: 5px !important;
    flex-shrink: 0;
  }

  .model-select-btn {
    padding: 4px 8px !important;
    max-width: 135px;
  }

  .model-meta {
    max-width: 85px !important;
  }

  .model-title {
    font-size: 0.76rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .model-tag {
    display: none !important;
  }

  /* Hide auxiliary buttons on mobile topbar to guarantee ZERO overflow */
  #apiKeyPillBtn,
  .btn-admin-link,
  #exportChatBtn,
  .session-badge {
    display: none !important;
  }

  /* Member Dashboard Link Icon Button */
  #memberDashboardLink {
    padding: 6px 9px !important;
    border-radius: var(--radius-sm);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  #memberDashboardLink span {
    display: none !important;
  }

  /* User Account Button */
  .btn-user-account {
    padding: 5px 8px !important;
    max-width: 130px;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .btn-user-account span#userAccountLabel {
    display: inline-block;
    max-width: 75px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.76rem;
  }

  .btn-user-account span#userTokenBadge {
    display: none !important;
  }

  .btn-top span {
    display: none;
  }

  /* Responsive Chat Feed & Empty Hero */
  .chat-feed {
    padding: 12px 10px 20px !important;
    overflow-y: auto;
  }

  .empty-hero {
    margin: 0 auto !important;
    padding: 14px 6px 24px !important;
    width: 100%;
  }

  .hero-badge {
    margin-bottom: 10px !important;
    padding: 4px 10px !important;
    font-size: 0.68rem !important;
  }

  .empty-hero h2 {
    font-size: 1.35rem !important;
    line-height: 1.35 !important;
    margin-bottom: 8px !important;
  }

  .hero-desc {
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
    margin-bottom: 18px !important;
    max-width: 100% !important;
  }

  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .prompt-card {
    padding: 10px 12px !important;
    gap: 10px !important;
  }

  .card-icon {
    font-size: 1.15rem !important;
  }

  .card-content h4 {
    font-size: 0.84rem !important;
    margin-bottom: 2px !important;
  }

  .card-content p {
    font-size: 0.74rem !important;
  }

  .msg-bubble-wrap {
    max-width: 90%;
  }

  .msg-bubble {
    font-size: 0.88rem;
    padding: 10px 14px;
    border-radius: 16px;
  }

  .message-row.user .msg-bubble {
    border-top-right-radius: 4px;
  }

  .msg-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
  }

  .msg-user-toolbar {
    opacity: 0.85;
  }

  /* Responsive Composer */
  .composer-container {
    padding: 6px 10px 12px !important;
    max-width: 100% !important;
  }

  .quick-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    margin-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  .quick-chips .chip {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 0.74rem;
  }

  .input-card {
    padding: 8px 10px 8px !important;
    border-radius: var(--radius-md) !important;
  }

  #promptInput {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    line-height: 1.45;
    min-height: 40px;
    max-height: 130px;
    scrollbar-width: none;
  }

  #promptInput::-webkit-scrollbar {
    display: none;
  }

  .input-bottom-bar {
    margin-top: 4px;
  }

  .input-left-tools {
    gap: 8px;
  }

  .active-model-indicator {
    font-size: 0.7rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .char-count {
    display: none !important;
  }

  /* Mobile Modals */
  .modal-overlay {
    padding: 10px !important;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    margin: auto;
    padding: 16px !important;
    border-radius: var(--radius-md) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .web-preview-container {
    width: 98vw !important;
    height: 95vh !important;
  }

  .web-preview-header {
    padding: 0 10px;
  }

  .preview-device-switch {
    display: none;
  }
}

@media (max-width: 480px) {
  .topbar {
    height: 50px !important;
    padding: 0 6px !important;
  }

  .model-select-btn {
    max-width: 110px !important;
  }

  .model-meta {
    max-width: 65px !important;
  }

  .btn-user-account {
    max-width: 105px !important;
    padding: 4px 6px !important;
  }

  .btn-user-account span#userAccountLabel {
    max-width: 55px !important;
  }

  .code-block-header {
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  .code-block-wrapper pre {
    padding: 10px 12px;
    font-size: 0.76rem;
  }

  .composer-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
}
