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

:root {
  --gold:        #C8A97A;
  --gold-light:  #F0D9B5;
  --gold-dark:   #9A7850;
  --cream:       #F8F3EC;
  --cream-2:     #F0E8DC;
  --ink:         #1A1410;
  --ink-2:       #2C2318;
  --ink-3:       #3E3028;
  --warm-gray:   #8A7A6A;
  --warm-mid:    #C4B09A;
  --success:     #4A9B7A;
  --success-bg:  #EBF7F2;
  --warning:     #D4820A;
  --warning-bg:  #FEF3E2;
  --danger:      #C0392B;
  --danger-bg:   #FDEDEB;
  --blue:        #2E6DA4;
  --blue-bg:     #EBF3FB;
  --purple:      #7B52AB;
  --purple-bg:   #F3EEFB;
  --teal:        #1A8A7A;
  --teal-bg:     #E8F7F5;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #0A0A0A;
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
}

/* ── DEVICE SHELL ── */
.device {
  width: 100%;
  height: 100%;
  max-width: 430px;
  max-height: 932px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 0;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Notch */
.device::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 126px; height: 34px;
  background: #000;
  border-radius: 0 0 20px 20px;
  z-index: 100;
}

/* Screen area */
.screen {
  position: absolute;
  inset: 0;
  background: var(--cream);
  overflow: hidden;
}

/* ── VIEWS ── */
.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateX(30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}
.view.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}
.view.exit-left {
  opacity: 0;
  transform: translateX(-30px);
}

/* ── STATUS BAR ── */
.status-bar {
  height: 44px;
  padding: 14px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.status-time {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
}
.status-bar.light .status-time,
.status-bar.light .status-icons { color: rgba(255,255,255,0.9); }

/* ── SCROLL CONTAINER ── */
.scroll-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  display: block;
}
.scroll-body::-webkit-scrollbar { display: none; }

/* ── NAV BAR ── */
.nav-bar {
  height: 82px;
  padding-bottom: 16px;
  background: rgba(248,243,236,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding-top: 10px;
  flex-shrink: 0;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
  transition: all 0.15s;
  min-width: 56px;
}
.nav-item:active { transform: scale(0.92); }
.nav-icon {
  font-size: 22px;
  line-height: 1;
  filter: grayscale(1) opacity(0.35);
  transition: filter 0.15s;
}
.nav-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--warm-gray);
  letter-spacing: 0.2px;
  transition: color 0.15s;
}
.nav-item.active .nav-icon { filter: none; }
.nav-item.active .nav-label { color: var(--gold-dark); font-weight: 600; }

/* ── BACK BUTTON ── */
.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gold-dark);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
}
.back-btn:active { opacity: 0.6; }

/* ── TODAY VIEW ── */
.today-header {
  background: var(--ink);
  padding: 0 24px 28px;
  position: relative;
  overflow: hidden;
}
.today-header::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(200,169,122,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.clinic-logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 20px;
}
.clinic-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(200,169,122,0.6);
}
.header-greeting {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  font-weight: 400;
  margin-bottom: 4px;
}
.header-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
  color: white;
  line-height: 1.1;
  margin-bottom: 20px;
}
.header-name span {
  background: linear-gradient(90deg, #C8A97A, #F0D9B5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Day progress pill */
.day-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(200,169,122,0.12);
  border: 1px solid rgba(200,169,122,0.2);
  border-radius: 20px;
  padding: 10px 16px;
}
.day-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.day-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  line-height: 1.3;
}
.day-label strong { color: rgba(255,255,255,0.85); display: block; font-size: 13px; }

/* Progress ring */
.progress-ring-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.ring-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.ring-fill {
  height: 100%;
  background: linear-gradient(90deg, #9A7850, #F0D9B5);
  border-radius: 2px;
  transition: width 0.6s ease;
}
.ring-pct {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}

/* ── CARDS ── */
.section-pad { padding: 0 16px; }
.section-title-sm {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--warm-gray);
  padding: 20px 20px 10px;
}

/* Today task card */
.task-card {
  background: white;
  border-radius: 16px;
  margin: 0 16px 10px;
  padding: 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.task-card:active { transform: scale(0.98); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.task-card.done { opacity: 0.55; }
.task-card.done .task-title { text-decoration: line-through; }
.task-icon-wrap {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.task-info { flex: 1; }
.task-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.task-sub { font-size: 12px; color: var(--warm-gray); line-height: 1.4; }
.task-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid #DDD;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s;
  font-size: 12px;
  color: transparent;
}
.task-card.done .task-check {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* Streak card */
.streak-card {
  background: linear-gradient(135deg, var(--ink) 0%, #2C1F10 100%);
  border-radius: 20px;
  margin: 0 16px 10px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.streak-card::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(200,169,122,0.15) 0%, transparent 70%);
}
.streak-flame { font-size: 40px; }
.streak-info { flex: 1; }
.streak-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.streak-label { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.streak-badge {
  background: rgba(200,169,122,0.15);
  border: 1px solid rgba(200,169,122,0.3);
  border-radius: 10px;
  padding: 8px 12px;
  text-align: center;
}
.streak-badge-num { font-size: 18px; font-weight: 700; color: var(--gold); }
.streak-badge-label { font-size: 10px; color: rgba(255,255,255,0.4); }

/* Alert card */
.alert-card {
  background: var(--warning-bg);
  border: 1px solid rgba(212,130,10,0.2);
  border-radius: 16px;
  margin: 0 16px 10px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.alert-card:active { opacity: 0.8; }
.alert-icon { font-size: 20px; }
.alert-text .alert-title { font-size: 13px; font-weight: 600; color: var(--warning); }
.alert-text .alert-sub { font-size: 12px; color: rgba(0,0,0,0.5); margin-top: 2px; line-height: 1.4; }

/* Tip card */
.tip-card {
  background: var(--teal-bg);
  border-radius: 16px;
  margin: 0 16px 10px;
  padding: 16px;
  border: 1px solid rgba(26,138,122,0.15);
}
.tip-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.tip-text { font-size: 13px; color: #1A4038; line-height: 1.6; }

/* ── MEDS VIEW ── */
.meds-header {
  background: linear-gradient(160deg, #1A1410 0%, #2C1F10 100%);
  padding: 0 24px 24px;
}
.med-phase-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.med-header-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: white;
  line-height: 1.2;
}
.med-compliance-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.med-comp-track {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.med-comp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  border-radius: 3px;
}
.med-comp-pct { font-size: 13px; font-weight: 700; color: var(--gold); }

/* Med row */
.med-row {
  background: white;
  border-radius: 16px;
  margin: 0 16px 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: all 0.15s;
}
.med-row:active { transform: scale(0.98); }
.med-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.med-info { flex: 1; }
.med-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.med-dose { font-size: 12px; color: var(--warm-gray); margin-top: 2px; }
.med-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}
.mb-taken { background: var(--success-bg); color: var(--success); }
.mb-due { background: var(--warning-bg); color: var(--warning); }
.mb-future { background: var(--cream-2); color: var(--warm-gray); }

/* Finasteride detail card */
.fin-card {
  background: white;
  border-radius: 16px;
  margin: 0 16px 8px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: all 0.15s;
}
.fin-card:active { transform: scale(0.98); }
.fin-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fin-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--purple-bg); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.fin-info { flex: 1; }
.fin-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.fin-sub { font-size: 12px; color: var(--warm-gray); margin-top: 1px; }
.fin-streak-row { display: flex; gap: 8px; }
.fin-streak-box {
  flex: 1;
  background: var(--purple-bg);
  border: 1px solid rgba(123,82,171,0.15);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.fin-streak-num { font-size: 22px; font-weight: 700; color: var(--purple); font-family: 'Cormorant Garamond', serif; }
.fin-streak-label { font-size: 10px; color: var(--warm-gray); margin-top: 1px; }

/* ── TIMELINE VIEW ── */
.timeline-header {
  background: var(--ink);
  padding: 0 24px 24px;
}
.timeline-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: white;
  line-height: 1.2;
}
.timeline-sub { font-size: 13px; color: rgba(255,255,255,0.4); margin-top: 4px; }

/* Phase tabs */
.phase-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.phase-tabs::-webkit-scrollbar { display: none; }
.phase-tab {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.phase-tab.active { background: var(--ink); color: var(--gold); border-color: rgba(200,169,122,0.3); }
.phase-tab:not(.active) { background: white; color: var(--warm-gray); border-color: rgba(0,0,0,0.08); }
.phase-tab:active { transform: scale(0.95); }

/* Milestone row */
.milestone {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.1s;
}
.milestone:active { background: rgba(0,0,0,0.02); }
.milestone-line-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 32px;
  flex-shrink: 0;
}
.milestone-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.milestone-dot.done { background: var(--success); color: white; }
.milestone-dot.current { background: var(--gold); color: white; box-shadow: 0 0 0 4px rgba(200,169,122,0.2); }
.milestone-dot.upcoming { background: var(--cream-2); color: var(--warm-mid); border: 1.5px dashed var(--warm-mid); }
.milestone-line { width: 2px; flex: 1; min-height: 20px; background: var(--cream-2); margin: 4px 0; }
.milestone-content { flex: 1; padding-top: 4px; }
.milestone-day { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--warm-gray); margin-bottom: 3px; }
.milestone-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.milestone-desc { font-size: 12px; color: var(--warm-gray); line-height: 1.5; }
.milestone-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}
.tag-done { background: var(--success-bg); color: var(--success); }
.tag-now { background: rgba(200,169,122,0.15); color: var(--gold-dark); }
.tag-soon { background: var(--cream-2); color: var(--warm-gray); }

/* ── PHOTO VIEW ── */
.photo-header {
  background: var(--ink);
  padding: 0 24px 24px;
}
.photo-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: white;
  line-height: 1.2;
}
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 16px;
}
.angle-btn {
  aspect-ratio: 1;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.angle-btn:active { transform: scale(0.95); }
.angle-btn.done {
  background: white;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  border: 1.5px solid rgba(74,155,122,0.3);
}
.angle-btn.pending {
  background: white;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  border: 1.5px dashed var(--cream-2);
}
.angle-icon { font-size: 26px; }
.angle-label { font-size: 10px; font-weight: 600; color: var(--warm-gray); text-align: center; line-height: 1.3; }
.angle-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}

/* AI result card */
.ai-card {
  background: linear-gradient(135deg, #0F0F0F 0%, #1E150A 100%);
  border-radius: 20px;
  margin: 0 16px 10px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.ai-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(200,169,122,0.12) 0%, transparent 70%);
}
.ai-eyebrow { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.ai-score-row { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.ai-score { font-family: 'Cormorant Garamond', serif; font-size: 52px; font-weight: 700; color: var(--gold); line-height: 1; }
.ai-score-label { font-size: 13px; color: rgba(255,255,255,0.5); padding-bottom: 8px; }
.ai-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-metric {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 10px;
}
.ai-metric-label { font-size: 10px; color: rgba(255,255,255,0.35); letter-spacing: 0.5px; margin-bottom: 3px; }
.ai-metric-val { font-size: 14px; font-weight: 600; color: white; }
.ai-metric-val.good { color: #4A9B7A; }
.ai-metric-val.warn { color: var(--gold); }

/* ── DIARY VIEW ── */
.diary-entry {
  background: white;
  border-radius: 16px;
  margin: 0 16px 8px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.diary-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.diary-day { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--warm-gray); }
.diary-mood { font-size: 18px; }
.diary-text { font-size: 14px; color: var(--ink); line-height: 1.6; margin-bottom: 10px; }
.diary-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.diary-tag { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.dt-positive { background: var(--success-bg); color: var(--success); }
.dt-neutral { background: var(--cream-2); color: var(--warm-gray); }
.dt-concern { background: var(--warning-bg); color: var(--warning); }

.diary-compose {
  background: white;
  border-radius: 16px;
  margin: 0 16px 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.diary-compose-prompt { font-size: 13px; color: var(--warm-gray); margin-bottom: 10px; }
.diary-input-row { display: flex; gap: 8px; }
.diary-fake-input {
  flex: 1;
  background: var(--cream);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--warm-gray);
  font-family: 'DM Sans', sans-serif;
}
.diary-send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.diary-send-btn:active { transform: scale(0.9); background: var(--gold-dark); }

/* ── ACHIEVEMENTS VIEW ── */
.achievement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 8px 16px 16px;
}
.badge-card {
  background: white;
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.15s;
}
.badge-card:active { transform: scale(0.95); }
.badge-card.locked { opacity: 0.4; }
.badge-emoji { font-size: 28px; margin-bottom: 6px; }
.badge-name { font-size: 10px; font-weight: 700; color: var(--ink); margin-bottom: 2px; line-height: 1.3; }
.badge-sub { font-size: 9px; color: var(--warm-gray); }
.badge-card.earned { border: 1.5px solid rgba(200,169,122,0.3); }

/* XP bar */
.xp-card {
  background: linear-gradient(135deg, var(--ink), #2C1F10);
  border-radius: 20px;
  margin: 12px 16px 4px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.xp-level {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(200,169,122,0.15);
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  flex-shrink: 0;
}
.xp-level-num { font-size: 18px; font-weight: 700; color: var(--gold); line-height: 1; }
.xp-level-label { font-size: 8px; letter-spacing: 1px; color: rgba(255,255,255,0.4); text-transform: uppercase; }
.xp-info { flex: 1; }
.xp-title { font-size: 13px; font-weight: 600; color: white; margin-bottom: 4px; }
.xp-sub { font-size: 11px; color: rgba(255,255,255,0.4); margin-bottom: 8px; }
.xp-track { height: 5px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); border-radius: 3px; width: 62%; }

/* ── MEDICATION DETAIL VIEW ── */
.med-detail-header {
  background: var(--purple);
  padding: 0 24px 28px;
  position: relative;
  overflow: hidden;
}
.med-detail-header::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}
.med-detail-icon { font-size: 40px; margin-bottom: 12px; }
.med-detail-name { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 700; color: white; line-height: 1.1; margin-bottom: 6px; }
.med-detail-dose { font-size: 13px; color: rgba(255,255,255,0.6); }

.info-section {
  background: white;
  border-radius: 16px;
  margin: 0 16px 10px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.info-section-title { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--warm-gray); margin-bottom: 10px; }
.info-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--cream); }
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.info-row-text { flex: 1; }
.info-row-label { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 1px; }
.info-row-val { font-size: 12px; color: var(--warm-gray); line-height: 1.5; }

/* ── NOTIFICATIONS DOT ── */
.notif-dot {
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  position: absolute;
  top: 2px; right: 4px;
}

/* ── LOADING PULSE ── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.pulse { animation: pulse 1.5s infinite; }

/* ── FADE IN ── */
@keyframes fadeUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.fade-up { animation: fadeUp 0.4s ease forwards; }

/* ── RIPPLE ── */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(200,169,122,0.3);
  transform: scale(0);
  animation: ripple-anim 0.5s ease-out;
  pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }
@keyframes splashDot { 0%,100%{opacity:0.25;transform:scale(0.8)} 50%{opacity:1;transform:scale(1.15)} }
.ob-input:focus { border-color:#1a2744 !important; }
.otp-box:focus  { border-color:#c8a97a !important; background:#fffdf7 !important; }
.auth-choice:active { border-color:#1a2744 !important; transform:scale(0.98); }
.ob-med-row input[type=checkbox]:checked ~ * { color:#1a2744; }
#view-splash { background:linear-gradient(170deg,#0a1628,#1a2744); }
#view-auth, #view-verify, #view-onboard1, #view-surgery { background:#f5f6f8; }

/* Desktop hint */
@media (min-width: 440px) {
  body::after {
    content: 'Tip: Open on mobile for the full experience';
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    white-space: nowrap;
    pointer-events: none;
  }
}

/* Mobile full screen */
@media (max-width: 430px) {
  body { background: var(--cream); }
  .device {
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .device::before { display: none; }
  .status-bar { padding-top: 44px; }
}

/* Profile view */
.scroll-body { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }

/* ── Symptom sliders ── */
.scale-row { padding:12px 0; border-bottom:1px solid var(--cream-2); }
.scale-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:8px; }
.scale-label { font-size:13px; font-weight:600; color:var(--ink); }
.scale-hint { font-size:10px; color:var(--warm-gray); margin-top:2px; }
.scale-val { font-size:22px; font-weight:700; color:var(--ink); font-family:'Cormorant Garamond',serif; min-width:28px; text-align:right; }
.scale-track { position:relative; }
.scale-slider { -webkit-appearance:none; appearance:none; width:100%; height:6px; border-radius:3px; outline:none; cursor:pointer; background:linear-gradient(90deg, var(--track-color, var(--gold)) calc(var(--val, 50%) * 10%), var(--cream-2) 0%); }
.scale-slider::-webkit-slider-thumb { -webkit-appearance:none; width:22px; height:22px; border-radius:50%; background:white; border:2px solid var(--track-color, var(--gold)); box-shadow:0 2px 8px rgba(0,0,0,0.15); cursor:pointer; }
.scale-ends { display:flex; justify-content:space-between; font-size:10px; color:var(--warm-gray); margin-top:4px; }
.scale-note { font-size:11px; padding:8px 10px; border-radius:8px; margin-top:8px; line-height:1.5; }

/* ── Commitment rows ── */
.commit-row-compact { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--cream-2); cursor:pointer; transition:opacity 0.15s; }
.commit-row-compact:active { opacity:0.7; }
.commit-check-sm { width:22px; height:22px; border-radius:50%; border:2px solid #DDD; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:#CCC; flex-shrink:0; transition:all 0.2s; }
.commit-check-sm.done { background:var(--success); border-color:var(--success); color:white; }
.commit-label-sm { flex:1; font-size:12px; font-weight:500; color:var(--ink); }
.commit-why-sm { font-size:10px; color:var(--warm-gray); }
.commit-row-compact.done .commit-check-sm { background:var(--success); border-color:var(--success); color:white; }


/* ── Language Drawer ── */
#lang-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:1000; opacity:0; pointer-events:none; transition:opacity 0.3s; }
#lang-overlay.open { opacity:1; pointer-events:all; }
#lang-drawer { position:fixed; bottom:0; left:0; right:0; z-index:1001; background:var(--cream); border-radius:20px 20px 0 0; padding:20px 20px 40px; transform:translateY(100%); transition:transform 0.35s cubic-bezier(0.4,0,0.2,1); max-height:70vh; overflow-y:auto; }
#lang-drawer.open { transform:translateY(0); }
.lang-drawer-handle { width:40px; height:4px; background:#DDD; border-radius:2px; margin:0 auto 16px; }
.lang-drawer-title { font-size:16px; font-weight:700; color:var(--ink); margin-bottom:14px; }
.lang-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.lang-option { display:flex; align-items:center; gap:10px; padding:12px; background:white; border-radius:12px; cursor:pointer; border:2px solid transparent; transition:all 0.15s; }
.lang-option.active { border-color:var(--gold); background:rgba(200,169,122,0.08); }
.lang-option-flag { font-size:22px; }
.lang-option-name { font-size:13px; font-weight:600; color:var(--ink); }
.lang-option-native { font-size:10px; color:var(--warm-gray); }
body.rtl { direction:rtl; text-align:right; }
body.rtl .nav-bar { direction:ltr; }


/* ── Medication dose cards ── */
.med-dose-card {
  background: white;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 12px;
  padding: 14px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.med-dose-card:active { transform: scale(0.98); }
.med-dose-card.done {
  background: #f0faf5;
  border-color: rgba(74,155,122,0.25);
}
.med-dose-card.done .dose-check {
  background: #4a9b7a !important;
  border-color: #4a9b7a !important;
  color: white !important;
}
.med-dose-due {
  background: #fff8f5 !important;
  border: 1.5px solid rgba(231,76,60,0.3) !important;
}
.med-dose-due.done {
  background: #f0faf5 !important;
  border-color: rgba(74,155,122,0.25) !important;
}

/* ── ENGAGEMENT CARDS ── */
.st-stage { display:flex; flex-direction:column; align-items:center; gap:5px; flex:1; }
.st-dot { width:14px; height:14px; border-radius:50%; border:2px solid rgba(255,255,255,0.2); background:rgba(255,255,255,0.1); transition:all 0.3s; }
.st-dot.done { background:#4a9b7a; border-color:#4a9b7a; }
.st-dot.current { background:var(--gold); border-color:var(--gold); box-shadow:0 0 8px rgba(200,169,122,0.6); }
.st-label { font-size:9px; font-weight:600; color:rgba(255,255,255,0.35); text-align:center; line-height:1.3; transition:color 0.3s; }
.st-label.done { color:rgba(255,255,255,0.55); }
.st-label.current { color:var(--gold); }

