/* ═══════════════════════════════════════════════════════
   HECTOR V2 — Ton Chef des Spéciaux
   Stylesheet complet · Dark theme, gold accents
   Font: Outfit · Mobile-first · PWA-ready
   ═══════════════════════════════════════════════════════ */

/* ─── Reset + Variables ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Background */
  --bg: #0B1215;
  --card: #101A1E;
  /* Gold */
  --gold: #D4A44A;
  --gold-dim: #8A7A4A;
  --gold-text: #A89060;
  --gold-bg: rgba(212,164,74,.05);
  --gold-border: rgba(212,164,74,.08);
  --gold-highlight: rgba(212,164,74,.12);
  /* Text */
  --text-primary: #E0E4E2;
  --text-heading: #E8E4DA;
  --text-secondary: #5A6A58;
  --text-tertiary: #3E4E42;
  --text-quaternary: #2E3E32;
  --text-detail: #98A896;
  --text-deal: #D8D0BA;
  --text-tagline: #6A7A68;
  /* Green (savings) */
  --green: #6A9F6A;
  --green-bg: rgba(106,159,106,.04);
  --green-border: rgba(106,159,106,.08);
  /* Theme colors */
  --theme-famille: #E8A849;
  --theme-vege: #6A9F6A;
  --theme-sante: #5A9DB8;
  --theme-batch: #B07A4A;
  --theme-etudiant: #9A6AB8;
  /* Chain colors */
  --chain-maxi: #F47920;
  --chain-superc: #D42B1E;
  --chain-metro: #003DA5;
  --chain-iga: #C41230;
  --chain-provigo: #00529B;
  /* Misc */
  --border-subtle: rgba(255,255,255,.02);
  --header-bg: rgba(11,18,21,.94);
  --font: 'Outfit', sans-serif;
  /* Safe areas iOS */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

::selection { background: #2A3020; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1E2820; border-radius: 10px; }
input::placeholder { color: var(--text-quaternary); }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* ─── Animations ─── */
@keyframes fin {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes gfloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes pulse {
  0%, 100% { opacity: .4; }
  50%      { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fi {
  animation: fin .5s cubic-bezier(.16,1,.3,1) forwards;
  opacity: 0;
}

/* ─── App Container ─── */
#app {
  width: 100vw; height: 100vh;
  height: 100dvh; /* dynamic viewport for mobile */
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}

/* ─── Texture Overlay ─── */
#texture-overlay {
  position: absolute; inset: 0;
  opacity: 0.012; pointer-events: none;
  background-image: radial-gradient(circle, var(--gold) 0.5px, transparent 0.5px);
  background-size: 56px 56px;
  z-index: 0;
}

/* ─── Buttons & Interactive ─── */
.btn {
  transition: all .2s ease;
  cursor: pointer;
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(212,164,74,.28) !important;
}
.btn:active:not(:disabled) { transform: scale(.97); }

.rcard {
  transition: all .2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rcard:hover {
  border-color: rgba(212,164,74,.18) !important;
  transform: translateY(-2px);
}
.rcard:active {
  transform: scale(.985);
}

.tpill {
  transition: all .15s ease;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tpill:hover { background: rgba(212,164,74,.08) !important; }
.tpill:active { transform: scale(.95); }

/* ─── ENTRY SCREEN ─── */
#screen-entry {
  position: absolute; inset: 0; z-index: 50;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
  padding-top: calc(24px + var(--sat));
}

.entry-hector {
  margin-bottom: 20px;
}
.entry-hector .hector-sprite {
  border-radius: 24px;
  border: 2px solid rgba(212,164,74,.1);
}

.entry-title {
  font-size: 28px; font-weight: 800;
  text-align: center; line-height: 1.2;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #F0EAD6, #D4A44A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.entry-subtitle {
  font-size: 14px; color: var(--text-secondary);
  text-align: center; max-width: 340px;
  line-height: 1.6; margin-bottom: 32px;
  font-weight: 400;
}

.entry-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px; color: #4A5A48;
  margin-bottom: 10px; display: block;
}

.entry-input-row {
  display: flex; gap: 10px;
  width: 100%; max-width: 380px;
}

.entry-input {
  flex: 1;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1.5px solid rgba(212,164,74,.1);
  background: var(--card);
  color: var(--text-primary);
  font-size: 22px; font-weight: 700;
  letter-spacing: 3px;
  font-family: var(--font);
  outline: none;
  text-transform: uppercase;
  transition: border-color .2s, box-shadow .2s;
  min-height: 56px;
}
.entry-input:focus {
  border-color: rgba(212,164,74,.3) !important;
  box-shadow: 0 0 0 3px rgba(212,164,74,.06);
}

.entry-btn {
  padding: 18px 28px;
  border-radius: 16px; border: none;
  font-size: 22px; font-weight: 700;
  flex-shrink: 0;
  min-width: 64px; min-height: 56px;
}
.entry-btn.active {
  background: linear-gradient(135deg, #D4A44A, #B8862A);
  color: var(--bg);
}
.entry-btn.inactive {
  background: #141E1A;
  color: #2A3828;
}

.entry-hint {
  font-size: 11px; color: var(--text-quaternary);
  margin-top: 10px; text-align: center;
  font-weight: 500;
}

.entry-features {
  display: flex; gap: 28px; margin-top: 40px;
}
.entry-feature {
  text-align: center;
}
.entry-feature-icon {
  font-size: 26px; margin-bottom: 6px;
}
.entry-feature-text {
  font-size: 11px; color: var(--text-tertiary);
  font-weight: 600;
}

/* ─── LOADING SCREEN ─── */
#screen-loading {
  position: absolute; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.loading-hector {
  animation: gfloat 2s ease-in-out infinite;
  margin-bottom: 20px;
}
.loading-hector .hector-sprite {
  border-radius: 24px;
}

.loading-text {
  font-size: 20px; font-weight: 600;
  color: var(--gold); margin-bottom: 8px;
}

.shimmer-bar {
  width: 220px; height: 3px;
  border-radius: 4px; overflow: hidden;
  background: #141E1A;
}
.shimmer-fill {
  width: 40%; height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.loading-subtext {
  font-size: 13px; color: var(--text-tertiary);
  margin-top: 12px;
}

/* ─── ERROR SCREEN ─── */
#screen-error {
  position: absolute; inset: 0; z-index: 90;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
}
.error-icon { font-size: 56px; margin-bottom: 16px; }
.error-text {
  font-size: 17px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 8px;
  text-align: center;
}
.error-detail {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 28px; text-align: center;
}
.error-btn {
  padding: 16px 36px; border-radius: 14px;
  border: none; font-family: var(--font);
  font-size: 16px; font-weight: 600;
  background: linear-gradient(135deg, #D4A44A, #B8862A);
  color: var(--bg);
  min-height: 52px;
}

/* ─── MAIN SCREEN ─── */
#screen-main {
  display: flex; flex-direction: column;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
}

/* Header */
#main-header {
  padding: 12px 18px;
  padding-top: calc(12px + var(--sat));
  display: flex; align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(212,164,74,.06);
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10; flex-shrink: 0;
}

.header-brand {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.header-name {
  font-size: 16px; font-weight: 800;
  letter-spacing: 3px; color: #F0EDE4;
}
.header-sub {
  font-size: 8px; color: #5A6858;
  font-weight: 700; letter-spacing: 2px;
  margin-top: -2px;
}
.header-zone {
  font-size: 12px; color: var(--text-tertiary);
  display: flex; align-items: center; gap: 5px;
  background: var(--card);
  padding: 8px 14px; border-radius: 10px;
  font-weight: 600;
  min-height: 36px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.header-zone-icon { font-size: 14px; }

/* Scroll content */
#main-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Hero */
#hero-banner { padding: 20px 18px 16px; }

.hero-row {
  display: flex; align-items: center; gap: 14px;
}

.hero-hector .hector-sprite {
  border-radius: 16px;
  border: 1.5px solid rgba(212,164,74,.08);
}

.hero-info { flex: 1; }

.hero-week-row {
  display: flex; align-items: center;
  gap: 8px; margin-bottom: 4px;
}
.hero-week-dot {
  width: 6px; height: 6px;
  border-radius: 50%; background: var(--green);
}
.hero-week-text {
  font-size: 11px; color: var(--green);
  font-weight: 600;
}

.hero-title {
  font-size: 22px; font-weight: 800;
  line-height: 1.2; margin-bottom: 4px;
  background: linear-gradient(135deg, #F0EAD6, #D4A44A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 13px; color: var(--text-secondary);
  font-weight: 400; line-height: 1.4;
}

/* Savings banner */
#savings-banner {
  margin: 0 18px 0;
  padding: 14px 18px; border-radius: 14px;
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  display: flex; align-items: center;
  justify-content: space-between;
  min-height: 52px;
}
.savings-label {
  font-size: 13px; color: var(--green);
  font-weight: 500;
}
.savings-amount {
  font-size: 24px; font-weight: 800;
  color: var(--green);
}

/* Chain pills (Mes épiceries) */
#chain-pills {
  padding: 16px 18px 0;
}
.chain-pills-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2px; color: var(--text-quaternary);
  margin-bottom: 10px;
}
.chain-pills-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.cpill {
  padding: 10px 14px; border-radius: 12px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 7px;
  transition: all .15s ease;
  border: 1px solid transparent;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.cpill.active {
  background: var(--card);
  color: var(--text-primary);
  border-color: rgba(255,255,255,.04);
}
.cpill.inactive {
  background: transparent;
  color: var(--text-quaternary);
  opacity: .45;
}
.cpill:hover { opacity: 1 !important; }
.cpill:active { transform: scale(.95); }
.cpill-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
  transition: opacity .15s ease;
}
.cpill.inactive .cpill-dot { opacity: .3; }
.cpill-check {
  font-size: 12px; margin-left: -2px;
}

/* Theme pills */
#theme-pills {
  display: flex; gap: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
#theme-pills::-webkit-scrollbar { display: none; }

.tpill {
  padding: 10px 16px; border-radius: 22px;
  white-space: nowrap; font-size: 13px;
  font-weight: 600; flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  background: var(--card);
  color: #4A5A48;
  border: 1px solid transparent;
  min-height: 44px;
}
.tpill.active-gold {
  background: rgba(212,164,74,.12);
  color: var(--gold);
  border: 1px solid rgba(212,164,74,.2);
}
.tpill-icon { font-size: 16px; }

/* Recipe cards */
#recipe-cards {
  padding: 0 14px 30px;
  padding-bottom: calc(30px + var(--sab));
  display: flex; flex-direction: column; gap: 12px;
}

.rcard {
  padding: 20px 18px; border-radius: 18px;
  background: var(--card);
  border: 1.5px solid var(--border-subtle);
}

.rcard-top {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 10px;
}

.rcard-theme-tag {
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 8px;
}

.rcard-savings-tag {
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 8px;
  background: rgba(106,159,106,.08);
  color: var(--green);
}

.rcard-name {
  font-size: 19px; font-weight: 700;
  color: var(--text-heading); line-height: 1.2;
  margin-bottom: 4px;
}

.rcard-tagline {
  font-size: 13px; color: var(--text-secondary);
  font-weight: 300; font-style: italic;
  margin-bottom: 14px;
}

.rcard-deals {
  display: flex; flex-wrap: wrap;
  gap: 6px; margin-bottom: 14px;
}

.rcard-deal-chip {
  font-size: 11px; padding: 5px 10px;
  border-radius: 8px; font-weight: 500;
  background: var(--gold-bg);
  color: var(--gold-text);
  border: 1px solid var(--gold-border);
  display: flex; align-items: center; gap: 5px;
}
.rcard-deal-dot {
  width: 7px; height: 7px;
  border-radius: 50%; flex-shrink: 0;
}

.rcard-footer {
  display: flex; gap: 14px; align-items: center;
  flex-wrap: wrap;
}
.rcard-stat {
  font-size: 12px; color: var(--text-tertiary);
  font-weight: 500;
}
.rcard-cta {
  margin-left: auto; font-size: 13px;
  color: var(--gold); font-weight: 600;
}

/* Store legend */
#store-legend { padding: 0 18px 24px; }
.legend-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2px; color: var(--text-quaternary);
  margin-bottom: 10px;
}
.legend-items {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.legend-item {
  font-size: 12px; padding: 8px 12px;
  border-radius: 10px; font-weight: 600;
  background: var(--card); color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
  min-height: 38px;
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

/* Footer */
#footer {
  padding: 0 18px 40px;
  padding-bottom: calc(40px + var(--sab));
  text-align: center;
}
.footer-text {
  font-size: 10px; color: #1E2820;
  font-weight: 500;
}

/* ─── DETAIL SCREEN ─── */
#screen-detail {
  position: absolute; inset: 0; z-index: 20;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.detail-back-bar {
  padding: 14px 18px;
  padding-top: calc(14px + var(--sat));
  position: sticky; top: 0; z-index: 5;
  background: rgba(11,18,21,.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
}
.detail-back-btn {
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 15px; font-weight: 500;
  display: flex; align-items: center;
  gap: 8px; cursor: pointer;
  padding: 8px 0; font-family: var(--font);
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.detail-scroll {
  flex: 1; overflow-y: auto;
  padding: 0 18px 40px;
  padding-bottom: calc(40px + var(--sab));
  -webkit-overflow-scrolling: touch;
}
.detail-content {
  max-width: 540px; margin: 0 auto;
}

/* Detail header */
.detail-header {
  text-align: center; margin-bottom: 24px;
}
.detail-theme-tag {
  font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: 10px;
  display: inline-flex; align-items: center;
  gap: 5px; margin-bottom: 14px;
}
.detail-toque { margin-bottom: 6px; }
.detail-chef-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2.5px; color: var(--gold-dim);
  margin-bottom: 10px;
}
.detail-title {
  font-size: 28px; font-weight: 800;
  line-height: 1.15; margin-bottom: 8px;
  background: linear-gradient(135deg, #F0EAD6, #D4A44A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.detail-tagline {
  font-size: 15px; color: var(--text-tagline);
  font-weight: 300; font-style: italic;
}

/* Detail stats */
.detail-stats {
  display: flex; justify-content: center;
  gap: 32px; margin-bottom: 28px;
  padding: 18px 0;
  border-top: 1px solid rgba(212,164,74,.08);
  border-bottom: 1px solid rgba(212,164,74,.08);
}
.detail-stat { text-align: center; }
.detail-stat-value {
  font-size: 20px; font-weight: 800;
  color: var(--gold);
}
.detail-stat-label {
  font-size: 10px; color: #4A5A48;
  font-weight: 600; letter-spacing: 1px;
  margin-top: 2px;
}

/* Where to buy */
.detail-section { margin-bottom: 28px; }
.detail-section-title {
  font-size: 12px; font-weight: 700;
  letter-spacing: 2px; color: var(--gold-dim);
  margin-bottom: 14px;
}

.detail-deal-row {
  padding: 14px 16px; border-radius: 14px;
  margin-bottom: 6px;
  background: rgba(212,164,74,.03);
  border-left: 3px solid transparent;
  display: flex; justify-content: space-between;
  align-items: center;
  min-height: 52px;
}
.detail-deal-name {
  font-size: 14px; font-weight: 600;
  color: var(--text-deal);
}
.detail-deal-store {
  font-size: 11px; color: var(--text-secondary);
  margin-top: 2px; font-weight: 500;
}
.detail-deal-store-name { font-weight: 700; }
.detail-deal-price {
  text-align: right; flex-shrink: 0;
}
.detail-deal-price-val {
  font-size: 18px; font-weight: 800;
  color: var(--gold);
}
.detail-deal-badge {
  font-size: 9px; font-weight: 700;
  color: var(--green);
  letter-spacing: .5px;
}

/* Ingredients */
.detail-ingredient {
  display: flex; justify-content: space-between;
  align-items: center;
  padding: 12px 14px; border-radius: 12px;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
  min-height: 46px;
}
.detail-ingredient.is-deal {
  background: rgba(212,164,74,.04);
  border-left-color: rgba(212,164,74,.3);
}
.detail-ingredient-name {
  font-size: 14px; font-weight: 400;
  color: var(--text-tagline);
}
.detail-ingredient.is-deal .detail-ingredient-name {
  font-weight: 600; color: var(--text-deal);
}
.detail-ingredient-right {
  display: flex; align-items: center; gap: 8px;
}
.detail-ingredient-qty {
  font-size: 13px; color: #4A5A48;
  font-weight: 500;
}
.detail-ingredient-badge {
  font-size: 8px; font-weight: 800;
  padding: 3px 6px; border-radius: 5px;
  background: var(--gold-highlight);
  color: var(--gold);
  letter-spacing: .5px;
}

/* Steps */
.detail-step {
  display: flex; align-items: flex-start;
  margin-bottom: 18px;
}
.detail-step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(212,164,74,.08);
  border: 1px solid rgba(212,164,74,.12);
  color: var(--gold);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center;
  justify-content: center;
  flex-shrink: 0; margin-right: 14px;
  margin-top: 1px;
}
.detail-step-text {
  font-size: 14.5px; line-height: 1.65;
  color: var(--text-detail); font-weight: 400;
}

/* Chef secret box */
.detail-secret {
  padding: 20px; border-radius: 18px;
  background: rgba(212,164,74,.03);
  border: 1px solid rgba(212,164,74,.1);
  margin-bottom: 24px;
}
.detail-secret-header {
  display: flex; align-items: center;
  gap: 10px; margin-bottom: 10px;
}
.detail-secret-hector .hector-sprite {
  border-radius: 10px;
  border: 1px solid rgba(212,164,74,.12);
}
.detail-secret-label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 2px; color: var(--gold-dim);
}
.detail-secret-text {
  font-size: 15px; line-height: 1.6;
  color: #B8A878; font-weight: 300;
  font-style: italic;
}

/* Savings box */
.detail-savings {
  padding: 20px; border-radius: 16px;
  text-align: center;
  background: var(--green-bg);
  border: 1px solid rgba(106,159,106,.1);
  margin-bottom: 20px;
  display: flex; flex-direction: column;
  align-items: center;
}
.detail-savings-label {
  font-size: 13px; color: var(--green);
  font-weight: 600;
}
.detail-savings-amount {
  font-size: 40px; font-weight: 900;
  color: var(--green); margin-top: 2px;
}
.detail-savings-sub {
  font-size: 11px; color: var(--text-tertiary);
  margin-top: 4px; font-weight: 500;
}

/* ─── FLOATING SELECTION BAR ─── */
#floating-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 14px 18px;
  padding-bottom: calc(14px + var(--sab));
  background: rgba(16, 26, 30, .96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(212,164,74,.15);
  display: flex; align-items: center;
  justify-content: space-between;
  z-index: 30;
  animation: fin .3s ease forwards;
}
.fab-count {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
}
.fab-clear {
  font-size: 12px; color: var(--text-tertiary);
  background: none; border: none;
  font-family: var(--font); font-weight: 500;
  cursor: pointer; padding: 4px 8px;
  -webkit-tap-highlight-color: transparent;
}
.fab-clear:active { opacity: .5; }
.fab-btn {
  padding: 12px 20px; border-radius: 14px;
  border: none; font-size: 14px; font-weight: 700;
  background: linear-gradient(135deg, #D4A44A, #B8862A);
  color: var(--bg); min-height: 44px;
}

/* ─── RECIPE CARD SELECT ─── */
.rcard { position: relative; }
.rcard-select {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(212,164,74,.15);
  background: rgba(11,18,21,.6);
  display: flex; align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.rcard-select::before {
  content: ''; position: absolute; inset: -8px;
}
.rcard-select.selected {
  background: var(--gold);
  border-color: var(--gold);
}
.rcard-select-check {
  font-size: 15px; color: var(--bg);
  font-weight: 800; line-height: 1;
}

/* ─── SHOPPING LIST SCREEN ─── */
#screen-shopping {
  position: absolute; inset: 0; z-index: 25;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.shopping-content {
  max-width: 540px; margin: 0 auto; width: 100%;
}
.shopping-header {
  text-align: center; margin-bottom: 24px;
}
.shopping-icon { font-size: 48px; margin-bottom: 12px; }
.shopping-title {
  font-size: 24px; font-weight: 800;
  background: linear-gradient(135deg, #F0EAD6, #D4A44A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 4px;
}
.shopping-subtitle {
  font-size: 13px; color: var(--text-secondary);
  font-weight: 400;
}

/* Recipe chips in shopping list */
.shopping-recipes {
  display: flex; flex-wrap: wrap;
  gap: 6px; margin-bottom: 20px;
}
.shopping-recipe-chip {
  font-size: 11px; padding: 6px 10px;
  border-radius: 8px; font-weight: 600;
  background: var(--gold-bg);
  color: var(--gold-text);
  border: 1px solid var(--gold-border);
}

/* Chain section */
.shopping-chain { margin-bottom: 20px; }
.shopping-chain-header {
  display: flex; align-items: center;
  gap: 10px; padding: 12px 16px;
  border-radius: 12px; margin-bottom: 4px;
  background: rgba(255,255,255,.02);
}
.shopping-chain-dot {
  width: 12px; height: 12px;
  border-radius: 50%; flex-shrink: 0;
}
.shopping-chain-name {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
}
.shopping-chain-count {
  font-size: 12px; font-weight: 500;
  margin-left: auto; color: var(--text-tertiary);
}

.shopping-item {
  display: flex; align-items: center;
  padding: 10px 14px 10px 20px; gap: 8px;
  min-height: 42px;
}
.shopping-item-check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 1.5px solid rgba(212,164,74,.15);
  flex-shrink: 0;
}
.shopping-item-name {
  font-size: 14px; color: var(--text-primary);
  font-weight: 400; flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopping-item-qty {
  font-size: 12px; color: var(--text-tertiary);
  font-weight: 500; white-space: nowrap;
  flex-shrink: 0;
}
.shopping-item-price {
  font-size: 13px; color: var(--gold);
  font-weight: 700; white-space: nowrap;
  flex-shrink: 0;
}
.shopping-item-recipe {
  font-size: 10px; color: var(--text-quaternary);
  padding: 0 16px 4px 48px;
}

/* Other ingredients */
.shopping-other { margin-bottom: 20px; }
.shopping-other-header {
  display: flex; align-items: center;
  gap: 10px; padding: 12px 16px;
  border-radius: 12px; margin-bottom: 4px;
  background: rgba(255,255,255,.02);
}
.shopping-other-title {
  font-size: 16px; font-weight: 700;
  color: var(--text-secondary);
}
.shopping-other-count {
  font-size: 12px; font-weight: 500;
  margin-left: auto; color: var(--text-tertiary);
}

/* Savings in shopping list */
.shopping-savings {
  text-align: center; padding: 20px;
  border-radius: 16px;
  background: var(--green-bg);
  border: 1px solid rgba(106,159,106,.1);
  margin-bottom: 24px;
}
.shopping-savings-label {
  font-size: 13px; color: var(--green); font-weight: 600;
}
.shopping-savings-amount {
  font-size: 36px; font-weight: 900;
  color: var(--green); margin-top: 2px;
}

/* Share buttons */
.shopping-share { margin-bottom: 20px; }
.shopping-share-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2px; color: var(--text-quaternary);
  margin-bottom: 12px; text-align: center;
}
.shopping-share-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.share-btn {
  padding: 14px 16px; border-radius: 14px;
  border: none; font-size: 14px; font-weight: 600;
  font-family: var(--font); cursor: pointer;
  display: flex; align-items: center;
  justify-content: center; gap: 8px;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  transition: all .15s ease;
}
.share-btn:active { transform: scale(.97); }
.share-btn-whatsapp { background: #25D366; color: white; }
.share-btn-sms { background: #34C759; color: white; }
.share-btn-email {
  background: rgba(212,164,74,.12); color: var(--gold);
  border: 1px solid rgba(212,164,74,.15);
}
.share-btn-copy {
  background: var(--card); color: var(--text-primary);
  border: 1px solid rgba(255,255,255,.04);
}
.share-btn-icon { font-size: 18px; }

/* Toast */
.toast {
  position: fixed; bottom: 100px;
  left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 12px;
  background: var(--card);
  border: 1px solid rgba(212,164,74,.15);
  color: var(--gold); font-size: 14px;
  font-weight: 600; font-family: var(--font);
  z-index: 1000;
  animation: fin .3s ease forwards;
  pointer-events: none;
}

/* ─── FRIDGE CTA BUTTON ─── */
#fridge-cta { padding: 14px 18px 0; }
.fridge-cta-btn {
  width: 100%; padding: 16px 20px;
  border-radius: 16px; border: 1.5px solid rgba(100,180,220,.12);
  background: linear-gradient(135deg, rgba(90,157,184,.06), rgba(90,157,184,.02));
  color: var(--text-primary); font-size: 15px;
  font-weight: 600; font-family: var(--font);
  cursor: pointer; display: flex;
  align-items: center; gap: 12px;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
  transition: all .2s ease;
}
.fridge-cta-btn:hover {
  border-color: rgba(100,180,220,.25);
  transform: translateY(-1px);
}
.fridge-cta-btn:active { transform: scale(.98); }
.fridge-cta-icon { font-size: 24px; }
.fridge-cta-text { flex: 1; text-align: left; }
.fridge-cta-title {
  font-size: 15px; font-weight: 700;
  color: #5A9DB8;
}
.fridge-cta-sub {
  font-size: 11px; font-weight: 400;
  color: var(--text-tertiary); margin-top: 1px;
}
.fridge-cta-arrow {
  font-size: 18px; color: var(--text-tertiary);
}

/* ─── FRIDGE MODE BANNER ─── */
#fridge-banner { padding: 10px 18px 0; }
.fridge-banner-inner {
  padding: 12px 16px; border-radius: 14px;
  background: rgba(90,157,184,.06);
  border: 1px solid rgba(90,157,184,.12);
  display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap;
}
.fridge-banner-icon { font-size: 20px; }
.fridge-banner-info { flex: 1; }
.fridge-banner-label {
  font-size: 12px; font-weight: 700;
  color: #5A9DB8; letter-spacing: .5px;
}
.fridge-banner-items {
  font-size: 11px; color: var(--text-secondary);
  font-weight: 400; margin-top: 1px;
}
.fridge-banner-actions {
  display: flex; gap: 8px;
}
.fridge-banner-btn {
  padding: 6px 12px; border-radius: 8px;
  border: none; font-size: 11px;
  font-weight: 600; font-family: var(--font);
  cursor: pointer; min-height: 32px;
  -webkit-tap-highlight-color: transparent;
}
.fridge-banner-btn:active { transform: scale(.95); }
.fridge-banner-modify {
  background: rgba(90,157,184,.12);
  color: #5A9DB8;
}
.fridge-banner-exit {
  background: rgba(255,255,255,.04);
  color: var(--text-tertiary);
}

/* ─── FRIDGE INPUT SCREEN ─── */
#screen-fridge {
  position: absolute; inset: 0; z-index: 22;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.fridge-content {
  max-width: 480px; margin: 0 auto; width: 100%;
}
.fridge-hector {
  text-align: center; margin-bottom: 16px;
}
.fridge-hector .hector-sprite {
  margin: 0 auto; border-radius: 20px;
  border: 1.5px solid rgba(90,157,184,.1);
}
.fridge-title {
  text-align: center; margin-bottom: 24px;
}
.fridge-title h2 {
  font-size: 26px; font-weight: 800;
  background: linear-gradient(135deg, #B8D8E8, #5A9DB8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 6px;
}
.fridge-title p {
  font-size: 13px; color: var(--text-secondary);
  font-weight: 400; line-height: 1.5;
  padding: 0 20px;
}

.fridge-input-row {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.fridge-input {
  flex: 1; padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(90,157,184,.12);
  background: var(--card);
  color: var(--text-primary);
  font-size: 16px; font-weight: 500;
  font-family: var(--font);
  outline: none; min-height: 50px;
  transition: border-color .2s;
}
.fridge-input:focus {
  border-color: rgba(90,157,184,.35);
}
.fridge-input::placeholder {
  color: var(--text-quaternary);
}
.fridge-add-btn {
  padding: 14px 20px; border-radius: 14px;
  border: none; font-size: 20px; font-weight: 700;
  background: #5A9DB8; color: white;
  min-width: 50px; min-height: 50px;
}
.fridge-add-btn:active { transform: scale(.95); }

/* Fridge chips */
.fridge-chips {
  display: flex; flex-wrap: wrap;
  gap: 8px; margin-bottom: 20px;
  min-height: 20px;
}
.fridge-chip {
  padding: 8px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  background: rgba(90,157,184,.1);
  color: #5A9DB8;
  border: 1px solid rgba(90,157,184,.15);
  display: flex; align-items: center; gap: 6px;
}
.fridge-chip-x {
  cursor: pointer; font-size: 16px;
  color: rgba(90,157,184,.5);
  font-weight: 400; line-height: 1;
}
.fridge-chip-x:hover { color: #5A9DB8; }

/* Suggestions */
.fridge-suggestions { margin-bottom: 28px; }
.fridge-suggestions-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2px; color: var(--text-quaternary);
  margin-bottom: 10px;
}
.fridge-suggestions-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.fridge-suggestion-btn {
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.04);
  background: var(--card); color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  font-family: var(--font); cursor: pointer;
  min-height: 38px;
  -webkit-tap-highlight-color: transparent;
  transition: all .15s ease;
}
.fridge-suggestion-btn:hover {
  background: rgba(90,157,184,.08);
  color: #5A9DB8;
}
.fridge-suggestion-btn:active { transform: scale(.95); }

/* Submit */
.fridge-submit {
  text-align: center; margin-bottom: 20px;
}
.fridge-submit-btn {
  width: 100%; padding: 16px 24px;
  border-radius: 16px; border: none;
  font-size: 16px; font-weight: 700;
  font-family: var(--font);
  min-height: 56px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fridge-submit-btn.active {
  background: linear-gradient(135deg, #5A9DB8, #3A7D98);
  color: white;
}
.fridge-submit-btn.inactive {
  background: #141E1A; color: #2A3828;
}
.fridge-submit-btn:active:not(:disabled) { transform: scale(.98); }

/* ─── FRIDGE MATCH ON RECIPE CARDS ─── */
.rcard-fridge {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.03);
}
.rcard-fridge-score {
  display: flex; align-items: center;
  gap: 8px; margin-bottom: 6px;
}
.rcard-fridge-bar {
  flex: 1; height: 4px;
  border-radius: 2px; background: rgba(255,255,255,.04);
  overflow: hidden;
}
.rcard-fridge-bar-fill {
  height: 100%; border-radius: 2px;
  background: #5A9DB8;
  transition: width .3s ease;
}
.rcard-fridge-pct {
  font-size: 11px; font-weight: 700;
  color: #5A9DB8; white-space: nowrap;
}
.rcard-fridge-have {
  font-size: 12px; color: var(--green);
  font-weight: 500; margin-bottom: 3px;
  line-height: 1.4;
}
.rcard-fridge-deals {
  font-size: 12px; color: var(--gold-text);
  font-weight: 500; line-height: 1.4;
}

/* ─── Hector Sprite Component ─── */
.hector-sprite {
  position: relative; overflow: hidden;
  flex-shrink: 0;
}
.hector-sprite img {
  position: absolute; top: 0;
  height: 100%; object-fit: cover;
}

/* ─── Hidden state classes ─── */
.hidden { display: none !important; }

/* ─── PWA standalone mode ─── */
@media (display-mode: standalone) {
  #main-header {
    padding-top: calc(12px + var(--sat));
  }
}

/* ─── Responsive — Desktop ─── */
@media (min-width: 600px) {
  .entry-title { font-size: 36px; }
  .entry-subtitle { font-size: 15px; }
  .detail-content { padding: 0 20px; }
  .rcard-footer { gap: 20px; }
  #recipe-cards { padding: 0 20px 30px; }
}
