/* sections.css — page areas: account, device list, dog modal, plan page,
   profile photo, notifications, billing, delete account, day overlay. */

/* =====================
   Account Page — centered card
   ===================== */
#page-account {
  /* Centering comes from margin:auto on .auth-card (shared with the auth
     page) — see base.css for why align-items:center is avoided here. */
  padding: 40px 20px;
}

.account-main-card {
  max-width: 640px;
  width: 100%;
  padding: 40px 48px;
}

.account-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.account-main-header .auth-title { margin-bottom: 0; }

.account-section {
  margin-bottom: 20px;
}
.account-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.account-section-header .account-section-title { margin-bottom: 0; }
.btn-section-edit {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.btn-section-edit:hover { background: var(--accent-light); }
.account-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.account-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
}
.account-row:last-child { border-bottom: none; }
.account-row-btn {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  transition: background 0.15s;
}
.account-row-btn:last-child { border-bottom: none; }
.account-row-btn:hover { background: var(--accent-light); }
.account-row-btn svg { color: var(--text-secondary); }

.pwd-changed-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 10px;
}

/* =====================
   Device List
   ===================== */
.device-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.device-row:last-child { border-bottom: none; }
.device-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.device-info { flex: 1; }
.device-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.device-current {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 50px;
}
.device-seen {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.btn-danger {
  padding: 10px 20px;
  background: none;
  border: 1px solid #e74c3c;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: #e74c3c;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger:hover { background: #fdecea; }
.account-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  min-width: 90px;
}
.account-since {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 8px;
}

.account-sections-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

/* Account landing rendered as summary cards */
.account-sections-list .dp-section {
  display: flex;
  flex-direction: column;
}
.account-sections-list .dp-sumcard {
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  padding: 16px 18px;
}
.account-sections-list .dp-sc-top {
  display: flex;
  align-items: center;
  gap: 9px;
}
.account-sections-list .dp-sc-ico {
  width: 19px;
  height: 19px;
  color: var(--accent);
  stroke-width: 2;
  flex: 0 0 auto;
}
.account-sections-list .dp-sc-title {
  flex: 1;
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.account-sections-list .dp-sc-chev {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  stroke-width: 2.2;
  flex: 0 0 auto;
}
.account-sections-list .dp-sc-summary {
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.account-sections-list .dp-sc-wide { grid-column: 1 / -1; }

/* Narrow screens: one column so titles fit on a line */
@media (max-width: 560px) {
  .account-sections-list { grid-template-columns: 1fr; }
}

.dp-section-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}
.dp-section-nav:hover { background: var(--border-light, #f5f5f3); }
.dp-section-nav svg { color: var(--text-secondary); }

.btn-security-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}
.btn-security-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.btn-security-nav svg { color: var(--text-secondary); }

.btn-inline-change {
  padding: 3px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-inline-change:hover { border-color: var(--accent); color: var(--accent); }

.btn-back {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-back:hover { border-color: var(--primary); color: var(--primary); }

.btn-logout {
  padding: 8px 18px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-logout:hover { border-color: #c0392b; color: #c0392b; }

/* Security modal — matches account card width */
.security-modal { max-width: 460px; }

.security-last-login-footer {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* =====================
   DOG PROFILE MODAL
   ===================== */
.dog-profile-card { max-width: 460px; }

.dog-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dog-profile-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dog-profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-light, #FFFFFF);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.dog-profile-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0;
}
.dog-profile-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.dog-profile-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dp-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.dp-section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--surface);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s;
}
.dp-section-header:hover { background: var(--border-light, #f5f5f3); }
.dp-section-header-left {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}
.dp-section-header-left svg { color: var(--text-secondary); }
.dp-chevron {
  color: var(--text-secondary);
  transition: transform 0.2s;
}
.dp-section.is-closed .dp-chevron {
  transform: rotate(180deg);
}
/* Account sections open a popup, so their chevron points right (like Security). */
.account-sections-list .dp-section.is-closed .dp-chevron {
  transform: rotate(90deg);
}
.dp-section-body {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
}
/* A section body moved into the popup sits flush (the modal supplies padding). */
#section-modal-body .dp-section-body {
  border-top: none;
  padding: 0;
}
.dp-notes-text {
  max-width: 220px;
  text-align: right;
  word-break: break-word;
  white-space: pre-wrap;
}

/* =====================
   RADIO PILL GROUP (meals per day)
   ===================== */
.radio-pill-group {
  display: flex;
  gap: 10px;
}

.radio-pill {
  flex: 1;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.radio-pill input[type="radio"] {
  display: none;
}

.radio-pill span {
  flex: 1;
  text-align: center;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
  cursor: pointer;
  user-select: none;
}

.radio-pill input[type="radio"]:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.radio-pill:hover span {
  border-color: var(--accent);
  color: var(--accent);
}

.radio-pill input[type="radio"]:checked + span:hover {
  color: #fff;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* =====================
   DOG TILE — CLICKABLE (My Plan)
   ===================== */
.dog-tile-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}

.dog-tile-clickable:hover {
  box-shadow: 0 4px 20px rgba(30, 50, 28, 0.13);
  transform: translateY(-1px);
}

.plan-tile-summary {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-tile-kcal {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.dog-tile-nav-hint {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: auto;
  padding-top: 8px;
}

/* =====================
   AAFCO BADGES
   ===================== */
.aafco-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 500;
  width: fit-content;
}

.aafco-complete {
  background: #e6f4ea;
  color: #1e7e34;
}

.aafco-supplement {
  background: #fff3cd;
  color: #856404;
}

/* =====================
   PLAN PAGE LAYOUT
   ===================== */
.plan-content {
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 48px 40px;
}

.plan-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;      /* match .dog-page-header so the plan page lines up with the dog profile when switching */
  margin-bottom: 34px;
}
@media (max-width: 768px) {
  .plan-page-header { min-height: 60px; margin-bottom: 28px; }
}
@media (max-width: 480px) {
  .plan-page-header { min-height: 82px; margin-bottom: 24px; }
}

.plan-page-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;   /* let the name ellipsize instead of pushing the action buttons off-screen */
}

.plan-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--avatar-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
}

.plan-dog-name {
  font-family: var(--font-body);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-dog-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 2px 0 0;
}

.plan-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
/* Narrow screens (mobile, shrunk laptop): the two header actions drop their
   labels and become icon buttons so the row fits and the Profile back button
   is never pushed off-screen. The in-card buttons (Recipe & Prep, Supplements)
   are unaffected. */
@media (max-width: 600px) {
  .plan-header-right .plan-btn-ghost {
    padding: 9px;
    gap: 0;
  }
  .plan-header-right .plan-btn-ghost .pbtn-label { display: none; }
}

.plan-week-range-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* =====================
   STATS + ACTIONS
   ===================== */
.plan-summary {
  margin-bottom: 16px;
}

.plan-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.plan-stat-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
}

.plan-stat-primary { grid-column: span 2; align-items: center; text-align: center; }
.plan-kcal-line { font-size: 0.95rem; color: var(--accent); line-height: 1.25; }
.plan-kcal-line strong { font-weight: 700; }
.plan-summary-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.plan-summary-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.plan-btn-primary {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-card);
  padding: 11px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s;
}
.plan-btn-primary:hover { background: var(--accent-hover); }

.plan-btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  transition: border-color 0.15s;
}
.plan-btn-ghost:hover { border-color: var(--accent); }

.shop-group-label {
  margin: 14px 0 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.shop-group-label:first-child { margin-top: 0; }
.shop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.88rem;
  color: var(--text-primary);
  cursor: pointer;
  border-top: 1px solid var(--border);
}
.shop-row .shop-name { flex: 1; }
.shop-row .shop-amt { color: var(--text-secondary); font-size: 0.8rem; white-space: nowrap; }
.shop-row.done { opacity: 0.5; text-decoration: line-through; }
.shopping-sub { margin: 2px 0 0; font-size: 0.78rem; color: var(--text-secondary); }
.shopping-note { margin: 0; font-size: 0.7rem; color: var(--text-secondary); text-align: center; }

.plan-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 16px;
}

/* =====================
   7-DAY CALENDAR GRID
   ===================== */
.plan-day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  /* Give the week some height without running the full screen. */
  min-height: 440px;
}

.plan-day-card {
  position: relative;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px 10px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* Status accent bar across the top (green = complete, amber = supplements). */
.plan-day-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
}
.plan-day-card.is-complete::before { background: #3b6d11; }
.plan-day-card.is-supps::before    { background: #ba7517; }

.plan-day-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(30, 50, 28, 0.06);
}

.plan-day-card-today {
  border-color: var(--accent);
}

.plan-cal-head {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin: 0 0 6px;
}
.plan-day-card-today .plan-cal-head { color: var(--accent); }

.plan-cal-meal-name {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0 0 8px;
  min-height: 2em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.plan-cal-status { font-size: 0.95rem; }
.plan-cal-status.ok   { color: #3b6d11; }
.plan-cal-status.warn { color: #ba7517; }

/* Each day is a column: summary on top, then one box per meal. */
.plan-day-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.plan-meal-box {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 9px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plan-meal-box:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(30, 50, 28, 0.05);
}
.plan-meal-label {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.plan-meal-bowl {
  margin: 2px 0 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.plan-meal-kcal {
  margin: 3px 0 0;
  font-size: 0.62rem;
  color: var(--text-secondary);
}

/* =====================
   PLAN BODY (collapsed one-bowl view + cadence)
   ===================== */
/* When the day-grid container holds the collapsed layout it is a single
   column, not the 7-across grid. */
.plan-day-grid.plan-body {
  display: block;
  grid-template-columns: none;
  grid-auto-rows: auto;
  min-height: 0;
}

.plan-bowl-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  padding: 18px 24px 0;
}
.plan-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0 2px 10px;
}
/* Desktop: lift the "This Week's Bowl" label out of flow so the bowl card's top
   lines up with the dog page's first tile when swapping in from the Nutrition
   tile. The label tucks into the header gap above the card. Mobile unchanged. */
@media (min-width: 769px) {
  .plan-day-grid.plan-body { position: relative; }
  .plan-day-grid.plan-body > .plan-section-label:first-child {
    position: absolute;
    top: -28px;
    left: 2px;
    margin: 0;
  }
}
.plan-chip {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 50px;
  padding: 3px 9px;
}
.plan-range {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  color: var(--text-primary);
}

/* Cadence toggle */
.cadence-toggle {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}
.cad-opt {
  grid-column: span 2;
  position: relative;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px 14px 44px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cad-opt .cad-tick {
  position: absolute;
  left: 15px;
  top: 15px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
}
.cad-opt .cad-tick::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: transparent;
}
.cad-opt.on { border-color: var(--accent); background: var(--accent-light); }
.cad-opt.on .cad-tick { border-color: var(--accent); }
.cad-opt.on .cad-tick::after { background: var(--accent); }
.cad-opt .cad-title {
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.cad-opt .cad-rec { margin-left: 6px; font-size: 0.68rem; color: #3b6d11; font-weight: 700; }
.cad-opt .cad-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

/* The one bowl card */
.plan-bowl {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(30, 50, 28, 0.05);
  overflow: hidden;
}
.plan-bowl-top { padding: 18px 20px 4px; }

/* Concept 1 hero: macro ring + meal + actions in one row */
.plan-bowl-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "ring title"
    "ring meta"
    "ring legend"
    "ring actions";
  align-items: center;
  column-gap: 28px;
  padding: 26px 28px 22px;
}
.plan-ring        { grid-area: ring; align-self: center; }
.plan-bowl-title  { grid-area: title; }
.plan-bowl-meta   { grid-area: meta; }
.plan-hero-legend { grid-area: legend; }
.plan-hero-actions{ grid-area: actions; }
.plan-ring {
  position: relative;
  width: 180px;
  height: 180px;
  flex: none;
}
.plan-ring-cen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.plan-ring-kcal {
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--text-primary);
}
.plan-ring-unit {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 4px;
}
.plan-bowl-title { font-size: 1.75rem; }
.plan-bowl-meta { margin-top: 5px; }
.plan-hero-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 15px 0 18px;
}
.plan-hero-legend .plan-ml { font-size: 0.9rem; }
.plan-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 560px) {
  /* Stacked: name on top of the ring, meta under it, macros to the LEFT,
     and the three actions kept on one line. */
  .plan-bowl-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "ring"
      "meta"
      "legend"
      "actions";
    column-gap: 0;
    row-gap: 4px;
    /* Match .plan-bowl-detail's 20px side padding so the action row and the
       macro legend line up with the "In the bowl" ingredient boxes. */
    padding-left: 20px;
    padding-right: 20px;
  }
  .plan-ring       { justify-self: center; }
  .plan-bowl-title { text-align: center; margin-top: 2px; font-size: 1.5rem; }
  .plan-bowl-meta  { text-align: center; }
  .plan-hero-legend{ justify-self: start; align-items: flex-start; margin: 12px 0 16px; }

  .plan-hero-actions {
    justify-self: stretch;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .plan-hero-actions .plan-btn-primary,
  .plan-hero-actions .plan-btn-ghost {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    border-radius: 10px;   /* match the ingredient boxes' curvature, not a pill */
  }
}
@media (max-width: 440px) {
  /* Phones: drop the button icons so the three labels fit one line without clipping. */
  .plan-hero-actions .plan-btn-primary i,
  .plan-hero-actions .plan-btn-ghost i { display: none; }
  .plan-hero-actions .plan-btn-primary,
  .plan-hero-actions .plan-btn-ghost { gap: 0; }
}
.plan-bowl-eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  margin: 0 0 6px;
}
.plan-bowl-title {
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.1;
}
.plan-bowl-meta { font-size: 0.82rem; color: var(--text-secondary); margin: 4px 0 0; }
.plan-bowl-meals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px 20px;
}

/* Cadence-dependent callout + storage note inside the bowl */
.plan-callout {
  margin: 0;
  border-radius: 12px;
  padding: 14px 15px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.plan-callout .pc-ic { font-size: 1.15rem; line-height: 1; flex: none; margin-top: 1px; }
.plan-callout .pc-title {
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0 0 3px;
}
.plan-callout .pc-body { font-size: 0.82rem; line-height: 1.5; margin: 0; color: var(--text-primary); }
.plan-callout { background: var(--accent-light); }
.plan-callout .pc-title { color: var(--accent-hover); }
.plan-storage {
  margin: 0;
  padding: 14px 15px;
  border-radius: 10px;
  background: #fff6e6;
  border: 1px solid #f0dfb4;
  color: #8a6100;
  font-size: 0.8rem;
  line-height: 1.45;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.plan-storage b { font-weight: 700; }
.plan-storage .ps-title {
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: #8a6100;
  margin: 0 0 3px;
}
.plan-storage .ps-body { font-size: 0.82rem; line-height: 1.5; margin: 0; color: #8a6100; }

/* Slim read-only week strip (keeps per-day detail access) */
.plan-week-strip { margin-top: 22px; }
.plan-week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.pws-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pws-day:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(30,50,28,0.05); }
.pws-day.today { border-color: var(--accent); background: var(--accent-light); }
.pws-lbl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: var(--text-secondary);
  margin: 0;
}
.pws-dow, .pws-dom { white-space: nowrap; }
.pws-day.today .pws-lbl { color: var(--accent-hover); }
.pws-icon { font-size: 0.9rem; margin-top: 5px; }
.pws-icon.ok { color: #3b6d11; }
.pws-icon.warn { color: #ba7517; }
.plan-week-hint { font-size: 0.72rem; color: var(--text-secondary); margin: 10px 4px 0; }

.plan-switched-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.plan-switched-note i { color: #3b6d11; margin-right: 5px; }
.plan-switched-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.plan-switched-link:hover { color: var(--accent-hover); }

/* Bowl detail: ingredient chips + per-meal macro bar */
.plan-bowl-detail { padding: 2px 20px 20px; }
.plan-mini-label {
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 14px 0 9px;
}
.plan-bowl-ings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.plan-bowl-ing {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}
.plan-macro-bar {
  display: flex;
  height: 11px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--border);
}
.plan-macro-bar span { display: block; height: 100%; }
.plan-macro-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
.plan-ml { display: flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--text-secondary); }
.plan-ml-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.plan-ml b { color: var(--text-primary); font-weight: 600; }

/* Bowl prep/storage as two compact tap-pills (collapsed by default) */
.plan-pip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
}
.plan-pip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--raised, #faf8f3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 15px;
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 600;
  font-size: 0.83rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.plan-pip:hover { border-color: var(--accent); }
.plan-pip[aria-expanded="true"] {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.pip-chev { color: var(--text-secondary); font-size: 0.8rem; transition: transform 0.2s; }
.plan-pip[aria-expanded="true"] .pip-chev { transform: rotate(90deg); color: var(--accent); }
.plan-pip-panel { padding: 0 20px 16px; }
.plan-pip-panel[hidden] { display: none; }

.freq-opts { display: flex; flex-direction: column; gap: 10px; }
.freq-opt {
  position: relative;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 15px 16px 15px 48px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.15s, background 0.15s;
}
.freq-opt .freq-tick {
  position: absolute; left: 16px; top: 16px; width: 22px; height: 22px;
  border-radius: 50%; border: 2px solid var(--line-strong, #d3ccbe); display: grid; place-items: center;
}
.freq-opt .freq-tick::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: transparent; }
.freq-opt.on { border-color: var(--accent); background: var(--accent-light); }
.freq-opt.on .freq-tick { border-color: var(--accent); }
.freq-opt.on .freq-tick::after { background: var(--accent); }
.freq-opt .freq-t { font-family: 'Poppins', var(--font-display), sans-serif; font-weight: 600; font-size: 1rem; color: var(--text-primary); }
.freq-opt .freq-rec { margin-left: 7px; font-size: 0.62rem; color: #3b6d11; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.freq-opt .freq-s { color: var(--text-secondary); font-size: 0.85rem; margin-top: 2px; }
.freq-opt .freq-d { color: var(--text-secondary); font-size: 0.8rem; margin-top: 8px; line-height: 1.45; border-top: 1px dashed var(--border); padding-top: 8px; }
.freq-opt .freq-line { margin-bottom: 6px; }
.freq-opt .freq-line:last-child { margin-bottom: 0; }
.freq-opt .freq-line b { color: var(--text-primary); font-weight: 600; }

@media (min-width: 641px) and (max-width: 900px) {
  .plan-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-stat-primary { grid-column: 1 / -1; }
  .plan-stats .plan-btn-primary { grid-column: 1 / -1; }
  .cadence-toggle { grid-template-columns: 1fr 1fr; }
  .cadence-toggle .cad-opt { grid-column: auto; }
}

@media (max-width: 640px) {
  .plan-stats { grid-template-columns: 1fr 1fr; }
  .plan-stat-primary { grid-column: 1 / -1; }
  .plan-stats .plan-btn-primary { grid-column: 1 / -1; }
  .cadence-toggle { grid-template-columns: 1fr; }
  .cadence-toggle .cad-opt { grid-column: auto; }
}

/* =====================
   PROFILE PHOTO
   ===================== */
.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.profile-avatar-btn {
  position: relative;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.profile-avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--avatar-text);
  font-size: 1.1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  color: #fff;
}

.profile-avatar-btn:hover .profile-avatar-overlay { opacity: 1; }

.profile-avatar-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.profile-avatar-hint {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin: 0;
}

/* "Change photo" text button under the avatar label */
.profile-avatar-change {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.profile-avatar-change:hover { text-decoration: underline; }

/* Inline-editable profile fields — grouped card, no dividers */
.profile-fields {
  background: var(--field-bg, #f7f5f1);
  border-radius: 14px;
  padding: 6px 6px;
}
.profile-field { padding: 10px 12px; }
.profile-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.profile-field input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text-primary);
  padding: 5px 8px;
  margin: -5px -8px;
  border-radius: 8px;
  outline: none;
  transition: background 0.12s, box-shadow 0.12s;
}
.profile-field input:hover { background: rgba(0,0,0,0.03); }
.profile-field input:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.profile-field input[readonly] { color: var(--text-secondary); cursor: default; }
.profile-field input[readonly]:hover { background: transparent; }

/* the Mapbox autocomplete input is injected into this wrapper */
#account-address-wrap { position: relative; }

.profile-field-error {
  margin: 8px 4px 0;
  min-height: 0;
}
.profile-field-error:empty { display: none; }

.profile-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  min-height: 38px;
}
.profile-save-hint {
  margin-right: auto;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.btn-section-ghost {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-section-ghost:hover { background: var(--bg); }
.profile-save-btn {
  width: auto;
  padding: 9px 20px;
  font-size: 0.92rem;
}
.profile-save-btn:disabled { opacity: 0.45; cursor: default; }

/* =====================
   NOTIFICATION TOGGLES
   ===================== */
.notif-beta {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #F4EAD2;
  border: 1px solid #E6D6A8;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
}

.notif-beta-badge {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #6B5A22;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.notif-beta-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #6B5A22;
}

.notif-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.notif-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 16px;
}

.notif-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.notif-row + .notif-row { border-top: 1px solid var(--border); }

.notif-master-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* 16px card padding + 1px card border, so this row's title and toggle
     line up with the toggles inside the .notif-group card above. */
  padding: 14px 17px 2px;
  margin-top: 4px;
}

.notif-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.notif-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* =====================
   BILLING SECTION
   ===================== */
.billing-plan-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.billing-plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.billing-plan-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.billing-plan-price {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.billing-plan-badge {
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 50px;
  white-space: nowrap;
}

.billing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.billing-features li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.billing-features li svg { flex-shrink: 0; color: var(--accent); }

.btn-manage-billing {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: not-allowed;
  font-family: var(--font-body);
  opacity: 0.6;
}

/* =====================
   DELETE ACCOUNT
   ===================== */
.btn-delete-account {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 9px;
  border: 1px solid #fca5a5;
  border-radius: 50px;
  background: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: #dc2626;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s;
  text-align: center;
}

.btn-delete-account:hover { background: #fef2f2; }

.pending-deletion-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: #9a3412;
  flex-wrap: wrap;
}

.pending-deletion-banner svg { flex-shrink: 0; color: #ea580c; }
.pending-deletion-banner span { flex: 1; }

.btn-cancel-deletion {
  background: none;
  border: 1px solid #fdba74;
  border-radius: 50px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #9a3412;
  cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
}

.btn-cancel-deletion:hover { background: #ffedd5; }

.delete-account-warning {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.delete-account-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.delete-account-list li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding-left: 12px;
  position: relative;
}

.delete-account-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #dc2626;
}

.btn-delete-confirm {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s;
}

.btn-delete-confirm:hover:not(:disabled) { background: #b91c1c; }
.btn-delete-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

/* =====================
   EMPTY / LOADING STATES
   ===================== */
.plan-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 24px;
  text-align: center;
}

.plan-empty-icon { font-size: 2.5rem; }

.plan-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.plan-empty-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0;
  line-height: 1.5;
}

.plan-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 24px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.plan-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =====================
   DAY DETAIL OVERLAY
   ===================== */

.day-nutrition-row {
  display: flex;
  gap: 6px;
  background: var(--accent-light);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  justify-content: space-around;
}

.day-nutrition-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.day-nutrition-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}

.day-nutrition-lbl {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.aafco-complete-card {
  background: #e6f4ea;
  color: #1e7e34;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.supplement-card {
  background: #fffbeb;
  border: 1.5px solid #f6c90e44;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

/* Nutrient-gap card: red, signals a real shortfall the recipe can't close. */
.gap-card {
  background: #fdecec;
  border: 1.5px solid #e24b4a44;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.gap-card-title { font-size: 0.85rem; font-weight: 700; color: #a32d2d; margin: 0 0 10px; }
.gap-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 0.85rem; color: var(--text-primary); padding: 3px 0;
}
.gap-detail { color: var(--text-secondary); white-space: nowrap; }
.gap-note { font-size: 0.8rem; color: var(--text-secondary); margin: 8px 0 0; line-height: 1.4; }

.supplement-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #856404;
  margin: 0 0 10px;
}

.supplement-row {
  margin-bottom: 10px;
}

.supplement-row:last-child { margin-bottom: 0; }

.supplement-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.supplement-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.day-meals-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 18px 0 10px;
}

.day-meals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Supplements & Gaps: two expandable toggle buttons under the section label. */
.day-sg { margin-bottom: 8px; }
.day-sg > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: all 0.15s;
}
.day-sg > summary::-webkit-details-marker { display: none; }
.day-sg > summary:hover { border-color: var(--accent); background: var(--surface); }
.day-sg-lbl { display: inline-flex; align-items: center; gap: 8px; }
.day-sg-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  background: var(--accent-light); color: var(--accent);
}
.day-sg-count-warn { background: #fdecec; color: #a32d2d; }
.day-sg-chev { color: var(--text-secondary); transition: transform 0.15s; }
.day-sg[open] > summary .day-sg-chev { transform: rotate(90deg); }
.day-sg-body { padding-top: 8px; }
.day-sg-body .supplement-card,
.day-sg-body .gap-card,
.day-sg-body .aafco-complete-card { margin-bottom: 0; }

.day-meal-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.day-meal-card:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.day-meal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}

.day-meal-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  margin: 0;
}

.day-meal-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2px 0 0;
}

.day-meal-kcal {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.day-meal-ingredients {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 4px 0 0;
  line-height: 1.4;
}



/* ── Day completion (meal_log): strip fed pill + day-overlay log controls ── */
.pws-fed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: auto;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: 'Poppins', var(--font-display), sans-serif;
  font-weight: 700;
  font-size: 0.58rem;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  max-width: 100%;
}
.pws-fed-dot { width: 8px; height: 8px; border-radius: 999px; border: 1.5px solid currentColor; flex: none; }
.pws-fed-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pws-fed-none { border-style: dashed; }
.pws-fed-none .pws-fed-dot { border-style: dashed; }
.pws-fed-fed { color: #3b6d11; background: #eef5e4; border-color: #cfe3b4; }
.pws-fed-fed .pws-fed-dot { background: #3b6d11; border-color: #3b6d11; }
.pws-fed-partial { color: #3b6d11; background: #eef5e4; border-color: #cfe3b4; }
.pws-fed-partial .pws-fed-dot { background: linear-gradient(90deg, #3b6d11 0 50%, transparent 50% 100%); border-color: #3b6d11; }
.pws-fed-skipped { color: var(--text-secondary); background: var(--bg); }
.pws-fed-skipped .pws-fed-dot { border-color: var(--text-secondary); }

.day-log-list { display: flex; flex-direction: column; gap: 8px; }
.day-log-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.day-log-meal { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.day-log-meal-name { font-weight: 700; font-size: 0.92rem; color: var(--text-primary); }
.day-log-meal-kcal { font-size: 0.72rem; color: var(--text-secondary); }
.day-log-seg { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; flex: none; }
.dl-btn {
  appearance: none; border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 0.8rem; color: var(--text-secondary);
  padding: 6px 12px; border-radius: 8px; transition: background 0.12s, color 0.12s;
}
.dl-btn:hover { color: var(--text-primary); }
.dl-fed.on { background: #3b6d11; color: #fff; }
.dl-skip.on { background: var(--text-secondary); color: #fff; }
