:root {
  --bg: #0E0E0E;
  --surface: #1A1A1A;
  --surface-2: #121212;
  --surface-3: #222222;
  --line: #2B2B2B;
  --ink: #F5F5F5;
  --muted: #B8B8B8;
  --dim: #7A7A7A;
  --orange: #E3791D;
  --orange-light: #F59E0B;
  --green-brand: #004A2A;
  --green: #10B981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --blue: #38BDF8;
  --danger: #F87171;
  --warn: #FBBF24;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% 0%, rgba(0, 74, 42, 0.28) 0%, transparent 40%),
    radial-gradient(circle at 90% 5%, rgba(227, 121, 29, 0.14) 0%, transparent 36%);
  color: var(--ink);
  font-family: "Prompt", "Sora", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Header & Zero-Clutter Navigation (Scrolls naturally so mobile screen has 100% workspace) */
.top-header {
  position: relative;
  z-index: 50;
  background: rgba(14, 14, 14, 0.95);
  border-bottom: 1px solid rgba(227, 121, 29, 0.28);
}

.header-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-box {
  width: 44px;
  height: 44px;
  background: #141414;
  border: 1px solid rgba(227, 121, 29, 0.35);
  border-radius: 12px;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(227, 121, 29, 0.22);
}

.brand-kicker {
  font-family: "Sora", sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--orange-light);
  text-transform: uppercase;
  line-height: 1.1;
}

.brand-title {
  margin: 0;
  font-family: "Sora", "Prompt", sans-serif;
  font-size: clamp(17px, 2.4vw, 22px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #FFFFFF 0%, #FDBA74 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 8 Friendly Icon-First Mode Switcher Tiles on Desktop (5 Spacious Buttons on Mobile) */
.mode-bar {
  max-width: 1220px;
  margin: 0 auto;
  padding: 2px 16px 12px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
}

.mob-only-lbl {
  display: none;
}

.tab-short {
  display: none;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 9px 6px;
  border-radius: 14px;
  border: 1px solid #2A2A2A;
  background: linear-gradient(180deg, #1E1E1E, #151515);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: center;
  min-width: 0;
}

.mode-icon {
  font-size: 22px;
  line-height: 1.15;
  margin-bottom: 2px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
  transition: transform 0.16s ease;
}

.mode-btn:hover .mode-icon {
  transform: scale(1.12);
}

.mode-label {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.mode-sub {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.15;
  white-space: nowrap;
}

.mode-btn:hover {
  border-color: rgba(227, 121, 29, 0.55);
  background: #202020;
}

.mode-btn.active {
  background: linear-gradient(135deg, #E3791D, #F59E0B);
  color: #0E0E0E;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(227, 121, 29, 0.32);
}

.mode-btn.active .mode-sub {
  color: rgba(14, 14, 14, 0.78);
  font-weight: 600;
}

@media (max-width: 860px) {
  .header-inner {
    padding: 7px 10px;
    gap: 6px;
  }
  .logo-box {
    width: 34px;
    height: 34px;
    padding: 2px;
    border-radius: 9px;
  }
  .brand-kicker {
    font-size: 8.5px;
  }
  .brand-title {
    font-size: 16px;
  }
  .header-controls {
    gap: 4px;
  }
  .header-controls select,
  .header-controls input,
  .header-controls .btn {
    padding: 4px 7px;
    font-size: 11.5px;
  }
  .mode-bar {
    padding: 0 8px 8px;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
  }
  .mode-btn {
    padding: 6px 2px !important;
    border-radius: 10px !important;
    gap: 1px !important;
  }
  .mode-icon {
    font-size: 18px;
    margin-bottom: 1px;
  }
  .mode-label {
    font-size: 10.5px;
  }
  .mode-sub {
    display: none;
  }
  .container {
    padding: 8px 10px !important;
  }
  .card {
    padding: 12px !important;
    margin-bottom: 12px !important;
  }
}

/* Main Container */
.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 16px;
}

.view-section {
  display: none;
  animation: fadeIn 0.2s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.grid-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.grid-2 > *,
.grid-equal > *,
.grid-3 > *,
.grid-4 > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 960px) {
  .grid-2, .grid-equal, .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Cards */
.card {
  background: linear-gradient(180deg, #1E1E1E, var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.card-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.card-hd > div:first-child {
  flex: 1;
  min-width: 180px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-sub {
  font-size: 12.5px;
  color: var(--muted);
}

/* Inputs & Buttons */
input, select, textarea {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid #303030;
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  max-width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(227, 121, 29, 0.22);
}

button {
  font-family: inherit;
  cursor: pointer;
}

.btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.14s ease;
}

.btn:hover {
  border-color: var(--orange);
  background: #1F1F1F;
}

.btn-primary {
  background: linear-gradient(135deg, #E3791D, #F08A30);
  color: #0E0E0E;
  border: none;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(227, 121, 29, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #F08A30, #F59E0B);
  color: #0E0E0E;
  transform: translateY(-1px);
}

.btn-green {
  background: linear-gradient(135deg, #059669, #10B981);
  color: #061A11;
  border: none;
  font-weight: 700;
}

.btn-danger {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.3);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.pill.orange {
  background: rgba(227, 121, 29, 0.15);
  border-color: rgba(227, 121, 29, 0.4);
  color: #FDBA74;
}

.pill.green {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
}

.pill.warn {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: #FDE68A;
}

.pill.danger {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.4);
  color: #FCA5A5;
}

/* Compass Ring & Today Balance */
.compass-wrap {
  display: grid;
  grid-template-columns: 185px 1fr;
  gap: 18px;
  align-items: center;
}

@media (max-width: 600px) {
  .compass-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
  }
  .ring-box {
    width: 135px !important;
    height: 135px !important;
  }
  .ring-val {
    font-size: 23px !important;
  }
  .macro-bars {
    gap: 7px !important;
  }
  .macro-row {
    padding: 7px 10px !important;
  }
  .macro-top {
    font-size: 12px !important;
    flex-wrap: wrap;
    gap: 4px;
  }
}

.ring-box {
  position: relative;
  width: 175px;
  height: 175px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-center {
  position: absolute;
  text-align: center;
}

.ring-val {
  font-family: "Sora", sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.ring-lbl {
  font-size: 11.5px;
  color: var(--muted);
}

/* Macro Bars */
.macro-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.macro-row {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px;
}

.macro-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 5px;
}

.progress-track {
  height: 8px;
  background: #262626;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* Quick Chips for 1-Tap Food & Exercise */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.food-chip {
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid #2F2F2F;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 100%;
  transition: all 0.14s ease;
}

.food-chip-title {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.food-chip-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .food-chip {
    width: 100%;
    font-size: 12.5px;
    padding: 7px 9px;
  }
  .cat-pill-btn {
    padding: 5px 9px;
    font-size: 11.5px;
  }
  .clean-table th, .clean-table td {
    padding: 7px 6px;
    font-size: 12.5px;
  }
}

.food-chip:hover {
  border-color: var(--orange);
  background: rgba(227, 121, 29, 0.12);
  transform: translateY(-1px);
}

.food-chip small {
  color: var(--orange-light);
  font-family: "Sora", sans-serif;
  font-size: 11px;
}

.fav-star-btn {
  background: transparent;
  border: none;
  padding: 2px 4px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: #6B7280;
  border-radius: 6px;
  transition: transform 0.12s ease, color 0.12s ease;
}

.fav-star-btn:hover {
  transform: scale(1.2);
}

.fav-star-btn.is-fav {
  color: #FBBF24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.45);
}

.cat-pill-btn {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #2E2E2E;
  background: #141414;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.cat-pill-btn:hover {
  border-color: rgba(227, 121, 29, 0.5);
  color: var(--ink);
}

.cat-pill-btn.active {
  background: rgba(227, 121, 29, 0.18);
  border-color: var(--orange);
  color: #FDBA74;
}

/* Water Glasses */
.water-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.glass-btn {
  width: 42px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid #2F2F2F;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.glass-btn.filled {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38BDF8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.22);
}

/* Day 1 vs Current Comparison KPI Cards */
.compare-banner {
  background: linear-gradient(135deg, rgba(0, 74, 42, 0.35), rgba(227, 121, 29, 0.16));
  border: 1px solid rgba(227, 121, 29, 0.35);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.kpi-num {
  font-family: "Sora", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.kpi-sub {
  font-size: 12px;
  margin-top: 4px;
  color: var(--muted);
}

/* Chart Container */
.chart-box {
  background: #111111;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  position: relative;
}

/* Meal Plan Cards */
.meal-day-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.meal-slot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed #2A2A2A;
}

.meal-slot:last-child {
  border-bottom: none;
}

/* Shopping List */
.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid #262626;
  margin-bottom: 6px;
  cursor: pointer;
}

.shop-item.checked {
  opacity: 0.52;
  text-decoration: line-through;
}

/* Tables */
.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.clean-table th, .clean-table td {
  padding: 8px 10px;
  border-bottom: 1px dashed #292929;
  text-align: left;
}

.clean-table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.text-right {
  text-align: right !important;
}

details.clean-details {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 10px;
}

details.clean-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--orange-light);
}

/* =========================================================================
   v3.8 ICON-FIRST INTERFACE & DYNAMICWORK FOOTER CREDIT
   ========================================================================= */

/* Big Card Header Icon Badge */
.card-hd-title-group {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.card-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: rgba(227, 121, 29, 0.14);
  border: 1px solid rgba(227, 121, 29, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-icon-badge.green {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.36);
}

.card-icon-badge.blue {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.36);
}

/* 1-Tap Meal Icon Bar (5 Big Meal Tiles) */
.meal-icon-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.meal-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 12px;
  border: 1px solid #2C2C2C;
  background: #141414;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 0;
}

.meal-icon-btn .m-ico {
  font-size: 22px;
  line-height: 1.1;
  transition: transform 0.14s ease;
}

.meal-icon-btn .m-lbl {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}

.meal-icon-btn:hover {
  border-color: rgba(227, 121, 29, 0.5);
  color: var(--ink);
  background: #1B1B1B;
}

.meal-icon-btn:hover .m-ico {
  transform: scale(1.1);
}

.meal-icon-btn.active {
  background: rgba(227, 121, 29, 0.18);
  border-color: var(--orange);
  color: #FDBA74;
  box-shadow: 0 4px 14px rgba(227, 121, 29, 0.2);
}

.meal-icon-btn.active .m-lbl {
  color: #FFFFFF;
  font-weight: 700;
}

/* 1-Tap Portion Multiplier Bar */
.portion-pill-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #141414;
  border: 1px solid #282828;
  border-radius: 11px;
  padding: 5px 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.portion-pill-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  flex: 1;
  min-width: 200px;
}

.portion-pill-btn {
  padding: 5px 6px;
  border-radius: 8px;
  border: 1px solid #2E2E2E;
  background: #1B1B1B;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.14s ease;
}

.portion-pill-btn small {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  opacity: 0.8;
}

.portion-pill-btn:hover {
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--ink);
}

.portion-pill-btn.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--green);
  color: #6EE7B7;
  font-weight: 700;
}

/* Quick Workout Big Icon Cards */
.workout-icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .workout-icon-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-icon-badge {
    width: 36px;
    height: 36px;
    font-size: 19px;
    border-radius: 10px;
  }
  .meal-icon-btn {
    padding: 7px 2px;
  }
  .meal-icon-btn .m-ico {
    font-size: 19px;
  }
  .meal-icon-btn .m-lbl {
    font-size: 10.5px;
  }
}

.workout-icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid #2E2E2E;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.workout-icon-card:hover {
  border-color: var(--green);
  background: rgba(16, 185, 129, 0.12);
  transform: translateY(-2px);
}

.workout-icon-card .w-ico {
  font-size: 26px;
  line-height: 1.1;
  margin-bottom: 2px;
}

.workout-icon-card .w-title {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
}

.workout-icon-card .w-sub {
  font-size: 10.5px;
  color: var(--muted);
}

.workout-icon-card .w-kcal {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #6EE7B7;
  background: rgba(16, 185, 129, 0.14);
  padding: 1px 7px;
  border-radius: 999px;
  margin-top: 2px;
}

/* Larger Water Glass Buttons */
.glass-btn {
  width: 48px;
  height: 54px;
  border-radius: 12px;
  font-size: 20px;
  gap: 2px;
}

/* Dynamicwork Brand Footer */
.app-footer {
  max-width: 1220px;
  margin: 18px auto 28px;
  padding: 0 16px;
}

.footer-brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), rgba(16, 16, 16, 0.95));
  border: 1px solid #292929;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.18s ease;
}

.footer-brand-link:hover {
  border-color: rgba(227, 121, 29, 0.55);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), 0 0 18px rgba(227, 121, 29, 0.14);
  transform: translateY(-1px);
}

.footer-dw-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #111111;
  border: 1px solid #2E2E2E;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.footer-brand-title {
  font-family: "Sora", "Prompt", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.footer-brand-title span.hl {
  color: var(--orange-light);
}

.footer-brand-sub {
  font-size: 11px;
  color: var(--muted);
}

/* =========================================================================
   v3.9 & v4.0 UX/UI UPGRADE:
   - Fix CSS class sync (.mini-ring-grams, .mini-ring-status, .quick-link-pill, .if-stage-card.active-stage)
   - Compact Mobile Hero Compass (side-by-side calorie ring + 3 stats on mobile)
   - Sticky Mobile Bottom Navigation Dock
   - Floating Toast Notification + Undo
   - Smart Filter Pills & Quantity +/- Steppers
   ========================================================================= */

/* Compact Compass Grid Areas (Desktop: Ring left + Stats/Rings right | Mobile: Ring+Stats row 1, 2x2 Rings row 2) */
.compass-wrap.v4-compass {
  display: grid;
  grid-template-columns: 180px 1fr;
  grid-template-areas:
    "ring stats"
    "ring rings";
  gap: 10px 18px;
  align-items: center;
}

.compass-ring-area {
  grid-area: ring;
  justify-self: center;
}

.compass-stats-area {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  background: #131313;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid #292929;
  width: 100%;
}

.compass-rings-area {
  grid-area: rings;
  width: 100%;
}

@media (max-width: 720px) {
  .compass-wrap.v4-compass {
    grid-template-columns: 118px 1fr;
    grid-template-areas:
      "ring stats"
      "rings rings";
    gap: 10px;
    align-items: center;
  }

  .compass-wrap.v4-compass .ring-box {
    width: 116px !important;
    height: 116px !important;
  }

  .compass-wrap.v4-compass .ring-val {
    font-size: 21px !important;
  }

  .compass-wrap.v4-compass .ring-lbl {
    font-size: 10px !important;
  }

  .compass-stats-area {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 7px 10px;
    text-align: left;
  }

  .compass-stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 2px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  }

  .compass-stat-item:last-child {
    border-bottom: none;
  }
}

/* Set 2: 4 Rings Grid (Protein, Carbs, Fat, Water) — 4 cols on desktop, 2x2 on mobile */
.macro-rings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

@media (max-width: 720px) {
  .macro-rings-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.mini-ring-card {
  background: #131313;
  border: 1px solid #292929;
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.18s ease;
  min-width: 0;
}

.mini-ring-card[data-jump-view],
.mini-ring-card.clickable {
  cursor: pointer;
}

.mini-ring-card[data-jump-view]:hover,
.mini-ring-card.clickable:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
}

.mini-ring-card.status-ok {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.09), #131313);
}

.mini-ring-card.status-warn {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.11), #131313);
}

.mini-ring-card.status-danger {
  border-color: rgba(239, 68, 68, 0.72);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.16), #131313);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.18);
}

.mini-ring-svg-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3px 0 4px;
}

@media (max-width: 600px) {
  .mini-ring-svg-wrap {
    width: 68px;
    height: 68px;
  }
}

.mini-ring-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
}

.mini-ring-pct {
  font-family: "Sora", sans-serif;
  font-size: 14.5px;
  font-weight: 800;
}

.mini-ring-unit {
  font-size: 9.5px;
  color: var(--muted);
}

.mini-ring-title {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
}

.mini-ring-grams,
.mini-ring-nums {
  font-family: "Sora", "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: #E5E5E5;
  margin: 1px 0 4px;
}

.mini-ring-status,
.mini-ring-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1E1E1E;
  border: 1px solid #2E2E2E;
  color: var(--muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-ring-card.status-ok .mini-ring-status,
.mini-ring-card.status-ok .mini-ring-badge {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.38);
  color: #6EE7B7;
}

.mini-ring-card.status-warn .mini-ring-status,
.mini-ring-card.status-warn .mini-ring-badge {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
  color: #FDE68A;
}

.mini-ring-card.status-danger .mini-ring-status,
.mini-ring-card.status-danger .mini-ring-badge {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.5);
  color: #FCA5A5;
}

/* Quick Cross-Link Bar inside Compass (3 sleek cards in 1 row even on mobile!) */
.compass-quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.quick-link-pill,
.quick-link-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 11px;
  background: linear-gradient(180deg, #1B1B1B, #131313);
  border: 1px solid #2C2C2C;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  min-width: 0;
}

.quick-link-pill:hover,
.quick-link-tile:hover {
  border-color: var(--orange);
  background: #202020;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .compass-quick-links {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .quick-link-pill,
  .quick-link-tile {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 7px 8px;
    gap: 2px;
    font-size: 11px;
  }
  .quick-link-pill .ql-arrow {
    display: none;
  }
}

/* Auto-Time Detection Bar */
.auto-time-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(227, 121, 29, 0.08);
  border: 1px dashed rgba(227, 121, 29, 0.35);
  border-radius: 11px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

/* Smart Filter Pills Row (⭐ โปรด • 🕒 ล่าสุด • 💪 โปรตีนสูง • 🏪 7-11 • 📋 ทั้งหมด) */
.smart-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.smart-filter-bar::-webkit-scrollbar {
  display: none;
}

.smart-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #2E2E2E;
  background: #151515;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.smart-filter-btn:hover {
  border-color: rgba(227, 121, 29, 0.55);
  color: var(--ink);
  background: #1D1D1D;
}

.smart-filter-btn.active {
  background: linear-gradient(135deg, rgba(227, 121, 29, 0.24), rgba(245, 158, 11, 0.16));
  border-color: var(--orange);
  color: #FFEAD5;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(227, 121, 29, 0.18);
}

/* Enhanced Food Chip Badges & Tap Pulse */
.food-chip {
  position: relative;
  padding: 8px 11px;
  border-radius: 11px;
  background: linear-gradient(180deg, #181818, #131313);
  border: 1px solid #2C2C2C;
}

.food-chip:active {
  transform: scale(0.98);
}

.food-chip.just-added {
  border-color: var(--green) !important;
  background: rgba(16, 185, 129, 0.18) !important;
}

.chip-kcal-tag {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #FDBA74;
  background: rgba(227, 121, 29, 0.14);
  padding: 2px 6px;
  border-radius: 6px;
}

.chip-prot-tag {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #6EE7B7;
  background: rgba(16, 185, 129, 0.14);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Meal Summary Breakdown Strip above Today's Food Table */
.meal-summary-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-top: 12px;
  margin-bottom: 6px;
  scrollbar-width: none;
}

.meal-summary-strip::-webkit-scrollbar {
  display: none;
}

.meal-sum-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #141414;
  border: 1px solid #292929;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.meal-sum-pill.has-items {
  border-color: rgba(16, 185, 129, 0.38);
  background: rgba(16, 185, 129, 0.08);
  color: var(--ink);
}

/* Quantity +/- Stepper inside Today's Food Log Table */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.qty-step-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #333333;
  background: #1B1B1B;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.12s ease;
}

.qty-step-btn:hover {
  border-color: var(--orange);
  background: rgba(227, 121, 29, 0.18);
  color: #FDBA74;
}

/* Water Quick Action Buttons */
.water-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

@media (max-width: 520px) {
  .water-quick-actions {
    grid-template-columns: 1fr 1fr 0.8fr;
    gap: 6px;
  }
}

/* IF 5-Stage Metabolic Cards & IF Progress Track */
.if-progress-wrap {
  margin-top: 10px;
  background: #181818;
  border: 1px solid #2A2A2A;
  border-radius: 12px;
  padding: 10px 12px;
}

.if-stage-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 860px) {
  .if-stage-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.if-stage-card {
  background: #141414;
  border: 1px solid #292929;
  border-radius: 12px;
  padding: 10px;
  font-size: 12px;
  transition: all 0.16s ease;
}

.if-stage-card.active,
.if-stage-card.active-stage {
  border-color: var(--orange);
  background: linear-gradient(180deg, rgba(227, 121, 29, 0.18), #151515);
  box-shadow: 0 0 16px rgba(227, 121, 29, 0.24);
}

.if-stage-time {
  font-family: "Sora", "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange-light);
  margin-bottom: 3px;
}

.if-stage-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}

.if-stage-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

/* Floating Toast Notification + Undo Bar */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  z-index: 1200;
  background: rgba(20, 24, 22, 0.97);
  border: 1px solid rgba(16, 185, 129, 0.55);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65), 0 0 20px rgba(16, 185, 129, 0.2);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  max-width: min(94vw, 540px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.app-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.app-toast-msg {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-toast-undo {
  background: rgba(227, 121, 29, 0.2);
  border: 1px solid rgba(227, 121, 29, 0.55);
  color: #FDBA74;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.app-toast-undo:hover {
  background: var(--orange);
  color: #0E0E0E;
}

/* Mobile Sticky Bottom Navigation Dock (5 Spacious Thumb-Friendly Tabs on Mobile!) */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }

  .nav-desk-only,
  .desk-only-lbl {
    display: none !important;
  }

  .mob-only-lbl {
    display: inline !important;
  }

  .mode-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    margin: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(14, 14, 14, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(227, 121, 29, 0.35);
    box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.6);
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 5px;
  }

  .mode-btn {
    background: transparent;
    border-color: transparent;
    padding: 5px 2px !important;
    border-radius: 11px !important;
  }

  .mode-label {
    font-size: 11px;
  }

  .mode-btn.active,
  .mode-btn.mobile-group-active {
    background: linear-gradient(135deg, #E3791D, #F59E0B);
    color: #0E0E0E;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(227, 121, 29, 0.35);
  }

  .app-toast {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    border-radius: 14px;
    padding: 9px 12px;
    font-size: 12.5px;
  }
}

/* =========================================================================
   v4.1 CUSTOM PORTION INPUT, LAZY CHIP PAGINATION & LOCAL FOOD BADGE
   ========================================================================= */

.custom-portion-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px dashed #3A3A3A;
  background: #181818;
  color: var(--muted);
  cursor: text;
  transition: all 0.14s ease;
  min-width: 0;
}

.custom-portion-box:hover {
  border-color: rgba(16, 185, 129, 0.5);
  background: #1D1D1D;
}

.custom-portion-box.active {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid var(--green);
  color: #6EE7B7;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.16);
}

.custom-portion-inp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
}

.custom-portion-box input#customPortionInp {
  width: 58px;
  padding: 1px 3px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: "Sora", "Prompt", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  border-radius: 4px;
  box-shadow: none;
  -moz-appearance: textfield;
}

.custom-portion-box input#customPortionInp::-webkit-outer-spin-button,
.custom-portion-box input#customPortionInp::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.custom-portion-box input#customPortionInp::placeholder {
  font-family: "Prompt", sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.custom-portion-box.active input#customPortionInp {
  color: #6EE7B7;
}

.custom-portion-x {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.custom-portion-box.active .custom-portion-x {
  color: #6EE7B7;
}

.custom-portion-box small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  opacity: 0.82;
  line-height: 1.1;
  white-space: nowrap;
}

/* Lazy Batch Load-More Button inside #quickFoodChips */
.btn-load-more-chips {
  width: 100%;
  margin-top: 6px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(227, 121, 29, 0.5);
  background: rgba(227, 121, 29, 0.1);
  color: #FDBA74;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-load-more-chips:hover {
  background: rgba(227, 121, 29, 0.2);
  border-color: var(--orange);
  color: #FFFFFF;
}

.chip-local-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #93C5FD;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 999px;
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* =========================================================================
   v4.2 UX OVERHAUL:
   - Dedicated Home Graph Hub (#view-home) + Contextual Action Icons beside charts
   - Zero-Scroll Food Logger (#view-today) with Slim Live Quota Bar
   - 1-Line Collapsible Smart Coach & Water Alerts (click to expand)
   - Mobile 5-Tab Dock + Activity Sub-Switcher + Responsive Weekly Meal Cards
   ========================================================================= */

.compass-stats-stack {
  grid-area: stats;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.ring-direct-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 8px;
  width: 100%;
}

.ring-cta-main {
  padding: 9px 12px;
  font-size: 13.5px;
  border-radius: 11px;
  white-space: nowrap;
}

.ring-cta-sub {
  padding: 9px 10px;
  font-size: 13px;
  border-radius: 11px;
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.1);
  color: #6EE7B7;
  white-space: nowrap;
}

.ring-cta-sub:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--green);
  color: #FFFFFF;
}

@media (max-width: 640px) {
  .ring-direct-actions {
    grid-template-columns: 1.15fr 0.95fr;
    gap: 5px;
  }
  .ring-cta-main,
  .ring-cta-sub {
    padding: 7px 6px;
    font-size: 11.5px;
    border-radius: 9px;
  }
}

/* Contextual Micro-Action Buttons Inside Each Mini-Ring Card */
.mini-ring-btn-row {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  margin-top: 6px;
}

.mini-ring-action-btn {
  margin-top: 6px;
  width: 100%;
  padding: 5px 7px;
  border-radius: 8px;
  border: 1px solid #303030;
  background: #1B1B1B;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.mini-ring-btn-row .mini-ring-action-btn {
  margin-top: 0;
  flex: 1;
}

.mini-ring-action-btn.icon-only {
  flex: 0 0 32px;
  width: 32px;
  padding: 5px 0;
}

.mini-ring-action-btn:hover {
  border-color: var(--orange);
  background: rgba(227, 121, 29, 0.18);
  color: #FDBA74;
}

.mini-ring-action-btn.primary-blue {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  color: #BAE6FD;
}

.mini-ring-action-btn.primary-blue:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: #38BDF8;
  color: #FFFFFF;
}

/* 1-Line Collapsible Smart Coach & Alert Bar */
details.coach-compact-details {
  margin-top: 10px;
  border-radius: 12px;
  background: #141414;
  border: 1px solid #2C2C2C;
  padding: 8px 12px;
  transition: border-color 0.18s ease, background 0.18s ease;
}

details.coach-compact-details.status-danger {
  border-color: rgba(248, 113, 113, 0.55);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.13), #141414);
}

details.coach-compact-details.status-warn {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), #141414);
}

details.coach-compact-details.status-ok {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), #141414);
}

details.coach-compact-details.water-theme {
  border-color: rgba(56, 189, 248, 0.38);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.1), #131820);
}

.coach-compact-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.coach-compact-summary::-webkit-details-marker {
  display: none;
}

.coach-headline-short {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.coach-expand-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #FDBA74;
  background: rgba(227, 121, 29, 0.14);
  border: 1px solid rgba(227, 121, 29, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

details.coach-compact-details.water-theme .coach-expand-pill {
  color: #BAE6FD;
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
}

details.coach-compact-details[open] .coach-expand-pill .chev {
  display: inline-block;
  transform: rotate(180deg);
}

.coach-expanded-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Home Meal Summary Strip & Clickable Meal Pills */
.home-meal-strip-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.home-meal-strip-lbl {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.meal-sum-pill.clickable-meal {
  cursor: pointer;
  transition: all 0.14s ease;
}

.meal-sum-pill.clickable-meal:hover {
  border-color: var(--orange);
  background: rgba(227, 121, 29, 0.15);
  color: #FFFFFF;
}

/* Home 2-Column Mini Charts Grid (Weight Sparkline + Live IF) */
.home-mini-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 820px) {
  .home-mini-charts-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.home-mini-card {
  padding: 14px !important;
}

.home-mini-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.home-mini-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.home-mini-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.home-mini-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.home-sparkline-box {
  margin-top: 8px;
  background: #121212;
  border: 1px solid #262626;
  border-radius: 11px;
  padding: 6px 10px;
  height: 76px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.home-sparkline-box:hover,
.home-if-mini-track:hover {
  border-color: rgba(227, 121, 29, 0.5);
}

.home-if-mini-track {
  margin-top: 8px;
  background: #121212;
  border: 1px solid #262626;
  border-radius: 11px;
  padding: 9px 11px;
  transition: border-color 0.15s ease;
}

/* Zero-Scroll Food Logger (#view-today) Slim Live Quota Bar */
.slim-quota-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(135deg, rgba(28, 22, 16, 0.96), #141414);
  border: 1px solid rgba(227, 121, 29, 0.42);
  border-radius: 13px;
  padding: 7px 11px;
  margin-bottom: 10px;
  font-size: 12.5px;
}

.slim-quota-metrics {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.sq-main {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.sq-sep {
  color: var(--dim);
}

.sq-macro {
  font-family: "Sora", "Prompt", sans-serif;
  font-size: 11.5px;
  color: #D4D4D4;
  background: #1D1D1D;
  border: 1px solid #2E2E2E;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.slim-home-btn {
  padding: 4px 9px;
  font-size: 11.5px;
  border-radius: 9px;
  flex-shrink: 0;
  white-space: nowrap;
}

.food-logger-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Hide Custom Food Drawer completely when closed so 0px sits between filters & chips */
details.custom-food-drawer:not([open]) {
  display: none !important;
}

/* Mobile Activity Sub-Navigation Bar (Workout • Water • IF) */
.activity-sub-nav {
  display: none;
}

@media (max-width: 768px) {
  .activity-sub-nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 5px;
    margin-bottom: 10px;
    background: #141414;
    border: 1px solid #2A2A2A;
    border-radius: 12px;
    padding: 4px;
  }

  .act-sub-btn {
    padding: 7px 6px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    transition: all 0.14s ease;
  }

  .act-sub-btn.active {
    background: linear-gradient(135deg, #E3791D, #F59E0B);
    color: #0E0E0E;
    box-shadow: 0 3px 10px rgba(227, 121, 29, 0.28);
  }

  .act-sub-btn.home-back {
    border-left: 1px solid #292929;
    border-radius: 0 9px 9px 0;
    color: #FDBA74;
    padding: 7px 8px;
  }
}

/* Mobile Card Layout for 7-Day Weekly Meal Plan Table (Zero horizontal crunching!) */
@media (max-width: 680px) {
  #weeklyPlanTable thead {
    display: none;
  }

  #weeklyPlanTable,
  #weeklyPlanTable tbody {
    display: block;
    width: 100%;
  }

  #weeklyPlanTable tr {
    display: block;
    background: #141414;
    border: 1px solid #2B2B2B;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }

  #weeklyPlanTable td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
    text-align: left !important;
    font-size: 12.5px;
  }

  #weeklyPlanTable td:first-child {
    font-size: 14px;
    color: var(--orange-light);
    border-bottom: 1px solid #292929;
    padding-bottom: 6px;
    margin-bottom: 3px;
  }

  #weeklyPlanTable td:last-child {
    border-bottom: none;
    padding-top: 8px;
    justify-content: flex-end;
  }

  #weeklyPlanTable td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 88px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
  }
}





