/* ============================================================
   Kobook — Libro de Cocina Moderno
   Tokens: Docmentación/theme.css + Guía de diseño
   Bootstrap 5.3 como base estructural
   ============================================================ */

:root {
  --color-bg:       #F5EFE3;
  --color-card:     #FDFAF5;
  --color-primary:  #273B23;
  --color-primary-dark: #3D5938;
  --color-secondary:#4E7D50;
  --color-tertiary: #CC8228;
  --color-heading:  #1A1510;
  --color-text:     #1A1510;
  --color-muted:    #72655A;
  --color-border:   #DDD1BC;
  --color-alert:    #C05030;
  --color-event:    #C05030;
  --color-cta-recetas: #C05030;
  --color-cta-cal:  #CC8228;
  --color-cta-inv:  #4E7D50;

  --font-heading: 'Fraunces', Georgia, serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', ui-monospace, monospace;
  --radius:       12px;
  --shadow:       0 2px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg:    0 3px 6px rgba(0, 0, 0, 0.10), 0 10px 20px rgba(0, 0, 0, 0.08);
  --transition:   0.3s ease;
  --app-max:      720px;
  --bottom-nav-h: 64px;

  /* Fondo pergamino / viñeta */
  --bg-vignette:       rgba(110, 70, 30, 0.34);
  --bg-vignette-mid:   rgba(110, 70, 30, 0.16);
  --bg-vignette-soft:  rgba(90, 55, 20, 0.18);
  --bg-center-light:   rgba(255, 250, 235, 0.7);
  --bg-texture-size:   180px 180px;
  --bg-side-fade:      22%;

  /* Compat con clases antiguas */
  --c-green:        var(--color-secondary);
  --c-green-dark:   #556B2F;
  --c-green-light:  #eef3e0;
  --c-green-mid:    #a8bf6e;
  --c-terra:        #C05030;
  --c-terra-dark:   var(--color-primary-dark);
  --c-terra-light:  #f5dfd6;
  --c-amber:        #C9962A;
  --c-amber-dark:   #a87b1e;
  --c-amber-light:  #fef3d8;
  --c-blue:         #8B6914;
  --c-blue-dark:    #7B3F00;
  --c-blue-light:   #f5edd8;
  --c-mauve:        #8B5A2B;
  --c-mauve-dark:   #6B4423;
  --c-mauve-light:  #f5ebe0;
  --color-acento:       var(--color-primary);
  --color-acento-dark:  var(--color-primary-dark);
  --color-acento-light: var(--c-terra-light);
  --color-bg-soft:      var(--color-bg);
  --bs-primary:         #273B23;
  --bs-primary-rgb:     39, 59, 35;
  --bs-body-color:      #1A1510;
  --bs-body-bg:         #F5EFE3;
  --bs-border-color:    #DDD1BC;
  --bs-link-color:      #C05030;
  --bs-link-hover-color:#273B23;
}

/* ------ Base ------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  background-color: var(--color-bg);
}

body {
  font-family: var(--font-body);
  position: relative;
  z-index: 0;
  background: transparent;
  color: var(--color-text);
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-nav-h) + 16px);
}

/* Textura + degradado laterales (fijo: móvil y PC; evita bugs de background-attachment) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--color-bg);
  background-image:
    /* Laterales — efecto mockup login */
    linear-gradient(
      90deg,
      var(--bg-vignette) 0%,
      var(--bg-vignette-mid) 8%,
      transparent var(--bg-side-fade),
      transparent calc(100% - var(--bg-side-fade)),
      var(--bg-vignette-mid) 92%,
      var(--bg-vignette) 100%
    ),
    /* Vertical suave */
    linear-gradient(
      180deg,
      var(--bg-vignette-soft) 0%,
      transparent 16%,
      transparent 84%,
      rgba(90, 55, 20, 0.22) 100%
    ),
    /* Viñeta elíptica global */
    radial-gradient(
      ellipse 95% 75% at 50% 42%,
      transparent 42%,
      rgba(90, 55, 20, 0.14) 100%
    ),
    /* Luz central sobre el pergamino */
    radial-gradient(
      ellipse at 50% 38%,
      var(--bg-center-light) 0%,
      transparent 55%
    ),
    /* Calidez base */
    linear-gradient(145deg, #FDF6EC 0%, #FAEBD7 48%, #F5E6D0 100%),
    /* Grano / fibras de papel */
    url('/public/img/textures/pergamino.svg');
  background-size:
    auto, auto, auto, auto, auto,
    var(--bg-texture-size);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-position: center, center, center, center, center, 0 0;
  background-blend-mode: multiply, multiply, multiply, soft-light, normal, multiply;
}

body.auth-body {
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Admin / cook: sin capa de pergamino (skins propias) */
.admin-body::before,
.cook-mode-body::before {
  display: none;
}

@media (min-width: 992px) {
  :root {
    --bg-side-fade: 18%;
    --bg-vignette: rgba(110, 70, 30, 0.38);
    --bg-vignette-mid: rgba(110, 70, 30, 0.18);
  }
}

h1, h2, h3, h4, .section-title, .page-title, .brand-title {
  font-family: var(--font-heading);
  color: var(--color-heading);
  font-weight: 700;
}

p, span, li, label, input, textarea, select, button {
  font-family: var(--font-body);
}

a { color: var(--color-primary-dark); }
a:hover { color: var(--color-heading); }

.text-acento { color: var(--color-primary) !important; }
.text-muted  { color: var(--color-muted) !important; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-shell {
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  padding-left: 10px;
  padding-right: 10px;
}

.page-wrapper {
  padding-top: 16px;
  padding-bottom: 24px;
}

.page-wrapper > .container.app-shell {
  max-width: var(--app-max);
  padding-left: 10px;
  padding-right: 10px;
}

.page-header {
  margin-bottom: 1rem;
}

.app-brand-header {
  margin: 0.35rem 0 1rem;
}
.app-brand-row {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 0.25rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(123, 63, 0, 0.45);
}
.app-brand-row-actions {
  grid-template-columns: 40px 1fr auto;
}
.app-brand-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 40px;
}
.app-brand-action {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  border: none;
  background: var(--color-primary);
  border-radius: 10px;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), color var(--transition);
}
.app-brand-action:hover {
  background: var(--color-primary-dark);
  color: #fff;
}
.app-brand-action-danger {
  background: var(--color-primary);
}
.app-brand-action-danger:hover {
  background: var(--color-primary-dark);
  color: #fff;
}
.app-brand-back,
.app-brand-back-spacer {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-brand-back {
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-size: 1.15rem;
  background: var(--color-primary);
  transition: background var(--transition), color var(--transition);
}
.app-brand-back:hover {
  background: var(--color-primary-dark);
  color: #fff;
}
.app-brand-header .brand-title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.65rem, 6vw, 2.05rem);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 6.5vw, 2.2rem);
  font-weight: 600;
  font-style: italic;
  text-align: center;
  margin: 0rem 0 1.15rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--color-heading);
  text-shadow: 0 1px 0 rgba(255, 248, 235, 0.6);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-heading);
  border: none;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.01em;
}
.section-title .bi { color: var(--color-heading); font-size: 1.05rem; }
.section-title.st-green,
.section-title.st-blue,
.section-title.st-amber { border: none; }

.footer {
  display: none;
}

.flash-container {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 24px, var(--app-max));
  z-index: 1080;
}

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--bottom-nav-h);
  background: rgba(250, 235, 215, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(123, 63, 0, 0.28);
  display: flex;
  justify-content: center;
  align-items: stretch;
  z-index: 1040;
  box-shadow: 0 -4px 16px rgba(60, 40, 20, 0.12);
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-sizing: border-box;
}

.bottom-nav-inner {
  width: 100%;
  max-width: var(--app-max);
  height: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  box-sizing: border-box;
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--color-heading);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 6px 2px;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  max-width: 80px;
}
.bottom-nav a i {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--color-heading);
}
.bottom-nav a.active,
.bottom-nav a:hover {
  color: var(--color-primary);
  background: rgba(210, 105, 30, 0.08);
}

.bottom-nav .dropup {
  flex: 1;
  max-width: 80px;
  display: flex;
  justify-content: center;
  position: relative;
}
.bottom-nav .dropup > a {
  width: 100%;
  max-width: none;
}
.bottom-nav .dropdown-menu {
  min-width: 0;
  width: max-content;
  max-width: min(90vw, 200px);
  padding: 10px 14px;
  margin-bottom: 0.5rem !important;
  background: rgba(253, 246, 232, 0.98);
  border: 1px solid rgba(160, 130, 90, 0.45);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(60, 40, 20, 0.15);
  --bs-dropdown-min-width: 0;
}
.bottom-nav .dropdown-menu .dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px;
  max-width: none;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-heading);
  background: transparent;
}
.bottom-nav .dropdown-menu .dropdown-item:hover,
.bottom-nav .dropdown-menu .dropdown-item:focus {
  background: rgba(210, 105, 30, 0.1);
  color: var(--color-primary);
}
.bottom-nav .dropdown-menu .dropdown-item i {
  font-size: 1.25rem;
  margin: 0 !important;
  line-height: 1;
}
.bottom-nav .dropdown-menu .dropdown-item.text-danger,
.bottom-nav .dropdown-menu .dropdown-item.text-danger:hover {
  color: #c0392b;
}
.bottom-nav .dropdown-menu .dropdown-divider {
  margin: 6px 0;
  border-color: rgba(160, 130, 90, 0.35);
}
.bottom-nav .dropdown-menu .dropdown-item-text {
  display: block;
  text-align: center;
  padding: 4px 6px;
  font-size: 0.7rem;
  white-space: nowrap;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 20px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition), transform 0.1s;
}

.btn-primary,
.btn-accent,
.btn-blue {
  background: linear-gradient(180deg, #c85b20 0%, #b54d18 100%);
  border-color: #9a4516;
  color: #fffaf3;
  box-shadow: 0 4px 10px rgba(110, 52, 17, 0.26);
}
.btn-primary:hover,
.btn-accent:hover,
.btn-blue:hover,
.btn-primary:focus,
.btn-accent:focus {
  background: linear-gradient(180deg, #bb521d 0%, #a94717 100%);
  border-color: #8f3d13;
  color: #fff;
  box-shadow: 0 4px 12px rgba(160, 82, 45, 0.38);
}

.btn-secondary,
.btn-outline-blue {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #fff;
}
.btn-tertiary {
  background-color: var(--color-tertiary);
  border-color: var(--color-tertiary);
  color: #fff;
}
.btn-tertiary:hover,
.btn-tertiary:focus {
  background-color: #bf8b2e;
  border-color: #bf8b2e;
  color: #fff;
}

.btn-secondary:hover,
.btn-outline-blue:hover {
  background-color: #556B2F;
  border-color: #556B2F;
  color: #fff;
}

.btn-outline-primary,
.btn-outline-secondary {
  color: var(--color-heading);
  border-color: var(--color-border);
  background: var(--color-card);
}
.btn-outline-primary:hover,
.btn-outline-secondary:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.btn-outline-danger {
  color: var(--color-alert);
  border-color: #d4a5a5;
  background: #fff8f8;
}
.btn-outline-danger:hover {
  background: var(--color-alert);
  border-color: var(--color-alert);
  color: #fff;
}

.btn-lg { padding: 12px 20px; font-size: 1rem; }

.btn-mauve,
.btn-amber,
.btn-terra {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
.btn-mauve:hover,
.btn-amber:hover,
.btn-terra:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}
.btn-outline-mauve,
.btn-outline-amber,
.btn-outline-terra {
  color: var(--color-heading);
  border-color: var(--color-border);
  background: var(--color-card);
}
.btn-outline-mauve:hover,
.btn-outline-amber:hover,
.btn-outline-terra:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.pagination .page-link {
  color: var(--color-heading);
  border-color: var(--color-border);
  background: var(--color-card);
}
.pagination .page-item.active .page-link {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.nav-tabs {
  border-bottom-color: var(--color-border);
}
.nav-tabs .nav-link {
  color: var(--color-muted);
  border: none;
  border-radius: 20px;
  margin-right: 4px;
  padding: 8px 14px;
}
.nav-tabs .nav-link.active {
  background: var(--color-primary);
  color: #fff;
}

.text-terra { color: var(--color-primary) !important; }
.text-mauve { color: var(--c-mauve) !important; }

/* ============================================================
   CARDS
   ============================================================ */
.content-card,
.card-cookbook,
.recipe-card {
  background-color: var(--color-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(160, 130, 90, 0.42);
}

.card {
  background: var(--color-card);
  border: 1px solid rgba(160, 130, 90, 0.42);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.sombra-gourmet {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.10), 0 10px 20px rgba(0, 0, 0, 0.08) !important;
}

.recipe-card {
  padding: 0;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.recipe-card .card-body { padding: 12px 14px; }
.recipe-card .card-img-top,
.recipe-card img.card-img-top {
  width: 100%;
  object-fit: cover;
}

.content-card.card-blue,
.content-card.card-amber {
  border-left: 4px solid var(--color-primary);
}

.bg-acento-light { background-color: var(--c-terra-light) !important; }
.bg-blue-light   { background-color: var(--c-blue-light) !important; }
.text-blue       { color: var(--color-heading) !important; }
.text-amber      { color: var(--c-amber) !important; }

/* ============================================================
   BADGES
   ============================================================ */
.badge-facil   { background-color: var(--c-green-light); color: var(--c-green-dark); border: 1px solid var(--c-green-mid); }
.badge-media   { background-color: var(--c-amber-light);  color: var(--c-amber-dark);  border: 1px solid #e8c97a; }
.badge-dificil { background-color: var(--c-terra-light);  color: var(--c-terra-dark);  border: 1px solid #e0a98a; }
.badge-cat {
  background: rgba(123, 63, 0, 0.08);
  color: var(--color-heading);
  font-weight: 500;
  border: 1px solid var(--color-border);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-control,
.form-select {
  background-color: #f8efdd;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  color: var(--color-text);
  padding: 10px 14px;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(196, 90, 58, 0.18);
  background-color: #fff;
}
.form-label { color: var(--color-heading); font-weight: 600; font-size: 0.9rem; }
.input-group-text {
  background: var(--color-card);
  border: 1px solid var(--color-heading);
  color: var(--color-heading);
  border-radius: 10px 0 0 10px;
}
.input-group .form-control { border-left: 0; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 20px 10px 24px;
}
.login-wrap .brand-title {
  font-size: clamp(1.9rem, 8vw, 2.45rem);
  font-weight: 700;
  font-style: italic;
  margin-bottom: 2.1rem;
  color: #4a2e1c;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 247, 230, 0.72);
}
.login-wrap .brand-title::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(123, 63, 0, 0.5) 12%,
    rgba(123, 63, 0, 0.55) 50%,
    rgba(123, 63, 0, 0.5) 88%,
    transparent 100%
  );
  margin: 14px auto 0;
  border-radius: 2px;
}
.login-wrap .form-control {
  border-radius: 10px;
  border: 1px solid rgba(160, 107, 52, 0.58);
  padding: 12px 14px 12px 50px;
  background: #f7efde;
  color: #4b382b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 2px 4px rgba(90, 60, 30, 0.14);
}
.login-wrap .form-control::placeholder {
  color: var(--color-nav-idle, #B0A090);
  opacity: 1;
}
.login-wrap .form-control:focus {
  border-color: #b06a2b;
  background: #f7efde;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 4px rgba(90, 60, 30, 0.16),
    0 0 0 0.15rem rgba(176, 106, 43, 0.12);
}
.login-field {
  position: relative;
  margin-bottom: 0.95rem;
}
.login-field .login-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #a17045;
  font-size: 1.45rem;
  z-index: 2;
}
.login-wrap .btn.btn-primary.btn-lg {
  border: 1px solid #9a4516;
  background: linear-gradient(180deg, #c85b20 0%, #b54d18 100%);
  color: #fffaf3;
  box-shadow: 0 4px 10px rgba(110, 52, 17, 0.26);
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  padding-top: 10px;
  padding-bottom: 10px;
}
.login-wrap .btn.btn-primary.btn-lg:hover,
.login-wrap .btn.btn-primary.btn-lg:focus {
  background: linear-gradient(180deg, #bb521d 0%, #a94717 100%);
  border-color: #8f3d13;
}
.login-link {
  display: block;
  text-align: center;
  margin-top: 1.45rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #57483d;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.login-link:hover {
  color: #7b3f00;
  text-decoration: underline;
}
.login-link + .login-link {
  margin-top: 0.65rem;
}
.login-link--register {
  font-weight: 600;
  color: #9a4516;
  text-decoration: none;
}
.login-link--register:hover {
  text-decoration: underline;
}
.login-field .login-toggle-pwd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  border: none;
  background: transparent;
  color: #a17045;
  padding: 4px 8px;
  line-height: 1;
  font-size: 1.15rem;
  cursor: pointer;
}
.login-field .login-toggle-pwd:hover,
.login-field .login-toggle-pwd:focus {
  color: var(--color-heading);
}
.login-field--with-toggle .form-control {
  padding-right: 46px;
}
.login-wrap--register {
  max-width: 420px;
}
.login-subtitle {
  text-align: center;
  color: #6e5a4a;
  font-size: 0.95rem;
  margin: -1.2rem 0 1.4rem;
}
.login-help {
  font-size: 0.78rem;
  color: #6e5a4a;
  margin: 0 0 0.55rem;
  line-height: 1.35;
}
.pwd-rules {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: #8a7564;
}
.pwd-rules li::before {
  content: '○ ';
}
.pwd-rules li.is-ok {
  color: #3d6b4f;
}
.pwd-rules li.is-ok::before {
  content: '✓ ';
}
.pwd-rules li.is-bad {
  color: #a14a2a;
}
.pwd-rules li.is-bad::before {
  content: '× ';
}
.login-wrap .form-control.is-invalid {
  border-color: #a14a2a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 0 0 0.15rem rgba(161, 74, 42, 0.18);
}
.login-field-error {
  font-size: 0.82rem;
  color: #a14a2a;
  margin: 0 0 0.55rem;
  font-weight: 500;
}
.login-combobox {
  z-index: 5;
}
.login-combobox-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: #f7efde;
  border: 1px solid rgba(160, 107, 52, 0.5);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(74, 46, 28, 0.18);
  z-index: 20;
}
.login-combobox-list li[role="option"] {
  padding: 0.45rem 0.9rem 0.45rem 3rem;
  cursor: pointer;
  color: #4b382b;
  font-size: 0.95rem;
}
.login-combobox-list li[role="option"]:hover,
.login-combobox-list li[role="option"].is-active {
  background: rgba(196, 90, 58, 0.14);
  color: #763607;
}
.login-combobox-empty {
  padding: 0.55rem 1rem;
  color: #8a7564;
  font-size: 0.85rem;
}
.register-thanks-modal {
  background: #f7efde;
  border: 1px solid rgba(160, 107, 52, 0.45);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(74, 46, 28, 0.22);
}
.register-thanks-body {
  text-align: center;
  padding: 2.25rem 1.75rem 1.75rem;
}
.register-thanks-text {
  font-family: var(--font-heading);
  color: #4a2e1c;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.55;
  margin: 0 0 1.5rem;
}
.register-thanks-btn {
  border: 1px solid #9a4516;
  background: linear-gradient(180deg, #c85b20 0%, #b54d18 100%);
  color: #fffaf3;
  border-radius: 10px;
  font-weight: 700;
  min-width: 140px;
  padding: 0.55rem 1.25rem;
}
.register-thanks-btn:hover,
.register-thanks-btn:focus {
  background: linear-gradient(180deg, #bb521d 0%, #a94717 100%);
  border-color: #8f3d13;
  color: #fffaf3;
}
.auth-flash-modal .register-thanks-text {
  white-space: pre-line;
}

/* ============================================================
   DASHBOARD / INICIO HUB
   ============================================================ */
.cta-hub {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1.35rem;
}
.cta-hub a {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  text-align: center;
  padding: 12px 10px;
  border-radius: 14px;
  box-shadow: 0 3px 8px rgba(60, 40, 20, 0.18), inset 0 1px 0 rgba(255,255,255,0.18);
  min-height: 56px;
  transition: transform var(--transition), box-shadow var(--transition);
  line-height: 1.2;
}
.cta-hub a i {
  font-size: 1.25rem;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
}
.cta-hub a span {
  flex: 0 1 auto;
  min-width: 0;
  text-align: center;
  line-height: 1.15;
}
.cta-hub a:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: #fff; }
.cta-hub .cta-recetas { background: linear-gradient(180deg, #D04535 0%, #C0392B 100%); }
.cta-hub .cta-calendario { background: linear-gradient(180deg, #7A9E2E 0%, #6B8E23 100%); }
.cta-hub .cta-invitados { background: linear-gradient(180deg, #C46A2A 0%, #A0522D 100%); }

.cta-frame {
  background: rgb(218 191 148 / 24%);
  border-top: 1px solid rgba(118, 54, 7, 0.28);
  border-bottom: 1px solid rgba(118, 54, 7, 0.28);
  padding: 10px 8px;
  margin: 0 -2px 1.1rem;
}
.cta-frame .cta-hub {
  margin-bottom: 0;
}

.home-section {
  margin-bottom: 1.35rem;
}
.home-section > .section-title {
  margin-bottom: 0.65rem;
  padding: 0 2px;
}

.event-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: transparent;
  border: 1px solid rgba(160, 130, 90, 0.35);
  border-radius: 12px;
  box-shadow: none;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  min-height: 72px;
  transition: opacity var(--transition);
}
.event-card:hover { color: inherit; opacity: 0.92; transform: none; box-shadow: none; }

.event-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
}
.event-row:last-child { border-bottom: 0; }
.event-row:hover { color: inherit; opacity: 0.92; }
.event-day-badge {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(180deg, #E04A38 0%, #C0392B 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(192, 57, 43, 0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  position: relative;
  z-index: 1;
}
.event-day-badge .d {
  font-size: 1.4rem;
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.event-day-badge .m { display: none; }
.event-card-info {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  z-index: 1;
  padding-right: 8px;
}
.event-card .event-title {
  font-weight: 800;
  color: #3d2b1f;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.event-card .event-dish {
  font-size: 0.88rem;
  font-weight: 700;
  color: #5a4332;
  line-height: 1.3;
  margin-top: 1px;
}
.event-card .event-meta {
  font-size: 0.78rem;
  font-weight: 500;
  color: #7a6350;
  margin-top: 2px;
}
.event-card-media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 42%;
  max-width: 160px;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.35) 35%, #000 70%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.35) 35%, #000 70%);
}
.event-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0 10px 10px 0;
}
.event-card-media-ph {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  color: var(--color-primary);
  font-size: 1.5rem;
  opacity: 0.35;
  background: linear-gradient(to right, transparent, rgba(210, 105, 30, 0.08));
}
.event-row-thumb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: var(--shadow);
}
.event-row-thumb-ph {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-terra-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.home-links {
  margin-top: 10px;
  text-align: right;
  font-size: 0.8rem;
}
.home-links a {
  color: var(--color-heading);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.featured-recipe {
  display: block;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 1px solid rgba(160, 130, 90, 0.35);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(60, 40, 20, 0.18);
  color: inherit;
}
.featured-recipe:hover { color: inherit; }
.featured-media {
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 21 / 10;
  width: 100%;
}
.featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  margin: 0;
  aspect-ratio: auto;
}
.featured-media-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(210, 105, 30, 0.1);
  color: var(--color-primary);
  font-size: 2.5rem;
}
.featured-recipe .featured-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 16px;
  margin: 0;
  background: #f9ecda;
}
.featured-recipe .featured-body-text { flex: 1; min-width: 0; }
.featured-recipe h3 {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #763607;
  letter-spacing: -0.01em;
}
.featured-recipe .featured-meta {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #5a4332;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.featured-recipe .featured-meta .bi {
  font-size: 0.95rem;
  color: #5a4332;
}
.featured-recipe .featured-utensils {
  flex-shrink: 0;
  color: #763607;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}
.featured-recipe .featured-utensils svg {
  display: block;
}

/* Icon bubbles (accesos) */
.icon-bubble {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.icon-bubble-terra { background: var(--c-terra-light); color: var(--color-primary); }
.icon-bubble-mauve { background: var(--c-mauve-light); color: var(--c-mauve); }
.icon-bubble-blue  { background: var(--c-blue-light);  color: var(--color-heading); }
.icon-bubble-amber { background: var(--c-amber-light); color: var(--c-amber); }

/* ============================================================
   RECIPES INDEX (buscador)
   ============================================================ */
.search-bar-wrap {
  margin-bottom: 1rem;
}
.search-bar-wrap .form-control {
  border-radius: 24px;
  padding-left: 42px;
  background: #fffaf2;
}
.search-bar-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-heading);
}

.recipe-search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.recipe-search-card {
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  margin-bottom: 0;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: transform var(--transition), box-shadow var(--transition);
}
.recipe-search-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}
.recipe-search-media {
  position: relative;
}
.recipe-search-media-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.recipe-search-card img,
.recipe-search-placeholder {
  width: 100%;
  height: 96px;
  object-fit: cover;
}
.recipe-search-placeholder i {
  font-size: 1.6rem;
  opacity: 0.5;
}
.recipe-search-media .recipe-share-fab {
  top: 0.4rem;
  right: 0.4rem;
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
  border-radius: 8px;
}
.recipe-search-body-link {
  display: block;
  text-decoration: none;
  color: inherit;
  flex: 1;
}
.recipe-search-body-link:hover {
  color: inherit;
}
.recipe-search-card .body {
  padding: 0.5rem 0.55rem 0.65rem;
}
.recipe-search-card h3 {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  margin: 0 0 0.2rem;
  color: var(--color-heading);
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recipe-search-meta {
  font-size: 0.72rem;
  color: var(--color-muted);
  line-height: 1.3;
}
.recipe-search-card .recipe-shared-badge--inline {
  font-size: 0.68rem;
  margin-bottom: 0.15rem !important;
}

@media (min-width: 768px) {
  .recipe-search-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
  }
  .recipe-search-card img,
  .recipe-search-placeholder {
    height: 130px;
  }
  .recipe-search-placeholder i {
    font-size: 2rem;
  }
  .recipe-search-media .recipe-share-fab {
    top: 0.55rem;
    right: 0.55rem;
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .recipe-search-card .body {
    padding: 0.7rem 0.75rem 0.85rem;
  }
  .recipe-search-card h3 {
    font-size: 1rem;
  }
  .recipe-search-meta {
    font-size: 0.8rem;
  }
}

/* ============================================================
   RECIPE SHOW
   ============================================================ */
.recipe-hero-wrap {
  position: relative;
  margin-bottom: 1rem;
}
.recipe-hero {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 21 / 9;
  max-height: 180px;
}
.recipe-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recipe-share-fab {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 2;
  transition: background var(--transition);
}
.recipe-share-fab:hover {
  background: var(--color-primary-dark);
  color: #fff;
}
.recipe-show-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  text-align: center;
  color: var(--color-heading);
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
}
.recipe-meta-line {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.recipe-meta-line .bi { color: var(--color-primary); }
.recipe-servings {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  vertical-align: middle;
}
.recipe-servings-input {
  width: 2.5rem;
  text-align: center;
  border: 1px solid var(--color-border, #d4c4b0);
  border-radius: 8px;
  background: var(--color-card, #fff);
  color: var(--color-heading, #5c3d1e);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.15rem 0.2rem;
  -moz-appearance: textfield;
}
.recipe-servings-input::-webkit-outer-spin-button,
.recipe-servings-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.recipe-servings-btn {
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.recipe-servings-btn:hover {
  background: var(--color-primary-dark);
}
.shopping-servings {
  margin-top: 0.15rem;
}
.shopping-servings .recipe-servings-input {
  width: 2.75rem;
}

.step-item .step-number,
.cook-step-num {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-heading);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.ingredient-row {
  border-color: var(--color-border) !important;
}

/* Formulario receta: ingredientes (móvil = resumen, desktop = formulario) */
#add-ingredient-btn .add-ing-label-full { display: none; }
#add-ingredient-btn .add-ing-label-short { display: inline; }
@media (min-width: 576px) {
  #add-ingredient-btn .add-ing-label-full { display: inline; }
  #add-ingredient-btn .add-ing-label-short { display: none; }
}
#ingredients-container {
  display: flex;
  flex-direction: column;
}
#ingredients-container > .ingredient-row {
  border-bottom: 1px solid rgba(123, 63, 0, 0.28);
  padding: 0.75rem 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-top: none;
  border-left: none;
  border-right: none;
}
#ingredients-container > .ingredient-row:last-child {
  border-bottom: 1px solid rgba(123, 63, 0, 0.28);
}
.ing-summary {
  display: none;
}
.ing-summary-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.ing-summary-text {
  min-width: 0;
  flex: 1;
}
.ing-summary-name {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-heading);
  font-size: 1.05rem;
  line-height: 1.25;
  margin-bottom: 0.15rem;
}
.ing-summary-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.ing-summary-notes {
  color: var(--color-muted);
  font-size: 0.8rem;
  font-style: italic;
  margin-top: 0.2rem;
}
.ing-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.ing-icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
}
.ing-icon-btn:hover {
  background: var(--color-primary-dark);
  color: #fff;
}
.ing-form {
  display: block;
}

@media (max-width: 575.98px) {
  #ingredients-container > .ingredient-row .ing-summary {
    display: block;
  }
  #ingredients-container > .ingredient-row .ing-form {
    display: none;
  }
  #ingredients-container > .ingredient-row.is-editing .ing-summary {
    display: none;
  }
  #ingredients-container > .ingredient-row.is-editing .ing-form {
    display: block;
  }
}

@media (min-width: 576px) {
  #ingredients-container > .ingredient-row {
    border-bottom: none !important;
    padding: 0;
    margin-bottom: 0.5rem;
  }
  #ingredients-container > .ingredient-row .ing-summary {
    display: none !important;
  }
  #ingredients-container > .ingredient-row .ing-form {
    display: block !important;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.5rem;
    box-shadow: var(--shadow);
  }
}

.btn-cook-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: var(--color-primary);
  color: #fff !important;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 3px 8px rgba(210, 105, 30, 0.35);
  text-decoration: none;
  margin-top: 0.5rem;
}
.btn-cook-cta:hover {
  background: var(--color-primary-dark);
  color: #fff !important;
}

/* ============================================================
   CALENDARIO
   ============================================================ */
.cal-title {
  font-family: var(--font-heading);
  text-align: center;
  font-size: 1.6rem;
  color: var(--color-heading);
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.cal-month {
  text-align: center;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 1rem;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: var(--color-card);
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  margin-bottom: 1rem;
}
.cal-dow {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  padding: 4px 0;
}
.cal-day {
  min-height: 42px;
  border-radius: 8px;
  padding: 4px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text);
  position: relative;
  transition: background var(--transition);
}
.cal-day.empty { visibility: hidden; }
.cal-day.has-event {
  background: rgba(196, 90, 58, 0.14);
  color: var(--color-heading);
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(196, 90, 58, 0.35);
}
.cal-day.has-event:hover { background: rgba(196, 90, 58, 0.24); color: var(--color-heading); }
.cal-day.today {
  outline: 2px solid var(--color-secondary);
  outline-offset: -2px;
}
.cal-day.selected {
  box-shadow: inset 0 0 0 2px var(--color-heading);
}
.cal-day .cal-dot {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-primary-dark);
  margin: 2px auto 0;
  opacity: 0.85;
}
.cal-nav-btns a {
  color: var(--color-heading);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  box-shadow: var(--shadow);
}

.avatar-stack {
  display: flex;
  align-items: center;
}
.avatar-stack .av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-left: -8px;
  object-fit: cover;
  background: var(--color-secondary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.avatar-stack .av:first-child { margin-left: 0; }

/* ============================================================
   CONTACT PROFILE
   ============================================================ */
.profile-page {
  padding-bottom: 0.5rem;
}
.profile-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: -16px -10px 0.85rem;
  padding: 8px 10px;
  background: #ebe0c8;
  border-bottom: 1px solid #8b6914;
  position: relative;
  z-index: 2;
}
.profile-topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.profile-topbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-heading);
  font-size: 1.2rem;
  border-radius: 8px;
  padding: 0;
  text-decoration: none;
  cursor: pointer;
}
.profile-topbar-btn:hover { color: var(--color-primary); background: rgba(210,105,30,0.12); }
.profile-topbar-danger { color: #a94442; }
.profile-topbar-danger:hover { color: #c0392b; background: rgba(192,57,43,0.08); }

.profile-hero {
  position: relative;
  text-align: center;
  margin: 0 0 1.1rem;
  padding-top: 0.35rem;
}
.profile-hero-band {
  position: absolute;
  left: -10px;
  right: -10px;
  /* Centrada con la foto + anillos (~134px): mitad − mitad franja */
  top: calc(0.35rem + (134px - 28px) / 2);
  height: 28px;
  background: linear-gradient(90deg, #a67c3a 0%, #b8893f 50%, #9a7030 100%);
  opacity: 0.92;
  z-index: 0;
  pointer-events: none;
}
.profile-hero-photo {
  position: relative;
  z-index: 1;
  display: inline-block;
}
.profile-photo-ring-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(60, 40, 20, 0.16);
}
.profile-photo-ring-brown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c9a05a 0%, #8b6914 55%, #6e5210 100%);
}
.profile-hero img,
.profile-hero .profile-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  box-shadow: none;
  display: block;
}
.profile-hero .profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 auto;
}
.profile-name {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #2f2118;
  margin: 0.85rem 0 0.15rem;
  line-height: 1.2;
}
.profile-relation {
  display: none;
}

.profile-facts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1.35rem;
  padding: 0 2px;
}
.profile-fact {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
  color: #2f2118;
}
.profile-fact > i {
  font-size: 1.1rem;
  margin-top: 2px;
  flex-shrink: 0;
}
.profile-fact-allergy,
.profile-fact-allergy strong { color: #c45c1a; }
.profile-fact-allergy > i { color: #d2691e; }
.profile-fact-pref,
.profile-fact-pref strong { color: #3d2b1f; }
.profile-fact-pref > i { color: #7B3F00; }
.profile-fact-empty {
  font-weight: 500;
  opacity: 0.65;
}

.profile-section {
  margin-bottom: 1.35rem;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.profile-section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #2f2118;
  margin: 0 0 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(160, 130, 90, 0.45);
  display: block;
}
.profile-empty {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0.35rem 0 0;
}

.fav-dishes {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 2px;
}
.fav-dishes a {
  flex: 0 0 92px;
  text-decoration: none;
  color: inherit;
}
.fav-dishes img,
.fav-dishes .fav-ph {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 6px rgba(60, 40, 20, 0.12);
}
.fav-dishes .fav-ph {
  background: rgba(210, 105, 30, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.4rem;
}

.profile-history {
  list-style: none;
  margin: 0;
  padding: 0;
}
.profile-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(160, 130, 90, 0.2);
}
.profile-history li:last-child .profile-history-item { border-bottom: 0; }
.profile-history-item:hover { color: inherit; opacity: 0.9; }
.profile-history-ico {
  color: #d2691e;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.profile-history-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.profile-history-title {
  font-weight: 800;
  color: #3d2b1f;
  font-size: 0.95rem;
}
.profile-history-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6a5444;
}
.profile-history-chevron {
  color: #8a7060;
  font-size: 1rem;
  flex-shrink: 0;
}

.profile-cooked {
  list-style: none;
  margin: 0;
  padding: 0;
}
.profile-cooked-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(160, 130, 90, 0.2);
  flex-wrap: wrap;
}
.profile-cooked li:last-child { border-bottom: 0; }
.profile-cooked-title {
  font-weight: 800;
  color: #3d2b1f;
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.profile-cooked-title i { color: #7B3F00; }
.profile-cooked-meta {
  font-size: 0.78rem;
  color: #6a5444;
  margin-top: 2px;
}
.profile-cooked-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.profile-cooked-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.profile-cooked-badge.is-like { background: rgba(107,142,35,0.15); color: #556B2F; }
.profile-cooked-badge.is-dislike { background: rgba(192,57,43,0.12); color: #a94442; }
.profile-fb-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(160, 130, 90, 0.35);
  background: transparent;
  color: #5a4332;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.profile-fb-btn.is-like:hover { color: #556B2F; border-color: #6B8E23; background: rgba(107,142,35,0.1); }
.profile-fb-btn.is-dislike:hover { color: #c0392b; border-color: #c0392b; background: rgba(192,57,43,0.08); }

.allergy-text { color: var(--color-alert); font-weight: 600; }

/* ============================================================
   INGREDIENTES
   ============================================================ */
.ingredient-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.ingredient-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.ingredient-icon {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(196, 90, 58, 0.12);
  color: var(--color-heading);
}
.ingredient-list-search {
  background: #f8efdd;
}
.ingredient-list-category {
  background: #f8efdd;
}
.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(196, 90, 58, 0.03);
  --bs-table-hover-bg: rgba(196, 90, 58, 0.05);
  --bs-table-border-color: var(--color-border);
  color: var(--color-text);
}
.table thead th {
  color: var(--color-heading);
  font-weight: 600;
  font-family: var(--font-heading);
}
.modal-content {
  background: var(--color-card);
  border: 1px solid rgba(160, 130, 90, 0.42);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.nutrition-pill {
  min-width: 82px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #f8efdd;
  padding: 8px 10px;
  text-align: center;
  color: var(--color-text);
}
.nutrition-pill .pill-val {
  display: block;
  font-weight: 700;
  color: var(--color-heading);
}
.nutrition-table td,
.nutrition-table th {
  border-color: var(--color-border) !important;
}
.nutrition-group-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-border);
}

/* ============================================================
   SHOPPING / HISTORIAL
   ============================================================ */
.shopping-item,
.historial-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  margin-bottom: 8px;
}
.historial-item a {
  color: var(--color-heading);
}
.historial-item a:hover {
  color: var(--color-primary-dark);
}
.shopping-item.is-done {
  opacity: 0.55;
  text-decoration: line-through;
}
.shopping-check,
.shopping-item input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

/* ============================================================
   SEMAFORO
   ============================================================ */
.semaforo-dot { font-size: 0.85rem; }
.semaforo-green  { color: #2e7d32; }
.semaforo-yellow { color: #c9a227; }
.semaforo-red    { color: #c62828; }

/* ============================================================
   EMPTY / MISC
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--color-muted);
}

.menu-row.card,
.menu-row.card-body {
  background: #fffaf2;
  border-color: var(--color-border);
}

.alert-info {
  background: var(--c-blue-light);
  border-color: var(--color-border);
  color: var(--color-text);
}
.alert-warning {
  background: var(--c-amber-light);
  border-color: #e8c97a;
  color: var(--color-text);
}
.alert-success {
  background: var(--c-green-light);
  border-color: var(--c-green-mid);
  color: var(--c-green-dark);
}
.alert-danger {
  background: #fde8e8;
  border-color: #e0a8a8;
  color: var(--color-alert);
}

/* Autocomplete */
.ingredient-autocomplete-list,
.ingredient-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  margin-top: 2px;
  border-radius: .375rem;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}
.ingredient-autocomplete-wrap,
.ingredient-suggest-wrap { position: relative; }

/* ============================================================
   COOK MODE
   ============================================================ */
.cook-mode-body {
  background: #2a241c;
  color: #f3f5f2;
  min-height: 100vh;
  margin: 0;
  padding-bottom: 0;
  background-image: none;
}
.cook-mode { min-height: 100vh; }
.cook-header {
  background: #3d3428;
  padding: 1rem 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky;
  top: 0;
  z-index: 10;
}
.cook-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin: 0.75rem 0 0.25rem;
  color: #fff;
  font-weight: 600;
}
.cook-body { padding: 1.25rem 10px; max-width: var(--app-max); margin: 0 auto; }
.cook-panel {
  background: #3d3428;
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 1px solid rgba(255,255,255,.06);
}
.cook-ings .cook-ing-item { padding: 0.4rem 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.cook-ings .cook-ing-item.is-done { opacity: 0.45; text-decoration: line-through; }
.cook-timer-display {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
}
.cook-step { display: none; gap: 1rem; align-items: flex-start; }
.cook-step.is-active { display: flex; }
.cook-step-body { font-size: 1.15rem; line-height: 1.55; flex: 1; }

/* Multi-select con checkboxes (relaciones) */
.ms-check-dropdown {
  position: relative;
}
.ms-check-toggle {
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-check-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow-y: auto;
  background: #f7efde;
  border: 1px solid rgba(160, 107, 52, 0.45);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.4rem 0;
}
.ms-check-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.85rem;
  margin: 0;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--color-heading);
}
.ms-check-option:hover {
  background: rgba(196, 90, 58, 0.1);
}
.ms-check-option input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

/* Menú de evento: secciones + chips de platos */
.menu-section .menu-section-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  border-top: 1px solid rgba(160, 107, 52, 0.2);
  margin-top: 0.45rem;
  padding-top: 0.55rem;
  list-style: none;
  margin-bottom: 0;
  padding-left: 0;
}
.menu-section .menu-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  background: #fff;
  border-radius: 999px;
  margin: 0;
  padding: 0.2rem 0.25rem 0.2rem 0.65rem;
  border: 1px solid rgba(160, 107, 52, 0.28);
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.05);
}
.menu-section .menu-item-label {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-heading);
  line-height: 1.2;
}
.menu-section .menu-item-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #8b6914;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}
.menu-section .menu-item-remove:hover {
  background: rgba(192, 57, 43, 0.12);
  color: #c0392b;
}
.menu-section .menu-add-item {
  min-width: 2rem;
}

/* Compartir recetas */
.profile-share-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.share-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.share-status-badge.is-kobook {
  color: #2f5d3a;
  background: rgba(92, 138, 107, 0.18);
}
.share-status-badge.is-external {
  color: #6b5a3e;
  background: rgba(166, 124, 58, 0.16);
}
.share-check-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 50vh;
  overflow-y: auto;
}
.share-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  margin: 0;
}
.share-check-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
.share-check-item.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.share-check-item input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.share-check-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.share-check-name {
  font-weight: 500;
}
.recipe-shared-badge {
  text-align: center;
  color: var(--color-primary, #5C8A6B);
  font-size: 0.85rem;
  font-weight: 600;
}
.recipe-shared-badge--inline {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary, #5C8A6B);
}

@media (max-width: 380px) {
  .cta-hub { gap: 8px; }
  .cta-hub a { font-size: 0.7rem; padding: 10px 8px; gap: 6px; }
  .cta-hub a i { font-size: 1.1rem; }
  .brand-title { font-size: 2rem; }
}

@media (min-width: 768px) {
  :root { --app-max: 960px; }
  .cta-hub a { font-size: 0.9rem; min-height: 60px; padding: 14px 14px; }
  .cta-hub a i { font-size: 1.4rem; }
}

@media print {
  .bottom-nav, .navbar, .footer, .page-header .btn, form .btn { display: none !important; }
  body { padding-bottom: 0; background: #fff; }
  body::before { display: none; }
  .shopping-list { font-size: 14pt; }
}
