/* STATS ROW */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.stat-box {
  background: var(--white);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-num {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-num.positive { color: var(--gold); }
.stat-num.negative { color: var(--red-soft); }
.stat-desc { font-size: 11px; color: var(--text-light); font-weight: 500; letter-spacing: 0.05em; }

/* CHART */
.chart-container {
  background: var(--white);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.chart-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 16px;
}
.chart-wrap { position: relative; height: 160px; }
canvas { width: 100% !important; }

/* STREAK */
.streak-bar {
  background: var(--white);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}
.streak-fire { font-size: 28px; }
.streak-info { flex: 1; }
.streak-num {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}
.streak-label { font-size: 13px; color: var(--text-mid); }

/* CALENDAR GRID */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.cal-day {
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  min-height: 64px;
  background: var(--cream-dark);
  color: var(--text-light);
  position: relative;
}
.cal-day-date { font-size: 10px; font-weight: 400; color: var(--text-light); line-height: 1.2; }
.cal-day-pct  { font-size: 8px; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.cal-day.logged { background: var(--gold-light); color: var(--gold); }
.cal-day.logged.lvl-top  { background: #e6f4ea; color: #276f38; }
.cal-day.logged.lvl-ok   { background: #fff8e1; color: #9a7000; }
.cal-day.logged.lvl-low  { background: #fff0e0; color: #b85c00; }
.cal-day.logged.lvl-miss { background: #fdecea; color: #b0332a; }
.cal-day.today  { background: var(--gold); color: #fff; font-weight: 600; }
.cal-day.today .cal-day-date { color: rgba(255,255,255,0.8); }
.cal-day.today .cal-day-pct  { color: #fff; }
.cal-day.future { opacity: 0.4; }
.cal-day.mess { box-shadow: inset 0 -3px 0 var(--gold); }
.cal-day.mess.logged.lvl-top  { box-shadow: inset 0 -3px 0 #276f38; }
.cal-day.mess.logged.lvl-ok   { box-shadow: inset 0 -3px 0 #9a7000; }
.cal-day.mess.logged.lvl-low  { box-shadow: inset 0 -3px 0 #b85c00; }
.cal-day.mess.logged.lvl-miss { box-shadow: inset 0 -3px 0 #b0332a; }
.cal-day.mess.today  { box-shadow: inset 0 -3px 0 rgba(255,255,255,0.55); }
.cal-day.logged { cursor: pointer; }
.cal-day.clickable { cursor: pointer; transition: opacity 0.15s, transform 0.1s; }
.cal-day.clickable:hover { opacity: 0.75; transform: scale(1.05); }

/* CALENDAR LEGEND */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-light);
}
.cal-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.cal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.cal-mess-stripe { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--gold); flex-shrink: 0; }

/* MEAL STATS */
.meal-stats { }
.stat-rule {
  padding: 11px 0;
  border-bottom: 1px solid var(--cream-dark);
}
.stat-rule:first-child { padding-top: 0; }
.stat-rule:last-child  { border-bottom: none; padding-bottom: 0; }
.stat-rule-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.stat-rule-label {
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
}
.stat-rule-count {
  flex-shrink: 0;
  margin-left: 10px;
  line-height: 1;
}
.stat-rule-count strong {
  font-size: 20px;
  font-weight: 600;
  font-family: 'Instrument Sans', sans-serif;
}
.stat-rule-of {
  font-size: 12px;
  color: var(--text-light);
}
.stat-rule-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: 5px;
  vertical-align: middle;
}
.stat-rule-bar {
  height: 5px;
  background: var(--cream-dark);
  border-radius: 99px;
  overflow: hidden;
}
.stat-rule-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}
/* Level colours — shared with log list */
.stat-lvl-top  { color: #276f38; }
.stat-lvl-ok   { color: #9a7000; }
.stat-lvl-low  { color: #b85c00; }
.stat-lvl-miss { color: #b0332a; }
.stat-rule-fill.stat-lvl-top  { background: #276f38; }
.stat-rule-fill.stat-lvl-ok   { background: #9a7000; }
.stat-rule-fill.stat-lvl-low  { background: #b85c00; }
.stat-rule-fill.stat-lvl-miss { background: #b0332a; }
.stat-rule-badge.stat-lvl-top  { background: #e6f4ea; }
.stat-rule-badge.stat-lvl-ok   { background: #fff8e1; }
.stat-rule-badge.stat-lvl-low  { background: #fff0e0; }
.stat-rule-badge.stat-lvl-miss { background: #fdecea; }

/* LOG LIST */
.log-entry {
  background: var(--white);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.log-day-badge {
  width: 44px; height: 44px;
  background: var(--gold-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--gold);
}
.log-day-badge.lvl-top  { background: #e6f4ea; color: #276f38; }
.log-day-badge.lvl-ok   { background: #fff8e1; color: #9a7000; }
.log-day-badge.lvl-low  { background: #fff0e0; color: #b85c00; }
.log-day-badge.lvl-miss { background: #fdecea; color: #b0332a; }
.log-info { flex: 1; min-width: 0; }
.log-date  { font-size: 11px; color: var(--text-light); margin-bottom: 3px; }
.log-weight { font-size: 15px; font-weight: 500; color: var(--text); display: flex; align-items: baseline; gap: 6px; }
.log-score  { font-size: 11px; color: var(--text-light); font-weight: 400; }
.log-note-hint { font-size: 11px; color: var(--text-light); }
.log-msg { font-size: 12px; margin-top: 4px; font-style: italic; line-height: 1.4; }
.log-msg.lvl-top  { color: #276f38; }
.log-msg.lvl-ok   { color: #9a7000; }
.log-msg.lvl-low  { color: #b85c00; }
.log-msg.lvl-miss { color: #b0332a; }
.log-chevron { color: var(--text-light); font-size: 20px; padding-right: 2px; line-height: 1; flex-shrink: 0; }
.log-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.7;
}
.log-empty-icon { font-size: 40px; margin-bottom: 12px; }
.log-entry.clickable { cursor: pointer; transition: background 0.15s; }
.log-entry.clickable:hover { background: var(--cream-dark); }

/* PHOTO SLIDER */
.photo-slider-wrap { text-align: center; }
.slider-photo-container {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 320px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--cream-dark);
  margin-bottom: 10px;
}
.slider-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slider-photo-label {
  font-size: 13px;
  color: var(--text-mid);
  font-weight: 500;
  margin-bottom: 10px;
}
#slider-photo-range {
  width: 100%;
  accent-color: var(--gold);
  margin-bottom: 6px;
}
.slider-photo-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.slider-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--gold-light);
  color: var(--gold);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: opacity 0.15s;
}
.slider-nav-btn:disabled { opacity: 0.3; cursor: default; }
.slider-photo-counter {
  font-size: 13px;
  color: var(--text-light);
  min-width: 44px;
  text-align: center;
}
