/* ============================================
   ShinrakitGPT — style.css
   สไตล์ ChatGPT สมัยใหม่ (Dark / Light Mode)
   ============================================ */

:root,
[data-theme="dark"] {
  --bg-main: #111011;
  --bg-sidebar: #0d0c0d;
  --bg-surface: #1d1a1b;
  --bg-surface-hover: #2a2527;
  --bg-composer: #1d1a1b;
  --bg-user-bubble: #282225;
  --bg-code: #0b0a0b;
  --bg-code-header: #171416;
  --bg-inline-code: rgba(255, 0, 72, 0.16);
  --bg-error: rgba(239, 68, 68, 0.12);

  --text-primary: #f6f2f3;
  --text-secondary: #d0c9cc;
  --text-muted: #a79ca0;
  --text-error: #fca5a5;

  --border-subtle: rgba(255, 245, 248, 0.1);
  --border-strong: rgba(255, 245, 248, 0.2);
  --border-error: rgba(239, 68, 68, 0.35);

  --accent: #ff0048;
  --accent-soft: rgba(255, 0, 72, 0.18);
  --accent-foreground: #ffb3c5;

  --send-bg: #ff0048;
  --send-fg: #ffffff;
  --send-disabled-bg: #43353a;
  --send-disabled-fg: #bcb2b6;

  --shadow-composer: 0 8px 28px rgba(0, 0, 0, 0.2);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.35);
  --scrollbar-thumb: rgba(255, 245, 248, 0.2);

  --sidebar-width: 276px;
  --chat-max-width: 800px;
  --focus-ring: #ff5277;
  --font-sans: "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="light"] {
  --bg-main: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-surface: #fff5f7;
  --bg-surface-hover: #ffedf1;
  --bg-composer: #ffffff;
  --bg-user-bubble: #fff1f4;
  --bg-code: #181417;
  --bg-code-header: #282225;
  --bg-inline-code: rgba(199, 0, 57, 0.08);
  --bg-error: #fef2f2;

  --text-primary: #241a1e;
  --text-secondary: #54464b;
  --text-muted: #6c5e63;
  --text-error: #a52222;

  --border-subtle: rgba(46, 23, 30, 0.12);
  --border-strong: rgba(46, 23, 30, 0.22);
  --border-error: #fecaca;

  --accent: #ff0048;
  --accent-soft: rgba(255, 0, 72, 0.1);
  --accent-foreground: #a90030;

  --send-bg: #c90039;
  --send-fg: #ffffff;
  --send-disabled-bg: #efe1e5;
  --send-disabled-fg: #6c5e63;

  --shadow-composer: 0 8px 24px rgba(65, 0, 17, 0.08);
  --shadow-float: 0 6px 18px rgba(65, 0, 17, 0.14);
  --scrollbar-thumb: rgba(65, 0, 17, 0.2);
  --focus-ring: #c90039;
}

/* ---------- รีเซ็ต ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
textarea {
  font-family: inherit;
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

/* ---------- โครงหน้าหลัก (Sidebar + Main) ---------- */
.app-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: var(--bg-main);
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: margin-left 0.22s ease, transform 0.22s ease;
  z-index: 40;
}

.app-shell.sidebar-collapsed .sidebar {
  margin-left: calc(var(--sidebar-width) * -1);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  height: 62px;
  flex-shrink: 0;
}

.sidebar-brand-logo {
  display: block;
  width: 88px;
  height: auto;
  flex-shrink: 0;
}

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

.sidebar-actions {
  padding: 4px 10px 12px;
}

.new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.new-chat-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
}

.sidebar-section-label {
  padding: 6px 16px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.history-search {
  min-height: 40px;
  margin: 0 10px 10px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-muted);
  background: var(--bg-main);
}

.history-search:focus-within {
  border-color: var(--border-strong);
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.history-search input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
}

.history-search input::placeholder {
  color: var(--text-muted);
}

.history-search kbd {
  flex-shrink: 0;
  padding: 2px 5px;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--text-muted);
  font: 0.68rem var(--font-mono);
}

.chat-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.history-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: background 0.14s ease, color 0.14s ease;
}

.history-select-btn {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

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

.history-item.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 500;
}

.history-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-delete-btn {
  opacity: 0;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.history-item:hover .history-delete-btn,
.history-item.active .history-delete-btn,
.history-delete-btn:focus-visible {
  opacity: 1;
}

.history-delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.sidebar-footer {
  padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
}

.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #9f0030);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.profile-avatar img,
.empty-logo img,
.msg-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 7px;
}

.profile-meta {
  min-width: 0;
  flex: 1;
}

.profile-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.status-dot.busy {
  background: #f59e0b;
}

.status-dot.error {
  background: #ef4444;
}

.sidebar-clear-btn {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}

.sidebar-clear-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* ---------- Topbar ---------- */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.topbar {
  height: 62px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ซ่อนปุ่มเปิด Sidebar บน Topbar ตอน Sidebar เปิดอยู่บนเดสก์ท็อป */
.app-shell:not(.sidebar-collapsed) #sidebar-open-btn,
.app-shell:not(.sidebar-collapsed) #new-chat-top-btn {
  display: none;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

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

.model-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  user-select: none;
}

.model-name {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.model-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-foreground);
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

/* ---------- พื้นที่แชท ---------- */
.chat-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 28px;
  scroll-behavior: smooth;
}

.chat-scroll::-webkit-scrollbar,
.chat-history-list::-webkit-scrollbar {
  width: 7px;
}

.chat-scroll::-webkit-scrollbar-track,
.chat-history-list::-webkit-scrollbar-track {
  background: transparent;
}

.chat-scroll::-webkit-scrollbar-thumb,
.chat-history-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
}

.chat-messages {
  max-width: var(--chat-max-width);
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- หน้าต้อนรับ (Empty State) ---------- */
.empty-state {
  margin: auto;
  width: 100%;
  max-width: 660px;
  text-align: center;
  padding: 24px 0 36px;
}

.empty-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-main);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  overflow: hidden;
}

.empty-title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-subtitle {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.quick-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.prompt-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  text-align: left;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-sidebar);
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.prompt-card:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.prompt-icon {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---------- ข้อความแชท (ChatGPT Style) ---------- */
.message {
  display: flex;
  width: 100%;
  animation: fadeSlide 0.18s ease-out;
}

.message.user {
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
}

.message.user .user-bubble {
  max-width: calc(78% - 40px);
  background: var(--bg-user-bubble);
  color: var(--text-primary);
  padding: 11px 18px;
  border-radius: 22px;
  font-size: 0.98rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.assistant {
  align-items: flex-start;
  gap: 14px;
}

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-main);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  overflow: hidden;
}

.user-avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  object-fit: cover;
}

.assistant-col {
  flex: 1;
  min-width: 0;
}

.message-content {
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--text-primary);
  word-break: break-word;
}

/* เคอร์เซอร์กะพริบขณะสตรีม */
.message.streaming .message-content::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 16px;
  margin-left: 3px;
  vertical-align: -2px;
  border-radius: 2px;
  background: var(--text-secondary);
  animation: blinkCursor 0.9s infinite;
}

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

/* ---------- จัดรูปแบบ Markdown ภายในคำตอบ ---------- */
.message-content p {
  margin-bottom: 12px;
}

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

.message-content h1,
.message-content h2,
.message-content h3 {
  font-weight: 600;
  line-height: 1.4;
  margin: 16px 0 8px;
  color: var(--text-primary);
}

.message-content h1 { font-size: 1.24rem; }
.message-content h2 { font-size: 1.12rem; }
.message-content h3 { font-size: 1.02rem; }

.message-content ul,
.message-content ol {
  margin: 8px 0 12px 22px;
}

.message-content li {
  margin-bottom: 5px;
}

.message-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 14px;
  margin: 10px 0;
  color: var(--text-secondary);
}

.message-content .inline-code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-inline-code);
  padding: 2px 6px;
  border-radius: 6px;
}

.code-block {
  margin: 12px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-code);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: var(--bg-code-header);
  color: #a1a1aa;
  font-size: 0.76rem;
}

.code-copy-btn {
  border: none;
  background: transparent;
  color: #d4d4d8;
  font-size: 0.76rem;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background 0.14s ease, color 0.14s ease;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.code-block pre {
  padding: 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #f4f4f5;
}

/* ---------- ปุ่ม Action ใต้คำตอบ ---------- */
.message-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  margin-left: -6px;
}

.msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

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

/* ---------- การ์ดแจ้ง Error + ปุ่มลองใหม่ ---------- */
.error-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--bg-error);
  border: 1px solid var(--border-error);
  color: var(--text-error);
  font-size: 0.88rem;
  line-height: 1.5;
}

.retry-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-error);
  background: transparent;
  color: var(--text-error);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease;
}

.retry-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* ---------- แถบสถานะกำลังคิด ---------- */
.typing-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.typing-body {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
  opacity: 0.4;
  animation: typingPulse 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }

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

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

/* ---------- ปุ่มเลื่อนลงล่างสุด ---------- */
.scroll-bottom-btn {
  position: absolute;
  left: 50%;
  bottom: 106px;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-main);
  color: var(--text-primary);
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  transition: transform 0.15s ease, background 0.15s ease;
}

.scroll-bottom-btn:hover {
  background: var(--bg-surface);
  transform: translateX(-50%) scale(1.06);
}

/* ---------- กล่องพิมพ์แคปซูลลอย (Composer) ---------- */
.composer-wrap {
  flex-shrink: 0;
  padding: 6px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg-main);
}

.composer-box {
  max-width: var(--chat-max-width);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 11px 12px 11px 18px;
  border-radius: 22px;
  background: var(--bg-composer);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-composer);
  transition: border-color 0.15s ease;
}

.composer-box:focus-within {
  border-color: var(--border-strong);
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.user-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.98rem;
  line-height: 1.5;
  max-height: 180px;
  padding: 4px 0;
  overflow-y: auto;
}

.user-input:focus-visible {
  outline: none;
}

.user-input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  flex-shrink: 0;
  background: var(--send-bg);
  color: var(--send-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease, background 0.15s ease;
}

.send-btn:hover:not(:disabled) {
  opacity: 0.88;
}

.send-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.send-btn:disabled {
  background: var(--send-disabled-bg);
  color: var(--send-disabled-fg);
  cursor: not-allowed;
}

.send-btn .icon-stop {
  display: none;
}

.send-btn.stop-mode {
  background: var(--send-bg);
  color: var(--send-fg);
}

.send-btn.stop-mode .icon-send {
  display: none;
}

.send-btn.stop-mode .icon-stop {
  display: block;
}

.composer-disclaimer {
  max-width: var(--chat-max-width);
  margin: 8px auto 0;
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-main);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: var(--shadow-float);
  z-index: 100;
  max-width: calc(100vw - 32px);
  text-align: center;
}

/* ---------- Responsive มือถือ ---------- */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 35;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    margin-left: 0 !important;
    transform: translateX(-100%);
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.35);
  }

  .app-shell.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .app-shell:not(.sidebar-collapsed) #sidebar-open-btn,
  .app-shell:not(.sidebar-collapsed) #new-chat-top-btn {
    display: inline-flex;
  }

  .empty-title {
    font-size: 1.45rem;
  }

  .topbar {
    padding: 0 12px;
  }

  .quick-prompts {
    grid-template-columns: 1fr;
  }

  .message.user .user-bubble {
    max-width: calc(88% - 40px);
  }

  .message.assistant {
    gap: 10px;
  }

  .history-delete-btn {
    opacity: 1;
  }

  .history-search kbd {
    display: none;
  }

  .composer-wrap {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 420px) {
  .model-name {
    font-size: 0.9rem;
  }

  .model-pill {
    gap: 6px;
    padding-left: 4px;
  }

  .composer-disclaimer {
    font-size: 0.7rem;
  }
}

@media (max-width: 360px) {
  .model-tag {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}