:root {
  --paper: #FBF4E6;
  --paper-alt: #F3E7D0;
  --paper-soft: #FFFDF8;
  --ink: #221D18;
  --ink-muted: #5C5247;
  --sage: #1F3528;
  --sage-mid: #32523F;
  --sage-soft: #E7F0E8;
  --terracotta: #C4552D;
  --terracotta-dark: #9D3F1E;
  --terracotta-soft: #FAEBE4;
  --ochre: #D69630;
  --ochre-soft: #FBF2DC;
  --rule: #DBCDB6;
  --rule-strong: #AD9A7E;
  --safe: #256440;
  --mod: #9B6412;
  --ban: #A8322E;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Guarda 2D artesanal de libro ilustrado (cero choque de perspectiva 3D) */
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  caret-color: var(--terracotta);
  background-color: var(--sage);
  background-image:
    linear-gradient(rgba(31, 53, 40, 0.24), rgba(31, 53, 40, 0.28)),
    url("assets/v4_bg_botanico_2d.webp");
  background-size: 720px auto;
  background-repeat: repeat;
  background-position: center top;
}

::selection {
  background-color: #EBD4B4;
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

button,
input,
select {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.mono-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Todas las acuarelas tienen punto blanco RGB(255,255,255) puro: multiply funde con ΔE = 0 sin recuadros */
.blend-img {
  display: block;
  max-width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

/* Ilustraciones exportadas con transparencia RGBA real limpia (0 % destello blanco al cambiar de pestaña) */
.rgba-art-img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- ANIMACIONES SUAVES SIN OPACITY EN PANELES PARA NO AISLAR MULTIPLY --- */
@keyframes dogSwap {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 1;
  }
}

.dog-vignette-img.is-swapping {
  animation: dogSwap 0.28s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .dog-vignette-img.is-swapping {
    animation: none !important;
    transition: none !important;
  }
}

/* --- OCULTACIÓN ESTRICTA --- */
.app-shell[hidden],
.gate-screen[hidden],
.view-panel[hidden],
.empty-illustrated[hidden],
.empty-state[hidden],
.recipe-reader[hidden],
#recipeCatalogView[hidden],
#shoppingProgressWrap[hidden] {
  display: none !important;
}

/* --- PANTALLA DE ACCESO VIP --- */
.gate-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.gate-spread {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.35rem;
  align-items: center;
  padding: 2.15rem 2.35rem;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at center, rgba(255, 253, 248, 0.85) 45%, rgba(239, 223, 194, 0.72) 100%),
    url("assets/v4_pergamino_limpio.webp");
  background-size: cover;
  background-position: center;
  border: 2px solid var(--ochre);
  outline: 1px solid rgba(31, 53, 40, 0.35);
  outline-offset: -8px;
  box-shadow: 0 22px 54px rgba(10, 20, 14, 0.42);
}

.gate-art-col {
  display: flex;
  justify-content: center;
}

.cover-art-frame {
  width: 100%;
  max-width: 360px;
  padding: 0.4rem;
  background-color: var(--sage);
  border: 1.5px solid var(--ochre);
}

.gate-cover-img {
  display: block;
  width: 100%;
  height: auto;
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.05rem;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--terracotta);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.38rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-edition {
  font-size: 0.78rem;
  color: rgba(251, 244, 230, 0.82);
  border-left: 1px solid rgba(251, 244, 230, 0.35);
  padding-left: 0.5rem;
}

.gate-book h1 {
  margin: 0 0 0.7rem;
  font-family: var(--font-serif);
  font-size: 2.15rem;
  font-weight: 600;
  line-height: 1.12;
  color: var(--sage);
}

.gate-book p {
  margin: 0 0 1.35rem;
  color: var(--ink-muted);
  font-size: 0.96rem;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sage);
  margin-bottom: 0.35rem;
}

.input-line {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  background-color: var(--paper-soft);
  border: 1.5px solid var(--rule);
  border-radius: 3px;
  font-size: 1rem;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.input-line:focus {
  border-color: var(--terracotta);
  background-color: #FFFFFF;
  outline: none;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  background-color: var(--terracotta);
  color: #FFFDF8;
  border: 1.5px solid var(--terracotta-dark);
  border-radius: 3px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background-color 0.16s ease, transform 0.12s ease;
}

.btn-primary:hover {
  background-color: var(--terracotta-dark);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.5rem 0.95rem;
  background-color: var(--paper-soft);
  color: var(--sage);
  border: 1.5px solid var(--rule-strong);
  border-radius: 3px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--sage);
  background-color: var(--paper-alt);
}

.btn-text {
  background: transparent;
  border: 0;
  padding: 0.35rem 0.2rem;
  color: var(--terracotta);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gate-error {
  min-height: 1.25rem;
  margin: 0;
  font-size: 0.88rem;
  color: var(--ban);
}

/* --- CUADERNO ABIERTO INTEGRADO SOBRE GUARDA BOTÁNICA 2D --- */
.app-shell {
  min-height: 100dvh;
  padding: 1.65rem 1.75rem 2.5rem;
}

.mobile-header {
  display: none;
}

.notebook-frame {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: calc(100dvh - 4rem);
  background: linear-gradient(90deg, var(--sage) 248px, var(--paper) 248px);
  border: 2px solid var(--ochre);
  box-shadow: 0 24px 60px rgba(10, 20, 14, 0.44);
}

/* Lomo lateral editorial continuo de arriba a abajo */
.sidebar {
  padding: 1.85rem 1.3rem;
  background-color: var(--sage);
  color: var(--paper);
  border-right: 2px solid var(--ochre);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-sticky-top {
  position: sticky;
  top: 1.85rem;
}

.sidebar .brand-mark {
  color: var(--ochre);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-nav {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.sidebar-btn {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(251, 244, 230, 0.84);
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.sidebar-btn:hover {
  color: #FFFFFF;
  background-color: rgba(251, 244, 230, 0.1);
}

.sidebar-btn.is-active {
  color: var(--ink);
  font-weight: 700;
  background-color: var(--paper);
  border-color: var(--ochre);
}

.sidebar-btn-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-count {
  font-size: 0.8rem;
  padding: 0.08rem 0.4rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: 0.9;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding-top: 1.1rem;
  border-top: 1px solid rgba(214, 150, 48, 0.45);
  font-size: 0.84rem;
  color: rgba(251, 244, 230, 0.86);
}

.sidebar-profile-line strong {
  color: var(--ochre);
}

.sidebar-note {
  margin-top: 0.45rem;
  font-size: 0.77rem;
  opacity: 0.8;
  line-height: 1.45;
}

/* Página principal sobre papel de acuarela cálido continuo (sin hojas repetidas detrás del texto) */
.main-content {
  padding: 1.6rem clamp(1.4rem, 3.2vw, 2.85rem) 3.25rem;
  min-width: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 253, 248, 0.78) 0%, rgba(251, 244, 230, 0.4) 65%, rgba(238, 221, 191, 0.55) 100%),
    url("assets/v4_pergamino_limpio.webp");
  background-size: 100% 100%, 900px auto;
  background-repeat: no-repeat, repeat;
  outline: 1px solid rgba(214, 150, 48, 0.55);
  outline-offset: -10px;
}

/* --- CABECERA EDITORIAL SIMÉTRICA FUNDIDA EN EL PAPEL (CERO BANNER RECORTADO) --- */
.editorial-crest-header {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 1.75rem;
}

.crest-garland-img {
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 0 auto 0.45rem;
}

.editorial-crest-header h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 2.7vw, 2.3rem);
  font-weight: 600;
  line-height: 1.12;
  color: var(--sage);
}

.view-lead {
  margin: 0.45rem auto 0;
  color: var(--ink-muted);
  font-size: 0.96rem;
  max-width: 62ch;
  text-align: center;
}

.ornamental-divider {
  margin: 0.95rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  max-width: 440px;
}

.ornamental-divider span {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--ochre), transparent);
}

.ornamental-divider i {
  width: 7px;
  height: 7px;
  background-color: var(--terracotta);
  transform: rotate(45deg);
  display: inline-block;
}

/* --- CALCULADORA SIMÉTRICA CON ESCENA ACUARELA INTEGRADA --- */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.dog-stage-vignette {
  margin-bottom: 1.35rem;
  text-align: center;
}

.dog-vignette-canvas {
  padding: 0.25rem 0.5rem 0.1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dog-vignette-img {
  width: 100%;
  max-width: 390px;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.dog-vignette-ribbon {
  margin-top: 0.25rem;
  background-color: var(--sage);
  color: var(--paper);
  padding: 0.52rem 1rem;
  border: 1.5px solid var(--ochre);
  border-radius: 2px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}

.dog-size-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 500;
  color: #FFFDF8;
}

.dog-size-sub {
  font-size: 0.8rem;
  color: #F4DCA8;
}

.control-group {
  margin-bottom: 1.1rem;
}

.weight-row {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 0.85rem;
  align-items: center;
}

.weight-input {
  min-height: 46px;
  padding: 0.45rem 0.75rem;
  background-color: var(--paper-soft);
  border: 1.5px solid var(--rule-strong);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
}

.unit-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid var(--sage);
  border-radius: 3px;
  overflow: hidden;
  max-width: 164px;
}

.unit-btn {
  min-height: 44px;
  border: 0;
  background: var(--paper-soft);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--sage);
}

.unit-btn.is-active {
  background-color: var(--sage);
  color: #FFFDF8;
}

.range-slider {
  width: 100%;
  margin-top: 0.65rem;
  accent-color: var(--terracotta);
  cursor: pointer;
}

.segmented-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.segmented-row.two-cols {
  grid-template-columns: repeat(2, 1fr);
}

.seg-btn {
  min-height: 44px;
  padding: 0.45rem 0.5rem;
  background-color: var(--paper-soft);
  border: 1.5px solid var(--rule);
  border-radius: 3px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-muted);
  transition: all 0.15s ease;
}

.seg-btn:hover {
  border-color: var(--sage);
  color: var(--sage);
}

.seg-btn.is-active {
  background-color: var(--sage);
  border-color: var(--sage);
  color: #FFFDF8;
}

.calc-actions {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.inline-feedback {
  font-size: 0.88rem;
  color: var(--safe);
  font-weight: 600;
}

/* Hoja de resultados */
.results-sheet {
  padding: 1.5rem;
  background-color: var(--paper-soft);
  border: 1.5px solid var(--sage);
  outline: 1px solid var(--ochre);
  outline-offset: -6px;
}

.total-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1.5px solid var(--rule);
}

.total-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--sage);
}

.total-grams {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.15rem, 3.6vw, 2.8rem);
  font-weight: 600;
  color: var(--terracotta);
  line-height: 1.05;
}

.bowl-wheel-hero {
  width: 112px;
  height: 112px;
  object-fit: contain;
  flex-shrink: 0;
}

.per-meal-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.96rem;
}

.per-meal-line strong {
  font-family: var(--font-mono);
  font-size: 1.22rem;
  color: var(--sage);
}

.ratio-visual {
  padding: 0.85rem 0 0.95rem;
  border-bottom: 1px solid var(--rule);
}

.ratio-bar {
  height: 12px;
  display: flex;
  gap: 3px;
  overflow: hidden;
  border-radius: 2px;
}

.ratio-seg {
  display: block;
  height: 100%;
}

.ratio-prot { background-color: var(--terracotta); }
.ratio-veg { background-color: var(--sage-mid); }
.ratio-carb { background-color: var(--ochre); }

.ratio-legend {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 0.35rem;
  border-radius: 1px;
}

.sw-prot { background-color: var(--terracotta); }
.sw-veg { background-color: var(--sage-mid); }
.sw-carb { background-color: var(--ochre); }

.portion-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.45rem;
}

.portion-table th {
  padding: 0.6rem 0;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sage);
  border-bottom: 1.5px solid var(--rule);
}

.portion-table th.num,
.portion-table td.num {
  text-align: right;
  white-space: nowrap;
}

.portion-table td {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
  font-size: 0.93rem;
}

.table-ing-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.table-mini-art {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
}

.portion-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.culinary-note {
  margin-top: 1.05rem;
  padding: 0.8rem 0.95rem;
  background-color: var(--paper-alt);
  border-top: 1.5px solid var(--ochre);
  font-size: 0.84rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* --- SEMÁFORO ILUSTRADO 1:1 SIN RECUADROS INTERNOS --- */
.semaforo-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  margin-bottom: 1.4rem;
}

.sem-art-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.85rem 0.95rem;
  border-radius: 3px;
  text-align: left;
  border: 1.5px solid var(--rule);
  background-color: var(--paper-soft);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.sem-art-card.is-safe { border-top: 3px solid var(--safe); }
.sem-art-card.is-mod { border-top: 3px solid var(--mod); }
.sem-art-card.is-ban { border-top: 3px solid var(--ban); }

.sem-art-card:hover {
  transform: translateY(-2px);
  border-color: var(--sage);
}

.sem-art-card.is-active {
  border-color: var(--sage);
  background-color: var(--ochre-soft);
}

.sem-art-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  margin-bottom: 0.45rem;
}

.sem-art-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.45rem;
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
}

.semaforo-controls-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.85rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 1.25rem;
}

.quick-link-btn {
  background: transparent;
  border: 0;
  padding: 0.15rem 0;
  color: var(--terracotta);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.underline-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  border-bottom: 1.5px solid var(--rule);
  margin-bottom: 1.35rem;
}

.tab-btn {
  background: transparent;
  border: 0;
  border-bottom: 2.5px solid transparent;
  padding: 0.65rem 0.15rem;
  margin-bottom: -1.5px;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.tab-btn.is-active {
  color: var(--sage);
  border-bottom-color: var(--terracotta);
}

.food-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.05rem;
}

/* El alimento ilustrado se apoya directo sobre el papel sin caja gris interna */
.food-row {
  padding: 0.95rem 1.05rem;
  border: 1.5px solid var(--rule);
  background-color: var(--paper-soft);
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0.95rem;
  align-items: center;
}

.food-art-wrap {
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.food-art-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.status-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-square {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 1px;
  flex-shrink: 0;
}

.status-seguro { color: var(--safe); }
.status-seguro .status-square { background-color: var(--safe); }

.status-moderacion { color: var(--mod); }
.status-moderacion .status-square { background-color: var(--mod); }

.status-prohibido { color: var(--ban); }
.status-prohibido .status-square { background-color: var(--ban); }

.food-name {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 600;
  margin: 0.18rem 0 0;
  color: var(--sage);
}

.food-synonyms {
  font-size: 0.79rem;
  color: var(--ink-muted);
}

.food-prep {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.44;
}

/* --- RECETARIO: TARJETAS UNIFICADAS SIN BANDA BEIGE NI REPETICIONES --- */
.filter-bar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.recipe-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.35rem;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--rule);
  background-color: var(--paper-soft);
  padding: 1.05rem 1.15rem 1.1rem;
  transition: border-color 0.16s ease, transform 0.15s ease;
}

.recipe-card:hover {
  border-color: var(--sage);
  transform: translateY(-2px);
}

/* Mismo fondo exacto de la tarjeta + imagen punto blanco 255 = CERO recuadro */
.recipe-card-art-band {
  padding: 0.2rem 0.5rem 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}

.recipe-thumb {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.recipe-card-body {
  padding-top: 0.85rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  text-align: center;
}

.recipe-row-btn {
  background: transparent;
  border: 0;
  padding: 0;
  width: 100%;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--sage);
  line-height: 1.22;
}

.recipe-row-btn:hover {
  color: var(--terracotta);
}

.recipe-meta {
  margin-top: 0.32rem;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.recipe-row-actions {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
}

.specials-block {
  margin-top: 2.35rem;
  padding-top: 1.4rem;
  border-top: 2px solid var(--sage);
}

.section-heading {
  margin: 0 0 0.4rem;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--sage);
}

.oto-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}

.oto-row h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--sage);
}

.oto-sample-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 0.85rem 0 0.35rem;
}

/* --- LECTOR DE RECETA 1:1 SIMÉTRICO EN ALTA RESOLUCIÓN --- */
.reader-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid var(--rule);
  margin-bottom: 1.35rem;
}

.reader-hero-spread {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.65rem;
  align-items: center;
  margin-bottom: 1.75rem;
  padding: 1.25rem 1.4rem;
  border: 1.5px solid var(--sage);
  outline: 1px solid var(--ochre);
  outline-offset: -6px;
  background-color: var(--paper-soft);
}

.reader-hero-art {
  display: flex;
  justify-content: center;
}

.reader-art-img {
  width: 100%;
  max-width: 325px;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.reader-hero-info h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.5vw, 2.05rem);
  font-weight: 600;
  line-height: 1.14;
  color: var(--sage);
}

.reader-meta-line {
  font-size: 0.91rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.kitchen-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.timer-ring {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.timer-ring-bg {
  fill: none;
  stroke: var(--rule);
  stroke-width: 3;
}

.timer-ring-fg {
  fill: none;
  stroke: var(--terracotta);
  stroke-width: 3.2;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s linear;
}

.timer-info {
  display: flex;
  flex-direction: column;
}

.timer-readout {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--terracotta);
  line-height: 1.1;
}

.reader-ingredients-block {
  margin-bottom: 1.85rem;
}

.reader-col-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 600;
  color: var(--sage);
  border-bottom: 1.5px solid var(--ochre);
  padding-bottom: 0.32rem;
}

/* Grilla de ingredientes simétrica según cantidad (2 -> 2 cols, 3 -> 3 cols, 4 -> 2x2) */
.ingredient-list-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.ingredient-list-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.ingredient-list-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.ingredient-list-grid li {
  padding: 0.8rem 0.95rem;
  border: 1.5px solid var(--rule);
  background-color: var(--paper-soft);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ing-mini-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.ing-text-wrap {
  min-width: 0;
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.32;
}

.ing-text-wrap strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--terracotta);
  font-size: 0.98rem;
  white-space: nowrap;
}

/* Grilla 2x2 estrictamente simétrica de pasos ilustrados en HD */
.steps-visual-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.step-visual-card {
  border: 1.5px solid var(--rule);
  background-color: var(--paper-soft);
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1rem 1rem;
}

.step-art-frame {
  padding: 0.15rem 0.35rem 0.65rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: center;
  align-items: center;
}

.step-art-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.step-card-body {
  padding-top: 0.75rem;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 0.65rem;
  align-items: start;
}

.step-num-badge {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  color: #FFFDF8;
  background-color: var(--terracotta);
  text-align: center;
  padding: 0.2rem 0;
  border-radius: 2px;
}

.step-card-text {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.48;
  color: var(--ink);
}

.steps-list {
  margin: 0;
  padding-left: 1.25rem;
}

.steps-list li {
  padding: 0.35rem 0;
}

/* --- LISTA DE COMPRAS --- */
.shopping-header-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid var(--rule);
  margin-bottom: 1rem;
}

.shopping-progress-wrap {
  margin-bottom: 1.25rem;
  padding: 0.9rem 1.05rem;
  border: 1.5px solid var(--sage);
  background-color: var(--sage-soft);
}

.shopping-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sage);
  margin-bottom: 0.45rem;
}

.shopping-progress-track {
  height: 10px;
  background-color: var(--paper-soft);
  border: 1px solid var(--sage);
  border-radius: 2px;
  overflow: hidden;
}

.shopping-progress-fill {
  height: 100%;
  background-color: var(--terracotta);
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.selected-recipes-list {
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
}

.selected-recipe-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.94rem;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--sage);
  background: var(--paper-soft);
  border-radius: 2px;
  font-weight: 700;
  color: var(--sage);
}

.aisle-section {
  margin-bottom: 1.5rem;
}

.aisle-section h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--sage);
  border-bottom: 1.5px solid var(--ochre);
  padding-bottom: 0.3rem;
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  transition: opacity 0.18s ease;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  flex: 1;
}

.check-box {
  width: 19px;
  height: 19px;
  accent-color: var(--sage);
  cursor: pointer;
}

.check-item.is-checked {
  opacity: 0.62;
}

.check-item.is-checked .check-text {
  text-decoration: line-through;
  color: var(--ink-muted);
}

.empty-illustrated {
  text-align: center;
  padding: 2rem 1.25rem;
  border: 1.5px solid var(--sage);
  outline: 1px solid var(--ochre);
  outline-offset: -6px;
  background-color: var(--paper-soft);
  max-width: 520px;
  margin: 1rem auto;
}

.empty-bag-img {
  width: 185px;
  margin: 0 auto 0.75rem;
}

.empty-illustrated h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: 1.38rem;
  font-weight: 600;
  color: var(--sage);
}

.empty-illustrated p {
  margin: 0 0 1.1rem;
  color: var(--ink-muted);
  font-size: 0.94rem;
}

.empty-state {
  padding: 1.75rem 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
  text-align: center;
}

.bottom-nav {
  display: none;
}

/* --- ADAPTACIÓN MÓVIL (< 900px) --- */
@media (max-width: 899px) {
  .gate-screen {
    padding: 1rem;
  }

  .gate-spread {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .cover-art-frame {
    max-width: 240px;
  }

  .app-shell {
    padding: 0;
  }

  .notebook-frame {
    grid-template-columns: 1fr;
    border: 0;
    box-shadow: none;
    min-height: 100dvh;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.05rem;
    background-color: var(--sage);
    color: var(--paper);
    border-bottom: 2px solid var(--ochre);
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .mobile-header .brand-mark {
    color: var(--ochre);
  }

  .weight-tag {
    font-size: 0.85rem;
    color: #F4DCA8;
    font-weight: 600;
  }

  .main-content {
    padding: 1rem 1rem 5.75rem;
    outline: 0;
  }

  .crest-garland-img {
    max-width: 100%;
  }

  .calc-layout,
  .reader-hero-spread,
  .food-list,
  .recipe-grid,
  .ingredient-list-grid,
  .ingredient-list-grid.cols-2,
  .ingredient-list-grid.cols-3,
  .steps-visual-grid,
  .oto-sample-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .semaforo-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .sem-art-card {
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
  }

  .sem-art-img {
    width: 96px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .sem-art-foot {
    flex: 1;
    border-top: 0;
    padding-top: 0;
  }

  .semaforo-controls-bar,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .dog-vignette-ribbon {
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background-color: var(--sage);
    border-top: 2px solid var(--ochre);
  }

  .bottom-nav-btn {
    padding: 0.55rem 0.25rem;
    background: transparent;
    border: 0;
    color: rgba(251, 244, 230, 0.78);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.74rem;
    font-weight: 600;
  }

  .bottom-nav-btn.is-active {
    color: #FFFDF8;
    background-color: rgba(214, 150, 48, 0.22);
  }
}
