@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* Lets the browser morph shared elements (e.g. the search bar) between
   full page navigations. Ignored by browsers that don't support it yet,
   which simply navigate normally. */
@view-transition {
  navigation: auto;
}

:root {
  --accent: #ff4b5c;
  --accent-dark: #e23553;
  --accent-light: #ffe7ea;
  --danger: #c0392b;
  --danger-dark: #9e2f22;
  --danger-light: #fbeae8;
  --basil: #5a9e4b;
  --basil-light: #e9f4e2;
  --saffron: #f2a93b;
  --saffron-light: #fdf1da;
  --ink: #38352f;
  --ink-soft: #7a7268;
  --paper: #fbf8f3;
  --surface: #ffffff;
  --border: #ece5da;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-card: 0 8px 24px rgba(31, 27, 22, 0.08);
  --shadow-pop: 0 14px 32px rgba(255, 75, 92, 0.22);
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --nav-height: 4.5rem;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

html.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

/* Every page's inline module script imports app.js, which pulls in
   nav.js -> auth.js -> the Firebase SDK (fetched from gstatic.com) before
   any of its own code runs — including the data-i18n text substitution.
   Without this, the raw untranslated HTML (empty labels, blank buttons)
   is visible for that entire fetch. initPage() removes this class once
   translations are applied and the nav is mounted. */
body.pre-render {
  visibility: hidden;
}

body {
  margin: 0;
  min-height: calc(100vh + 3rem);
  min-height: calc(100dvh + 3rem);
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  padding-top: calc(3.25rem + env(safe-area-inset-top));
  padding-bottom: calc(var(--nav-height) + 0.75rem + env(safe-area-inset-bottom));
}

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  font-weight: 800;
}

p {
  margin: 0;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

svg {
  display: block;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-pop);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(255, 75, 92, 0.3);
}

.selection-cta {
  width: 100%;
  margin-top: 1.5rem;
}

/* ---------- Header / Nav ---------- */

.app-header {
  display: contents;
}

.brand {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(3.25rem + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: env(safe-area-inset-top) 1.25rem 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  z-index: 20;
}

.brand-icon {
  border-radius: 7px;
  display: block;
}

.brand-word {
  display: inline-flex;
  align-items: center;
}

.top-right-cluster {
  position: fixed;
  top: calc(0.5rem + env(safe-area-inset-top));
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 21;
}

.credits-badge {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--surface);
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  box-shadow: var(--shadow-card);
  white-space: nowrap;
  cursor: pointer;
}

.trial-badge {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-light);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  box-shadow: var(--shadow-card);
  white-space: nowrap;
}

.profile-link {
  height: 34px;
  padding: 0 0.75rem 0 0.55rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-soft);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  white-space: nowrap;
}

.profile-link-label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
}

.profile-link[aria-current='page'] {
  color: var(--accent);
}

.profile-cluster {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-signout-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-signout-btn:hover {
  color: var(--accent);
}

.coach-badge {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, #f03f58, #ff7643);
  background-size: 160% 160%;
  background-position: 0% 50%;
  color: #fff;
  box-shadow: var(--shadow-pop);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: background-position 0.4s ease, transform 0.2s ease;
}

.coach-badge svg {
  flex-shrink: 0;
}

.coach-badge:hover {
  background-position: 100% 50%;
  transform: translateY(-1px);
}

@media (max-width: 420px) {
  .coach-badge {
    width: 30px;
    height: 30px;
    padding: 0;
    justify-content: center;
  }

  .coach-badge span {
    display: none;
  }
}

.admin-nav-badge {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, #2c2a28, #55504a);
  color: #fff;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: transform 0.2s ease;
}

.admin-nav-badge svg {
  flex-shrink: 0;
}

.admin-nav-badge:hover {
  transform: translateY(-1px);
}

@media (max-width: 420px) {
  .admin-nav-badge {
    width: 30px;
    height: 30px;
    padding: 0;
    justify-content: center;
  }

  .admin-nav-badge span {
    display: none;
  }
}

@media (max-width: 480px) {
  .top-right-cluster {
    right: 0.6rem;
    gap: 0.35rem;
  }

  .credits-badge {
    font-size: 0.65rem;
    padding: 0.35rem 0.55rem;
  }

  .profile-link {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .profile-link-label {
    display: none;
  }
}

.nav-login-link {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

.nav-login-link:hover {
  color: var(--ink);
}

.nav-cta-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  box-shadow: none;
}

.nav-links {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0.7rem 0.5rem calc(0.7rem + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 20;
}

.nav-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  transition: color 0.2s ease;
}

.nav-links a[aria-current='page'] {
  color: var(--accent);
}

@media (min-width: 768px) {
  body {
    min-height: 0;
    padding-top: calc(var(--nav-height) + 1.5rem);
    padding-bottom: 0;
  }

  .app-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    align-items: center;
    height: var(--nav-height);
    padding: 0 2.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 20;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    position: static;
    height: auto;
    background: none;
    font-size: 1.3rem;
  }

  .top-right-cluster {
    grid-column: 3;
    grid-row: 1;
    position: static;
    justify-self: end;
    margin-left: 0;
  }

  .profile-link,
  .credits-badge,
  .nav-signout-btn {
    box-shadow: none;
    background: var(--paper);
  }

  .nav-login-link {
    font-size: 0.88rem;
  }

  .nav-cta-btn {
    padding: 0.65rem 1.4rem;
    font-size: 0.88rem;
  }

  .nav-links {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    position: static;
    background: none;
    border-top: none;
    width: auto;
    gap: 0.5rem;
    padding: 0;
    margin-left: 0;
  }

  .nav-links a {
    flex-direction: row;
    font-size: 0.92rem;
    padding: 0.5rem 0.9rem;
    border-bottom: 2px solid transparent;
  }

  .nav-links a[aria-current='page'] {
    border-bottom-color: var(--accent);
  }

  main {
    max-width: 1080px;
  }
}

/* ---------- Hero (Accueil) ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin: 1rem 0 2rem;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 27, 22, 0) 30%, rgba(20, 16, 12, 0.85) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 1.75rem;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.72rem;
  opacity: 0.9;
}

.hero h1 {
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0.5rem 0 0.75rem;
  max-width: 26ch;
  white-space: pre-line;
}

.hero p {
  max-width: 34ch;
  opacity: 0.95;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  font-size: 0.95rem;
}

@media (min-width: 768px) {
  .hero {
    min-height: 420px;
    margin: 1.5rem 0 3rem;
  }

  .hero-content {
    padding: 3rem;
  }

  .hero h1 {
    font-size: 2.4rem;
    max-width: 30ch;
  }
}

/* ---------- Value props (Accueil) ---------- */

.value-props {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.value-prop {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  color: inherit;
  text-decoration: none;
}

.value-prop[href]:hover h3 {
  text-decoration: underline;
}

.value-prop:not([href]) {
  cursor: default;
}

.value-num {
  color: var(--accent-dark);
}

.value-prop:not(:first-child)::before {
  content: '';
  position: absolute;
  top: -1.5rem;
  left: 21px;
  width: 2px;
  height: 1.5rem;
  background: var(--border);
}

.value-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.value-prop h3 {
  font-size: 0.98rem;
  margin-bottom: 0.15rem;
}

.value-prop p {
  color: var(--ink-soft);
  font-size: 0.87rem;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .value-props {
    flex-direction: row;
    gap: 0;
  }

  .value-prop {
    flex: 1;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 0 0.75rem;
  }

  .value-prop:not(:first-child)::before {
    top: 21px;
    left: -50%;
    width: 100%;
    height: 2px;
  }
}

/* ---------- Section headers ---------- */

.section-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.page-header {
  padding: 1.75rem 0 1.25rem;
}

.page-header h1 {
  font-size: 1.7rem;
}

.page-header p {
  color: var(--ink-soft);
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

.page-header-with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-header-pill-btn {
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  white-space: nowrap;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .page-header-with-action {
    flex-wrap: wrap;
  }

  .page-header-actions {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-end;
  }
}

.share-cta-btn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}

.share-cta-btn.active {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: transparent;
}

.page-header-actions .ing-equiv-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.1rem;
  gap: 0.5rem;
}

.page-header-actions .ing-equiv-btn.active {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.clear-selection-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.2rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.clear-selection-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ---------- Horizontal carousel (Accueil) ---------- */

.carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  scroll-snap-type: x proximity;
}

.section-more {
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.btn-see-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-see-more:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel-card {
  flex: 0 0 auto;
  width: 168px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}

.carousel-photo {
  width: 168px;
  height: 120px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-card);
  background: var(--border);
}

.carousel-card h3 {
  font-size: 0.88rem;
  margin-top: 0.6rem;
  font-family: var(--font-body);
  font-weight: 700;
}

/* ---------- Search + tabs (Recettes) ---------- */

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.8rem 1.15rem;
  margin-bottom: 1.25rem;
  color: var(--ink-soft);
  /* Same name on the homepage and Recettes versions of this element lets
     the browser morph one into the other during the page navigation
     (see the @view-transition rule above). */
  view-transition-name: recipe-search;
}

.search-bar input {
  border: none;
  outline: none;
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: transparent;
  color: var(--ink);
}

.hero-search-bar {
  margin-bottom: 0;
  box-shadow: var(--shadow-card);
}

.recipes-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.main-tab-row {
  display: flex;
  gap: 0.35rem;
  background: var(--border);
  border-radius: 999px;
  padding: 0.3rem;
  width: 100%;
  max-width: 420px;
}

.main-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: none;
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.main-tab svg {
  flex-shrink: 0;
}

.main-tab.active {
  background: var(--ink);
  color: #fff;
}

.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 0.75rem;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.5rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tab svg {
  flex-shrink: 0;
}

.tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.toolbar-actions .clear-selection-btn {
  margin: 0;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-control label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 600;
  white-space: nowrap;
}

.sort-control select {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.9rem 0.5rem 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%237a7268' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 16px;
}

.sort-control select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.filters-trigger-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.filters-trigger-btn:hover {
  border-color: var(--ink-soft);
}

.filters-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---------- Filters modal (recettes) ---------- */

.filters-modal-card {
  max-width: 560px;
}

.filters-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.filter-section-title {
  font-size: 0.95rem;
  margin: 0 0 0.7rem;
  font-family: var(--font-body);
}

.filter-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 1.05rem 0.4rem 0.4rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--ink-soft);
}

.filter-chip-pictogram {
  display: flex;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
}

.filter-chip-pictogram svg {
  display: block;
  width: 100%;
  height: 100%;
}

.filter-chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.filters-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: -1.5rem;
  background: var(--surface);
  margin: 0 -1.5rem -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-bottom: 1.5rem;
}

.filters-clear-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Recipe grid ---------- */

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.recipe-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  opacity: 0;
  transform: translateY(16px);
  animation: cardIn 0.5s ease forwards;
}

.recipe-card--instant {
  opacity: 1;
  transform: none;
  animation: none;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(31, 27, 22, 0.14);
}

.recipe-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.recipe-photo {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: var(--border);
  flex-shrink: 0;
}

.recipe-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.9rem 1.05rem 1.1rem;
}

.recipe-body h3 {
  font-size: 1rem;
  line-height: 1.3;
  font-family: var(--font-body);
  font-weight: 700;
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.4rem;
  color: var(--border);
}

.stars .star {
  color: var(--border);
}

.stars .star[fill='currentColor'] {
  color: var(--accent);
}

.rating-value {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: 0.3rem;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 0.4rem;
  column-gap: 0.9rem;
  margin-top: auto;
  padding-top: 0.65rem;
  color: var(--ink-soft);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.meta-item svg {
  flex-shrink: 0;
}

.selection-fab {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.selection-fab:hover {
  transform: translateX(-50%) scale(1.05);
}

.fab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark, var(--accent));
  font-size: 0.72rem;
  font-weight: 800;
}

/* Small neutral counter next to the nav star icon (sélection) — shows how
   many recipes are still waiting to be cooked. Sits clear of the icon
   artwork (not overlaid on it) so the digit stays legible at any count,
   and uses a muted grey rather than the accent/alert color since it's an
   inventory count, not a notification. */
.nav-icon-wrap {
  position: relative;
  display: inline-flex;
}

.nav-badge {
  position: absolute;
  bottom: -3px;
  right: -6px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 13px;
  text-align: center;
}

@media (min-width: 768px) {
  .selection-fab {
    bottom: 1.75rem;
  }
}

.add-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-card);
  border: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.add-btn:disabled {
  cursor: default;
}

.add-btn.added {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  transform: none;
}

.add-btn.added::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
}

.favorite-btn {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-card);
  border: none;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}

.favorite-btn.favorited {
  color: var(--accent);
  transform: scale(1.08);
}

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

/* ---------- Vol vers la sélection (ajout façon panier) ---------- */

.fly-to-selection {
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--surface, #fff);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-card);
  z-index: 999;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 1;
  transition: transform 0.6s cubic-bezier(0.35, 0, 0.25, 1), opacity 0.6s ease 0.15s;
  will-change: transform, opacity;
}

@keyframes navPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.nav-links a.nav-pulse svg {
  animation: navPulse 0.4s ease;
}

.selection-fab.nav-pulse {
  animation: navPulse 0.4s ease;
}

/* ---------- Sélection ---------- */

.selection-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(12px);
  animation: cardIn 0.4s ease forwards;
}

.selection-item--instant {
  opacity: 1;
  transform: none;
  animation: none;
}

.cook-picker-item {
  cursor: pointer;
}

.selection-photo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}

.selection-info {
  flex: 1;
}

.selection-info h3 {
  font-size: 0.98rem;
  font-family: var(--font-body);
  font-weight: 700;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.5rem;
}

.stepper button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.stepper span {
  font-weight: 700;
  min-width: 1.2rem;
  text-align: center;
  font-size: 0.92rem;
}

.stepper span.stepper-label {
  font-weight: 400;
  min-width: 0;
  text-align: left;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-transform: lowercase;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.3rem;
}

.cooked-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.cooked-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.cooked-redo-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
}

.cook-cooked-row {
  justify-content: center;
  margin: -0.5rem 0 1.25rem;
}

.cook-picker-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}

.cook-launch-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}

/* ---------- Cook assistant ---------- */

.cook-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1.5rem;
}

.cook-header h1 {
  font-size: 1.2rem;
  flex: 1;
  min-width: 0;
}

.cook-back {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}

.cook-servings {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.cook-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.cook-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  transition: transform 0.2s ease, background 0.2s ease;
}

.cook-dot.done {
  background: var(--accent);
}

.cook-dot.current {
  background: var(--accent);
  transform: scale(1.4);
}

.cook-dot--clickable {
  cursor: pointer;
}

.cook-dot--timer {
  background: var(--accent-light);
  box-shadow: 0 0 0 2px var(--accent);
}

.cook-dot--alert {
  background: #ff4b5c;
  animation: cook-dot-alert 1s ease infinite;
}

@keyframes cook-dot-alert {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 75, 92, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(255, 75, 92, 0); }
}

.cook-step-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2.25rem 1.5rem;
  text-align: center;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.cook-step-done {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.cook-step-done-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cook-step-done p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: line-through;
  flex: 1;
}

.cook-step-done--active {
  cursor: pointer;
  opacity: 1;
}

.cook-step-done--active p {
  text-decoration: none;
  color: var(--ink);
}

.cook-step-done-icon--progress {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.cook-step-done-timer {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent-dark);
  flex-shrink: 0;
}

.cook-step-done-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.cook-step-done-timer-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.cook-step-done-timer-btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
}

.cook-step-done--alert {
  border: 1px solid #ff4b5c;
  animation: cook-timer-pulse 1s ease infinite;
}

.cook-step-done--alert .cook-step-done-timer {
  color: #ff4b5c;
}

.cook-step-done--alert .cook-step-done-icon--progress {
  background: rgba(255, 75, 92, 0.15);
  color: #ff4b5c;
}

.cook-step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cook-step-text {
  font-size: 1.15rem;
  line-height: 1.55;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  max-width: 32ch;
}

.cook-timer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  transition: box-shadow 0.2s ease;
}

.cook-timer-icon {
  color: var(--accent-dark);
}

.cook-timer-display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  min-width: 3rem;
}

.cook-timer-actions {
  display: flex;
  gap: 0.4rem;
}

.cook-timer-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cook-timer-btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
}

.cook-timer--done {
  animation: cook-timer-pulse 1s ease infinite;
}

@keyframes cook-timer-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 75, 92, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 75, 92, 0); }
}

.cook-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.cook-ingredient-chip {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}

.cook-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.cook-ingredients-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.cook-modal-servings {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.cook-start-btn {
  width: 100%;
  margin-top: 0.5rem;
}

.cook-prev-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cook-prev-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.cook-check-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-pop);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.cook-check-btn:hover {
  transform: scale(1.05);
}

.cook-finish {
  text-align: center;
  padding: 3rem 1.5rem;
}

.cook-finish-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.cook-finish h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.cook-finish p {
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
}

/* ---------- Liste de courses ---------- */

.custom-item-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.7rem;
  margin-bottom: 1.25rem;
}

.custom-item-form input,
.custom-item-form select {
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  min-width: 0;
}

/* Row 1, always visible: item name + submit — the only thing you need to
   add something quickly. Quantity/unit/aisle are opt-in below. */
.custom-item-main {
  display: flex;
  gap: 0.5rem;
}

.custom-item-name {
  flex: 1 1 auto;
  width: 100%;
}

.custom-item-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  padding: 0.15rem 0.1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.custom-item-toggle svg {
  transition: transform 0.15s ease;
}

.custom-item-toggle.open svg {
  transform: rotate(180deg);
}

.custom-item-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.custom-item-details[hidden] {
  display: none;
}

.custom-item-qty {
  width: 4rem;
  flex: 0 0 auto;
}

.custom-item-unit {
  width: 5.5rem;
  flex: 0 0 auto;
}

.custom-item-cat {
  flex: 1 1 auto;
}

.custom-item-add-btn {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.shopping-item-remove {
  flex-shrink: 0;
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--paper);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.shopping-progress {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.shopping-group {
  margin-bottom: 1.75rem;
}

.shopping-group h2 {
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
}

.shopping-group h2 .cat-icon {
  color: var(--accent-dark);
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.check-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.shopping-item.checked .check-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.shopping-item.checked .item-label {
  text-decoration: line-through;
  color: var(--ink-soft);
  opacity: 0.65;
}

.item-label {
  font-size: 0.95rem;
}

/* Click-to-edit: the qty/unit/name each carry a dashed underline as a
   standing hint that they're tappable — no separate "edit mode" affordance
   like a pencil icon, the field itself is the button. */
.item-field {
  display: inline-block;
  cursor: text;
  border-radius: 4px;
  padding: 0 0.15rem;
  border-bottom: 1px dashed var(--border);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.item-field:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.item-field-unit {
  min-width: 0.9em;
}

.item-field-input {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--accent);
  padding: 0;
  outline: none;
}

.item-field-input[type='number'] {
  width: 3.5rem;
}

/* Small colored initial badge showing who checked/added an item on a
   shared shopping list — same idea as iOS Notes' shared-edit markers. */
.shopping-item-badge {
  flex-shrink: 0;
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  cursor: default;
}

.shopping-item-remove + .shopping-item-badge {
  margin-left: 0.4rem;
}

.shopping-guest-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent-light);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.shopping-guest-banner .guest-banner-cta {
  font-weight: 700;
  color: var(--accent-dark);
  text-decoration: underline;
  white-space: nowrap;
}

.shopping-guest-banner .guest-name-input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.shopping-guest-banner .guest-name-save {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.shopping-guest-banner .guest-banner-dismiss {
  flex-shrink: 0;
  margin-left: auto;
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.share-link-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.share-link-input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.share-stop-btn {
  display: block;
  margin: 1.25rem auto 0;
  border: none;
  background: none;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ---------- Empty states ---------- */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

/* ---------- Recipe detail ---------- */

.detail-photo-wrap {
  position: relative;
  margin: 1rem -1.25rem 1.25rem;
}

.detail-photo {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.detail-back {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  text-decoration: none;
}

.detail-top-actions {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.detail-edit,
.detail-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 38px;
  padding: 0 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.detail-share-btn.shared {
  background: rgba(255, 75, 92, 0.92);
  color: #fff;
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.translate-row {
  position: relative;
  flex-shrink: 0;
}

.translate-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.translate-icon-btn.active {
  color: var(--accent-dark);
  background: var(--accent-light);
}

.translate-icon-btn:disabled {
  opacity: 0.6;
}

.translate-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 170px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.translate-menu-item {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.translate-menu-item:hover {
  background: var(--paper);
}

.translate-menu-item.active {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 700;
}

.translate-error {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--accent-dark);
}

.detail-title {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.detail-description {
  color: var(--ink-soft);
  margin-top: 0.75rem;
  line-height: 1.5;
}

.detail-meta {
  margin-top: 1rem;
  padding-top: 0;
}

.portions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin: 1.5rem 0 2rem;
}

.portions-label {
  font-weight: 700;
  font-family: var(--font-body);
}

.ingredient-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.ingredient-list li {
  display: flex;
  gap: 0.9rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.ing-qty {
  flex-shrink: 0;
  width: 6rem;
  font-weight: 700;
  color: var(--accent-dark);
  font-size: 0.9rem;
}

.ing-name {
  font-size: 0.95rem;
}

.ing-cal {
  display: block;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.ing-equiv {
  display: block;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--accent-dark);
}

.ingredients-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
}

.ingredients-header .section-title {
  margin: 0;
  line-height: 1;
}

.ing-equiv-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}

.ing-equiv-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.ing-equiv-btn.active {
  background: var(--accent-dark);
  color: #fff;
}

.ing-equiv-error {
  color: var(--accent-dark);
  font-size: 0.82rem;
  margin: 0.3rem 0 0.8rem;
}

.step-list {
  list-style: none;
  counter-reset: step;
  margin: 0 0 2rem;
  padding: 0;
}

.step-list li {
  counter-increment: step;
  display: flex;
  gap: 0.9rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.step-list li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-selection-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .detail-photo-wrap {
    margin: 1.5rem 0 1.5rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  .detail-photo {
    height: 360px;
  }
}

/* ---------- Auth gate + profile ---------- */

.auth-loading {
  padding: 0.25rem 0 1rem;
}

.auth-loading--centered {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
}

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

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

@media (prefers-reduced-motion: reduce) {
  .spinner,
  .spinner-sm {
    animation: none;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

.auth-gate {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  margin: 1rem 0;
}

.auth-gate h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.auth-gate p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.btn-google:hover {
  border-color: var(--ink-soft);
}

.btn-google:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form label:not(.filter-chip) {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.auth-form input,
.auth-form textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}

.auth-form select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%237a7268' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 16px;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.auth-form .btn-pill {
  margin-top: 0.25rem;
}

.password-field {
  position: relative;
  display: flex;
}

.password-field input {
  width: 100%;
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
}

.password-toggle:hover {
  color: var(--ink);
}

.auth-form input.auth-input-error {
  border-color: var(--accent-dark);
  outline: 2px solid var(--accent-dark);
  outline-offset: 1px;
  animation: auth-input-shake 0.3s ease;
}

@keyframes auth-input-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.auth-message {
  font-size: 0.85rem;
  color: var(--accent-dark);
  margin: 0;
}

.auth-message-error {
  color: var(--accent-dark);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 1.1rem;
}

.auth-link {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* Signup funnel: "1 Formule · 2 Compte · 3 Paiement" indicator */
.funnel-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.funnel-steps li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.funnel-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  flex: none;
}

.funnel-step-current {
  color: var(--ink);
}

.funnel-step-current .funnel-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.funnel-step-done .funnel-dot {
  background: var(--accent-light);
  border-color: transparent;
  color: var(--accent-dark);
}

/* Non-blocking "confirm your email" banner shown at the top of app pages */
.verify-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  margin: 0 0 1rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.verify-banner-resend {
  background: none;
  border: none;
  color: var(--accent-dark);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  white-space: nowrap;
}

.verify-banner-resend:disabled {
  cursor: default;
  text-decoration: none;
  opacity: 0.8;
}

/* Post-payment welcome questions (subscribe-success page) */
.auth-gate p.welcome-progress {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
  margin-bottom: 0.4rem;
}

.welcome-choices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.welcome-choice {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.welcome-choice:hover {
  border-color: var(--accent);
}

.welcome-choice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.profile-signed-in-as {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 1rem;
}

.profile-email {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0.3rem 0 1.5rem;
}

.profile-id {
  color: var(--ink-soft);
  font-size: 1rem;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

.profile-complete-desc {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: -0.5rem 0 1.25rem;
  line-height: 1.5;
}

.profile-fullname {
  font-size: 1.5rem;
  margin: 0.2rem 0 1.5rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.profile-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.profile-stat--wide {
  grid-column: 1 / -1;
}

.profile-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  font-weight: 700;
}

.profile-stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
}

.profile-energy {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.profile-energy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-energy-card--accent {
  background: var(--accent-light);
  border-color: transparent;
}

.profile-energy-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--ink);
  line-height: 1.2;
}

.profile-energy-card--accent .profile-energy-value {
  color: var(--accent-dark);
}

.profile-energy-unit {
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.profile-energy-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.profile-weight-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
}

.profile-weight-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.profile-weight-row .profile-stat-value {
  flex-shrink: 0;
  white-space: nowrap;
}

.profile-inactive-banner {
  background: var(--accent-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-inactive-banner .section-title,
.profile-inactive-banner .profile-complete-desc {
  margin-top: 0;
}

.profile-inactive-banner .btn-pill {
  display: inline-block;
  text-decoration: none;
}

.danger-zone {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.danger-zone-title {
  font-size: 1.1rem;
  color: var(--danger);
  margin-bottom: 0.4rem;
}

.danger-zone-desc {
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}

.btn-danger-outline:hover {
  background: var(--danger-light);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-danger:disabled,
.btn-danger-outline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.delete-account-desc {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.delete-account-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.delete-account-actions .btn-pill {
  flex: 1;
}

.weight-sparkline-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 50px;
}

.weight-sparkline-wrap {
  width: 100%;
  max-width: 150px;
  line-height: 0;
}

/* On a card wide enough to spare the room, center the chart on the whole
   card instead of just the space left of the value — matches the app's
   own breakpoint for switching to the wider desktop layout. Below this,
   there isn't enough width to do that without the chart creeping under
   the value text, so it stays anchored next to it. */
@media (min-width: 768px) {
  .profile-weight-row {
    position: relative;
  }

  .weight-sparkline-center {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .weight-sparkline-wrap {
    pointer-events: auto;
  }
}

.weight-sparkline {
  width: 100%;
  height: auto;
  aspect-ratio: 150 / 46;
  display: block;
  overflow: visible;
}

.weight-sparkline-label {
  font-size: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  fill: var(--ink-soft);
  opacity: 0.75;
}

.weight-chart-hint {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin: 0.1rem 0 0.2rem;
  line-height: 1.4;
}

.weight-update-btn {
  align-self: flex-start;
  background: var(--accent-light);
  color: var(--accent-dark);
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.weight-update-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.weight-update-form input {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
}

.weight-update-form .btn-pill {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 27, 22, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 200;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(31, 27, 22, 0.28);
  position: relative;
}

@media (min-width: 768px) {
  /* Credits history reads as a dropdown anchored under the badge on
     desktop rather than a full centered dialog — top/right are set inline
     in js/creditsModal.js from the badge's live position. */
  .modal-overlay.credits-popover-overlay {
    background: transparent;
  }

  .modal-card.credits-popover-card {
    position: fixed;
    margin: 0;
    max-width: 340px;
    max-height: min(70vh, 460px);
  }
}

.modal-close-btn {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--paper);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-title {
  font-size: 1.2rem;
  margin: 0 2rem 1.25rem 0;
}

.weight-detail-chart {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 0.5rem;
}

.weight-detail-value {
  font-size: 10px;
  font-family: var(--font-body);
  font-weight: 700;
  fill: var(--ink);
}

.weight-detail-date {
  font-size: 9px;
  font-family: var(--font-body);
  font-weight: 600;
  fill: var(--ink-soft);
}

.modal-card .weight-update-btn {
  margin-top: 0.75rem;
}

.weight-log-list {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  max-height: 220px;
  overflow-y: auto;
}

.weight-log-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.weight-log-row:last-child {
  border-bottom: none;
}

.weight-log-date {
  flex: 1;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.weight-log-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
}

.weight-log-delete {
  background: none;
  border: none;
  color: var(--ink-soft);
  padding: 0.3rem;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
}

.buy-credits-btn {
  width: 100%;
  margin-top: 1.25rem;
}

.credit-log-list {
  max-height: 260px;
  overflow-y: auto;
}

.credits-renewal-note {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
}

.credit-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.credit-log-row:last-child {
  border-bottom: none;
}

.credit-log-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.credit-log-reason {
  font-size: 0.88rem;
  font-weight: 700;
}

.credit-log-date {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.credit-log-delta {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.credit-log-delta-pos {
  color: #3f8f5f;
}

.credit-log-delta-neg {
  color: var(--ink-soft);
}

.credit-log-delta-failed {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-style: italic;
}

.credit-log-empty {
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-align: center;
  padding: 0.5rem 0;
}

.weight-log-delete:hover {
  color: var(--accent-dark);
}

/* ---------- Skeleton loading state ---------- */

.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.skeleton-photo {
  width: 100%;
  height: 150px;
}

.skeleton-body {
  padding: 0.95rem 1.05rem 1.1rem;
}

.skeleton-photo,
.skeleton-line,
.skeleton-row-photo,
.skeleton-circle,
.skeleton-block {
  background: linear-gradient(90deg, #e2d9c8 25%, #faf5e9 37%, #e2d9c8 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

.skeleton-block {
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}

.skeleton-tile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.1rem;
  margin-bottom: 0.85rem;
}

.skeleton-tile-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

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

.skeleton-line {
  height: 0.85rem;
  border-radius: 4px;
  margin-bottom: 0.65rem;
}

.skeleton-line.short {
  width: 55%;
}

.skeleton-line.tiny {
  height: 0.65rem;
  width: 70%;
  margin-bottom: 0;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.skeleton-row-photo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.skeleton-row-body {
  flex: 1;
}

.skeleton-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-shopping-group {
  margin-bottom: 1.75rem;
}

.skeleton-shopping-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .recipe-card, .selection-item {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .skeleton-photo,
  .skeleton-line,
  .skeleton-row-photo,
  .skeleton-circle,
  .skeleton-block {
    animation: none;
  }
}

/* ---------- My recipe badge ---------- */

.my-recipe-badge {
  display: inline-flex;
  align-items: center;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.coach-recipe-badge {
  display: inline-flex;
  align-items: center;
  background: var(--surface-alt, var(--border));
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

/* ---------- Community sharing & ratings ---------- */

.community-recipe-badge {
  display: inline-flex;
  align-items: center;
  background: #e8f4ee;
  color: #1e7a4f;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.shared-by-line {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}

.rating-count {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: 0.2rem;
}

.no-rating-yet {
  display: inline-block;
  color: var(--ink-soft);
  font-size: 0.78rem;
  margin-top: 0.4rem;
}

.detail-rating-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-bottom: 0.35rem;
}

.detail-rating-row .stars,
.detail-rating-row .no-rating-yet,
.detail-rating-row .shared-by-line {
  margin: 0;
}

.rate-block {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  background: var(--surface-alt, var(--border));
  border-radius: var(--radius-md, 14px);
  padding: 0.6rem 0.9rem;
  margin: 0.75rem 0 0.25rem;
}

.rate-label {
  font-size: 0.85rem;
  font-weight: 700;
}

.rate-stars {
  display: inline-flex;
  gap: 0.1rem;
}

.rate-star {
  background: none;
  border: none;
  padding: 0.15rem;
  cursor: pointer;
  /* Outline visible by default (not just on hover/active) so the 5
     clickable stars read clearly against the block's beige background —
     var(--border) used to blend into it, making the control look empty. */
  color: var(--accent);
  transition: transform 0.15s ease, color 0.15s ease;
}

.rate-star:hover {
  transform: scale(1.15);
  color: var(--accent);
}

.rate-star.active {
  color: var(--accent);
}

.rate-star:disabled {
  opacity: 0.6;
  cursor: default;
}

.rate-hint {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.admin-recipe-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-alt, var(--border));
}

/* ---------- Coach page ---------- */

.coach-restricted {
  color: var(--ink-soft);
  margin-top: 1rem;
}

.coach-recipe-saved-msg {
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem;
}

.coach-recipe-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
}

.coach-recipe-item summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  list-style: none;
}

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

.coach-recipe-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm, 8px);
  object-fit: cover;
  flex-shrink: 0;
}

.coach-recipe-title {
  font-weight: 700;
  flex: 1;
}

.coach-recipe-meta {
  color: var(--ink-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}

.coach-recipe-item .ingredient-list,
.coach-recipe-item .step-list {
  margin-top: 0.75rem;
}

.delete-recipe-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 1rem;
  color: var(--ink-soft);
}

.coach-client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ---------- Coach recipe-list selection & management ---------- */

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.coach-tools {
  display: flex;
  gap: 0.4rem;
}

.coach-tools-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.coach-tools-btn:hover {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.coach-tools-btn.active {
  background: var(--accent);
  color: #fff;
}

.coach-select-check {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  color: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.recipe-grid.coach-select-mode .coach-select-check {
  display: flex;
}

.coach-select-check.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Extra room at the bottom of the grid so the last rows can be scrolled
   clear of the fixed coach-selection-bar below — without this, cards in
   the last row stay permanently covered and their checkbox is unreachable. */
.recipe-grid.coach-select-mode {
  padding-bottom: 6rem;
}

.coach-selection-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 16;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(31, 27, 22, 0.35);
  padding: 0.6rem 0.6rem 0.6rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
}

.coach-selection-bar-actions {
  display: flex;
  gap: 0.4rem;
}

.coach-selection-bar-actions .btn-pill {
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.coach-selection-bar-actions .btn-pill:not(.btn-accent) {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.coach-selection-bar-actions .btn-pill:not(.btn-accent):hover {
  background: rgba(255, 255, 255, 0.22);
}

@media (min-width: 768px) {
  .coach-selection-bar {
    bottom: 1.75rem;
  }
}

.coach-list-manage {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.coach-list-row {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
}

.coach-list-row summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
}

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

.coach-apply-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.coach-list-name {
  font-weight: 700;
  flex: 1;
}

.coach-list-count {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.coach-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.coach-icon-btn--danger {
  color: var(--danger, #c0392b);
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 2rem 1.25rem 0;
}

.modal-title-row .modal-title {
  margin: 0;
}

.modal-title-row .coach-icon-btn {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
}

.coach-list-items {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.coach-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.coach-list-empty {
  color: var(--ink-soft);
}

/* ---------- Add recipe form ---------- */

.add-recipe-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 3rem 1rem;
  text-align: center;
}

.add-recipe-choice-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}

.add-recipe-choice-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  max-width: 380px;
}

.add-recipe-choice-sub {
  padding-top: 1rem;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.choice-card:hover,
.choice-card:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.choice-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}

.choice-card-accent .choice-card-icon {
  background: linear-gradient(135deg, #f03f58, #ff7643);
  border: none;
  color: #fff;
}

.choice-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.choice-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.choice-card-desc {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.choice-card .ai-cost-badge {
  background: linear-gradient(135deg, #f03f58, #ff7643);
  color: #fff;
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ai-cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.15rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.ai-cost-badge svg {
  flex-shrink: 0;
}

.btn-outline .ai-cost-badge {
  background: linear-gradient(135deg, #f03f58, #ff7643);
  color: #fff;
}

.btn-accent .ai-cost-badge {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.scan-back-link {
  display: inline-block;
  margin-bottom: 1rem;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.scan-back-link:hover {
  color: var(--accent);
}

.scan-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scan-panel .photo-dropzone {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 1.5rem 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.scan-pages {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.scan-pages-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.scan-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 0.6rem;
}

.scan-page-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
}

.scan-page-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--border);
}

.scan-page-thumb .photo-remove-btn {
  width: 1.6rem;
  height: 1.6rem;
  top: 0.35rem;
  right: 0.35rem;
}

.scan-pages-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ---------- PDF import (multi-recipe selection modal + result) ---------- */

.pdf-modal-title {
  font-family: var(--font-display, inherit);
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.pdf-modal-hint {
  margin: 0 0 0.9rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.pdf-recipe-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 42vh;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

.pdf-recipe-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.pdf-recipe-item:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.pdf-recipe-item input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.pdf-recipe-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.pdf-recipe-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.pdf-recipe-desc {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.pdf-toggle-all {
  border: none;
  background: none;
  padding: 0;
  margin-bottom: 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.pdf-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pdf-modal-actions .btn-pill[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.pdf-import-result {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: center;
  padding: 1rem 0;
  text-align: center;
}

.pdf-result-ok {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.pdf-result-ok svg {
  color: var(--accent);
  flex-shrink: 0;
}

.pdf-result-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.scan-paste-fallback {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.scan-paste-fallback p {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin: 0;
}

.scan-paste-target {
  min-height: 70px;
  padding: 0.8rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  resize: none;
}

.scan-paste-target:focus {
  outline: none;
  border-color: var(--accent);
}

.scan-link-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.scan-link-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.scan-link-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.scan-link-row .scan-link-paste-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.scan-link-input {
  flex: 1;
  min-width: 0;
  padding: 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
}

.scan-link-input:focus {
  outline: none;
  border-color: var(--accent);
}

.scan-link-form .btn-pill {
  align-self: center;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* ---------- Recipe form: shared step/section chrome (js/recipeForm.js) ---------- */

.rf-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 1rem;
}

.rf-section-idx {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* create-from-scratch wizard */

.rf-progress {
  margin-bottom: 1.25rem;
}

.rf-progress-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 0 0 0.5rem;
}

.rf-progress-track {
  display: flex;
  gap: 5px;
}

.rf-progress-seg {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.rf-progress-seg i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
}

.rf-progress-seg.active i {
  width: 100%;
}

.rf-wizard-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  z-index: 15;
  display: flex;
  gap: 0.6rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.rf-wizard-bar .rf-prev-btn {
  flex: 0 0 auto;
  padding: 0.75rem;
}

.rf-wizard-bar .rf-next-btn {
  flex: 1;
}

.rf-wizard {
  padding-bottom: 6rem;
}

@media (min-width: 768px) {
  .rf-wizard-bar {
    bottom: 0;
  }
}

/* edit / AI-review single page */

.rf-jumpnav {
  position: sticky;
  top: calc(3.25rem + env(safe-area-inset-top));
  z-index: 5;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.6rem 0 0.9rem;
  margin-bottom: 0.5rem;
  background: var(--paper);
}

@media (min-width: 768px) {
  .rf-jumpnav {
    top: var(--nav-height);
  }
}

.rf-jn {
  flex: 0 0 auto;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.42rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}

.rf-jn.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}

.rf-singlepage .rf-section {
  scroll-margin-top: 4.5rem;
}

.rf-singlepage .rf-section + .rf-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* category segmented control */

.rf-segmented {
  display: flex;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}

.rf-seg-opt {
  flex: 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.55rem 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: center;
  margin: 0;
}

label.rf-seg-opt.active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-pop);
}

/* time / servings stepper */

.rf-stepper-row {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.rf-stepper-card {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.9rem;
  text-align: center;
}

.rf-stepper-card label {
  font-size: 0.72rem !important;
  text-align: center;
  margin-bottom: 0.5rem;
}

.rf-stepper-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.rf-stepper-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--accent-dark);
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rf-stepper-input {
  width: 3.4rem;
  border: none !important;
  background: none !important;
  padding: 0 !important;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
}

.rf-stepper-input::-webkit-outer-spin-button,
.rf-stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* filters accordion */

.rf-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.rf-accordion-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
}

.rf-accordion-left small {
  display: block;
  font-weight: 500;
  color: var(--ink-faint, var(--ink-soft));
  font-size: 0.72rem;
  margin-top: 1px;
}

.rf-accordion-toggle svg {
  flex-shrink: 0;
  color: var(--ink-soft);
  transition: transform 0.2s ease;
}

.rf-accordion-toggle.open svg {
  transform: rotate(180deg);
}

.rf-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.rf-accordion-body.open {
  max-height: 1400px;
}

.rf-accordion-inner {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding-top: 1.1rem;
}

.photo-dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.photo-dropzone:hover,
.photo-dropzone:focus-visible {
  border-color: var(--accent);
}

.photo-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-tint, var(--surface));
}

.photo-dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--ink-soft);
}

.photo-dropzone-icon {
  color: var(--ink-soft);
}

.photo-dropzone-text {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.photo-url-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-soft);
}

.photo-url-row svg {
  flex-shrink: 0;
}

.photo-url-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink);
  min-width: 0;
}

.photo-url-input:focus {
  outline: none;
}

.photo-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.35rem;
}

.photo-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.photo-action-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.photo-action-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.spinner-sm {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.6;
  animation: spinner-spin 0.8s linear infinite;
}

.photo-dropzone-preview {
  position: relative;
}

.photo-remove-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
}

.recipe-photo-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--border);
}

/* Hero treatment for the manual recipe form's photo field specifically —
   scoped so it doesn't touch the scan/import dropzone in js/addRecipe.js,
   which reuses the same base .photo-dropzone class. */
.rf-photo-field .photo-dropzone {
  border: 2px dashed #e3b9bd;
  background: var(--accent-light);
  border-radius: var(--radius-lg);
}

.rf-photo-field .photo-dropzone-empty {
  padding: 2.1rem 1rem;
}

.rf-photo-field .photo-dropzone-icon,
.rf-photo-field .photo-dropzone-text {
  color: var(--accent-dark);
}

.rf-photo-field .photo-action-row {
  margin-top: 0.6rem;
}

.rf-ing-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.85rem;
  margin-bottom: 0.65rem;
}

.rf-ing-line1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.rf-ing-line1 .ing-name {
  flex: 1;
  min-width: 0;
}

.rf-ing-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--paper);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rf-ing-line2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rf-ing-line2 .rf-ing-qty {
  width: 5rem;
  flex: 0 0 auto;
}

.rf-ing-line2 .rf-ing-unit {
  width: 5.5rem;
  flex: 0 0 auto;
}

.rf-ing-detail-toggle {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  border: none;
  background: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.rf-ing-detail-toggle svg {
  transition: transform 0.2s ease;
}

.rf-ing-detail-toggle.open svg {
  transform: rotate(180deg);
}

.rf-ing-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.rf-ing-details.open {
  max-height: 160px;
  margin-top: 0.6rem;
}

.rf-ing-details-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: stretch;
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}

.rf-ing-sparkle {
  padding: 0 0.6rem !important;
}

.ing-suffix-field {
  position: relative;
  display: block;
  margin: 0;
}

.ing-suffix-field input {
  width: 100%;
  padding-right: 2.1rem;
  -moz-appearance: textfield;
  appearance: textfield;
}

.ing-suffix-field input::-webkit-outer-spin-button,
.ing-suffix-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ing-suffix-field .ing-suffix {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--ink-soft);
  pointer-events: none;
}

.ing-ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 0.65rem;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.ing-ai-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.ing-ai-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.ing-ai-cost {
  white-space: nowrap;
}

.ing-ai-error {
  margin: -0.25rem 0 0;
}

.rf-ing-row input,
.rf-ing-row select {
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  min-width: 0;
  width: 100%;
}

/* prep steps: numbered timeline */

.rf-step-row {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
  position: relative;
}

.rf-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.rf-step-row:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: -12px;
  width: 2px;
  background: var(--border);
}

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

.rf-step-row .step-text {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}

.rf-step-remove-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.3rem;
}

.rf-step-remove {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.2rem;
}

.rf-step-remove:hover {
  color: var(--accent-dark);
}

.add-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.calories-total-display {
  margin-top: -1rem;
  margin-bottom: 1.5rem;
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 700;
  min-height: 1.2em;
}

/* ---------- Features page ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.feature-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-card h3 {
  font-size: 1.02rem;
  margin-bottom: 0.35rem;
}

.feature-card p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.features-cta {
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

/* ---------- Pricing page ---------- */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.pricing-card {
  position: relative;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.pricing-card--premium {
  border: 1px dashed var(--border);
  opacity: 0.85;
}

.pricing-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.pricing-name {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.pricing-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.pricing-price .pricing-period {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-left: 0.25rem;
}

.pricing-price-original {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: line-through;
  margin-right: 0.4rem;
}

.pricing-discount-note {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 600;
  margin: -0.25rem 0 0.75rem;
}

.pricing-desc {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.pricing-features {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--ink);
}

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

.pricing-card .btn-pill {
  width: 100%;
}

.pricing-card .btn-pill:disabled {
  background: var(--border);
  color: var(--ink-soft);
  box-shadow: none;
  cursor: not-allowed;
}

@media (min-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Admin page ---------- */

.admin-main {
  max-width: 800px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.admin-header-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.admin-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2c2a28, #55504a);
  color: #fff;
}

.admin-header-title h1 {
  font-size: 1.4rem;
}

.admin-header-email {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.admin-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

@media (max-width: 560px) {
  .admin-tiles {
    grid-template-columns: 1fr;
  }
}

.admin-tile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.1rem;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
}

.admin-tile:hover {
  border-color: var(--accent);
}

.admin-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.admin-tile-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent-dark);
}

.admin-tile-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-tile-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
}

.admin-tile-desc {
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.4;
}

.admin-tile-badge {
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
}

.admin-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.admin-card-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}

.admin-card-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

.admin-card-desc {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0.35rem 0 1rem;
}

.admin-count-badge {
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.admin-form-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.admin-code-input {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  text-transform: uppercase;
  min-width: 0;
  flex: 1 1 140px;
}

.admin-code-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.admin-btn-sm {
  padding: 0.65rem 1.15rem;
  font-size: 0.85rem;
}

.admin-inline-msg {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 0.6rem;
  min-height: 1.1em;
}

.admin-search-bar {
  margin: 0.9rem 0 0.25rem;
}

.admin-list {
  margin-top: 0.5rem;
}

.admin-list--scroll {
  max-height: 20rem;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.admin-empty {
  color: var(--ink-soft);
  font-size: 0.88rem;
  padding: 1rem 0;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.admin-row:last-child {
  border-bottom: none;
}

.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.admin-row-info {
  flex: 1;
  min-width: 0;
}

.admin-row-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-row-line strong {
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.admin-row-meta {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.admin-row-msg {
  font-size: 0.78rem;
  color: var(--accent-dark);
  margin: 0.3rem 0 0;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.admin-pill--coach {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.admin-pill--stripe {
  background: #ece9fe;
  color: #635bff;
}

.admin-pill--active {
  background: #e3f5e9;
  color: #1f8a4c;
}

.admin-pill--past_due {
  background: #fdf1de;
  color: #b8720b;
}

.admin-pill--canceled {
  background: var(--paper);
  color: var(--ink-soft);
}

.admin-pill--inactive {
  background: transparent;
  color: var(--ink-soft);
  border: 1px dashed var(--ink-soft);
}

.admin-row--log {
  align-items: flex-start;
}

.admin-row-msg--log {
  color: var(--danger);
}

.admin-row-log-details {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border);
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.admin-row-log-detail {
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
}

.admin-row-log-detail strong {
  color: var(--ink);
}

.admin-row-log-stack pre {
  margin: 0.2rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.7rem;
}

.admin-logs-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.6rem 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.admin-log-resolve-btn {
  flex-shrink: 0;
  color: var(--ink-soft);
  border: 1px solid var(--border);
}

.admin-row--resolved {
  opacity: 0.5;
}

.admin-row--resolved .admin-log-resolve-btn {
  background: var(--success, #2e9e5b);
  border-color: transparent;
  color: #fff;
}

.admin-pill--discount {
  background: #fdf1de;
  color: #b8720b;
}

.admin-pill--trial {
  background: #e3f0fd;
  color: #1f6fb8;
}

.admin-pill--family {
  background: #f3e8fd;
  color: #7a3fc9;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.admin-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--paper);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-icon-btn:hover {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.admin-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-icon-btn--danger:hover {
  background: var(--danger-light);
  color: var(--danger);
}

@media (max-width: 480px) {
  .admin-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .admin-row {
    flex-wrap: wrap;
  }

  .admin-actions {
    width: 100%;
    padding-left: calc(38px + 0.85rem);
    margin-top: 0.5rem;
  }
}

.admin-icon-btn.active {
  background: var(--accent);
  color: #fff;
}

.admin-row-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--paper);
  color: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-list.admin-select-mode .admin-row-check {
  display: flex;
}

.admin-row-check.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.admin-row-check:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.admin-list.admin-select-mode .admin-actions {
  display: none;
}

.admin-list.admin-select-mode .admin-row {
  cursor: pointer;
}

.admin-selection-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 16;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(31, 27, 22, 0.35);
  padding: 0.6rem 0.6rem 0.6rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
}

.admin-selection-bar-actions {
  display: flex;
  gap: 0.4rem;
}

.admin-selection-bar-actions .btn-pill {
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-selection-bar-actions .btn-pill:not(.btn-danger) {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.admin-selection-bar-actions .btn-pill:not(.btn-danger):hover {
  background: rgba(255, 255, 255, 0.22);
}

@media (min-width: 768px) {
  .admin-selection-bar {
    bottom: 1.75rem;
  }
}

.admin-bulk-delete-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  max-height: 8rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.admin-bulk-delete-list li {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.admin-bulk-delete-list li:last-child {
  border-bottom: none;
}

.admin-temp-password-row {
  display: none;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.admin-temp-password-row input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
}

/* ---------- Pricing consent note ---------- */

.pricing-consent-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.4;
  text-align: center;
}

.pricing-consent-note a {
  color: var(--ink);
  text-decoration: underline;
}

/* ---------- Legal pages (mentions légales / CGV / confidentialité) ---------- */

.legal-content {
  color: var(--ink);
  line-height: 1.6;
  padding-bottom: 1rem;
}

.legal-content h2 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.legal-content p,
.legal-content li {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.legal-content ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.legal-content li {
  margin-bottom: 0.35rem;
}

.legal-content a {
  color: var(--accent-dark);
}

.legal-content .legal-updated {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: -0.5rem;
}

/* ---------- Site footer ---------- */

.site-footer {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
}

@media (max-width: 767px) {
  .site-footer {
    display: none;
  }
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.1rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-copyright {
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

/* ---------- Admin: EU cross-border revenue tracker ---------- */

.admin-eu-revenue-total {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-eu-revenue-total strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.admin-eu-revenue-note {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.admin-eu-revenue-bar {
  margin-top: 0.6rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--border);
  overflow: hidden;
}

.admin-eu-revenue-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.admin-eu-revenue-bar-fill.admin-eu-revenue-bar-fill--warn {
  background: var(--danger);
}

.admin-eu-revenue-rows {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-eu-revenue-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}

.admin-eu-revenue-row span:first-child {
  color: var(--ink-soft);
}

.admin-eu-revenue-row--fr {
  font-size: 0.95rem;
  font-weight: 700;
  padding-bottom: 0.75rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.admin-eu-revenue-row--fr span:first-child {
  color: var(--ink);
}

.admin-eu-revenue-warn {
  color: var(--danger-dark);
  font-size: 0.8rem;
  margin-top: 0.6rem;
}

/* ---------- Dashboard ---------- */

.dashboard-header-block {
  padding-top: 0.5rem;
  margin-bottom: 1.75rem;
}

.dashboard-greeting {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.dashboard-calorie-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1.4rem;
}

.dashboard-calorie-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.dashboard-calorie-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
}

.dashboard-calorie-caption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.dashboard-gauge {
  height: 0.6rem;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--border);
  overflow: hidden;
}

.dashboard-gauge-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.4s ease;
}

.dashboard-macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-top: 1.1rem;
}

.dashboard-macro-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dashboard-macro-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.dashboard-macro-item .dashboard-gauge {
  height: 0.4rem;
}

.dashboard-macro-value {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ---------- Dashboard: bouton magique ---------- */

.dashboard-magic-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2.25rem;
}

.dashboard-magic-btn {
  width: 100%;
  padding: 1.15rem 1.6rem;
  font-size: 1.05rem;
}

.dashboard-import-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--accent-dark);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem;
}

.dashboard-import-btn:hover {
  text-decoration: underline;
}

/* ---------- Dashboard: menu du jour ---------- */

.dashboard-menu-block {
  margin-bottom: 2.25rem;
}

.dashboard-menu-card {
  width: 200px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 0.9rem;
  position: relative;
}

.dashboard-menu-slot {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.6rem;
}

.dashboard-menu-photo {
  display: block;
  width: 100%;
  height: 100px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--border);
}

.dashboard-menu-card h3 {
  font-size: 0.88rem;
  margin: 0.55rem 0 0;
  padding-right: 2rem;
}

.dashboard-menu-cook-btn {
  position: absolute;
  bottom: 0.9rem;
  right: 0.9rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-menu-empty {
  padding: 2rem 1.25rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* ---------- Dashboard: raccourci liste de courses ---------- */

.dashboard-shopping-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--ink);
}

.dashboard-shopping-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--basil-light);
  color: var(--basil);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-shopping-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dashboard-shopping-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
}

.dashboard-shopping-count {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.dashboard-shopping-card > svg {
  flex-shrink: 0;
  color: var(--ink-soft);
}

/* ---------- Dashboard: séparation "Aujourd'hui" / "Mon profil" ---------- */

.dashboard-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0 2rem;
}

.dashboard-profile-block {
  margin-top: 0;
}

.dashboard-profile-title {
  margin-bottom: 1.5rem;
}

/* ---------- Dashboard: section profil (fusionnée depuis l'ancienne page /profile) ---------- */

.dashboard-section-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  margin: 0 0 1.1rem;
}

.dashboard-section-label svg {
  flex-shrink: 0;
  color: var(--accent);
}

.dashboard-subsection-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  margin: 1.5rem 0 0.85rem;
}

.dashboard-settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.4rem 1.4rem 1.6rem;
  margin-bottom: 1.25rem;
}

.dashboard-settings-card .profile-stats,
.dashboard-settings-card .profile-energy {
  margin-bottom: 0;
}

.dashboard-settings-card .danger-zone {
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.dashboard-card-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

/* ---------- Dashboard: paywall contextuel ---------- */

.dashboard-paywall-benefits {
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
  display: grid;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.dashboard-paywall-benefits li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.dashboard-paywall-benefits svg {
  flex-shrink: 0;
  margin-top: 0.2rem;
  color: var(--basil);
}
