:root,
[data-theme="dark"] {
  --bg: #0a0a0f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #94a3b8;
  --primary: #818cf8;
  --primary-glow: rgba(129, 140, 248, 0.35);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --modal-bg: #12121a;
  --popover-bg: #1a1a24;
  --toast-bg: #1a1a24;
  --sidebar-bg: rgba(10, 10, 15, 0.6);
  --input-bg: #1a1a24;
  --option-bg: #1e1e2a;
  --aurora-1: rgba(99, 102, 241, 0.18);
  --aurora-2: rgba(236, 72, 153, 0.12);
  --aurora-3: rgba(6, 182, 212, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glass: blur(20px) saturate(180%);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --mobile-nav-height: 64px;
  --mobile-header-height: 56px;
  --surface-glass: rgba(10, 10, 15, 0.65);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: rgba(15, 23, 42, 0.04);
  --surface-hover: rgba(15, 23, 42, 0.07);
  --border: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.2);
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --modal-bg: #ffffff;
  --popover-bg: #ffffff;
  --toast-bg: #ffffff;
  --sidebar-bg: rgba(255, 255, 255, 0.85);
  --input-bg: #ffffff;
  --option-bg: #f1f5f9;
  --aurora-1: rgba(99, 102, 241, 0.12);
  --aurora-2: rgba(236, 72, 153, 0.08);
  --aurora-3: rgba(6, 182, 212, 0.08);
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --mobile-nav-height: 64px;
  --mobile-header-height: 56px;
  --surface-glass: rgba(255, 255, 255, 0.85);
}

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

/* Laptop & Desktop Screen Scale Reduction (Decrease zoom by 20% / 80% scale) */
@media (min-width: 769px) {
  html {
    zoom: 0.8;
  }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  color-scheme: dark;
}

[data-theme="light"] body {
  color-scheme: light;
}

/* Light Theme Title & Text Accessibility Enhancements */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6,
[data-theme="light"] .card-title,
[data-theme="light"] .google-card-title,
[data-theme="light"] .google-card .card-title,
[data-theme="light"] .google-day-title,
[data-theme="light"] .cal-event-title,
[data-theme="light"] .calendar-toolbar h3,
[data-theme="light"] .calendar-sidebar h4,
[data-theme="light"] .topbar h2,
[data-theme="light"] .brand h1,
[data-theme="light"] .mobile-brand-title,
[data-theme="light"] .mobile-greeting-title,
[data-theme="light"] .modal-header h3,
[data-theme="light"] .empty-state h3,
[data-theme="light"] .settings-row-title,
[data-theme="light"] .m-stat-value,
[data-theme="light"] .user-name {
  color: #0f172a !important;
}

[data-theme="light"] .card-desc,
[data-theme="light"] .google-card-preview,
[data-theme="light"] .google-card-when,
[data-theme="light"] .cal-event-time,
[data-theme="light"] .cal-hint,
[data-theme="light"] .subtitle,
[data-theme="light"] .settings-row-desc {
  color: #334155 !important;
}

[data-theme="light"] .google-card-desc-box {
  background: rgba(15, 23, 42, 0.03) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-left: 3px solid var(--card-accent, #6366f1) !important;
}

[data-theme="light"] .google-card-actions {
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .google-detail-footer {
  background: #f8fafc !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .google-detail-footer #google-detail-close-btn {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
}

[data-theme="light"] .google-detail-footer #google-detail-close-btn:hover {
  background: #f1f5f9 !important;
}

[data-theme="light"] #reject-item-preview {
  background: rgba(15, 23, 42, 0.03) !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] #reject-item-title {
  color: #0f172a !important;
}

[data-theme="light"] #reject-item-desc {
  color: #334155 !important;
}

[data-theme="light"] #reject-confirm-question {
  color: #0f172a !important;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, var(--aurora-1), transparent),
    radial-gradient(ellipse 60% 50% at 90% 10%, var(--aurora-2), transparent),
    radial-gradient(ellipse 70% 60% at 50% 100%, var(--aurora-3), transparent),
    var(--bg);
  animation: auroraShift 20s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(25deg); }
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  padding: 28px 20px;
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  backdrop-filter: var(--glass);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text) !important;
}

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

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn:hover { background: var(--surface-hover); color: var(--text); }
.nav-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  font-weight: 500;
}

.nav-btn-google-login {
  background: rgba(66, 133, 244, 0.1);
  color: var(--text);
  border: 1px solid rgba(66, 133, 244, 0.25);
  margin-top: 4px;
}

.nav-btn-google-login:hover {
  background: rgba(66, 133, 244, 0.18);
  border-color: rgba(66, 133, 244, 0.5);
}

.nav-google-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #4285f4, #34a853, #fbbc05, #ea4335);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--mono);
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-cta { margin-top: auto; }
.sidebar-cta span { font-size: 1.2rem; margin-right: 4px; }

.sidebar-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.sidebar-footer strong {
  color: var(--text);
  font-weight: 600;
}

.google-panel {
  margin-top: 20px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.google-panel-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.google-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4285f4, #34a853);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.google-panel strong {
  font-size: 0.78rem;
  display: block;
}

.google-status {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

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

.btn-google-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #dadce0;
  background: #ffffff !important;
  color: #1f1f1f !important;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.btn-google-signin:hover:not(:disabled) {
  background: #f8f9fa !important;
  color: #1f1f1f !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  border-color: #c6c9cc;
}

.btn-google-signin:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-google-signin.connecting {
  pointer-events: none;
}

.ical-sync {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.ical-field span {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.ical-field input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.68rem;
  font-family: var(--font-mono, monospace);
}

.ical-help {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.ical-help-section {
  margin: 10px 0 4px;
  font-size: 0.68rem;
  color: var(--text);
}

.ical-help-warn {
  margin-top: 10px;
  color: #fbbf24;
  font-size: 0.65rem;
  line-height: 1.5;
}

.ical-help-note {
  margin-top: 8px;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.feed-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  font-size: 0.68rem;
}

.feed-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

.oauth-setup {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.oauth-setup-intro {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.oauth-steps {
  margin: 0 0 12px 18px;
  padding: 0;
  font-size: 0.65rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.oauth-steps a {
  color: #4285f4;
}

.oauth-fallback {
  font-size: 0.62rem;
  color: #fbbf24;
  margin: 0 0 10px;
  line-height: 1.5;
}

.oauth-redirect-note {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin: 0 0 10px;
  line-height: 1.5;
}

.oauth-redirect-note code {
  word-break: break-all;
  font-size: 0.6rem;
}

.oauth-creds-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-link {
  width: 100%;
  margin-bottom: 8px;
}

.guide-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 0 48px;
}

.guide-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text) !important;
}

.guide-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.guide-close {
  flex-shrink: 0;
  margin-top: 2px;
}

.guide-intro {
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.6;
}

.guide-section {
  margin-bottom: 28px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.guide-section h3 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--text) !important;
}

.guide-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  line-height: 1.6;
}

.guide-steps li {
  margin-bottom: 16px;
  padding-left: 36px;
  position: relative;
}

.guide-steps .step-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4285f4;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-steps .step-detail {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.guide-steps a {
  color: #4285f4;
  font-weight: 500;
}

.guide-uri {
  display: block;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.75rem;
  word-break: break-all;
  font-family: "JetBrains Mono", monospace;
}

.guide-creds .field span {
  font-size: 0.8rem;
}

.guide-features {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.guide-actions {
  margin-top: 8px;
}

.guide-signin {
  width: 100%;
  max-width: 320px;
}

.google-card.google-silent {
  opacity: 0.65;
}

.google-card.google-expired {
  border-color: rgba(239, 68, 68, 0.35);
}

.google-card.google-expired::before {
  background: #ef4444;
}

.google-card.google-expired.google-silent {
  opacity: 0.78;
}

.google-expired-badge {
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  background: rgba(239, 68, 68, 0.12) !important;
}

.expired-hint {
  color: #f87171;
  font-weight: 500;
}

.address-hint {
  color: #fbbf24;
  font-weight: 500;
}

.google-card.google-needs-address {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);
}

.google-card.google-addressed-card {
  opacity: 0.88;
}

.reminder-card.urgent-needs-address {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);
}

.reminder-card.urgent-addressed-card {
  opacity: 0.92;
}

.urgent-hint {
  color: #fbbf24;
}

.btn-sm.google-address-pending {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.14);
  font-weight: 700;
}

.btn-sm.google-address-pending:hover {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.22);
}

.btn-sm.google-addressed {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.14);
  cursor: default;
}

.btn-sm.google-address-later {
  opacity: 0.45;
  cursor: default;
}

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

.silent-hint {
  color: #fbbf24;
}

.btn-sm.active {
  background: var(--surface-hover);
  border-color: #4285f4;
}

.ical-sync-section {
  margin-top: 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.ical-sync-section summary {
  cursor: pointer;
  color: var(--text);
}

.google-setup summary {
  cursor: pointer;
  color: var(--text);
}

.google-setup p {
  margin-top: 8px;
  line-height: 1.5;
  word-break: break-word;
}

.google-steps {
  margin: 10px 0 0 18px;
  padding: 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.google-steps code {
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  word-break: break-all;
}

.google-upload {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.google-setup-note {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.reminder-card.google-card {
  cursor: default;
  padding: 16px 18px;
}

.reminder-grid.google-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.google-day-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: transparent;
}

.google-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  background: transparent !important;
  padding-top: 6px;
}

.google-day-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.google-day-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 999px;
}

.google-day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.google-day-section-undated .google-day-title {
  color: var(--text-muted);
}

.google-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.google-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* Beautiful Matching Card Loader */
.google-card-loader {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.google-card.is-processing .google-card-loader {
  opacity: 1;
  pointer-events: all;
}

.google-card-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--card-accent, #4285f4);
  border-right-color: rgba(66, 133, 244, 0.6);
  animation: googleCardSpin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-shadow: 0 0 18px rgba(66, 133, 244, 0.45);
}

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

.google-card-loader-text {
  margin-top: 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.03em;
  text-align: center;
  animation: googleCardPulse 1.4s ease-in-out infinite;
}

@keyframes googleCardPulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.google-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  min-height: 24px;
}

.google-card-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.google-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.google-card.google-accepted-card {
  border-left: 3px solid #34a853;
}

.google-card.google-declined-card {
  opacity: 0.72;
}

.google-card.google-declined-card:hover {
  opacity: 1;
}

.google-card .card-title,
.google-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text) !important;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.google-card .badge {
  font-size: 0.65rem;
  padding: 3px 8px;
  font-weight: 600;
  border-radius: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: none !important;
  max-width: 100%;
  box-sizing: border-box;
}

.google-card-desc-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--card-accent, #6366f1);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 0 10px;
}

.google-card-preview {
  font-size: 0.76rem;
  color: var(--text-muted, #94a3b8);
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.google-card-when {
  font-size: 0.76rem;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 10px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.google-card-when .card-hint {
  display: inline;
}

.google-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.google-card-actions .btn-sm {
  padding: 4px 10px;
  font-size: 0.72rem;
  border-radius: 6px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-sm.success.active {
  background: rgba(52, 168, 83, 0.22) !important;
  border-color: #34a853 !important;
  color: #34a853 !important;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(52, 168, 83, 0.35);
}

.btn-sm.danger.active {
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.google-detail-modal {
  max-width: 620px;
  width: min(620px, 94vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  border-radius: 20px;
  background: var(--modal-bg, #0f172a);
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.reject-confirm-modal {
  max-width: 500px;
  width: min(500px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  border-radius: 20px;
  background: var(--modal-bg, #0f172a);
  border: 1px solid var(--border);
}

.google-detail-meta {
  padding: 0 24px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.google-detail-body {
  overflow-y: auto;
  max-height: 55vh;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
}

.google-detail-body.empty {
  color: var(--text-muted);
  font-style: italic;
}

.google-detail-body p {
  margin: 0 0 0.85em;
}

.google-detail-body p:last-child {
  margin-bottom: 0;
}

.google-detail-body ul,
.google-detail-body ol {
  margin: 0.5em 0 1em;
  padding-left: 1.4em;
}

.google-detail-body li {
  margin-bottom: 0.45em;
}

.google-detail-body li p {
  margin: 0;
}

.google-detail-body strong,
.google-detail-body b {
  color: var(--text);
  font-weight: 600;
}

.google-detail-body a {
  color: #4285f4;
  word-break: break-word;
}

.google-detail-body a:hover {
  text-decoration: underline;
}

/* Schedule Call & Google Meet CTA */
.btn-call-cta {
  background: rgba(66, 133, 244, 0.12);
  border-color: rgba(66, 133, 244, 0.35);
  color: #4285f4;
  font-weight: 600;
}

.btn-call-cta:hover {
  background: rgba(66, 133, 244, 0.22);
  border-color: #4285f4;
  color: #4285f4;
}

.call-meet-info-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(66, 133, 244, 0.08);
  border: 1px solid rgba(66, 133, 244, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 6px;
}

.card-header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-accepted {
  background: rgba(52, 168, 83, 0.18) !important;
  color: #34a853 !important;
  border: 1px solid rgba(52, 168, 83, 0.3);
}

.badge-declined {
  background: rgba(234, 67, 53, 0.18) !important;
  color: #ea4335 !important;
  border: 1px solid rgba(234, 67, 53, 0.3);
}

.meet-join-btn {
  background: rgba(66, 133, 244, 0.15) !important;
  color: #4285f4 !important;
  border-color: rgba(66, 133, 244, 0.35) !important;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meet-join-btn:hover {
  background: #4285f4 !important;
  color: #ffffff !important;
}

.btn-sm.success {
  background: rgba(52, 168, 83, 0.12);
  border-color: rgba(52, 168, 83, 0.35);
  color: #34a853;
}

.btn-sm.success:hover {
  background: rgba(52, 168, 83, 0.25);
  color: #34a853;
  border-color: #34a853;
}

.google-detail-body h1,
.google-detail-body h2,
.google-detail-body h3,
.google-detail-body h4 {
  margin: 1.1em 0 0.5em;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.google-detail-body h1:first-child,
.google-detail-body h2:first-child,
.google-detail-body h3:first-child,
.google-detail-body h4:first-child {
  margin-top: 0;
}

.google-detail-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 22px !important;
  background: var(--surface, #1e293b);
  border-top: 1px solid var(--border);
  border-radius: 0 0 20px 20px;
  margin-top: auto;
  flex-wrap: wrap;
}

.google-detail-footer .detail-footer-btn,
.google-detail-footer button,
.google-detail-footer a {
  padding: 9px 18px;
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  cursor: pointer;
  box-sizing: border-box;
  text-decoration: none;
  line-height: 1;
}

.google-detail-footer #google-detail-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text, #f8fafc);
}

.google-detail-footer #google-detail-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.google-detail-footer #google-detail-open {
  background: #4285f4;
  color: #ffffff;
  border: 1px solid transparent;
  font-weight: 600;
}

.google-detail-footer #google-detail-open:hover {
  background: #3367d6;
}

.reject-confirm-modal .modal-footer {
  padding: 16px 24px 22px !important;
  background: var(--surface, #1e293b);
  border-top: 1px solid var(--border);
  border-radius: 0 0 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.reminder-card.google-card .card-actions .btn-sm.primary {
  margin-left: 0;
}

.cal-event.google-event {
  cursor: pointer;
}

.cal-event.google-event::before {
  content: "G";
  font-size: 0.6rem;
  font-weight: 700;
  opacity: 0.85;
  margin-right: 4px;
}

.badge.google-badge {
  background: rgba(66, 133, 244, 0.15) !important;
  color: #4285f4 !important;
  border: 1px solid rgba(66, 133, 244, 0.3) !important;
  text-transform: none !important;
}

.badge.google-tasks-badge {
  background: rgba(52, 168, 83, 0.15) !important;
  color: #34a853 !important;
  border: 1px solid rgba(52, 168, 83, 0.3) !important;
  text-transform: none !important;
}

/* Main */
.main {
  padding: 28px 32px;
  overflow-y: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.google-tone-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  backdrop-filter: var(--glass);
}

.google-tone-bar-label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.google-tone-bar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4285f4, #34a853);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.google-tone-bar-label strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text) !important;
}

.google-tone-bar-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.google-tone-bar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.google-tone-select {
  min-width: 200px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  cursor: pointer;
}

.google-tone-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

#btn-google-tone-save:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.topbar h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text) !important;
}

.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
}

.search-box input {
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  width: 200px;
  outline: none;
}

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

/* Buttons */
.btn-primary, .btn-ghost, .btn-icon, .btn-sm {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--primary-glow); }

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-icon {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
}

.btn-icon:hover { color: var(--text); background: var(--surface-hover); }

.btn-sm {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-sm:hover { background: var(--surface-hover); color: var(--text); }
.btn-sm.danger:hover { background: rgba(248, 113, 113, 0.15); color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.btn-sm.primary { background: rgba(99, 102, 241, 0.15); color: var(--primary); border-color: rgba(99, 102, 241, 0.3); }

/* Reminder cards */
.reminder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.reminder-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: var(--glass);
  transition: all 0.25s;
  animation: cardIn 0.4s ease backwards;
  position: relative;
  overflow: hidden;
}

/* After first paint, skip entrance animation so silent refreshes don't flicker */
#reminder-list.list-settled .reminder-card {
  animation: none;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.reminder-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--card-accent, var(--primary));
  border-radius: 4px 0 0 4px;
}

.reminder-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.reminder-card.reorderable {
  padding-left: 44px;
}

.reminder-card.reorderable:hover {
  transform: none;
}

.reminder-card.dragging {
  opacity: 0.55;
  transform: scale(0.985);
  box-shadow: var(--shadow);
}

.reminder-card.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.card-drag-handle {
  position: absolute;
  top: 18px;
  left: 12px;
  width: 24px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-subtle);
  font-size: 0.95rem;
  letter-spacing: -0.12em;
  cursor: grab;
  padding: 0;
  transition: color 0.2s, background 0.2s;
}

.card-drag-handle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.card-drag-handle:active {
  cursor: grabbing;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text) !important;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge.status-PENDING { color: var(--success); border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.08); }
.badge.status-SNOOZED { color: var(--warning); border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.08); }
.badge.status-DISMISSED { color: var(--text-muted); }
.badge.status-TRIGGERED { color: var(--primary); border-color: rgba(129, 140, 248, 0.3); }

.card-next {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.card-next strong { color: var(--text); }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.tone-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state.hidden { display: none; }

.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.3rem; margin-bottom: 8px; color: var(--text) !important; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }

.hidden { display: none !important; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0;
}

.modal-header h3 { font-size: 1.2rem; font-weight: 600; color: var(--text) !important; }

.modal-body { padding: 20px 24px 24px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field > span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input, .field select, .field textarea {
  background-color: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.field select option {
  background-color: var(--option-bg);
  color: var(--text);
  padding: 8px;
}

[data-theme="light"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

.field input[type="datetime-local"],
.field input[type="date"],
.field input[type="time"] {
  color-scheme: inherit;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* All-day toggle row */
.datetime-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.all-day-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--text);
}

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

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Day picker */
.day-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.day-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.day-btn.selected {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

/* Color picker */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.color-swatch.selected {
  border-color: white;
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

/* Tone grid */
.tone-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.tone-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
}

.tone-option:hover { background: var(--surface-hover); }
.tone-option.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.tone-option .tone-emoji { font-size: 1.2rem; }
.tone-option .tone-name { font-size: 0.85rem; font-weight: 500; }
.tone-option .tone-desc { font-size: 0.7rem; color: var(--text-muted); }

.tone-preview-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
}

.tone-preview-btn:hover { color: var(--primary); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Popover */
.popover {
  position: fixed;
  z-index: 200;
  background: var(--popover-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popover button {
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-size: 0.85rem;
}

.popover button:hover { background: var(--surface-hover); }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--toast-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    display: flex;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
  }
  .reminder-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .calendar-layout { grid-template-columns: 1fr !important; }
}

/* View switch */
.view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.view-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn:hover { color: var(--text); background: var(--surface-hover); }
.view-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.theme-toggle { font-size: 1rem; }

/* Calendar */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.calendar-toolbar h3 {
  font-size: 1.2rem;
  font-weight: 600;
  min-width: 180px;
  text-align: center;
  color: var(--text) !important;
}

.calendar-toolbar .btn-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

.calendar-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: var(--glass);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.cal-weekday {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 0;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  min-height: 72px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.cal-day:hover { background: var(--surface-hover); border-color: var(--border); }
.cal-day.other-month { opacity: 0.35; }
.cal-day.today { border-color: var(--primary); background: rgba(99, 102, 241, 0.08); }
.cal-day.selected { background: rgba(99, 102, 241, 0.15); border-color: var(--primary); }

.cal-day-num {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--mono);
  margin-bottom: 4px;
}

.cal-day-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  width: 100%;
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.calendar-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: var(--glass);
  position: sticky;
  top: 20px;
}

.calendar-sidebar h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text) !important;
}

.cal-day-events { display: flex; flex-direction: column; gap: 8px; }

.cal-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  border-left: 3px solid var(--event-color, var(--primary));
  cursor: pointer;
  transition: transform 0.15s;
}

.cal-event:hover { transform: translateX(2px); }

.cal-event-time {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 52px;
}

.cal-event-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text) !important;
  flex: 1;
}

.cal-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cal-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}

/* ========================================================
   Web App Additions: User Profile, Alerts & Audio
   ======================================================== */

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

/* User Profile Widget */
.user-widget {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.user-pill:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
}

.user-name {
  font-weight: 500;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-signin-google-topbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff !important;
  border: 1px solid #dadce0;
  color: #1f1f1f !important;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-signin-google-topbar:hover {
  background: #f8f9fa !important;
  color: #1f1f1f !important;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.25);
  border-color: #4285F4;
}

.btn-signout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.btn-signout:hover {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
}

/* In-App Floating Notification Alerts Container */
.notification-alerts-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 380px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.reminder-alert-card {
  pointer-events: auto;
  background: var(--modal-bg);
  border: 1px solid var(--alert-color, var(--primary));
  border-left: 5px solid var(--alert-color, var(--primary));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideInAlert 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: var(--glass);
}

.reminder-alert-card.urgent {
  border-color: var(--danger);
  border-left-color: var(--danger);
  box-shadow: 0 16px 40px rgba(220, 38, 38, 0.35), 0 0 30px rgba(248, 113, 113, 0.3);
  animation: pulseUrgent 1.8s infinite alternate;
}

@keyframes slideInAlert {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulseUrgent {
  0% { transform: scale(1); }
  100% { transform: scale(1.02); }
}

.alert-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.alert-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-tone-emoji {
  font-size: 1.4rem;
}

.alert-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.alert-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
}

.alert-close:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.alert-body {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.alert-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--mono);
}

.alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.btn-alert-dismiss {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-alert-dismiss:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-alert-snooze {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-alert-snooze:hover {
  background: var(--surface-hover);
}

.btn-alert-addressed {
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-alert-addressed:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Audio Status & Notification Permission Badges */
.status-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.status-pill-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.status-pill-btn.active {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.4);
}

/* ============================================================
   Mobile First Architecture: Components & Native App Patterns
   ============================================================ */

/* Hide mobile app elements on desktop by default */
.mobile-header,
.mobile-dashboard,
.mobile-bottom-nav,
.mobile-fab,
.sheet-drag-handle {
  display: none;
}

/* Mobile Header */
.mobile-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent !important;
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 10;
  margin: 0 0 16px 0 !important;
  padding: var(--safe-top) 0 0 0 !important;
  width: 100%;
}

.mobile-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.mobile-brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 11px;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.mobile-brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.mobile-icon-btn:hover {
  background: var(--surface-hover);
  border-color: rgba(99, 102, 241, 0.3);
}

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

.mobile-icon-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
}

.mobile-user-slot {
  display: flex;
  align-items: center;
}

.mobile-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-avatar-btn:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

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

.mobile-avatar-btn .user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  object-fit: cover;
}

.mobile-avatar-btn.google-login-cta {
  background: var(--surface);
  border-color: var(--border);
}

.mobile-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.mobile-user-pill:hover {
  background: var(--surface-hover);
  border-color: rgba(99, 102, 241, 0.35);
}

.mobile-avatar-click {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}

.mobile-user-pill .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.mobile-user-pill .user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-user-pill .btn-signout {
  padding: 3px 6px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.mobile-user-pill .btn-signout:hover,
.mobile-user-pill .btn-signout:active {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
}

/* Mobile Dashboard (Greetings + Stats Cards + Horizontal Chips) */
.mobile-dashboard {
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.mobile-greeting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 4px 2px 0;
}

.mobile-greeting-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.25;
}

.wave-hand {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 2.5s infinite;
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(14deg); }
  50% { transform: rotate(-4deg); }
}

.mobile-greeting-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.mobile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mobile-stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.mobile-stat-card:active {
  transform: scale(0.96);
}

.stat-card-active {
  border-left: 3.5px solid #6366f1;
}

.stat-card-snoozed {
  border-left: 3.5px solid #f59e0b;
}

.stat-card-total {
  border-left: 3.5px solid #10b981;
}

.m-stat-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.m-stat-info {
  display: flex;
  flex-direction: column;
}

.m-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.m-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Horizontally Scrollable Filter Chips */
.mobile-filter-chips-wrap {
  position: relative;
  margin: 0 -16px;
  padding: 0 16px;
  overflow: hidden;
}

.mobile-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 8px;
  scrollbar-width: none;
}

.mobile-filter-chips::-webkit-scrollbar {
  display: none;
}

.mobile-filter-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-filter-chip:active {
  transform: scale(0.95);
}

.mobile-filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.35);
  font-weight: 600;
}

/* Floating Action Button (FAB) */
.mobile-fab {
  position: fixed;
  bottom: calc(var(--mobile-nav-height) + var(--safe-bottom) + 16px);
  right: max(18px, var(--safe-right));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45), 0 2px 6px rgba(0, 0, 0, 0.2);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 85;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.mobile-fab:active {
  transform: scale(0.92);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.mobile-fab.hidden {
  display: none !important;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--mobile-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  align-items: center;
  justify-content: space-around;
  z-index: 90;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 6px 0;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

.bnav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bnav-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active .bnav-icon {
  transform: translateY(-2px);
  color: var(--primary);
}

.bottom-nav-item.active .bnav-label {
  font-weight: 700;
  color: var(--primary);
}

/* Settings Sheet Styles */
.settings-group {
  margin-bottom: 20px;
}

.settings-group-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 2px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 8px;
}

.settings-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.settings-row-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.settings-row-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ============================================================
   Responsive Breakpoints & Viewport Adaptations
   ============================================================ */

/* Large Tablets & Small Desktops (1024px - 1180px) */
@media (max-width: 1180px) {
  .app {
    grid-template-columns: 240px 1fr;
  }

  .main {
    padding: 22px 22px 28px;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .search-box {
    flex: 1 1 220px;
  }

  .search-box input {
    width: 100%;
  }
}

/* Intermediate Tablets (769px - 900px) */
@media (max-width: 900px) and (min-width: 769px) {
  .app {
    grid-template-columns: 220px 1fr;
  }

  .sidebar {
    padding: 20px 14px;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .calendar-sidebar {
    position: static;
  }
}

/* Mobile First Transformation (<= 768px: Smartphones & Mini Tablets) */
@media (max-width: 768px) {
  html,
  body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app {
    grid-template-columns: 1fr;
    height: 100%;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  /* Hide desktop sidebar and topbar */
  .sidebar {
    display: none !important;
  }

  .topbar {
    display: none !important;
  }

  /* Sticky top mobile navigation header */
  .mobile-header {
    display: flex !important;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
    background: var(--surface-glass) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    margin: 0 -16px 14px -16px !important;
    padding: max(10px, var(--safe-top)) 16px 10px !important;
    width: calc(100% + 32px) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
  }

  .mobile-dashboard {
    display: flex !important;
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  .mobile-fab {
    display: flex !important;
  }

  .main {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 0 16px calc(var(--mobile-nav-height) + var(--safe-bottom) + 24px) !important;
  }

  /* Bottom sheet modal transformation for all dialogs */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    border-radius: 24px 24px 0 0 !important;
    margin: 0 !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding-bottom: max(16px, var(--safe-bottom)) !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45) !important;
  }

  @keyframes sheetSlideUp {
    from {
      transform: translateY(100%);
      opacity: 0.6;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .sheet-drag-handle {
    display: block !important;
    width: 44px;
    height: 4.5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    margin: 10px auto 14px;
    cursor: grab;
  }

  [data-theme="light"] .sheet-drag-handle {
    background: rgba(0, 0, 0, 0.2);
  }

  .modal-header {
    padding: 6px 20px 14px !important;
  }

  .modal-body {
    padding: 0 20px 20px !important;
    max-height: calc(90vh - 140px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modal-footer {
    padding: 14px 20px !important;
  }

  /* Responsive lists & grids */
  .reminder-grid,
  .google-day-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .reminder-card {
    border-radius: 16px !important;
    padding: 14px !important;
  }

  .card-header {
    align-items: flex-start;
  }

  .card-actions {
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
  }

  .card-actions .btn-sm {
    min-height: 38px;
    padding: 6px 14px;
    border-radius: 10px;
  }

  /* Calendar view responsive */
  .calendar-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .calendar-sidebar {
    position: static !important;
    max-height: none !important;
  }

  .cal-day {
    min-height: 48px !important;
    padding: 4px !important;
  }

  .cal-weekday {
    padding: 6px 2px !important;
    font-size: 0.72rem !important;
  }

  .calendar-toolbar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .calendar-toolbar h3 {
    min-width: 0;
    width: 100%;
    order: 2;
    text-align: center;
  }

  /* Google tone bar responsive */
  .google-tone-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    border-radius: 16px;
  }

  .google-tone-bar-controls {
    width: 100%;
  }

  .google-tone-select {
    flex: 1;
    min-width: 0;
  }
}

/* Small Smartphone Optimization (<= 480px: iPhone 12/13/14/15, Pixel, Galaxy) */
@media (max-width: 480px) {
  .mobile-greeting-title {
    font-size: 1.25rem;
  }

  .mobile-greeting-subtitle {
    font-size: 0.82rem;
  }

  .mobile-stats-grid {
    gap: 8px;
  }

  .mobile-stat-card {
    padding: 10px 10px;
    border-radius: 14px;
  }

  .m-stat-value {
    font-size: 1.15rem;
  }

  .m-stat-label {
    font-size: 0.65rem;
  }

  .mobile-filter-chip {
    padding: 6px 14px;
    font-size: 0.82rem;
    min-height: 36px;
  }

  .field-row {
    grid-template-columns: 1fr !important;
  }

  .mobile-user-pill .user-name {
    max-width: 85px;
    font-size: 0.78rem;
  }
}

/* Ultra Compact Devices (<= 360px: iPhone SE, Galaxy Fold outer screen, 320px screens) */
@media (max-width: 360px) {
  .mobile-greeting-title {
    font-size: 1.15rem;
  }

  .mobile-header {
    margin: 0 -10px 10px -10px !important;
    padding: max(8px, var(--safe-top)) 10px 8px !important;
    width: calc(100% + 20px) !important;
  }

  .mobile-brand-title {
    font-size: 1.05rem;
  }

  .mobile-user-pill {
    gap: 4px;
    padding: 2px 6px 2px 3px;
  }

  .mobile-user-pill .user-name {
    max-width: 65px;
    font-size: 0.72rem;
  }

  .mobile-user-pill .btn-signout {
    font-size: 0.68rem;
    padding: 2px 4px;
  }

  .mobile-stat-card {
    padding: 8px 6px;
  }

  .m-stat-icon {
    font-size: 0.95rem;
  }

  .m-stat-value {
    font-size: 1.05rem;
  }

  .main {
    padding: 0 10px calc(var(--mobile-nav-height) + var(--safe-bottom) + 20px) !important;
  }

  .mobile-bottom-nav .bnav-label {
    font-size: 0.65rem;
  }
}

