/* Notes PWA — deliberately minimal, mobile-first, separate from the
   desktop 3-pane chat UI's styling assumptions. Reuses style.css's CSS
   custom properties (--bg-surface, --accent, etc.) for visual consistency
   without inheriting any of its layout. */

.notes-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.notes-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notes-tab {
  flex: 1;
  padding: 14px 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.notes-tab.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

.notes-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
}

.notes-textarea {
  flex: 1;
  min-height: 160px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  padding: 12px;
  resize: none;
  outline: none;
}
.notes-textarea:focus { border-color: var(--accent); }

.notes-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
}
.notes-input:focus { border-color: var(--accent); }

.notes-primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg, 12px);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.notes-primary-btn:active { opacity: 0.85; }
.notes-primary-btn:disabled { opacity: 0.5; cursor: default; }

.notes-status {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  min-height: 16px;
}

.notes-voice-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
/* .voice-orb / .thinking / .speaking already defined in style.css — reused as-is */

.notes-mode-picker {
  display: flex;
  gap: 8px;
}
.notes-mode-btn {
  flex: 1;
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}
.notes-mode-btn.active {
  background: var(--accent-glow);
  color: var(--accent-light);
  border-color: var(--border-focus);
}

/* Full-screen chat — deliberate takeover, distinct from the desktop
   mini-player's "stay small, stay out of the way" design. This surface
   was opened specifically to capture one thing; give it the whole screen. */
.notes-chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.notes-chat-overlay-header {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 10px);
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.notes-chat-cog-btn,
.notes-chat-exit {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.notes-chat-exit { font-size: 20px; }

/* Settings — mode/model/scope, tucked behind the cog (2026-07-20) instead
   of gating entry into chat. A centered card over the messages/orb, not a
   separate screen — "Done" or the cog again dismisses it. */
.notes-chat-settings-panel {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 56px);
  left: 14px;
  right: 14px;
  z-index: 2;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.notes-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 56px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notes-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.notes-chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
}
.notes-chat-msg.assistant {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.notes-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.notes-chat-input-row .notes-textarea { min-height: 40px; max-height: 120px; }

.notes-list-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notes-list-item-body { flex: 1; min-width: 0; }
.notes-list-item-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.notes-list-item-text {
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.notes-list-item-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.notes-list-item-edit,
.notes-list-item-delete {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
}
.notes-list-item-delete:active { color: #e5484d; }
.notes-list-item-edit:active { color: var(--accent-light); }
.notes-list-item-audio {
  width: 100%;
  height: 32px;
  margin-top: 8px;
}

.notes-model-picker-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.notes-model-picker-label select {
  flex: 1;
  min-width: 0;
}

.notes-scope-display {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-light);
  font-weight: 600;
}
.notes-scope-change-btn {
  flex-shrink: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.notes-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 2px;
}

.notes-chat-mic-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}
.notes-chat-mic-btn.recording {
  background: var(--accent);
  border-color: var(--accent);
}

/* Same popover pattern as the desktop app's #voice-overlay — stays in the
   DOM, .open toggles visibility, sits above the input row inside the
   full-screen overlay (no separate anchoring math needed here since it's
   already position:fixed within the same overlay). */
.notes-chat-voice-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
}
.notes-chat-voice-panel.open { display: flex; }
