* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --panel-bg: linear-gradient(90deg, #0F1526, #1a1a2e);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #000000;
  color: #e0e0e0;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.header {
  background: var(--panel-bg);
  padding: 10px 10px 8px;
  text-align: left;
  border-bottom: 2px solid #ff6b35;
  position: relative;
  flex-shrink: 0;
  z-index: 100;
}
.header h1 {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(90deg, #ff6b35, #f7c948);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 3px;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-sub-label {
  font-size: 10px;
  color: #4ade80;
  font-weight: 700;
  text-align: left;
  margin-top: 2px;
}
.goal-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 6px;
}
@keyframes goalPulse {
  0%, 100% { box-shadow: 0 0 4px #ff6b35; border-color: #ff6b35; }
  50% { box-shadow: 0 0 16px 4px #ff6b35, 0 0 30px 2px #f7c948; border-color: #f7c948; }
}
@keyframes kcalDetectedGlow {
  0%, 100% { box-shadow: 0 0 4px #ff6b35; border-color: #ff6b35; }
  50% { box-shadow: 0 0 16px 4px #ff6b35, 0 0 30px 2px #f7c948; border-color: #f7c948; }
}
@keyframes collagePulse {
  0%, 100% { box-shadow: 0 0 4px #e91e63; border-color: #e91e63; }
  50% { box-shadow: 0 0 16px 4px #e91e63, 0 0 30px 2px #f48fb1; border-color: #f48fb1; }
}
@keyframes textPulse {
  0%, 100% { box-shadow: 0 0 4px #f7c948; border-color: #f7c948; }
  50% { box-shadow: 0 0 16px 4px #f7c948, 0 0 30px 2px #eab308; border-color: #eab308; }
}
#loginBtn {
  animation: loginPulse 3.5s ease-in-out infinite;
}
@keyframes loginPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(99,102,241,0.6); }
  50% { box-shadow: 0 0 16px 4px rgba(168,85,247,0.7), 0 0 30px 2px rgba(99,102,241,0.5); }
}

/* GOAL + SPORT KCAL ROW (between meals and progress bar) */
.goal-sport-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  margin-top: 10px;
  padding-top: 6px;
  margin-bottom: 0;
  gap: 12px;
}
.goal-sport-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.goal-sport-item input {
  width: 80px;
  padding: 5px 8px;
  border: 2px solid #ff6b35;
  border-radius: 8px;
  background: #1a1a2e;
  color: #f7c948;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: box-shadow 0.3s;
  animation: goalPulse 3.5s ease-in-out infinite;
}
.goal-sport-item input:focus { border-color: #f7c948; animation: none; box-shadow: 0 0 8px #f7c948; }
.goal-sport-item .goal-label {
  font-size: 13px;
  color: #ff6b35;
  font-weight: 600;
  margin-top: 3px;
}
.goal-sport-item.sport-item input {
  border-color: #6366f1;
  animation: loginPulse 3.5s ease-in-out infinite;
}
.goal-sport-item.sport-item .goal-label {
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(90deg, #a855f7, #6366f1, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.goal-sport-item input[readonly] {
  border-color: rgba(255,107,53,0.35);
  background: rgba(28, 19, 38, 0.9);
  color: rgba(247,201,72,0.7);
  animation: none;
  box-shadow: none;
}
.goal-sport-item.sport-item input[readonly] {
  border-color: rgba(99,102,241,0.35);
  background: rgba(18, 18, 41, 0.95);
  color: rgba(168,85,247,0.7);
}
.goal-sport-item input[readonly]:focus {
  border-color: rgba(255,107,53,0.5);
  box-shadow: none;
}
.goal-sport-item.sport-item input[readonly]:focus {
  border-color: rgba(99,102,241,0.5);
}
.goal-sport-item input[readonly] + .goal-label {
  color: rgba(255,107,53,0.65);
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: rgba(255,107,53,0.65);
}
.goal-sport-item.sport-item input[readonly] + .goal-label {
  color: rgba(168,85,247,0.75);
  -webkit-text-fill-color: rgba(168,85,247,0.75);
}
.calorie-info-btn:disabled,
.sport-expand-btn.past-day {
  opacity: 0.65;
  border-color: rgba(255,107,53,0.45);
  color: rgba(255,107,53,0.65);
  background: rgba(0,0,0,0.12);
  text-shadow: none;
}
.sport-expand-btn.past-day {
  border-color: rgba(99,102,241,0.45);
  color: rgba(168,85,247,0.65);
}
.sport-expand-btn.past-day {
  -webkit-background-clip: initial;
  -webkit-text-fill-color: #777;
}
@keyframes sportPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(99,102,241,0.6); border-color: #6366f1; }
  50% { box-shadow: 0 0 16px 4px rgba(168,85,247,0.7), 0 0 30px 2px rgba(99,102,241,0.5); border-color: #a855f7; }
}
.sport-expand-btn {
  padding: 5px 14px;
  border: 1.5px solid #6366f1;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg,#a855f7,#6366f1,#3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: loginPulse 3.5s ease-in-out infinite;
}
.sport-expand-btn:active { opacity: 0.7; }

.sport-expand-btn.foto-info-btn {
  width: 24px;
  height: 24px;
  padding: 0;

  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 20px;
  font-weight: 800;

  /* anulamos el efecto texto degradado SOLO en este botón */
  -webkit-background-clip: initial;
  -webkit-text-fill-color: #a855f7;

  background: transparent;
  border: 2px solid #6366f1;
}
.sport-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.sport-modal-overlay.active { display: flex; }
.sport-modal {
  background: #1a1a2e;
  border-radius: 16px;
  padding: 24px 16px 20px;
  max-width: 400px;
  width: 92%;
  position: relative;
  border: 2px solid #6366f1;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 30px rgba(99,102,241,0.3);
}
.sport-modal-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: 1.5px;
  background: linear-gradient(90deg, #a855f7, #6366f1, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}
.sport-modal .modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #888;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

/* CALORIE INFO BUTTON */
.calorie-info-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ff6b35;
  background: transparent;
  color: #ff6b35;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
  animation: goalPulse 3.5s ease-in-out infinite;
}
.calorie-info-btn:active { background: #ff6b35; color: #fff; }

/* CALORIE MODAL */
.calorie-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.calorie-modal-overlay.active { display: flex; }
.calorie-modal {
  background: #1a1a2e;
  border-radius: 16px;
  padding: 24px 20px;
  max-width: 370px;
  width: 92%;
  position: relative;
  border: 2px solid #ff6b35;
  max-height: 90vh;
  overflow-y: auto;
}
.calorie-modal label {
  display: block;
  font-size: 13px;
  color: #ccc;
  margin-bottom: 4px;
  margin-top: 12px;
  font-weight: 600;
}
.calorie-modal input,
.calorie-modal select,
.calorie-modal textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid #333;
  background: #0d0d1a;
  color: #e0e0e0;
  font-size: 14px;
  outline: none;
}
.calorie-modal input:focus,
.calorie-modal select:focus,
.calorie-modal textarea:focus {
  border-color: #ff6b35;
}
.calorie-modal textarea {
  resize: vertical;
  min-height: 60px;
}
.calorie-modal .section-title {
  font-size: 13px;
  font-weight: 700;
  color: #f7c948;
  margin-top: 16px;
  margin-bottom: 4px;
}
.calorie-modal .calc-btn {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #ff6b35 0%, #f7c948 50%, #ff8c42 100%);
  color: #0f0f1a;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
  text-shadow: 0 1px 1px rgba(255,255,255,0.2);
}
.calorie-modal .calc-btn.loading {
  color: transparent;
  position: relative;
  pointer-events: none;
}
.calorie-modal .calc-btn.loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2.5px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  top: 50%; left: 50%;
  margin: -9px 0 0 -9px;
  animation: spin 0.8s linear infinite;
}
.calorie-modal .calc-result {
  margin-top: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #4ade80;
  min-height: 0;
}

/* NAV ARROWS */
.nav-btn {
  background: none;
  border: 2px solid #333;
  color: #888;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.nav-btn:active { background: #ff6b35; border-color: #ff6b35; color: #fff; }

/* CAROUSEL */
.carousel-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.carousel {
  display: flex;
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  height: 100%;
}

/* DAY COLUMN */
.day-column {
  min-width: 100%;
  padding: 18px 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}
.day-header {
  text-align: center;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
}
.day-header .date-block {
  text-align: center;
}
.day-header .date {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.day-header .weekday {
  font-size: 14px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 2px;
}
.day-header .today-badge {
  display: inline-block;
  background: #ff6b35;
  color: #fff;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  margin-top: 4px;
  font-weight: 600;
}
.header-video {
  width: 85px;
  height: 85px;
  border-radius: 10px;
  object-fit: contain;
  position: absolute;
  left: -100px;
  top: 50%;
  transform: translateY(-50%);
}
.header-video.nogoal {
  width: 80px;
  height: 80px;
  left: -95px;
}
.header-video.fit-comida {
  width: 85px;
  height: 85px;
}
.header-video.fit-tarde {
  width: 85px;
  height: 85px;
}
.header-video.fit-noche {
  width: 85px;
  height: 85px;
}
.header-video-right {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: contain;
  position: absolute;
  right: -95px;
  top: 50%;
  transform: translateY(-50%);
}
.header-video-right.reta-happy {
  width: 95px;
  height: 95px;
}
.header-video-right.reta-comida {
  width: 90px;
  height: 90px;
}
.header-video-right.reta-fail {
  width: 95px;
  height: 95px;
}
.header-video-right.reta-tarde {
  width: 90px;
  height: 90px;
}
.header-video-right.reta-noche {
  width: 90px;
  height: 90px;
}
.header-video.fit-fail {
  width: 90px;
  height: 90px;
}

/* MEAL BLOCK */
.meal-block {
  width: 100%;
  max-width: 400px;
  margin-bottom: 10px;
}
.meal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.meal-label {
  font-size: 14px;
  color: #666;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.meal-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #343450;
  border-radius: 10px;
  background: #242442;
  transition: border-color 0.2s;
}
.meal-input-wrap:focus-within { border-color: #ff6b35; }
.meal-input-wrap.disabled { opacity: 0.55; }
.meal-input-wrap.kcal-detected-glow {
  animation: kcalDetectedGlow 1.4s ease-in-out 1;
}
.meal-input {
  flex: 1;
  padding: 10px 4px 10px 12px;
  border: none;
  background: transparent;
  color: #f7c948;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  outline: none;
  width: 0;
}
.meal-input:disabled { cursor: not-allowed; }
.meal-input::placeholder { color: #444; font-weight: 400; font-size: 14px; }
.meal-unit {
  color: #555;
  font-size: 12px;
  font-weight: 600;
  padding-right: 10px;
  flex-shrink: 0;
}
.meal-prot {
  font-size: 12px;
  color: #ccc;
  margin-top: 2px;
  margin-left: 28px;
  min-height: 14px;
  font-weight: 600;
}
.meal-desc {
  font-size: 13px;
  color: #fff;
  margin-top: 1px;
  margin-left: 28px;
  min-height: 14px;
  font-weight: 400;
}
.past-day .meal-desc,
.past-day .meal-prot {
  opacity: 0.55;
}
.past-day .day-total {
  opacity: 0.6;
}

.foto-btn {
  padding: 10px 12px;
  border: 2px solid #6366f1;
  border-radius: 10px;
  background: #242442;
  color: #f7c948;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  position: relative;
  overflow: visible;
  box-shadow: 0 0 10px 2px rgba(168,85,247,0.5), 0 0 20px 1px rgba(99,102,241,0.3);
}
.foto-btn:active { background: #ff6b35; color: #fff; border-color: #ff6b35; }
.foto-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #2e2e44;
  box-shadow: none;
}
.foto-btn.last-attempt {
  border-style: dashed;
}
.foto-btn.loading { color: transparent; opacity: 1 !important; border-color: #6366f1 !important; border-style: solid !important; }
.foto-btn.loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid #f7c948;
  border-top-color: transparent;
  border-radius: 50%;
  top: 50%; left: 50%;
  margin: -8px 0 0 -8px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* TOTAL */
.day-total {
  margin-top: 0;
  padding: 0;
  text-align: center;
  width: 100%;
  max-width: 400px;
}
.day-total .total-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 2px;
}
.day-total .total-value {
  font-size: 34px;
  font-weight: 800;
  transition: color 0.3s;
}
.day-total .total-value.ok { color: #2ecc71; }
.day-total .total-value.over { color: #e74c3c; }
.day-total .total-progress {
  width: 100%;
  height: 6px;
  background: #6b4d3f;
  border-radius: 3px;
  margin-top: 4px;
  overflow: visible;
  position: relative;
}
.day-total .total-progress-sport {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  background: #3b3c66;
  border-radius: 0 3px 3px 0;
  transition: width 0.4s ease;
}
.day-total .total-progress-bar {
  height: 100%;
  background: #2ecc71;
  border-radius: 3px;
  transition: width 0.4s ease;
  position: relative;
  overflow: visible;
}
.day-total .total-progress-bar::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #2ecc71 60%);
  animation: progressPulse 1.5s ease-in-out infinite;
}
.day-total .total-progress-bar.over {
  background: #e74c3c;
}
.day-total .total-progress-bar.over::after {
  background: radial-gradient(circle, #fff 0%, #e74c3c 60%);
  animation: none;
}
@keyframes progressPulse {
  0%, 100% { box-shadow: 0 0 12px 6px rgba(46,204,113,0.7), 0 0 4px 2px rgba(255,255,255,0.5); }
  50% { box-shadow: 0 0 28px 14px rgba(46,204,113,0.95), 0 0 8px 4px rgba(255,255,255,0.7); }
}
.day-total .macros-table {
  width: 100%;
  margin-top: 6px;
  background: #2a2a2a;
  border-radius: 8px;
  padding: 8px 6px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px 4px;
  text-align: center;
}
.macros-table .macro-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.macros-table .macro-value {
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
}
.macro-prot { color: #f7c948; }
.macro-carbs { color: #3b82f6; }
.macro-sugar { color: #f472b6; }
.macro-fat { color: #fb923c; }
.macro-fiber { color: #34d399; }
.macro-zero { color: #555; }
.macros-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  margin-top: 4px;
  background: #333;
}
.macros-bar-segment {
  height: 100%;
  transition: width 0.4s ease;
}
.macros-bar-segment.seg-prot { background: #f7c948; }
.macros-bar-segment.seg-carbs { background: #3b82f6; }
.macros-bar-segment.seg-sugar { background: #f472b6; }
.macros-bar-segment.seg-fat { background: #fb923c; }
.macros-bar-segment.seg-fiber { background: #34d399; }
.day-total .total-sub {
  font-size: 13px;
  color: #666;
  margin-top: 2px;
  font-weight: 700;
}
.day-total .month-streak {
  font-size: 13px;
  color: #aaa;
  margin-top: 6px;
  font-weight: 600;
}

/* EXERCISE PANEL */
.exercise-panel {
  width: 100%;
  max-width: 400px;
  margin-top: 14px;
  padding: 0 4px;
}
.exercise-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-align: center;
  background: linear-gradient(90deg, #a855f7, #6366f1, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
.exercise-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  border-radius: 8px;
  border: 2px solid #4a4a6a;
  background: #242442;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 0 4px rgba(168, 85, 247, 0.15);
}
.exercise-box .ex-icon {
  font-size: 16px;
  margin-bottom: 2px;
}
.exercise-box .ex-label {
  font-size: 11px;
  color: #aab;
  font-weight: 600;
  text-transform: uppercase;
}
.exercise-box.active {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.22);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.5), 0 0 20px rgba(46, 204, 113, 0.25);
}
.exercise-box.active .ex-label {
  color: #2ecc71;
}
.exercise-box.faded, .cardio-box.faded {
  opacity: 0.7;
  filter: saturate(0.6) brightness(1.1);
  border-color: #333;
  box-shadow: none;
}
.exercise-panel.sport-tenue .exercise-title,
.cardio-panel.sport-tenue .cardio-title {
  opacity: 0.4;
}
.exercise-panel.sport-tenue .exercise-box,
.cardio-panel.sport-tenue .cardio-box {
  opacity: 0.35;
  pointer-events: none;
}
.exercise-panel.sport-tenue .exercise-box.active,
.cardio-panel.sport-tenue .cardio-box.active {
  opacity: 0.45;
}
.exercise-panel.sport-tenue .sport-premium-overlay,
.cardio-panel.sport-tenue .sport-premium-overlay {
  opacity: 0.3;
}
.sport-grid-wrapper {
  position: relative;
}
.sport-premium-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: linear-gradient(90deg,#a855f7,#6366f1,#3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  pointer-events: none;
  margin-top: 4px;
}
.sport-premium-overlay.overlay-right {
  width: 50%;
  margin-left: 50%;
}
.sport-premium-overlay.overlay-mid {
  width: 50%;
  margin-left: 16.66%;
}

/* CARDIO PANEL */
.cardio-panel {
  width: 100%;
  max-width: 400px;
  margin-top: 10px;
  padding: 0 4px;
}
.cardio-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-align: center;
  background: linear-gradient(90deg, #a855f7, #6366f1, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cardio-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
.cardio-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  border-radius: 8px;
  border: 2px solid #4a4a6a;
  background: #242442;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  font-size: 13px;
  color: #aab;
  font-weight: 700;
  min-height: 45px;
  box-shadow: 0 0 4px rgba(168, 85, 247, 0.15);
}
.cardio-box.active {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.22);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.5), 0 0 20px rgba(46, 204, 113, 0.25);
  color: #2ecc71;
}

/* SPORT KCAL SECTION */
.sport-minutes-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  justify-content: flex-start;
}
.sport-minutes-row label {
  font-size: 12px;
  color: #aab;
  font-weight: 600;
}
.sport-minutes-input {
  width: 70px;
  padding: 6px 8px;
  border: 2px solid #4a4a6a;
  border-radius: 8px;
  background: #242442;
  color: #f7c948;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}
.sport-minutes-input:focus { border-color: #a855f7; }
.sport-minutes-input::placeholder { color: #444; font-weight: 400; font-size: 12px; }
.sport-weight-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-start;
}
.sport-weight-input {
  width: 70px;
  padding: 6px 8px;
  border: 2px solid #4a4a6a;
  border-radius: 8px;
  background: #242442;
  color: #f7c948;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}
.sport-weight-input:focus { border-color: #a855f7; }
.sport-weight-input::placeholder { color: #444; font-weight: 400; font-size: 12px; }
.sport-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-start;
}
.sport-select {
  width: 170px;
  padding: 7px 10px;
  border: 2px solid #4a4a6a;
  border-radius: 8px;
  background: #242442;
  color: #f7c948;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
  cursor: pointer;
}
.sport-select:focus { border-color: #a855f7; }
.sport-kcal-title {
  font-size: 14px;
  color: #a855f7;
  font-weight: 700;
  margin-top: 14px;
  letter-spacing: 0.5px;
  text-align: center;
}
.sport-kcal-box {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  gap: 6px;
}
.sport-kcal-value {
  width: 100px;
  padding: 6px 8px;
  border: 1.5px solid #6366f1;
  border-radius: 8px;
  background: transparent;
  color: #f7c948;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  outline: none;
  pointer-events: none;
  animation: loginPulse 3.5s ease-in-out infinite;
}
.sport-kcal-unit {
  font-size: 12px;
  color: #a855f7;
  font-weight: 600;
}
.sport-include-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 16px;
  justify-content: center;
}
.sport-include-row label {
  font-size: 12px;
  color: #aab;
  font-weight: 600;
  cursor: pointer;
}
.sport-include-check {
  width: 18px;
  height: 18px;
  accent-color: #a855f7;
  cursor: pointer;
}

/* MINI CALENDAR */
.mini-cal-cardio-dot {
  position: absolute;
  bottom: 0px;
  right: -1px;
  font-size: 9px;
  line-height: 1;
  animation: cardioGlow 1.5s ease-in-out infinite;
}
@keyframes cardioGlow {
  0%, 100% { filter: drop-shadow(0 0 2px #a855f7) drop-shadow(0 0 4px #a855f7); }
  50% { filter: drop-shadow(0 0 5px #a855f7) drop-shadow(0 0 10px #a855f7); }
}
@keyframes gymGlow {
  0%, 100% { filter: drop-shadow(0 0 2px #a855f7) drop-shadow(0 0 4px #a855f7); }
  50% { filter: drop-shadow(0 0 5px #a855f7) drop-shadow(0 0 10px #a855f7); }
}
.mini-cal-gym-dot {
  position: absolute;
  top: -2px;
  right: -1px;
  font-size: 9px;
  line-height: 1;
  animation: gymGlow 1.5s ease-in-out infinite;
}
.mini-cal {
  width: 100%;
  max-width: 400px;
  margin-top: 32px;
  padding: 0 4px;
}
.mini-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 3px;
}
.mini-cal-weekdays span {
  text-align: center;
  font-size: 10px;
  color: #555;
  font-weight: 700;
  text-transform: uppercase;
}
.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.mini-cal-cell {
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  position: relative;
}
.mini-cal-cell.empty { background: transparent; }
.mini-cal-cell.gray { background: #2a2a2a; color: #444; }
.mini-cal-cell.green { background: #1a6b3a; color: #8eff8e; }
.mini-cal-cell.red { background: #6b1a1a; color: #ff8e8e; }
.mini-cal-cell.today-cell { outline: 2px solid #ff6b35; outline-offset: -1px; }
.mini-cal-cell .cell-kcal {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* ADMIN MINI CALENDAR */
.admin-mini-cal {
  width: 100%;
  margin-top: 12px;
  padding: 0 4px;
}
.admin-mini-cal .mini-cal-cell.admin-yellow { background: #5c4a00; color: #fbbf24; }
.admin-mini-cal .mini-cal-cell.admin-purple { background: #3b1f6e; color: #c084fc; }
.admin-mini-cal .mini-cal-cell.today-cell { outline: 2px solid #a855f7; outline-offset: -1px; }
.admin-mini-cal .cell-premium {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: #fbbf24;
}
.admin-mini-cal .cell-queries {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: #c084fc;
}

/* HIDDEN FILE INPUT */
.hidden-file { display: none; }

/* COMMUNITY PANEL */
.community-separator {
  width: 100%;
  max-width: 400px;
  height: 1px;
  background: #f7c948;
  border: none;
  margin-top: 92px;
  margin-bottom: 10px;
  border-radius: 1px;
  box-shadow: 0 0 8px 2px rgba(247,201,72,0.7), 0 0 16px 4px rgba(247,201,72,0.4);
}
.community-separator-bottom {
  margin-top: 2px;
  margin-bottom: 22px;
}
.community-title {
  font-size: 19px;
  font-weight: 800;
  margin-top: 2px;
  margin-bottom: 0;
  letter-spacing: 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 400px;
  width: 100%;
}
.community-title > span {
  color: #f7c948;
  text-transform: uppercase;
  font-style: normal;
  text-shadow: 0 0 8px rgba(247,201,72,1), 0 0 16px rgba(255,107,53,0.7), 0 0 28px rgba(247,201,72,0.5), 0 0 40px rgba(255,107,53,0.3);
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.community-panel {
  width: 100%;
  max-width: 400px;
  background: #2a2a2a;
  border-radius: 10px;
  padding: 4px 12px;
  border: none;
  box-shadow: none;
}
.community-list {
  min-height: 260px;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #888 #2a2a2a;
}
.community-list::-webkit-scrollbar {
  width: 5px;
}
.community-list::-webkit-scrollbar-track {
  background: #2a2a2a;
  border-radius: 3px;
}
.community-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}
.community-item {
  padding: 6px 0;
  border-bottom: 1px solid #2a2a2a;
}
.community-item:last-child {
  border-bottom: none;
}
.community-item-new {
  animation: communitySlideIn 0.4s ease-out;
}
@keyframes communitySlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.community-item-header {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.community-item-time {
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg,#a855f7,#6366f1,#3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.community-item-kcal {
  color: #f7c948;
  font-weight: 700;
  font-size: 13px;
}
.community-item-desc {
  font-size: 13px;
  color: #fff;
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.4;
}
/* TOP MEAL PANEL */
.community-top-meal {
  width: 100%;
  max-width: 400px;
  background: #2a2a2a;
  border: 2px solid #6366f1;
  border-radius: 8px;
  padding: 4px 12px 4px 12px;
  text-align: left;
  box-shadow: 0 0 8px 2px rgba(168,85,247,0.5), 0 0 16px 2px rgba(99,102,241,0.25);
  position: relative;
  margin-top: 4px;
}
.community-top-meal-badge {
  position: absolute;
  top: -8px;
  left: -6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #6366f1;
  border-radius: 10px;
  padding: 2px 6px;
  box-shadow: 0 0 6px rgba(99,102,241,0.6);
  white-space: nowrap;
}
.community-top-meal-desc {
  font-size: 13px;
  color: #e0e0e0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.community-top-meal-kcal {
  color: #f7c948;
  font-weight: 700;
  font-size: 13px;
  margin-left: 4px;
}

/* FRIENDS PANEL */
.friends-panel {
  width: 100%;
  max-width: 400px;
  background: #2a2a2a;
  border-radius: 10px;
  padding: 4px 12px;
  border: none;
  box-shadow: none;
  margin-top: 18px;
  min-height: 180px;
  overflow: visible;
  position: relative;
}
.friends-list {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #888 #2a2a2a;
}
.friends-list::-webkit-scrollbar {
  width: 5px;
}
.friends-list::-webkit-scrollbar-track {
  background: #2a2a2a;
  border-radius: 3px;
}
.friends-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}
.friends-panel-badge {
  position: absolute;
  top: -10px;
  left: -6px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 12px;
  padding: 3px 10px;
  box-shadow: 0 0 8px rgba(99,102,241,0.7), 0 0 16px rgba(168,85,247,0.4);
  white-space: nowrap;
  letter-spacing: 1px;
}
.friend-entry {
  padding: 6px 0 10px;
  border-bottom: 1px solid #3a3a3a;
}
.friend-entry:last-child { border-bottom: none; }
.friend-entry[data-accept] { cursor: pointer; }
.friend-entry-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.friend-status-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #555;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  cursor: pointer;
}
.friend-status-box.green {
  background: #2ecc71;
  border-color: #2ecc71;
}
.friend-status-box.white {
  background: #fff;
  border-color: #888;
}
.friend-name {
  font-weight: 700;
  font-size: 14px;
  background: linear-gradient(90deg,#a855f7,#6366f1,#3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.friend-label-tu {
  font-size: 13px;
  color: #aaa;
  font-weight: 600;
}
.friend-delete-btn {
  margin-left: auto;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #e74c3c;
  opacity: 0.8;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 2px;
}
.friend-delete-btn:hover { opacity: 1; }
.friend-progress {
  height: 4px;
  width: 100%;
  background: #1a1a2e;
  border-radius: 2px;
  margin-top: 4px;
  overflow: visible;
  position: relative;
}
.friend-progress-bar {
  height: 100%;
  background: #2ecc71;
  border-radius: 2px;
  transition: width 0.4s ease;
  position: relative;
  box-shadow: 2px 0 8px 2px rgba(46,204,113,0.8), 4px 0 16px 4px rgba(46,204,113,0.5);
}
.friend-progress-bar.over {
  background: #e74c3c;
  box-shadow: 2px 0 8px 2px rgba(231,76,60,0.8), 4px 0 16px 4px rgba(231,76,60,0.5);
}
.friend-progress-label {
  position: absolute;
  right: 0;
  top: 0px;
  font-size: 10px;
  font-weight: 700;
  color: #2ecc71;
}

/* FRIEND SEARCH */
.friend-search-panel {
  width: 100%;
  max-width: 400px;
  background: #2a2a2a;
  border-radius: 0 0 10px 10px;
  padding: 8px 12px;
  margin-top: 2px;
}
.friend-search-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.friend-search-input:focus {
  border-color: #6366f1;
}
.friend-search-input::placeholder {
  color: #666;
}
.friend-search-results {
  max-height: 120px;
  overflow-y: auto;
  margin-top: 6px;
}
.friend-search-item {
  padding: 6px 8px;
  font-size: 13px;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
}
.friend-search-item:hover {
  background: rgba(99,102,241,0.2);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #e74c3c;
  color: #fff;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  transition: transform 0.3s;
  white-space: normal;
  max-width: calc(100vw - 48px);
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: #2ecc71; }
.toast.error { background: #e74c3c; }
.toast.admin { background: #1e293b; color: #f97316; }

/* AUTH MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-box {
  background: var(--panel-bg);
  border: 2px solid #ff6b35;
  border-radius: 16px;
  padding: 28px 24px 22px;
  width: 90%;
  max-width: 360px;
  position: relative;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #666;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: #e74c3c; }
.modal-title {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(90deg, #ff6b35, #f7c948);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: 1px;
}
.modal-field {
  margin-bottom: 12px;
}
.modal-field label {
  display: block;
  font-size: 12px;
  color: #aaa;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.modal-field input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #2a2a3e;
  border-radius: 10px;
  background: #0f0f1a;
  color: #f7c948;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}
.modal-field input:focus { border-color: #ff6b35; }
.modal-field input::placeholder { color: #444; font-weight: 400; }
.modal-error {
  color: #e74c3c;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  min-height: 18px;
  margin-bottom: 6px;
}
.modal-success {
  color: #2ecc71;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  min-height: 18px;
  margin-bottom: 6px;
}
.modal-btn-primary {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #ff6b35, #f7c948);
  color: #0f0f1a;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity 0.2s;
}
.modal-btn-primary:active { opacity: 0.8; }
.modal-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}
.modal-link {
  background: none;
  border: none;
  color: #6366f1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.modal-link:hover { color: #a855f7; }

/* LOGGED-IN HEADER */
.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.user-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}
.user-label {
  font-size: 11px;
  color: #fff;
  font-weight: 600;
}
.user-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #a855f7, #6366f1, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}
.gear-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.2s;
}
.gear-btn:hover { color: #f7c948; }
.gear-menu {
  position: absolute;
  top: 32px;
  right: 0;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 2px solid #2a2a3e;
  border-radius: 10px;
  padding: 6px 0;
  min-width: 210px;
  z-index: 600;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.gear-menu.open { display: block; }
.gear-menu-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.gear-menu-item:hover { background: rgba(255,107,53,0.15); }
.gear-menu-item.danger { color: #e74c3c; }
.gear-menu-item.danger:hover { background: rgba(231,76,60,0.15); }

/* PAYMENT INFO BOX */
.payment-info-box {
  border: 2px solid #6366f1;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
  padding: 14px 16px;
  margin-bottom: 14px;
  text-align: center;
}
.payment-info-box .payment-title {
  font-size: 13px;
  color: #aaa;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.payment-info-box .payment-price {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(90deg, #a855f7, #6366f1, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}
.payment-info-box .payment-period {
  font-size: 12px;
  color: #888;
  font-weight: 600;
}
.payment-info-box .payment-features {
  font-size: 11px;
  color: #aaa;
  margin-top: 8px;
  line-height: 1.5;
  text-align: left;
}
.modal-btn-stripe {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #a855f7, #6366f1, #3b82f6);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity 0.2s;
  position: relative;
}
.modal-btn-stripe:active { opacity: 0.8; }
.modal-btn-stripe:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.modal-btn-stripe .stripe-icon {
  font-size: 13px;
  margin-right: 4px;
}

/* Hide PREMIUM tags when logged in */
body.logged-in .premium-tag { display: none !important; }

/* PHOTO TIPS INFO BUTTON */
.foto-info-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #6366f1;
  background: transparent;
  color: #a855f7;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
  animation: loginPulse 3.5s ease-in-out infinite;
}
.foto-info-btn:active { background: #6366f1; color: #fff; }
.tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tips-list li {
  padding: 10px 0;
  border-bottom: 1px solid #2a2a3e;
  font-size: 13px;
  color: #ccc;
  line-height: 1.5;
}
.tips-list li:last-child { border-bottom: none; }
.tips-list .tip-icon {
  font-size: 16px;
  margin-right: 8px;
}
.tips-list .tip-title {
  color: #f7c948;
  font-weight: 700;
}

/* CHAT SYSTEM */
.friend-chat-btn {
  cursor: pointer;
  font-size: 15px;
  margin-left: 6px;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
  position: relative;
}
.friend-chat-btn:hover { opacity: 1; transform: scale(1.15); }
.friend-chat-btn.unread {
  opacity: 1;
  animation: chatGlow 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 4px #2ecc71) drop-shadow(0 0 8px #2ecc71);
}
.friend-chat-btn.unread::before {
  content: '!';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 14px;
  height: 14px;
  background: #2ecc71;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(46,204,113,0.8);
}
@keyframes chatGlow {
  0%, 100% { filter: drop-shadow(0 0 4px #2ecc71) drop-shadow(0 0 8px #2ecc71); transform: scale(1); }
  50% { filter: drop-shadow(0 0 8px #2ecc71) drop-shadow(0 0 16px #2ecc71); transform: scale(1.15); }
}
.chat-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.chat-overlay.active { display: flex; }
.chat-modal {
  width: 92%;
  max-width: 380px;
  height: 70vh;
  max-height: 500px;
  background: #1a1a2e;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #333;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #16213e;
  border-bottom: 1px solid #333;
}
.chat-header-name {
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(90deg,#a855f7,#6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.chat-close-btn {
  cursor: pointer;
  font-size: 20px;
  color: #888;
  transition: color 0.2s;
}
.chat-close-btn:hover { color: #fff; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: #555 #1a1a2e;
}
.chat-msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}
.chat-msg.mine {
  align-self: flex-end;
  background: #6366f1;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.theirs {
  align-self: flex-start;
  background: #2a2a3e;
  color: #e0e0e0;
  border-bottom-left-radius: 4px;
}
.chat-msg-time {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-top: 3px;
}
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #16213e;
  border-top: 1px solid #333;
}
.chat-input {
  flex: 1;
  background: #0f0f23;
  border: 1px solid #444;
  border-radius: 20px;
  padding: 8px 14px;
  color: #e0e0e0;
  font-size: 13px;
  outline: none;
}
.chat-input:focus { border-color: #6366f1; }
.chat-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.chat-send-btn:active { transform: scale(0.9); }
.chat-counter {
  font-size: 11px;
  color: #888;
  text-align: center;
  padding: 2px 0;
}
.chat-empty {
  color: #555;
  font-size: 13px;
  text-align: center;
  margin: auto;
}

/* El contenedor del bocadillo */
.comic-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  margin-left: 60px;
  
  /* Degradado naranja: de naranja vivo a un naranja un poco más dorado/cálido */
  background: linear-gradient(135deg, #a0522d, #cc5500);
  
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  animation: bounceBubble 2s infinite ease-in-out;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Ajuste de la colita para que coincida con el nuevo color del degradado */
.comic-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -65px;
  border-width: 6px;
  border-style: solid;
  /* Usamos el color de la parte inferior del degradado para la flecha */
  border-color: #e67e22 transparent transparent transparent;
}

.comic-bubble-purple {
  position: absolute;
  bottom: 100%;
  left: 50%;
  /* -90% lo mueve mucho a la izquierda respecto al centro */
  transform: translateX(-65%) translateY(-10px); 
  
  background: linear-gradient(135deg, #4A2C1B, #371B4A); 
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  
  /* USA LA NUEVA ANIMACIÓN */
  animation: bouncePurple 2s infinite ease-in-out; 
  
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Colita morada */
.comic-bubble-purple::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  /* Aumenta este valor (positivo) para mover la colita a la derecha */
  margin-left: 15px; 
  border-width: 6px;
  border-style: solid;
  border-color: #371B4A transparent transparent transparent;
}

/* Animación sutil de rebote */
@keyframes bounceBubble {
  0%, 100% { transform: translateX(-50%) translateY(-10px); }
  50% { transform: translateX(-50%) translateY(-15px); }
}
/* Animación para el bocadillo MORADO (con más desplazamiento a la izquierda) */
@keyframes bouncePurple {
  0%, 100% { transform: translateX(-65%) translateY(-10px); }
  50% { transform: translateX(-65%) translateY(-15px); }
}

/* FIX: contenido cortado en móviles con pantalla grande / notch / alta resolución */

/* Safe area para iPhones con notch y móviles modernos */
body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* day-column: min-width + padding causaba desbordamiento horizontal */
.day-column {
  width: 100%;
  min-width: 100vw;
  padding-left: max(10px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
  overflow-x: hidden;
}

/* max-width relativo al viewport para evitar desbordamiento en pantallas pequeñas */
.meal-block,
.day-total,
.goal-sport-row,
.exercise-panel,
.cardio-panel,
.mini-cal,
.community-panel,
.community-title,
.friend-search-panel,
.community-top-meal {
  max-width: min(400px, 100vw - 20px);
}
