/* ═══════════════════════════════════════════════════════
   Dottie PWA — Mobile-first Patient App Shell
   Palette: Teal (#1a5f6a, #2d8f9c) + Warm Cream (#fef7f3)
            + Gold/Coral (#d4956f) + Off-white (#f9f4f0)
   ═══════════════════════════════════════════════════════ */

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

:root {
  --teal:        #2d8f9c;
  --deep-teal:   #1a5f6a;
  --navy:        #1a4a55;
  --gold:        #d4956f;
  --coral:       #e07a5f;
  --cream:       #fef7f3;
  --warm-white:  #f9f4f0;
  --warm-gray:   #e8e0d9;
  --mid-gray:    #9b9088;
  --dark-gray:   #4a4540;
  --white:       #ffffff;

  --font-body:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-head:   'Nunito', 'Inter', sans-serif;

  /* Layout */
  --header-h:    56px;
  --nav-h:       64px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--dark-gray);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* ── App Shell Container ──────────────────────────────── */
#dottie-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* dynamic viewport height — handles mobile browser chrome */
  max-width: 480px;
  margin: 0 auto;
  background: var(--white);
  box-shadow: 0 0 40px rgba(26, 95, 106, 0.08);
  position: relative;
  overflow: hidden;
}

/* ── App Header ───────────────────────────────────────── */
.dottie-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: var(--deep-teal);
  color: var(--white);
  min-height: var(--header-h);
  box-shadow: 0 2px 12px rgba(26, 95, 106, 0.2);
}

.dottie-header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dottie-header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.dottie-header__name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.dottie-header__tagline {
  font-size: 0.65rem;
  opacity: 0.75;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dottie-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dottie-header__btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.dottie-header__btn:active { background: rgba(255,255,255,0.3); }

/* Online/Offline indicator dot */
.dottie-header__status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  border: 1.5px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
}
.dottie-header__status--offline { background: #f87171; }

/* ── Tab Bar ──────────────────────────────────────────── */
.dottie-tabs {
  display: flex;
  align-items: center;
  background: var(--white);
  border-bottom: 1px solid var(--warm-gray);
  padding: 0 4px;
}

.dottie-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--mid-gray);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dottie-tab__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.dottie-tab--active {
  color: var(--deep-teal);
  border-bottom-color: var(--teal);
}

/* ── Main Content Area ────────────────────────────────── */
.dottie-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--warm-white);
  scroll-behavior: smooth;
}

/* Tab panel visibility */
.dottie-panel {
  display: none;
  min-height: 100%;
  padding: 0 0 calc(var(--safe-bottom) + 8px);
}
.dottie-panel--active { display: block; }

/* ── Bottom Nav ───────────────────────────────────────── */
.dottie-nav {
  display: flex;
  align-items: stretch;
  background: var(--white);
  border-top: 1px solid var(--warm-gray);
  padding-bottom: var(--safe-bottom);
  min-height: var(--nav-h);
  box-shadow: 0 -4px 20px rgba(26, 95, 106, 0.06);
}

.dottie-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  cursor: pointer;
  border: none;
  background: transparent;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--mid-gray);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.dottie-nav__icon {
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.15s;
}

.dottie-nav__item--active {
  color: var(--deep-teal);
}
.dottie-nav__item--active .dottie-nav__icon {
  transform: scale(1.1);
}

/* Active indicator pill */
.dottie-nav__item--active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--teal);
  border-radius: 0 0 4px 4px;
}

/* ── Chat Panel ───────────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: calc(100dvh - var(--header-h) - var(--nav-h) - 44px);
}

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

/* Bubble base */
.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.9375rem;
  line-height: 1.5;
  animation: bubbleIn 0.2s ease-out;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dottie's bubble: left-aligned, teal-tinted */
.chat-bubble--dottie {
  align-self: flex-start;
  background: var(--white);
  border: 1.5px solid var(--warm-gray);
  border-bottom-left-radius: 4px;
  color: var(--dark-gray);
  box-shadow: 0 2px 8px rgba(26, 95, 106, 0.06);
}

/* Dottie avatar + name above bubble */
.chat-message--dottie {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  align-self: flex-start;
  max-width: 90%;
}

.chat-message--dottie .chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--deep-teal);
  color: var(--white);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(26, 95, 106, 0.3);
}

/* Patient's bubble: right-aligned, warm teal */
.chat-message--user {
  align-self: flex-end;
  max-width: 85%;
}

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

/* Typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 4px 0;
}
.chat-typing .chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--deep-teal);
  color: var(--white);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.typing-dots {
  background: var(--white);
  border: 1.5px solid var(--warm-gray);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mid-gray);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-5px); opacity: 1; }
}

/* Quick reply chips */
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 4px;
}
.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--teal);
  color: var(--deep-teal);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--white);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.chat-chip:active,
.chat-chip:hover {
  background: var(--deep-teal);
  color: var(--white);
  border-color: var(--deep-teal);
}

/* Chat input bar */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: var(--white);
  border-top: 1px solid var(--warm-gray);
}

.chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--warm-gray);
  background: var(--warm-white);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--dark-gray);
  outline: none;
  resize: none;
  line-height: 1.4;
  overflow-y: auto;
  transition: border-color 0.15s;
}
.chat-input:focus {
  border-color: var(--teal);
  background: var(--white);
}
.chat-input::placeholder { color: var(--mid-gray); }

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--deep-teal);
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.chat-send-btn:active { transform: scale(0.92); background: var(--navy); }
.chat-send-btn:disabled { background: var(--warm-gray); cursor: not-allowed; }

/* ── Upload button (paperclip) ───────────────────────── */
.chat-upload-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--warm-gray);
  background: var(--warm-white);
  color: var(--mid-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.chat-upload-btn:active,
.chat-upload-btn:hover {
  background: var(--warm-gray);
  border-color: var(--teal);
  color: var(--deep-teal);
}

/* ── Upload picker bottom sheet ──────────────────────── */
.upload-picker {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.upload-picker.hidden { display: none; }

.upload-picker__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  animation: fadeIn 0.18s ease;
}

.upload-picker__sheet {
  position: relative;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: slideUp 0.22s ease;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

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

.upload-picker__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--deep-teal);
  text-align: center;
  margin-bottom: 16px;
}

.upload-picker__option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--warm-gray);
  border-radius: 14px;
  background: var(--white);
  cursor: pointer;
  text-align: left;
  margin-bottom: 10px;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.upload-picker__option:active,
.upload-picker__option:hover {
  border-color: var(--teal);
  background: rgba(45, 143, 156, 0.05);
}
.upload-picker__icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1;
}
.upload-picker__label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--dark-gray);
  margin-bottom: 2px;
}
.upload-picker__desc {
  font-size: 0.8125rem;
  color: var(--mid-gray);
  line-height: 1.3;
}

.upload-picker__cancel {
  width: 100%;
  padding: 12px;
  border: none;
  background: var(--warm-white);
  border-radius: 12px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--mid-gray);
  cursor: pointer;
  margin-top: 4px;
  -webkit-tap-highlight-color: transparent;
}
.upload-picker__cancel:active { opacity: 0.7; }

/* ── Home Panel ───────────────────────────────────────── */
.home-greeting {
  padding: 20px 16px 12px;
  background: linear-gradient(135deg, var(--deep-teal) 0%, var(--teal) 100%);
  color: var(--white);
}

.home-greeting__wave {
  font-size: 1.75rem;
  margin-bottom: 6px;
}
.home-greeting__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.25;
  margin-bottom: 4px;
}
.home-greeting__subtitle {
  font-size: 0.875rem;
  opacity: 0.85;
  line-height: 1.4;
}

/* Quick action cards */
.home-actions {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-section-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--mid-gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px solid var(--warm-gray);
  border-radius: 14px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  color: inherit;
}
.action-card:active {
  box-shadow: 0 0 0 2px var(--teal);
  border-color: var(--teal);
}

.action-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  flex-shrink: 0;
}
.action-card__icon--teal    { background: rgba(45,143,156,0.12); }
.action-card__icon--gold    { background: rgba(212,149,111,0.15); }
.action-card__icon--coral   { background: rgba(224,122,95,0.12); }
.action-card__icon--purple  { background: rgba(120,100,180,0.12); }

.action-card__text { flex: 1; min-width: 0; }
.action-card__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--dark-gray);
  margin-bottom: 2px;
}
.action-card__desc {
  font-size: 0.8rem;
  color: var(--mid-gray);
  line-height: 1.35;
}
.action-card__arrow {
  font-size: 1.1rem;
  color: var(--mid-gray);
  flex-shrink: 0;
}

/* ── Timeline Panel ───────────────────────────────────── */
.timeline-header {
  padding: 16px 16px 12px;
  background: var(--white);
  border-bottom: 1px solid var(--warm-gray);
}
.timeline-header__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--deep-teal);
}
.timeline-header__subtitle {
  font-size: 0.8rem;
  color: var(--mid-gray);
  margin-top: 2px;
}

.timeline-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

/* Vertical timeline line */
.timeline-list::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: var(--warm-gray);
}

.timeline-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  position: relative;
}

.timeline-item__dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid var(--teal);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  z-index: 1;
  margin-top: 2px;
}
.timeline-item__dot--done { background: var(--teal); border-color: var(--teal); color: var(--white); }
.timeline-item__dot--upcoming { border-color: var(--warm-gray); }

.timeline-item__content {
  flex: 1;
  background: var(--white);
  border: 1.5px solid var(--warm-gray);
  border-radius: 12px;
  padding: 10px 12px;
}
.timeline-item__date {
  font-size: 0.7rem;
  color: var(--mid-gray);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.timeline-item__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--dark-gray);
  margin-top: 2px;
}
.timeline-item__body {
  font-size: 0.8125rem;
  color: var(--mid-gray);
  margin-top: 4px;
  line-height: 1.4;
}

/* Empty state */
.timeline-empty {
  padding: 32px 16px;
  text-align: center;
}
.timeline-empty__icon { font-size: 3rem; margin-bottom: 12px; }
.timeline-empty__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--dark-gray);
  margin-bottom: 6px;
}
.timeline-empty__body {
  font-size: 0.875rem;
  color: var(--mid-gray);
  line-height: 1.5;
  max-width: 260px;
  margin: 0 auto;
}

/* ── Profile Panel ────────────────────────────────────── */
.profile-hero {
  padding: 24px 16px 20px;
  background: linear-gradient(135deg, var(--deep-teal) 0%, var(--teal) 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 12px;
}
.profile-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.25rem;
}
.profile-email {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 2px;
}

.profile-sections {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px solid var(--warm-gray);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.profile-row:active { border-color: var(--teal); }
.profile-row__icon { font-size: 1.2rem; width: 24px; text-align: center; flex-shrink: 0; }
.profile-row__label {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dark-gray);
}
.profile-row__arrow { font-size: 0.9rem; color: var(--mid-gray); }

/* Profile info card */
.profile-info-card {
  background: var(--white);
  border: 1.5px solid var(--warm-gray);
  border-radius: 14px;
  overflow: hidden;
}
.profile-info-card__header {
  padding: 12px 16px;
  background: rgba(45,143,156,0.06);
  border-bottom: 1px solid var(--warm-gray);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--deep-teal);
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--warm-gray);
}
.profile-field:last-child { border-bottom: none; }
.profile-field__label {
  font-size: 0.75rem;
  color: var(--mid-gray);
  font-weight: 600;
  min-width: 90px;
  padding-top: 1px;
}
.profile-field__value {
  flex: 1;
  font-size: 0.875rem;
  color: var(--dark-gray);
  line-height: 1.4;
}
.profile-field__value--empty { color: var(--mid-gray); font-style: italic; }

/* ── Install Prompt Banner ────────────────────────────── */
.install-banner {
  position: fixed;
  bottom: calc(var(--safe-bottom) + var(--nav-h) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  background: var(--white);
  border: 1.5px solid var(--warm-gray);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 8px 30px rgba(26, 95, 106, 0.15);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideUp 0.3s ease-out;
}

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

.install-banner.hidden { display: none; }

.install-banner__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--deep-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.install-banner__text { flex: 1; min-width: 0; }
.install-banner__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--dark-gray);
  margin-bottom: 2px;
}
.install-banner__body {
  font-size: 0.8rem;
  color: var(--mid-gray);
  line-height: 1.4;
}

.install-banner__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.install-banner__btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8125rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.install-banner__btn:active { opacity: 0.8; }
.install-banner__btn--primary { background: var(--deep-teal); color: var(--white); }
.install-banner__btn--secondary { background: var(--warm-gray); color: var(--mid-gray); }

.install-banner__close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--mid-gray);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

/* ── Offline Banner ───────────────────────────────────── */
.offline-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fff3cd;
  border-bottom: 1px solid #ffc107;
  font-size: 0.8125rem;
  color: #856404;
  font-weight: 500;
}
.offline-banner.hidden { display: none; }
.offline-banner__icon { font-size: 1rem; }

/* ── iOS Install Guide ────────────────────────────────── */
.ios-install-guide {
  background: var(--white);
  border: 1.5px solid var(--warm-gray);
  border-radius: 16px;
  padding: 16px;
  margin: 12px 16px;
  box-shadow: 0 4px 16px rgba(26, 95, 106, 0.08);
}
.ios-install-guide.hidden { display: none; }
.ios-install-guide__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--deep-teal);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ios-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
}
.ios-step__num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--deep-teal);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ios-step__text {
  font-size: 0.875rem;
  color: var(--dark-gray);
  line-height: 1.4;
}

/* ── Utilities ────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.hidden { display: none !important; }

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--warm-gray);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Desktop centering (when not fullscreen) ──────────── */
@media (min-width: 480px) {
  body {
    background: #e8e0d9;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
  }
  #dottie-app {
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
  }
  .install-banner {
    bottom: calc(var(--nav-h) + 16px);
  }
}

/* ── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
