*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0a09;
  --surface: #1c1212;
  --surface2: #251818;
  --border: rgba(255,255,255,0.08);
  --accent: #ff7c4a;
  --accent2: #ff4d8f;
  --text: #f5eeee;
  --muted: #9e8080;
  --danger: #ff5f5f;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Bubbles ── */
.bubble {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.12;
  animation: drift 12s ease-in-out infinite;
}
.bubble:nth-child(1) { width: 500px; height: 500px; background: radial-gradient(circle, #ff4d8f, transparent); top: -150px; right: -100px; animation-delay: 0s; }
.bubble:nth-child(2) { width: 350px; height: 350px; background: radial-gradient(circle, #ff7c4a, transparent); bottom: -80px; left: -80px; animation-delay: -4s; }
.bubble:nth-child(3) { width: 200px; height: 200px; background: radial-gradient(circle, #ff4d8f, transparent); top: 40%; left: 20%; animation-delay: -8s; opacity: 0.06; }

/* ── Login ── */
#login-page {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
}

.login-card {
  text-align: center;
  z-index: 1;
  animation: popIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.platypus-wrap {
  margin-bottom: 1.5rem;
  animation: float 3.5s ease-in-out infinite;
  filter: drop-shadow(0 10px 30px rgba(255,77,143,0.35));
}

.logo {
  font-family: 'Nunito', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: white;
  color: #2a1a1a;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 2.2rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 30px rgba(255,124,74,0.25);
}
.google-btn:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 40px rgba(255,77,143,0.35); }
.google-btn svg { width: 20px; height: 20px; }

/* ── Dashboard ── */
#dashboard { display: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(28,18,18,0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-logo {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-platy { animation: wiggle 2.5s ease-in-out infinite; display: inline-block; }
.user-info { display: flex; align-items: center; gap: 0.75rem; }

.avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.85rem; font-family: 'Nunito', sans-serif;
  box-shadow: 0 2px 12px rgba(255,77,143,0.3);
}

.user-name { font-size: 0.9rem; font-weight: 600; }

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}
.logout-btn:hover { border-color: var(--danger); color: var(--danger); }

.main { max-width: 1100px; margin: 0 auto; padding: 2.5rem 2rem; }

/* ── Welcome Banner ── */
.welcome-banner {
  background: linear-gradient(135deg, var(--surface2) 0%, rgba(255,77,143,0.1) 100%);
  border: 1px solid rgba(255,124,74,0.15);
  border-radius: 24px;
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeUp 0.5s ease both;
  overflow: hidden;
  position: relative;
}
.welcome-banner::before {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(255,77,143,0.15), transparent);
  border-radius: 50%;
}
.welcome-text h2 { font-family: 'Nunito', sans-serif; font-size: 1.9rem; font-weight: 900; margin-bottom: 0.2rem; }
.welcome-text p { color: var(--muted); font-size: 0.95rem; }
.banner-platy { animation: float 3s ease-in-out infinite; }

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem 1.75rem;
  animation: fadeUp 0.5s ease both;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,124,74,0.08), transparent);
}
.stat-card:hover { border-color: rgba(255,124,74,0.35); transform: translateY(-3px); box-shadow: 0 8px 30px rgba(255,77,143,0.1); }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.16s; }
.stat-card:nth-child(4) { animation-delay: 0.24s; }

.stat-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.4rem; font-weight: 600; }
.stat-value { font-family: 'Nunito', sans-serif; font-size: 2.2rem; font-weight: 900; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-unit { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }

/* ── Shared card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem 2.5rem;
  margin-top: 1.5rem;
  animation: fadeUp 0.6s ease both;
}

.section-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
}

/* ── Shared field ── */
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }

.field input, .field select {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.field input:focus, .field select:focus { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(255,77,143,0.1); }
.field select option { background: var(--surface2); }

.save-btn {
  margin-top: 1.75rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  padding: 0.85rem 2.5rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(255,77,143,0.3);
}
.save-btn:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 8px 30px rgba(255,77,143,0.4); }
.save-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Profile ── */
.profile-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

/* ── Log Meal ── */
.log-form {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.photo-area { display: flex; flex-direction: column; gap: 0.75rem; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  overflow: hidden;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
}
.drop-zone-placeholder { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-align: center; padding: 1.5rem; color: var(--muted); }
.drop-zone-placeholder span { font-size: 2rem; }
.drop-zone-placeholder p { font-size: 0.8rem; }
#image-preview { width: 100%; max-height: 200px; object-fit: cover; display: none; }

.photo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.outline-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.6rem 0.75rem;
  border-radius: 100px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.outline-btn:hover { border-color: var(--accent2); background: rgba(255,77,143,0.07); }

.log-fields { display: flex; flex-direction: column; gap: 1rem; }
.macros-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }

/* ── Meals list ── */
.meals-grid { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }

.meal-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s;
}
.meal-card:hover { border-color: rgba(255,124,74,0.3); }

.meal-img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.meal-img-placeholder {
  width: 64px; height: 64px; border-radius: 12px;
  background: var(--surface); display: flex; align-items: center;
  justify-content: center; font-size: 1.5rem; flex-shrink: 0;
}
.meal-info { flex: 1; }
.meal-name-text { font-family: 'Nunito', sans-serif; font-weight: 700; margin-bottom: 0.3rem; }
.meal-macros { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.macro { font-size: 0.72rem; padding: 0.2rem 0.65rem; border-radius: 100px; background: var(--surface); }
.meal-date { font-size: 0.7rem; color: var(--muted); }
.meals-empty { color: var(--muted); text-align: center; padding: 2rem; font-size: 0.9rem; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem; right: 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  padding: 0.8rem 1.75rem;
  border-radius: 100px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(255,77,143,0.3);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Animations ── */
@keyframes drift { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(20px,-20px) scale(1.05); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

/* ── Nav ── */
.topbar-nav { display: flex; gap: 0.25rem; }
.nav-link {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--text); background: rgba(255,124,74,0.12); }

/* ── Meals page ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-title { font-family: 'Nunito', sans-serif; font-size: 1.9rem; font-weight: 900; }
.page-subtitle { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }

.filters-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }

.summary-bar {
  display: flex;
  gap: 1.5rem;
  padding: 0.85rem 1.5rem;
  background: rgba(255,124,74,0.07);
  border: 1px solid rgba(255,124,74,0.15);
  border-radius: 16px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  flex-wrap: wrap;
}

.meals-full-grid { display: flex; flex-direction: column; gap: 0.75rem; }

.meal-card-full {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s;
}
.meal-card-full:hover { border-color: rgba(255,124,74,0.3); }

.meal-img-lg {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

/* ── Chat ── */
.chat-bubble {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 0;
  animation: chadBounce 2.4s ease-in-out infinite;
}
.chat-bubble:hover { animation: none; transform: scale(1.12); }
.chat-bubble.ping { animation: chadPing 0.5s cubic-bezier(0.34,1.8,0.64,1) 2; }
.chat-bubble-img { width: 110px; height: 110px; object-fit: contain; }

@keyframes chadBounce {
  0%, 100% { transform: translateY(0); }
  45%       { transform: translateY(-14px); }
  65%       { transform: translateY(-6px); }
}

@keyframes chadPing {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25) rotate(-8deg); }
  100% { transform: scale(1); }
}

.chud-notif {
  position: fixed;
  bottom: 8.5rem;
  right: 1.5rem;
  max-width: 280px;
  background: var(--surface2);
  border: 1.5px solid var(--accent2);
  border-radius: 16px;
  padding: 0.85rem 1.1rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(255,77,143,0.3);
  z-index: 199;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34,1.4,0.64,1);
}
.chud-notif.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.chud-notif::before {
  content: '💬';
  display: block;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.chat-panel {
  position: fixed;
  bottom: 8.5rem;
  right: 1.5rem;
  width: 480px;
  height: 660px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 200;
  animation: popIn 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
}
.chat-panel.open { display: flex; }

.chat-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface2);
  flex-shrink: 0;
}
.chat-header-title { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.05rem; }
.chat-header-sub { font-size: 0.75rem; color: var(--muted); }
.chat-online { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; margin-left: auto; flex-shrink: 0; box-shadow: 0 0 6px #4ade80; }
.chat-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.55rem;
  margin-left: 0.4rem;
  border-radius: 8px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.chat-close-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg {
  max-width: 82%;
  padding: 0.75rem 1.1rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg.typing { color: var(--muted); font-style: italic; }

.chat-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 0.6rem 1rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--accent2); }
.chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Profile dropdown ── */
.user-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.5rem 0.2rem 0.2rem;
  border-radius: 100px;
  color: var(--text);
  font-family: inherit;
  transition: background 0.2s;
}
.user-trigger:hover { background: rgba(255,255,255,0.06); }

.dropdown-chevron {
  font-size: 0.65rem;
  color: var(--muted);
  transition: transform 0.2s;
  line-height: 1;
}

.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: 380px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  z-index: 500;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.profile-dropdown.open {
  display: block;
  animation: fadeUp 0.18s ease both;
}

.dropdown-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}
.dropdown-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}
.dropdown-subtitle {
  font-size: 0.75rem;
  color: var(--muted);
}
.dropdown-close {
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.dropdown-close:hover { background: rgba(255,95,95,0.15); color: var(--danger); }

.profile-dropdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Log Meal improvements ── */
.drop-zone {
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  min-height: 180px;
}
.drop-zone:hover { border-color: rgba(255,124,74,0.5); background: rgba(255,124,74,0.04); }
.drop-zone.drag-over { border-color: var(--accent2); background: rgba(255,77,143,0.07); }

.drop-hint {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--surface);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  margin-top: 0.3rem;
}

.remove-photo-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s;
  line-height: 1;
}
.remove-photo-btn:hover { background: rgba(255,95,95,0.75); }

.camera-btn { width: 100%; justify-content: center; }

.macro-input-wrap { position: relative; }
.macro-input-wrap input { width: 100%; padding-right: 2.75rem; }
.macro-unit {
  position: absolute;
  right: 0.75rem; top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--muted);
  pointer-events: none;
  font-weight: 600;
}

/* ── Delete button on meal cards ── */
.meal-card { position: relative; }
.meal-card-full { position: relative; }
.meal-delete-btn {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.18s;
  line-height: 1;
  flex-shrink: 0;
}
.meal-card:hover .meal-delete-btn,
.meal-card-full:hover .meal-delete-btn { opacity: 1; }
.meal-delete-btn:hover {
  background: rgba(255,95,95,0.12);
  border-color: rgba(255,95,95,0.35);
  color: var(--danger);
}

/* ── Feed ── */
.feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  animation: fadeUp 0.5s ease both;
  transition: border-color 0.2s;
}
.feed-card:hover { border-color: rgba(255,124,74,0.3); }

.feed-user-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.feed-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,124,74,0.3);
}

.feed-avatar-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.feed-username {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
}

.feed-time {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.feed-meal-img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 0.85rem;
}

.feed-meal-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
}

/* ── Ascension rating ── */
.ascension-wrap {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ascension-bar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ascension-end-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ascension-track {
  flex: 1;
  height: 8px;
  border-radius: 100px;
  background: linear-gradient(to right, #ff4444, #ff7c4a, #f5c542, #7fdd6f, #4ade80);
  position: relative;
  cursor: grab;
  touch-action: none;
}
.ascension-track-dragging { cursor: grabbing; }
.ascension-track:hover { box-shadow: 0 0 0 6px rgba(255, 124, 74, 0.06); }

.ascension-icon {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  pointer-events: none;
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* While dragging, kill the elastic snap-into-place transition so the platypus
   tracks the cursor 1:1 — feels far more responsive than easing during drag. */
.ascension-track-dragging .ascension-icon-mine { transition: none; }

/* The platypus is the user's own rating marker (large, prominent, draggable). */
.ascension-icon-mine { z-index: 2; }

/* Community average — a small white dot underneath the platypus, deliberately
   subordinate so the user's primary action target (drag the platypus) stays
   visually dominant. */
.ascension-icon-community {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.ascension-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.ascension-meta {
  font-size: 0.78rem;
  color: var(--muted);
}
.ascension-meta strong { color: var(--text); }
.ascension-sep { opacity: 0.5; margin: 0 0.15rem; }
.ascension-hint {
  font-size: 0.68rem;
  color: var(--muted);
  font-style: italic;
  opacity: 0.7;
}

.ascension-badge {
  display: inline-block;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  border: 1px solid;
  letter-spacing: 0.03em;
}

/* ── Comments ── */
.feed-card-footer {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.comment-toggle-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.comment-toggle-btn:hover { color: var(--text); }

.comments-section {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comments-loading {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  padding: 0.5rem 0;
}

.comments-list { display: flex; flex-direction: column; gap: 0.65rem; }

.comment { display: flex; flex-direction: column; }
.comment.reply { margin-left: 2.25rem; margin-top: 0.4rem; }

.comment-row { display: flex; gap: 0.6rem; align-items: flex-start; }

.comment-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,124,74,0.25);
}
.comment-avatar-initials {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito', sans-serif; font-weight: 900;
  flex-shrink: 0;
}

.comment-body { flex: 1; min-width: 0; }

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.comment-username { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.82rem; }
.comment-time { font-size: 0.68rem; color: var(--muted); }
.comment-text { font-size: 0.88rem; line-height: 1.45; word-break: break-word; }

.comment-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.3rem;
}
.comment-action-btn {
  background: none; border: none;
  font-size: 0.72rem; font-weight: 700; font-family: 'Nunito', sans-serif;
  color: var(--muted); cursor: pointer; padding: 0;
  transition: color 0.15s;
}
.comment-action-btn:hover { color: var(--text); }
.comment-action-btn.delete-btn:hover { color: var(--danger); }

.replies { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }

.reply-form-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.reply-input { font-size: 0.82rem; padding: 0.4rem 0.75rem; }
.reply-cancel-btn {
  background: none; border: none;
  color: var(--muted); cursor: pointer; font-size: 0.8rem;
  padding: 0 0.25rem; transition: color 0.15s;
}
.reply-cancel-btn:hover { color: var(--danger); }

.comment-compose {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.4rem;
}
.comment-input {
  flex: 1;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 0.5rem 1rem;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}
.comment-input:focus { border-color: var(--accent2); }
.comment-submit-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: none;
  border-radius: 100px;
  padding: 0.45rem 1rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.comment-submit-btn:hover { opacity: 0.88; }

/* ── Trainer ── */
.bmi-card {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.bmi-platy-col {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bmi-platy-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(255,124,74,0.35));
}
#bmi-platypus {
  width: 260px;
  height: 260px;
}
.bmi-stats-col { flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.bmi-number-row { display: flex; align-items: baseline; gap: 0.5rem; }
.bmi-number {
  font-family: 'Nunito', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ff7c4a, #ff4d8f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.bmi-number-label { font-size: 1rem; color: var(--muted); font-weight: 600; }
.bmi-badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  width: fit-content;
}
.bmi-badge-king   { background: rgba(250,204,21,0.2);   color: #fde047; }
.bmi-badge-prince { background: rgba(167,139,250,0.2);  color: #c4b5fd; }
.bmi-badge-under  { background: rgba(96,165,250,0.18);  color: #93c5fd; }
.bmi-badge-normal { background: rgba(52,211,153,0.18);  color: #6ee7b7; }
.bmi-badge-over   { background: rgba(251,191,36,0.18);  color: #fde68a; }
.bmi-badge-obese  { background: rgba(255,95,95,0.18);   color: #fca5a5; }

.bmi-tier-label {
  margin-top: 0.5rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.01em;
}

.bmi-meter-wrap { display: flex; flex-direction: column; gap: 0.35rem; }
.bmi-meter-track {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  overflow: visible;
}
.bmi-meter-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #60a5fa, #6ee7b7, #fde68a, #fca5a5);
  transition: width 1s cubic-bezier(0.34,1.2,0.64,1);
  width: 0;
}
.bmi-meter-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
  transform: translate(-50%, -50%);
  transition: left 1s cubic-bezier(0.34,1.2,0.64,1);
  left: 0;
}
.bmi-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
}
.bmi-meta-row { display: flex; gap: 0.75rem; }
.bmi-meta-chip {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 0.3rem 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.bmi-incomplete { font-size: 0.85rem; color: var(--muted); }

/* Rings */
.rings-row-inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.rings-macros {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.rings-empty { color: var(--muted); font-size: 0.9rem; }

.ring-big-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.ring-big-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
}
.ring-big-goal { font-size: 0.78rem; color: var(--muted); }

.ring-center-big {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.ring-big-val {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  color: white;
  line-height: 1;
}
.ring-big-unit { font-size: 0.65rem; color: rgba(255,255,255,0.5); }

.ring-small-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.ring-small-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}
.ring-small-goal { font-size: 0.72rem; color: var(--muted); }

/* Targets */
.targets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.target-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.target-icon { font-size: 1.5rem; }
.target-body { display: flex; flex-direction: column; gap: 0.15rem; }
.target-label { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.target-value {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1;
}
.target-unit { font-size: 0.72rem; color: var(--muted); font-weight: 400; }

/* ── PSL Rating ── */
.psl-disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}
.psl-drop { min-height: 200px; }

.psl-hero-card { background: linear-gradient(135deg, var(--surface2), rgba(255,77,143,0.07)); }
.psl-hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.psl-platy-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.psl-platy-img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(255,124,74,0.4));
}
#psl-platy-img { width: 240px; height: 240px; }
.psl-bubble {
  background: var(--surface);
  border: 1.5px solid rgba(255,77,143,0.4);
  border-radius: 14px;
  padding: 0.55rem 0.9rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text);
  max-width: 180px;
  text-align: center;
  position: relative;
}
.psl-bubble::before {
  content: '';
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top: none;
  border-bottom-color: rgba(255,77,143,0.4);
}

.psl-score-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.psl-score-number {
  font-family: 'Nunito', sans-serif;
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.psl-score-label { font-size: 1rem; color: var(--muted); font-weight: 600; margin-top: -0.4rem; }
.psl-tier-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 100px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  width: fit-content;
}
.psl-tier-king   { background: rgba(250,204,21,0.2);  color: #fde047; }
.psl-tier-prince { background: rgba(167,139,250,0.2); color: #c4b5fd; }
.psl-tier-normal { background: rgba(52,211,153,0.18); color: #6ee7b7; }
.psl-tier-over   { background: rgba(251,191,36,0.18); color: #fde68a; }
.psl-tier-obese  { background: rgba(255,95,95,0.18);  color: #fca5a5; }

.psl-verdict-stamp {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent2);
  text-shadow: 0 0 18px rgba(255,77,143,0.6);
  line-height: 1.2;
  word-break: break-word;
}
.psl-tier-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
  margin-top: -0.25rem;
}
.psl-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.psl-stat-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 100px;
  padding: 0.18rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.psl-headline {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  font-style: italic;
}

.psl-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.psl-half-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}
.psl-pos-title { color: #6ee7b7; }
.psl-neg-title { color: #fca5a5; }
.psl-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  list-style: none;
  padding: 0;
}
.psl-list li {
  font-size: 0.875rem;
  color: var(--muted);
  padding-left: 1rem;
  position: relative;
}
.psl-pos-list li::before { content: '+'; position: absolute; left: 0; color: #6ee7b7; font-weight: 700; }
.psl-neg-list li::before { content: '−'; position: absolute; left: 0; color: #fca5a5; font-weight: 700; }

.psl-roast {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  font-style: italic;
}
.psl-advice {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}

/* ── Peptides ── */
.peptide-disclaimer {
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 12px;
  padding: 0.75rem 1.1rem;
  font-size: 0.8rem;
  color: #fbbf24;
  margin-bottom: 1.5rem;
}
.peptide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}
.peptide-card {
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s, transform 0.18s;
}
.peptide-card:hover {
  border-color: rgba(255,124,74,0.3);
  transform: translateY(-2px);
}
.peptide-card-top {
  padding: 1.25rem 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.peptide-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.peptide-emoji {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}
.peptide-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.2;
}
.peptide-aliases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.25rem;
}
.peptide-aliases span {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  padding: 0.1rem 0.5rem;
}
.peptide-category {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 100px;
  padding: 0.2rem 0.65rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.peptide-description {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}
.peptide-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.peptide-effect-chip {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255,124,74,0.1);
  border: 1px solid rgba(255,124,74,0.2);
  border-radius: 100px;
  padding: 0.18rem 0.6rem;
}
.peptide-dosing {
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
.peptide-card-actions {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 0.75rem;
}
.peptide-vendors {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.peptide-vendor-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
  cursor: pointer;
}
.peptide-vendor-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.vendor-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
}
.vendor-secondary {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
}
.peptide-reddit-btn {
  background: rgba(255,69,0,0.12);
  border: 1px solid rgba(255,69,0,0.25);
  color: #ff6b35;
  border-radius: 100px;
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}
.peptide-reddit-btn:hover { background: rgba(255,69,0,0.2); }
.peptide-discussions {
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.15);
}
.peptide-disc-loading {
  display: flex;
  justify-content: center;
  padding: 1.5rem;
}
.peptide-disc-list {
  display: flex;
  flex-direction: column;
}
.peptide-disc-item {
  display: block;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  text-decoration: none;
  transition: background 0.15s;
}
.peptide-disc-item:last-child { border-bottom: none; }
.peptide-disc-item:hover { background: rgba(255,255,255,0.04); }
.peptide-disc-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}
.peptide-disc-preview {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.35rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.peptide-disc-meta {
  display: flex;
  gap: 0.65rem;
  font-size: 0.7rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.peptide-disc-error {
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Looksmaxxing News ── */
.news-sub-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.news-sub-btn {
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 0.3rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
}
.news-sub-btn:hover, .news-sub-btn.active {
  background: rgba(255,77,143,0.18);
  border-color: rgba(255,77,143,0.5);
  color: #ff4d8f;
}
.news-topic-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.news-topic-btn {
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
}
.news-topic-btn:hover, .news-topic-btn.active {
  background: rgba(255,124,74,0.18);
  border-color: rgba(255,124,74,0.5);
  color: var(--accent);
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}
.news-card {
  display: flex;
  flex-direction: column;
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.18s, border-color 0.18s;
}
.news-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,124,74,0.35);
}
.news-card-img {
  width: 100%;
  height: 160px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface);
}
.news-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.news-card-meta-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.news-sub-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent2);
  background: rgba(255,77,143,0.12);
  border-radius: 100px;
  padding: 0.15rem 0.55rem;
}
.news-flair {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  padding: 0.15rem 0.5rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-card-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.4;
}
.news-card-preview {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.news-card-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 0.5rem;
  flex-wrap: wrap;
}
.news-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem;
  color: var(--muted);
}
.news-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 3rem;
  font-size: 0.9rem;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .log-form { grid-template-columns: 1fr; }
  .macros-row { grid-template-columns: repeat(2, 1fr); }
  .bmi-card { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .rings-row-inner { flex-direction: column; align-items: flex-start; }
}

/* ── Today's Nutrition panel (dashboard) ── */
.nutrition-panel {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.75rem;
  align-items: center;
}
.nutrition-cal-col { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.nutrition-cal-ring-wrap {
  position: relative;
  width: 200px;
  height: 200px;
}
.nutrition-cal-ring { display: block; }
.nutrition-cal-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  pointer-events: none;
  text-align: center;
}
.nutrition-cal-num {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 2.4rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nutrition-cal-of  { color: var(--muted); font-size: 0.78rem; }
.nutrition-cal-pct { color: var(--text);  font-size: 0.8rem; font-weight: 700; }

.macro-bars-col { display: flex; flex-direction: column; gap: 0.7rem; }
.macro-bar-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
}
.macro-bar-label { font-weight: 700; }
.macro-bar-track {
  height: 8px; border-radius: 100px;
  background: rgba(255,255,255,0.06);
  overflow: hidden; position: relative;
}
.macro-bar-fill { height: 100%; border-radius: 100px; transition: width 0.6s ease; }
.macro-bar-meta { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.macro-bar-meta strong { color: var(--text); }

/* ── Micro tiles — horizontal layout: ring on left, label/% on right ── */
.micros-grid {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}
.micro-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 0.15s, border-color 0.15s;
  min-width: 0;
}
.micro-cell:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.15); }

.micro-ring-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}
.micro-ring-wrap svg { display: block; width: 100%; height: 100%; }

/* Emoji centering — grid place-items is more reliable than flex for one-glyph
   content, especially across emoji fonts (Apple/Google/Twemoji) where glyph
   metrics differ. Inner span normalizes line-height so the bounding box
   matches what the SVG ring expects. */
.micro-ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.micro-emoji {
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  font-feature-settings: "kern" 0;
}

.micro-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.micro-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.micro-row2 {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.micro-pct {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1;
}
.micro-amount {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}

/* Trainer card uses a slightly tighter variant */
.micros-grid.compact .micro-ring-wrap { width: 32px; height: 32px; }
.micros-grid.compact .micro-emoji { font-size: 0.88rem; }
.micros-grid.compact .micro-pct { font-size: 0.85rem; }
.micros-grid.compact .micro-label { font-size: 0.62rem; }
.micros-grid.compact .micro-amount { font-size: 0.65rem; }
.micros-grid.compact .micro-cell { padding: 0.45rem 0.55rem; gap: 0.5rem; }

.micros-toggle {
  margin-top: 1.25rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.025);
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.micros-toggle:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,124,74,0.4); }
.micros-toggle-chevron { font-size: 0.75rem; color: var(--muted); }
.micros-toggle + .micros-grid,
.micros-toggle + .meal-details-micros { margin-top: 0.6rem; }

.trainer-micros-label {
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
@media (max-width: 900px) {
  .micros-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
}
@media (max-width: 720px) {
  .nutrition-panel { grid-template-columns: 1fr; }
  .micros-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .micros-grid { grid-template-columns: 1fr; }
  .micro-cell { padding: 0.55rem 0.85rem; }
}

/* ── Target breakdown / editor (trainer) ── */
.targets-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap;
}
.targets-toolbar-status { color: var(--muted); font-size: 0.85rem; }
.targets-toolbar-status strong { color: var(--text); }
.targets-edit-btn {
  background: rgba(255,124,74,0.12);
  border: 1px solid rgba(255,124,74,0.4);
  color: var(--accent);
  padding: 0.45rem 0.9rem;
  border-radius: 100px;
  font-family: inherit; font-weight: 700; font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.targets-edit-btn:hover { background: rgba(255,124,74,0.22); }

.target-formula-wrap {
  margin-top: 1rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
  overflow: hidden;
}
.target-formula-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.85rem 1.2rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.target-formula-toggle:hover { background: rgba(255,255,255,0.04); }
.target-formula-chevron {
  font-size: 0.8rem;
  color: var(--muted);
  transition: transform 0.2s;
}
.target-formula-body {
  padding: 0 1.2rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  border-top: 1px dashed var(--border);
  padding-top: 0.85rem;
}
.target-formula-body code {
  background: rgba(255,255,255,0.05);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  color: var(--text);
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 0.78rem;
}
.target-formula-body b { color: var(--text); }

.macro-split-editor {
  margin-top: 1rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.macro-split-row {
  display: grid;
  grid-template-columns: 80px 1fr 90px;
  gap: 1rem;
  align-items: center;
}
.macro-split-label { font-weight: 800; font-family: 'Nunito', sans-serif; }
.macro-split-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  outline: none;
}
.macro-split-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--accent2);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
}
.macro-split-pct-input {
  width: 90px; text-align: right;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
}
.macro-split-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  font-size: 0.85rem;
}
.macro-split-summary.invalid { background: rgba(255,77,143,0.08); color: var(--accent2); }

/* ── Meal-card highlights (high protein / high micros) ── */
.meal-card-highlight-protein,
.meal-card-full.meal-card-highlight-protein {
  border: 1.5px solid rgba(134, 239, 172, 0.45);
  box-shadow: 0 0 0 1px rgba(134, 239, 172, 0.15) inset;
}
.meal-highlight-chips {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  margin-top: 0.45rem;
}
.meal-highlight-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 100px;
  background: rgba(134, 239, 172, 0.12);
  color: #86efac;
  border: 1px solid rgba(134, 239, 172, 0.3);
}
.meal-highlight-chip.protein {
  background: rgba(255, 77, 143, 0.12);
  color: #ff7c4a;
  border-color: rgba(255, 124, 74, 0.4);
}

/* ── Meal-details micro grid ── */
.meal-details-micros {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
}
.meal-detail-micro {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.meal-detail-micro.high {
  background: rgba(134, 239, 172, 0.08);
  border-color: rgba(134, 239, 172, 0.35);
}
.meal-detail-micro-row1 {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.78rem; font-weight: 700;
}
.meal-detail-micro-row2 {
  font-size: 0.7rem; color: var(--muted);
}
.meal-detail-micro-row1 .pct { color: #86efac; font-family: 'Nunito', sans-serif; }
.meal-detail-micro.limit .pct { color: #fda4af; }

/* ── Macro tag absolute-threshold highlights ── */
/* Protein ≥ 40g in a meal: green tag */
.macro.macro-high-protein {
  color: #86efac;
  font-weight: 800;
  background: rgba(134, 239, 172, 0.1);
  border: 1px solid rgba(134, 239, 172, 0.3);
  border-radius: 100px;
  padding: 0.15rem 0.55rem;
}
/* Fat ≥ 40g in a meal: red tag (signal of a heavy / fatty meal) */
.macro.macro-high-fat {
  color: #fda4af;
  font-weight: 800;
  background: rgba(253, 164, 175, 0.1);
  border: 1px solid rgba(253, 164, 175, 0.3);
  border-radius: 100px;
  padding: 0.15rem 0.55rem;
}

/* Feed: push View More button to the right of the user row */
.feed-view-btn {
  margin-left: auto;
  flex-shrink: 0;
}

/* Red variant of meal highlight chip — for "limit" nutrients (sugar, sodium,
   cholesterol, sat fat) when a single meal hits ≥30% DV */
.meal-highlight-chip.bad {
  background: rgba(253, 164, 175, 0.12);
  color: #fda4af;
  border-color: rgba(253, 164, 175, 0.35);
}

/* ── Stat-card corner sub-stats ──────────────────────────────────────────────
   Each card surfaces a secondary metric in the top-right and bottom-right
   corners (e.g. "🔥 Cal Streak" alongside the main streak). Absolute-
   positioned so the existing icon/label/value/unit stack stays untouched.
*/
.stat-corner {
  position: absolute;
  text-align: right;
  line-height: 1.2;
  z-index: 1;
}
.stat-corner-tr { top: 0.85rem;    right: 1rem; }
.stat-corner-br { bottom: 0.85rem; right: 1rem; }
.stat-corner-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.stat-corner-value {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 0.05rem;
}

/* ── Meal-details popup — full red highlight for bad micros at high range ──
   Limit nutrients (sodium, sugar, cholesterol, sat fat) at ≥30% DV per meal
   get a red-tinted card mirroring how good micros get a green-tinted card.
*/
.meal-detail-micro.bad {
  background: rgba(253, 164, 175, 0.1);
  border-color: rgba(253, 164, 175, 0.4);
}
.meal-detail-micro.bad .pct { color: #fda4af; }

/* "View N more comments" button shown below the first 3 comments per meal.
   Click expands the visible set to show all loaded comments for that meal. */
.comments-more-btn {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.45rem 0.75rem;
  background: rgba(255, 124, 74, 0.06);
  color: var(--accent);
  border: 1px dashed rgba(255, 124, 74, 0.35);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.comments-more-btn:hover {
  background: rgba(255, 124, 74, 0.12);
  border-color: var(--accent);
  border-style: solid;
}

/* Clickable "X ratings" chip in the feed ascension meta row.
   Visually styled to look like an inline link so users know it's interactive. */
.ascension-rating-count {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline dotted rgba(255,124,74,0.4);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.ascension-rating-count:hover {
  color: var(--accent2);
  text-decoration-color: var(--accent2);
}

/* ── Ratings list modal ──────────────────────────────────────────────────
   Opens when the user clicks the "X ratings" chip on a feed card.
   Lists every rater (avatar + name + time-ago) and their tier label.
*/
.ratings-list-modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.ratings-list-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.ratings-list-content {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 80vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.5rem 1.6rem 1.25rem;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  animation: popIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.ratings-list-close {
  position: absolute;
  top: 0.85rem; right: 0.85rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ratings-list-close:hover {
  background: rgba(255,95,95,0.12);
  color: var(--danger);
  border-color: var(--danger);
}
.ratings-list-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-right: 2rem;
}
.ratings-list-items {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ratings-list-loading {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.ratings-list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.ratings-list-meta {
  flex: 1;
  min-width: 0;
}
.ratings-list-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ratings-list-time {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.ratings-list-tier {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  border: 1px solid;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
