/* ===== Design tokens ===== */
:root{
  --media9x16-h: clamp(360px, 52vw, 520px);
  --app-bg: #f3f1e8;
  --app-bg-accent: #ebe6d7;
  --app-shell-bg: linear-gradient(180deg, rgba(247,245,238,.96), rgba(241,237,227,.98));
  --app-surface: rgba(255,255,255,.94);
  --app-surface-strong: #ffffff;
  --app-surface-muted: rgba(243,239,228,.9);
  --app-surface-inset: rgba(25,25,21,.03);
  --app-text: #171714;
  --app-text-muted: rgba(23,23,20,.62);
  --app-text-soft: rgba(23,23,20,.48);
  --app-border: rgba(26,26,22,.1);
  --app-border-strong: rgba(26,26,22,.18);
  --app-accent: #c6a646;
  --app-accent-soft: rgba(198,166,70,.16);
  --app-accent-strong: #9b7d21;
  --app-success: #4f8b48;
  --app-success-soft: rgba(79,139,72,.14);
  --app-danger-soft: rgba(176,66,66,.1);
  --radius-xs: .7rem;
  --radius-sm: .9rem;
  --radius-md: 1rem;
  --radius-lg: 1.2rem;
  --space-1: .35rem;
  --space-2: .55rem;
  --space-3: .8rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --shadow-sm: 0 .32rem .85rem rgba(22,18,8,.05);
  --shadow-md: 0 .55rem 1.25rem rgba(22,18,8,.08);
  --shadow-lg: 0 1rem 2.4rem rgba(20,16,6,.12);
  /* bottom nav (floating pill) */
  --bottom-nav-h: 64px;
  --bottom-nav-gap: 12px;
  --swipe-rail-h: 34px;
  --bottom-nav-bg: rgba(16,18,18,.86);
  --bottom-nav-border: rgba(255,255,255,.14);
  --bottom-nav-muted: rgba(255,255,255,.68);
  --bottom-nav-active: #f7fbf2;
  --bottom-nav-ink: #121512;
  --bottom-nav-accent: #9de84d;
  /* Solid controls (active pills, primary buttons): ink on light, cream on dark */
  --solid-bg: #171714;
  --solid-fg: #fff;
  --solid-bg-hover: #0d0d0c;
  --switch-bg: #2a2a26;        /* Home/Gym/Hybrid active segment: charcoal, not pure black */
  --switch-fg: #fff;
  /* Text on muscle-colour / success / gold surfaces: constant across themes */
  --on-color: #fff;
  --on-gold: #171714;
  --gold-a: #D6B85A;
  --gold-b: #B8952F;
  --gold-active: #E2C76C;
  /* Dark cards (Next up, program cards) and media backgrounds: dark in both themes */
  --card-dark: #171714;
  --card-dark-fg: #fff;
  --media-bg: #2B2B27;
  /* Ends of color-mix() ramps: swap in dark mode so tints go lighter, not darker */
  --mix-deep: #000;
  --mix-base: #fff;
  /* Macros: identity colours for protein / carbs / fat (validated for CVD + contrast
     on the light surface); calories use the ink colour. Bars and lines use --chart. */
  --macro-protein: #C8402F;
  --macro-carbs: #2F7FC1;
  --macro-fat: #B07812;
  --chart: #B8952F;
  --chart-wash: rgba(184,149,47,.12);
  /* Top bar */
  --bar-bg: rgba(18,21,18,.96);
  --bar-fg: #fff;
  --bar-muted: rgba(255,255,255,.7);
  --bar-border: rgba(255,255,255,.08);
  --bar-field: rgba(255,255,255,.09);
  --bar-field-focus: rgba(255,255,255,.15);
  --bar-active-bg: #F7FBF2;
  --bar-active-fg: #121512;
  --danger-text: #A23B3B;
  --warn-text: #B58A1E;
  color-scheme: light;
}


/* ===== Dark theme =====
   Set by the nfg_theme cookie (server) or the device setting (inline script in
   base.html). Only tokens change here; components never branch on the theme. */
:root[data-theme="dark"]{
  --app-bg: #121512;
  --app-bg-accent: #171a17;
  --app-shell-bg: linear-gradient(180deg, rgba(22,25,22,.96), rgba(18,21,18,.98));
  --app-surface: rgba(30,33,30,.94);
  --app-surface-strong: #1f221f;
  --app-surface-muted: rgba(38,41,38,.9);
  --app-surface-inset: rgba(255,255,255,.05);
  --app-text: #f1eee4;
  --app-text-muted: rgba(241,238,228,.66);
  --app-text-soft: rgba(241,238,228,.5);
  --app-border: rgba(255,255,255,.1);
  --app-border-strong: rgba(255,255,255,.2);
  --app-accent: #d6b85a;
  --app-accent-soft: rgba(214,184,90,.16);
  --app-accent-strong: #e2c76c;
  --app-success: #6fb366;
  --app-success-soft: rgba(111,179,102,.18);
  --app-danger-soft: rgba(216,90,90,.16);
  --shadow-sm: 0 .32rem .85rem rgba(0,0,0,.25);
  --shadow-md: 0 .55rem 1.25rem rgba(0,0,0,.32);
  --shadow-lg: 0 1rem 2.4rem rgba(0,0,0,.45);
  --bottom-nav-bg: rgba(10,12,10,.86);
  --bottom-nav-border: rgba(255,255,255,.12);
  --solid-bg: #f1eee4;
  --solid-fg: #171714;
  --solid-bg-hover: #ffffff;
  --switch-bg: #f1eee4;
  --switch-fg: #171714;
  --card-dark: #262925;
  --media-bg: #1a1c1a;
  --mix-deep: #fff;
  --mix-base: #1f221f;
  --macro-protein: #D85A48;
  --macro-carbs: #3F86C8;
  --macro-fat: #C08A1E;
  --chart: #D6B85A;
  --chart-wash: rgba(214,184,90,.12);
  --bar-bg: rgba(10,12,10,.9);
  --bar-border: rgba(255,255,255,.08);
  --danger-text: #e07a7a;
  --warn-text: #d9b24a;
  color-scheme: dark;
}

:root[data-theme="dark"] body{
  background:
    radial-gradient(circle at top left, rgba(214,184,90,.07), transparent 28%),
    linear-gradient(180deg, var(--app-bg), var(--app-bg-accent));
}

/* Basic page scaling */
h1.page-title{ font-size: clamp(1.75rem, 2.5vw, 2.25rem); }

/* Prevent horizontal jiggle on mobile */
html, body{ overflow-x: hidden; }
html{ background: var(--app-bg); }

body{
  color: var(--app-text);
  background:
    radial-gradient(circle at top left, rgba(198,166,70,.08), transparent 28%),
    linear-gradient(180deg, var(--app-bg), var(--app-bg-accent));
}

body.bg-light{
  background:
    radial-gradient(circle at top left, rgba(198,166,70,.08), transparent 28%),
    linear-gradient(180deg, var(--app-bg), var(--app-bg-accent)) !important;
}

a{
  color: inherit;
}

.text-muted,
.small.text-muted,
.text-body-secondary{
  color: var(--app-text-muted) !important;
}

/* Slightly nicer card text rhythm (helps your Bio block) */
.card .card-body{
  line-height: 1.35;
}

/* Keep alerts above surrounding content */
.alert { z-index: 1; position: relative; }

.app-main-shell{
  min-height: calc(100vh - 150px);
}

.app-page-shell{
  position: relative;
}

.app-page{
  display: grid;
  gap: var(--space-5);
}

.app-page-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.app-page-kicker{
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--app-text-soft);
  margin-bottom: .25rem;
}
.app-page-kicker.is-greeting{ text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 700; color: var(--app-text-muted); }

.app-page-copy{
  color: var(--app-text-muted);
  font-size: .92rem;
  line-height: 1.4;
  margin-bottom: 0;
  max-width: 44rem;
}

.app-section-kicker{
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--app-text-soft);
  margin-bottom: .2rem;
}

.app-surface,
.flow-card,
.week-detail-panel,
.home-program-card .card,
.home-library,
.home-hero,
.filter-toolbar{
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  background: var(--app-surface);
  box-shadow: var(--shadow-sm);
}

.app-surface-muted{
  background: linear-gradient(180deg, color-mix(in srgb, var(--app-surface-strong) 92%, transparent), var(--app-surface-muted));
}

.app-surface-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: .9rem 1rem .15rem;
}

.app-surface-header h2,
.app-surface-header strong{
  font-size: .98rem;
  font-weight: 700;
  color: var(--app-text);
}

.app-list-card .card-header,
.app-list-card .card-footer,
.app-surface .card-header,
.app-surface .card-footer{
  background: transparent;
  border-color: var(--app-border);
}

.app-list-row,
.list-group-item.list-group-item-action{
  border-color: var(--app-border);
  background: transparent;
  color: var(--app-text);
  padding: .82rem 1rem;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.app-list-row:hover,
.list-group-item.list-group-item-action:hover{
  background: var(--app-surface-inset);
  color: var(--app-text);
}

.app-list-row.active,
.list-group-item.list-group-item-action.active{
  background: color-mix(in srgb, var(--app-text) 92%, transparent);
  border-color: color-mix(in srgb, var(--app-text) 92%, transparent);
}

.app-list-arrow{
  color: var(--app-text-soft);
  font-size: .82rem;
}

.app-note{
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, color-mix(in srgb, var(--app-surface-strong) 70%, transparent), color-mix(in srgb, var(--app-surface-muted) 92%, transparent));
  padding: .8rem .9rem;
  color: var(--app-text-muted);
  font-size: .82rem;
  line-height: 1.35;
}

.app-sidebar-stack{
  display: grid;
  gap: 1rem;
}

.app-chip,
.flow-chip{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--app-border-strong);
  background: var(--app-surface-inset);
  border-radius: 999px;
  padding: .24rem .65rem;
  font-size: .78rem;
  color: var(--app-text);
}

.flow-chip-accent{
  border-color: rgba(198,166,70,.36);
  background: var(--app-accent-soft);
  color: var(--app-accent-strong);
}

.app-chip-success{
  border-color: rgba(79,139,72,.32);
  background: var(--app-success-soft);
  color: var(--app-success);
}

.app-chip-warning{
  border-color: rgba(198,166,70,.34);
  background: rgba(198,166,70,.16);
  color: var(--app-accent-strong);
}

.app-chip-danger{
  border-color: rgba(176,66,66,.26);
  background: var(--app-danger-soft);
  color: #9f3d3d;
}

.app-btn-primary,
.app-btn-secondary,
.app-btn-compact{
  border-radius: 999px;
  font-weight: 600;
  box-shadow: none;
}

.app-btn-primary{
  background: var(--solid-bg);
  border-color: var(--solid-bg);
  color: var(--solid-fg);
}

.app-btn-primary:hover,
.app-btn-primary:focus-visible{
  background: var(--solid-bg-hover);
  border-color: var(--solid-bg-hover);
  color: var(--solid-fg);
}

.app-btn-secondary{
  background: transparent;
  border-color: var(--app-border-strong);
  color: var(--app-text);
}

.app-btn-secondary:hover,
.app-btn-secondary:focus-visible{
  background: var(--app-surface-inset);
  border-color: color-mix(in srgb, var(--app-text) 24%, transparent);
  color: var(--app-text);
}

.app-btn-compact{
  min-height: 32px;
  padding: .34rem .8rem;
  font-size: .78rem;
}

.app-progress{
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
}

.app-progress-track{
  display: inline-grid;
  gap: 6px;
}

.app-progress-step{
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-text) 12%, transparent);
}

.app-progress-step.active{
  background: var(--solid-bg);
}

.navbar.navbar-dark.bg-dark{
  background: linear-gradient(180deg, rgba(20,21,18,.96), rgba(14,15,13,.98)) !important;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 .55rem 1.25rem rgba(15,15,10,.14);
}

.navbar .form-control,
.navbar .input-group-text{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
  color: #fff;
}

.navbar .form-control::placeholder{
  color: rgba(255,255,255,.56);
}

.navbar .form-control:focus{
  background: rgba(255,255,255,.1);
  border-color: rgba(198,166,70,.45);
  box-shadow: 0 0 0 .2rem rgba(198,166,70,.16);
  color: #fff;
}
.nav-mobile-search .form-control{
  min-width: 0;
}

.nav-mobile-auth .btn{
  white-space: nowrap;
}

.card{
  border-color: var(--app-border);
  border-radius: var(--radius-md);
  background: var(--app-surface);
  box-shadow: var(--shadow-sm);
}

.card-header,
.card-footer{
  background: transparent;
  border-color: var(--app-border);
}

.badge{
  border-radius: 999px;
  font-weight: 600;
  padding: .4rem .58rem;
}

.badge.text-bg-light{
  background: color-mix(in srgb, var(--app-surface-strong) 72%, transparent) !important;
}

.badge.text-bg-warning{
  color: #241b04 !important;
  background: rgba(198,166,70,.26) !important;
}

.badge.text-bg-success{
  background: rgba(79,139,72,.18) !important;
  color: #214f1f !important;
}

.btn{
  border-radius: 999px;
  font-weight: 600;
}

.btn-dark,
.btn-primary{
  background: var(--solid-bg);
  border-color: var(--solid-bg);
  color: var(--solid-fg);
}

.btn-dark:hover,
.btn-dark:focus-visible,
.btn-primary:hover,
.btn-primary:focus-visible{
  background: var(--solid-bg-hover);
  border-color: var(--solid-bg-hover);
  color: var(--solid-fg);
}

.btn-outline-dark,
.btn-outline-secondary{
  color: var(--app-text);
  border-color: var(--app-border-strong);
}

.btn-outline-dark:hover,
.btn-outline-dark:focus-visible,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible{
  background: var(--app-surface-inset);
  border-color: color-mix(in srgb, var(--app-text) 24%, transparent);
  color: var(--app-text);
}

.btn-outline-warning{
  color: var(--app-accent-strong);
  border-color: rgba(198,166,70,.42);
}

.btn-outline-warning:hover,
.btn-outline-warning:focus-visible{
  background: var(--app-accent-soft);
  border-color: rgba(198,166,70,.55);
  color: #6f5915;
}

.btn-outline-danger{
  border-color: rgba(176,66,66,.2);
  color: #8d2d2d;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus-visible{
  background: var(--app-danger-soft);
  border-color: rgba(176,66,66,.3);
  color: #7a2020;
}

.progress{
  background: color-mix(in srgb, var(--app-text) 8%, transparent);
  border-radius: 999px;
}

.progress-bar{
  background: var(--solid-bg);
}

.progress-bar.bg-success{
  background: var(--app-success) !important;
}

.alert{
  border-radius: var(--radius-sm);
  border-color: var(--app-border);
  box-shadow: var(--shadow-sm);
}

.form-control,
.form-select{
  border-radius: var(--radius-xs);
  border-color: var(--app-border);
  background: color-mix(in srgb, var(--app-surface-strong) 92%, transparent);
  color: var(--app-text);
}

.form-control:focus,
.form-select:focus{
  border-color: rgba(198,166,70,.45);
  box-shadow: 0 0 0 .2rem rgba(198,166,70,.16);
}
.filter-toolbar .toolbar-top .form-control,
.filter-toolbar .toolbar-top .form-select{
  min-height: 2.1rem;
}
.compact-pills .badge{
  font-weight: 500;
}

.workout-library-carousel.locked .carousel-control-prev,
.workout-library-carousel.locked .carousel-control-next{
  display: none !important;
  pointer-events: none;
}

.workout-library-card .carousel-control-prev,
.workout-library-card .carousel-control-next{
  width: 20%;
}

.workout-empty-state{
  margin-top: -.15rem;
}

.workout-pagination .page-link{
  border-radius: 999px;
  border-color: var(--app-border);
  color: var(--app-text);
  background: color-mix(in srgb, var(--app-surface-strong) 88%, transparent);
  padding: .45rem .8rem;
  box-shadow: none;
}

.workout-pagination .page-item.disabled .page-link{
  background: color-mix(in srgb, var(--app-surface-muted) 80%, transparent);
  color: var(--app-text-soft);
}

.search-recipe-card .card-body{
  padding: .9rem 1rem;
}

/* ===== Workout detail ===== */

.workout-detail-media-panel .card-body{
  padding: 1rem;
}

.workout-detail-carousel.locked .carousel-control-prev,
.workout-detail-carousel.locked .carousel-control-next{
  display: none !important;
  pointer-events: none;
}

/* Numbered steps (exercise instructions) */

@media (max-width: 767.98px){
  .workout-detail-media-panel .card-body{
    padding: .9rem;
  }
}

.js-workout-card{
  cursor: pointer;
}
.carousel.fast-carousel{
  --bs-carousel-transition-duration: .28s;
}

/* ===== Admin week item authoring ===== */
.admin-week-items-page{
  gap: 1rem;
}

.admin-week-tools{
  padding: 0 1rem 1rem;
}

.admin-week-item-list{
  display: grid;
  gap: .9rem;
}

.admin-week-item-card .card-body{
  padding: 0 1rem 1rem;
}

.admin-week-item-card-heading strong{
  font-size: .98rem;
}

.admin-week-item-card-actions{
  display: flex;
  align-items: center;
  gap: .5rem;
}

.admin-week-item-form{
  display: grid;
  gap: .85rem;
}

.admin-ops-page{
  gap: 1rem;
}

.admin-ops-grid{
  display: grid;
  gap: 1rem;
}

.admin-workflow-list{
  display: grid;
  gap: .55rem;
  padding-left: 1.15rem;
}

.admin-production-grid{
  display: grid;
  gap: .8rem;
}

.admin-production-card{
  display: grid;
  gap: .2rem;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, color-mix(in srgb, var(--app-surface-strong) 92%, transparent), color-mix(in srgb, var(--app-surface-muted) 86%, transparent));
  padding: .8rem .9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.admin-production-card:hover,
.admin-production-card:focus-visible{
  border-color: color-mix(in srgb, var(--app-text) 20%, transparent);
  box-shadow: var(--shadow-sm);
  color: inherit;
}

.admin-production-card-legacy{
  background: linear-gradient(180deg, color-mix(in srgb, var(--app-surface-muted) 82%, transparent), color-mix(in srgb, var(--app-surface-muted) 72%, transparent));
}

.admin-production-title{
  font-weight: 700;
  font-size: .92rem;
  color: var(--app-text);
}

.admin-production-copy{
  font-size: .8rem;
  line-height: 1.38;
  color: var(--app-text-muted);
}

.template-library-list{
  display: grid;
  gap: .9rem;
}

.template-library-row .card-body{
  display: grid;
  gap: .9rem;
}

.template-library-main{
  display: grid;
  gap: .2rem;
}

.admin-week-item-grid{
  display: grid;
  gap: .85rem;
}

.admin-week-item-section{
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--app-surface-strong) 60%, transparent);
  padding: .8rem;
}

.admin-week-item-section-title{
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--app-text-soft);
  margin-bottom: .55rem;
}

.admin-week-item-status{
  margin-top: -.1rem;
}

.admin-week-item-footer{
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}

.admin-workout-picker{
  display: grid;
  gap: .75rem;
  padding: .8rem;
}

.admin-workout-picker-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .7rem;
  flex-wrap: wrap;
}

.admin-workout-picker-title{
  font-size: .95rem;
  font-weight: 700;
  color: var(--app-text);
  line-height: 1.25;
}

.admin-workout-picker-copy{
  color: var(--app-text-muted);
  font-size: .82rem;
  line-height: 1.4;
  margin-top: .18rem;
}

.admin-workout-picker-toolbar{
  display: grid;
  gap: .65rem;
}

.admin-workout-picker-filters{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}

.admin-workout-picker-status{
  margin-top: -.1rem;
}

.admin-workout-preview{
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--app-surface-strong) 72%, transparent);
  padding: .65rem;
}

.admin-workout-preview-media{
  width: 72px;
  aspect-ratio: 9 / 16;
  border-radius: .75rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--app-text) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--app-text) 8%, transparent);
}

.admin-workout-preview-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-workout-preview-fallback{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--app-text-soft);
  font-size: .72rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.admin-workout-preview-body{
  min-width: 0;
}

.admin-workout-preview-name{
  font-weight: 700;
  font-size: .9rem;
  line-height: 1.25;
  color: var(--app-text);
}

.admin-workout-preview-meta{
  margin-top: .2rem;
  font-size: .78rem;
  color: var(--app-text-muted);
  line-height: 1.4;
}

.admin-workout-picker-results{
  display: grid;
  gap: .45rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: .1rem;
}

.admin-workout-result{
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: .58rem;
  width: 100%;
  align-items: center;
  text-align: left;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  background: var(--app-surface-strong);
  color: var(--app-text);
  padding: .68rem .75rem;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease, transform .12s ease;
}

.admin-workout-result:hover,
.admin-workout-result:focus-visible{
  border-color: color-mix(in srgb, var(--app-text) 20%, transparent);
  background: color-mix(in srgb, var(--app-surface-strong) 98%, transparent);
  box-shadow: var(--shadow-sm);
}

.admin-workout-result:active{
  transform: scale(.996);
}

.admin-workout-result.is-selected{
  border-color: rgba(198,166,70,.48);
  background: rgba(198,166,70,.12);
  box-shadow: inset 0 0 0 1px rgba(198,166,70,.16);
}

.admin-workout-result-media{
  width: 48px;
  aspect-ratio: 9 / 16;
  border-radius: .6rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--app-text) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--app-text) 8%, transparent);
}

.admin-workout-result-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-workout-result-fallback{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--app-text-soft);
  font-size: 1rem;
}

.admin-workout-result-copy{
  min-width: 0;
  display: grid;
  gap: .18rem;
}

.admin-workout-result-name{
  font-weight: 700;
  font-size: .9rem;
  color: var(--app-text);
  line-height: 1.25;
}

.admin-workout-result-meta{
  font-size: .78rem;
  color: var(--app-text-muted);
  line-height: 1.35;
}

@media (min-width: 900px){
  .admin-ops-grid{
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    align-items: start;
  }

  .admin-production-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-week-item-grid{
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr);
    align-items: start;
  }

  .admin-week-item-section-picker{
    grid-row: span 3;
  }

  .admin-workout-picker-results{
    max-height: 280px;
  }
}

@media (max-width: 767.98px){
  .admin-week-item-card .card-body,
  .admin-week-tools{
    padding-inline: .9rem;
    padding-bottom: .9rem;
  }

  .admin-week-item-section,
  .admin-workout-picker{
    padding: .72rem;
  }

  .admin-workout-picker-filters{
    grid-template-columns: 1fr;
  }

  .admin-workout-preview{
    grid-template-columns: 60px minmax(0, 1fr);
    gap: .6rem;
    padding: .58rem;
  }

  .admin-workout-preview-media{
    width: 60px;
  }

  .admin-workout-picker-results{
    max-height: 220px;
  }
}

/* ===== Floating bottom navigation (mobile) ===== */
body{
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 991.98px){
  body{
    padding-bottom: calc(var(--bottom-nav-h) + var(--bottom-nav-gap) + 1rem + env(safe-area-inset-bottom));
  }
  body.has-mobile-swipe-rail{
    padding-bottom: calc(var(--bottom-nav-h) + var(--bottom-nav-gap) + var(--swipe-rail-h) + 1rem + env(safe-area-inset-bottom));
  }
  body.has-top-level-swipe .top-level-swipe-zone{
    touch-action: pan-y pinch-zoom;
    overscroll-behavior-x: contain;
  }
}

.mobile-swipe-rail{
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-nav-h) + var(--bottom-nav-gap) + 6px + env(safe-area-inset-bottom));
  height: var(--swipe-rail-h);
  z-index: 1085;
  display: none;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

@media (max-width: 991.98px){
  .mobile-swipe-rail{
    display: flex;
  }
}

.mobile-swipe-rail .rail-hit{
  pointer-events: auto;
  width: min(240px, calc(100% - 72px));
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.mobile-swipe-rail .rail-track{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 8px;
  width: min(116px, 70%);
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-text) 16%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mobile-swipe-rail .rail-dot{
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-text) 24%, transparent);
  transition: width .16s ease, background .16s ease, opacity .16s ease;
}

.mobile-swipe-rail .rail-dot.active{
  width: 18px;
  background: var(--bottom-nav-accent);
}

.bottom-nav{
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--bottom-nav-gap) + env(safe-area-inset-bottom));
  height: var(--bottom-nav-h);
  display: none;
  z-index: 1090;
  pointer-events: none; /* only inner pill clickable */
}

@media (max-width: 991.98px){
  .bottom-nav{ display: flex; }
}

.bottom-nav .nav-wrap{
  pointer-events: auto;
  width: min(430px, calc(100% - 20px));
  margin: 0 auto;
  height: 100%;
  padding: 7px;
  border-radius: 22px;

  background: linear-gradient(180deg, rgba(24,27,27,.9), var(--bottom-nav-bg));
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--bottom-nav-border);
  box-shadow: 0 14px 34px rgba(0,0,0,.28);

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.bottom-nav a{
  text-decoration: none;
  color: var(--bottom-nav-muted);
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 14px;
  min-width: 0;
  min-height: 50px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 6px 3px;
  position: relative;
  outline: none;

  transition: background .16s ease, color .16s ease, transform .1s ease, box-shadow .16s ease;
}
.bottom-nav a:active{
  transform: translateY(1px) scale(.98);
}
.bottom-nav a:focus-visible{
  box-shadow: 0 0 0 3px rgba(157,232,77,.36);
}

.bottom-nav a.active{
  color: var(--bottom-nav-ink);
  background: var(--bottom-nav-active);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.bottom-nav a.is-pending{
  color: #fff;
  background: rgba(157,232,77,.18);
}
.bottom-nav a.active::after{
  content:"";
  position:absolute;
  left: 50%;
  top: 3px;
  width: 18px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--bottom-nav-accent);
}

.bottom-nav .label{
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 360px){
  .bottom-nav .nav-wrap{
    width: min(430px, calc(100% - 14px));
    gap: 4px;
    padding: 6px;
  }
  .bottom-nav a{
    min-height: 48px;
    padding-left: 2px;
    padding-right: 2px;
  }
  .bottom-nav .label{
    font-size: .64rem;
  }
}

/* ===== Swipe shell ===== */
/* Sub-pages: a sideways drag is the back gesture, so the browser only pans vertically. */
@media (max-width: 991.98px){
  body:not([data-back-url=""]) #page-shell{ touch-action: pan-y pinch-zoom; }
}
/* No transform/containment on #page-shell at rest: those would trap position:fixed
   children and cost memory on every page. They're applied only while dragging. */
#page-shell.is-swiping,
#page-shell.is-leaving,
#page-shell.is-settling{
  will-change: transform, opacity;
  opacity: var(--swipe-opacity, 1);
  transform: translate3d(var(--swipe-x, 0), 0, 0);
}
#page-shell.is-swiping{ transition: none; }
#page-shell.is-leaving{ transition: transform 90ms ease-out, opacity 90ms ease-out; opacity: .5; }
#page-shell.is-settling{ transition: transform 200ms cubic-bezier(.2,.8,.2,1), opacity 200ms ease; }

/* Browsers without cross-document view transitions get a light entry fade. */
@supports not (view-transition-name: none){
  #page-shell{ animation: shellEnter 180ms ease both; }
}

@keyframes shellEnter{
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Page-to-page transitions (Chrome/Edge/Safari 18+): the page slides, bars stay put. */
@view-transition{ navigation: auto; }

.nfg-topbar{ view-transition-name: nfg-topbar; }
.bottom-nav{ view-transition-name: nfg-bottomnav; }
.mobile-swipe-rail{ view-transition-name: nfg-swiperail; }

::view-transition-old(root),
::view-transition-new(root){ animation-duration: 200ms; }

html[data-nav-dir="next"]::view-transition-old(root){ animation: nfgOutLeft 200ms cubic-bezier(.4,0,1,1) both; }
html[data-nav-dir="next"]::view-transition-new(root){ animation: nfgInRight 260ms cubic-bezier(0,0,.2,1) both; }
html[data-nav-dir="prev"]::view-transition-old(root){ animation: nfgOutRight 200ms cubic-bezier(.4,0,1,1) both; }
html[data-nav-dir="prev"]::view-transition-new(root){ animation: nfgInLeft 260ms cubic-bezier(0,0,.2,1) both; }

@keyframes nfgOutLeft{ to { transform: translateX(-22%); opacity: 0; } }
@keyframes nfgOutRight{ to { transform: translateX(22%); opacity: 0; } }
@keyframes nfgInRight{ from { transform: translateX(22%); opacity: 0; } }
@keyframes nfgInLeft{ from { transform: translateX(-22%); opacity: 0; } }

@media (prefers-reduced-motion: reduce){
  #page-shell{ animation: none; }
  #page-shell.is-leaving, #page-shell.is-settling{ transition: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*){ animation: none !important; }
}

/* ===== Program flow ===== */
.flow-shell{
  max-width: 760px;
  margin: 0 auto;
}

.flow-shell-wide{
  max-width: 840px;
  margin: 0 auto;
}

.flow-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.flow-kicker{
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--app-text-soft);
  margin-bottom: .3rem;
}

.flow-copy{
  color: var(--app-text-muted);
  font-size: .92rem;
  line-height: 1.35;
}

.flow-progress{
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.flow-progress-copy,
.flow-progress-label{
  font-size: .82rem;
  color: var(--app-text-muted);
}

.flow-progress-track{
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.flow-progress-step{
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-text) 12%, transparent);
}

.flow-progress-step.active{
  background: var(--solid-bg);
}

.flow-card{
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  background: var(--app-surface);
}

.flow-summary .card-body{
  padding: 1rem;
}

.flow-section{
  margin-top: 1.5rem;
}

.flow-section-header{
  margin-bottom: .9rem;
}

.setup-chip-row{
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.flow-chip{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--app-border-strong);
  background: var(--app-surface-inset);
  border-radius: 999px;
  padding: .24rem .65rem;
  font-size: .78rem;
  color: var(--app-text);
}

.flow-chip-accent{
  border-color: rgba(198,166,70,.36);
  background: var(--app-accent-soft);
  color: var(--app-accent-strong);
}

.selection-stack{
  display: grid;
  gap: .75rem;
}

.selection-card{
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  background: var(--app-surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease, background .12s ease;
}

.selection-card:active{
  transform: scale(.994);
}

.selection-card:focus-visible{
  outline: none;
  border-color: color-mix(in srgb, var(--app-text) 55%, transparent);
  box-shadow: 0 0 0 3px rgba(198,166,70,.18);
}

@media (hover: hover){
  .selection-card:hover{
    border-color: color-mix(in srgb, var(--app-text) 22%, transparent);
    box-shadow: var(--shadow-md);
    background: color-mix(in srgb, var(--app-surface-muted) 98%, transparent);
  }
}

.selection-card.is-current,
.selection-card.is-emphasis{
  border-color: rgba(198,166,70,.44);
  box-shadow: 0 0 0 2px rgba(198,166,70,.12), var(--shadow-md);
}

.selection-card-body{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .9rem;
  padding: 1rem;
}

.selection-card-main{
  min-width: 0;
  flex: 1 1 auto;
}

.selection-card-top{
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .3rem;
}

.selection-card-title{
  font-size: 1rem;
  font-weight: 700;
  color: var(--app-text);
}

.selection-card-copy{
  font-size: .9rem;
  line-height: 1.4;
  color: var(--app-text-muted);
}

.selection-card-meta{
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  margin-top: .85rem;
}

.selection-card-side{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
  flex: 0 0 auto;
}

.selection-card-action{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 .8rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--app-text) 14%, transparent);
  background: var(--solid-bg);
  color: var(--solid-fg);
  font-size: .8rem;
  font-weight: 600;
}

.selection-card-icon{
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .8rem;
  background: color-mix(in srgb, var(--app-text) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--app-text) 8%, transparent);
  position: relative;
  flex: 0 0 auto;
}

.selection-card-icon::before,
.selection-card-icon::after{
  content: "";
  position: absolute;
}

.selection-card-icon-home::before{
  left: 8px;
  right: 8px;
  bottom: 8px;
  top: 17px;
  border: 2px solid color-mix(in srgb, var(--app-text) 42%, transparent);
  border-top: 0;
  border-radius: 0 0 6px 6px;
}

.selection-card-icon-home::after{
  left: 11px;
  right: 11px;
  top: 8px;
  height: 14px;
  border-top: 2px solid color-mix(in srgb, var(--app-text) 42%, transparent);
  border-left: 2px solid color-mix(in srgb, var(--app-text) 42%, transparent);
  transform: rotate(45deg);
  transform-origin: top left;
}

.selection-card-icon-gym::before{
  left: 7px;
  right: 7px;
  top: 18px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-text) 45%, transparent);
}

.selection-card-icon-gym::after{
  inset: 10px 6px;
  border-left: 3px solid color-mix(in srgb, var(--app-text) 42%, transparent);
  border-right: 3px solid color-mix(in srgb, var(--app-text) 42%, transparent);
  border-radius: 4px;
}

.selection-card-icon-hybrid::before{
  left: 8px;
  right: 8px;
  top: 8px;
  bottom: 8px;
  border: 2px solid color-mix(in srgb, var(--app-text) 40%, transparent);
  border-radius: 999px;
}

.selection-card-icon-hybrid::after{
  left: 50%;
  top: 9px;
  bottom: 9px;
  width: 2px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--app-text) 34%, transparent);
}

.selection-card.is-locked{
  opacity: .76;
  background: color-mix(in srgb, var(--app-text) 2%, transparent);
}

.selection-card.is-locked .selection-card-action{
  background: color-mix(in srgb, var(--app-text) 8%, transparent);
  color: color-mix(in srgb, var(--app-text) 50%, transparent);
  border-color: color-mix(in srgb, var(--app-text) 8%, transparent);
}

.flow-list{
  display: grid;
  gap: .85rem;
}

.flow-inline-stats{
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .85rem;
}

.program-setup-screen .flow-header{
  gap: .55rem;
}

.program-setup-screen .flow-kicker{
  margin-bottom: .12rem;
}

.program-setup-screen .flow-copy{
  font-size: .84rem;
  line-height: 1.3;
}

.program-setup-screen .flow-progress{
  gap: .55rem;
  margin-bottom: .75rem;
}

.program-setup-screen .flow-progress-copy,
.program-setup-screen .flow-progress-label{
  font-size: .78rem;
}

.program-setup-screen .flow-progress-step{
  width: 28px;
  height: 3px;
}

.program-setup-screen .flow-section-header{
  margin-bottom: .55rem;
}

.program-setup-screen .selection-stack{
  gap: .55rem;
}

.program-setup-screen .selection-card-body{
  align-items: center;
  gap: .7rem;
  padding: .78rem .82rem;
}

.program-setup-screen .selection-card-title{
  font-size: .96rem;
}

.program-setup-screen .selection-card-copy{
  font-size: .82rem;
  line-height: 1.28;
}

.program-setup-screen .selection-card-meta{
  margin-top: .45rem;
  gap: .35rem;
}

.program-setup-screen .selection-card-side{
  gap: .35rem;
}

.program-setup-screen .selection-card-action{
  min-height: 30px;
  padding: 0 .68rem;
  font-size: .74rem;
}

.program-setup-screen .flow-chip{
  padding: .16rem .48rem;
  font-size: .72rem;
}

.program-setup-screen .selection-card-icon{
  width: 2rem;
  height: 2rem;
  border-radius: .65rem;
}

.program-setup-screen .selection-card-icon-home::before{
  left: 7px;
  right: 7px;
  bottom: 6px;
  top: 14px;
}

.program-setup-screen .selection-card-icon-home::after{
  left: 10px;
  right: 10px;
  top: 7px;
  height: 11px;
}

.program-setup-screen .selection-card-icon-gym::before{
  left: 6px;
  right: 6px;
  top: 14px;
  height: 4px;
}

.program-setup-screen .selection-card-icon-gym::after{
  inset: 8px 5px;
}

.program-setup-screen .selection-card-icon-hybrid::before{
  left: 7px;
  right: 7px;
  top: 7px;
  bottom: 7px;
}

.program-setup-screen .selection-card-icon-hybrid::after{
  top: 8px;
  bottom: 8px;
}

@media (max-width: 575.98px){
  .selection-card-body{
    padding: .95rem;
  }
  .selection-card-side{
    align-items: flex-start;
  }
  .selection-card-action{
    min-height: 32px;
  }
  .program-setup-screen .flow-header{
    margin-bottom: .7rem !important;
  }
  .program-setup-screen .selection-card-body{
    padding: .72rem .78rem;
    gap: .6rem;
  }
  .program-setup-screen .selection-card-copy{
    font-size: .8rem;
  }
  .program-setup-screen .selection-card-top{
    gap: .6rem;
    margin-bottom: .2rem;
  }
  .program-setup-screen .selection-card-side{
    align-items: flex-end;
  }
.program-setup-screen .selection-card-action{
    min-height: 28px;
    padding: 0 .62rem;
  }
}

/* ===== Week detail ===== */

.week-detail-switchboard .card-body{
  padding: .95rem 1rem;
}

.week-detail-panel .card-body{
  padding: 1rem;
}

.week-item-list{
  display: grid;
  gap: .65rem;
}

.week-item-card{
  border: 1px solid var(--app-border);
  border-radius: .9rem;
  padding: .82rem .88rem;
  background: var(--app-surface-strong);
}

.week-detail-empty .card-body{
  padding: 1rem;
}

@media (max-width: 767.98px){
  .week-detail-panel .card-body{
    padding: .92rem;
  }
  .week-item-card{
    padding: .75rem .78rem;
  }
}

@media (max-width: 575.98px){
  .week-detail-switchboard .card-body{
    padding: .85rem .88rem;
  }
}

/* ===== Home page ===== */

.home-program-card .card{
  border: 1px solid var(--app-border);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.home-program-card:active .card{
  transform: scale(.995);
}

@media (max-width: 575.98px){
  .home-hero-actions .btn{
    width: 100%;
  }
}

/* =====================================================================
   Discovery (Home v2, Muscle Mixer) — mobile first.
   Group colours come from taxonomy.MUSCLE_GROUPS via --group-color.
   ===================================================================== */
.nfg-discover{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  max-width: 1080px;
  margin: 0 auto;
}

/* Grid children default to min-width:auto, which lets a wide rail stretch the
   whole page past the viewport. Let them shrink so rails scroll instead. */
.nfg-discover > *{ min-width: 0; }

.nfg-hero{ padding-top: .25rem; }

.nfg-hero-title{
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.08;
  margin: .2rem 0 .45rem;
}

.nfg-section-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem;
}

.nfg-section-title{
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -.01em;
  margin: 0;
}

.nfg-section-copy{
  color: var(--app-text-muted);
  font-size: .875rem;
  margin: .2rem 0 0;
}

.nfg-section-link{
  font-size: .875rem;
  font-weight: 650;
  color: var(--app-text);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--app-border-strong);
}

/* Where-are-you-training switch */
.nfg-env-switch{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .3rem;
  max-width: 420px;
  padding: .3rem;
  border-radius: 999px;
  background: var(--app-surface-inset);
  border: 1px solid var(--app-border);
}

.nfg-env-option{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 650;
  color: var(--app-text-muted);
  text-decoration: none;
}

.nfg-env-option.is-active{
  background: var(--switch-bg);
  color: var(--switch-fg);
  box-shadow: var(--shadow-sm);
}

.nfg-env-note{
  color: var(--app-text-soft);
  font-size: .82rem;
  margin: .55rem 0 0;
}

/* Muscle group tiles */
.nfg-group-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}

@media (min-width: 576px){
  .nfg-group-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 992px){
  .nfg-group-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.nfg-group-card{
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 96px;
  padding: .9rem;
  border-radius: var(--radius-md);
  color: var(--on-color);
  text-decoration: none;
  background-color: var(--group-color);
  background-image: linear-gradient(135deg, var(--group-color), color-mix(in srgb, var(--group-color) 58%, #000));
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}

.nfg-group-card::after{
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
}

.nfg-group-label{
  position: relative;
  font-weight: 800;
  font-size: 1.05rem;
}

.nfg-group-count{
  position: relative;
  font-size: .78rem;
  opacity: .85;
}

.nfg-group-card.is-empty{ opacity: .55; }

@media (hover: hover){
  .nfg-group-card:hover{
    color: var(--on-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

.nfg-continue-kicker{
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--app-accent);
}

/* Continue training */
.nfg-continue{
  display: grid;
  gap: .3rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-lg);
  background: var(--card-dark);
  color: var(--card-dark-fg);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.nfg-continue:hover{ color: var(--card-dark-fg); }

.nfg-continue-title{ font-size: 1.15rem; font-weight: 800; }

.nfg-continue-meta{ opacity: .8; font-size: .875rem; }

.nfg-progress{
  display: block;
  height: 6px;
  margin-top: .35rem;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  overflow: hidden;
}

.nfg-progress-bar{
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--app-accent);
}

/* Horizontal rails */
.nfg-rail{
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: .15rem .1rem .6rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nfg-rail::-webkit-scrollbar{ display: none; }

.nfg-rail > *{
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.nfg-rail-card{
  display: flex;
  flex-direction: column;
  gap: .35rem;
  width: 42vw;
  max-width: 180px;
  color: var(--app-text);
  text-decoration: none;
}

.nfg-rail-media{
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--media-bg);
  box-shadow: var(--shadow-sm);
}

.nfg-rail-media img,
.nfg-ex-thumb img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.nfg-rail-title{ font-weight: 700; font-size: .92rem; line-height: 1.2; }

.nfg-rail-meta{ font-size: .78rem; color: var(--app-text-muted); }

/* Program cards in rails */
.nfg-program-card{
  display: flex;
  flex-direction: column;
  gap: .45rem;
  width: 78vw;
  max-width: 320px;
  min-height: 170px;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(214,184,90,.26), transparent 55%),
    var(--card-dark);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow-md);
  color: var(--card-dark-fg);
  text-decoration: none;
}
.nfg-program-card:hover{ color: var(--card-dark-fg); }
.nfg-program-card .nfg-badge{ background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); color: var(--card-dark-fg); }
.nfg-program-card .nfg-badge.is-light{ background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.16); color: var(--card-dark-fg); }
.nfg-program-card .nfg-badge.is-saved{ background: var(--gold-a); border-color: transparent; color: var(--on-gold); }
.nfg-program-card .nfg-program-copy{ color: rgba(255,255,255,.72); }
.nfg-program-card .nfg-program-cta{ color: var(--gold-a); }

.nfg-program-badges{ display: flex; flex-wrap: wrap; gap: .35rem; }

.nfg-badge{
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--solid-bg);
  color: var(--solid-fg);
  font-size: .7rem;
  font-weight: 700;
}

.nfg-badge.is-light{
  background: var(--app-surface-muted);
  color: var(--app-text);
  border: 1px solid var(--app-border);
}

.nfg-badge.is-saved{ background: var(--app-accent); color: var(--on-gold); }

.nfg-program-title{ font-size: 1.05rem; font-weight: 800; }

.nfg-program-copy{
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--app-text-muted);
  font-size: .85rem;
}

.nfg-program-cta{ margin-top: auto; font-size: .85rem; font-weight: 700; }

/* Muscle Mixer results */
.nfg-results-head{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .7rem;
  font-weight: 700;
}

.nfg-results-key{ display: inline-flex; gap: .35rem; }

.nfg-ex-list{ display: grid; gap: .6rem; }

@media (min-width: 768px){
  .nfg-ex-list{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.nfg-ex-row{
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .6rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  text-decoration: none;
}

.nfg-ex-thumb{
  flex: 0 0 64px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--media-bg);
}

.nfg-ex-body{ display: flex; flex-direction: column; gap: .2rem; min-width: 0; }

.nfg-ex-name{ font-weight: 700; }

.nfg-ex-meta{ font-size: .8rem; color: var(--app-text-muted); }

.nfg-ex-hits{ display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .15rem; }

.nfg-hit{
  padding: .1rem .5rem;
  border-radius: 999px;
  border: 1.5px solid var(--group-color, var(--app-border-strong));
  color: var(--app-text);
  font-size: .7rem;
  font-weight: 700;
}

.nfg-hit.is-primary{
  background: var(--group-color, var(--app-text));
  border-color: var(--group-color, var(--app-text));
  color: var(--on-color);
}
.nfg-hit.is-primary:not([style]){ background: var(--solid-bg); border-color: var(--solid-bg); color: var(--solid-fg); }

.nfg-saved-dot{ color: #C0392B; }

.nfg-empty{
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-muted);
  color: var(--app-text-muted);
}

.nfg-browse-links{ display: grid; gap: .5rem; }

@media (min-width: 768px){
  .nfg-browse-links{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.nfg-browse-link{
  display: flex;
  justify-content: space-between;
  padding: .9rem 1rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  font-weight: 650;
  text-decoration: none;
}

/* Save button on the exercise page */
.nfg-title-row{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.nfg-save-form{ flex: 0 0 auto; margin: 0; }

.nfg-save-btn{
  min-height: 40px;
  padding: .45rem .95rem;
  border-radius: 999px;
  border: 1.5px solid var(--app-text);
  background: transparent;
  color: var(--app-text);
  font-weight: 700;
}

.nfg-save-btn.is-saved{ background: var(--solid-bg); color: var(--solid-fg); }

.nfg-group-card:focus-visible,
.nfg-env-option:focus-visible,
.nfg-rail-card:focus-visible,
.nfg-ex-row:focus-visible,
.nfg-program-card:focus-visible,
.nfg-continue:focus-visible{
  outline: 3px solid var(--app-accent);
  outline-offset: 2px;
}

/* =====================================================================
   App shell v2: top bar, icons, footer
   ===================================================================== */
.nfg-icon{
  display: inline-flex;
  width: 1em;
  height: 1em;
  line-height: 0;
  flex: 0 0 auto;
}

.nfg-icon svg{ width: 100%; height: 100%; }

.nfg-topbar{
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--bar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bar-border);
}

.nfg-topbar-inner{
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
}

.nfg-brand{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--bar-fg);
  text-decoration: none;
}

.nfg-brand:hover{ color: var(--bar-fg); }

.nfg-brand-logo{
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 0 0 1px rgba(255,255,255,.1);
}

@media (min-width: 576px){
  .nfg-brand-logo{ width: 34px; height: 34px; border-radius: 9px; }
}

.nfg-brand-word{
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: .08em;
}

.nfg-topnav{
  display: none;
  gap: .25rem;
}

.nfg-topnav a{
  padding: .4rem .75rem;
  border-radius: 999px;
  color: rgba(255,255,255,.7);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
}

.nfg-topnav a:hover{ color: var(--bar-fg); }
.nfg-topnav a.is-active{ color: var(--bar-active-fg); background: var(--bar-active-bg); }

.nfg-topsearch{
  display: none;
  align-items: center;
  gap: .5rem;
  flex: 0 1 280px;
  margin-left: auto;
  padding: 0 .8rem;
  height: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.6);
}

.nfg-topsearch input{
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--bar-fg);
  font-size: .92rem;
}

.nfg-topsearch input::placeholder{ color: rgba(255,255,255,.5); }
.nfg-topsearch:focus-within{ background: rgba(255,255,255,.15); }

.nfg-topactions{
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
}

@media (min-width: 992px){
  .nfg-topnav, .nfg-topsearch{ display: flex; }
  .nfg-topactions{ margin-left: 0; }
  .nfg-search-btn{ display: none !important; }
}

.nfg-iconbtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255,255,255,.85);
  font-size: 1.2rem;
  text-decoration: none;
}

.nfg-iconbtn:hover, .nfg-iconbtn.is-active{ color: var(--bar-fg); background: var(--bar-field); }
.nfg-iconbtn.is-dark{ color: var(--app-text); }
.nfg-iconbtn.is-dark:hover{ color: var(--app-text); background: var(--app-surface-inset); }

.nfg-pill{
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 .9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--bar-fg) 30%, transparent);
  color: var(--bar-fg);
  font-weight: 650;
  font-size: .85rem;
  text-decoration: none;
}

.nfg-pill:hover, .nfg-pill.is-active{ color: var(--bar-active-fg); background: var(--bar-active-bg); border-color: var(--bar-active-bg); }

.nfg-footer{
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0 1.5rem;
  font-size: .82rem;
}

.nfg-footer a{ color: var(--app-text-soft); text-decoration: none; }

/* Bottom nav icons (Bootstrap Icons; filled when the tab is active). */
.bottom-nav a[data-nav] .icon{
  display: inline-flex;
  width: 22px;
  height: 22px;
  margin-bottom: 3px;
  background: none;
  box-shadow: none;
  border-radius: 0;
  font-size: 20px;
}

/* =====================================================================
   Page header, search bar, filters
   ===================================================================== */
.nfg-page-head{ display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.nfg-page-head > *{ min-width: 0; }

.nfg-page-title{
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0;
}

.nfg-searchbar{
  display: flex;
  align-items: center;
  gap: .55rem;
  height: 46px;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  color: var(--app-text-soft);
  box-shadow: var(--shadow-sm);
}

.nfg-searchbar:focus-within{ border-color: var(--app-text); }

.nfg-searchbar input{
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--app-text);
  font-size: 1rem;
}

.nfg-searchbar.is-large{ height: 52px; }

.nfg-count{
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--solid-bg);
  color: var(--solid-fg);
  font-size: .72rem;
  font-weight: 800;
}

.nfg-active-chip{
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 32px;
  padding: 0 .75rem;
  border-radius: 999px;
  background: var(--solid-bg);
  color: var(--solid-fg);
  font-size: .82rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.nfg-active-chip:hover{ color: var(--solid-fg); }
.nfg-active-chip .nfg-icon{ font-size: .7rem; opacity: .75; }
.nfg-active-chip.is-group{ background: var(--group-color); color: var(--on-color); }
.nfg-active-chip.is-group:hover{ color: var(--on-color); filter: brightness(1.06); }

/* Always-visible filter bar (Exercises + browse): search, then Muscles · Equipment ·
   Level · more. Sticks under the top bar while the results scroll. */
.nfg-filterbar{
  position: sticky;
  top: 57px;
  z-index: 20;
  margin: 0 -1rem 1rem;
  padding: .6rem 1rem .55rem;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.nfg-filterbar.is-stuck{
  background: var(--app-bg);
  border-bottom-color: var(--app-border);
  box-shadow: 0 8px 18px -14px rgba(0,0,0,.35);
}
.nfg-fchips{
  display: flex;
  gap: .4rem;
  margin-top: .55rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nfg-fchips::-webkit-scrollbar{ display: none; }
.nfg-fchip{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 36px;
  padding: 0 .8rem 0 .9rem;
  border-radius: 999px;
  border: 1px solid var(--app-border-strong);
  background: var(--app-surface-strong);
  color: var(--app-text);
  font-size: .86rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.nfg-fchip:hover{ color: var(--app-text); border-color: var(--app-text-soft); }
.nfg-fchip .nfg-icon{ font-size: .7rem; opacity: .7; }
.nfg-fchip.is-icon{ padding: 0 .75rem; }
.nfg-fchip.is-icon .nfg-icon{ font-size: .95rem; opacity: 1; }
.nfg-fchip.is-on{ background: var(--solid-bg); border-color: var(--solid-bg); color: var(--solid-fg); }
.nfg-fchip.is-on:hover{ color: var(--solid-fg); }
.nfg-fchips.is-active{ align-items: center; margin-top: .45rem; }
.nfg-clear-link{ flex: 0 0 auto; padding: 0 .4rem; font-size: .82rem; font-weight: 650; color: var(--app-text-muted); }
@media (min-width: 992px){
  .nfg-filterbar{ margin-inline: 0; padding-inline: 0; }
  .nfg-filterbar .nfg-searchbar{ max-width: 560px; }
}

/* Filter panel: bottom sheet on phones, popup under the filter bar on desktop. */
.nfg-fpanel{ position: fixed; inset: 0; z-index: 1100; display: none; }
.nfg-fpanel.is-open, .nfg-fpanel:target{ display: block; }
.nfg-fpanel-backdrop{ position: absolute; inset: 0; background: rgba(0,0,0,.42); }
.nfg-fpanel-card{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-height: 86vh;
  max-height: 86svh;
  border-radius: 22px 22px 0 0;
  background: var(--app-bg);
  box-shadow: 0 -12px 40px rgba(0,0,0,.25);
  animation: nfg-sheet-up .2s ease-out;
}
@keyframes nfg-sheet-up{ from{ transform: translateY(24px); opacity: .6; } to{ transform: none; opacity: 1; } }
@keyframes nfg-pop-down{ from{ transform: translateY(-8px); opacity: 0; } to{ transform: none; opacity: 1; } }
@media (min-width: 768px){
  .nfg-fpanel-backdrop{ background: rgba(0,0,0,.18); }
  .nfg-fpanel-card{
    top: var(--panel-top, 120px);
    bottom: auto;
    left: 50%;
    right: auto;
    width: min(720px, calc(100vw - 2rem));
    max-height: calc(100vh - var(--panel-top, 120px) - 24px);
    transform: translateX(-50%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--app-border);
    box-shadow: 0 18px 48px rgba(0,0,0,.22);
    animation: none;
  }
}
@media (prefers-reduced-motion: reduce){ .nfg-fpanel-card{ animation: none; } }
html.nfg-fpanel-open{ overflow: hidden; }
.nfg-legend-note{ display: block; margin-top: .15rem; font-size: .76rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--app-text-muted); }
.nfg-choice.is-group input:checked + span{ background: var(--group-color); border-color: var(--group-color); color: var(--on-color); }
.nfg-choice.is-group span{ border-color: color-mix(in srgb, var(--group-color) 45%, var(--app-border-strong)); }
.nfg-fpanel-empty{
  margin: 0;
  padding: .65rem 1.1rem;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface-inset);
  font-size: .88rem;
}
.nfg-fieldset{ border-radius: var(--radius-sm); transition: background-color .4s ease; }
.nfg-fieldset.is-focus legend{ color: var(--app-text); }
.nfg-linkbtn{ border: 0; padding: 0; background: none; color: var(--app-text); font-weight: 700; text-decoration: underline; }
.nfg-sheet-foot .nfg-btn[disabled]{ opacity: .55; filter: grayscale(.4); box-shadow: none; }

/* Neutral tiles (equipment, level) */

.nfg-tile{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .4rem;
  min-height: 78px;
  padding: .85rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--tile-accent, var(--app-text));
  color: var(--app-text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.nfg-tile-label{ font-weight: 750; }
.nfg-tile-sub{ font-size: .78rem; color: var(--app-text-muted); }

@media (hover: hover){
  .nfg-tile:hover{ color: var(--app-text); box-shadow: var(--shadow-md); }
}

/* Exercise card grid */
.nfg-card-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem .75rem;
}

@media (min-width: 768px){
  .nfg-card-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px){
  .nfg-card-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.nfg-card{
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 0;
  color: var(--app-text);
  text-decoration: none;
}

.nfg-card:hover{ color: var(--app-text); }

.nfg-card-media,
.nfg-mini-media,
.nfg-ex-media{
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--media-bg);
}

.nfg-card-media{ border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }

.nfg-card-media img,
.nfg-mini-media img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nfg-card-flag{
  position: absolute;
  top: .5rem;
  left: .5rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: #F2C94C;
  color: var(--on-gold);
  font-size: .68rem;
  font-weight: 800;
}

.nfg-card-title{
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nfg-card-meta{ font-size: .76rem; color: var(--app-text-muted); }

/* Pagination */
.nfg-pager{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  margin-top: 1.5rem;
}

.nfg-pager-num,
.nfg-pager-step{
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 .4rem;
  border-radius: 999px;
  color: var(--app-text);
  font-weight: 650;
  font-size: .9rem;
  text-decoration: none;
}

.nfg-pager-num:hover, .nfg-pager-step:hover{ background: var(--app-surface-inset); color: var(--app-text); }
.nfg-pager-num.is-current{ background: var(--solid-bg); color: var(--solid-fg); }
.nfg-pager-gap{ color: var(--app-text-soft); padding: 0 .2rem; }

/* Sheet parts (the filter panel uses them) */

.nfg-sheet-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.1rem .6rem;
}

.nfg-sheet-title{ font-size: 1.2rem; font-weight: 800; margin: 0; }

.nfg-sheet-body{
  overflow-y: auto;
  padding: .4rem 1.1rem 1rem;
}

.nfg-sheet-foot{
  display: flex;
  gap: .6rem;
  padding: .8rem 1.1rem calc(.8rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--app-border);
}

.nfg-sheet-foot > *{ flex: 1; }

.nfg-fieldset{ margin-bottom: 1.1rem; }

.nfg-fieldset legend{
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--app-text-soft);
  margin-bottom: .5rem;
}

.nfg-choices{ display: flex; flex-wrap: wrap; gap: .4rem; }

.nfg-choice input{ position: absolute; opacity: 0; pointer-events: none; }

.nfg-choice span{
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 .85rem;
  border-radius: 999px;
  border: 1px solid var(--app-border-strong);
  background: var(--app-surface-strong);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}

.nfg-choice input:checked + span{ background: var(--solid-bg); border-color: var(--solid-bg); color: var(--solid-fg); }
.nfg-choice input:focus-visible + span{ outline: 3px solid var(--app-accent); outline-offset: 2px; }

.nfg-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 1.4rem;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(180deg, var(--gold-a), var(--gold-b));
  color: var(--on-gold);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(155,125,33,.28);
}

.nfg-btn:hover{ color: var(--on-gold); filter: brightness(1.04); }

.nfg-btn.is-ghost{
  background: transparent;
  border: 1.5px solid var(--app-text);
  color: var(--app-text);
  box-shadow: none;
}

/* =====================================================================
   Exercise page
   ===================================================================== */
.nfg-exercise{
  --accent: #3A3A34;
  display: grid;
  gap: 1.25rem;
  max-width: 1080px;
  margin: 0 auto;
}

.nfg-exercise > *{ min-width: 0; }

.nfg-back{
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: var(--app-text-muted);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
}

/* Phone: name and chips, then the viewer, then the rest. Desktop: viewer on the
   left (sticky), everything else on the right. */
.nfg-ex-layout{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "media" "info";
  gap: 1rem;
}

.nfg-ex-head{ grid-area: head; }
.nfg-ex-media-col{ grid-area: media; }
.nfg-ex-info{ grid-area: info; }
.nfg-ex-head .nfg-ex-chips{ margin-top: .65rem; }

@media (min-width: 992px){
  .nfg-ex-layout{
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "media head" "media info";
    column-gap: 2.5rem;
    row-gap: 1rem;
    align-items: start;
  }
  .nfg-ex-media-col{ position: sticky; top: 76px; }
}

/* 9:16, the shape of a phone held upright. Height is capped so the whole frame
   fits on screen; on a typical phone it's nearly full width. */
.nfg-ex-media{
  aspect-ratio: 9 / 16;
  width: min(100%, calc(78vh * 9 / 16));
  width: min(100%, calc(78svh * 9 / 16));
  margin-inline: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

@media (min-width: 992px){
  .nfg-ex-media{
    width: min(380px, calc((100vh - 150px) * 9 / 16));
    width: min(380px, calc((100svh - 150px) * 9 / 16));
  }
}

.nfg-gallery{
  display: flex;
  height: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.nfg-gallery::-webkit-scrollbar{ display: none; }
.nfg-gallery:focus-visible{ outline: 3px solid var(--accent); outline-offset: -3px; }

.nfg-gallery img{
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  user-select: none;
}

/* Story-style steps along the top: visible straight away (the bottom of a tall
   frame can sit under the phone nav), and the number of bars says how many images. */
.nfg-ex-media.has-steps::before{
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 72px;
  background: linear-gradient(rgba(0,0,0,.32), rgba(0,0,0,0));
  pointer-events: none;
}

.nfg-gallery-steps{
  position: absolute;
  top: .35rem;
  left: .6rem;
  right: .6rem;
  z-index: 2;
  display: flex;
  gap: 4px;
}

/* Each bar is a 22px-tall tap target around a 3px line. */
.nfg-gallery-step{
  flex: 1 1 0;
  display: grid;
  align-items: center;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
}

.nfg-gallery-step::before{
  content: "";
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.42);
  transition: background-color .2s ease;
}

.nfg-gallery-step.is-active::before{ background: #fff; }

.nfg-gallery-arrow{
  position: absolute;
  z-index: 2;
  top: 50%;
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: #171714;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  transform: translateY(-50%);
}

.nfg-gallery-arrow.is-prev{ left: .6rem; }
.nfg-gallery-arrow.is-next{ right: .6rem; }

@media (hover: hover) and (pointer: fine){
  .nfg-gallery-arrow{ display: grid; }
  .nfg-gallery-arrow[hidden]{ display: none; }
}

.nfg-help-btn{
  position: absolute;
  z-index: 2;
  top: 2.1rem;
  right: .6rem;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #171714;
  font-size: 1.15rem;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}

.nfg-ex-media:not(.has-steps) .nfg-help-btn{ top: .6rem; }

.nfg-video-links{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem;
  width: min(100%, calc(78svh * 9 / 16));
  margin: .75rem auto 0;
}

.nfg-video-link{
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 40px;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
}

.nfg-video-link:first-child{ flex: 1 1 auto; justify-content: center; }
.nfg-video-link.is-youtube .nfg-icon{ color: #FF0033; font-size: 1.15rem; }
.nfg-video-link:hover{ color: var(--app-text); border-color: var(--app-text); }

@media (min-width: 992px){
  .nfg-video-links{ width: min(380px, calc((100svh - 150px) * 9 / 16)); }
}

.nfg-ex-kicker{
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.nfg-ex-title{
  font-size: clamp(1.45rem, 4.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: .15rem 0 0;
}

.nfg-ex-chips{
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .8rem;
}

.nfg-mchip{
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 .65rem;
  border-radius: 999px;
  border: 1.5px solid var(--group-color, var(--app-border-strong));
  color: var(--app-text);
  font-size: .78rem;
  font-weight: 650;
  text-decoration: none;
}

a.nfg-mchip:hover{ color: var(--app-text); }
.nfg-mchip.is-primary{ background: var(--group-color); border-color: var(--group-color); color: var(--on-color); }
a.nfg-mchip.is-primary:hover{ color: var(--on-color); }
.nfg-mchip.is-neutral{ border-color: var(--app-border-strong); background: var(--app-surface-strong); }

.nfg-ex-info > :first-child{ margin-top: 0; }

.nfg-ex-summary{
  margin: 1rem 0 0;
  padding-left: .85rem;
  border-left: 3px solid var(--accent);
  color: var(--app-text);
  line-height: 1.55;
}

.nfg-ex-variations{ display: grid; gap: .45rem; margin-top: 1.1rem; }

/* How to do it: Start · Movement · Finish. Illustrated figures (formfigures.py) or
   Nate's step photos; a swipeable rail on phones, three columns from 576px. */
.nfg-form{ margin-top: 1.35rem; }
.nfg-form-title{ margin: 0 0 .65rem; font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.nfg-form-steps{
  list-style: none;
  margin: 0 -1rem;
  padding: 0 1rem .25rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 66%;
  gap: .75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1rem;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.nfg-form-steps::-webkit-scrollbar{ display: none; }
@media (min-width: 576px){
  .nfg-form-steps{
    margin: 0;
    padding: 0;
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }
}
.nfg-form-step{
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.nfg-form-media{
  position: relative;
  aspect-ratio: 4 / 5;
  background: #121514;
  border-bottom: 3px solid var(--accent);
}
.nfg-form-media > svg,
.nfg-form-media > img{ display: block; width: 100%; height: 100%; object-fit: cover; }
.nfg-form-badge{
  position: absolute;
  top: .5rem;
  left: .5rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .65rem .2rem .22rem;
  border-radius: 999px;
  background: rgba(0,0,0,.58);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.nfg-form-badge b{
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-color);
  font-size: .72rem;
}
.nfg-form-caption{ margin: .65rem .75rem .4rem; font-size: .9rem; line-height: 1.42; color: var(--app-text); }
.nfg-form-tip{
  display: flex;
  gap: .42rem;
  margin: auto .75rem .75rem;
  padding-top: .45rem;
  border-top: 1px dashed var(--app-border);
  font-size: .8rem;
  line-height: 1.38;
  color: var(--app-text-muted);
}
.nfg-form-tip > .nfg-icon{ flex: none; width: .95rem; height: .95rem; margin-top: .05rem; color: var(--accent); }
.nfg-form-tip > .nfg-icon svg{ width: 100%; height: 100%; display: block; }

.nfg-variation{
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem .85rem;
  border-radius: var(--radius-sm);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  text-decoration: none;
}

.nfg-variation:hover{ color: var(--app-text); border-color: var(--app-border-strong); }

.nfg-variation-tag{
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--app-success-soft);
  color: var(--app-success);
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.nfg-variation-tag.is-harder{ background: var(--app-danger-soft); color: var(--danger-text); }
.nfg-variation-name{ flex: 1; font-weight: 650; }

.nfg-more{
  padding-top: 1.25rem;
  border-top: 1px solid var(--app-border);
}

.nfg-more-title{
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 .75rem;
}

.nfg-mini-card{
  display: flex;
  flex-direction: column;
  gap: .3rem;
  width: 112px;
  color: var(--app-text);
  text-decoration: none;
}

.nfg-mini-card:hover{ color: var(--app-text); }
.nfg-mini-media{ border-radius: var(--radius-sm); }
.nfg-mini-title{ font-size: .78rem; font-weight: 650; line-height: 1.2; }

.nfg-save-btn{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

/* How-to sheet */
.nfg-tabs{
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  padding: 0 1.1rem .5rem;
  scrollbar-width: none;
}

.nfg-tabs::-webkit-scrollbar{ display: none; }

.nfg-tab{
  flex: 0 0 auto;
  height: 34px;
  padding: 0 .9rem;
  border-radius: 999px;
  border: 1px solid var(--app-border-strong);
  background: var(--app-surface-strong);
  color: var(--app-text);
  font-size: .86rem;
  font-weight: 650;
}

.nfg-tab.active{ background: var(--solid-bg); border-color: var(--solid-bg); color: var(--solid-fg); }

.nfg-howto-sub{
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--app-text-soft);
  margin: .6rem 0 .45rem;
}

.nfg-howto-list,
.nfg-howto-steps{
  margin: 0 0 .6rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .5rem;
}

.nfg-howto-list li{
  position: relative;
  padding-left: 1.1rem;
  line-height: 1.45;
}

.nfg-howto-list li::before{
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.nfg-howto-list.is-mistakes li::before{ background: var(--danger-text); }
.nfg-howto-list.is-safety li::before{ background: var(--warn-text); }

.nfg-howto-steps{ counter-reset: howto; }

.nfg-howto-steps li{
  position: relative;
  padding-left: 2.1rem;
  line-height: 1.45;
  min-height: 1.5rem;
}

.nfg-howto-steps li::before{
  counter-increment: howto;
  content: counter(howto);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-color);
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.5rem;
  text-align: center;
}

.nfg-howto-note{
  margin: .6rem 0 0;
  padding: .65rem .8rem;
  border-radius: var(--radius-sm);
  background: var(--app-surface-muted);
  font-size: .9rem;
}

.nfg-video-frame{
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.nfg-video-frame iframe{ position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Lists (search, A–Z) */
.nfg-list{ display: grid; gap: .45rem; }

.nfg-list-row{
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  text-decoration: none;
}

.nfg-list-row:hover{ color: var(--app-text); border-color: var(--app-border-strong); }
.nfg-list-row > .nfg-icon{ color: var(--app-text-soft); }

.nfg-list-thumb{
  flex: 0 0 44px;
  height: 55px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--media-bg);
}

.nfg-list-thumb img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.nfg-list-main{ display: flex; flex-direction: column; flex: 1; min-width: 0; }
.nfg-list-title{ font-weight: 700; }
.nfg-list-meta{ font-size: .78rem; color: var(--app-text-muted); }

.nfg-letter{
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  font-weight: 700;
  text-decoration: none;
}

.nfg-letter-head{ font-size: 1rem; font-weight: 800; margin: 0 0 .5rem; color: var(--app-text-soft); }

.nfg-help-btn:focus-visible,
.nfg-video-link:focus-visible,
.nfg-tile:focus-visible,
.nfg-card:focus-visible,
.nfg-mini-card:focus-visible,
.nfg-variation:focus-visible,
.nfg-list-row:focus-visible,
.nfg-pager-num:focus-visible,
.nfg-active-chip:focus-visible,
.nfg-iconbtn:focus-visible,
.nfg-pill:focus-visible,
.nfg-tab:focus-visible{
  outline: 3px solid var(--app-accent);
  outline-offset: 2px;
}

/* Muscle-group tile detail line (Exercises catalogue). */
.nfg-group-blurb{
  position: relative;
  margin: .15rem 0 .5rem;
  font-size: .74rem;
  line-height: 1.3;
  opacity: .82;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =====================================================================
   Home: build today's session
   ===================================================================== */
.nfg-today{
  display: grid;
  gap: 1.1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-md);
  min-width: 0;
}

.nfg-today > *{ min-width: 0; }

.nfg-today .nfg-env-switch{ max-width: none; }

.nfg-today-label{
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.005em;
  margin: 0 0 .6rem;
}

/* Session type cards: one colour per split, big name, what it covers. */
.nfg-split-card{
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  width: 172px;
  min-height: 150px;
  padding: .95rem 1rem .85rem;
  border-radius: 18px;
  color: var(--on-color);
  text-decoration: none;
  background: var(--split-color);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.24), transparent 55%),
    linear-gradient(160deg, var(--split-color), color-mix(in srgb, var(--split-color) 68%, #000));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--split-color) 30%, transparent);
  transition: transform .15s ease;
}

.nfg-split-card::after{
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  z-index: -1;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 14px solid rgba(255,255,255,.13);
}

.nfg-split-card:hover{ color: var(--on-color); }
.nfg-split-card:active{ transform: scale(.97); }
.nfg-split-card:focus-visible{ outline: 3px solid var(--app-accent); outline-offset: 2px; }

.nfg-split-name{ font-size: 1.4rem; font-weight: 850; letter-spacing: -.015em; line-height: 1.1; }
.nfg-split-covers{ font-size: .78rem; line-height: 1.3; opacity: .92; }
.nfg-split-focus{ font-size: .72rem; line-height: 1.3; opacity: .78; }

.nfg-split-count{
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  align-self: flex-start;
  margin-top: auto;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  font-size: .74rem;
  font-weight: 800;
}

.nfg-split-count .nfg-icon{ width: .85em; height: .85em; }

/* Muscle chips: tinted in the group colour, solid when picked. */
.nfg-session-chips{ display: flex; flex-wrap: wrap; gap: .45rem; }

.nfg-pick input{ position: absolute; opacity: 0; pointer-events: none; }

.nfg-pick span{
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 .9rem;
  border-radius: 999px;
  border: 1.5px solid var(--group-color);
  border-color: color-mix(in srgb, var(--group-color) 40%, var(--mix-base));
  background: var(--app-surface-strong);
  background: color-mix(in srgb, var(--group-color) 11%, var(--mix-base));
  color: var(--app-text);
  color: color-mix(in srgb, var(--group-color) 72%, var(--mix-deep));
  font-size: .88rem;
  font-weight: 750;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.nfg-pick input:checked + span{ background: var(--group-color); border-color: var(--group-color); color: var(--on-color); }
.nfg-pick input:checked + span::before{ content: "✓"; margin-right: .3rem; font-weight: 800; }
.nfg-pick input:focus-visible + span{ outline: 3px solid var(--app-accent); outline-offset: 2px; }
.nfg-pick input:disabled + span{ opacity: .4; cursor: default; }

.nfg-session-go{ width: 100%; margin-top: .9rem; }
.nfg-session-go:disabled{
  background: var(--app-surface-inset);
  color: var(--app-text-soft);
  box-shadow: none;
  border: 1.5px solid var(--app-border);
}

/* Continue training, compact (top of Home) */
.nfg-continue.is-compact{
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  padding: .85rem .9rem .85rem 1.1rem;
}

.nfg-continue-body{ display: grid; gap: .12rem; min-width: 0; }

.nfg-continue.is-compact .nfg-continue-title{
  font-size: 1.02rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nfg-continue.is-compact .nfg-continue-meta{ font-size: .8rem; }

.nfg-continue-go{
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-a), var(--gold-b));
  color: var(--on-gold);
}

/* Session pages: focus switch (chest vs shoulders, etc.) */
.nfg-focus{
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--app-border-strong);
  background: var(--app-surface-strong);
  color: var(--app-text);
  font-weight: 700;
  font-size: .88rem;
  white-space: nowrap;
  text-decoration: none;
}

.nfg-focus.is-active{ background: var(--solid-bg); border-color: var(--solid-bg); color: var(--solid-fg); }
.nfg-focus.is-active[style*="--split-color"]{ background: var(--split-color); border-color: var(--split-color); }

/* Session and Mixer pages: title on the left, Home/Gym/Hybrid and Add top-right, the
   level switch and picked add-ons in one slim row under it. */
.nfg-session-top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}
.nfg-session-id{ position: relative; min-width: 0; padding-left: .85rem; }
.nfg-session-id::before{
  content: "";
  position: absolute;
  left: 0;
  top: .15rem;
  bottom: .15rem;
  width: 5px;
  border-radius: 999px;
  background: var(--split-color, var(--gold-b));
}
.nfg-session-id .app-page-kicker{ color: var(--split-color, var(--app-text-soft)); }
.nfg-session-id .nfg-page-title{ margin-bottom: .2rem; }
.nfg-session-id .nfg-env-note{ margin: 0; }
.nfg-session-controls{ flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .45rem; padding-top: .2rem; }

.nfg-seg{
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--app-surface-inset);
  border: 1px solid var(--app-border);
}
.nfg-seg-opt{
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 .7rem;
  border-radius: 999px;
  color: var(--app-text-muted);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.nfg-seg-opt:hover{ color: var(--app-text); }
.nfg-seg-opt.is-on{ background: var(--switch-bg); color: var(--switch-fg); box-shadow: var(--shadow-sm); }
.nfg-seg.is-env .nfg-seg-opt{ height: 28px; padding: 0 .6rem; font-size: .76rem; }

.nfg-session-bar{ display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: .1rem 0 1rem; }

.nfg-addmenu{ position: relative; }
.nfg-addmenu > summary{ list-style: none; }
.nfg-addmenu > summary::-webkit-details-marker{ display: none; }
.nfg-addmenu-btn{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  height: 32px;
  padding: 0 .8rem;
  border-radius: 999px;
  border: 1.5px dashed var(--app-border-strong);
  background: var(--app-surface-strong);
  color: var(--app-text);
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
}
.nfg-addmenu[open] .nfg-addmenu-btn{ border-style: solid; border-color: var(--app-text); }
.nfg-addmenu-btn .nfg-icon{ font-size: .8rem; }
.nfg-addmenu-pop{
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 210px;
  padding: .45rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--app-border);
  background: var(--app-surface-strong);
  box-shadow: 0 14px 36px rgba(0,0,0,.18);
}
.nfg-addmenu-note{ margin: .15rem .5rem .35rem; font-size: .72rem; font-weight: 700; color: var(--app-text-soft); text-transform: uppercase; letter-spacing: .06em; }
.nfg-addmenu-item{
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .6rem;
  border-radius: var(--radius-sm);
  color: var(--app-text);
  font-weight: 650;
  font-size: .9rem;
  text-decoration: none;
}
.nfg-addmenu-item:hover{ background: var(--app-surface-inset); color: var(--app-text); }
.nfg-addmenu-dot{ width: 10px; height: 10px; border-radius: 50%; background: var(--group-color); flex: none; }
.nfg-addmenu-state{ margin-left: auto; color: var(--app-text-soft); }
.nfg-addmenu-item.is-on .nfg-addmenu-state{ color: var(--group-color); }

/* Session rows: number, image, name, sets x reps on the right. */
.nfg-srow{
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .7rem .55rem .55rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  text-decoration: none;
}
.nfg-srow:hover{ color: var(--app-text); border-color: var(--app-border-strong); }
.nfg-srow:focus-visible{ outline: 3px solid var(--app-accent); outline-offset: 2px; }
.nfg-srow .nfg-ex-thumb{ flex-basis: 52px; height: 64px; }
.nfg-srow .nfg-ex-body{ flex: 1; }
.nfg-srow-n{
  flex: none;
  width: 1.6rem;
  text-align: center;
  font-weight: 800;
  font-size: .9rem;
  color: var(--split-color, var(--app-text-soft));
  font-variant-numeric: tabular-nums;
}
.nfg-srow-scheme{
  flex: none;
  padding: .3rem .55rem;
  border-radius: var(--radius-sm);
  background: var(--app-surface-inset);
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.nfg-srow-note{ font-weight: 750; color: var(--app-text); }
.nfg-tier{
  margin: 1rem 0 .5rem;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--app-text-soft);
}
.nfg-tier:first-of-type{ margin-top: .2rem; }
.nfg-more-options{ margin-top: 1rem; }
.nfg-more-options > summary{
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .45rem 0;
  font-weight: 750;
  font-size: .9rem;
  color: var(--app-text-muted);
  cursor: pointer;
}
.nfg-more-options[open] > summary{ margin-bottom: .5rem; color: var(--app-text); }

/* Muscle Mixer: tap the body (dark card like the exercise muscle cards). */
.nfg-bodypick{
  position: relative;
  padding: 1rem .5rem .6rem;
  border-radius: var(--radius-lg);
  background: radial-gradient(120% 90% at 50% 30%, #1a1e1c, #0e100f);
}
.nfg-bodypick-figs{ display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; max-width: 520px; margin: 0 auto; }
.nfg-bodypick-fig{ margin: 0; text-align: center; }
.nfg-bodypick-fig figcaption{ margin-top: .3rem; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.nfg-bm{ width: 100%; height: auto; max-height: 52vh; display: block; margin: 0 auto; }
.nfg-bm-outline{ fill: #272b29; }
.nfg-bm-deco{ fill: #303432; stroke: #101211; stroke-width: 2.2; }
.nfg-bm-region{ fill: #3c413e; stroke: #101211; stroke-width: 2.2; stroke-linejoin: round; transition: fill .15s ease; }
.nfg-bm-link{ cursor: pointer; }
.nfg-bm-link:hover .nfg-bm-region,
.nfg-bm-link:focus-visible .nfg-bm-region{ fill: color-mix(in srgb, var(--group-color) 55%, #3c413e); }
.nfg-bm-link.is-on .nfg-bm-region{ fill: var(--group-color); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--group-color) 70%, transparent)); }
.nfg-bm-link.is-empty .nfg-bm-region{ fill: #2d312f; }
.nfg-bm-link:focus{ outline: none; }
.nfg-bodypick-hint{ margin: .6rem 0 0; text-align: center; font-size: .8rem; color: rgba(255,255,255,.62); }
.nfg-picked{ display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .8rem 0 0; }
.nfg-mixlist{ margin: .8rem 0 1.2rem; }
.nfg-mixlist > summary{ font-weight: 750; font-size: .88rem; color: var(--app-text-muted); cursor: pointer; padding: .3rem 0; }
.nfg-mixlist[open] > summary{ margin-bottom: .5rem; }
.nfg-pick{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  height: 34px;
  padding: 0 .8rem;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--group-color) 50%, var(--app-border-strong));
  background: var(--app-surface-strong);
  color: var(--app-text);
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
}
.nfg-pick small{ font-weight: 600; color: var(--app-text-soft); }
.nfg-pick.is-on{ background: var(--group-color); border-color: var(--group-color); color: var(--on-color); }
.nfg-pick.is-on small{ color: rgba(255,255,255,.75); }
.nfg-pick.is-empty{ opacity: .5; }
@media (max-width: 420px){
  .nfg-seg.is-env .nfg-seg-opt{ padding: 0 .5rem; font-size: .72rem; }
  .nfg-session-id .nfg-page-title{ font-size: 1.8rem; }
}


h2.nfg-results-head{ font-size: 1rem; font-weight: 800; margin: 0 0 .7rem; }

.nfg-results-n{
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: .35rem;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--app-surface-inset);
  font-size: .74rem;
  font-weight: 800;
  vertical-align: middle;
}

.nfg-focus:focus-visible{ outline: 3px solid var(--app-accent); outline-offset: 2px; }

/* =====================================================================
   Top bar: wordmark, Sign in / Join, menu, search drawer
   ===================================================================== */
.nfg-brand-word{ color: var(--bar-fg); }

.nfg-pill.is-quiet{ border-color: transparent; padding: 0 .55rem; color: rgba(255,255,255,.88); }
.nfg-pill.is-quiet:hover{ color: var(--bar-fg); background: var(--bar-field); border-color: transparent; }

.nfg-pill.is-solid{
  border-color: transparent;
  background: linear-gradient(180deg, var(--gold-a), var(--gold-b));
  color: var(--on-gold);
  font-weight: 800;
}

.nfg-pill.is-solid:hover,
.nfg-pill.is-solid.is-active{ color: var(--on-gold); background: var(--gold-active); border-color: transparent; }

@media (max-width: 359.98px){
  .nfg-topactions{ gap: .15rem; }
  .nfg-pill{ padding: 0 .6rem; }
}

.nfg-search-drawer{ border-top: 1px solid rgba(255,255,255,.06); }

.nfg-drawer-field{
  display: flex;
  align-items: center;
  gap: .55rem;
  height: 44px;
  margin: .55rem 0 .7rem;
  padding: 0 .9rem;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.65);
}

.nfg-drawer-field input{
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--bar-fg);
  font-size: 1rem; /* 16px: stops iOS zooming into the field */
}

.nfg-drawer-field input::placeholder{ color: rgba(255,255,255,.5); }

@media (min-width: 992px){
  .nfg-search-drawer{ display: none !important; }
}

/* Menu (hamburger): a small card that drops from the button, sized to its contents.
   It pops in from the top-right corner in 160ms and closes instantly. */
.nfg-menu-wrap{ position: relative; }

.dropdown-menu.nfg-menu{
  --bs-dropdown-link-hover-bg: var(--app-surface-inset);
  --bs-dropdown-link-hover-color: var(--app-text);
  --bs-dropdown-link-active-bg: var(--app-surface-inset);
  --bs-dropdown-link-active-color: var(--app-text);
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: min(264px, calc(100vw - 24px));
  margin: 0;
  padding: .4rem;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-bg);
  box-shadow: 0 18px 40px rgba(0,0,0,.22), 0 2px 6px color-mix(in srgb, var(--app-text) 8%, transparent);
  z-index: 1100;
  transform-origin: top right;
}

@media (prefers-reduced-motion: no-preference){
  .dropdown-menu.nfg-menu.show{ animation: nfg-menu-in .16s cubic-bezier(.22, .8, .24, 1); }
}

@keyframes nfg-menu-in{
  from{ opacity: 0; transform: translateY(-6px) scale(.96); }
  to{ opacity: 1; transform: none; }
}

.nfg-menu .nfg-menu-link{
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  min-height: 42px;
  padding: .45rem .65rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--app-text);
  font-size: .92rem;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
  text-decoration: none;
}

.nfg-menu .nfg-menu-link .nfg-icon{ width: 1rem; height: 1rem; color: var(--app-text-muted); }
.nfg-menu .nfg-menu-link:hover,
.nfg-menu .nfg-menu-link:focus{ background: var(--app-surface-inset); color: var(--app-text); }
.nfg-menu .nfg-menu-link.is-active{ background: var(--app-surface-strong); box-shadow: var(--shadow-sm); }
.nfg-menu .nfg-menu-link.is-active .nfg-icon{ color: var(--app-accent-strong); }
.nfg-menu .nfg-menu-link:focus-visible{ outline: 3px solid var(--app-accent); outline-offset: -1px; }

.nfg-menu-sep{ height: 1px; margin: .35rem .5rem; background: var(--app-border); }

/* Theme switch inside the menu */
.nfg-theme-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin: 0;
  padding: .35rem .75rem .35rem .85rem;
}
.nfg-theme-label{
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .92rem;
  font-weight: 650;
  color: var(--app-text);
}
.nfg-theme-label .nfg-icon{ width: 1rem; height: 1rem; color: var(--app-text-muted); }
.nfg-theme-seg{
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: var(--app-surface-inset);
  border: 1px solid var(--app-border);
}
.nfg-theme-seg button{
  min-width: 46px;
  height: 26px;
  padding: 0 .55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--app-text-muted);
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
}
.nfg-theme-seg button.is-on{ background: var(--solid-bg); color: var(--solid-fg); }
.nfg-theme-seg button:focus-visible{ outline: 2px solid var(--app-accent); outline-offset: 1px; }

/* Overlays sit above the bottom nav. */
body.modal-open .bottom-nav,
body.modal-open .mobile-swipe-rail,
body:has(.offcanvas.show) .bottom-nav,
body:has(.offcanvas.show) .mobile-swipe-rail,
body:has(.offcanvas.showing) .bottom-nav,
body:has(.offcanvas.showing) .mobile-swipe-rail{ z-index: 1030; }

/* =====================================================================
   How-to popup (exercise page)
   ===================================================================== */
.nfg-howto-dialog{
  max-width: min(340px, calc(100vw - 3rem));
  margin-left: auto;
  margin-right: auto;
}

.nfg-howto-card{
  display: flex;
  flex-direction: column;
  height: min(440px, 60vh);
  border: 0;
  border-radius: 20px;
  border-top: 5px solid var(--accent);
  background: var(--app-bg);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  overflow: hidden;
}

.nfg-howto-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem .6rem .5rem 1.1rem;
}

.nfg-howto-title{ font-size: 1.1rem; font-weight: 800; line-height: 1.2; margin: .1rem 0 0; }

.nfg-howto .nfg-tabs{ flex: 0 0 auto; padding-bottom: .6rem; border-bottom: 1px solid var(--app-border); }
.nfg-howto .nfg-tab{ height: 32px; padding: 0 .75rem; font-size: .84rem; }

.nfg-howto-body{
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .5rem 1.1rem 1rem;
  font-size: .92rem;
}

.modal.fade.nfg-howto .modal-dialog{ transform: scale(.94); transition: transform .18s ease-out; }
.modal.fade.nfg-howto.show .modal-dialog{ transform: none; }

/* =====================================================================
   Exercises page (catalogue)
   ===================================================================== */
.nfg-library .nfg-page-head .app-page-kicker{ margin-bottom: -.55rem; }

@media (min-width: 992px){
  .nfg-group-grid.is-six{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.nfg-more-btn{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin-top: .6rem;
  border-radius: 999px;
  border: 1.5px solid var(--app-border-strong);
  background: transparent;
  color: var(--app-text);
  font-size: .9rem;
  font-weight: 750;
}

.nfg-more-btn:hover{ background: var(--app-surface-inset); }
.nfg-more-btn:focus-visible{ outline: 3px solid var(--app-accent); outline-offset: 2px; }

/* Equipment: tinted tiles in the equipment colour. */
.nfg-eq-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}

@media (min-width: 576px){
  .nfg-eq-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.nfg-eq-tile{
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .5rem;
  min-height: 84px;
  padding: .85rem .9rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--tile-accent);
  border-color: color-mix(in srgb, var(--tile-accent) 28%, var(--mix-base));
  background: var(--app-surface-strong);
  background: color-mix(in srgb, var(--tile-accent) 9%, var(--mix-base));
  color: var(--app-text);
  text-decoration: none;
}

.nfg-eq-tile::before{
  content: "";
  position: absolute;
  top: .9rem;
  right: .9rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tile-accent);
}

.nfg-eq-label{
  padding-right: 1rem;
  font-weight: 800;
  color: var(--tile-accent);
  color: color-mix(in srgb, var(--tile-accent) 78%, var(--mix-deep));
}

.nfg-eq-meta{ display: grid; gap: .05rem; font-size: .76rem; font-weight: 650; color: var(--app-text-muted); }
.nfg-eq-where{ font-weight: 600; color: var(--app-text-soft); }

.nfg-eq-tile:hover{ color: var(--app-text); border-color: var(--tile-accent); }
.nfg-eq-tile:focus-visible{ outline: 3px solid var(--app-accent); outline-offset: 2px; }

/* Level: difficulty bars + one line on who it suits. */
.nfg-level-grid{ display: grid; gap: .6rem; }

@media (min-width: 768px){
  .nfg-level-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.nfg-level-card{
  --level: #2E8A5F;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "bars label count"
    "bars blurb count";
  align-items: center;
  column-gap: .9rem;
  row-gap: .1rem;
  padding: .85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-sm);
  color: var(--app-text);
  text-decoration: none;
}

.nfg-level-card.is-intermediate{ --level: #C79A1E; }
.nfg-level-card.is-advanced{ --level: #B23A3A; }
.nfg-level-card.is-empty{ opacity: .6; }

.nfg-level-bars{
  grid-area: bars;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
}

.nfg-level-bars span{
  width: 7px;
  border-radius: 3px;
  background: var(--app-border-strong);
}

.nfg-level-bars span:nth-child(1){ height: 40%; }
.nfg-level-bars span:nth-child(2){ height: 70%; }
.nfg-level-bars span:nth-child(3){ height: 100%; }
.nfg-level-bars span.is-on{ background: var(--level); }

.nfg-level-label{ grid-area: label; font-weight: 800; }
.nfg-level-blurb{ grid-area: blurb; font-size: .8rem; line-height: 1.3; color: var(--app-text-muted); }

.nfg-level-count{
  grid-area: count;
  font-size: .76rem;
  font-weight: 750;
  color: var(--app-text-soft);
  white-space: nowrap;
}

.nfg-level-card:hover{ color: var(--app-text); border-color: var(--level); }
.nfg-level-card:focus-visible{ outline: 3px solid var(--app-accent); outline-offset: 2px; }

/* Home hero: tighter now the kicker is back. */
.nfg-home .nfg-hero-title{ margin-bottom: 0; }

/* Sign in / Join on their own pages: keep the active pill readable. */
.nfg-pill.is-quiet.is-active{ color: var(--bar-active-fg); background: var(--bar-active-bg); }

/* =====================================================================
   About
   ===================================================================== */
.nfg-about{ max-width: 720px; }
.nfg-about .nfg-page-head .app-page-kicker{ margin-bottom: -.55rem; }
.nfg-about-lead{ margin: 0; color: var(--app-text-muted); font-size: 1.02rem; line-height: 1.5; }

.nfg-about-list{ display: grid; gap: .6rem; margin: .8rem 0 0; padding: 0; list-style: none; }

.nfg-about-list li{
  display: grid;
  gap: .15rem;
  padding: .85rem 1rem .85rem 1.15rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--group-color);
  box-shadow: var(--shadow-sm);
}

.nfg-about-list strong{ font-weight: 800; }
.nfg-about-list span{ color: var(--app-text-muted); font-size: .92rem; line-height: 1.4; }

.nfg-about-note{
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
}

.nfg-about-note-title{ font-size: 1rem; font-weight: 800; margin: 0 0 .35rem; }
.nfg-about-note p{ margin: 0; color: var(--app-text-muted); font-size: .92rem; line-height: 1.5; }

.nfg-about-actions{ display: flex; flex-wrap: wrap; gap: .6rem; }
.nfg-about-actions .nfg-btn{ flex: 1 1 180px; }

/* =====================================================================
   Programs: program page, day page, programs list (revamp phase 4)
   Day colours come from the day type (--day); program accents from the file (--accent).
   ===================================================================== */
.nfg-prog{ max-width: 760px; }
.nfg-prog .nfg-page-head .app-page-kicker{ margin-bottom: -.55rem; }
.nfg-prog-summary{ margin: 0; color: var(--app-text-muted); line-height: 1.5; }

.nfg-prog-facts{ display: flex; flex-wrap: wrap; gap: .35rem; }
.nfg-prog-facts span{
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 .65rem;
  border-radius: 999px;
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  font-size: .8rem;
  font-weight: 700;
  color: var(--app-text);
}
.nfg-prog-facts.is-dark span{ background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: #fff; }

.nfg-dot{ display: inline-block; flex: none; width: .6em; height: .6em; border-radius: 50%; background: var(--dot, var(--gold-a)); }

/* Return visits: level + Home/Gym in one slim row */
.nfg-prog-toggles{ display: flex; flex-wrap: wrap; gap: .4rem; }

/* First visit: two rows of pills */
.nfg-prog-setup{
  display: grid;
  gap: .55rem;
  padding: .8rem .9rem;
  border-radius: var(--radius-lg);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-sm);
}
.nfg-prog-setup-row{ display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); align-items: center; gap: .5rem; }
.nfg-prog-label{ font-size: .78rem; font-weight: 800; color: var(--app-text-soft); }
.nfg-prog-seg{ display: flex; width: 100%; }
.nfg-prog-seg .nfg-seg-opt{ flex: 1 1 0; justify-content: center; height: 34px; padding: 0 .4rem; font-size: .82rem; }
.nfg-prog-note{ margin: 0; color: var(--app-text-muted); font-size: .86rem; line-height: 1.45; }
.nfg-prog-fixed{ display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; padding-left: .3rem; font-size: .92rem; font-weight: 800; }
.nfg-prog-fixed small{ font-size: .78rem; font-weight: 600; color: var(--app-text-muted); }

/* Next up: dark card washed with the day's colour */
.nfg-prog-next{
  --day: var(--gold-a);
  position: relative;
  display: grid;
  gap: .45rem;
  padding: 1.05rem 1.1rem 1.1rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(130% 110% at 100% 0%, color-mix(in srgb, var(--day) 42%, transparent), transparent 62%),
    var(--card-dark);
  color: var(--card-dark-fg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.nfg-prog-next::before{
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--day);
}
.nfg-prog-next-top{ display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem .8rem; }
.nfg-prog-next-kicker{ font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-a); }
.nfg-prog-next-week{ font-size: .78rem; font-weight: 700; color: rgba(255,255,255,.72); }
.nfg-prog-next-title{ display: flex; align-items: center; gap: .55rem; font-size: 1.75rem; font-weight: 850; letter-spacing: -.02em; line-height: 1.1; }
.nfg-day-tag{
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 .55rem;
  border-radius: 999px;
  background: var(--day);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.nfg-prog-next-meta{ display: flex; flex-wrap: wrap; gap: .15rem .7rem; font-size: .86rem; color: rgba(255,255,255,.8); }
.nfg-prog-next-list{ display: flex; flex-wrap: wrap; gap: .35rem; margin: .15rem 0 0; padding: 0; list-style: none; }
.nfg-prog-next-list li{
  padding: .2rem .6rem;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  font-size: .78rem;
  font-weight: 650;
  color: rgba(255,255,255,.9);
}
.nfg-prog-next-list li.is-more{ background: transparent; color: rgba(255,255,255,.6); padding-left: .2rem; }
.nfg-prog-progress{ display: grid; gap: .3rem; margin-top: .25rem; font-size: .8rem; color: rgba(255,255,255,.75); }
.nfg-prog-progress .nfg-progress{ margin: 0; }
.nfg-prog-progress .nfg-progress-bar{ background: var(--gold-a); }
.nfg-prog-start{ width: 100%; margin-top: .45rem; gap: .4rem; }
.nfg-prog-start .nfg-icon{ width: 1em; height: 1em; }

.nfg-prog-empty{
  display: grid;
  gap: .5rem;
  justify-items: start;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-muted);
  border: 1px solid var(--app-border);
}
.nfg-prog-empty h2{ font-size: 1.05rem; font-weight: 800; margin: 0; }
.nfg-prog-empty p{ margin: 0; color: var(--app-text-muted); }

/* Day cards (program page): colour bar + number in the day's colour */
.nfg-day-list{ display: grid; gap: .5rem; margin-top: .6rem; }
.nfg-day-card{
  --day: var(--gold-a);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  padding: .75rem .85rem .75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-sm);
  color: var(--app-text);
  text-decoration: none;
  overflow: hidden;
}
.nfg-day-card::before{ content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--day); }
.nfg-day-card:hover{ color: var(--app-text); border-color: var(--app-border-strong); }
.nfg-day-card.is-next{ border-color: color-mix(in srgb, var(--day) 55%, var(--app-border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--day) 16%, transparent), var(--shadow-sm); }
.nfg-day-num{
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--day) 16%, var(--app-surface-strong));
  color: var(--app-text);
  font-weight: 850;
}
.nfg-day-card.is-next .nfg-day-num{ background: var(--day); color: #fff; }
.nfg-day-card.is-done .nfg-day-num{ background: var(--app-success); color: var(--on-color); }
.nfg-day-card.is-done .nfg-day-name{ color: var(--app-text-muted); }
.nfg-day-body{ display: grid; gap: .1rem; min-width: 0; }
.nfg-day-name{ display: flex; align-items: center; gap: .45rem; font-weight: 800; }
.nfg-day-flag{
  padding: .1rem .45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--day) 18%, transparent);
  color: var(--app-text);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.nfg-day-meta{ font-size: .8rem; color: var(--app-text-muted); }
.nfg-day-go{ color: var(--app-text-soft); }

/* Week strip (program page) */
.nfg-week-chip{
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: .25rem;
  width: 80px;
  padding: .6rem .4rem .55rem;
  border-radius: 14px;
  background: var(--app-surface-strong);
  border: 1.5px solid var(--app-border);
  color: var(--app-text);
  text-decoration: none;
}
.nfg-week-n{ display: grid; place-items: center; height: 1.3rem; font-size: 1.2rem; font-weight: 850; line-height: 1; }
.nfg-week-n .nfg-icon{ width: 1rem; height: 1rem; }
.nfg-week-label{ font-size: .68rem; font-weight: 700; color: var(--app-text-muted); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nfg-week-dots{ display: flex; gap: 3px; }
.nfg-week-dots i{ width: 6px; height: 6px; border-radius: 50%; background: var(--app-border-strong); }
.nfg-week-dots i.is-on{ background: var(--day, var(--app-success)); }
.nfg-week-chip.is-current{ border-color: var(--app-accent); box-shadow: 0 0 0 3px var(--app-accent-soft); }
.nfg-week-chip.is-done{ background: var(--app-success-soft); border-color: transparent; }
.nfg-week-chip.is-done .nfg-week-n{ color: var(--app-success); }
.nfg-week-chip.is-locked{ opacity: .5; }
.nfg-week-chip.is-locked .nfg-week-n{ color: var(--app-text-soft); }
.nfg-week-chip:hover{ color: var(--app-text); }
.nfg-week-chip:focus-visible{ outline: 3px solid var(--app-accent); outline-offset: 2px; }

/* How it works */
.nfg-prog-how{
  padding: .9rem 1rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
}
.nfg-prog-how summary{ font-weight: 800; cursor: pointer; }
.nfg-prog-how-lead{ margin-top: .7rem; }
.nfg-phase-list{ display: grid; gap: .6rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.nfg-phase-list li{ display: grid; gap: .1rem; padding-left: .8rem; border-left: 3px solid var(--app-accent); }
.nfg-phase-weeks{ font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--app-text-soft); }
.nfg-phase-scheme{ font-size: .86rem; color: var(--app-text); }
.nfg-phase-note{ font-size: .84rem; color: var(--app-text-muted); }
.nfg-rule-list{ margin: .9rem 0 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .9rem; color: var(--app-text-muted); }

.nfg-link-btn{
  border: 0;
  padding: .3rem 0;
  background: transparent;
  color: var(--app-text-muted);
  font-size: .86rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nfg-prog-reset{ text-align: center; }

/* Day page: title left, day pills top-right, so the exercises start high */
.nfg-prog-day{ gap: .9rem; }
.nfg-pday-head{ display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.nfg-pday-id{ min-width: 0; }
.nfg-pday-id .app-page-kicker{ color: var(--app-text-soft); }
.nfg-pday-id .nfg-page-title{ display: flex; align-items: center; gap: .5rem; margin: 0; }
.nfg-pday-id .nfg-page-title::before{ content: ""; flex: none; width: .5em; height: .5em; border-radius: 50%; background: var(--day); }
.nfg-day-pills{ flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3rem; max-width: 60%; padding-top: .2rem; }
.nfg-day-pill{
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--day) 14%, var(--app-surface-strong));
  border: 1.5px solid color-mix(in srgb, var(--day) 45%, transparent);
  color: var(--app-text);
  font-size: .85rem;
  font-weight: 850;
  text-decoration: none;
}
.nfg-day-pill .nfg-icon{ width: .95rem; height: .95rem; }
.nfg-day-pill:hover{ color: var(--app-text); border-color: var(--day); }
.nfg-day-pill.is-done{ background: var(--app-success-soft); border-color: transparent; color: var(--app-success); }
.nfg-day-pill.is-active{ background: var(--day); border-color: var(--day); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--day) 22%, transparent); }
.nfg-day-pill:focus-visible{ outline: 3px solid var(--app-accent); outline-offset: 2px; }
.nfg-pday-facts{ margin-top: -.3rem; }
.nfg-pday-facts .is-focus{ background: color-mix(in srgb, var(--day) 14%, var(--app-surface-strong)); border-color: color-mix(in srgb, var(--day) 35%, transparent); }

.nfg-pday-list{ display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.nfg-pday-row{
  --row: var(--day);
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .5rem .8rem .5rem .75rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-sm);
  color: var(--app-text);
  text-decoration: none;
  overflow: hidden;
}
.nfg-pday-row::before{ content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--row); }
.nfg-pday-row:hover{ color: var(--app-text); border-color: var(--app-border-strong); }
.nfg-pday-thumb{ position: relative; width: 56px; height: 70px; border-radius: 10px; overflow: hidden; background: var(--media-bg); }
.nfg-pday-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.nfg-pday-n{
  position: absolute;
  left: 3px;
  top: 3px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--row);
  color: var(--on-color);
  font-size: .7rem;
  font-weight: 850;
}
.nfg-pday-row.is-custom .nfg-pday-n{ inset: 0; margin: auto; min-width: 28px; height: 28px; font-size: .85rem; }
.nfg-pday-body{ display: grid; gap: .15rem; min-width: 0; }
.nfg-pday-name{ font-weight: 800; line-height: 1.25; }
.nfg-pday-meta{ display: flex; flex-wrap: wrap; gap: .1rem .6rem; font-size: .78rem; color: var(--app-text-muted); }
.nfg-pday-group{ font-weight: 700; color: var(--app-text); }
.nfg-pday-swap,
.nfg-pday-note{ font-size: .76rem; color: var(--app-text-muted); line-height: 1.35; }
.nfg-pday-swap{ font-style: italic; }
.nfg-pday-dose{ display: grid; justify-items: end; gap: 0; text-align: right; }
.nfg-pday-dose b{ font-size: 1rem; font-weight: 850; white-space: nowrap; }
.nfg-pday-dose small{ font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--app-text-soft); white-space: nowrap; }

/* Mark complete · Next … Undo */
.nfg-pday-actions{ display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-top: .2rem; }
.nfg-pday-form{ display: contents; }
.nfg-pday-undo{ margin-left: auto; }
.nfg-act{
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 44px;
  padding: 0 1.1rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-size: .92rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.nfg-act .nfg-icon{ width: 1.05em; height: 1.05em; }
.nfg-act.is-primary{ background: linear-gradient(180deg, var(--gold-a), var(--gold-b)); color: var(--on-gold); box-shadow: 0 6px 16px rgba(155,125,33,.24); }
.nfg-act.is-primary:hover{ color: var(--on-gold); filter: brightness(1.04); }
.nfg-act.is-done{ background: var(--app-success); color: var(--on-color); }
.nfg-act.is-ghost{ background: var(--app-surface-strong); border-color: var(--app-border-strong); color: var(--app-text); }
.nfg-act.is-ghost:hover{ color: var(--app-text); border-color: var(--app-text); }
.nfg-undo-btn{
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 36px;
  padding: 0 .4rem;
  border: 0;
  background: transparent;
  color: var(--app-text-muted);
  font-size: .82rem;
  font-weight: 700;
}
.nfg-undo-btn:hover{ color: var(--app-text); }
.nfg-undo-btn .nfg-icon{ width: .95em; height: .95em; }

/* Week pills at the bottom of the day page */
.nfg-pday-weeks{ display: grid; gap: .45rem; padding-top: .6rem; border-top: 1px solid var(--app-border); }
.nfg-pday-weeks-head{ display: flex; justify-content: space-between; align-items: baseline; font-size: .78rem; font-weight: 800; color: var(--app-text-soft); letter-spacing: .04em; text-transform: uppercase; }
.nfg-pday-weeks-count{ font-weight: 700; letter-spacing: 0; text-transform: none; }
.nfg-week-pill{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  min-width: 40px;
  height: 34px;
  padding: 0 .6rem;
  border-radius: 999px;
  background: var(--app-surface-strong);
  border: 1.5px solid var(--app-border);
  color: var(--app-text);
  font-size: .85rem;
  font-weight: 800;
  text-decoration: none;
}
.nfg-week-pill .nfg-icon{ width: .85rem; height: .85rem; }
.nfg-week-pill:hover{ color: var(--app-text); border-color: var(--app-border-strong); }
.nfg-week-pill.is-done{ background: var(--app-success-soft); border-color: transparent; color: var(--app-success); }
.nfg-week-pill.is-current{ background: var(--solid-bg); border-color: var(--solid-bg); color: var(--solid-fg); }
.nfg-week-pill.is-locked{ opacity: .45; }

/* Programs list: dark cards with the program's accent */
.nfg-prog-cards{ display: grid; gap: .8rem; }
@media (min-width: 720px){ .nfg-prog-cards{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nfg-prog-card{
  --accent: var(--gold-a);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  gap: .55rem .8rem;
  padding: 1.1rem 1.15rem 1.05rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%),
    var(--card-dark);
  color: var(--card-dark-fg);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.nfg-prog-card::before{ content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.nfg-prog-card:hover{ color: var(--card-dark-fg); }
.nfg-prog-card > :not(.nfg-prog-card-main):not(.nfg-prog-card-weeks){ grid-column: 1 / -1; }
.nfg-prog-card-main{ display: grid; gap: .35rem; min-width: 0; }
.nfg-prog-card-kicker{ display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 55%, #fff); }
.nfg-prog-card-kicker .nfg-icon{ width: .9em; height: .9em; }
.nfg-prog-card-title{ font-size: 1.4rem; font-weight: 850; letter-spacing: -.015em; line-height: 1.15; }
.nfg-prog-card-copy{ font-size: .88rem; color: rgba(255,255,255,.78); line-height: 1.45; }
.nfg-prog-card-status{ display: inline-flex; align-items: center; gap: .45rem; font-size: .92rem; font-weight: 800; }
.nfg-prog-card-weeks{ display: grid; justify-items: center; align-self: start; line-height: 1; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.nfg-prog-card-weeks b{ font-size: 2.6rem; font-weight: 900; letter-spacing: -.04em; color: var(--accent); }
.nfg-prog-card-bar{ display: block; height: 6px; border-radius: 999px; background: rgba(255,255,255,.14); overflow: hidden; }
.nfg-prog-card-bar span{ display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.nfg-prog-card-cta{ display: inline-flex; align-items: center; gap: .35rem; margin-top: .1rem; font-weight: 800; color: var(--gold-a); }
.nfg-prog-card-cta .nfg-icon{ width: 1em; height: 1em; }

/* Program cards in Home's rail: accent + "Week 3 · Pull" once started */
.nfg-program-card{ position: relative; overflow: hidden; }
.nfg-program-card[style*="--accent"]{
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 58%),
    var(--card-dark);
}
.nfg-program-card[style*="--accent"]::before{ content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); }
.nfg-program-status{ display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 800; }
.nfg-program-bar{ display: block; height: 5px; border-radius: 999px; background: rgba(255,255,255,.14); overflow: hidden; }
.nfg-program-bar span{ display: block; height: 100%; border-radius: inherit; background: var(--accent, var(--gold-a)); }


/* =====================================================================
   Recipes + Macros (revamp phase 5)
   ===================================================================== */
.is-protein{ --m: var(--macro-protein); }
.is-carbs{ --m: var(--macro-carbs); }
.is-fat{ --m: var(--macro-fat); }
.is-kcal{ --m: var(--solid-bg); }
.nfg-recipes, .nfg-recipe, .nfg-macros{ max-width: 760px; }

/* Macro strip and coloured dots: the dot carries identity, text stays ink. */
.nfg-mstrip{ display: flex; flex-wrap: wrap; gap: .2rem .8rem; font-size: .82rem; color: var(--app-text-muted); }
.nfg-mstrip b{ color: var(--app-text); font-weight: 800; }
.nfg-mstrip span{ display: inline-flex; align-items: center; gap: .3rem; }
.nfg-mstrip i, .nfg-rcard-macros i, .nfg-log-macros i, .nfg-recipe-stats i,
.nfg-ring-label i, .nfg-quickadd .nfg-field i, .nfg-numbers-table i{
  display: inline-block; flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--m);
}

/* Today card on Recipes, and the invite */
.nfg-macro-card{
  display: grid;
  gap: .6rem;
  padding: .9rem 1rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-sm);
  color: var(--app-text);
  text-decoration: none;
}
.nfg-macro-card:hover{ color: var(--app-text); border-color: var(--app-border-strong); }
.nfg-macro-card-head{ display: flex; justify-content: space-between; align-items: baseline; }
.nfg-macro-card-kicker{ font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--app-text-soft); }
.nfg-macro-card-go{ display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 800; }
.nfg-macro-card-go .nfg-icon{ width: 1em; height: 1em; }
.nfg-macro-card-rings{ display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.nfg-macro-card-small{ display: flex; gap: .35rem; }
.nfg-macro-invite{
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(214,184,90,.28), transparent 60%),
    var(--card-dark);
  color: var(--card-dark-fg);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}
.nfg-macro-invite:hover{ color: var(--card-dark-fg); }
.nfg-macro-invite-icon{ display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--gold-a); color: var(--on-gold); }
.nfg-macro-invite-icon .nfg-icon{ width: 1.3rem; height: 1.3rem; }
.nfg-macro-invite-text{ display: grid; gap: .15rem; min-width: 0; }
.nfg-macro-invite-text b{ font-size: 1.05rem; font-weight: 850; }
.nfg-macro-invite-text span{ font-size: .84rem; color: rgba(255,255,255,.75); line-height: 1.4; }
.nfg-macro-invite-go{ color: var(--gold-a); }

/* Rings */
.nfg-ring{ position: relative; display: grid; justify-items: center; gap: .1rem; }
.nfg-ring svg{ display: block; }
.nfg-ring-track{ fill: none; stroke: var(--app-surface-inset); stroke-width: 7; }
.nfg-ring-fill{ fill: none; stroke: var(--m); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .35s ease; }
.nfg-ring.is-big .nfg-ring-track, .nfg-ring.is-big .nfg-ring-fill{ stroke-width: 10; }
.nfg-ring-fill[stroke-dasharray^="0.0 "], .nfg-ring-fill[stroke-dasharray^="0.00 "], .nfg-ring-fill[stroke-dasharray^="0 "]{ opacity: 0; }
.nfg-ring-center{ position: absolute; top: 0; left: 0; right: 0; display: grid; place-content: center; justify-items: center; line-height: 1.05; pointer-events: none; }
.nfg-ring:not(.is-big) .nfg-ring-center{ height: 76px; display: flex; align-items: baseline; justify-content: center; padding-top: 30px; }
.nfg-ring.is-big .nfg-ring-center{ height: 108px; }
.nfg-ring-center b{ font-size: .95rem; font-weight: 850; color: var(--app-text); }
.nfg-ring-center small{ font-size: .66rem; font-weight: 700; color: var(--app-text-soft); }
.nfg-ring.is-big .nfg-ring-center b{ font-size: 1.45rem; letter-spacing: -.02em; }
.nfg-ring.is-big .nfg-ring-center small{ font-size: .74rem; }
.nfg-ring-label{ display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; color: var(--app-text-muted); white-space: nowrap; }
.nfg-ring-label span{ color: var(--app-text-soft); font-weight: 600; }
.nfg-ring.is-big .nfg-ring-label{ font-size: .8rem; font-weight: 800; color: var(--app-text); }
.nfg-ring.is-over .nfg-ring-fill{ stroke-dasharray: none; }
.nfg-ring.is-kcal.is-over .nfg-ring-label{ color: var(--danger-text, #b3261e); }

/* Recipe filters */
.nfg-rfilters{ display: grid; gap: .35rem; }
.nfg-rchip{
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 .85rem;
  border-radius: 999px;
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.nfg-rchip:hover{ color: var(--app-text); border-color: var(--app-border-strong); }
.nfg-rchip.is-meal:not(:first-child)::before{ content: ""; width: .5rem; height: .5rem; margin-right: .4rem; border-radius: 50%; background: var(--meal); }
.nfg-rchip.is-on{ background: var(--solid-bg); border-color: var(--solid-bg); color: var(--solid-fg); }
@media (min-width: 720px){ .nfg-rfilters .nfg-rail{ flex-wrap: wrap; overflow: visible; } }
.nfg-rcount{ margin: 0; font-size: .82rem; color: var(--app-text-muted); }
.nfg-rcount a{ color: var(--app-text); font-weight: 700; }

/* Recipe cards: colour tile by meal with the protein up front */
.nfg-rgrid{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 720px){ .nfg-rgrid{ grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nfg-rcard{ display: grid; align-content: start; gap: .45rem; min-width: 0; color: var(--app-text); text-decoration: none; }
.nfg-rcard:hover{ color: var(--app-text); }
.nfg-rcard-tile{
  position: relative;
  display: grid;
  align-content: space-between;
  aspect-ratio: 4 / 3;
  padding: .7rem .75rem;
  border-radius: var(--radius-md);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255,255,255,.14), transparent 55%),
    linear-gradient(160deg, var(--meal), color-mix(in srgb, var(--meal) 70%, #000));
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.nfg-rcard-meal{ font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.nfg-rcard-protein{ display: flex; align-items: baseline; gap: .25rem; line-height: 1; }
.nfg-rcard-protein b{ font-size: 2.1rem; font-weight: 900; letter-spacing: -.04em; }
.nfg-rcard-protein small{ font-size: .74rem; font-weight: 750; opacity: .92; }
.nfg-rcard-kcal{ position: absolute; right: .55rem; top: .55rem; font-size: .72rem; font-weight: 800; padding: .12rem .5rem; border-radius: 999px; background: rgba(0,0,0,.22); }
.nfg-rcard-body{ display: grid; gap: .15rem; min-width: 0; }
.nfg-rcard-name{ font-weight: 800; line-height: 1.25; }
.nfg-rcard-meta{ font-size: .76rem; color: var(--app-text-muted); }
.nfg-rcard-macros{ display: flex; flex-wrap: wrap; gap: .1rem .6rem; font-size: .74rem; color: var(--app-text-muted); }
.nfg-rcard-macros span{ display: inline-flex; align-items: center; gap: .3rem; }

/* Recipe page */
.nfg-recipe-hero{
  display: grid;
  gap: .45rem;
  padding: 1.1rem 1.15rem 1.15rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255,255,255,.14), transparent 55%),
    linear-gradient(160deg, var(--meal), color-mix(in srgb, var(--meal) 70%, #000));
  color: #fff;
  box-shadow: var(--shadow-md);
}
.nfg-recipe-kicker{ font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.nfg-recipe-title{ margin: 0; font-size: 1.75rem; font-weight: 850; letter-spacing: -.02em; line-height: 1.12; }
.nfg-recipe-summary{ margin: 0; font-size: .92rem; line-height: 1.45; opacity: .92; }
.nfg-recipe-tags{ display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
.nfg-recipe-tags span{ padding: .15rem .55rem; border-radius: 999px; background: rgba(0,0,0,.18); font-size: .74rem; font-weight: 750; }
.nfg-recipe-macros{
  display: grid;
  gap: .65rem;
  padding: .9rem 1rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-sm);
}
.nfg-recipe-macros-head{ display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .8rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--app-text-soft); }
.nfg-recipe-goals{ letter-spacing: 0; text-transform: none; font-weight: 700; color: var(--app-text-muted); font-size: .8rem; }
.nfg-recipe-stats{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.nfg-recipe-stats > div{ display: grid; gap: .1rem; padding: .55rem .5rem; border-radius: 12px; background: var(--app-surface-inset); text-align: center; }
.nfg-recipe-stats b{ font-size: 1.3rem; font-weight: 850; letter-spacing: -.02em; }
.nfg-recipe-stats b small{ font-size: .75rem; font-weight: 750; margin-left: 1px; }
.nfg-recipe-stats span{ display: inline-flex; align-items: center; justify-content: center; gap: .3rem; font-size: .72rem; font-weight: 700; color: var(--app-text-muted); }
.nfg-recipe-share{ margin: 0; font-size: .84rem; color: var(--app-text-muted); }
.nfg-recipe-add{ display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.nfg-recipe-add select{
  height: 44px;
  padding: 0 2rem 0 .9rem;
  border-radius: 999px;
  border: 1.5px solid var(--app-border-strong);
  background: var(--app-surface-strong);
  color: var(--app-text);
  font-weight: 700;
}
.nfg-recipe-add .nfg-act{ flex: 1 1 auto; justify-content: center; }
.nfg-recipe-ing-head{ display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.nfg-stepper{ display: inline-flex; align-items: center; gap: .25rem; padding: 3px; border-radius: 999px; background: var(--app-surface-inset); border: 1px solid var(--app-border); }
.nfg-stepper-btn{ display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--app-surface-strong); color: var(--app-text); text-decoration: none; box-shadow: var(--shadow-sm); }
.nfg-stepper-btn:hover{ color: var(--app-text); }
.nfg-stepper-btn.is-off{ opacity: .35; pointer-events: none; box-shadow: none; }
.nfg-stepper-btn .nfg-icon{ width: .95rem; height: .95rem; }
.nfg-stepper-value{ min-width: 6.2rem; text-align: center; font-size: .86rem; font-weight: 700; }
.nfg-ing-list{ display: grid; margin: .5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--app-border); }
.nfg-ing-list li{ display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--app-border); font-size: .94rem; }
.nfg-ing-qty{ font-weight: 800; white-space: nowrap; }
.nfg-ing-item small{ color: var(--app-text-soft); font-size: .8rem; }
.nfg-ing-list li:not(:has(.nfg-ing-qty)) .nfg-ing-item{ grid-column: 2; color: var(--app-text-muted); }
.nfg-step-list{ display: grid; gap: .75rem; margin: .6rem 0 0; padding: 0; list-style: none; counter-reset: step; }
.nfg-step-list li{ position: relative; padding-left: 2.4rem; line-height: 1.5; counter-increment: step; }
.nfg-step-list li::before{
  content: counter(step);
  position: absolute; left: 0; top: -.05rem;
  display: grid; place-items: center;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--meal); color: #fff; font-size: .82rem; font-weight: 850;
}
.nfg-recipe-tip{ display: flex; gap: .5rem; align-items: flex-start; margin: .9rem 0 0; padding: .7rem .85rem; border-radius: 12px; background: var(--app-surface-inset); font-size: .88rem; color: var(--app-text); }
.nfg-recipe-tip .nfg-icon{ flex: none; width: 1.05rem; height: 1.05rem; margin-top: .1rem; color: var(--gold-b); }
.nfg-recipe-note{ margin: 0; font-size: .76rem; color: var(--app-text-soft); }

/* Macros page */
.nfg-macros-head{ display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.nfg-macros-head .nfg-page-title{ margin: 0; }
.nfg-goal-seg{ display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--app-surface-inset); border: 1px solid var(--app-border); }
.nfg-goal-seg form{ display: contents; }
.nfg-goal-seg .nfg-seg-opt{ border: 0; background: transparent; height: 34px; padding: 0 .9rem; font-size: .84rem; }
.nfg-goal-seg .nfg-seg-opt.is-on{ background: var(--switch-bg); color: var(--switch-fg); }
.nfg-macro-today{
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: .6rem;
  flex-wrap: wrap;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-sm);
}
.nfg-macro-today-small{ display: flex; gap: .5rem; }
.nfg-macro-add-head, .nfg-progress-head{ display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.nfg-quickadd{
  display: grid;
  gap: .55rem;
  margin-top: .55rem;
  padding: .85rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
}
.nfg-quickadd-nums{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.nfg-quickadd-btn{ justify-content: center; }
.nfg-field{ display: grid; gap: .25rem; min-width: 0; }
.nfg-field > span:first-child{ display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 800; color: var(--app-text-muted); }
.nfg-field input, .nfg-field select{
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 .75rem;
  border-radius: 12px;
  border: 1.5px solid var(--app-border-strong);
  background: var(--app-surface-strong);
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 650;
}
.nfg-field input:focus{ outline: none; border-color: var(--app-text); box-shadow: 0 0 0 3px var(--app-accent-soft); }
.nfg-field input::placeholder{ color: var(--app-text-soft); font-weight: 500; }
.nfg-field-unit{ position: relative; display: block; }
.nfg-field-unit input{ padding-right: 2.6rem; }
.nfg-field-unit i, .nfg-field-pair i{ position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); font-style: normal; font-size: .82rem; font-weight: 700; color: var(--app-text-soft); pointer-events: none; }
.nfg-field-pair{ display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.nfg-field-pair label{ position: relative; }
.nfg-field-pair input{ padding-right: 2.2rem; }
.nfg-field-error{ font-size: .76rem; font-weight: 700; color: var(--danger-text, #b3261e); }
.has-error input, .has-error .nfg-choose{ border-color: var(--danger-text, #b3261e); }
.nfg-recent{ display: grid; gap: .3rem; margin-top: .55rem; }
.nfg-recent-label{ font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--app-text-soft); }
.nfg-recent form{ flex: none; }
.nfg-recent-chip{
  display: inline-flex; align-items: center; gap: .35rem;
  height: 36px; padding: 0 .8rem;
  border-radius: 999px;
  border: 1px solid var(--app-border-strong);
  background: var(--app-surface-strong);
  color: var(--app-text);
  font-size: .84rem; font-weight: 700; white-space: nowrap;
}
.nfg-recent-chip small{ color: var(--app-text-soft); font-weight: 700; }
.nfg-recent-chip .nfg-icon{ width: .85rem; height: .85rem; }
.nfg-log{ display: grid; margin: .5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--app-border); }
.nfg-log-row{ display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--app-border); }
.nfg-log-main{ display: grid; gap: .1rem; min-width: 0; font-weight: 750; }
.nfg-log-main a{ color: var(--app-text); }
.nfg-log-main small{ color: var(--app-text-soft); font-weight: 700; }
.nfg-log-macros{ display: flex; gap: .6rem; font-size: .76rem; font-weight: 700; color: var(--app-text-muted); }
.nfg-log-macros span{ display: inline-flex; align-items: center; gap: .25rem; }
.nfg-log-kcal{ font-weight: 850; white-space: nowrap; }
.nfg-log-kcal small{ margin-left: .15rem; font-size: .7rem; color: var(--app-text-soft); }
.nfg-log-del{ display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--app-text-soft); }
.nfg-log-del:hover{ background: var(--app-surface-inset); color: var(--app-text); }
.nfg-log-del .nfg-icon{ width: .8rem; height: .8rem; }

/* Progress */
.nfg-progress-card{
  display: grid;
  gap: .6rem;
  padding: .95rem 1rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-sm);
}
.nfg-progress-sub{ justify-self: start; }
.nfg-progress-stat{ margin: 0; font-size: .86rem; color: var(--app-text-muted); }
.nfg-progress-stat b{ color: var(--app-text); font-weight: 850; }
.nfg-progress-big{ display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--app-text-muted); }
.nfg-progress-big b{ font-size: 1.6rem; font-weight: 850; letter-spacing: -.02em; color: var(--app-text); }
.nfg-progress-big .nfg-icon{ width: 1rem; height: 1rem; align-self: center; }
.nfg-progress-big small{ flex-basis: 100%; font-size: .84rem; font-weight: 750; color: var(--app-text); }
.nfg-chart{ display: block; width: 100%; max-width: 620px; height: auto; overflow: visible; font-family: inherit; }
.nfg-chart-grid{ stroke: var(--app-border); stroke-width: 1; shape-rendering: crispEdges; }
.nfg-chart-tick, .nfg-chart-x{ fill: var(--app-text-soft); font-size: 9.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.nfg-chart-bar{ fill: var(--chart); }
.nfg-chart-col.is-today .nfg-chart-bar{ fill: var(--solid-bg); }
.nfg-chart-hit{ fill: transparent; }
.nfg-chart-col:hover .nfg-chart-hit{ fill: var(--app-surface-inset); }
.nfg-chart-hitmark{ fill: var(--on-gold); font-size: 9px; font-weight: 900; pointer-events: none; }
.nfg-chart-col.is-today .nfg-chart-hitmark{ fill: var(--solid-fg); }
.nfg-chart-target{ stroke: var(--app-text-muted); stroke-width: 1.25; stroke-dasharray: 4 3; }
.nfg-chart-target-label{ fill: var(--app-text-muted); font-size: 9.5px; font-weight: 700; paint-order: stroke; stroke: var(--app-surface-strong); stroke-width: 3px; }
.nfg-chart-line{ fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.nfg-chart-area{ fill: var(--chart-wash); }
.nfg-chart-dot{ fill: var(--chart); stroke: var(--app-surface-strong); stroke-width: 2; }
.nfg-chart-hitdot{ fill: transparent; }
.nfg-chart-pt:hover .nfg-chart-hitdot{ fill: var(--chart-wash); }
.nfg-chart-end{ fill: var(--app-text); font-size: 10.5px; font-weight: 800; }
.nfg-chart-line.is-logged{ stroke: var(--app-text-muted); stroke-dasharray: 5 4; }
.nfg-chart-dot.is-logged{ fill: var(--app-text-muted); }
.nfg-chart-legend{ display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .76rem; font-weight: 700; color: var(--app-text-muted); }
.nfg-chart-legend span{ display: inline-flex; align-items: center; gap: .4rem; }
.nfg-chart-legend i{ display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--chart); }
.nfg-chart-legend i.is-logged{ border-top: 2px dashed var(--app-text-muted); }
.nfg-chart-title{ margin: .3rem 0 0; font-size: .86rem; font-weight: 800; }
.nfg-chart-title small{ font-weight: 600; color: var(--app-text-soft); }
.nfg-chart.is-small{ max-width: 620px; }
.nfg-chart-table summary{ font-size: .8rem; font-weight: 700; color: var(--app-text-muted); cursor: pointer; }
.nfg-chart-table table{ width: 100%; margin-top: .4rem; font-size: .82rem; border-collapse: collapse; }
.nfg-chart-table th, .nfg-chart-table td{ padding: .3rem .2rem; border-bottom: 1px solid var(--app-border); text-align: left; }
.nfg-chart-table td:nth-child(2){ font-variant-numeric: tabular-nums; }
.nfg-weighin{ display: flex; align-items: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: .2rem; }
.nfg-weighin .nfg-field{ flex: 1 1 10rem; }
.nfg-numbers-table{ width: 100%; margin-top: .5rem; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.nfg-numbers-table th, .nfg-numbers-table td{ padding: .5rem .45rem; border-bottom: 1px solid var(--app-border); text-align: right; font-variant-numeric: tabular-nums; }
.nfg-numbers-table thead th{ font-size: .72rem; font-weight: 800; color: var(--app-text-soft); }
.nfg-numbers-table thead th i{ margin-right: .3rem; vertical-align: 1px; }
.nfg-numbers-table tbody th{ text-align: left; font-weight: 800; }
.nfg-numbers-table tr.is-on th, .nfg-numbers-table tr.is-on td{ background: var(--app-surface-inset); font-weight: 850; }
.nfg-numbers-table tr.is-on th{ border-radius: 10px 0 0 10px; }
.nfg-numbers-table tr.is-on td:last-child{ border-radius: 0 10px 10px 0; }

/* Calculator */
.nfg-calc{
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-sm);
}
.nfg-calc fieldset{ margin: 0; padding: 0; border: 0; min-width: 0; }
.nfg-calc legend{ margin-bottom: .35rem; font-size: .76rem; font-weight: 800; color: var(--app-text-muted); float: none; width: auto; padding: 0; }
.nfg-calc-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .6rem; }
.nfg-choose{ display: grid; gap: .4rem; }
.nfg-choose.is-seg{ grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; border-radius: 14px; background: var(--app-surface-inset); border: 1px solid var(--app-border); }
.nfg-choose-opt{ position: relative; display: block; cursor: pointer; }
.nfg-choose-opt input{ position: absolute; opacity: 0; inset: 0; margin: 0; }
.nfg-choose-opt > span{ display: grid; gap: .1rem; height: 100%; padding: .6rem .7rem; border-radius: 11px; border: 1.5px solid transparent; }
.nfg-choose.is-seg .nfg-choose-opt > span{ justify-items: center; text-align: center; padding: .55rem .4rem; }
.nfg-choose-opt b{ font-size: .9rem; font-weight: 800; }
.nfg-choose-opt small{ font-size: .74rem; color: var(--app-text-muted); font-weight: 600; }
.nfg-choose.is-list .nfg-choose-opt > span{ border-color: var(--app-border); background: var(--app-surface-strong); grid-template-columns: auto 1fr; column-gap: .6rem; align-items: center; }
.nfg-choose.is-list .nfg-choose-opt > span::before{ content: ""; grid-row: span 2; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--app-border-strong); }
.nfg-choose.is-list .nfg-choose-opt b, .nfg-choose.is-list .nfg-choose-opt small{ grid-column: 2; }
.nfg-choose-opt input:checked + span{ background: var(--switch-bg); color: var(--switch-fg); }
.nfg-choose-opt input:checked + span small{ color: inherit; opacity: .78; }
.nfg-choose.is-list .nfg-choose-opt input:checked + span{ border-color: var(--switch-bg); }
.nfg-choose.is-list .nfg-choose-opt input:checked + span::before{ border-color: var(--gold-a); background: var(--gold-a); box-shadow: inset 0 0 0 3px var(--switch-bg); }
.nfg-choose-opt input:focus-visible + span{ outline: 3px solid var(--app-accent); outline-offset: 1px; }
.nfg-calc:has(#units-imperial:checked) .is-metric,
.nfg-calc:has(#units-metric:checked) .is-imperial{ display: none; }
.nfg-calc-more{ padding: .7rem .8rem; border-radius: 12px; background: var(--app-surface-inset); }
.nfg-calc-more summary{ font-weight: 800; cursor: pointer; }
.nfg-calc-more summary small{ font-weight: 600; color: var(--app-text-soft); }
.nfg-calc-more .nfg-prog-note{ margin: .5rem 0 .6rem; }
.nfg-calc-submit{ width: 100%; }
.nfg-form-alert{ padding: .65rem .85rem; border-radius: 12px; background: rgba(179,38,30,.1); color: var(--danger-text, #b3261e); font-weight: 700; font-size: .88rem; }
@media (max-width: 380px){
  .nfg-quickadd-nums{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nfg-macro-today-small{ gap: .2rem; }
}

/* =====================================================================
   Account page (revamp phase 6)
   ===================================================================== */
.nfg-account{ max-width: 760px; }
.nfg-acct-card{
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .4rem .9rem;
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 110% at 100% 0%, rgba(214,184,90,.24), transparent 60%),
    var(--card-dark);
  color: var(--card-dark-fg);
  box-shadow: var(--shadow-md);
}
.nfg-acct-avatar{
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-a), var(--gold-b));
  color: var(--on-gold); font-size: 1.5rem; font-weight: 900;
}
.nfg-acct-id{ display: grid; gap: .1rem; min-width: 0; }
.nfg-acct-name{ margin: 0; font-size: 1.35rem; font-weight: 850; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; }
.nfg-acct-meta{ font-size: .82rem; color: rgba(255,255,255,.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nfg-acct-stats{ grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.nfg-acct-stats span{ padding: .25rem .65rem; border-radius: 999px; background: rgba(255,255,255,.1); font-size: .8rem; color: rgba(255,255,255,.85); }
.nfg-acct-stats b{ color: #fff; font-weight: 850; }
.nfg-acct-plans{ display: grid; gap: .55rem; margin-top: .55rem; }
@media (min-width: 720px){ .nfg-acct-plans{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nfg-acct-plan{
  --accent: var(--gold-a);
  position: relative;
  display: grid;
  gap: .35rem;
  padding: .9rem 1rem;
  border-radius: var(--radius-md);
  background:
    radial-gradient(120% 110% at 100% 0%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 60%),
    var(--card-dark);
  color: var(--card-dark-fg);
  text-decoration: none;
  overflow: hidden;
}
.nfg-acct-plan::before{ content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); }
.nfg-acct-plan:hover{ color: var(--card-dark-fg); }
.nfg-acct-plan-title{ font-weight: 850; }
.nfg-acct-plan-status{ display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 750; }
.nfg-acct-plan-go{ display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 800; color: var(--gold-a); }
.nfg-acct-plan-go .nfg-icon{ width: 1em; height: 1em; }
.nfg-acct-empty{
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  margin-top: .55rem; padding: .9rem 1rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px dashed var(--app-border-strong);
  color: var(--app-text-muted); text-decoration: none; font-size: .9rem;
}
.nfg-acct-empty b{ color: var(--app-text); }
.nfg-acct-empty .nfg-icon{ width: 1em; height: 1em; color: var(--app-text); }
.nfg-acct-recent{ display: grid; gap: .35rem; margin: .7rem 0 0; padding: 0; list-style: none; font-size: .86rem; color: var(--app-text-muted); }
.nfg-acct-recent li{ display: flex; align-items: center; gap: .45rem; }
.nfg-acct-recent b{ color: var(--app-text); }
.nfg-acct-recent small{ margin-left: auto; color: var(--app-text-soft); font-weight: 700; }
.nfg-acct-macros{
  display: grid; gap: .45rem;
  margin-top: .55rem; padding: .9rem 1rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
  color: var(--app-text); text-decoration: none;
}
.nfg-acct-macros:hover{ color: var(--app-text); border-color: var(--app-border-strong); }
.nfg-acct-macros-goal{ font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--app-text-soft); }
.nfg-acct-macros-today{ display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .86rem; color: var(--app-text-muted); }
.nfg-acct-macros-today span{ display: inline-flex; align-items: center; gap: .3rem; }
.nfg-acct-macros-today b{ color: var(--app-text); font-weight: 850; }
.nfg-acct-macros-today i{ display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--m); }
.nfg-acct-prefs{ display: grid; gap: .8rem; margin-top: .55rem; padding: .95rem 1rem; border-radius: var(--radius-md); background: var(--app-surface-strong); border: 1px solid var(--app-border); }
.nfg-acct-pref{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; }
.nfg-acct-pref-label{ display: grid; font-weight: 800; font-size: .92rem; }
.nfg-acct-pref-label small{ font-size: .76rem; font-weight: 600; color: var(--app-text-soft); }
.nfg-seg-form{ display: contents; }
.nfg-seg-form .nfg-seg-opt{ border: 0; background: transparent; }
.nfg-seg-form .nfg-seg-opt.is-on{ background: var(--switch-bg); color: var(--switch-fg); }
.nfg-acct-password{ padding: .85rem 1rem; border-radius: var(--radius-md); background: var(--app-surface-strong); border: 1px solid var(--app-border); }
.nfg-acct-password summary{ font-weight: 800; cursor: pointer; }
.nfg-acct-password-form{ display: grid; gap: .6rem; margin-top: .7rem; }
.nfg-acct-password-form .nfg-act{ justify-self: start; }
.nfg-acct-actions{ display: flex; flex-wrap: wrap; gap: .5rem; }

/* Admin: Coach's Picks */
.nfg-admin-picks{ max-width: 760px; }
.nfg-picks-add{ display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
.nfg-picks-add .nfg-field{ flex: 1 1 14rem; }
.nfg-picks-list{ display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.nfg-picks-row{
  display: grid;
  grid-template-columns: 1.6rem 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .45rem .55rem;
  border-radius: var(--radius-md);
  background: var(--app-surface-strong);
  border: 1px solid var(--app-border);
}
.nfg-picks-row.has-problem{ border-color: var(--warn-text, #a07a12); }
.nfg-picks-n{ font-weight: 850; color: var(--app-text-soft); text-align: center; }
.nfg-picks-thumb{ width: 48px; height: 60px; border-radius: 8px; overflow: hidden; background: var(--media-bg); }
.nfg-picks-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.nfg-picks-body{ display: grid; gap: .1rem; min-width: 0; }
.nfg-picks-body small{ font-size: .76rem; color: var(--app-text-muted); }
.nfg-picks-body small.is-warning{ color: var(--warn-text, #a07a12); font-weight: 700; }
.nfg-picks-tools{ display: flex; gap: .2rem; }
.nfg-picks-btn{ display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--app-border); border-radius: 50%; background: var(--app-surface-strong); color: var(--app-text); }
.nfg-picks-btn .nfg-icon{ width: .85rem; height: .85rem; }
.nfg-picks-btn.is-up .nfg-icon, .nfg-picks-btn.is-down .nfg-icon{ transform: rotate(90deg); }
.nfg-picks-btn:disabled{ opacity: .35; }
.nfg-picks-btn.is-remove:hover{ color: var(--danger-text, #b3261e); border-color: currentColor; }
.nfg-errpage{ max-width: 560px; }
.nfg-errpage-search input{ height: 48px; }
