/* ============================================================
   Walt - Tom's Health Assistant
   Mobile-first, high-contrast, accessibility-focused
   v2.0
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: #1a1a2e;
  background: #eef1f8;
  -webkit-font-smoothing: antialiased;
}

/* ---- PIN Screen ---- */
.pin-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: #eef1f8;
  padding: 20px;
}

.pin-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 340px;
}

.pin-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: #1a73e8;
  color: #fff;
  font-size: 42px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.pin-title {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.5px;
}

.pin-subtitle {
  font-size: 17px;
  color: #666;
  margin-top: -6px;
  margin-bottom: 8px;
}

.pin-display {
  font-size: 36px;
  letter-spacing: 18px;
  color: #1a73e8;
  font-weight: 600;
  padding: 10px 20px;
  background: #fff;
  border: 2px solid #c5d5f5;
  border-radius: 12px;
  min-width: 200px;
  text-align: center;
  margin-bottom: 4px;
}

.pin-error {
  font-size: 16px;
  color: #c0392b;
  font-weight: 500;
  background: #fdecea;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 8px 16px;
  text-align: center;
  width: 100%;
}

/* Attempts-remaining counter — shown only after a wrong PIN */
.pin-attempts {
  font-size: 14px;
  color: #a16207;
  font-weight: 600;
  background: #fef9c3;
  border: 1px solid #e6d475;
  border-radius: 8px;
  padding: 6px 14px;
  text-align: center;
  width: 100%;
}

/* Lockout countdown — shown after hitting rate limit */
.pin-lockout {
  font-size: 15px;
  color: #7f1d1d;
  font-weight: 600;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 16px;
  text-align: center;
  width: 100%;
  line-height: 1.4;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.key-btn {
  height: 72px;
  font-size: 28px;
  font-weight: 500;
  color: #1a1a2e;
  background: #fff;
  border: 2px solid #dce6f9;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.key-btn:active {
  background: #e8f0fe;
  transform: scale(0.95);
}

.key-btn:disabled {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.key-blank {
  pointer-events: none;
}

.key-del {
  font-size: 22px;
  color: #555;
}

/* ---- App Shell ---- */
.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: #eef1f8;
}

/* ---- Header ---- */
.app-header {
  flex-shrink: 0;
  height: 60px;
  background: linear-gradient(135deg, #1a73e8 0%, #1255c0 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(26,85,192,0.18);
}

.header-inner {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.header-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.header-sub {
  font-size: 14px;
  opacity: 0.85;
  font-weight: 400;
}

/* ---- Tab Content Area ---- */
.tab-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-pane {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- Chat Input Bar ---- */
.chat-input-bar {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #dce6f9;
  z-index: 10;
}

.chat-input {
  flex: 1;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.5;
  color: #333;
  background: #f5f7fb;
  border: 2px solid #c5d5f5;
  border-radius: 22px;
  padding: 10px 16px;
  resize: none;
  outline: none;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.15s;
}

.chat-input:focus {
  border-color: #1a73e8;
  background: #fff;
}

.chat-input::placeholder {
  color: #666;
}

.send-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
}

.send-btn:hover {
  background: #1558b0;
}

.send-btn:active {
  transform: scale(0.93);
}

.send-btn:disabled {
  background: #b0c4e8;
  cursor: default;
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
  flex-shrink: 0;
  height: 70px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid #d8e4f5;
  box-shadow: 0 -2px 10px rgba(26,85,192,0.07);
  z-index: 10;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 8px 4px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 70px;
}

.nav-btn svg {
  transition: stroke 0.15s;
}

.nav-btn.active {
  color: #1a73e8;
}

.nav-btn:active {
  background: #eef1f8;
}

/* ---- Chat Messages ---- */
.chat-messages {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* bottom padding for input bar height */
  padding-bottom: 8px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.user-msg {
  align-self: flex-end;
  align-items: flex-end;
}

.walt-msg {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 17px;
  line-height: 1.55;
}

.user-msg .msg-bubble {
  background: #1a73e8;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.walt-msg .msg-bubble {
  background: #fff;
  color: #1a1a2e;
  border: 1px solid #d8e4f5;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(26,85,192,0.06);
}

.msg-bubble p {
  margin: 0 0 6px;
}

.msg-bubble p:last-child {
  margin-bottom: 0;
}

.msg-bubble ul {
  margin: 6px 0 6px 20px;
  padding: 0;
}

.msg-bubble li {
  margin-bottom: 4px;
}

.msg-bubble strong {
  font-weight: 600;
}

/* Confidence badge */
.confidence-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.confidence-high {
  background: #dcfce7;
  color: #166534;
}

.confidence-medium {
  background: #fef9c3;
  color: #854d0e;
}

.confidence-low {
  background: #fee2e2;
  color: #991b1b;
}

/* Disclaimer */
/* Medical disclaimer — upgraded for readability.
   This is the most important safety string in the app; treat it like it matters. */
.msg-disclaimer {
  font-size: 14px;
  color: #334155;          /* slate-700, ~11:1 on white — exceeds WCAG AAA */
  font-weight: 500;
  margin-top: 8px;
  padding: 8px 12px;
  line-height: 1.5;
  background: #f1f5f9;     /* subtle slate-100 background so it reads as a notice */
  border-left: 3px solid #1a73e8;
  border-radius: 6px;
}

/* Sources */
.msg-sources {
  font-size: 13px;
  color: #555;              /* was #555 (3.54:1 — fail) → #555 (~7:1 — pass) */
  margin-top: 4px;
  padding: 0 2px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #dce6f9;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #aac4f0;
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Error message in chat */
.chat-error {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  color: #c0392b;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 16px;
  align-self: center;
  max-width: 90%;
  text-align: center;
}

/* ---- Medications Tab ---- */
.meds-content {
  padding: 16px 12px 24px;
}

.meds-slot {
  margin-bottom: 20px;
}

.meds-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px 10px 0 0;
  margin-bottom: 0;
}

.meds-slot-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}

.slot-count {
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,0.28);
  color: #fff;
  padding: 2px 9px;
  border-radius: 10px;
}

.slot-time {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  font-weight: 400;
}

/* Time slot color themes */
.slot-morning .meds-slot-header   { background: #1a73e8; }
.slot-midday .meds-slot-header    { background: #0891b2; }
.slot-afternoon .meds-slot-header { background: #7c3aed; }
.slot-evening .meds-slot-header   { background: #0d9488; }
.slot-bedtime .meds-slot-header   { background: #1e40af; }
.slot-prebreakfast .meds-slot-header { background: #b45309; }
.slot-default .meds-slot-header   { background: #475569; }

.meds-slot-cards {
  border: 1px solid #d8e4f5;
  border-top: none;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 6px rgba(26,85,192,0.05);
}

/* Med card */
.med-card {
  padding: 14px 16px;
  border-bottom: 1px solid #eef2fb;
  cursor: pointer;
  transition: background 0.12s;
}

.med-card:last-child {
  border-bottom: none;
}

.med-card:active {
  background: #f5f7fb;
}

.med-card-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.med-category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.cat-prescription { background: #1a73e8; }
.cat-supplement   { background: #16a34a; }
.cat-protocol     { background: #ea580c; }
.cat-default      { background: #64748b; }

.med-card-body {
  flex: 1;
  min-width: 0;
}

.med-name {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.3;
}

.med-dosage {
  font-size: 16px;
  color: #555;
  margin-top: 2px;
}

.med-purpose {
  font-size: 15px;
  color: #777;
  margin-top: 2px;
}

.med-timing {
  font-size: 14px;
  color: #999;
  margin-top: 3px;
  font-style: italic;
}

.med-expand-icon {
  font-size: 18px;
  color: #666;
  flex-shrink: 0;
  margin-top: 4px;
  line-height: 1;
  transition: transform 0.2s;
}

.med-card.expanded .med-expand-icon {
  transform: rotate(180deg);
}

.med-notes {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  background: #f5f7fb;
  border-radius: 8px;
  font-size: 15px;
  color: #555;
  line-height: 1.55;
}

.med-card.expanded .med-notes {
  display: block;
}

/* Category label tag */
.med-cat-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 8px;
  margin-top: 4px;
}

.med-cat-tag.cat-prescription { background: #dbeafe; color: #1e40af; }
.med-cat-tag.cat-supplement   { background: #dcfce7; color: #166534; }
.med-cat-tag.cat-protocol     { background: #ffedd5; color: #9a3412; }
.med-cat-tag.cat-default      { background: #f1f5f9; color: #475569; }

/* Meds error */
.meds-error {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  color: #c0392b;
  border-radius: 10px;
  padding: 16px;
  font-size: 16px;
  text-align: center;
  margin: 20px 0;
}

/* ---- Timeline Tab ---- */
.timeline-content {
  padding: 16px 12px 24px;
}

.timeline-list {
  position: relative;
  padding-left: 36px;
}

/* Vertical connecting line */
.timeline-list::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dce6f9;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
  cursor: pointer;
}

/* Timeline dot */
.timeline-dot {
  position: absolute;
  left: -30px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px currentColor;
  z-index: 1;
}

.dot-completed { color: #22c55e; background: #22c55e; }
.dot-ongoing   { color: #1a73e8; background: #1a73e8; }
.dot-upcoming  { color: #f59e0b; background: #fff; }

.timeline-card {
  background: #fff;
  border: 1px solid #d8e4f5;
  border-radius: 12px;
  padding: 14px 16px;
  transition: background 0.12s;
  box-shadow: 0 1px 4px rgba(26,85,192,0.05);
}

.timeline-card:active {
  background: #f5f7fb;
}

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

.timeline-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.3;
  flex: 1;
}

.timeline-status-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 8px;
}

.status-completed { background: #dcfce7; color: #166534; }
.status-ongoing   { background: #dbeafe; color: #1e40af; }
.status-upcoming  { background: #fef9c3; color: #854d0e; }

.timeline-date {
  font-size: 15px;
  color: #1a73e8;
  font-weight: 600;
  margin-top: 4px;
}

.timeline-meta {
  font-size: 14px;
  color: #555;
  margin-top: 2px;
}

.timeline-expand-icon {
  font-size: 16px;
  color: #666;
  margin-left: 4px;
  transition: transform 0.2s;
}

.timeline-item.expanded .timeline-expand-icon {
  transform: rotate(180deg);
}

.timeline-desc {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef2fb;
  font-size: 15px;
  color: #555;
  line-height: 1.55;
}

.timeline-item.expanded .timeline-desc {
  display: block;
}

/* "YOU ARE HERE" marker */
.timeline-here-marker {
  position: relative;
  margin: 8px 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 6px;
}

.here-line {
  flex: 1;
  height: 2px;
  background: #1a73e8;
}

.here-label {
  font-size: 13px;
  font-weight: 700;
  color: #1a73e8;
  background: #e8f0fe;
  padding: 4px 12px;
  border-radius: 12px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  border: 1px solid #c5d5f5;
}

/* Timeline error */
.timeline-error {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  color: #c0392b;
  border-radius: 10px;
  padding: 16px;
  font-size: 16px;
  text-align: center;
  margin: 20px 0;
}

/* ---- Loading ---- */
.loading-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: #555;
  font-size: 17px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #dce6f9;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ---- Utility ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Scrollbar styling (WebKit) ---- */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #c5d5f5;
  border-radius: 4px;
}

/* ---- Desktop breakpoint ---- */
@media (min-width: 600px) {
  .pin-container {
    max-width: 380px;
  }

  .key-btn {
    height: 80px;
    font-size: 30px;
  }

  .app {
    max-width: 480px;
    margin: 0 auto;
    height: 100dvh;
    box-shadow: 0 0 40px rgba(0,0,0,0.12);
  }

  body {
    background: #d4def4;
  }
}

/* ===== WORKOUT TAB ===== */
.workout-subtabs { display: flex; border-bottom: 2px solid #e5e7eb; margin-bottom: 12px; }
.subtab-btn { flex: 1; padding: 10px 4px; font-size: 14px; font-weight: 600; background: none; border: none; border-bottom: 3px solid transparent; cursor: pointer; color: #666; transition: color 0.15s, border-color 0.15s; }
.subtab-btn.active { color: #1a73e8; border-bottom-color: #1a73e8; }
.subtab-pane { padding: 0 0 80px; }

/* Stats bar */
.workout-stats { display: flex; gap: 8px; margin-bottom: 14px; padding: 0 2px; }
.stat-card { flex: 1; background: white; border-radius: 10px; padding: 10px 8px; text-align: center; border: 1px solid #e5e7eb; }
.stat-card .stat-num { font-size: 22px; font-weight: 700; color: #1a73e8; }
.stat-card .stat-label { font-size: 12px; color: #555; margin-top: 2px; }

/* Plan cards */
.plan-card { background: white; border-radius: 12px; margin-bottom: 10px; border: 1px solid #d8e4f5; overflow: hidden; box-shadow: 0 1px 4px rgba(26,85,192,0.06); }
.plan-card-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; }
.plan-card-title { font-size: 16px; font-weight: 700; color: #1a2340; }
.plan-card-focus { font-size: 13px; color: #666; margin-top: 2px; }
.plan-expand-icon { color: #1a73e8; font-size: 18px; transition: transform 0.2s; }
.plan-card.expanded .plan-expand-icon { transform: rotate(180deg); }
.plan-card-body { display: none; padding: 0 16px 12px; border-top: 1px solid #f3f4f6; }
.plan-card.expanded .plan-card-body { display: block; }

/* Exercise rows */
.exercise-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.exercise-row:last-child { border-bottom: none; }
.exercise-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.exercise-cat-dot.cat-resistance { background: #1a73e8; }
.exercise-cat-dot.cat-cardio { background: #22c55e; }
.exercise-cat-dot.cat-balance { background: #a855f7; }
.exercise-cat-dot.cat-stretch { background: #94a3b8; }
.exercise-info { flex: 1; }
.exercise-name { font-size: 15px; font-weight: 600; color: #1a2340; }
.exercise-detail { font-size: 13px; color: #555; margin-top: 2px; }
.exercise-notes { font-size: 12px; color: #555; margin-top: 2px; font-style: italic; }
.plan-log-btn { display: block; width: 100%; margin-top: 12px; padding: 10px; background: #1a73e8; color: white; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.plan-log-btn:hover { background: #1558b0; }

/* Log form */
.log-form { background: white; border-radius: 12px; padding: 16px; border: 1px solid #e5e7eb; }
.log-form label { display: block; font-size: 15px; font-weight: 600; color: #333; margin-bottom: 4px; margin-top: 14px; }
.log-form label:first-child { margin-top: 0; }
.log-form select, .log-form input[type="date"], .log-form input[type="number"], .log-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 16px; box-sizing: border-box; }
.log-form textarea { resize: vertical; min-height: 70px; }
.fatigue-row { display: flex; align-items: center; gap: 10px; }
.fatigue-row input[type="range"] { flex: 1; }
.fatigue-val { font-size: 18px; font-weight: 700; color: #1a73e8; min-width: 24px; text-align: center; }
.log-submit-btn { width: 100%; margin-top: 18px; padding: 14px; background: #1a73e8; color: white; border: none; border-radius: 10px; font-size: 17px; font-weight: 700; cursor: pointer; }
.log-submit-btn:hover { background: #1558b0; }
.log-success { background: #dcfce7; border: 1px solid #86efac; border-radius: 10px; padding: 14px; text-align: center; color: #166534; font-weight: 600; margin-top: 12px; }

/* History cards */
.history-card { background: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; border: 1px solid #d8e4f5; position: relative; box-shadow: 0 1px 4px rgba(26,85,192,0.06); }
.history-card-date { font-size: 14px; color: #555; }
.history-card-name { font-size: 16px; font-weight: 700; color: #1a2340; margin: 4px 0; }
.history-card-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.history-meta-item { font-size: 13px; color: #555; }
.fatigue-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #f0f4ff; color: #1a73e8; }
.history-notes { font-size: 13px; color: #666; margin-top: 8px; font-style: italic; }
.history-delete-btn { position: absolute; top: 12px; right: 12px; background: none; border: none; color: #dc2626; font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.history-delete-btn:hover { background: #fee2e2; }
.workout-empty { text-align: center; color: #555; padding: 40px 20px; font-size: 15px; }

/* Workout subtab content padding */
#workout-plan-content,
#workout-log-content,
#workout-history-content { padding: 0 12px 80px; }

/* ===== DAILY TAB — Faith & Health News ===== */
.daily-subtabs {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 0;
  flex-shrink: 0;
}

.daily-sub-btn {
  flex: 1;
  padding: 12px 4px;
  font-size: 15px;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  color: #666;
  transition: color 0.15s, border-color 0.15s;
}

.daily-sub-btn.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

.daily-pane {
  overflow-y: auto;
  flex: 1;
}

.daily-content {
  padding: 16px 12px 100px;
}

/* Section headers */
.daily-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 10px;
}

.daily-section-header:first-child {
  margin-top: 4px;
}

.daily-section-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.daily-icon {
  font-size: 18px;
  color: #1a73e8;
}

/* Cards */
.daily-card {
  background: white;
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 6px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* Scripture */
.scripture-card {
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
  border-color: #c7d7f5;
}

.scripture-ref {
  font-size: 13px;
  font-weight: 700;
  color: #1a73e8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}

blockquote.scripture-text {
  margin: 0;
  padding: 0;
  font-size: 17px;
  line-height: 1.65;
  color: #1a2340;
  font-style: italic;
}

/* Saint */
.saint-card {
  background: linear-gradient(135deg, #fdf4ff 0%, #ffffff 100%);
  border-color: #e9d5f5;
}

.saint-name {
  font-size: 17px;
  font-weight: 700;
  color: #7c3aed;
  margin: 0 0 2px;
}

.saint-title {
  font-size: 13px;
  color: #555;
  margin: 0 0 10px;
}

.saint-reflection {
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
  margin: 0;
}

/* Prayer */
.prayer-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border-color: #bbf7d0;
}

.prayer-title {
  font-size: 14px;
  font-weight: 700;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}

.prayer-text {
  font-size: 15px;
  line-height: 1.7;
  color: #1a2340;
  margin: 0;
}

/* News */
.news-card {
  margin-bottom: 10px;
}

.news-source {
  font-size: 12px;
  color: #1a73e8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}

.news-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a2340;
  line-height: 1.4;
  margin: 0 0 6px;
}

.news-desc {
  font-size: 14px;
  line-height: 1.55;
  color: #555;
  margin: 0 0 8px;
}

.news-link {
  font-size: 14px;
  font-weight: 600;
  color: #1a73e8;
  text-decoration: none;
}

.news-link:hover {
  text-decoration: underline;
}

/* States */
.daily-loading {
  text-align: center;
  color: #555;
  padding: 40px 20px;
  font-size: 15px;
}

.daily-empty {
  text-align: center;
  color: #555;
  padding: 30px 20px;
  font-size: 15px;
}

.daily-error {
  text-align: center;
  color: #dc2626;
  padding: 30px 20px;
  font-size: 15px;
}

/* 5-tab nav — tighten labels slightly */
.bottom-nav {
  grid-template-columns: repeat(5, 1fr);
}

.nav-btn span {
  font-size: 12px;
  font-weight: 600;
}

/* ===== GREETING CARD ===== */
.greeting-card {
  background: linear-gradient(135deg, #1a73e8 0%, #1558b0 100%);
  border-radius: 16px;
  padding: 18px 16px 14px;
  margin: 0 0 4px;
  color: #fff;
}

.greeting-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.greeting-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.greeting-salutation {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.greeting-day {
  font-size: 13px;
  opacity: 0.8;
  font-weight: 500;
  margin-top: 2px;
}

/* Day-of-week workout strip */
.greeting-day-strip {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
  padding-top: 2px;
}

.day-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0;
}

.day-dot.done {
  background: rgba(255,255,255,0.9);
  color: #1a73e8;
}

.day-dot.today {
  background: rgba(255,255,255,0.35);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.7);
}

.day-dot.done.today {
  background: #fff;
  color: #1a73e8;
  box-shadow: 0 0 0 2px #fff;
}

/* Milestone banner */
.greeting-milestone {
  background: rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  text-align: center;
  letter-spacing: 0.1px;
}

/* Row items */
.greeting-row {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 6px;
  padding: 0 2px;
}

.greeting-event {
  color: rgba(255,255,255,0.85);
}

.greeting-event-soon {
  color: #fde68a;
  font-weight: 600;
}

.workout-nudge {
  color: rgba(255,255,255,0.75);
}

.workout-win {
  color: #86efac;
  font-weight: 600;
}

/* Scripture snippet */
.greeting-scripture {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 10px;
  margin-top: 6px;
}

.greeting-scripture-ref {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.greeting-scripture-text {
  font-size: 14px;
  font-style: italic;
  line-height: 1.5;
  opacity: 0.92;
}

/* ===== QUICK ACTION CHIPS ===== */
.quick-chips {
  display: flex;
  gap: 8px;
  padding: 8px 12px 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
}

.quick-chips::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  flex-shrink: 0;
  padding: 9px 16px;
  border-radius: 24px;
  border: 2px solid #c5d5f5;
  background: #fff;
  color: #1a73e8;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.chip-btn:active {
  background: #e8f0fe;
  border-color: #1a73e8;
}

/* ===== COACH NOTES (workout progression) ===== */
.coach-note-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

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

.coach-note-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b45309;
}

.coach-note-dismiss {
  background: none;
  border: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.coach-note-dismiss:hover {
  color: #555;
}

.coach-note-text {
  font-size: 15px;
  line-height: 1.55;
  color: #374151;
}

.coach-note-meta {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
}

/* Weekly streak strip (workout tab) */
.workout-week-strip {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #e5e7eb;
}

.workout-week-label {
  font-size: 13px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.workout-week-dots {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.week-day-dot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.week-day-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  border: 2px solid #e5e7eb;
}

.week-day-circle.done {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
}

.week-day-circle.today {
  border-color: #1a73e8;
  color: #1a73e8;
}

.week-day-circle.done.today {
  background: #1a73e8;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.25);
}

.week-day-name {
  font-size: 11px;
  color: #666;
  font-weight: 600;
}

.week-day-name.today {
  color: #1a73e8;
}

.workout-week-goal {
  font-size: 13px;
  color: #555;
  margin-top: 10px;
  text-align: center;
}

.coach-notes-wrapper {
  margin-bottom: 4px;
}

/* ============================================================
   v2.0 Additions
   ============================================================ */

/* ---- Font size bump for readability (Tom is 68) ---- */
body {
  font-size: 19px;
}

/* ---- Medication Check-off ---- */

.meds-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 6px;
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.meds-progress-track {
  flex: 1;
  height: 10px;
  background: #e8eaf0;
  border-radius: 6px;
  overflow: hidden;
}

.meds-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #34a853, #1a73e8);
  border-radius: 6px;
  transition: width 0.4s ease;
}

.meds-progress-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  min-width: 110px;
  text-align: right;
}

.meds-celebration {
  display: none;
  background: linear-gradient(135deg, #34a853, #1a8c4e);
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 16px;
  animation: celebrationSlide 0.4s ease;
}

.meds-celebration.show {
  display: block;
}

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

/* Med card check-off state */
.med-card {
  transition: opacity 0.2s;
}

.med-card.med-taken {
  opacity: 0.6;
}

.med-card.med-taken .med-name {
  text-decoration: line-through;
  color: #555;
}

/* Check circle button */
.med-check-circle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: 2.5px solid #ccd0e0;
  background: transparent;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.med-check-circle:active {
  transform: scale(0.9);
}

.med-taken .med-check-circle {
  background: #34a853;
  border-color: #34a853;
  color: #fff;
}

/* Slot complete header */
.meds-slot-header.slot-complete {
  background: linear-gradient(90deg, #e8f5e9, #f0faf0);
}

.meds-slot-header.slot-complete h2 {
  color: #2d7a3e;
}

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

.slot-done-badge {
  font-size: 12px;
  font-weight: 700;
  color: #34a853;
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Empty state */
.meds-empty {
  padding: 48px 24px;
  text-align: center;
  color: #555;
  line-height: 1.8;
}

/* ---- CSS Entrance Animations ---- */

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

@keyframes fadeSlideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

/* Greeting card entrance */
.greeting-card {
  animation: fadeSlideUp 0.35s ease both;
}

/* Chat bubbles */
.message.user {
  animation: fadeSlideInRight 0.25s ease both;
}

.message.assistant {
  animation: fadeSlideInLeft 0.25s ease both;
}

/* Daily cards stagger */
.daily-card:nth-child(1) { animation: fadeSlideUp 0.25s ease 0.05s both; }
.daily-card:nth-child(2) { animation: fadeSlideUp 0.25s ease 0.12s both; }
.daily-card:nth-child(3) { animation: fadeSlideUp 0.25s ease 0.19s both; }
.daily-card:nth-child(4) { animation: fadeSlideUp 0.25s ease 0.26s both; }
.daily-card:nth-child(5) { animation: fadeSlideUp 0.25s ease 0.33s both; }

/* Meds slot entrance */
.meds-slot:nth-child(1) { animation: fadeSlideUp 0.25s ease 0.05s both; }
.meds-slot:nth-child(2) { animation: fadeSlideUp 0.25s ease 0.1s both; }
.meds-slot:nth-child(3) { animation: fadeSlideUp 0.25s ease 0.15s both; }
.meds-slot:nth-child(4) { animation: fadeSlideUp 0.25s ease 0.2s both; }
.meds-slot:nth-child(5) { animation: fadeSlideUp 0.25s ease 0.25s both; }
.meds-slot:nth-child(6) { animation: fadeSlideUp 0.25s ease 0.3s both; }

/* ---- Treatment Progress Bar (Orgovyx day counter) ---- */

.treatment-progress-wrap {
  padding: 0 16px 10px;
  margin-top: -4px;
}

.treatment-progress-track {
  height: 6px;
  background: #e8eaf0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.treatment-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a73e8, #4285f4);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.treatment-progress-label {
  font-size: 12px;
  color: #555;
  text-align: right;
}

/* ---- Mood Check-in ---- */

.mood-checkin {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 2px;
  flex-wrap: wrap;
}

.mood-checkin-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.mood-btns {
  display: flex;
  gap: 8px;
}

.mood-btn {
  font-size: 26px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

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

.mood-btn.selected-good   { border-color: #34a853; background: #e8f5e9; }
.mood-btn.selected-okay   { border-color: #fbbc04; background: #fef9e7; }
.mood-btn.selected-rough  { border-color: #ea4335; background: #fce8e6; }

.mood-saved-msg {
  font-size: 13px;
  color: #34a853;
  font-weight: 600;
}

/* ---- iPhone safe-area-inset for chat input ---- */

.chat-input-bar {
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* ---- Better empty states ---- */

.timeline-empty,
.workout-empty,
.daily-empty {
  padding: 48px 24px;
  text-align: center;
  color: #555;
  line-height: 1.8;
}

.timeline-empty p,
.workout-empty p,
.daily-empty p {
  margin-bottom: 8px;
}

/* ---- Exercise demo button ---- */

.exercise-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exercise-demo-btn {
  font-size: 12px;
  font-weight: 600;
  color: #1a73e8;
  text-decoration: none;
  background: #e8f0fe;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  transition: background 0.15s;
}

.exercise-demo-btn:hover,
.exercise-demo-btn:active {
  background: #d2e3fc;
}

/* ============================================================
   v2.1 Additions
   ============================================================ */

/* ---- Logout button ---- */
.logout-btn {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 8px;
  color: #fff;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.logout-btn:active {
  background: rgba(255,255,255,0.28);
}

/* Header inner needs space-between when logout is present */
.app-header {
  justify-content: space-between;
}

/* ---- Session-expired PIN message ---- */
.pin-expired {
  font-size: 15px;
  color: #1a73e8;
  font-weight: 500;
  background: #e8f0fe;
  border: 1px solid #c5d5f5;
  border-radius: 8px;
  padding: 8px 16px;
  text-align: center;
  width: 100%;
}

/* ---- Word-break on chat bubbles (long medical terms) ---- */
.msg-bubble {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ---- Copy button on Walt messages ---- */
.msg-copy-btn {
  background: none;
  border: none;
  color: #556680;
  font-size: 13px;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 6px;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.msg-copy-btn:hover {
  color: #1a73e8;
  background: #f0f4ff;
}

.msg-copy-btn.copied {
  color: #34a853;
}

/* ---- Med taken-at timestamp ---- */
.med-taken-at {
  font-size: 12px;
  color: #34a853;
  font-weight: 600;
  margin-top: 3px;
}

/* ---- Chat History Panel ---- */
.history-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #eef1f8;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-panel.open {
  transform: translateX(0);
}

.history-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1a73e8 0%, #1255c0 100%);
  color: #fff;
  padding: 0 16px;
  height: 60px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(26,85,192,0.18);
}

.history-panel-back {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px 4px 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.history-panel-title {
  font-size: 18px;
  font-weight: 700;
}

.history-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.history-item {
  background: #fff;
  border: 1px solid #d8e4f5;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(26,85,192,0.05);
}

.history-item-q {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 6px;
  line-height: 1.4;
}

.history-item-a {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-item-meta {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
}

.history-empty {
  text-align: center;
  color: #555;
  padding: 48px 24px;
  font-size: 16px;
}

/* History trigger button in chat */
.chat-history-btn {
  font-size: 13px;
  color: #1a73e8;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  align-self: flex-end;
  margin-bottom: 2px;
}

.chat-history-btn:active {
  background: #e8f0fe;
}

/* ---- Mood history dots in greeting ---- */
.mood-history-strip {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 0 0;
}

.mood-hist-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.mood-hist-dot.good  { background: #34a853; }
.mood-hist-dot.okay  { background: #fbbc04; }
.mood-hist-dot.rough { background: #ea4335; }

.mood-history-label {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin-right: 2px;
}

/* ============================================================
   Journal Tab
   ============================================================ */

.journal-compose {
  padding: 14px 14px 0;
  border-bottom: 1px solid #dce6f9;
  background: #fff;
}

.journal-tag-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.journal-tag-label {
  font-size: 13px;
  color: #555;
  font-weight: 500;
  flex-shrink: 0;
}

.journal-tag-btn {
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid #c5d5f5;
  background: #f5f8ff;
  color: #4a70c4;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.journal-tag-btn.active {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #fff;
}

.journal-input {
  width: 100%;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.55;
  color: #1a1a2e;
  background: #f5f7fb;
  border: 2px solid #c5d5f5;
  border-radius: 12px;
  padding: 10px 14px;
  resize: none;
  outline: none;
  max-height: 160px;
  overflow-y: auto;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.journal-input:focus {
  border-color: #1a73e8;
  background: #fff;
}

.journal-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px 12px;
}

.journal-char-count {
  font-size: 12px;
  color: #666;
}

.journal-save-btn {
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 22px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.journal-save-btn:active {
  background: #1255c0;
}

.journal-save-btn:disabled {
  background: #b0c4e8;
  cursor: default;
}

/* ---- Journal list ---- */

.journal-list {
  padding: 12px 12px 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.journal-card {
  background: #fff;
  border: 1px solid #d8e4f5;
  border-radius: 14px;
  padding: 12px 14px 10px;
  box-shadow: 0 1px 4px rgba(26,85,192,0.06);
  position: relative;
}

.journal-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.journal-entry-date {
  font-size: 13px;
  color: #555;
  font-weight: 500;
}

.journal-entry-tag {
  font-size: 12px;
  font-weight: 700;
  color: #1a73e8;
  background: #e8f0fe;
  border-radius: 10px;
  padding: 2px 8px;
}

.journal-delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #c5c5c5;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}

.journal-delete-btn:hover {
  color: #e74c3c;
}

.journal-card-preview,
.journal-card-body {
  font-size: 16px;
  color: #333;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.journal-expand-btn {
  background: none;
  border: none;
  color: #1a73e8;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0 0;
  -webkit-tap-highlight-color: transparent;
}

.journal-empty {
  text-align: center;
  color: #666;
  padding: 40px 24px;
  font-size: 16px;
}

.journal-load-more {
  display: block;
  width: 100%;
  background: #f5f8ff;
  border: 1.5px solid #c5d5f5;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #1a73e8;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}

/* ============================================================
   Workout Banners (ADT + Rest Day)
   ============================================================ */

.adt-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 12px 4px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  background: #f5f7fb;
  border: 1px solid #d0daf0;
  color: #444;
}

.adt-banner.adt-green { background: #edfaf3; border-color: #a8e6c6; color: #1b6b3a; }
.adt-banner.adt-amber { background: #fffbea; border-color: #f5d97a; color: #7a5700; }
.adt-banner-icon { font-size: 16px; flex-shrink: 0; }

.rest-day-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 12px 4px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  background: #f0f8ff;
  border: 1px solid #b0d4f5;
  color: #1a4a7a;
}

.rest-day-icon { font-size: 16px; flex-shrink: 0; }

/* ============================================================
   Faith Tab Enhancements
   ============================================================ */

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

.scripture-bookmark-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  color: #666;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}

.scripture-bookmark-btn:hover { color: #1a73e8; background: #e8f0fe; }
.scripture-bookmark-btn:disabled { color: #34a853; }

.scripture-reflection {
  margin-top: 12px;
  font-size: 15px;
  color: #555;
  font-style: italic;
  line-height: 1.5;
  border-top: 1px solid #eef1f8;
  padding-top: 10px;
}

.scripture-saved-msg {
  font-size: 13px;
  color: #34a853;
  font-weight: 600;
  margin-top: 6px;
}

/* Prayer intentions */
.prayer-intentions-card { padding: 14px 16px; }

.prayer-intention-compose {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.prayer-intention-input {
  flex: 1;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a2e;
  background: #f5f7fb;
  border: 2px solid #c5d5f5;
  border-radius: 10px;
  padding: 8px 12px;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
}

.prayer-intention-input:focus { border-color: #1a73e8; background: #fff; }

.prayer-intention-save {
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.prayer-intention-save:disabled { background: #b0c4e8; cursor: default; }

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

.prayer-intention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f9fbff;
  border: 1px solid #dce6f9;
  border-radius: 10px;
}

.prayer-intention-text {
  flex: 1;
  font-size: 15px;
  color: #333;
  line-height: 1.5;
}

.prayer-intention-done {
  background: none;
  border: 1.5px solid #34a853;
  color: #34a853;
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.prayer-intention-done:hover { background: #34a853; color: #fff; }

.prayer-intentions-empty,
.prayer-intentions-loading {
  font-size: 14px;
  color: #666;
  text-align: center;
  padding: 8px 0;
}

/* ============================================================
   Pelvic floor strip (Chat greeting card)
   ============================================================ */

.pelvic-floor-host {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.22);
}

.pf-strip-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pf-label {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

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

.pf-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: 1.5px solid rgba(255,255,255,0.55);
}

.pf-dot-filled {
  background: #34a853;
  border-color: #34a853;
  box-shadow: 0 0 0 2px rgba(52,168,83,0.3);
}

.pf-count {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}

.pf-streak {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: #ffd54f;
}

.pf-tip {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  margin-top: 6px;
  line-height: 1.45;
  font-style: italic;
}

.pf-add-btn {
  margin-top: 8px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.pf-add-btn:active { background: rgba(255,255,255,0.3); }
.pf-add-btn:disabled { opacity: 0.6; cursor: default; }

.pf-done {
  margin-top: 8px;
  font-size: 13px;
  color: #a6efc3;
  font-weight: 600;
}

/* ============================================================
   Vitals subtab — BP + Oura
   ============================================================ */

.vitals-section {
  background: #fff;
  border: 1px solid #d8e4f5;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.vitals-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 4px;
}

.vitals-sub {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

/* BP input */
.bp-compose {
  background: #f5f8ff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.bp-inputs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.bp-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bp-input-group label {
  font-size: 12px;
  color: #666;
  font-weight: 600;
  margin-bottom: 4px;
}

.bp-input-group input {
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  background: #fff;
  border: 2px solid #c5d5f5;
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.bp-input-group input:focus {
  border-color: #1a73e8;
}

.bp-sep {
  font-size: 28px;
  color: #666;
  font-weight: 700;
  padding-bottom: 6px;
}

.bp-save-btn {
  width: 100%;
  padding: 10px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bp-save-btn:active { background: #1255c0; }
.bp-save-btn:disabled { background: #b0c4e8; cursor: default; }

.bp-trend-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #eef1f8;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 14px;
}

.bp-trend-label { color: #666; }
.bp-trend-box strong { font-size: 18px; color: #1a1a2e; }
.bp-trend-count { color: #555; font-size: 12px; }

.bp-list { display: flex; flex-direction: column; gap: 6px; }

.bp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  position: relative;
  border-left: 4px solid transparent;
}

.bp-row-when { color: #555; flex-shrink: 0; min-width: 110px; }
.bp-row-val strong { font-size: 15px; color: #1a1a2e; }
.bp-row-pulse { color: #666; font-size: 12px; }
.bp-row-cls { margin-left: auto; font-size: 12px; font-weight: 600; }

.bp-row.bp-normal { background: #f0fdf4; border-color: #22c55e; }
.bp-row.bp-normal .bp-row-cls { color: #15803d; }
.bp-row.bp-elevated { background: #fef9c3; border-color: #eab308; }
.bp-row.bp-elevated .bp-row-cls { color: #a16207; }
.bp-row.bp-stage1 { background: #ffedd5; border-color: #f97316; }
.bp-row.bp-stage1 .bp-row-cls { color: #c2410c; }
.bp-row.bp-stage2 { background: #fee2e2; border-color: #ef4444; }
.bp-row.bp-stage2 .bp-row-cls { color: #b91c1c; }
.bp-row.bp-crisis { background: #fecaca; border-color: #991b1b; }
.bp-row.bp-crisis .bp-row-cls { color: #7f1d1d; font-weight: 700; }

.bp-row-del {
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.bp-row-del:hover { color: #e74c3c; }
.bp-empty { color: #555; font-size: 14px; text-align: center; padding: 12px 0; }

/* Oura */
.oura-host { font-size: 14px; }

.oura-disconnect p { margin: 0 0 8px; }
.oura-help { color: #666; font-size: 13px; }
.oura-help a { color: #1a73e8; }

.oura-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.oura-form input {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  background: #f5f8ff;
  border: 2px solid #c5d5f5;
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

.oura-form input:focus { border-color: #1a73e8; background: #fff; }

.oura-form button {
  padding: 10px 18px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.oura-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.oura-status-label {
  color: #15803d;
  font-weight: 700;
  flex: 1;
}

.oura-status-row button {
  padding: 6px 14px;
  background: #eef1f8;
  color: #1a73e8;
  border: 1px solid #c5d5f5;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.oura-disconnect-btn { color: #b91c1c !important; border-color: #fecaca !important; }

.oura-latest {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.oura-metric {
  background: #f5f8ff;
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
}

.oura-val {
  font-size: 22px;
  font-weight: 700;
  color: #1a73e8;
}

.oura-lbl {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.oura-hint {
  font-size: 12px;
  color: #666;
  font-style: italic;
  margin: 0;
}

/* ============================================================
   Catholic Liturgy (Daily tab + greeting pill)
   ============================================================ */

.liturgy-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.liturgy-season {
  font-size: 16px;
  font-weight: 700;
}

.liturgy-color {
  font-size: 12px;
  padding: 3px 8px;
  background: rgba(255,255,255,0.22);
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.liturgy-note {
  font-size: 13px;
  margin-left: auto;
  font-weight: 500;
  opacity: 0.95;
}

/* Compact pill in chat greeting card */
.greeting-liturgy-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  margin: 6px 0 4px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
  align-self: flex-start;
}

/* Rosary */
.rosary-card {
  padding: 14px 16px;
}

.rosary-theme {
  font-size: 13px;
  color: #666;
  font-style: italic;
  margin-bottom: 10px;
}

.rosary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: rosary;
}

.rosary-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a2e;
}

.rosary-list li:last-child { border-bottom: none; }

.rosary-num {
  color: #1a73e8;
  font-weight: 700;
  margin-right: 4px;
  min-width: 20px;
  display: inline-block;
}

.rosary-ref {
  display: block;
  font-size: 12px;
  color: #555;
  margin-top: 2px;
  margin-left: 20px;
  font-style: italic;
}

/* Calendar saint */
.calendar-saint-card { padding: 14px 16px; }

.calendar-saint-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.calendar-saint-name {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

.saint-rank {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.saint-rank-solemnity { background: #fff8dc; color: #8b7500; border: 1px solid #e6d475; }
.saint-rank-feast { background: #fdecea; color: #8b1a1a; border: 1px solid #eaa5a5; }
.saint-rank-memorial { background: #e8f0fe; color: #1a4a7a; border: 1px solid #a8c4e8; }
.saint-rank-optional-memorial { background: #f5f7fb; color: #555; border: 1px solid #ccd4e0; }
.saint-rank-commemoration { background: #f5f7fb; color: #555; border: 1px solid #ccd4e0; }

.calendar-saint-blurb {
  font-size: 14px;
  color: #444;
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   Passkey / WebAuthn UI
   ============================================================ */

.passkey-unlock-btn {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: #fff;
  border: 2px solid #1a73e8;
  color: #1a73e8;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}

.passkey-unlock-btn:active {
  background: #e8f0fe;
}

.passkey-unlock-btn svg {
  flex-shrink: 0;
}

.passkey-status {
  margin-top: 10px;
  font-size: 14px;
  color: #1a73e8;
  font-weight: 500;
}

.passkey-banner {
  background: linear-gradient(135deg, #e8f0fe 0%, #dbe8fb 100%);
  border-bottom: 1px solid #c5d5f5;
  padding: 10px 12px;
  flex-shrink: 0;
}

.passkey-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
}

.passkey-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.passkey-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.passkey-banner-text strong {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
}

.passkey-banner-text span {
  font-size: 12px;
  color: #555;
}

.passkey-banner-btn {
  background: #1a73e8;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.passkey-banner-btn:active {
  background: #1255c0;
}

.passkey-banner-btn:disabled {
  background: #b0c4e8;
  cursor: default;
}

.passkey-banner-dismiss {
  background: none;
  border: none;
  color: #555;
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.passkey-banner-dismiss:hover {
  color: #333;
}

.passkey-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #fff;
  padding: 12px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 1000;
  animation: passkey-toast-in 0.3s ease-out;
}

@keyframes passkey-toast-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
   Daily Symptom Check-in Card
   Lives inside the Chat greeting card. Mobile-first, big touch targets.
   ============================================================ */

.checkin-card-host {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.22);
}

.checkin-loading, .checkin-error {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  padding: 6px 0;
}

/* ---- Collapsed state (already logged today) ---- */
.checkin-collapsed {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
}

.checkin-collapsed-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkin-check {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #34a853;
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.checkin-done-label {
  flex: 1;
  font-size: 14px;
  color: rgba(255,255,255,0.95);
  font-weight: 600;
}

.checkin-edit-btn {
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.checkin-edit-btn:active {
  background: rgba(255,255,255,0.28);
}

.checkin-summary {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.78);
  line-height: 1.4;
}

/* ---- Prompt state (not logged yet) ---- */
.checkin-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 14px;
}

.checkin-prompt-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.checkin-prompt-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkin-prompt-text strong {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.checkin-prompt-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

.checkin-start-btn {
  background: #fff;
  color: #1a73e8;
  border: none;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.checkin-start-btn:active {
  background: #eef1f8;
}

/* ---- Expanded form (on white background so sliders read well) ---- */
.checkin-form {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-top: 4px;
  color: #1a1a2e;
}

.checkin-field {
  margin-bottom: 14px;
}

.checkin-field:last-child {
  margin-bottom: 0;
}

.checkin-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.checkin-scale {
  color: #555;
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
}

.checkin-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkin-slider {
  flex: 1;
  height: 38px; /* big touch target */
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.checkin-slider::-webkit-slider-runnable-track {
  height: 8px;
  background: linear-gradient(90deg, #34a853 0%, #fbbc04 50%, #ea4335 100%);
  border-radius: 4px;
}

.checkin-slider::-moz-range-track {
  height: 8px;
  background: linear-gradient(90deg, #34a853 0%, #fbbc04 50%, #ea4335 100%);
  border-radius: 4px;
}

.checkin-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #1a73e8;
  margin-top: -10px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(26,115,232,0.35);
}

.checkin-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #1a73e8;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(26,115,232,0.35);
}

.checkin-val {
  min-width: 28px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #1a73e8;
}

/* Stepper (+/-) for night trips, hot flashes */
.checkin-stepper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.checkin-step-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #c5d5f5;
  background: #f5f8ff;
  color: #1a73e8;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.checkin-step-btn:active {
  background: #e8f0fe;
  transform: scale(0.95);
}

.checkin-stepper-val {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
  min-width: 40px;
  text-align: center;
}

/* Bowel toggle — 3 big buttons */
.checkin-bowel-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.checkin-bowel-btn {
  padding: 12px 4px;
  font-size: 15px;
  font-weight: 600;
  border: 2px solid #c5d5f5;
  background: #f5f8ff;
  color: #4a70c4;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.checkin-bowel-btn.active {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #fff;
}

/* Optional section (collapsible) */
.checkin-optional {
  margin-bottom: 14px;
  border-top: 1px dashed #d8e4f5;
  padding-top: 10px;
}

.checkin-optional summary {
  font-size: 14px;
  font-weight: 600;
  color: #1a73e8;
  cursor: pointer;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
  list-style: none;
}

.checkin-optional summary::-webkit-details-marker { display: none; }

.checkin-optional summary::before {
  content: '+ ';
  font-weight: 700;
}

.checkin-optional[open] summary::before {
  content: '− ';
}

.checkin-optional-hint {
  color: #555;
  font-weight: 400;
  font-size: 12px;
}

.checkin-optional[open] .checkin-field:first-of-type {
  margin-top: 12px;
}

.checkin-note {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a2e;
  background: #f5f7fb;
  border: 2px solid #c5d5f5;
  border-radius: 10px;
  padding: 8px 12px;
  resize: none;
  outline: none;
  box-sizing: border-box;
}

.checkin-note:focus {
  border-color: #1a73e8;
  background: #fff;
}

/* Actions */
.checkin-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.checkin-cancel-btn {
  flex: 0 0 auto;
  padding: 11px 18px;
  background: none;
  border: 2px solid #c5d5f5;
  color: #666;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.checkin-save-btn {
  flex: 1;
  padding: 11px 18px;
  background: #1a73e8;
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.checkin-save-btn:active { background: #1255c0; }
.checkin-save-btn:disabled { background: #b0c4e8; cursor: default; }

/* ============================================================
   v3.0 — Desktop Redesign
   Dark navy / glass — calibrated for 68-year-old retired engineer
   High contrast, readable, professional
   Mobile layout (< 768px) is UNCHANGED
   ============================================================ */

@keyframes glow-drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(50px, 70px) scale(1.08); }
}
@keyframes glow-drift-2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-60px, -50px) scale(1.1); }
}

@media (min-width: 768px) {
  /* ---- Dark navy base ---- */
  html, body {
    background: linear-gradient(135deg, #09152a 0%, #0e2040 55%, #0b1a32 100%);
    background-attachment: fixed;
  }

  /* Ambient glow layer 1 — blue, top center */
  body::before {
    content: '';
    position: fixed;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74,144,212,0.14) 0%, transparent 70%);
    top: -160px;
    left: 50%;
    transform: translateX(-50%);
    /* Animation is opt-in: respect prefers-reduced-motion (post-cataract-surgery + vestibular users). */
    animation: none;
    pointer-events: none;
    z-index: 0;
  }

  /* Ambient glow layer 2 — green, bottom right */
  body::after {
    content: '';
    position: fixed;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(82,196,122,0.09) 0%, transparent 70%);
    bottom: -60px;
    right: 0;
    animation: none;
    pointer-events: none;
    z-index: 0;
  }

  /* ---- PIN screen on dark bg ---- */
  .pin-screen {
    background: transparent;
    z-index: 10;
    position: relative;
  }

  .pin-container {
    max-width: 400px;
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 22px;
    padding: 44px 40px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  }

  .pin-title   { color: #dde6f6; }
  .pin-subtitle { color: rgba(221,230,246,0.65); }

  .pin-display {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.22);
    color: #7ab8ea;
  }

  .pin-error {
    background: rgba(192,57,43,0.18);
    border-color: rgba(220,100,80,0.4);
    color: #f4a09a;
  }

  .pin-expired {
    background: rgba(26,115,232,0.18);
    border-color: rgba(100,160,232,0.35);
    color: #90bef5;
  }

  /* ---- Left sidebar — replaces bottom nav on desktop ---- */
  .bottom-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 72px;
    height: 100vh;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    /* override any grid */
    grid-template-columns: unset !important;
    background: linear-gradient(180deg,
      rgba(18,26,48,0.97) 0%,
      rgba(10,18,36,0.99) 100%
    );
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid rgba(255,255,255,0.07);
    border-top: none;
    box-shadow: 4px 0 28px rgba(0,0,0,0.35);
    z-index: 50;
    padding: 20px 0;
  }

  .nav-btn {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    padding: 0;
    min-height: unset;
    flex-direction: column;
    gap: 4px;
    color: rgba(255,255,255,0.38);
    font-size: 10px;
    position: relative;
    transition: color 0.18s, background 0.18s;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-btn span {
    font-size: 10px;
    font-weight: 500;
  }

  .nav-btn:hover {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.06);
  }

  .nav-btn:active {
    background: rgba(74,144,212,0.15);
  }

  .nav-btn.active {
    color: #7ab8ea;
    background: rgba(74,144,212,0.18);
  }

  /* Left accent bar on active nav item */
  .nav-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    background: #4a90d4;
    border-radius: 0 3px 3px 0;
  }

  /* ---- App container ---- */
  .app {
    margin-left: 72px;
    max-width: 820px;
    height: 100vh;
    background: #f0f4fc;
    box-shadow: 0 0 60px rgba(0,0,0,0.5), inset -1px 0 0 rgba(255,255,255,0.06);
    position: relative;
    z-index: 1;
  }

  /* ---- Header — deeper blue on dark bg ---- */
  .app-header {
    background: linear-gradient(135deg, #1462b8 0%, #0e3f8a 100%);
    box-shadow: 0 2px 18px rgba(0,0,0,0.32);
  }

  /* ---- Greeting card — slightly richer ---- */
  .greeting-card {
    background: linear-gradient(135deg, #1462b8 0%, #1044a0 100%);
    border: 1px solid rgba(255,255,255,0.12);
  }

  /* ---- Cards — light glass on desktop ---- */
  .med-card,
  .plan-card,
  .stat-card,
  .timeline-card,
  .history-item {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(210,225,248,0.9);
  }

  /* ---- Quick chips — wrap so none are cut off ---- */
  .quick-chips {
    flex-wrap: wrap;
    padding-bottom: 4px;
  }

  /* ---- History panel scoped to app ---- */
  .history-panel {
    position: absolute;
    inset: 0;
  }

  /* ---- Logout button stronger contrast on dark glass ---- */
  .logout-btn {
    background: rgba(255,255,255,0.14);
  }

  .logout-btn:hover {
    background: rgba(255,255,255,0.24);
  }

  /* ---- Journal — desktop layout ---- */
  .journal-compose {
    padding: 18px 20px 0;
  }

  .journal-list {
    padding: 14px 20px 80px;
  }

  .journal-input {
    font-size: 18px;
  }

  .journal-card {
    padding: 14px 18px 12px;
  }

  /* ---- Workout banners — desktop spacing ---- */
  .adt-banner,
  .rest-day-banner {
    margin-left: 0;
    margin-right: 0;
    font-size: 16px;
  }

  /* ---- Faith tab — desktop ---- */
  .prayer-intentions-card {
    padding: 16px 20px;
  }
}

/* ============================================================
   Motion preferences — opt-in to the ambient glow animation
   Users with prefers-reduced-motion (post-cataract-surgery,
   vestibular, motion-sensitive) get static glow, no drift.
   ============================================================ */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  body::before { animation: glow-drift-1 20s ease-in-out infinite alternate; }
  body::after  { animation: glow-drift-2 25s ease-in-out infinite alternate; }
}
