/* ============================================================
   WELCOME SCREEN — PAGINATED HOWTO CARDS
   ============================================================ */
#welcome-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  max-width: 430px;
  margin: 0 auto;
  overflow: hidden;
}
#welcome-screen.active { display: flex; }

.wlc-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 20px 12px;
  flex-shrink: 0;
}
.wlc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border2);
  transition: background 0.2s, width 0.2s;
}
.wlc-dot.active {
  background: var(--orange);
  width: 18px;
  border-radius: 3px;
}
.wlc-cards {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.wlc-card {
  display: none;
  flex-direction: column;
  padding: 20px 24px 16px;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}
.wlc-card.active { display: flex; }
.wlc-card-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--orange-light);
  border: 1.5px solid var(--orange-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  line-height: 1;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.wlc-card-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 14px;
  flex-shrink: 0;
}
.wlc-card-body {
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  line-height: 1.7;
}
.wlc-acc-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.wlc-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg3);
}
.wlc-row:last-child { border-bottom: none; }
.wlc-row-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.wlc-row-text {
  flex: 1;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
}
.wlc-row-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.wlc-nav {
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}
.wlc-btn-next {
  width: 100%;
  height: 54px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--orange2), var(--orange));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s, transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 4px 20px rgba(232,93,0,0.35);
}
.wlc-btn-next:active { opacity: 0.9; transform: scale(0.97); box-shadow: none; }
.wlc-btn-skip {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 13px;
  font-weight: 500;
  padding: 10px;
  cursor: pointer;
  margin-top: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   PROFILE TOUR HIGHLIGHT
   ============================================================ */
.tour-highlight {
  animation: tourPulse 1s ease-in-out infinite;
  border-radius: 12px;
  position: relative;
  z-index: 10;
}
@keyframes tourPulse {
  0%   { box-shadow: 0 0 0 0 rgba(232,93,0,0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(232,93,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,93,0,0); }
}

/* ============================================================
   HOW-TO ACCORDION (sub-howto)
   ============================================================ */
.howto-intro {
  padding: 16px 16px 8px;
  font-size: 13px;
  color: var(--text3);
  line-height: 1.6;
}
.acc-item {
  margin: 0 16px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  overflow: hidden;
}
.acc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.acc-header:active { background: var(--bg3); }
.acc-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.acc-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.acc-chevron {
  font-size: 18px;
  color: var(--text3);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
  line-height: 1;
}
.acc-item.open .acc-chevron { transform: rotate(90deg); }
.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1);
}
.acc-item.open .acc-body { max-height: 2000px; }
.acc-content {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.acc-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg3);
}
.acc-row:last-child { border-bottom: none; }
.acc-row-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.acc-row-text {
  flex: 1;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
}
.acc-row-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.howto-footer {
  padding: 16px;
  text-align: center;
}
.howto-ob-btn {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-sm);
  background: var(--orange);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-bottom: 10px;
}

/* ============================================================
   5KG MİLESTONE KUTLAMA EKRANI
   ============================================================ */
#milestone-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: linear-gradient(160deg, #1a0a00 0%, #2d1200 40%, #E85D00 100%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 28px 48px;
  max-width: 430px;
  margin: 0 auto;
  text-align: center;
  animation: fadeIn 0.4s ease;
}
#milestone-screen.active { display: flex; }

.ms-emoji {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 12px;
  animation: msBounce 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.3s both;
}
@keyframes msBounce {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.ms-badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 99px;
  padding: 6px 18px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.ms-title {
  font-size: 42px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.ms-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-bottom: 32px;
  line-height: 1.5;
}
.ms-info-card {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 32px;
  width: 100%;
  text-align: left;
  backdrop-filter: blur(8px);
}
.ms-info-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.ms-info-text {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
}
.ms-btn-primary {
  width: 100%;
  height: 56px;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--orange);
  font-size: 16px;
  font-weight: 900;
  border: none;
  cursor: pointer;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
  transition: opacity 0.15s, transform 0.12s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.ms-btn-primary:active { opacity: 0.9; transform: scale(0.97); }
.ms-btn-skip {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  font-weight: 500;
  padding: 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* ── WEIGHT INSIGHT CARD ── */
#insight-card {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,0.5);
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
}
#insight-card.active { display: flex; }
#insight-inner {
  width: 100%;
  max-width: 430px;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 28px 24px max(env(safe-area-inset-bottom,20px),20px);
  animation: sheetUp 0.32s cubic-bezier(0.32,0.72,0,1);
  text-align: center;
}
#insight-emoji {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 12px;
}
#insight-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
#insight-msg {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 20px;
}
#insight-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#insight-btn {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, var(--orange2), var(--orange));
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
#insight-btn:active { opacity: 0.9; transform: scale(0.98); }
#insight-btn2 {
  width: 100%;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 13px;
  font-weight: 500;
  padding: 6px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── GOAL REACHED CELEBRATION ── */
#goal-reached-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  overflow: hidden;
}
#goal-reached-screen.active { display: flex; }
#gr-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gr-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}
.gr-emoji {
  font-size: 72px;
  line-height: 1;
  animation: gr-pop 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes gr-pop {
  0%   { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.gr-badge {
  background: rgba(255,215,0,0.15);
  border: 1px solid rgba(255,215,0,0.4);
  color: #ffd700;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
}
.gr-title {
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  margin-top: 4px;
}
.gr-subtitle {
  color: rgba(255,255,255,0.6);
  font-size: 15px;
  text-align: center;
  line-height: 1.5;
}
.gr-stat-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 16px 28px;
  margin-top: 6px;
}
.gr-stat { text-align: center; }
.gr-stat-val {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}
.gr-stat-lbl {
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  margin-top: 2px;
}
.gr-arrow {
  color: rgba(255,255,255,0.3);
  font-size: 20px;
}
.gr-btn-primary {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  box-shadow: 0 4px 20px rgba(255,107,53,0.4);
}
.gr-btn-primary:active { opacity: 0.9; transform: scale(0.97); }
.gr-btn-skip {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  font-weight: 500;
  padding: 8px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── GEÇMİŞ KAYITLAR ── */
.gc-filters {
  display: flex;
  gap: 6px;
  padding: 12px 14px 4px;
  flex-shrink: 0;
}
.gc-filter {
  flex: 1;
  height: 32px;
  border-radius: 99px;
  border: 1.5px solid var(--border2);
  background: var(--bg2);
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.15s, transform 0.1s;
  font-family: var(--font);
}
.gc-filter:active { transform: scale(0.95); }
.gc-filter.active {
  border-color: var(--orange);
  background: var(--orange-light);
  color: var(--orange);
}

/* Day row */
.gc-day {
  margin: 0 14px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.gc-day-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  gap: 10px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.gc-day-header:active { background: var(--bg3); }
.gc-day-date {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  flex: 1;
}
.gc-day-pills {
  display: flex;
  gap: 5px;
  align-items: center;
}
.gc-pill {
  height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}
.gc-pill.food  { background: #FFF2E8; color: #E85D00; }
.gc-pill.lift  { background: #EFF6FF; color: #3A7BD5; }
.gc-pill.cardio{ background: #EFF6FF; color: #3A7BD5; }
.gc-pill.weight{ background: #F0FDF4; color: #16A34A; }
.gc-chevron {
  font-size: 14px;
  color: var(--text3);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.gc-day.open .gc-chevron { transform: rotate(90deg); }

/* Day detail */
.gc-day-body {
  display: none;
  border-top: 1px solid rgba(0,0,0,0.05);
  padding: 8px 0 4px;
}
.gc-day.open .gc-day-body { display: block; }

.gc-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 14px 6px;
}
.gc-row {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  gap: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.gc-row:last-child { border-bottom: none; }
.gc-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gc-row-dot.food   { background: #E85D00; }
.gc-row-dot.lift   { background: #3A7BD5; }
.gc-row-dot.cardio { background: #3A7BD5; }
.gc-row-dot.weight { background: #16A34A; }
.gc-row-main { flex: 1; min-width: 0; }
.gc-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gc-row-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
}
.gc-row-val {
  font-size: 13px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  flex-shrink: 0;
}
.gc-row-del {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg3);
  border: none;
  color: var(--text3);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font);
  transition: background 0.15s, color 0.15s;
}
.gc-row-del:active { background: #FEE2E2; color: var(--danger); }

/* Trend bar (kilo) */
.gc-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
}
.gc-trend.up   { background: #FEE2E2; color: #DC2626; }
.gc-trend.down { background: #F0FDF4; color: #16A34A; }
.gc-trend.flat { background: var(--bg3); color: var(--text3); }

/* Filter dim */
.gc-day.dimmed { opacity: 0.35; }

/* Empty */
.gc-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
  font-size: 14px;
}
.gc-empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ============================================================
   PWA INSTALL EKRANI
   ============================================================ */
#install-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #1a0800 0%, #2d1200 50%, #E85D00 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  z-index: 9999;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#install-screen.active {
  opacity: 1;
  pointer-events: all;
}
.inst-icon {
  font-size: 72px;
  margin-bottom: 20px;
}
.inst-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.inst-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.80);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 280px;
}
.inst-btn-primary {
  width: 100%;
  max-width: 280px;
  padding: 18px;
  background: #fff;
  color: var(--orange);
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  letter-spacing: -0.2px;
}
.inst-btn-skip {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ============================================================
   AI ANALİZ — OBSIDIAN INTELLIGENCE
   ============================================================ */

/* JetBrains Mono for terminal feel */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');

/* ── SEGMENT CONTROL ── */
.ai-seg-wrap {
  padding: 14px 14px 0;
  position: relative;
}
.ai-seg-track {
  display: flex;
  background: #111;
  border-radius: 10px;
  padding: 3px;
  position: relative;
  gap: 0;
  overflow: hidden;
}
.ai-seg-pill {
  position: absolute;
  top: 3px;
  height: calc(100% - 6px);
  background: var(--orange);
  border-radius: 7px;
  transition: left 0.28s cubic-bezier(0.4,0,0.2,1), width 0.28s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
  z-index: 0;
}
.ai-seg-btn {
  flex: 1;
  position: relative;
  z-index: 1;
  height: 34px;
  background: transparent;
  border: none;
  border-radius: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}
.ai-seg-btn.active {
  color: #fff;
}

/* ── WARNING ── */
.ai-warn-box {
  display: none;
  margin: 10px 14px 0;
  padding: 10px 14px;
  background: #0F0F0F;
  border: 1px solid rgba(232,93,0,0.25);
  border-left: 2.5px solid var(--orange);
  border-radius: 0 10px 10px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255,180,60,0.75);
  letter-spacing: 0.02em;
  line-height: 1.6;
}
.ai-warn-box.visible { display: block; }

/* ── MAIN CARD ── */
.ai-card {
  margin: 12px 14px 0;
  background: #080808;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
/* Gradient border via pseudo */
.ai-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1.5px;
  background: linear-gradient(160deg, var(--orange) 0%, rgba(232,93,0,0.3) 50%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
/* Dot grid texture */
.ai-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 16px;
  pointer-events: none;
  z-index: 0;
}

/* ── CARD HEADER ── */
.ai-card-header {
  position: relative;
  z-index: 1;
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ai-card-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--orange), #FF9A40);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(232,93,0,0.35);
}
.ai-card-titles { flex: 1; }
.ai-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}
.ai-card-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* ── READY DOT ── */
.ai-ready-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
  animation: ai-pulse 2s infinite;
}
@keyframes ai-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.ai-ready-dot.generating {
  animation: ai-spin-arc 0.8s linear infinite;
  background: transparent;
  border: 2px solid var(--orange);
  border-top-color: transparent;
}
@keyframes ai-spin-arc {
  to { transform: rotate(360deg); }
}
.ai-ready-dot.done {
  animation: none;
  background: #22C55E;
}

/* ── GENERATE BUTTON ── */
.ai-btn-row {
  position: relative;
  z-index: 1;
  padding: 14px 14px 0;
  display: flex;
  gap: 8px;
}
.ai-btn-generate {
  flex: 1;
  height: 52px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 4px 20px rgba(232,93,0,0.4);
}
.ai-btn-generate:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(232,93,0,0.3);
}
.ai-btn-regen {
  height: 52px;
  padding: 0 16px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.12s;
  font-family: var(--font);
}
.ai-btn-regen:active { transform: scale(0.96); }

/* ── OUTPUT WRAP ── */
.ai-output-wrap {
  display: none;
  position: relative;
  z-index: 1;
  padding: 14px 14px 0;
}
.ai-output-wrap.visible { display: block; }

/* ── META ROW ── */
.ai-output-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.ai-created-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.05em;
}
.ai-char-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.3);
  transition: color 0.3s;
}
.ai-char-count.warn { color: #FCD34D; }
.ai-char-count.danger { color: #F87171; }

/* ── READ VIEW ── */
.ai-read-view {
  background: #0D0D0D;
  border: 1px solid rgba(255,255,255,0.07);
  border-left: 3px solid var(--orange);
  border-radius: 10px;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: rgba(255,255,255,0.75);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(232,93,0,0.4) transparent;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.ai-read-view.revealed {
  opacity: 1;
  transform: translateY(0);
}
.ai-read-view::-webkit-scrollbar { width: 3px; }
.ai-read-view::-webkit-scrollbar-track { background: transparent; }
.ai-read-view::-webkit-scrollbar-thumb { background: rgba(232,93,0,0.4); border-radius: 2px; }

/* ── EDIT VIEW ── */
.ai-edit-view {
  display: none;
  width: 100%;
  min-height: 300px;
  background: #0D0D0D;
  border: 1.5px solid var(--orange);
  border-radius: 10px;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: rgba(255,255,255,0.85);
  line-height: 1.75;
  resize: vertical;
  text-transform: none;
  outline: none;
  box-shadow: 0 0 0 3px rgba(232,93,0,0.12);
}
.ai-edit-view.visible { display: block; }

/* ── TRIMMED NOTE ── */
.ai-trimmed-note {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(252,211,77,0.6);
  margin-top: 6px;
  letter-spacing: 0.03em;
  display: none;
}
.ai-trimmed-note.visible { display: block; }

/* ── ACTION ROW ── */
.ai-action-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-bottom: 14px;
}
.ai-btn-edit {
  flex: 1;
  height: 44px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s, transform 0.1s;
}
.ai-btn-edit:active { transform: scale(0.97); }

.ai-btn-copy {
  flex: 1;
  height: 44px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s, transform 0.1s;
  letter-spacing: -0.2px;
}
.ai-btn-copy:active { transform: scale(0.97); }
.ai-btn-copy.copied {
  background: #16A34A;
}

/* ============================================================
   DESKTOP MOUSE — HOVER STATES + CURSOR FIXES
   ============================================================ */

/* Ensure cursor on all clickable divs */
.acc-header,
.gc-day-header,
.wj-trend-bar,
.mp-ex-main,
.mp-sub-pill,
.mp-lib-item,
.vd-dot,
.nav-item,
.cal-day,
.chip,
.wj-chip,
.menu-item,
.gc-filter,
.gc-day-header,
.howto-ob-btn,
.ai-seg-btn,
.ai-btn-generate,
.ai-btn-regen,
.ai-btn-edit,
.ai-btn-copy,
.prof-settings-toggle { cursor: pointer; }

/* Readable text — no pointer */
.hero-kcal, .hero-label, .hero-greeting,
.wj-current, .wj-unit, .wj-label,
.card-title, .topbar-title, .topbar-logo,
.ant-stat-val, .ant-stat-lbl,
.modal-title, .section-title { cursor: default; user-select: none; }

/* Prevent text selection on all tappable elements */
.nav-item, .menu-item, .cal-day, .chip,
.wj-chip, .wj-btn, .meal-btn, .modal-tab,
.gc-filter, .gc-day-header, .acc-header,
.ai-seg-btn, .topbar-back, .topbar-action,
.food-add-btn, .ant-lift-card { user-select: none; }

/* ── HOVER STATES ── */
@media (hover: hover) {
  /* Nav */
  .nav-item:hover { background: rgba(232,93,0,0.06); }
  .nav-item:hover .nav-label { color: var(--orange); }
  .nav-item:hover .nav-icon { transform: scale(1.06); filter: drop-shadow(0 1px 4px rgba(232,93,0,0.25)); }

  /* Buttons */
  .btn-primary:hover { opacity: 0.92; box-shadow: 0 6px 20px rgba(232,93,0,0.38); }
  .btn-secondary:hover { background: var(--bg4); }
  .wj-btn:hover { opacity: 0.92; box-shadow: 0 6px 18px rgba(232,93,0,0.36); }
  .food-add-btn:hover { opacity: 0.92; }
  .wlc-btn-primary:hover { opacity: 0.92; }
  .wlc-btn-secondary:hover { background: var(--bg4); }
  .ms-btn-primary:hover { opacity: 0.92; }
  .ai-btn-generate:hover { opacity: 0.92; }
  .ai-btn-copy:hover { opacity: 0.92; }

  /* Menu items */
  .menu-item:hover { background: var(--bg3); }

  /* Cal day */
  .cal-day:hover { background: var(--bg3); border-color: var(--border2); }
  .cal-day.active:hover { background: var(--orange); }

  /* Chips */
  .chip:hover { background: var(--bg3); border-color: var(--border2); }
  .wj-chip:hover { background: var(--bg3); }
  .wj-chip.done:hover { background: #FFE8D6; }

  /* Meal buttons */
  .meal-btn:hover { background: var(--bg4); }
  .meal-btn.active:hover { background: var(--orange-light); }

  /* Modal tabs */
  .modal-tab:hover { background: var(--bg4); }
  .modal-tab.active:hover { opacity: 0.92; }

  /* GC */
  .gc-day-header:hover { background: var(--bg3); }
  .gc-filter:hover { border-color: var(--border2); background: var(--bg3); }
  .gc-filter.active:hover { background: var(--orange-light); }

  /* Acc */
  .acc-header:hover { background: var(--bg3); }

  /* Topbar buttons */
  .topbar-back:hover { background: var(--bg4); }
  .topbar-action:hover { background: var(--bg4); }

  /* Food del */
  .food-del:hover { opacity: 1; color: var(--danger); }
  .ant-lift-del:hover { opacity: 1; color: var(--danger); }

  /* Seg buttons */
  .ai-seg-btn:hover { color: rgba(255,255,255,0.7); }
  .ai-seg-btn.active:hover { color: #fff; }

  /* AI regen/edit */
  .ai-btn-regen:hover { background: rgba(255,255,255,0.12); }
  .ai-btn-edit:hover { background: rgba(255,255,255,0.08); }

  /* Muscle page zones */
  .vd-zone:hover { opacity: 0.85; }
  .mp-ex-main:hover { background: rgba(255,255,255,0.05); }
  .mp-sub-pill:hover { opacity: 0.8; }
  .mp-lib-item:hover { background: rgba(255,255,255,0.28); }

  /* VD dots */
  .vd-dot:hover { transform: scale(1.3); }
}

/* ============================================================
   GLOBAL SHADOW BLEED FIX
   All card-level shadows contained — no vertical bleed
   ============================================================ */
.card,
.wj-card,
.ant-lift-card,
.gc-day,
.chip,
.wj-chip,
.cal-day {
  box-shadow: 0 1px 6px rgba(0,0,0,0.07) !important;
}

.hero-card {
  box-shadow: none !important;
}

/* Buttons keep their glow but tighter */
.btn-primary,
.wj-btn,
.food-add-btn,
.wlc-btn-primary {
  box-shadow: 0 2px 8px rgba(232,93,0,0.22) !important;
}
.btn-primary:active,
.wj-btn:active,
.food-add-btn:active,
.wlc-btn-primary:active {
  box-shadow: none !important;
}

#app, #app * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: default;
}
#app input, #app textarea { 
  user-select: text; 
  -webkit-user-select: text; 
  cursor: text; 
}
#app button, #app [onclick] { cursor: pointer; }
#app [contenteditable] { 
  user-select: text; 
  -webkit-user-select: text; 
  cursor: text; 
}
.hero-card, .hero-card *,
.wj-card, .wj-card *,
.wj-today-row, .wj-today-row *,
.nav-item, .nav-item *,
.menu-item, .menu-item *,
.cal-day, .cal-day *,
.chip,
.meal-btn,
.modal-tab,
.food-add-btn,
.topbar, .topbar *,
.ant-lift-card, .ant-lift-card *,
.ant-stat-cell, .ant-stat-cell *,
.gc-day-header, .gc-day-header *,
.gc-filter,
.acc-header, .acc-header *,
.vd-card, .vd-card *,
.vd-dot,
.ai-seg-btn,
.ai-card-header *,
.wlc-btn-primary, .wlc-btn-secondary,
.ms-btn-primary,
.stat-box, .stat-box * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   AI SUGGEST PANEL — v2.3.0
   ============================================================ */
.suggest-card-wrap { position: relative; width: 100%; }

.suggest-card {
  position: relative !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.suggest-front {
  display: flex;
  flex-direction: column;
  padding: 14px;
}

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

/* ✦ Spark button */
.ai-spark-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #FFF2E8;
  border: 1.5px solid #FFCFA8;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: background .15s, transform .1s, box-shadow .15s;
  flex-shrink: 0;
}
.ai-spark-btn:hover { background: var(--orange); color: #fff; box-shadow: 0 0 0 4px rgba(232,93,0,.15); }
.ai-spark-btn:active { transform: scale(.92); }
.ai-spark-btn.pulse { animation: aiSparkPulse 2s ease-in-out .5s 2; }
.ai-spark-btn.hidden { display: none; }
@keyframes aiSparkPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(232,93,0,0); }
  50%      { box-shadow: 0 0 0 6px rgba(232,93,0,.25); }
}

/* Ripple */
.suggest-ripple-overlay {
  position: absolute; inset: 0;
  border-radius: var(--radius, 18px);
  pointer-events: none; overflow: hidden; z-index: 5;
}
.suggest-ripple-circle {
  position: absolute; border-radius: 50%;
  background: #111; transform: scale(0); pointer-events: none;
}
.suggest-ripple-circle.expanding  { animation: sugRippleIn  .55s cubic-bezier(.4,0,.2,1) forwards; }
.suggest-ripple-circle.collapsing { animation: sugRippleOut .45s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes sugRippleIn  { from{transform:scale(0);opacity:1;} to{transform:scale(1);opacity:1;} }
@keyframes sugRippleOut { from{transform:scale(1);opacity:1;} to{transform:scale(0);opacity:0;} }

/* Back panel */
.suggest-back {
  position: absolute; inset: 0;
  background: #111;
  border-radius: var(--radius, 18px);
  display: none; flex-direction: column;
  z-index: 6;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.suggest-back.visible { display: flex; }
.suggest-back.visible + * + .suggest-front,
.suggest-front.ai-hidden { visibility: hidden; }

/* Back nav */
.suggest-back-nav {
  padding: 10px 14px 0;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.suggest-back-btn {
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,.5);
  cursor: pointer; background: none; border: none; padding: 4px 0;
  transition: color .15s;
}
.suggest-back-btn:hover { color: rgba(255,255,255,.9); }
.suggest-back-time {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,.3); font-family: monospace;
}

/* Mode select */
.sug-mode-select { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; animation: sugFadeUp .3s ease forwards; }
.sug-mode-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.sug-mode-card {
  background: rgba(255,255,255,.07); border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 12px 14px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  display: flex; align-items: center; gap: 10px;
}
.sug-mode-card:hover { background: rgba(232,93,0,.15); border-color: rgba(232,93,0,.4); }
.sug-mode-card:active { transform: scale(.98); }
.sug-mode-icon { font-size: 20px; flex-shrink: 0; }
.sug-mode-info { flex: 1; }
.sug-mode-title { font-size: 12px; font-weight: 800; color: #fff; margin-bottom: 2px; }
.sug-mode-sub { font-size: 10px; font-weight: 500; color: rgba(255,255,255,.45); line-height: 1.4; }
.sug-mode-arrow { font-size: 13px; color: rgba(255,255,255,.25); flex-shrink: 0; }

/* Loading */
.sug-loading { padding: 14px; display: flex; flex-direction: column; gap: 10px; animation: sugFadeUp .3s ease forwards; }
.sug-loading-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .07em; }
.sug-loading-macros { display: flex; flex-direction: column; gap: 6px; }
.sug-loading-row { display: flex; align-items: center; gap: 8px; }
.sug-loading-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.35); width: 48px; flex-shrink: 0; }
.sug-loading-val { font-size: 15px; font-weight: 900; font-family: monospace; min-width: 55px; transition: color .3s; }
.sug-loading-val.counting { color: var(--orange); }
.sug-loading-val.done { color: rgba(255,255,255,.2); }
.sug-loading-unit { font-size: 10px; color: rgba(255,255,255,.25); font-weight: 600; }
.sug-dots { display: flex; gap: 5px; margin-top: 2px; }
.sug-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--orange); animation: sugDotPulse 1.2s ease-in-out infinite; }
.sug-dot:nth-child(2) { animation-delay: .2s; }
.sug-dot:nth-child(3) { animation-delay: .4s; }
@keyframes sugDotPulse { 0%,100%{opacity:.25;transform:scale(.8);}50%{opacity:1;transform:scale(1);} }

/* Results */
.sug-results { padding: 8px 14px 14px; display: flex; flex-direction: column; gap: 8px; animation: sugFadeUp .35s ease forwards; }
.sug-results-header { display: flex; align-items: center; justify-content: space-between; }
.sug-summary { font-size: 11px; font-weight: 600; color: rgba(255,255,255,.5); line-height: 1.4; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.07); flex: 1; }
.sug-item { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); border-radius: 11px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.sug-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.sug-item-name { font-size: 12px; font-weight: 800; color: #fff; line-height: 1.3; flex: 1; }
.sug-item-time { font-size: 9px; font-weight: 700; color: var(--orange); background: rgba(232,93,0,.15); border-radius: 6px; padding: 2px 6px; flex-shrink: 0; }
.sug-macro-row { display: flex; gap: 5px; flex-wrap: wrap; }
.sug-pill { font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 20px; font-family: monospace; }
.sug-pill.kcal { background: rgba(232,93,0,.18); color: #FF7A20; }
.sug-pill.p    { background: rgba(59,130,246,.18); color: #60A5FA; }
.sug-pill.k    { background: rgba(245,158,11,.18); color: #FCD34D; }
.sug-pill.y    { background: rgba(16,185,129,.18); color: #34D399; }
.sug-prog-wrap { display: flex; align-items: center; gap: 7px; }
.sug-prog-bar { flex: 1; height: 3px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.sug-prog-fill { height: 100%; background: var(--orange); border-radius: 99px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.sug-prog-label { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.3); font-family: monospace; flex-shrink: 0; }
.sug-item-warn { font-size: 9px; font-weight: 700; color: #FBBF24; background: rgba(251,191,36,.12); border-radius: 5px; padding: 2px 6px; align-self: flex-start; }
.sug-meal-tag { font-size: 9px; color: rgba(255,255,255,.25); font-weight: 600; margin-top: 1px; }
.sug-total { background: rgba(232,93,0,.1); border: 1px solid rgba(232,93,0,.2); border-radius: 11px; padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; }
.sug-total-title { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .06em; }
.sug-total-vals { font-size: 11px; font-weight: 700; color: #FF7A20; font-family: monospace; }
.sug-actions { display: flex; align-items: center; justify-content: center; padding-top: 2px; }
.sug-regen-btn { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.4); cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 20px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); transition: all .15s; }
.sug-regen-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.sug-regen-btn:disabled { opacity: .3; cursor: not-allowed; }
.sug-regen-icon { transition: transform .3s; }
.sug-regen-btn:not(:disabled):hover .sug-regen-icon { transform: rotate(180deg); }
.sug-rate-msg { font-size: 10px; font-weight: 600; color: rgba(255,165,0,.8); text-align: center; padding: 3px 0; }
.sug-stale { background: rgba(245,158,11,.15); border: 1px solid rgba(245,158,11,.3); border-radius: 9px; padding: 7px 10px; font-size: 10px; font-weight: 700; color: #FCD34D; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sug-stale-btn { cursor: pointer; color: #FCD34D; text-decoration: underline; background: none; border: none; font-size: 10px; font-weight: 700; padding: 0; }
.sug-nogoal, .sug-exceeded { padding: 20px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: sugFadeUp .3s ease forwards; }
.sug-nogoal-icon { font-size: 24px; }
.sug-nogoal-text, .sug-exceeded-text { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.5); line-height: 1.5; }
.sug-exceeded-chips { display: flex; gap: 7px; }
.sug-exceeded-chip { font-size: 11px; font-weight: 700; padding: 7px 12px; border-radius: 20px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.6); cursor: pointer; transition: all .15s; }
.sug-exceeded-chip:hover { background: rgba(255,255,255,.13); color: #fff; }
.sug-overcap { display: none; }
@keyframes sugFadeUp { from{opacity:0;transform:translateY(8px);} to{opacity:1;transform:translateY(0);} }
