:root {
  --primary: #7C3AED;
  --secondary: #06B6D4;
  --surface: #1E1E2E;
  --background: #12121F;
  --card: #1E1E2E;
  --text-primary: #E2E8F0;
  --text-secondary: #94A3B8;
  --danger: #EF4444;
  --success: #10B981;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.page { display: none; height: 100vh; }
.page.active { display: flex; }
.view { display: none; flex-direction: column; overflow-y: auto; padding: 0 16px 80px; }
.view.active { display: flex; }

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-danger {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-danger:hover { background: rgba(239, 68, 68, 0.1); }

.btn-sm {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-complete { background: var(--secondary); color: white; }
.btn-cancel { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-delete { background: transparent; color: var(--danger); }
.btn-complete:hover, .btn-cancel:hover, .btn-delete:hover { opacity: 0.8; }

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border-top: 1px solid rgba(255,255,255,0.05);
  z-index: 100;
  padding: 6px 0;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s;
}

.nav-btn.active { color: var(--primary); }
.nav-icon { font-size: 20px; }
.nav-label { font-size: 11px; font-weight: 500; }

.main-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 70px;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: var(--background);
  z-index: 10;
}

.view-header h1 { font-size: 22px; font-weight: 700; }

.welcome-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.welcome-greeting {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.welcome-sub {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: white;
  overflow: hidden;
}

.avatar-large img { width: 100%; height: 100%; object-fit: cover; }

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-emoji { font-size: 24px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-secondary); }

.section { margin-bottom: 24px; }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; }

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

.memory-card, .reminder-card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: transform 0.15s;
}

.memory-card:hover, .reminder-card:hover { transform: translateY(-1px); }

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.card-body { flex: 1; min-width: 0; }
.card-content { font-size: 14px; line-height: 1.5; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 11px; color: var(--text-secondary); }
.card-actions { display: flex; gap: 6px; margin-top: 6px; }

.overdue-badge {
  display: inline-block;
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  background: var(--card);
  border-radius: 16px;
}

.search-bar { margin-bottom: 8px; }

.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  background: var(--surface);
  border: none;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.598.856a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}

.search-bar input::placeholder { color: var(--text-secondary); }

.filter-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s;
}

.chip.active {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

.settings-content { display: flex; flex-direction: column; gap: 12px; }

.settings-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
}

.settings-card h3 { margin-bottom: 8px; font-size: 16px; }
.settings-card ol { padding-left: 20px; line-height: 1.8; font-size: 13px; }

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.text-secondary { color: var(--text-secondary); font-size: 13px; }

.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.btn-add {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

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

.add-memory-form {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.add-memory-form.hidden { display: none; }

.add-memory-form textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  padding: 12px 14px;
  resize: vertical;
  outline: none;
  min-height: 80px;
  transition: border-color 0.2s;
}

.add-memory-form textarea:focus { border-color: var(--primary); }
.add-memory-form textarea::placeholder { color: var(--text-secondary); }

.add-memory-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}

.telegram-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(34, 158, 217, 0.10);
  border: 1px solid rgba(34, 158, 217, 0.30);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 0 18px;
}
.telegram-banner.hidden { display: none; }
.tg-banner-text {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.tg-banner-logo { width: 36px; height: 36px; flex-shrink: 0; }
.tg-banner-body { min-width: 0; }
.tg-banner-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.tg-banner-sub { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.btn-connect-tg {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #229ED9;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.btn-connect-tg:hover { background: #1a8cbf; transform: translateY(-1px); }
.btn-connect-tg:active { transform: translateY(0); }

.ob-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.ob-back-btn:hover { opacity: 1; }

.error-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 16px 0;
  color: #fca5a5;
  font-size: 13px;
}

@media (min-width: 768px) {
  .app-layout { max-width: 700px; }
  .view { padding: 0 24px 80px; }
}

/* ============================================================
   ONBOARDING OVERLAY
   ============================================================ */

#onboarding-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  flex-direction: row;
  background: #0A0A18;
}

#onboarding-overlay.ob-active {
  display: flex;
}

/* --- Left icon panel --- */
#ob-icon-panel {
  width: 42%;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: #0A0A18;
  position: relative;
  overflow: hidden;
  padding: 40px 32px;
}

#ob-icon-panel::before {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.18) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: obPulseGlow 3s ease-in-out infinite;
}

@keyframes obPulseGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50%       { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

.ob-icon-stage {
  width: 180px;
  height: 180px;
  position: relative;
  z-index: 1;
}

.ob-icon-stage svg {
  width: 100%;
  height: 100%;
}

.ob-step-counter {
  font-size: 13px;
  font-weight: 500;
  color: rgba(160, 160, 192, 0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* --- Right interact panel --- */
#ob-interact-panel {
  flex: 1;
  background: #13132A;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 48px 40px;
  overflow-y: auto;
  position: relative;
}

/* --- Step visibility & animation --- */
.ob-step { display: none; flex-direction: column; gap: 0; }
.ob-step.active {
  display: flex;
  animation: obSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.ob-step.ob-exit {
  animation: obSlideOut 0.25s ease both;
}

@keyframes obSlideIn {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes obSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-28px); }
}

/* --- Typography --- */
.ob-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7C3AED;
  margin-bottom: 12px;
}

.ob-headline {
  font-size: 30px;
  font-weight: 800;
  color: #F0F0FF;
  line-height: 1.2;
  margin-bottom: 12px;
}

.ob-sub {
  font-size: 15px;
  color: #8A8AB0;
  line-height: 1.65;
  margin-bottom: 28px;
}

/* Typewriter cursor */
.ob-typewriter::after {
  content: '|';
  color: #7C3AED;
  animation: obBlink 1s step-end infinite;
  margin-left: 2px;
}
.ob-typewriter.ob-typed::after { display: none; }

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

/* --- Buttons --- */
.ob-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 26px;
  background: linear-gradient(135deg, #7C3AED 0%, #06B6D4 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.18s;
  margin-top: 8px;
  letter-spacing: 0.01em;
}
.ob-btn:hover { opacity: 0.88; transform: scale(1.015); }
.ob-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.ob-btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  background: transparent;
  color: #8A8AB0;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  margin-top: 8px;
}
.ob-btn-ghost:hover { border-color: #7C3AED; color: #F0F0FF; }

.ob-btn-google {
  background: #fff;
  color: #1a1a2e;
  font-weight: 600;
}
.ob-btn-google:hover { opacity: 0.92; }

.ob-btn-microsoft {
  background: #2A2A4A;
  color: #F0F0FF;
  font-weight: 600;
}
.ob-btn-microsoft:hover { background: #323260; }

.ob-btn-link {
  background: none;
  border: none;
  color: #8A8AB0;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 0;
  text-align: center;
  transition: color 0.18s;
  width: 100%;
}
.ob-btn-link:hover { color: #7C3AED; }

.ob-btn-celebrate {
  background: linear-gradient(135deg, #06B6D4 0%, #7C3AED 50%, #EC4899 100%);
  background-size: 200% 200%;
  animation: obGradientShift 2.5s ease infinite;
  font-size: 16px;
  height: 56px;
}
@keyframes obGradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Input --- */
.ob-input {
  width: 100%;
  padding: 14px 18px;
  background: #0A0A18;
  border: 1px solid #2A2A4A;
  border-radius: 12px;
  color: #F0F0FF;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 16px;
}
.ob-input:focus {
  border-color: #7C3AED;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.ob-input::placeholder { color: #4A4A6A; }

/* --- Cards --- */
.ob-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.ob-card-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.ob-card {
  border: 1.5px solid #2A2A4A;
  border-radius: 14px;
  padding: 18px 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: center;
  user-select: none;
}
.ob-card:hover { border-color: #5B21B6; transform: translateY(-2px); }
.ob-card.selected {
  border-color: #7C3AED;
  background: rgba(124, 58, 237, 0.1);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.ob-card-icon { font-size: 26px; margin-bottom: 8px; }
.ob-card-name { font-size: 13px; font-weight: 700; color: #F0F0FF; margin-bottom: 4px; }
.ob-card-desc { font-size: 11px; color: #6A6A8A; line-height: 1.4; }

/* --- Privacy list --- */
.ob-privacy-list {
  list-style: none;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ob-privacy-list li {
  font-size: 14px;
  color: #A0A0C0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}
.ob-check {
  color: #06B6D4;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* --- Pills / chips --- */
.ob-highlight-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.ob-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  color: #A78BFA;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.ob-email-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.ob-feature-chip {
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.2);
  color: #67E8F9;
  font-size: 12px;
  font-weight: 600;
}

/* --- Divider --- */
.ob-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.ob-divider::before,
.ob-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.ob-divider span {
  color: #4A4A6A;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Complete step --- */
.ob-complete-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.ob-stat-chip {
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.2);
  color: #67E8F9;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- Progress dots --- */
.ob-progress-dots {
  display: flex;
  gap: 6px;
  padding-top: 32px;
  margin-top: auto;
}
.ob-dot {
  height: 6px;
  border-radius: 3px;
  background: #2A2A4A;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 6px;
}
.ob-dot.active {
  background: linear-gradient(90deg, #7C3AED, #06B6D4);
  width: 22px;
}
.ob-dot.done {
  background: #5B21B6;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  #onboarding-overlay { flex-direction: column; }
  #ob-icon-panel {
    width: 100%;
    min-width: unset;
    padding: 20px;
    height: 120px;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
  #ob-icon-panel::before { width: 200px; height: 200px; }
  .ob-icon-stage { width: 60px; height: 60px; }
  .ob-step-counter { font-size: 12px; }
  #ob-interact-panel { padding: 28px 24px 24px; justify-content: flex-start; }
  .ob-headline { font-size: 24px; }
  .ob-card-grid { grid-template-columns: repeat(3, 1fr); }
  .ob-card-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .ob-card { padding: 12px 8px; }
  .ob-card-icon { font-size: 20px; }
}

/* ===== APP LOADER ===== */
#app-loader {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0d0d1a;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.app-loader-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(124, 58, 237, 0.25);
  border-top-color: #7C3AED;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.app-loader-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.04em;
  margin: 0;
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-secondary:hover { background: rgba(255,255,255,0.18); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm.btn-danger {
  width: auto;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
}
.btn-sm.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-sm.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

.hidden { display: none !important; }

/* ── Google Calendar Integration ─────────────────────────────── */
.integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

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

.integration-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.integration-status {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

.gcal-connected {
  color: #4ade80;
}

.gcal-calendar-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.gcal-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

.gcal-id-input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  font-family: inherit;
  min-width: 0;
}
.gcal-id-input:focus { outline: none; border-color: rgba(255,255,255,0.35); }

.gcal-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ── Calendar Event Cards ─────────────────────────────────────── */
.calendar-event-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.cal-event-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin-bottom: 4px;
}

.cal-event-time {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.cal-event-location {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-title-row .section-title { margin-bottom: 0; }

.btn-add-sm {
  font-size: 12px;
  padding: 4px 12px;
  height: 28px;
}

.calendar-event-card {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cal-event-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.cal-event-main { flex: 1; min-width: 0; }
.cal-event-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cal-event-delete-btn {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.6;
}
.cal-event-delete-btn:hover { opacity: 1; }

.cal-event-edit-btn {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.55;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.cal-event-edit-btn:hover { opacity: 1; border-color: rgba(255,255,255,0.3); }

.edit-event-form {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 10px;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.edit-event-form.hidden { display: none; }
.edit-event-form input[type="text"],
.edit-event-form textarea {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  padding: 8px 10px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.edit-event-form input[type="text"]:focus,
.edit-event-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.edit-event-form input[type="text"]::placeholder,
.edit-event-form textarea::placeholder { color: var(--text-secondary); }
.edit-event-error {
  font-size: 12px;
  color: var(--danger);
  padding: 4px 0;
}
.edit-event-error.hidden { display: none; }
.calendar-event-card.editing .cal-event-row { opacity: 0.65; }
.calendar-event-card.saving { opacity: 0.5; pointer-events: none; }

.add-event-form {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.add-event-form.hidden { display: none; }

.add-event-form input[type="text"],
.add-event-form textarea {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  padding: 8px 10px;
  font-family: inherit;
  resize: vertical;
}
.add-event-form input[type="text"]:focus,
.add-event-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.add-event-form input[type="text"]::placeholder,
.add-event-form textarea::placeholder { color: var(--text-secondary); }

.add-event-times {
  display: flex;
  gap: 10px;
}
.time-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.time-field label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.time-field input[type="datetime-local"] {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 7px 8px;
  font-family: inherit;
  color-scheme: dark;
}
.time-field input[type="datetime-local"]:focus {
  outline: none;
  border-color: var(--primary);
}

.add-event-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.add-event-error {
  font-size: 12px;
  color: var(--danger);
  padding: 4px 0;
}
.add-event-error.hidden { display: none; }

/* ===================== TODAY'S BRIEFING ===================== */
#today-briefing-section {
  background: var(--card);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

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

.briefing-header .section-title {
  margin-bottom: 0;
}

.briefing-date-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.briefing-greeting {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.briefing-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin: 10px 0 6px;
}

.briefing-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  transition: opacity 0.2s;
}

.briefing-item.past {
  opacity: 0.45;
  text-decoration: line-through;
}

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

.briefing-dot-cal {
  background: var(--primary);
}

.briefing-dot-rem {
  background: var(--secondary);
}

.briefing-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 58px;
  flex-shrink: 0;
}

.briefing-title {
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.briefing-empty {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 0;
  text-align: center;
}
