/* ===== Miyagi Chat — App-specific styles ===== */
/* Theme tokens, reset, scrollbars: shared/theme.css */
/* Topbar, waffle, search, sidebar frame, input, pills, modals, LLM pane, messages, help: shared/shell.css */

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

/* Pipeline health dots — one row per assistant message, 5 dots for each pipeline step */
.pipeline-row {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 0 4px;
}
.pipeline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border, #333);
  cursor: default;
  position: relative;
}
.pipeline-dot.ok { background: var(--accent, #6c9); }
.pipeline-dot.fail { background: #e05252; }
.pipeline-dot.skip { background: var(--border, #333); opacity: 0.4; }
.pipeline-dot[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--surface2, #222);
  color: var(--text, #eee);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  z-index: 100;
  pointer-events: none;
  border: 1px solid var(--border, #333);
}
.pipeline-dot[data-error] { cursor: pointer; }
.pipeline-dot.copied { outline: 2px solid var(--accent, #6c9); outline-offset: 1px; }

/* Pipeline error text — copyable on click */
.pipeline-error {
  font-size: 11px;
  color: #e05252;
  padding: 2px 6px;
  margin-left: 4px;
  cursor: pointer;
  user-select: text;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
}
.pipeline-error:hover { text-decoration: underline; }
.pipeline-row { flex-wrap: wrap; }

/* Staged context indicator in pipeline row */
.pipeline-staged {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--accent);
  margin-left: 6px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pipeline-staged .material-symbols-outlined { font-size: 14px; }

/* RAG chunk viewer — expandable list below pipeline row */
.rag-viewer {
  padding: 4px 0 8px;
  max-height: 300px;
  overflow-y: auto;
}
.rag-viewer-empty {
  font-size: 11px;
  color: var(--muted, #888);
  padding: 4px 0;
}
.rag-chunk-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 11px;
  color: var(--text, #eee);
}
.rag-chunk-icon {
  font-size: 13px;
  color: var(--muted, #888);
  flex-shrink: 0;
}
.rag-chunk-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.rag-chunk-topic {
  font-size: 10px;
  color: var(--muted, #888);
  background: var(--surface2, #222);
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.rag-chunk-score {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.rag-chunk-score.high { color: var(--accent, #6c9); }
.rag-chunk-score.mid { color: #e8a838; }
.rag-chunk-score.low { color: var(--muted, #888); }
.rag-fb-group {
  display: inline-flex;
  gap: 2px;
  flex-shrink: 0;
}
.rag-fb {
  background: none;
  border: none;
  color: var(--muted, #888);
  cursor: pointer;
  padding: 1px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.rag-fb:hover { opacity: 1; }
.rag-fb .material-symbols-outlined { font-size: 12px; }
.rag-fb.active { opacity: 1; color: var(--accent, #6c9); }
.rag-fb.active[data-fb="down"] { color: #e05252; }

/* Edit message button */
.edit-msg-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.edit-msg-btn:hover { color: var(--text2); background: var(--surface); }

/* User bubble refinements */
.message.user .edit-hint { order: -1; }
.message.user .content pre { background: var(--code-bg); }
.message.user .content p:first-child { margin-top: 0; }
.message.user .content p:last-child { margin-bottom: 0; }
.message.user .show-more-btn { align-self: flex-end; }

/* Message action buttons (reply, task, wiki) */
.msg-actions {
  display: inline-flex;
  gap: 2px;
  margin-left: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.message:hover .msg-actions { opacity: 1; }
.msg-action-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.msg-action-btn:hover { color: var(--accent); border-color: var(--accent); }
.msg-action-btn .icon-sm { font-size: 16px; }

/* Inline threading */
.thread-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 32px;
  margin-bottom: 8px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  border-radius: 6px;
  transition: background 0.1s;
}
.thread-indicator:hover { background: var(--surface); }
.thread-indicator .icon-sm { font-size: 15px; }
.thread-container {
  display: none;
  margin-left: 32px;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}
.thread-container[data-visible="true"] { display: block; }
.thread-container .message {
  max-width: 100%;
  margin-bottom: 10px;
  align-self: stretch;
}
.thread-container .message.user { align-self: flex-end; max-width: 85%; }
.thread-container .message.user .content {
  padding: 8px 12px;
  border-radius: 12px 12px 4px 12px;
}
.thread-container .message .role { font-size: 11px; margin-bottom: 2px; }
.thread-container .message .content { font-size: 14px; }
.thread-empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
.thread-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}
.thread-input-field {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  resize: none;
  line-height: 1.4;
  min-height: 36px;
  max-height: 120px;
}
.thread-input-field:focus { outline: none; border-color: var(--accent); }
.thread-send {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--on-accent, #fff);
  flex-shrink: 0;
}
.thread-send:hover { opacity: 0.85; }
.thread-send .icon-sm { font-size: 16px; }
@media (max-width: 768px) {
  .thread-container { margin-left: 16px; padding-left: 8px; }
  .thread-indicator { margin-left: 16px; }
}

/* Chunked assistant messages — visual separation between sections */
.msg-chunk { margin-bottom: 6px; }
.msg-chunk-first { margin-bottom: 6px; }
.msg-chunk-last { margin-bottom: 20px; }
.msg-chunk:not(.msg-chunk-first) .content { padding-top: 2px; }

/* Unified pill system — topic, model, style all share one style */
.pill-wrapper { position: relative; margin-left: 2px; }
.chat-pill {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  transition: border-color 100ms ease, color 100ms ease;
}
.chat-pill:hover { border-color: var(--accent); color: var(--accent); }
.chat-pill.pill-active { color: var(--accent); border-color: var(--accent); }
.pill-dropdown {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 0;
  min-width: 150px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  margin-bottom: 4px;
}
.pill-dropdown.open { display: block; }
.pill-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
}
.pill-option:hover { background: var(--bg3); }
.pill-option.selected { color: var(--accent); }
.pill-option .check { width: 16px; font-size: 12px; }
.pill-divider { height: 1px; background: var(--border); margin: 4px 0; }
.pill-header { padding: 4px 12px 2px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* === Bulk Action Bar (Gmail-style) === */
.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px;
  background: transparent;
  border-bottom: none;
  font-size: 13px;
  color: var(--text2);
  min-height: 32px;
  flex-shrink: 0;
}
/* bulk-action-bar always visible in list view */
.bulk-action-bar .bulk-select-all {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent, #1a73e8);
  flex-shrink: 0;
}
.bulk-count { flex: 1; font-weight: 500; }
.bulk-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text2);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 100ms;
}
.bulk-btn:hover { background: var(--md-surface-container-low); color: var(--text); }
body.dark .bulk-btn:hover { background: rgba(255,255,255,0.08); }

/* === Conversation List View (Gmail inbox in main area) === */
#convListView { overflow: hidden; flex: 1; display: none; flex-direction: column; }
.conv-list-topbar {
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}
.conv-list-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.conv-list-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.conv-list-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.conv-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: none;
  border-left: none;
  border-radius: var(--radius-xs);
  margin: 1px 8px;
  transition: background 60ms ease;
  min-height: 44px;
}
.conv-list-row:hover { background: var(--md-surface-container-low); }
body.dark .conv-list-row:hover { background: var(--md-surface-container); }
.conv-list-row.active { background: var(--md-primary-container); }
.conv-list-row .star-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--muted);
  padding: 2px;
}
.conv-list-row .star-icon .material-symbols-outlined {
  font-size: 18px;
}
.conv-list-row .star-icon.starred {
  color: #f4b400;
}
.conv-list-row .star-icon:not(.starred) {
  opacity: 0.4;
}
.conv-list-row:hover .star-icon:not(.starred),
.conv-list-row.highlighted .star-icon:not(.starred) {
  opacity: 0.7;
}
.conv-list-row.selected {
  background: var(--md-secondary-container, #e8eaed);
}
body.dark .conv-list-row.selected {
  background: var(--md-secondary-container, #3c4043);
}
.conv-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--accent, #1a73e8);
}
.conv-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.conv-list-row .conv-row-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-row-snippet {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-list-row .conv-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.conv-list-row .conv-row-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.conv-list-row .conv-row-chips {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
/* .conv-tag-chip base: now in shell.css */
.conv-list-row .conv-row-actions {
  display: none;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.conv-list-row:hover .conv-row-actions { display: flex; }
.conv-list-row:hover .conv-row-date { display: none; }

/* back-btn, context-menu: now in shell.css */

/* === Main Layout === */
/* One data attribute controls all visibility. JS sets data-view, CSS does the rest. */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: var(--bg);
  order: 1;
  transition: background var(--transition);
  overflow-x: hidden;
}
/* Default: everything hidden */
#convListView, #chatView, #emptyState { display: none; }
#chatView { min-height: 0; flex: 1; flex-direction: column; }

/* new-chat: greeting + input only */
.main[data-view="new-chat"] #emptyState { display: flex; }

/* split: list + conversation side by side */
.main[data-view="split"] { flex-direction: row; }
.main[data-view="split"] #convListView { display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid var(--border-light); }
.main[data-view="split"] #chatView { display: flex; flex-direction: column; flex: none; min-width: 0; }
.main[data-view="split"] #topbar { display: flex; }

/* focus: full-width conversation */
.main[data-view="focus"] #chatView { display: flex; flex-direction: column; flex: 1; }
.main[data-view="focus"] #topbar { display: flex; }

/* === Topbar === */
#topbar { display: none; }
.topbar {
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border-bottom: none;
  background: transparent;
  transition: background var(--transition);
}
.menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  line-height: 0;
}
.menu-btn:hover { background: var(--surface); }
.topbar-title {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* Build/Work Mode Toggle — icon style, top right */
.app-mode-toggle {
  display: inline-flex;
  align-items: center;
}
.app-mode-btn {
  display: none; /* hidden — only the icon toggle is used */
}
.app-mode-icon-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 100ms ease, color 100ms ease;
}
.app-mode-icon-toggle:hover { background: var(--surface); color: var(--text2); }
.app-mode-icon-toggle.build-mode { color: var(--accent); }
.app-mode-icon-toggle .material-symbols-outlined { font-size: 20px; }

/* usage-dot, help-usage-row: shell.css */

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 32px 16px;
  position: relative;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}
.empty-state .logo {
  font-size: 36px;
  margin-bottom: 4px;
  width: 100%;
  max-width: 760px;
  text-align: center;
  padding-left: 0;
}
.empty-state .greeting {
  font-size: 30px;
  font-weight: 400;
  margin-bottom: 36px;
  width: 100%;
  max-width: 760px;
  text-align: center;
  padding-left: 0;
  color: var(--text);
}
.empty-prompt { width: 100%; max-width: 760px; }
/* Chat overrides streaming cursor color (base .message, .thinking-block, .copy-btn, .msg-meta/tokens: shell.css) */
.streaming-cursor::after { color: var(--accent); }
.edit-hint { display: none; position: absolute; right: 0; top: 0; }
.message.user:hover .edit-hint { display: block; }

/* input-area, input-container, input-main, input-toolbar, tb-btn, tb-spacer: now in shell.css */


/* Mic button (chat-specific; send-circle in shell.css) */
.mic-btn.has-text { display: none; }
.mic-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}
.mic-btn:hover { background: var(--surface); }
.mic-btn.recording { background: var(--md-error-container); color: var(--red); animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: 0.6; } }

/* File chips */
.file-chips { display: flex; gap: 4px; flex-wrap: wrap; padding: 3px 6px 0; }
.file-chip {
  background: var(--surface);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 3px;
}
.file-chip img { height: 20px; width: auto; border-radius: 3px; object-fit: cover; }
.file-chip button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 11px; }
.file-chip.uploading { opacity: 0.6; }
.chip-spinner { width: 10px; height: 10px; border: 2px solid var(--muted); border-top-color: var(--primary); border-radius: 50%; animation: chip-spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes chip-spin { to { transform: rotate(360deg); } }

/* Attached files summary in rendered user messages */
.attached-files-summary { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.file-chip-inline {
  background: var(--surface);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.file-chip-inline::before { content: '📎'; font-size: 11px; }

/* Conversation mode toggle — tiny */
.mode-toggle {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1px;
  margin-left: 2px;
}
.mode-toggle-btn {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: all 100ms;
  white-space: nowrap;
}
.mode-toggle-btn.active { background: var(--accent); color: var(--md-on-primary); }
.mode-toggle-btn:not(.active):hover { color: var(--text2); }

/* Coaching mode label */
/* Style pill merged into unified .chat-pill system */

.tb-focused { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Model dropdown — chat-specific overrides for the shared pill-dropdown pattern */
#modelDropdown {
  display: none;
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 6px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  min-width: 200px;
  padding: 4px 0;
  z-index: 20;
  max-height: 360px;
  overflow-y: auto;
}
#modelDropdown.open { display: block; }
.model-group-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 12px 3px;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.model-group-divider { border-top: 1px solid var(--border-light); margin: 3px 8px; }
.model-cost { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 400; }
.model-option { align-items: flex-start; }
.model-info { display: flex; flex-direction: column; gap: 1px; }
.model-name { font-size: 13px; }
.model-default { font-size: 10px; color: var(--accent); font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; }
.model-pricing { font-size: 11px; color: var(--muted); }
.model-provider { font-size: 10px; color: var(--muted); opacity: 0.7; }

/* .help-fab: now in shell.css */

/* Attach icon button */
.tb-icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 100ms ease;
}
.tb-icon-btn:hover { background: var(--surface); }

/* Search sources */
.search-sources { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border-light); }
.sources-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.source-chip {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 10px;
  padding: 1px 8px;
  text-decoration: none;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}
.source-chip:hover { background: var(--accent-dim); }

/* Deep Research */
.research-progress { display: flex; align-items: center; gap: 8px; padding: 10px 0; color: var(--muted); font-size: 13px; }
.research-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
/* @keyframes spin: now in shell.css */
/* overlay: now in shell.css */

/* === Desktop (>768px) === */
@media (min-width: 769px) {
  .sidebar.collapsed + .overlay + .main .menu-btn { display: none; }
}

/* === Mobile (<768px) === */
@media (max-width: 768px) {
  .send-circle.has-text { display: flex; }
  .mic-btn { width: 40px; height: 40px; }
  .mic-btn .material-symbols-outlined { font-size: 24px; }
  .mic-btn.has-text { display: none; }
  .empty-state .greeting { font-size: 20px; }
  /* Full-screen chat — no topbar, no sidebar, just messages + input */
  .messages-inner { padding: 12px; max-width: none; }
  .message .content { font-size: 15px; line-height: 1.6; }
  .input-area { background: var(--bg); position: sticky; bottom: 0; z-index: 5;
    padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .input-container { border-radius: 28px; padding: 6px 10px; }
  .input-main textarea { font-size: 16px; } /* prevent iOS zoom */
  body { padding-bottom: 0; }
  .main { padding-bottom: 0; height: 100dvh; }
  /* Toolbar pills: compact */
  .input-toolbar { gap: 1px; }
  .input-toolbar .tb-icon-btn[title="Attach (f)"] { display: none; }
  .chat-pill { font-size: 11px; padding: 2px 6px; }
  .chat-pill[title="Style (l)"] { display: none; }
  .mode-toggle-btn { font-size: 10px; padding: 2px 6px; }
}

/* === Large screens === */
@media (min-width: 1200px) {
  .messages-inner { max-width: 800px; }
  .empty-prompt, .input-container { max-width: 680px; }
}

/* ===== Help FAB (bottom-right, chat-only) ===== */

.help-fab {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: background 100ms ease;
}
.help-fab:hover { background: var(--surface2); color: var(--text2); }
.help-fab .material-symbols-outlined { font-size: 18px; }
@media (max-width: 768px) { button.help-fab { display: none; } }

/* ===== Help Modal (chat-only) ===== */

.help-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.32);
  backdrop-filter: blur(2px);
  z-index: 600;
  align-items: center;
  justify-content: center;
}
.help-bg.open { display: flex; }
.help-modal {
  background: var(--bg);
  border-radius: 20px;
  max-width: 640px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.help-modal h2 { font-size: 16px; font-weight: 500; margin-bottom: 16px; }
.help-section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 10px;
}
.help-modal .shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 20px; }
.help-modal .shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 13px;
}
.help-modal .shortcut-row kbd {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  min-width: 24px;
  text-align: center;
}
.help-modal .shortcut-row .keys {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
}
.help-modal table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.help-modal th, .help-modal td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border-light); }
.help-modal th { font-weight: 500; color: var(--text2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.tier-badge { display: inline-block; padding: 1px 5px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.tier-0 { background: #e8f5e9; color: #2e7d32; }
.tier-1 { background: #e3f2fd; color: #1565c0; }
.tier-2 { background: #fff3e0; color: #e65100; }
.tier-3 { background: #fce4ec; color: #c62828; }
body.dark .tier-0 { background: rgba(129,201,149,0.15); color: #81c995; }
body.dark .tier-1 { background: rgba(138,180,248,0.15); color: #8ab4f8; }
body.dark .tier-2 { background: rgba(253,214,99,0.15); color: #fdd663; }
body.dark .tier-3 { background: rgba(242,139,130,0.15); color: #f28b82; }
.best-for { color: var(--muted); font-size: 11px; }
.default-marker { color: var(--accent); font-weight: 500; font-size: 11px; }

/* Usage dot + row (help modal) */
.usage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  margin-left: 4px;
}
.usage-dot.warn { background: var(--yellow); }
.usage-dot.danger { background: var(--red); }
.help-usage-title { margin-top: 24px; }
.help-usage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text2);
  padding: 6px 0;
}
.help-usage-value {
  font-weight: 500;
  color: var(--text);
}
.help-footnote { margin-top: 12px; font-size: 12px; color: var(--on-surface-variant); }
.help-model-table { margin-top: 16px; }

/* ===== Sidebar Content (was sidebar.css) ===== */

/* Sidebar Sections & Items */
.sidebar-section { margin-top: 1px; }
.sidebar-section.collapsed .conv-group { display: none; }
.sidebar-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 12px 3px;
  letter-spacing: 0.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  border-radius: var(--radius-xs);
}
.sidebar-label:hover { color: var(--text2); }
.sidebar-label.focused { background: var(--surface); }
.sidebar-label.drag-over {
  background: var(--accent-light);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}
.folder-chevron {
  font-size: 18px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  flex-shrink: 0;
  line-height: 1;
}
.sidebar-label .count { font-size: 11px; color: var(--muted); font-weight: 400; }
.sidebar-label .folder-drag { opacity: 0; cursor: grab; color: var(--border); font-size: 14px; margin-left: auto; transition: opacity 0.12s; line-height: 1; }
.sidebar-label:hover .folder-drag { opacity: 0.5; }
.sidebar-label .folder-drag:hover { opacity: 1; color: var(--text2); }
.sidebar-label .folder-actions { display: none; gap: 2px; }
.sidebar-label:hover .folder-actions { display: flex; }
.sidebar-label .folder-actions button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 3px;
  border-radius: 3px;
}
.sidebar-label .folder-actions button:hover { color: var(--text); background: var(--surface2); }
.conv-group { padding: 1px 0; min-height: 1px; }
/* Gmail sidebar items: 32px, very compact, subtle hover */
.conv-item {
  padding: 0 12px 0 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  transition: background 60ms ease;
}
.conv-item:hover { background: rgba(0,0,0,0.04); }
body.dark .conv-item:hover { background: rgba(255,255,255,0.04); }
.conv-item.active { background: var(--md-primary-container); color: var(--md-on-primary-container); font-weight: 500; }
body.dark .conv-item.active { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.conv-item.focused { outline: 2px solid var(--accent); outline-offset: -2px; }
.conv-item.dragging { opacity: 0.4; }
.conv-item .drag-grip {
  color: var(--muted);
  font-size: 14px;
  cursor: grab;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.1s;
  line-height: 1;
  user-select: none;
}
.conv-item:hover .drag-grip { opacity: 0.5; }
.conv-item .drag-grip:hover { opacity: 1; color: var(--text2); }
.conv-item .title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .star-icon { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.conv-item .star-icon.starred { color: #f4b400; }
.conv-actions { display: none; align-items: center; gap: 1px; flex-shrink: 0; }
.conv-item:hover .conv-actions { display: flex; }
.conv-item:hover .star-icon:not(.starred) { display: none; }
.conv-action-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  width: 20px;
  height: 20px;
  justify-content: center;
}
.conv-action-btn svg, .conv-action-btn .material-symbols-outlined { font-size: 16px; width: 14px; height: 14px; }
.conv-action-btn:hover { background: rgba(0,0,0,0.06); color: var(--text2); }
body.dark .conv-action-btn:hover { background: rgba(255,255,255,0.08); }
.conv-action-btn.conv-action-delete:hover { color: var(--red); }
.conv-actions .menu-dots {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  width: 20px;
  height: 20px;
  justify-content: center;
}
.conv-actions .menu-dots svg { width: 14px; height: 14px; }
.conv-actions .menu-dots:hover { background: rgba(0,0,0,0.06); }
body.dark .conv-actions .menu-dots:hover { background: rgba(255,255,255,0.08); }

.add-folder-btn {
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-xs);
  margin: 4px 6px;
}
.add-folder-btn:hover { background: var(--surface); color: var(--text2); }

/* Topic modal — icon picker + name/desc inputs */
.topic-modal-form { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.topic-name-input, .topic-desc-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-xs);
  font-size: 14px; background: var(--bg); color: var(--text); outline: none;
}
.topic-name-input:focus, .topic-desc-input:focus { border-color: var(--accent); }
.topic-icon-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  max-height: 200px; overflow-y: auto; padding: 4px;
}
.topic-icon-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius-xs); background: none;
  cursor: pointer; color: var(--text2); transition: all 0.1s;
}
.topic-icon-btn:hover { background: var(--surface); }
.topic-icon-btn.selected { border-color: var(--accent); background: var(--accent-light, rgba(59,130,246,0.1)); color: var(--accent); }
.topic-icon-btn .material-symbols-outlined { font-size: 22px; }

/* Label/topic list, label-picker, hierarchical groups: now in shell.css */
/* Keyboard-highlighted label (chat-specific interaction) */
#sidebar.kb-focus { border-right: 2px solid var(--accent); }

/* Sidebar Mobile (chat-specific items only; .app-sidebar mobile rules are in shell.css) */
@media (max-width: 768px) {
  .conv-item { padding: 8px 12px 8px 10px; height: auto; min-height: 48px; }
  .label-item { min-height: 48px; padding: 10px 16px 10px 12px; }
  .sidebar-hamburger { width: 48px; height: 48px; }
  .conv-action-btn { width: 28px; height: 28px; }
}

/* ===== Modals (was modals.css) ===== */

/* Chat-specific modal overrides — visibility via data-visible */
#modalMessage[data-visible="false"] { display: none; }
#modalInput { display: none; }
#modalInput[data-visible="true"] { display: block; }
#chatLinkSection[data-visible="true"] { display: block; }

/* Search modal (.search-modal, .search-box, .search-result, etc.): now in shell.css */
/* Chat-specific search highlight */
.message.search-highlight { background: rgba(255, 213, 79, 0.25); border-radius: var(--radius-xs); transition: background 500ms ease; }
body.dark .message.search-highlight { background: rgba(255, 213, 79, 0.12); }
.message.search-highlight-fade { background: transparent; transition: background 500ms ease; }

/* Help modal, tier badges, shortcut grid: now in shell.css */

/* ===== Voice Mode (was voice.css) ===== */

.voice-mode {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  z-index: 500;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}
.voice-mode.active { display: flex; }
.voice-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.voice-center { display: flex; flex-direction: column; align-items: center; gap: 20px; max-width: 560px; width: 100%; padding: 16px; }
.voice-orb {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #6ea8fe, #1a73e8, #0d47a1);
  box-shadow: 0 0 30px rgba(26,115,232,0.25);
}
.voice-orb.listening { animation: orb-pulse 2s ease-in-out infinite; }
.voice-orb.thinking { animation: orb-pulse 1s ease-in-out infinite; background: radial-gradient(circle at 40% 40%, #ffd54f, #e37400, #bf360c); box-shadow: 0 0 30px rgba(227,116,0,0.25); }
.voice-orb.speaking { animation: orb-pulse 0.8s ease-in-out infinite; background: radial-gradient(circle at 40% 40%, #81c784, #388e3c, #1b5e20); box-shadow: 0 0 30px rgba(56,142,60,0.25); }
@keyframes orb-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.voice-status { font-size: 16px; font-weight: 300; opacity: 0.8; }
.voice-transcript { font-size: 20px; text-align: center; min-height: 24px; opacity: 0.9; font-weight: 300; }
.voice-response { font-size: 14px; text-align: center; max-height: 180px; overflow-y: auto; opacity: 0.6; line-height: 1.5; padding: 0 16px; }
.voice-model { position: absolute; bottom: 32px; font-size: 12px; opacity: 0.4; }

/* ===== Split Pane — refinements for split view ===== */
/* Core display rules are above in Main Layout. Split.js manages widths via inline styles. */
.main[data-view="split"] .conv-list-row { padding: 6px 14px; min-height: 40px; gap: 6px; }
.main[data-view="split"] .conv-checkbox { width: 16px; height: 16px; }
.main[data-view="split"] .conv-list-row .conv-row-title { font-size: 13px; max-width: none; flex: 1; min-width: 0; }
.main[data-view="split"] .conv-list-row .conv-row-date { font-size: 11px; }
.main[data-view="split"] .conv-list-row .conv-row-chips { display: none; }
.main[data-view="split"] .conv-list-row.active { background: var(--md-primary-container); border-left: none; }
body.dark .main[data-view="split"] .conv-list-row.active { background: var(--md-primary-container); }
.main[data-view="split"] .back-btn { display: none; }
.main[data-view="split"] #chatView .menu-btn { display: none; }
.main[data-view="split"] .conv-row-snippet { display: none; }
.main[data-view="split"] .conv-row-actions { display: none; gap: 1px; }
.main[data-view="split"] .conv-list-row:hover .conv-row-actions { display: flex; }
.main[data-view="split"] .conv-list-row:hover .conv-row-date { display: none; }
.main[data-view="split"] .star-icon { display: none; }
.main[data-view="split"] .conv-list-row:hover .star-icon { display: inline-flex; }
.main[data-view="split"] .conv-list-row .star-icon.starred { display: inline-flex; }
.conv-list-row.highlighted { background: var(--md-surface-container-high); border-left: none; }
body.dark .conv-list-row.highlighted { background: var(--md-surface-container-high); }
.main[data-view="split"] .conv-list-row.highlighted { background: var(--md-surface-container-low); border-left: none; }
body.dark .main[data-view="split"] .conv-list-row.highlighted { background: var(--md-surface-container); }
#convListView.kb-focus { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-xs); }
#chatView.kb-focus { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-xs); }

@media (max-width: 768px) {
  .main[data-view="split"] { flex-direction: column; }
  .main[data-view="split"] #convListView { width: 100%; max-width: none; border-right: none; display: none; }
  .main[data-view="split"] #chatView { flex: 1; }
}

/* === @ Mention Dropdown === */
.input-container { position: relative; }
.mention-dropdown {
  display: none; /* shown via data-visible="true" */
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  max-height: 280px;
  overflow-y: auto;
  z-index: 30;
  min-width: 360px;
  max-width: 540px;
  padding: 4px 0;
}
.mention-dropdown[data-visible="true"] { display: block; }
.mention-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mention-item:hover, .mention-item.focused {
  background: var(--surface);
}
.mention-icon {
  font-size: 18px;
  color: var(--muted);
  flex-shrink: 0;
}
.mention-item.focused .mention-icon { color: var(--accent); }
.mention-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mention-snippet { font-size: 11px; color: var(--muted); margin-left: 6px; }
/* Rich mention items (email two-line layout) */
.mention-rich { align-items: flex-start; }
.mention-rich .mention-icon { margin-top: 2px; }
.mention-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 1px; }
.mention-body .mention-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-preview { font-size: 11px; color: var(--text3, var(--muted)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.7; }
.mention-header { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 12px 2px; font-weight: 500; }
.collapsed-msg { max-height: 4.5em; overflow: hidden; position: relative; }
.show-more-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 12px; padding: 2px 0; margin-top: 2px; }
.label-manage { opacity: 0.6; font-size: 12px; }
.label-manage:hover { opacity: 1; }
.manage-topic-row { display: flex; align-items: center; gap: 8px; padding: 8px 4px; cursor: pointer; font-size: 14px; }
.manage-topic-row:hover { background: var(--surface); }
.manage-topic-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.manage-topics-list { margin: 12px 0; }

/* Inline edit mode for topics */
.label-edit-actions { display: flex; gap: 2px; margin-left: auto; flex-shrink: 0; }
.label-edit-btn { font-size: 16px; cursor: pointer; opacity: 0.5; padding: 2px; border-radius: 4px; }
.label-edit-btn:hover { opacity: 1; background: var(--surface); }

/* Tagged highlight — shows which sidebar labels match current conversation */
.label-item.tagged { background: color-mix(in srgb, var(--accent) 10%, transparent); }
body.dark .label-item.tagged { background: color-mix(in srgb, var(--accent) 15%, transparent); }

/* Hidden labels shown in edit mode */
.label-item.label-hidden { opacity: 0.4; }
.label-item.label-hidden:hover { opacity: 0.7; }
.mention-type {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
/* Inline @ref in message text */
.mention-ref {
  color: var(--accent);
  font-weight: 500;
}

/* === Context Panel (focus view sidebar) === */
#contextPanel { display: none; }

/* Focus + context open: side-by-side layout */
.main[data-view="focus"][data-context="open"] { flex-direction: row; }
.main[data-view="focus"][data-context="open"] #chatView { flex: 1; min-width: 0; }
.main[data-view="focus"][data-context="open"] #contextPanel {
  display: flex;
  flex-direction: column;
  width: 320px;
  flex-shrink: 0;
  border-left: 1px solid var(--border-light);
  background: var(--bg);
  overflow: hidden;
}

/* Panel header */
.ctx-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.ctx-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}
.ctx-panel-close {
  width: 28px;
  height: 28px;
}

/* Panel search */
.ctx-panel-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.ctx-search-icon { color: var(--muted); font-size: 16px; flex-shrink: 0; }
.ctx-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
}
.ctx-search-input::placeholder { color: var(--muted); }

/* Panel body */
.ctx-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

/* Sections */
.ctx-section { border-bottom: 1px solid var(--border-light); }
.ctx-section:last-child { border-bottom: none; }
.ctx-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  transition: background 80ms ease;
}
.ctx-section-header:hover { background: var(--surface); }
.ctx-section-icon { font-size: 16px; color: var(--muted); }
.ctx-section-label { flex: 1; }
.ctx-section-count {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}
.ctx-section-staged {
  font-size: 10px;
  color: var(--bg);
  background: var(--accent);
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 600;
}
.ctx-chevron {
  font-size: 16px;
  color: var(--muted);
  transition: transform 120ms ease;
}

/* Section items */
.ctx-section-items { padding: 0 4px 4px; }
.ctx-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 80ms ease;
}
.ctx-item:hover { background: var(--surface); }
.ctx-item.checked { background: color-mix(in srgb, var(--accent) 8%, transparent); }
body.dark .ctx-item.checked { background: color-mix(in srgb, var(--accent) 12%, transparent); }

.ctx-checkbox {
  font-size: 18px;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 1px;
}
.ctx-item.checked .ctx-checkbox { color: var(--accent); }

.ctx-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ctx-item-title {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ctx-item-snippet {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.ctx-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Footer */
.ctx-panel-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}
.ctx-staged-summary {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

/* Search results status */
.ctx-search-status {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 12px;
}

/* Topbar toggle button — active state */
.ctx-toggle-btn.active { color: var(--accent); }

/* Staged indicator badge in input toolbar */
.ctx-staged-indicator {
  font-size: 11px;
  color: var(--bg);
  background: var(--accent);
  border-radius: 8px;
  padding: 0 5px;
  min-width: 16px;
  text-align: center;
  font-weight: 600;
  line-height: 16px;
  display: none;
}
.ctx-staged-indicator.has-items { display: inline-block; }

@media (max-width: 768px) {
  /* Full-width overlay on mobile */
  .main[data-view="focus"][data-context="open"] #contextPanel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    z-index: 25;
    box-shadow: -4px 0 16px rgba(0,0,0,0.15);
  }
}

/* === Conversation Detail Three-Dot Menu === */
.conv-detail-menu-wrapper {
  position: relative;
}
.conv-detail-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 240px;
  z-index: 50;
  padding: 4px 0;
}
.conv-detail-menu.open { display: block; }
.conv-detail-menu-section {
  padding: 6px 12px 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.conv-detail-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: background 60ms;
}
.conv-detail-menu-item:hover { background: var(--surface); }
.conv-detail-menu-item .material-symbols-outlined { font-size: 18px; color: var(--muted); }
.conv-detail-menu-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}
.conv-detail-menu-item .linked-item-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-detail-menu-empty {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
