/* ============================================================
   MOBILE TOP BAR & NAVIGATION (Gemini style)
   ============================================================ */

/* Mobile Top Navigation Bar — sticky at top of viewport */
.mobile-top-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 12px;
  background-color: var(--clr-bg, rgb(250, 248, 245));
  border-bottom: 1px solid var(--clr-border, #ddd);
  flex-shrink: 0;
  z-index: 50;
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-top-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--clr-text, #1a1a1a);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.mobile-top-btn:hover {
  background-color: var(--clr-hover, rgba(0, 0, 0, 0.05));
}

.mobile-top-btn:active {
  transform: scale(0.92);
  background-color: var(--clr-hover, rgba(0, 0, 0, 0.08));
}

.mobile-top-btn svg {
  width: 22px;
  height: 22px;
}

.mobile-top-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.mobile-top-logo {
  height: 24px;
  width: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

html.light .mobile-top-logo {
  filter: none;
}

.mobile-top-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--clr-text, #111);
}

/* ============================================================
   SIDEBAR TOGGLE & DESKTOP COLLAPSE
   ============================================================ */

/* Desktop toggle button (visible in main workspace only when sidebar collapsed) */
.sidebar-toggle-btn {
  display: none;
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 40;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--clr-surface, #ffffff);
  border: 1px solid var(--clr-border, #ddd);
  color: var(--clr-text-muted, #777);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

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

.sidebar-toggle-btn:hover {
  background-color: var(--clr-hover, #f3f3f3);
  color: var(--clr-text, #111);
}

/* Desktop: show toggle button when collapsed */
@media (min-width: 769px) {
  .app.sidebar-collapsed .sidebar-toggle-btn {
    display: flex;
  }
}

/* Close (×) button inside the sidebar header */
.sidebar-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--clr-text-muted, #888);
  border: none;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

.sidebar-close-btn:hover {
  background-color: var(--clr-hover, rgba(0, 0, 0, 0.06));
  color: var(--clr-text, #1a1a1a);
}

/* Mobile backdrop overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 190;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: all;
}

/* Desktop collapsed sidebar */
.app.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  pointer-events: none;
  border-right-color: transparent;
}

.sidebar {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--clr-text, #111);
  margin-left: 8px;
  white-space: nowrap;
}

/* ============================================================
   HERO SUGGESTION CHIPS (Gemini style)
   ============================================================ */

.hero-subtitle {
  margin-top: 8px;
  font-size: 15px;
  color: var(--clr-text-muted, #777);
  font-weight: 400;
}

.hero-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
  max-width: 600px;
  width: 100%;
}

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background-color: var(--clr-surface, #ffffff);
  border: 1px solid var(--clr-border, #ddd);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--clr-text, #333);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
  text-align: left;
}

.suggestion-chip:hover {
  border-color: #999;
  background-color: var(--clr-surface-2, #f5f4f1);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.suggestion-chip:active {
  transform: scale(0.96);
}

.suggestion-chip-icon {
  font-size: 14px;
  line-height: 1;
}

.suggestion-chip-text {
  white-space: nowrap;
}

/* ============================================================
   SEND BUTTON — Circular Arrow (Gemini style)
   ============================================================ */

.mobile-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.06);
  color: #999;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-send-btn svg {
  width: 16px;
  height: 16px;
}

.mobile-send-btn.active {
  background-color: #1a1a1a;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transform: scale(1.02);
}

.mobile-send-btn.active:hover {
  background-color: #000000;
}

.mobile-send-btn:active {
  transform: scale(0.92);
}

.chat-box.is-loading .mobile-send-btn {
  opacity: 0.3;
  pointer-events: none;
}

/* ============================================================
   DARK MODE ADJUSTMENTS FOR MOBILE & CAPSULE
   ============================================================ */

html.dark .mobile-top-bar {
  background-color: var(--clr-bg, #1a1a1a);
  border-bottom-color: var(--clr-border, #3a3a3a);
}

html.dark .mobile-top-btn {
  color: var(--clr-text, #e8e6e3);
}

html.dark .mobile-top-btn:hover,
html.dark .mobile-top-btn:active {
  background-color: var(--clr-hover, rgba(255, 255, 255, 0.08));
  color: var(--clr-text, #fff);
}

html.dark .sidebar-toggle-btn {
  background-color: var(--clr-surface, #242424);
  border-color: var(--clr-border, #3a3a3a);
  color: var(--clr-text-muted, #aaa);
}

html.dark .sidebar-toggle-btn:hover {
  background-color: var(--clr-hover, #333);
  color: var(--clr-text, #fff);
}

html.dark .sidebar-close-btn:hover {
  background-color: var(--clr-hover);
  color: var(--clr-text);
}

html.dark .mobile-send-btn {
  background-color: rgba(255, 255, 255, 0.08);
  color: #777;
}

html.dark .mobile-send-btn.active {
  background-color: #ffffff;
  color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

html.dark .suggestion-chip {
  background-color: var(--clr-surface, #242424);
  border-color: var(--clr-border, #3a3a3a);
  color: var(--clr-text, #e8e6e3);
}

html.dark .suggestion-chip:hover {
  background-color: var(--clr-surface-2, #2c2c2c);
  border-color: #666;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
  background-color: rgb(250, 248, 245);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.app {
  display: flex;
  height: 100vh;
}

/* Sidebar */

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width, 180px);
  min-width: 140px;
  max-width: 400px;
  flex-shrink: 0;
  border-right: 1px solid #ddd;
  background-color: rgb(250, 248, 245);
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.sidebar-resizer:hover,
.sidebar-resizer.dragging {
  background-color: rgba(0, 0, 0, 0.08);
}

body.sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 16px 16px 12px;
  flex-shrink: 0;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  max-width: 100%;
}

.sidebar-brand-logo {
  height: 32px;
  width: 32px;
  max-width: none;
  display: block;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.sidebar-brand:hover .sidebar-brand-logo {
  opacity: 0.85;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  border-radius: 10px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.sidebar-item.active {
  background-color: #ececec;
  color: #111111;
  /* No font-weight change — changing weight causes text reflow which
     invalidates layout and makes the sidebar flash on every render. */
}

.hidden {
  display: none !important;
}

/* Search modal */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 24px;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.35);
}

.search-dialog {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.search-dialog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}

.search-dialog-icon {
  font-size: 18px;
  color: #888;
  line-height: 1;
}

.search-dialog-input {
  flex: 1;
  font: inherit;
  font-size: 15px;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

.search-dialog-input::placeholder {
  color: #999;
}

.search-close-btn {
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
  color: #888;
  border-radius: 4px;
}

.search-close-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #333;
}

.search-results {
  list-style: none;
  overflow-y: auto;
  padding: 6px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.search-result-item:hover,
.search-result-item.active {
  background-color: #f3f2ef;
}

.search-result-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fafafa;
}

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

.search-result-time {
  flex-shrink: 0;
  font-size: 13px;
  color: #888;
}

.search-empty {
  padding: 24px 16px;
  font-size: 14px;
  color: #888;
  text-align: center;
}

/* Recent chats panel */

.recent-chats-panel {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  min-height: 0;
}

.recent-chats-label {
  padding: 0 20px 8px;
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recent-chats-list {
  list-style: none;
}

.recent-chat-row {
  display: flex;
  align-items: center;
  position: relative;
}

.recent-chat-row:hover,
.recent-chat-row.active {
  background-color: rgba(0, 0, 0, 0.05);
}

.recent-chat-item {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 10px 20px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-chat-row.active .recent-chat-item {
  font-weight: 500;
}

.recent-chat-pin {
  flex-shrink: 0;
  margin-left: 12px;
  font-size: 11px;
  color: #888;
}

.chat-menu {
  position: relative;
  flex-shrink: 0;
  margin-right: 6px;
}

.chat-menu-btn {
  display: none;
  width: 28px;
  height: 28px;
  font-size: 16px;
  letter-spacing: 0.05em;
  color: #888;
  border-radius: 4px;
}

.recent-chat-row:hover .chat-menu-btn,
.chat-menu.open .chat-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-menu-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: #333;
}

.chat-menu-dropdown {
  position: absolute;
  right: calc(100% + 6px);
  top: 0;
  min-width: 120px;
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 20;
}

.chat-menu-dropdown .dropdown-item {
  padding: 9px 14px;
  font-size: 14px;
}

.chat-menu-dropdown .dropdown-item.danger:hover {
  background-color: rgba(192, 57, 43, 0.08);
  color: #c0392b;
}

.recent-chats-empty {
  padding: 8px 20px;
  font-size: 13px;
  color: #888;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 8px 10px 12px;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-icon {
  width: 22px;
  height: 22px;
  border: 1.5px solid #555;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Main content */

.main {
  /* Absorbs all horizontal space left after the sidebar — flex: 1 1 0% is key */
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  /* min-width: 0 lets the flex item shrink below its content width when needed */
  min-width: 0;
  width: 0;          /* combined with flex-grow: 1 this forces the element to fill */
  height: 100%;
  overflow: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.main::-webkit-scrollbar {
  display: none;
}

.workspace {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;      /* don't let workspace hold onto intrinsic content width */
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.chat-column {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  /* Fill the full width of .workspace — no artificial cap here */
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: 100%;
  /* Edge padding so content never touches the viewport/sidebar border */
  padding: 0 clamp(16px, 3vw, 40px);
}

.workspace:not(.has-messages) .chat-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.workspace.has-messages .chat-hero {
  display: none;
}

.chat-hero {
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #444;
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 999px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #111;
}

.conversation {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 32px 0 16px;
  /* Wide enough for the message list, but never overflow the column */
  width: 100%;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Hide scrollbar for Chrome, Safari, and Opera */
.conversation::-webkit-scrollbar {
  display: none;
}

.composer-footer {
  flex-shrink: 0;
  background-color: rgb(250, 248, 245);
  width: 100%;
  padding: 16px 0 24px;
  z-index: 10;
}

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

.disclaimer {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #888;
  text-align: center;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  /* Prevent the list itself from shrinking tighter than its content */
  flex-shrink: 0;
  /* Full width of the conversation column */
  width: 100%;
}

.chat-turn-user {
  display: flex;
  justify-content: flex-end;
  /* Don't let the row collapse narrower than its bubble */
  flex-shrink: 0;
  min-width: 0;
}

.user-turn-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  /* User bubbles are capped at a comfortable reading width, right-aligned */
  width: 100%;
  max-width: 48rem;
  min-width: 0;
}

.file-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.file-thumb {
  position: relative;
  width: 120px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  background-color: #ffffff;
}

.file-thumb-preview {
  height: 150px;
  background: linear-gradient(#f5f5f5, #fafafa);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 11px,
      #e8e8e8 11px,
      #e8e8e8 12px
    );
}

.file-thumb-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background-color: #666;
  border-radius: 3px;
}

.user-bubble {
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.45;
  color: #1a1a1a;
  background-color: #eceae6;
  border-radius: 4px;
}

.chat-turn-assistant {
  display: flex;
  justify-content: flex-start;
  /* Prevent row from squishing narrower than its content */
  flex-shrink: 0;
  min-width: 0;
}

.assistant-turn-content {
  /* Assistant responses fill the column's readable area, centered */
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.assistant-bubble {
  padding: 4px 0;
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a1a;
}

.assistant-bubble code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  padding: 1px 5px;
  background-color: #f0f0f0;
  border-radius: 4px;
}

.assistant-bubble.error {
  color: #c0392b;
}

/* Upgrade Prompt Card */
.upgrade-prompt-card {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background-color: #fff9f0;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  color: #9a3412;
  box-shadow: 0 2px 10px rgba(234, 88, 12, 0.08);
  max-width: 580px;
  width: 100%;
}

.upgrade-prompt-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: #ea580c;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upgrade-prompt-icon svg {
  width: 28px;
  height: 28px;
}

.upgrade-prompt-body {
  flex: 1;
  min-width: 0;
}

.upgrade-prompt-title {
  font-size: 14px;
  font-weight: 600;
  color: #9a3412;
  margin: 0 0 2px 0;
}

.upgrade-prompt-desc {
  font-size: 13px;
  line-height: 1.4;
  color: #c2410c;
  margin: 0;
}

.upgrade-prompt-desc strong {
  color: #7c2d12;
}

.upgrade-prompt-btn {
  flex-shrink: 0;
  background-color: #ea580c;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.upgrade-prompt-btn:hover {
  background-color: #c2410c;
}

.upgrade-prompt-btn:active {
  transform: scale(0.98);
}

.upgrade-prompt-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

html.dark .upgrade-prompt-card {
  background-color: #2a1b12;
  border-color: #7c2d12;
  color: #fed7aa;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

html.dark .upgrade-prompt-title {
  color: #ffedd5;
}

html.dark .upgrade-prompt-desc {
  color: #fdba74;
}

html.dark .upgrade-prompt-desc strong {
  color: #ffffff;
}

html.dark .upgrade-prompt-btn {
  background-color: #f97316;
  color: #ffffff;
}

html.dark .upgrade-prompt-btn:hover {
  background-color: #ea580c;
}

/* AI Provider Quota Notification Card */
.ai-quota-card {
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #991b1b;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.08);
  max-width: 580px;
  width: 100%;
}

.ai-quota-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.ai-quota-icon svg {
  width: 26px;
  height: 26px;
}

.ai-quota-body {
  flex: 1;
  min-width: 0;
}

.ai-quota-title {
  font-size: 14px;
  font-weight: 600;
  color: #991b1b;
  margin: 0 0 3px 0;
}

.ai-quota-desc {
  font-size: 13px;
  line-height: 1.45;
  color: #b91c1c;
  margin: 0;
}

html.dark .ai-quota-card {
  background-color: #2b1414;
  border-color: #7f1d1d;
  color: #fecaca;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

html.dark .ai-quota-icon {
  color: #f87171;
}

html.dark .ai-quota-title {
  color: #fee2e2;
}

html.dark .ai-quota-desc {
  color: #fca5a5;
}

/* File Preview Card (Dark Theme) */

.file-preview-card {
  margin-top: 14px;
  background-color: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  color: #f4f4f5;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  max-width: 560px;
  width: 100%;
  transition: all 0.2s ease;
}

.file-preview-card.is-expired {
  opacity: 0.7;
  border-color: #3f3f46;
}

.file-card-main {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.file-card-left {
  flex-shrink: 0;
}

.file-card-icon-badge {
  position: relative;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #27272a, #202023);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.file-card-doc-icon {
  width: 22px;
  height: 22px;
  color: #60a5fa;
}

.file-card-type-tag {
  position: absolute;
  bottom: -4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background-color: #2563eb;
  color: #ffffff;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}

.file-card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.file-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card-subtext {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #a1a1aa;
}

.subtext-dot {
  color: #52525b;
}

.file-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.file-card-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: #27272a;
  color: #a1a1aa;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.15s ease;
}

.file-card-icon-btn:hover {
  background-color: #3f3f46;
  color: #ffffff;
}

.file-card-delete-btn:hover {
  background-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.action-svg {
  width: 16px;
  height: 16px;
}

.file-card-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background-color: #ffffff;
  color: #09090b;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.file-card-download-btn:hover:not(.disabled) {
  background-color: #e4e4e7;
  transform: translateY(-1px);
}

.file-card-download-btn.disabled {
  background-color: #3f3f46;
  color: #71717a;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-download-icon {
  width: 15px;
  height: 15px;
}

.file-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background-color: #121215;
  border-top: 1px solid #27272a;
  font-size: 11px;
}

.file-card-expiry-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fbbf24;
}

.file-preview-card.is-expired .file-card-expiry-notice {
  color: #f87171;
}

.expiry-icon {
  font-size: 12px;
  line-height: 1;
}

.expiry-text {
  font-weight: 500;
}

.file-card-countdown {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #a1a1aa;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.chat-turn-loading {
  display: flex;
  justify-content: flex-start;
  /* Keep the loading row at full column width — don't let it collapse */
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
}

.loading-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: #888;
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.spinner-svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #555;
}

@keyframes spinner-fade {
  0%   { opacity: 1; }
  100% { opacity: 0.08; }
}

.spinner-spoke {
  animation: spinner-fade 0.8s linear infinite;
}

.generating-text {
  color: #888;
}

.chat-box.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.pending-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pending-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.pending-file-remove {
  font-size: 16px;
  line-height: 1;
  color: #888;
  border-radius: 3px;
}

.pending-file-remove:hover {
  color: #c0392b;
}

.chat-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 28px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-box:focus-within {
  border-color: #888;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.88);
  pointer-events: none;
}

.drop-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.drop-overlay-icon {
  width: 92px;
  height: auto;
}

.drop-overlay-label {
  font-size: 18px;
  font-weight: 500;
  color: #1a1a1a;
}

.plus-menu {
  position: relative;
  flex-shrink: 0;
}

.plus-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 20px;
  font-weight: 300;
  color: #666;
  line-height: 1;
  border-radius: 4px;
}

.plus-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.plus-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  min-width: 140px;
  background-color: var(--clr-surface, #ffffff);
  border: 1px solid var(--clr-border, #ccc);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 30;
  overflow: hidden;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.chat-input {
  flex: 1;
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

.chat-input::placeholder {
  color: #888;
}

/* ============================================================
   THEME VARIABLES
   ============================================================ */

:root {
  --clr-bg: rgb(250, 248, 245);
  --clr-surface: #ffffff;
  --clr-surface-2: #f5f4f1;
  --clr-border: #ddd;
  --clr-text: #1a1a1a;
  --clr-text-muted: #888;
  --clr-hover: rgba(0, 0, 0, 0.04);
  --clr-active: #ececec;
  --clr-accent: #1a1a1a;
}

/* Dark mode */
html.dark {
  --clr-bg: #1a1a1a;
  --clr-surface: #242424;
  --clr-surface-2: #2c2c2c;
  --clr-border: #3a3a3a;
  --clr-text: #e8e6e3;
  --clr-text-muted: #888;
  --clr-hover: rgba(255, 255, 255, 0.05);
  --clr-active: #333333;
  --clr-accent: #e8e6e3;
  color-scheme: dark;
}

html.dark body {
  background-color: var(--clr-bg);
  color: var(--clr-text);
}

html.dark .sidebar {
  background-color: #111111;
  border-right-color: var(--clr-border);
}

html.dark .sidebar-brand-logo {
  filter: brightness(0) invert(1);
}

html.light .sidebar-brand-logo {
  filter: none;
}

html.dark .sidebar-item {
  color: var(--clr-text-muted);
}

html.dark .sidebar-item.active {
  background-color: var(--clr-active);
  color: var(--clr-text);
}

html.dark .sidebar-item:hover {
  background-color: var(--clr-hover);
}

html.dark .recent-chat-row:hover,
html.dark .recent-chat-row.active {
  background-color: var(--clr-hover);
}

html.dark .chat-box {
  background-color: var(--clr-surface);
  border-color: var(--clr-border);
}

html.dark .composer-footer {
  background-color: var(--clr-bg);
}

html.dark .user-bubble {
  background-color: var(--clr-surface-2);
  color: var(--clr-text);
}

html.dark .assistant-bubble {
  color: var(--clr-text);
}

html.dark .hero-badge {
  background-color: var(--clr-surface);
  border-color: var(--clr-border);
  color: var(--clr-text-muted);
}

html.dark .hero-title {
  color: var(--clr-text);
}

html.dark .loading-bubble {
  background-color: var(--clr-surface);
  border-color: var(--clr-border);
  color: var(--clr-text-muted);
}

html.dark .search-dialog {
  background-color: var(--clr-surface);
  border-color: var(--clr-border);
  color: var(--clr-text);
}

html.dark .search-dialog-header {
  border-bottom-color: var(--clr-border);
}

html.dark .search-result-item:hover,
html.dark .search-result-item.active {
  background-color: var(--clr-hover);
}

html.dark .plus-dropdown,
html.dark .chat-menu-dropdown {
  background-color: var(--clr-surface);
  border-color: var(--clr-border);
}

html.dark .account-icon {
  border-color: var(--clr-text-muted);
}

/* Light mode (explicit) */
html.light {
  --clr-bg: rgb(250, 248, 245);
  --clr-surface: #ffffff;
  --clr-surface-2: #f5f4f1;
  --clr-border: #ddd;
  --clr-text: #1a1a1a;
  --clr-text-muted: #888;
  --clr-hover: rgba(0, 0, 0, 0.04);
  --clr-active: #ececec;
  color-scheme: light;
}

/* High contrast */
html[data-contrast="high"] {
  --clr-border: #555;
  --clr-text-muted: #555;
  filter: contrast(1.12);
}

/* Accent colours */
html[data-accent="blue"]   { --clr-accent: #2563eb; }
html[data-accent="green"]  { --clr-accent: #16a34a; }
html[data-accent="orange"] { --clr-accent: #ea580c; }
html[data-accent="red"]    { --clr-accent: #dc2626; }
html[data-accent="purple"] { --clr-accent: #7c3aed; }

/* ============================================================
   SETTINGS MODAL
   ============================================================ */

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.settings-overlay.hidden {
  display: none;
}

.settings-dialog {
  position: relative;
  display: flex;
  width: min(92vw, 860px);
  height: min(88vh, 640px);
  background-color: var(--clr-surface, #ffffff);
  border: 1px solid var(--clr-border, #ddd);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  color: var(--clr-text, #1a1a1a);
}

/* --- Settings sidebar --- */
.settings-sidebar {
  width: 210px;
  flex-shrink: 0;
  background-color: var(--clr-surface-2, #f5f4f1);
  border-right: 1px solid var(--clr-border, #ddd);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.settings-sidebar-header {
  padding: 20px 18px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--clr-text-muted, #888);
}

.settings-nav-list {
  list-style: none;
  padding: 0 8px 16px;
}

.settings-nav-item {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--clr-text, #1a1a1a);
  transition: background-color 0.12s ease;
  user-select: none;
}

.settings-nav-item:hover {
  background-color: var(--clr-hover, rgba(0,0,0,0.04));
}

.settings-nav-item.active {
  background-color: var(--clr-active, #ececec);
  font-weight: 600;
}

/* --- Settings content area --- */
.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-section-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--clr-text, #1a1a1a);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--clr-border, #ddd);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--clr-text, #1a1a1a);
  flex-shrink: 0;
}

.settings-select {
  padding: 7px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--clr-text, #1a1a1a);
  background-color: var(--clr-surface, #ffffff);
  border: 1px solid var(--clr-border, #ddd);
  border-radius: 6px;
  cursor: pointer;
  min-width: 180px;
  outline: none;
  appearance: auto;
}

.settings-select:focus {
  border-color: #999;
}

.settings-placeholder {
  font-size: 14px;
  color: var(--clr-text-muted, #888);
  margin-top: 8px;
}

/* --- Close button --- */
.settings-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--clr-text-muted, #888);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.settings-close-btn:hover {
  background-color: var(--clr-hover, rgba(0,0,0,0.05));
  color: var(--clr-text, #1a1a1a);
}

.settings-close-btn svg {
  width: 16px;
  height: 16px;
}

/* Account row — wraps account button + gear icon on the same line */
.account-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
}

.account-row .account {
  flex: 1;
  min-width: 0;
}

.account-avatar-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.account-avatar-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.account-google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.account-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.user-plan-badge {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--clr-text-muted, #888);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan-badge.hidden {
  display: none;
}

/* Gear icon button beside the account row */
.account-settings-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--clr-text-muted, #888);
  opacity: 1;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.account-settings-btn svg {
  width: 16px;
  height: 16px;
}

.account-settings-btn:hover {
  background-color: var(--clr-hover, rgba(0, 0, 0, 0.06));
  color: var(--clr-text, #1a1a1a);
}

/* Dark mode gear icon */
html.dark .account-settings-btn:hover {
  background-color: var(--clr-hover);
  color: var(--clr-text);
}

.settings-btn-danger {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  background-color: #e53e3e;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.settings-btn-danger:hover {
  background-color: #c53030;
}

.usage-counter { font-size: 11px; opacity: .7; padding: 0; line-height: 1.2; }
.usage-counter-full { color: #d93025; opacity: 1; }
.qpgen-toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 1000; }
.qpgen-toast.show { opacity: 1; transform: translate(-50%, 0); }
.usage-counter.hidden { display: none; }

/* ============================================================
   MOBILE VIEWPORT DEFINITIVE OVERRIDES (≤ 768px)
   Must remain at the very end of this file so it overrides all base rules.
   ============================================================ */

@media (max-width: 768px) {
  html,
  body {
    width: 100% !important;
    max-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 2. .app: full width, strictly contained, no horizontal overflow */
  .app {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 1. .sidebar: off-canvas drawer ONLY; does NOT participate in layout */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    height: 100dvh !important;
    width: min(84vw, 310px) !important; /* DO NOT USE var(--sidebar-width) */
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    flex: none !important;
    flex-shrink: 0 !important;
    z-index: 200 !important;
    background-color: var(--clr-bg, rgb(250, 248, 245)) !important;
    border-right: 1px solid var(--clr-border, #ddd) !important;
    box-shadow: none !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease !important;
    display: flex !important;
    flex-direction: column !important;
    pointer-events: none !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.25) !important;
    pointer-events: all !important;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    z-index: 190 !important;
    background-color: rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    opacity: 0;
    transition: opacity 0.25s ease !important;
    pointer-events: none !important;
  }

  .sidebar-backdrop.active {
    display: block !important;
    opacity: 1 !important;
    pointer-events: all !important;
  }

  .sidebar-close-btn {
    display: flex !important;
  }

  /* 4. Hide desktop collapse button and resizer on mobile */
  #sidebar-toggle-btn,
  .sidebar-toggle-btn,
  .sidebar-resizer {
    display: none !important;
  }

  /* 3. .main: full width, no margin-left/padding-left tied to sidebar */
  .main {
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    flex: 1 1 auto !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  /* Show Gemini mobile top bar */
  .mobile-top-bar {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 5. Workspace & Chat Column: min-width: 0, no fixed widths */
  .workspace {
    flex: 1 1 0% !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  .chat-column {
    flex: 1 1 0% !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  .conversation {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 12px 8px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .message-list {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    gap: 16px !important;
  }

  /* 6. Message bubbles: max-width 100% with overflow-wrap anywhere */
  .chat-turn-user,
  .chat-turn-assistant {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .user-turn-content {
    max-width: 88% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .assistant-turn-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .user-bubble {
    max-width: 100% !important;
    border-radius: 18px 18px 4px 18px !important;
    padding: 10px 14px !important;
    font-size: 14.5px !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
  }

  .assistant-bubble {
    max-width: 100% !important;
    font-size: 14.5px !important;
    line-height: 1.6 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
  }

  .assistant-bubble pre,
  .assistant-bubble code {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    word-break: normal !important;
  }

  /* 5. Composer & .chat-box: full width, 12px wrapper padding, send button inside capsule */
  .composer-footer {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 8px 12px max(10px, env(safe-area-inset-bottom)) !important;
    background-color: var(--clr-bg, rgb(250, 248, 245)) !important;
  }

  .composer {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .chat-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 8px 6px 12px !important;
    border-radius: 28px !important;
    min-height: 48px !important;
  }

  .chat-input {
    min-width: 0 !important;
    flex: 1 1 0% !important;
    width: 0 !important;
    font-size: 16px !important; /* Prevents iOS auto-zoom */
    padding: 6px 4px !important;
    box-sizing: border-box !important;
  }

  .mobile-send-btn {
    flex-shrink: 0 !important;
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Compact format button & plus button */
  .format-btn {
    height: 28px !important;
    padding: 0 7px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    gap: 2px !important;
  }

  .format-btn-chevron {
    width: 11px !important;
    height: 11px !important;
  }

  .plus-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 20px !important;
  }

  .disclaimer {
    font-size: 11px !important;
    margin-top: 5px !important;
  }

  /* Hero on mobile */
  .hero-title {
    font-size: clamp(1.8rem, 7vw, 2.35rem) !important;
    line-height: 1.15 !important;
  }

  .hero-subtitle {
    font-size: 13.5px !important;
    padding: 0 10px !important;
  }

  .hero-suggestions {
    margin-top: 16px !important;
    gap: 6px !important;
    padding: 0 4px !important;
  }

  .suggestion-chip {
    padding: 7px 12px !important;
    font-size: 12px !important;
  }

  /* Settings Modal on mobile: bottom sheet */
  .settings-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .settings-dialog {
    width: 100% !important;
    height: 90vh !important;
    height: 90dvh !important;
    border-radius: 20px 20px 0 0 !important;
    flex-direction: column !important;
    max-height: 90dvh !important;
  }

  .settings-sidebar {
    width: 100% !important;
    flex-shrink: 0 !important;
    border-right: none !important;
    border-bottom: 1px solid var(--clr-border) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .settings-sidebar-header {
    display: none !important;
  }

  .settings-nav-list {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    padding: 8px 12px !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
  }

  .settings-nav-item {
    padding: 6px 12px !important;
    font-size: 13px !important;
    border-radius: 999px !important;
  }

  .settings-content {
    padding: 20px 16px !important;
    flex: 1 !important;
    overflow-y: auto !important;
  }

  /* Search Modal on mobile */
  .search-modal {
    padding: 16px 12px !important;
    align-items: flex-start !important;
  }

  .search-dialog {
    max-height: 80vh !important;
    border-radius: 16px !important;
  }

  /* File Preview Card on mobile */
  .file-card-main {
    padding: 12px !important;
    gap: 10px !important;
  }

  .file-card-download-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
}


