/* Design System Tokens */
:root {
  --bg-color: #f8f9fc;
  --card-bg: #ffffff;
  --text-main: #1d1d1f;
  --text-muted: #86868b;

  --primary: #5e5ce6;
  --primary-glow: rgba(94, 92, 230, 0.4);

  --color-pee: #ffcc00;
  --color-poop: #8b572a;
  --color-feed: #ff3b30;
  --color-sleep: #32ade6;
  --color-vomit: #af52de;
  --color-other: #ff9500;
  --color-diaper: #B8860B;
  /* Dark goldenrod for Diaper */

  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding-bottom: 80px;
  /* Space for bottom nav */
}

#app {
  width: 100%;
  max-width: 480px;
  /* Mobile width */
  min-height: 100vh;
  background-color: var(--bg-color);
  position: relative;
  overflow-x: hidden;
  box-shadow: var(--shadow-lg);
}

/* ===================== LOGIN SCREEN ===================== */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  z-index: 200;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top));
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.4);
  animation: loginFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 8px 16px rgba(94, 92, 230, 0.4));
  animation: floatIcon 3.5s ease-in-out infinite;
}

.login-title {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.input-group input {
  width: 100%;
  padding: 14px 16px 14px 42px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.input-group input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.input-group input:focus {
  border-color: var(--primary);
  background: rgba(94, 92, 230, 0.1);
}

.auth-error {
  color: #ff6b6b;
  font-size: 13px;
  font-weight: 500;
  min-height: 18px;
  text-align: center;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 16px rgba(94, 92, 230, 0.45);
}

.btn-primary:hover {
  opacity: 0.9;
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.btn-google {
  width: 100%;
  padding: 13px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-google:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-google:active {
  transform: scale(0.98);
}

/* Color Picker Profile Setup */
.color-option {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
}

.color-option.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--primary);
  transform: scale(1.1);
}

/* ===================== HEADER RIGHT ===================== */
.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}


.user-menu-wrapper {
  position: relative;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
  animation: menuFadeIn 0.15s ease;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  background: none;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.user-menu-item:hover {
  background: rgba(0,0,0,0.04);
}

.user-menu-item i {
  font-size: 18px;
  color: var(--text-muted);
}

.user-menu-signout {
  color: #ff3b30;
}

.user-menu-signout i {
  color: #ff3b30;
}

.user-menu-divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 0;
}

.logout-btn {
  background: rgba(29, 29, 31, 0.06);
  border: none;
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  transition: background 0.2s ease, color 0.2s ease;
}

.logout-btn:hover {
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
}

/* Header */
header {
  padding: 16px 20px 14px;
  padding-top: calc(16px + env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: rgba(248, 249, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

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

.header-title-text {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.header-icon {
  font-size: 32px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
  animation: floatIcon 3.5s ease-in-out infinite;
}

.header-image {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

@keyframes floatIcon {
  0% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-3px) rotate(6deg);
  }

  100% {
    transform: translateY(0) rotate(0);
  }
}

header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.app-version-tag {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.5;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
}

.app-version-footer {
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.4;
  padding: 8px 0 4px;
  letter-spacing: 0.03em;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.sync-dot.online {
  background: #34c759;
}

.sync-dot.offline {
  background: #c7c7cc;
}

.sync-dot.syncing {
  background: #ff9f0a;
  animation: sync-pulse 1.2s ease-in-out infinite;
}

@keyframes sync-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-color, #f2f2f7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-screen.hidden {
    display: none !important;
}
.data-loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-color, #f2f2f7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: opacity 0.3s ease;
}
.data-loading-overlay.hidden {
    display: none !important;
}
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.loading-logo {
    width: 72px;
    height: 72px;
    animation: pulse 1.4s ease-in-out infinite;
}
.loading-text {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted, #8e8e93);
    letter-spacing: 0.3px;
}
.loading-dots span {
    animation: loading-dot-blink 1.4s ease-in-out infinite;
    opacity: 0;
}
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes loading-dot-blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* Feed Reminder Banner (in-app fallback for iOS) */
#feed-reminder-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 420px;
  background: #1c1c1e;
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 9999;
  animation: banner-slide-in 0.3s ease;
}

@keyframes banner-slide-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.feed-banner-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.feed-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-banner-text strong {
  font-size: 14px;
  font-weight: 600;
}

.feed-banner-text span {
  font-size: 13px;
  opacity: 0.8;
}

.feed-banner-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

/* Feed Timer */
.feed-timer-display {
  font-size: 64px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  text-align: center;
  letter-spacing: -2px;
  margin: 12px 0 4px;
  line-height: 1;
}

.feed-timer-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  margin: 8px 0 20px;
}

/* Full-screen timer takeover */
#breastfeedingModal.timer-fullscreen {
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  transform: none;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px calc(48px + env(safe-area-inset-bottom));
  overflow: hidden;
}

#breastfeedingModal.timer-fullscreen #bf-screen-2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
}

#breastfeedingModal.timer-fullscreen .feed-timer-display {
  font-size: 96px;
  letter-spacing: -4px;
  margin: 24px 0 8px;
}

#breastfeedingModal.timer-fullscreen h3 {
  font-size: 28px;
  margin-bottom: 0;
}

#breastfeedingModal.timer-fullscreen .save-btn,
#breastfeedingModal.timer-fullscreen .cancel-btn {
  width: 100%;
  max-width: 360px;
}

/* Dashboard Grid */
.actions-header-container {
  padding: 0 24px 12px;
}

/* Section-level title headers should NOT inherit the negative margin
   that's designed for inline timeline date separators */
.actions-header-container h3,
.todo-header-container h3 {
  margin-bottom: 0;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 24px 24px;
}

.action-btn {
  background: var(--card-bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}

.action-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.action-btn:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-md);
}

.action-btn i {
  font-size: 40px;
  margin-bottom: 4px;
}

.action-btn span {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-main);
}

.action-btn .last-event-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: -8px;
  /* Pull it slightly closer to the main text */
}

.diaper-btn i {
  color: var(--color-diaper);
}

.feed-btn i,
.feed-btn svg {
  color: var(--color-feed);
}

.feed-btn.feed-waiting {
  background: rgba(255, 59, 48, 0.1);
}

.feed-btn.feed-waiting i,
.feed-btn.feed-waiting svg,
.feed-btn.feed-waiting span {
  color: #ff3b30;
}

.feed-btn.feed-waiting .last-event-time {
  color: #ff3b30;
  font-weight: 600;
}

.feed-btn.feed-ready {
  background: rgba(52, 199, 89, 0.1);
}

.feed-btn.feed-ready i,
.feed-btn.feed-ready svg,
.feed-btn.feed-ready span {
  color: #34c759;
}

.feed-btn.feed-ready .last-event-time {
  color: #34c759;
  font-weight: 600;
}

.sleep-btn i {
  color: var(--color-sleep);
}

.sleep-btn.active,
.feed-btn.active {
  background: var(--color-primary, #5e5ce6);
  color: white;
  animation: pulseActive 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.sleep-btn.active i,
.sleep-btn.active span,
.feed-btn.active svg,
.feed-btn.active span {
  color: white;
}

@keyframes pulseActive {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(94, 92, 230, 0.4);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(94, 92, 230, 0);
  }
}

.other-btn i {
  color: var(--color-other);
}

/* Timeline Filter Chips */
.timeline-filter-chips {
  display: flex;
  gap: 8px;
  padding: 16px 24px 16px;
  margin-top: -16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  background: var(--card-bg);
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(94, 92, 230, 0.3);
}

/* Timeline */
.timeline-container {
  padding: 0 24px 40px;
}

.timeline-container h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
  display: none;
  /* Removed the hardcoded 'Today' header */
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.timeline-date-header {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: -12px;
}

.timeline-day-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.timeline-icon.pee {
  background: rgba(255, 204, 0, 0.15);
  color: var(--color-pee);
}

.timeline-icon.poop {
  background: rgba(139, 87, 42, 0.15);
  color: var(--color-poop);
}

.timeline-icon.diaper {
  background: rgba(184, 134, 11, 0.15);
  /* Match --color-diaper */
  color: var(--color-diaper);
}

.timeline-icon.feed {
  background: rgba(255, 59, 48, 0.15);
  color: var(--color-feed);
}

.timeline-icon.sleep {
  background: rgba(50, 173, 230, 0.15);
  color: var(--color-sleep);
}

.timeline-icon.other {
  background: rgba(255, 149, 0, 0.15);
  color: var(--color-other);
}

.timeline-content {
  flex: 1;
  min-width: 0;
  /* Critical for text truncation in flex containers */
}

.timeline-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.timeline-meta {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.growth-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.growth-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.growth-pill i {
  font-size: 14px;
}

.tracker-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tracker-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.tracker-pill i {
  font-size: 14px;
}

.tracker-pill.feed-pill,
.tracker-pill.sleep-pill,
.tracker-pill.diaper-pill,
.tracker-pill.other-pill {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
}

.timeline-comment {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
  margin-bottom: 2px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  /* Prevents long words/links from breaking layout */
  border-left: 2px solid rgba(0, 0, 0, 0.05);
  padding-left: 8px;
}

.timeline-time {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
  text-align: right;
}

.timeline-user-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Tooltip for the user circle — appears below to avoid viewport clipping */
.timeline-user-circle::after {
  content: attr(data-email);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(30, 30, 35, 0.92);
  color: #fff;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.95);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.18s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  z-index: 2000;
  pointer-events: none;
}

/* Arrow pointing up */
.timeline-user-circle::before {
  content: '';
  position: absolute;
  top: calc(100% + 4px);
  right: 10px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent rgba(30, 30, 35, 0.92) transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s;
  z-index: 2001;
  pointer-events: none;
}

/* Show on hover / tap / focus */
.timeline-user-circle:hover::after,
.timeline-user-circle:active::after,
.timeline-user-circle:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.timeline-user-circle:hover::before,
.timeline-user-circle:active::before,
.timeline-user-circle:focus::before {
  opacity: 1;
  visibility: visible;
}

.timeline-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* Delete Button (Two-Tap) */
.delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
  /* Prevent the 300ms iOS tap delay */
  touch-action: manipulation;
}

.delete-btn i,
.delete-btn svg {
  pointer-events: none;
}

.delete-btn:hover {
  color: var(--primary);
  background: rgba(94, 92, 230, 0.08);
  transform: translateY(-1px);
}

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

/* State 1: Confirmation requested */
.delete-btn.confirm-delete {
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.1);
  transform: scale(1.1);
  animation: pulseWarning 1.5s infinite;
}

@keyframes pulseWarning {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(255, 59, 48, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
  }
}

/* State 2: Actually deleting (slide out) */
.timeline-item.deleting {
  transform: translateX(100%);
  opacity: 0;
  margin-bottom: -72px;
  /* Pulls the next item up smoothly */
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hidden {
  display: none !important;
}

/* Modals */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* When hidden, truly remove from hit-testing to prevent iOS ghost taps */
.overlay.hidden {
  display: none !important;
}

/* Inner overlay: sits between stacked modals (e.g. schedule → detail) */
.inner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1010;
}

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

.modal {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 92vh;
  overflow-y: auto;
}

.modal.hidden {
  transform: translateX(-50%) translateY(100%);
}

.modal h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
}

/* Specific styling for the time input to make it look decent on dark mode */
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
}

.modal-options {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.option-btn {
  flex: 1;
  background: var(--bg-color);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* Fix iOS 300ms tap delay */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.option-btn i {
  font-size: 28px;
}

.option-btn:hover {
  border-color: var(--primary);
  background: rgba(94, 92, 230, 0.06);
  color: var(--primary);
}

.option-btn:active {
  background: rgba(94, 92, 230, 0.14);
  transform: scale(0.97);
}

.option-btn.selected {
  border-color: var(--primary);
  background: rgba(94, 92, 230, 0.1);
  color: var(--primary);
}

/* Inputs */
.modal-input-group {
  margin-bottom: 24px;
}

.modal-input-group input {
  width: 100%;
  max-width: 100%;
  display: block;
  padding: 16px;
  border: 2px solid #e5e5ea;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  color: var(--text-main);
  background: var(--bg-color);
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.modal-input-group input:focus,
.modal-input-group textarea:focus {
  border-color: var(--primary);
}

/* Toggle Switch */
.toggle-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 16px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
}

.toggle-container label {
  font-weight: 500;
  font-size: 16px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e5e5ea;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
  background-color: #34c759;
}

input:checked+.slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.save-btn,
.cancel-btn {
  width: 100%;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 16px;
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  /* Fix iOS 300ms tap delay */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.save-btn {
  background: var(--primary);
  color: white;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, opacity 0.2s ease;
}

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

.cancel-btn {
  background: var(--bg-color);
  color: var(--text-muted);
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  font-weight: 500;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cancel-btn:hover {
  background: rgba(94, 92, 230, 0.07);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.save-btn:active,
.cancel-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================== BOTTOM NAVIGATION ===================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(70px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  cursor: pointer;
  flex: 1;
  height: 100%;
  transition: color 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item i {
  font-size: 24px;
  transition: transform 0.2s ease;
}

.nav-item span {
  font-size: 12px;
  font-weight: 500;
}

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

.nav-item.active i {
  transform: scale(1.15);
  font-weight: bold;
}

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

/* ===================== TO-DO VIEW ===================== */
#todoView {
  padding-bottom: 24px;
  animation: fadeIn 0.3s ease;
}

.todo-header-container {
  padding: 0 24px 12px;
  margin-bottom: 0;
}

.todo-search-bar {
  display: flex;
  align-items: center;
  padding: 0 24px 12px;
  gap: 10px;
}

.todo-search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.todo-search-icon {
  position: absolute;
  left: 14px;
  font-size: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.todo-search-input-wrap input {
  width: 100%;
  padding: 13px 40px 13px 42px;
  border: 2px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-lg);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  background: var(--card-bg);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.todo-search-input-wrap input:focus {
  border-color: var(--primary);
}

.todo-search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: background 0.2s ease, color 0.2s ease;
}

.todo-search-clear:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-main);
}

.add-todo-fab {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(94, 92, 230, 0.35);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.add-todo-fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(94, 92, 230, 0.25);
}

/* Health collapsible search */
.health-search-bar {
  overflow: hidden;
  max-height: 80px;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease;
  opacity: 1;
}

.health-search-bar.collapsed {
  max-height: 0;
  opacity: 0;
}

.health-search-toggle {
  padding: 6px 10px;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.health-search-toggle.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}


.todo-input-container input {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-lg);
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: all 0.2s ease;
}

.todo-input-container input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.add-todo-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 8px 16px var(--primary-glow);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  flex-shrink: 0;
}

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

.add-todo-btn:hover {
  box-shadow: 0 12px 24px var(--primary-glow);
}

.todo-list {
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.todo-item {
  background: var(--card-bg);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  transition: transform 0.2s ease, opacity 0.3s ease;
  animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.todo-item.completed {
  opacity: 0.6;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.todo-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.todo-item.completed .todo-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}

.todo-text {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  word-break: break-word;
  transition: all 0.2s ease;
}

.todo-delete {
  background: none;
  border: none;
  color: #ff3b30;
  opacity: 0.5;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  margin: -8px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.todo-delete:hover {
  opacity: 1;
}

.todo-delete:active {
  transform: scale(0.9);
}

.todo-delete.confirm-delete {
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
  opacity: 1;
  border-radius: 50%;
  transform: scale(1.1);
  animation: pulseWarning 1.5s infinite;
}

.todo-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.todo-extras {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  min-height: 20px;
}

.todo-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-color);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.todo-assignee-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

.todo-has-comment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  opacity: 0.8;
  font-size: 14px;
}

.todo-view-completed-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: 2px dashed rgba(0,0,0,0.1);
  border-radius: var(--radius-md);
  background: none;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.todo-view-completed-btn:hover {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.18);
}

.todo-completed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-top: 16px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease;
}

.todo-completed-header:hover {
  background: rgba(0, 0, 0, 0.05);
}

.todo-completed-header i {
  transition: transform 0.3s ease;
}

.todo-completed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding: 0 8px;
  /* Slight indent */
}

/* Edit Task Modal Overrides */
#todoDetailModal .modal-input-group {
  margin-bottom: 16px;
}

#todoDetailModal select {
  cursor: pointer;
}
/* ===== TEETHING MAP ===== */
.teething-section {
  margin: 16px 0 8px;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px 20px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

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

.teething-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.teething-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.teething-counter {
  font-size: 13px;
  font-weight: 600;
  color: #34c759;
  background: rgba(52, 199, 89, 0.1);
  padding: 3px 10px;
  border-radius: 20px;
}

.teething-chart {
  width: 100%;
}

.teething-svg {
  width: 100%;
  height: auto;
  display: block;
}

.tooth-group:hover .tooth-rect {
  filter: brightness(0.93);
}

.tooth-group:active .tooth-rect {
  transform: scale(0.96);
  transform-box: fill-box;
  transform-origin: center;
}

#teethingModal {
  z-index: 1010;
}

.teething-modal-date-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(52, 199, 89, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
}

/* ===== VACCINE SCHEDULE ===== */
/* ── Vaccine Schedule ───────────────────────────── */
.vaccine-milestone {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  border: 1.5px solid rgba(94, 92, 230, 0.2);
}

.vaccine-milestone.milestone-due {
  border-color: rgba(255,149,0,0.45);
  box-shadow: 0 0 0 1px rgba(255,149,0,0.2), var(--shadow-sm);
}

.vaccine-milestone.milestone-done {
  opacity: 0.72;
}

.vaccine-milestone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  gap: 10px;
  transition: background 0.15s ease;
  background: rgba(94, 92, 230, 0.04);
  border-bottom: 1px solid rgba(94, 92, 230, 0.1);
}

.vaccine-milestone-header:hover {
  background: rgba(94, 92, 230, 0.08);
}

.vaccine-milestone-header:active {
  background: rgba(0,0,0,0.06);
}

.vaccine-milestone-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.vaccine-milestone-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vaccine-milestone-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.vaccine-milestone-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Progress bar */
.vaccine-progress-bar {
  height: 4px;
  background: rgba(0,0,0,0.07);
  border-radius: 4px;
  overflow: hidden;
}

.vaccine-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: #34c759;
  transition: width 0.4s ease;
}

.milestone-due .vaccine-progress-fill {
  background: #ff9500;
}

/* Chevron */
.vaccine-milestone-chevron {
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.vaccine-milestone-doses:not(.collapsed) ~ * .vaccine-milestone-chevron,
.vaccine-milestone-header.open .vaccine-milestone-chevron {
  transform: rotate(180deg);
}

/* Badges */
.vaccine-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.vaccine-badge-done {
  background: rgba(52,199,89,0.12);
  color: #27a24a;
}

.vaccine-badge-due {
  background: rgba(255,149,0,0.15);
  color: #c96800;
}

.vaccine-badge-upcoming {
  background: rgba(94,92,230,0.1);
  color: var(--primary);
}

.vaccine-badge-future {
  background: rgba(0,0,0,0.05);
  color: var(--text-muted);
  font-weight: 500;
}

/* Dose rows */
.vaccine-milestone-doses {
  border-top: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.vaccine-milestone-doses.collapsed {
  display: none;
}

.vaccine-dose-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: background 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.vaccine-dose-row:last-child {
  border-bottom: none;
}

.vaccine-dose-row:hover {
  background: rgba(0,0,0,0.025);
}

.vaccine-dose-row:active {
  background: rgba(94,92,230,0.06);
}

.vaccine-dose-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.vaccine-dose-icon.icon-done {
  background: rgba(52,199,89,0.12);
  color: #27a24a;
}

.vaccine-dose-icon.icon-due {
  background: rgba(255,149,0,0.12);
  color: #c96800;
}

.vaccine-dose-icon.icon-pending {
  background: rgba(0,0,0,0.05);
  color: var(--text-muted);
}

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

.vaccine-dose-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  display: block;
}

.vaccine-dose-done .vaccine-dose-name {
  color: var(--text-muted);
  font-weight: 400;
}

.vaccine-dose-due .vaccine-dose-name {
  font-weight: 600;
}

.vaccine-dose-num {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}

.vaccine-dose-date {
  font-size: 12px;
  color: #27a24a;
  font-weight: 600;
  white-space: nowrap;
}

.vaccine-dose-chevron {
  font-size: 16px;
  color: rgba(0,0,0,0.18);
  flex-shrink: 0;
}

#vaccineDoseModal {
  z-index: 1020;
}

/* ── Visitor Mode ───────────────────────────────────────────── */

/* Feed, Sleep, Diaper, Other — fully disabled for visitors */
body.visitor-mode #feedBtn,
body.visitor-mode #sleepBtn,
body.visitor-mode .action-btn.diaper-btn,
body.visitor-mode .action-btn.other-btn {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Growth and Medical health buttons — dimmed for visitors */
body.visitor-mode #growthBtn,
body.visitor-mode #medicalBtn {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}


/* Todo add FAB — visible but disabled for visitors */
body.visitor-mode .add-todo-fab {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Todo detail modal — grey out all fields for visitors */
body.visitor-mode #todoDetailModal input,
body.visitor-mode #todoDetailModal textarea,
body.visitor-mode #todoDetailModal select {
  background: var(--bg-color) !important;
  color: var(--text-secondary) !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}

/* Priority toggle — disabled for visitors */
body.visitor-mode #todoPriorityToggle,
body.visitor-mode label[for="todoPriorityToggle"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* All modal save buttons — greyed out for visitors (covers any open modal on role change) */
body.visitor-mode .modal .save-btn {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}


/* Visitor toast — brief centered message */
#visitor-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 30, 35, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  pointer-events: none;
}

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

/* ── Update Toast ───────────────────────────────────────────── */
#update-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 30, 35, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}

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

#update-toast button {
  background: var(--primary, #5e5ce6);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

#update-toast button:hover {
  opacity: 0.85;
}
