/* Antigravity NAS Console - Apple Light Aesthetic Theme */
:root {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f1f5;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #0071e3;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --success: #28c840;
  --warning: #febc2e;
  --danger: #ff5f57;
  --card-bg: #ffffff;
  --header-height: 72px;
  --sidebar-width: 320px;
  --aside-width: 320px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.03);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Header - Hard locked 72px with Apple Glass Aesthetic */
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.brand-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-only {
  display: none !important;
}

.mobile-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.mobile-toggle-btn:hover {
  background: var(--bg-tertiary);
}

.btn-close-drawer {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #f0f1f5;
  color: var(--text-secondary);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-close-drawer:hover {
  background: #e5e5ea;
  color: var(--text-primary);
}

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

.sidebar-header-top .btn-new-chat {
  flex: 1;
}

.sidebar-right-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: #fafafc;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0071e3, #42a5f5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.badge-mock {
  font-size: 11px;
  background-color: rgba(254, 188, 46, 0.15);
  color: #b45309;
  border: 1px solid rgba(254, 188, 46, 0.35);
  padding: 3px 10px;
  border-radius: 980px;
  font-weight: 600;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background-color: #f0f1f5;
  border-radius: 980px;
  border: 1px solid var(--border-color);
  font-weight: 500;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.status-dot.online {
  background-color: var(--success);
  box-shadow: 0 0 8px rgba(40, 200, 64, 0.6);
}

.status-dot.offline {
  background-color: var(--danger);
}

.btn-token {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: 980px;
  background: white;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-token:hover {
  background: #f5f5f7;
}

/* Sub-page Navigation Capsule Buttons */
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 980px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  white-space: nowrap;
}

.nav-btn.btn-back {
  background: #e8f2fe;
  color: #0071e3;
  border: 1px solid rgba(0, 113, 227, 0.2);
}

.nav-btn.btn-back:hover {
  background: #d4e7fd;
  transform: translateY(-1px);
}

.nav-btn.btn-home {
  background: #0071e3;
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.25);
}

.nav-btn.btn-home:hover {
  background: #0077ed;
  transform: translateY(-1px);
}

/* App Container 3-Column Layout */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  background: var(--bg-primary);
}

/* Left Sidebar */
.sidebar-left {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

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

.btn-new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.2);
}

.btn-new-chat:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.search-box {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.search-box:focus {
  border-color: var(--border-focus);
  background-color: #ffffff;
}

/* Pinned Project Folders Bar (置顶项目文件夹分段栏) */
.project-folders-bar {
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--border-color);
  background: #fafafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-folders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-folders-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.folder-title-icon {
  font-size: 13px;
}

.view-mode-toggle {
  display: inline-flex;
  background: #e5e5ea;
  padding: 2px;
  border-radius: 980px;
  gap: 2px;
}

.btn-view-mode {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 980px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

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

.btn-view-mode.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.project-pills {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}

.project-pills::-webkit-scrollbar {
  height: 4px;
}

.project-pills::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
}

.project-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 980px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.project-pill:hover {
  background: #f0f1f5;
  border-color: rgba(0, 113, 227, 0.35);
  transform: translateY(-1px);
}

.project-pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.28);
}

.project-pill .pill-count {
  font-size: 10px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 6px;
  border-radius: 980px;
  opacity: 0.85;
}

.project-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  opacity: 1;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Folder Groups for Collapsible Project Tree */
.folder-group {
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  transition: box-shadow 0.15s ease;
}

.folder-group:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.folder-group-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  background: #f8f9fb;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.12s ease;
}

.folder-group.collapsed .folder-group-header {
  border-bottom: 1px solid transparent;
}

.folder-group-header:hover {
  background: #eff2f7;
}

.folder-chevron {
  font-size: 11px;
  color: var(--text-muted);
  width: 14px;
  text-align: center;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.folder-group.collapsed .folder-chevron {
  transform: rotate(-90deg);
}

.folder-group-icon {
  font-size: 13px;
}

.folder-group-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-group-badge {
  font-size: 10.5px;
  font-weight: 600;
  background: #e5e5ea;
  color: var(--text-secondary);
  padding: 1px 7px;
  border-radius: 980px;
}

.folder-group-body {
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.folder-group.collapsed .folder-group-body {
  display: none;
}

/* Conversation Item */
.conv-item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.conv-item:hover {
  background-color: var(--bg-tertiary);
}

.conv-item.active {
  background-color: #e8f2fe;
  border-color: rgba(0, 113, 227, 0.3);
}

.conv-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 20px;
}

.conv-item-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Timeline Project Tag Chip */
.project-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 500;
  background: #eef4fe;
  color: #0071e3;
  border: 1px solid rgba(0, 113, 227, 0.15);
  border-radius: 4px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Delete Button on Hover */
.btn-delete-conv {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}

.conv-item:hover .btn-delete-conv {
  opacity: 1;
}

.btn-delete-conv:hover {
  background-color: rgba(255, 95, 87, 0.15);
  color: var(--danger);
}

/* Center Chat Surface */
.chat-surface {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  position: relative;
}

.message-stream {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.msg-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
}

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

.msg-wrapper.assistant {
  align-items: flex-start;
}

.msg-bubble {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  line-height: 1.6;
  position: relative;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.msg-wrapper.user .msg-bubble {
  background-color: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-wrapper.assistant .msg-bubble {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

/* Markdown elements styling inside message bubbles */
.msg-bubble p {
  margin: 0 0 10px 0;
}
.msg-bubble p:last-child {
  margin-bottom: 0;
}
.msg-bubble pre {
  background-color: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 10px 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}
.msg-wrapper.user .msg-bubble pre {
  background-color: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}
.msg-bubble code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
}
.msg-wrapper.assistant .msg-bubble code:not(pre code) {
  background-color: #f0f2f5;
  padding: 2px 6px;
  border-radius: 4px;
  color: #d1245b;
}
.msg-wrapper.user .msg-bubble code:not(pre code) {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3, .msg-bubble h4 {
  margin: 14px 0 8px 0;
  font-weight: 700;
  color: inherit;
}
.msg-bubble h1:first-child, .msg-bubble h2:first-child, .msg-bubble h3:first-child {
  margin-top: 0;
}
.msg-bubble h1 { font-size: 18px; }
.msg-bubble h2 { font-size: 16px; }
.msg-bubble h3 { font-size: 15px; }
.msg-bubble ul, .msg-bubble ol {
  margin: 8px 0;
  padding-left: 22px;
}
.msg-bubble li {
  margin-bottom: 4px;
}
.msg-bubble blockquote {
  border-left: 3px solid var(--accent);
  margin: 10px 0;
  padding-left: 12px;
  color: var(--text-secondary);
}
.msg-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 13px;
}
.msg-bubble th, .msg-bubble td {
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  text-align: left;
}
.msg-bubble th {
  background-color: #f6f8fa;
  font-weight: 600;
}

/* Conv Item delete button */
.conv-item {
  position: relative;
}
.btn-delete-conv {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  transition: all 0.15s ease;
}
.conv-item:hover .btn-delete-conv {
  display: flex;
}
.btn-delete-conv:hover {
  background: #fee2e2;
  color: #ef4444;
}
  margin-top: 10px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  width: 100%;
  box-shadow: var(--shadow-subtle);
}

.events-header {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text-secondary);
  user-select: none;
  font-weight: 600;
}

.events-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
  font-family: SF Mono, Consolas, Monaco, monospace;
}

.event-entry {
  color: var(--text-secondary);
  font-size: 11.5px;
}

.event-entry.highlight {
  color: #0071e3;
  font-weight: 500;
}

/* Chat Input Area */
.chat-input-area {
  padding: 16px 32px 24px;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachment-preview-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 980px;
  font-size: 12px;
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.attachment-chip .remove-chip {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
}

.attachment-chip .remove-chip:hover {
  color: var(--danger);
}

.input-box-wrapper {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-box-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.chat-textarea {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14.5px;
  resize: none;
  min-height: 56px;
  max-height: 180px;
  line-height: 1.5;
}

.input-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

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

.btn-tool {
  background: #f5f5f7;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 980px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.btn-tool:hover {
  background-color: #e8e8ed;
  color: var(--text-primary);
}

.btn-send {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 980px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.2);
}

.btn-send:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-stop {
  background-color: var(--danger);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 980px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: none;
}

/* Right Sidebar */
.sidebar-right {
  width: var(--aside-width);
  background-color: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 18px;
  gap: 16px;
}

.panel-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-subtle);
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.device-info-table {
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-row {
  display: flex;
  justify-content: space-between;
}

.device-row span:first-child {
  color: var(--text-secondary);
}

.device-row span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: #f5f5f7;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  border: 1px solid var(--border-color);
}

.file-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
  color: var(--text-primary);
  font-weight: 500;
}

.btn-download {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 980px;
  background-color: #e8f2fe;
  border: 1px solid rgba(0, 113, 227, 0.2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-download:hover {
  background-color: #d4e7fd;
}

/* ========================================================
   Mobile & Responsive Adaptations (iOS / Android / Tablets)
   ======================================================== */
@media (max-width: 900px) {
  .mobile-only {
    display: inline-flex !important;
  }

  .sidebar-header-top .mobile-only {
    display: inline-flex !important;
  }

  .sidebar-right-header.mobile-only {
    display: flex !important;
  }

  /* Header mobile adjustment */
  .app-header {
    padding: 0 12px;
    gap: 8px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
    border-radius: 8px;
  }

  .brand-title {
    font-size: 15px;
  }

  .badge-mock {
    display: none; /* Hide badge on mobile to conserve space */
  }

  .header-status {
    gap: 6px;
  }

  .status-indicator {
    padding: 5px 8px;
  }

  .status-text-label {
    display: none; /* Keep just the glowing dot on small screens */
  }

  .btn-token {
    padding: 5px 8px;
    font-size: 11.5px;
  }

  .nav-btn {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  /* Sliding Drawer: Left Sidebar */
  .sidebar-left {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 84%;
    max-width: 320px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    border-right: 1px solid var(--border-color);
    background: #ffffff;
  }

  .sidebar-left.open {
    transform: translateX(0);
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.2);
  }

  /* Sliding Drawer: Right Sidebar */
  .sidebar-right {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 84%;
    max-width: 320px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    border-left: 1px solid var(--border-color);
    background: #ffffff;
    overflow-y: auto;
  }

  .sidebar-right.open {
    transform: translateX(0);
    box-shadow: -6px 0 30px rgba(0, 0, 0, 0.2);
  }

  /* Chat surface on Mobile */
  .chat-surface {
    width: 100%;
    min-width: 0;
  }

  .message-stream {
    padding: 12px 14px 16px;
    gap: 14px;
  }

  .msg-bubble {
    max-width: 92%;
    padding: 10px 14px;
    font-size: 14px;
  }

  .chat-input-area {
    padding: 8px 10px max(10px, env(safe-area-inset-bottom));
  }

  .chat-textarea {
    font-size: 16px !important; /* Critical for iOS Safari: prevents viewport zoom jump */
    min-height: 52px;
    padding: 8px 10px;
  }

  #drag-hint {
    display: none; /* Hide drag text on touch phones */
  }

  .btn-tool {
    padding: 5px 8px;
    font-size: 11.5px;
  }

  .btn-send, .btn-stop {
    padding: 6px 14px;
    font-size: 12.5px;
  }
}

/* Extra small mobile screens (iPhone SE / mini, 375px) */
@media (max-width: 480px) {
  .app-header {
    padding: 0 8px;
  }

  .brand-title {
    font-size: 13.5px;
  }

  .btn-token {
    display: none;
  }

  .nav-btn {
    padding: 5px 8px;
    font-size: 11px;
    gap: 2px;
  }
}
