/* ============================================
   Grail PWA - Style Sheet
   Dark theme, mobile-first, minimal design
   ============================================ */

:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #1e2a4a;
  --bg-input: #0f1a30;
  --accent: #4a9eff;
  --accent-dim: #0f3460;
  --accent-glow: rgba(74, 158, 255, 0.15);
  --text-primary: #e0e0e0;
  --text-secondary: #8899aa;
  --text-muted: #556677;
  --danger: #ff4757;
  --success: #2ed573;
  --warning: #ffa502;
  --border: rgba(74, 158, 255, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --transition: 0.2s ease;
  --nav-height: 64px;
  --header-height: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.screen {
  height: 100%;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
}

/* ============================================
   Auth Screen
   ============================================ */

#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 1000;
}

.auth-container {
  text-align: center;
  padding: 2rem;
  width: 100%;
  max-width: 320px;
}

.auth-logo {
  margin-bottom: 1.5rem;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 8px rgba(74, 158, 255, 0.3)); }
  50% { opacity: 0.85; filter: drop-shadow(0 0 16px rgba(74, 158, 255, 0.6)); }
}

.auth-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.auth-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
}

.pin-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pin-input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}

.pin-input:focus {
  border-color: var(--accent);
}

.pin-submit {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), background var(--transition);
}

.pin-submit:active {
  transform: scale(0.92);
}

.pin-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 1rem;
  min-height: 1.2em;
}

/* ============================================
   App Header
   ============================================ */

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-height) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding-left: 16px;
  padding-right: 12px;
  z-index: 100;
}

.header-left {
  flex-shrink: 0;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #7dd3fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: background var(--transition);
}

.status-indicator.online {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.status-indicator.offline {
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ============================================
   Tab Content
   ============================================ */

.tab-content {
  position: fixed;
  top: calc(var(--header-height) + var(--safe-top));
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  left: 0;
  right: 0;
  overflow: hidden;
}

.tab-panel {
  display: none;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
}

.tab-panel.active {
  display: flex;
}

.tab-header {
  position: sticky;
  top: 0;
  padding: 12px 16px;
  background: var(--bg-primary);
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.tab-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.search-input {
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
}

.content-list {
  padding: 8px 16px 16px;
  flex: 1;
}

/* ============================================
   Bottom Navigation
   ============================================ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  min-width: 0;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
}

.nav-btn.active {
  color: var(--accent);
}

.nav-btn span {
  margin-top: 1px;
}

/* ============================================
   Chat Tab
   ============================================ */

#tab-home {
  display: none;
  flex-direction: column;
}

#tab-home.active {
  display: flex;
}

#tab-more {
  display: none;
  flex-direction: column;
}

#tab-more.active {
  display: flex;
}

#tab-chat {
  display: none;
  flex-direction: column;
}

#tab-chat.active {
  display: flex;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
  animation: bubble-in 0.25s ease-out;
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-bubble.user {
  background: var(--accent);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
  background: var(--bg-card);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble .timestamp {
  display: block;
  font-size: 0.7rem;
  margin-top: 4px;
  opacity: 0.6;
}

.chat-bubble.user .timestamp {
  text-align: right;
  color: rgba(255, 255, 255, 0.7);
}

.chat-bubble.assistant .timestamp {
  color: var(--text-muted);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  max-width: 60px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.chat-text-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.chat-text-input:focus {
  border-color: var(--accent);
}

.voice-btn,
.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), background var(--transition);
}

.voice-btn {
  background: var(--bg-card);
  color: var(--text-secondary);
}

.voice-btn.recording {
  background: var(--danger);
  color: white;
  animation: pulse-record 1.5s ease-in-out infinite;
}

@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 71, 87, 0); }
}

.send-btn {
  background: var(--accent);
  color: white;
}

.send-btn:active,
.voice-btn:active {
  transform: scale(0.9);
}

/* ============================================
   Content Cards
   ============================================ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.card:active {
  transform: scale(0.98);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-expanded .card-body {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.badge-note { background: rgba(74, 158, 255, 0.15); color: var(--accent); }
.badge-task { background: rgba(46, 213, 115, 0.15); color: var(--success); }
.badge-email { background: rgba(255, 165, 2, 0.15); color: var(--warning); }
.badge-article { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }
.badge-capture { background: rgba(74, 158, 255, 0.1); color: var(--text-secondary); }

/* ============================================
   Tasks
   ============================================ */

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.task-checkbox {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 2px solid var(--accent-dim);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.task-checkbox:hover {
  border-color: var(--accent);
}

.task-checkbox.completed {
  background: var(--success);
  border-color: var(--success);
}

.task-checkbox.completed::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  margin-top: -2px;
}

.task-content {
  flex: 1;
}

.task-title {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.task-title.completed {
  text-decoration: line-through;
  opacity: 0.5;
}

.task-due {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.task-due.overdue {
  color: var(--danger);
  font-weight: 500;
}

.quick-add {
  display: flex;
  gap: 8px;
}

.add-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius);
  background: var(--accent);
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.add-btn:active {
  transform: scale(0.9);
}

/* ============================================
   Email
   ============================================ */

.email-group-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 0 6px;
}

.email-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.email-sender {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.email-subject {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.email-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ============================================
   Settings
   ============================================ */

.settings-content {
  padding: 16px;
}

.settings-section {
  margin-bottom: 28px;
}

.settings-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-input {
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.settings-input:focus {
  border-color: var(--accent);
}

select.settings-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238899aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.btn-primary {
  padding: 12px 24px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-danger {
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background var(--transition);
}

.btn-danger:active {
  background: rgba(255, 71, 87, 0.1);
}

.settings-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 0;
}

.settings-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-message {
  font-size: 0.82rem;
  min-height: 1.2em;
}

.form-message.success { color: var(--success); }
.form-message.error { color: var(--danger); }

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

.linked-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.linked-account-info {
  display: flex;
  flex-direction: column;
}

.linked-account-email {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.linked-account-provider {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.linked-account-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.linked-account-delete:hover {
  opacity: 1;
}

/* ============================================
   Feed
   ============================================ */

.feed-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.feed-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.feed-icon.note { background: rgba(74, 158, 255, 0.15); color: var(--accent); }
.feed-icon.task { background: rgba(46, 213, 115, 0.15); color: var(--success); }
.feed-icon.email { background: rgba(255, 165, 2, 0.15); color: var(--warning); }
.feed-icon.article { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }
.feed-icon.capture { background: rgba(74, 158, 255, 0.1); color: var(--text-secondary); }

.feed-content {
  flex: 1;
  min-width: 0;
}

.feed-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state svg {
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================
   Loading Spinner
   ============================================ */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 200;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================
   Calendar
   ============================================ */

.cal-view-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.cal-toggle-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.cal-toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.cal-day-section {
  margin-bottom: 20px;
}

.cal-day-section.cal-today {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin-left: -4px;
}

.cal-day-header {
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 0;
  z-index: 5;
}

.cal-today .cal-day-header {
  color: var(--accent);
}

.cal-allday-banner {
  background: var(--accent-glow);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cal-allday-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cal-event-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.cal-event-time {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 72px;
  padding-top: 2px;
  white-space: nowrap;
}

.cal-event-details {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.cal-event-indicator {
  width: 4px;
  min-width: 4px;
  border-radius: 2px;
  align-self: stretch;
}

.cal-event-info {
  flex: 1;
  min-width: 0;
}

.cal-event-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event-location {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event-account {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cal-no-events {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 12px 0;
}

/* ============================================
   Email Filters & Badges
   ============================================ */

.email-filters {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.email-filter-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.email-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.email-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
}

.email-badge-spam {
  background: rgba(255, 165, 2, 0.15);
  color: var(--warning);
}

.email-badge-unsub {
  background: rgba(155, 89, 182, 0.15);
  color: #9b59b6;
}

.email-importance-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.email-importance-dot.high { background: var(--danger); }
.email-importance-dot.medium { background: var(--warning); }
.email-importance-dot.low { background: var(--text-muted); }

/* ============================================
   Email Reply Modal
   ============================================ */

.reply-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.reply-modal.hidden {
  display: none !important;
}

.reply-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reply-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  animation: slide-up 0.3s ease;
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.reply-modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.reply-modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.reply-modal-close-btn:hover {
  color: var(--text-primary);
}

.reply-context {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.8rem;
}

.reply-context-label {
  color: var(--text-muted);
  font-weight: 500;
  min-width: 52px;
}

.reply-context-value {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-instructions-group {
  margin-top: 4px;
}

.reply-instructions-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition);
}

.reply-instructions-input:focus {
  border-color: var(--accent);
}

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

.reply-draft-area {
  flex: 1;
  min-height: 0;
}

.reply-draft-textarea {
  width: 100%;
  min-height: 160px;
  max-height: 40vh;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition);
}

.reply-draft-textarea:focus {
  border-color: var(--accent);
}

.reply-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
}

.reply-loading.hidden {
  display: none !important;
}

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

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite;
}

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

.reply-loading-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.reply-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding-bottom: var(--safe-bottom);
}

.reply-btn {
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.reply-btn:active {
  transform: scale(0.96);
}

.reply-btn-generate {
  background: var(--accent);
  border: none;
  color: white;
  flex: 1;
}

.reply-btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.reply-btn-send {
  background: var(--accent);
  border: none;
  color: white;
  flex: 1;
}

.reply-btn-send.hidden {
  display: none !important;
}

.reply-btn-confirm-send {
  background: var(--accent);
  border: none;
  color: white;
  flex: 1;
}

/* ============================================
   Send Confirmation Overlay
   ============================================ */

.send-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 24px;
  animation: fade-in 0.2s ease;
}

.send-confirm-overlay.hidden {
  display: none !important;
}

.send-confirm-card {
  background: #1e2a4a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  width: 100%;
  max-width: 400px;
  animation: scale-in 0.2s ease;
}

@keyframes scale-in {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.send-confirm-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.send-confirm-details {
  margin-bottom: 20px;
}

.send-confirm-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.send-confirm-label {
  color: var(--text-muted);
  font-weight: 500;
  min-width: 52px;
}

.send-confirm-value {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.send-confirm-body-preview {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  max-height: 120px;
  overflow-y: auto;
}

.send-confirm-body-preview p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.send-confirm-actions {
  display: flex;
  gap: 10px;
}

/* ============================================
   Email Reply Button on Cards
   ============================================ */

.email-card {
  position: relative;
}

.email-reply-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  opacity: 0.7;
}

.email-reply-btn:hover {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}

.email-reply-btn:active {
  transform: scale(0.9);
}

/* ============================================
   Sent Emails List
   ============================================ */

.sent-email-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.sent-email-to {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.sent-email-subject {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.sent-email-body-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sent-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 6px;
  background: rgba(46, 213, 115, 0.15);
  color: var(--success);
}

/* ============================================
   Universal Search Bar (Header)
   ============================================ */

.header-center {
  flex: 1;
  margin: 0 12px;
  position: relative;
}

.universal-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.universal-search-wrapper .search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.universal-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.universal-search-input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
}

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

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 300;
  animation: fade-in 0.15s ease;
}

.search-results-dropdown.hidden {
  display: none !important;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:active {
  background: var(--accent-glow);
}

.search-result-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-result-icon.note { background: rgba(74, 158, 255, 0.15); color: var(--accent); }
.search-result-icon.task { background: rgba(46, 213, 115, 0.15); color: var(--success); }
.search-result-icon.email { background: rgba(255, 165, 2, 0.15); color: var(--warning); }
.search-result-icon.calendar,
.search-result-icon.event { background: rgba(155, 89, 182, 0.15); color: #9b59b6; }
.search-result-icon.person { background: rgba(74, 158, 255, 0.15); color: var(--accent); }
.search-result-icon.whatsapp { background: rgba(46, 213, 115, 0.15); color: var(--success); }

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-preview {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-result-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  text-transform: capitalize;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================
   Home Tab - Morning Briefing
   ============================================ */

.briefing-card {
  background: linear-gradient(135deg, #1e3a5f, #2d1b69);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(74, 158, 255, 0.2);
  position: relative;
}

.briefing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.briefing-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.briefing-refresh-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), transform var(--transition);
}

.briefing-refresh-btn:hover {
  color: var(--accent);
}

.briefing-refresh-btn:active {
  transform: rotate(180deg);
}

.briefing-summary {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #d4e4f7;
}

/* Quick Stats Row */
.quick-stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.quick-stats-row::-webkit-scrollbar {
  display: none;
}

.stat-card {
  flex: 1;
  min-width: 80px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Home section titles */
.home-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  padding-top: 4px;
}

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

/* Compact today events */
.home-events-compact {
  margin-bottom: 20px;
}

.home-event-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border: 1px solid var(--border);
}

.home-event-time {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  min-width: 56px;
}

.home-event-title {
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   Habits Section (within Tasks tab)
   ============================================ */

.habits-section {
  padding: 0 16px 16px;
}

.habits-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0 16px;
}

.habits-header {
  margin-bottom: 10px;
}

.habits-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.habits-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

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

.habits-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 0;
}

.habit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: background var(--transition);
}

.habit-item.logged {
  background: rgba(46, 213, 115, 0.05);
  border-color: rgba(46, 213, 115, 0.2);
}

.habit-check {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.habit-check.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.habit-check:hover {
  border-color: var(--success);
}

.habit-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.habit-name {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.habit-streak {
  font-size: 0.75rem;
  color: var(--warning);
  font-weight: 600;
  background: rgba(255, 165, 2, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ============================================
   People Module
   ============================================ */

.people-header {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px 16px 0;
}

.people-list {
  padding: 0 16px;
}

.person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition);
}

.person-card:active {
  transform: scale(0.98);
}

.person-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

.person-avatar.large {
  width: 56px;
  height: 56px;
  min-width: 56px;
  font-size: 1.4rem;
}

.person-info {
  flex: 1;
  min-width: 0;
}

.person-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.person-last-interaction {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Person Detail View */
.person-detail-view,
.person-add-form {
  padding: 16px;
}

.person-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 12px;
}

.person-detail-header {
  text-align: center;
  margin-bottom: 24px;
}

.person-detail-header .person-avatar {
  margin: 0 auto 12px;
}

.person-detail-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.person-detail-email {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.person-interactions-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.person-interactions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.person-interaction-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.person-interaction-type {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  text-transform: capitalize;
}

.person-interaction-summary {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-interaction-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============================================
   WhatsApp View
   ============================================ */

.wa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.wa-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.wa-watched-list {
  padding: 0 16px;
}

.wa-contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition);
}

.wa-contact-card:active {
  transform: scale(0.98);
}

.wa-contact-info {
  flex: 1;
  min-width: 0;
}

.wa-contact-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.wa-contact-preview {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* WhatsApp Conversation */
.wa-conversation-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.wa-conv-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.wa-conv-title {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.wa-summary-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.wa-summary-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wa-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.wa-bubble.me {
  background: var(--accent-dim);
  color: var(--text-primary);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.wa-bubble.them {
  background: var(--bg-card);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.wa-bubble-text {
  margin-bottom: 4px;
}

.wa-bubble-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: right;
}

/* WhatsApp Summary Overlay */
.wa-summary-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: 24px;
  animation: fade-in 0.2s ease;
}

.wa-summary-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  width: 100%;
  max-width: 400px;
  animation: scale-in 0.2s ease;
}

.wa-summary-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.wa-summary-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.wa-summary-close {
  width: 100%;
}

/* ============================================
   Weekly Review
   ============================================ */

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.review-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.review-summary-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 16px 16px;
  border: 1px solid var(--border);
}

.review-summary-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.review-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 16px 16px;
}

.review-stat-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  border: 1px solid var(--border);
}

.review-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 16px 8px;
}

.review-list {
  padding: 0 16px 16px;
}

.review-list-item {
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--text-primary);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.review-check-icon {
  color: var(--success);
  font-weight: 700;
}

.review-pending-icon {
  color: var(--text-muted);
}

.review-list-item.pattern {
  border-left: 3px solid var(--accent);
}

.review-list-item.suggestion {
  border-left: 3px solid var(--warning);
}

/* ============================================
   More Tab Grid
   ============================================ */

.more-grid-view {
  padding: 24px 16px;
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.more-grid-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
}

.more-grid-item:active {
  transform: scale(0.95);
}

.more-grid-item:hover {
  border-color: var(--accent);
}

.more-grid-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.more-grid-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* More subview */
.more-subview {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.more-subview.hidden {
  display: none !important;
}

.more-subview-content {
  height: 100%;
  overflow-y: auto;
}

.more-subview-content.hidden {
  display: none !important;
}

/* ============================================
   Responsive adjustments
   ============================================ */

@media (min-width: 768px) {
  .tab-content {
    max-width: 600px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .bottom-nav {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .chat-bubble {
    max-width: 70%;
  }
}
