:root {
  --bg: #24150f;
  --bg-deep: #1b100b;
  --panel: #5a4031;
  --panel-2: #674b39;
  --panel-3: #735341;
  --panel-dark: #3d291f;
  --titlebar: #7a5138;
  --titlebar-2: #593527;
  --field: #d9c0a1;
  --field-2: #cbae88;
  --text: #f7ead8;
  --text-soft: #e4cfb2;
  --muted: #c4ab90;
  --accent: #efbc78;
  --accent-2: #c98c46;
  --good: #cde38e;
  --danger: #f1a69d;
  --edge-light: #a47a5a;
  --edge-mid: #7b5840;
  --edge-dark: #2c1b13;
  --shadow: rgba(0, 0, 0, 0.28);
  --radius-sm: 4px;
  --radius-md: 6px;
  --nav-height: 72px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(227, 179, 109, 0.08), transparent 28%),
    linear-gradient(180deg, #322018 0%, #2b1b14 100%);
  padding: 10px 10px calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 6px 6px, 6px 6px;
}

body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
a { color: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 1px dotted #1e130e;
  outline-offset: -3px;
}

.app-shell {
  width: min(100%, 1040px);
  margin: 0 auto;
}

.hero-card,
.main-panel,
.stat-card,
.sheet,
.calculated-card,
.recipe-card,
.quick-tips,
.info-grid article,
.home-result,
.steps-list li,
.mini-disclosure,
.empty-list,
.form-total,
.ingredient-field,
.ingredient-row,
.mini-value,
.objective,
.tip-pill,
.toast,
.bottom-nav {
  background: var(--panel);
  border-top: 1px solid var(--edge-light);
  border-left: 1px solid var(--edge-light);
  border-right: 1px solid var(--edge-dark);
  border-bottom: 1px solid var(--edge-dark);
  box-shadow: 1px 1px 0 var(--edge-mid), 0 8px 18px var(--shadow);
}

.hero-card,
.main-panel,
.sheet,
.quick-tips,
.toast { position: relative; }

.hero-card::before,
.main-panel::before,
.sheet::before,
.quick-tips::before,
.stat-card::before,
.calculated-card::before,
.recipe-card::before,
.info-grid article::before {
  content: "";
  display: block;
  height: 22px;
  margin: -10px -10px 10px;
  padding: 0 8px;
  background: linear-gradient(180deg, var(--titlebar), var(--titlebar-2));
  border-bottom: 1px solid var(--edge-dark);
}

.hero-card,
.main-panel,
.sheet,
.quick-tips,
.calculated-card,
.recipe-card,
.info-grid article,
.home-result,
.mini-disclosure,
.empty-list,
.form-total,
.steps-list li,
.ingredient-field,
.ingredient-row,
.tip-pill,
.toast,
.bottom-nav {
  border-radius: var(--radius-sm);
}

.hero-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.hero-art {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  background: #4b3327;
  border-top: 1px solid #a47a5a;
  border-left: 1px solid #a47a5a;
  border-right: 1px solid #2c1b13;
  border-bottom: 1px solid #2c1b13;
  border-radius: 3px;
  overflow: hidden;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 6px;
  color: #fff7eb;
  line-height: 1.05;
  font-size: clamp(1.6rem, 7vw, 2.5rem);
}
h2 {
  margin-bottom: 6px;
  color: #fff0dc;
  font-size: clamp(1.15rem, 5vw, 1.7rem);
  line-height: 1.1;
}
h3 {
  margin-bottom: 4px;
  color: #fff0de;
  font-size: 1rem;
}
p {
  color: var(--text-soft);
  line-height: 1.38;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.stat-card {
  min-height: 88px;
  padding: 10px;
}
.stat-card::before { margin: -10px -10px 8px; }
.stat-icon {
  display: inline-block;
  color: var(--accent);
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 2px;
}
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.stat-card strong {
  display: block;
  color: #fff8ef;
  font-size: 1.28rem;
  line-height: 1.15;
}
.stat-card strong.good {
  color: var(--good);
  font-size: 0.95rem;
}

.main-panel { padding: 10px; }
.panel-head,
.sheet-head,
.result-head,
.recipe-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button,
.edit-button,
.delete-button,
.chip,
.bottom-nav button,
.action-card,
.card-actions button {
  appearance: none;
  border-top: 1px solid var(--edge-light);
  border-left: 1px solid var(--edge-light);
  border-right: 1px solid var(--edge-dark);
  border-bottom: 1px solid var(--edge-dark);
  background: linear-gradient(180deg, var(--panel-3), var(--panel-dark));
  color: var(--text);
  border-radius: 3px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.08);
}

.icon-button:active,
.primary-button:active,
.secondary-button:active,
.danger-button:active,
.edit-button:active,
.delete-button:active,
.chip:active,
.bottom-nav button:active,
.action-card:active,
.card-actions button:active {
  border-top: 1px solid var(--edge-dark);
  border-left: 1px solid var(--edge-dark);
  border-right: 1px solid var(--edge-light);
  border-bottom: 1px solid var(--edge-light);
  box-shadow: inset 1px 1px 0 rgba(0,0,0,0.16);
  transform: translate(1px, 1px);
}

.icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: bold;
}

.home-result {
  margin: 10px 0 12px;
  padding: 10px;
}
.home-result::before { content: none; }
.home-result.empty-state {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
}
.home-result img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.ingredient-list { display: grid; gap: 8px; }
.ingredient-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
}
.ingredient-row::before { content: none; }
.ingredient-row img { width: 24px; height: 24px; }
.ingredient-row span { display: block; font-weight: bold; color: #fff1de; }
.ingredient-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.ingredient-row strong { color: var(--accent); white-space: nowrap; }

.primary-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.action-card {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  text-align: left;
  padding: 10px;
}
.action-card span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: #4e3528;
  border-top: 1px solid var(--edge-light);
  border-left: 1px solid var(--edge-light);
  border-right: 1px solid var(--edge-dark);
  border-bottom: 1px solid var(--edge-dark);
  border-radius: 2px;
  font-size: 1rem;
}
.action-card strong { color: #fff6e8; font-size: 0.98rem; }
.action-card small { color: var(--muted); font-size: 12px; }
.action-card.featured { background: linear-gradient(180deg, #75503b, #4f3427); }

.quick-tips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  margin-top: 10px;
  scrollbar-width: none;
}
.quick-tips::before { content: none; }
.quick-tips::-webkit-scrollbar { display: none; }
.tip-pill {
  flex: 0 0 auto;
  padding: 8px 10px;
  white-space: nowrap;
  color: #28170f;
  background: linear-gradient(180deg, #efc388, #c98e4b);
  box-shadow: 1px 1px 0 #7a583f;
  font-size: 12px;
  font-weight: bold;
}

.bottom-nav {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  background: #4b3428;
}
.bottom-nav::before { content: none; }
.bottom-nav button {
  min-width: 0;
  padding: 4px 2px;
  font-size: 11px;
  font-weight: bold;
  display: grid;
  place-items: center;
  gap: 2px;
  text-align: center;
}
.bottom-nav button span { font-size: 1rem; }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 80;
}
.modal.is-open { display: block; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 12, 8, 0.7);
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(92svh, 980px);
  overflow-y: auto;
  padding: 10px 10px calc(14px + env(safe-area-inset-bottom));
  background: #5a4031;
  animation: sheetIn 150ms ease-out;
}
@keyframes sheetIn {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet::before {
  content: "CHOCOLATE TOOL";
  display: flex;
  align-items: center;
  height: 22px;
  margin: -10px -10px 10px;
  padding: 0 8px;
  color: #ffe4bd;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  background: linear-gradient(180deg, var(--titlebar), var(--titlebar-2));
  border-bottom: 1px solid var(--edge-dark);
}
.sheet-handle { display: none; }

.stacked-form { display: grid; gap: 10px; margin-top: 10px; }
.form-grid { display: grid; gap: 8px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 4px; }
.field.full { grid-column: 1 / -1; }
.field span,
.search-box span {
  color: var(--text);
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.field small,
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: #2c1b13;
  background: linear-gradient(180deg, var(--field), var(--field-2));
  border-top: 1px solid var(--edge-dark);
  border-left: 1px solid var(--edge-dark);
  border-right: 1px solid #f4dfc1;
  border-bottom: 1px solid #f4dfc1;
  border-radius: 3px;
  font-size: 16px;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #4d2d1f 50%),
    linear-gradient(135deg, #4d2d1f 50%, transparent 50%),
    linear-gradient(180deg, var(--field), var(--field-2));
  background-position: calc(100% - 18px) 17px, calc(100% - 12px) 17px, 0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.input-unit { position: relative; }
.input-unit input { padding-right: 56px; }
.input-unit em {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #4b2b1d;
  font-style: normal;
  font-weight: bold;
  pointer-events: none;
  font-size: 12px;
}

.primary-button,
.secondary-button,
.danger-button,
.edit-button,
.delete-button {
  min-height: 38px;
  padding: 0 12px;
  font-weight: bold;
}
.primary-button {
  width: 100%;
  color: #2f1b12;
  background: linear-gradient(180deg, #efc488, #c58645);
}
.secondary-button { color: var(--text); }
.danger-button,
.delete-button {
  color: #2c110d;
  background: linear-gradient(180deg, #e9a098, #c36a5c);
}
.edit-button {
  color: #2e1a11;
  background: linear-gradient(180deg, #f1cf9e, #d09a57);
}

.tool-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none;
}
.tool-row::-webkit-scrollbar { display: none; }
.tool-row > * { flex: 0 0 auto; }
.file-button {
  display: inline-grid;
  place-items: center;
}
.file-button input { display: none; }
.search-box { display: grid; gap: 4px; margin: 4px 0 10px; }

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: bold;
}

.mini-disclosure {
  padding: 10px;
}
.mini-disclosure::before { content: none; }
.mini-disclosure summary {
  color: #fff0db;
  font-weight: bold;
  cursor: pointer;
}
.compact-top { margin-top: 10px; }

.calculated-card {
  margin-top: 12px;
  padding: 10px;
}
.result-head { margin-bottom: 10px; }
.badge {
  display: inline-block;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: bold;
  color: #1f120d;
  background: linear-gradient(180deg, #d7ec9c, #adc05e);
  border-top: 1px solid #eef8cf;
  border-left: 1px solid #eef8cf;
  border-right: 1px solid #6c7a37;
  border-bottom: 1px solid #6c7a37;
  border-radius: 3px;
}
.objective {
  margin-top: 10px;
  padding: 8px 10px;
  color: #311d14;
  background: linear-gradient(180deg, #f0c98e, #d69b57);
  font-weight: bold;
}
.result-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.recipes-list { display: grid; gap: 10px; }
.recipe-card { padding: 10px; }
.recipe-top h3 { margin: 0; }
.recipe-top p { margin: 3px 0 0; font-size: 12px; }
.recipe-mix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.mini-value {
  padding: 6px 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: bold;
}
.card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.card-actions button { flex: 1 1 90px; min-height: 34px; }

.ingredient-editor { display: grid; gap: 8px; }
.ingredient-field {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px;
}
.ingredient-field img { width: 24px; height: 24px; }
.ingredient-field .input-unit { grid-column: 1 / -1; }
.form-total {
  padding: 8px 10px;
  font-weight: bold;
  color: #fff0db;
}

.steps-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
  counter-reset: step;
}
.steps-list li {
  counter-increment: step;
  position: relative;
  padding: 10px 10px 10px 42px;
  line-height: 1.4;
}
.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 10px;
  top: 10px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: bold;
  color: #2e1a11;
  background: linear-gradient(180deg, #efc488, #c88744);
  border-top: 1px solid #ffe5bd;
  border-left: 1px solid #ffe5bd;
  border-right: 1px solid #7f562f;
  border-bottom: 1px solid #7f562f;
  border-radius: 2px;
}
.steps-list strong { color: #ffe3b8; }

.info-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.info-grid article {
  padding: 10px;
  box-shadow: 1px 1px 0 var(--edge-mid);
}
.info-grid strong {
  display: block;
  color: #fff0dc;
  margin-bottom: 4px;
}
.info-grid p { margin: 0; }
.danger-zone { margin-top: 12px; }
.empty-list {
  padding: 16px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px);
  z-index: 120;
  display: none;
  padding: 10px 12px;
  color: #2d1a11;
  background: linear-gradient(180deg, #efc98e, #cf9656);
  font-weight: bold;
}
.toast::before { content: none; }
.toast.is-visible { display: block; animation: toastIn 160ms ease-out; }
@keyframes toastIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.hidden { display: none !important; }

@media (max-width: 380px) {
  body { padding-inline: 8px; }
  .hero-card { grid-template-columns: 70px 1fr; }
  .hero-art { width: 70px; height: 70px; }
  .form-grid.two,
  .recipe-mix,
  .result-actions { grid-template-columns: 1fr; }
  .card-actions { flex-direction: column; }
}

@media (min-width: 720px) {
  body { padding: 14px 14px 102px; }
  .hero-card { grid-template-columns: 120px 1fr; }
  .hero-art { width: 120px; height: 96px; }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .primary-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet {
    left: 50%;
    right: auto;
    bottom: 14px;
    width: min(700px, calc(100% - 26px));
    transform: translateX(-50%);
    max-height: min(90svh, 900px);
  }
  @keyframes sheetIn {
    from { transform: translate(-50%, 16px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
  }
  .compact-sheet { width: min(560px, calc(100% - 26px)); }
  .bottom-nav {
    left: 50%;
    right: auto;
    width: min(520px, calc(100% - 20px));
    transform: translateX(-50%);
  }
}
/* FIX HERO MOBILE: la barra old-style ya no entra como item del grid */
.hero-card {
  grid-template-columns: minmax(0, 1fr) 72px;
  min-height: auto;
  align-items: start;
  overflow: hidden;
  padding: 34px 10px 10px;
}
.hero-card::before {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 22px;
  margin: 0;
  z-index: 0;
}
.hero-copy {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.hero-art {
  grid-column: 2;
  grid-row: 1;
  width: 64px;
  height: 64px;
  justify-self: end;
  position: relative;
  z-index: 1;
}
.hero-copy p:not(.eyebrow) {
  max-width: 24rem;
  margin-bottom: 0;
}
h1 {
  font-size: clamp(1.65rem, 8vw, 2.4rem);
  line-height: 0.98;
}
@media (max-width: 380px) {
  .hero-card { grid-template-columns: minmax(0, 1fr) 58px; }
  .hero-art { width: 54px; height: 54px; }
  h1 { font-size: clamp(1.45rem, 8vw, 2rem); }
}
@media (min-width: 720px) {
  .hero-card { grid-template-columns: minmax(0, 1fr) 110px; }
  .hero-art { width: 104px; height: 82px; }
}


/* --- Integración de imágenes reales + intro animada --- */
.hero-art img { object-fit: cover; }
body.intro-mode .app-shell,
body.intro-mode .bottom-nav {
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
}
.app-shell, .bottom-nav {
  transition: opacity 420ms ease, transform 420ms ease;
}
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(248, 228, 198, 0.92) 0%, rgba(238, 214, 178, 0.96) 48%, rgba(214, 182, 145, 0.98) 100%),
    linear-gradient(180deg, #e8cfac 0%, #d5b185 100%);
  overflow: hidden;
  transition: opacity 420ms ease, visibility 420ms ease;
}
.splash-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-scene {
  position: relative;
  width: min(92vw, 560px);
  height: min(84vh, 500px);
  display: grid;
  place-items: center;
}
.splash-glow {
  position: absolute;
  width: min(86vw, 520px);
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 248, 236, 0.72), rgba(255, 248, 236, 0.12) 65%, transparent 72%);
}
.splash-product {
  position: relative;
  width: min(78vw, 400px);
  aspect-ratio: 1;
}
.splash-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(89, 48, 23, 0.25));
}
.splash-img-wrapped {
  opacity: 1;
  animation: wrappedFade 2.35s both ease-in-out;
}
.splash-img-bare {
  opacity: 0;
  transform: scale(0.92);
  animation: bareReveal 2.35s both ease-in-out;
}
.foil {
  position: absolute;
  bottom: 19%;
  width: 42%;
  height: 19%;
  opacity: 0;
  background: linear-gradient(135deg, #fce8b4 0%, #efc46a 18%, #b97a29 55%, #fce8b4 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.36);
}
.foil-left {
  left: 8%;
  clip-path: polygon(0 14%, 100% 0, 76% 100%, 0 76%);
  transform-origin: right center;
  animation: foilLeftOpen 2.35s both ease-in-out;
}
.foil-right {
  right: 8%;
  clip-path: polygon(0 0, 100% 14%, 100% 76%, 24% 100%);
  transform-origin: left center;
  animation: foilRightOpen 2.35s both ease-in-out;
}
.splash-copy {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  text-align: center;
  color: #6e4022;
  animation: copyFade 2.35s both ease-in-out;
}
.splash-copy p {
  margin: 0 0 4px;
  color: #9b6640;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 11px;
  font-weight: bold;
}
.splash-copy strong {
  font-size: clamp(1.1rem, 4.8vw, 1.55rem);
  color: #6f3f22;
}
@keyframes wrappedFade {
  0%, 28% { opacity: 1; transform: scale(0.92); }
  42% { opacity: 1; transform: scale(1); }
  56% { opacity: 0; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.12); }
}
@keyframes bareReveal {
  0%, 26% { opacity: 0; transform: scale(0.9); }
  42%, 62% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.75); }
}
@keyframes foilLeftOpen {
  0%, 24% { opacity: 0; transform: translate(0, 8%) rotate(0deg); }
  36% { opacity: 1; transform: translate(0, 0) rotate(-6deg); }
  62% { opacity: 1; transform: translate(-20%, -10%) rotate(-15deg); }
  100% { opacity: 0; transform: translate(-56%, -24%) rotate(-28deg); }
}
@keyframes foilRightOpen {
  0%, 24% { opacity: 0; transform: translate(0, 8%) rotate(0deg); }
  36% { opacity: 1; transform: translate(0, 0) rotate(6deg); }
  62% { opacity: 1; transform: translate(20%, -10%) rotate(15deg); }
  100% { opacity: 0; transform: translate(56%, -24%) rotate(28deg); }
}
@keyframes copyFade {
  0%, 12% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  25%, 66% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(10px); }
}
@media (max-width: 420px) {
  .splash-product { width: min(84vw, 350px); }
  .splash-copy { bottom: 12%; }
}


/* --- Intro simplificada con fondo transparente y recortes --- */
.hero-art { background: transparent; }
.hero-art img { object-fit: contain; }
.home-result.empty-state img { object-fit: contain; }
.splash-screen {
  background: transparent !important;
  backdrop-filter: none !important;
}
.splash-scene {
  width: min(92vw, 430px);
  height: min(76vh, 420px);
}
.splash-glow {
  display: none !important;
}
.splash-product {
  width: min(78vw, 300px);
  aspect-ratio: 1 / 1;
}
.splash-img {
  filter: drop-shadow(0 14px 20px rgba(62, 31, 15, 0.30));
}
.splash-img-wrapped {
  animation: wrappedFadeClean 1.75s both ease-in-out;
}
.splash-img-bare {
  animation: bareRevealClean 1.75s both ease-in-out;
}
.foil {
  display: none !important;
}
.splash-copy {
  bottom: 6%;
  text-shadow: 0 1px 0 rgba(255,255,255,0.28);
  animation: copyFadeClean 1.75s both ease-in-out;
}
.splash-copy p { color: #8f5a38; }
.splash-copy strong { color: #6f3f22; }
@keyframes wrappedFadeClean {
  0%, 36% { opacity: 1; transform: scale(0.92); }
  58% { opacity: 1; transform: scale(1); }
  74% { opacity: 0; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.08); }
}
@keyframes bareRevealClean {
  0%, 40% { opacity: 0; transform: scale(0.88); }
  62% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.7); }
}
@keyframes copyFadeClean {
  0%, 15% { opacity: 0; transform: translateX(-50%) translateY(8px); }
  30%, 68% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(6px); }
}
@media (max-width: 420px) {
  .splash-scene { height: min(70vh, 380px); }
  .splash-product { width: min(80vw, 280px); }
}


/* --- Ajuste de centrado y tamaño para tus recortes nuevos --- */
.hero-card {
  grid-template-columns: minmax(0, 1fr) 92px;
}
.hero-art {
  width: 92px;
  height: 62px;
  display: grid;
  place-items: center;
  justify-self: end;
  align-self: start;
  padding: 0;
  overflow: visible;
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}
.home-result.empty-state {
  grid-template-columns: 82px 1fr;
  align-items: center;
}
.home-result.empty-state img {
  width: 82px;
  height: 48px;
  object-fit: contain;
  object-position: center center;
}
.splash-scene {
  width: min(94vw, 460px);
  height: min(74vh, 410px);
}
.splash-product {
  width: min(88vw, 360px);
  aspect-ratio: auto;
  display: grid;
  place-items: center;
}
.splash-img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  object-position: center center;
}
.splash-copy {
  width: 100%;
  bottom: 2%;
  left: 50%;
}
.splash-copy p,
.splash-copy strong {
  text-align: center;
}
@media (max-width: 420px) {
  .hero-card {
    grid-template-columns: minmax(0, 1fr) 78px;
  }
  .hero-art {
    width: 78px;
    height: 52px;
  }
  .home-result.empty-state {
    grid-template-columns: 72px 1fr;
  }
  .home-result.empty-state img {
    width: 72px;
    height: 42px;
  }
  .splash-scene {
    width: min(96vw, 420px);
    height: min(70vh, 360px);
  }
  .splash-product {
    width: min(90vw, 320px);
  }
  .splash-img {
    max-height: 180px;
  }
  .splash-copy {
    bottom: 4%;
  }
}
@media (min-width: 720px) {
  .hero-card {
    grid-template-columns: minmax(0, 1fr) 122px;
  }
  .hero-art {
    width: 122px;
    height: 82px;
  }
  .splash-product {
    width: min(50vw, 430px);
  }
  .splash-img {
    max-height: 260px;
  }
}


/* --- Intro premium corta: logo arriba, tableta centrada, texto abajo --- */
body.intro-mode .app-shell,
body.intro-mode .bottom-nav {
  opacity: 0;
  transform: scale(0.99);
  pointer-events: none;
}
.splash-screen {
  background: transparent !important;
  display: grid;
  place-items: center;
}
.splash-scene.premium-intro {
  width: min(92vw, 380px);
  min-height: min(66vh, 420px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 14px;
}
.splash-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(61, 33, 18, 0.20));
  animation: premiumLogoIn 0.32s ease-out both;
}
.splash-product {
  width: min(84vw, 300px);
  display: grid;
  place-items: center;
}
.splash-img-main {
  width: 100%;
  height: auto;
  max-height: 170px;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 16px 22px rgba(66, 35, 19, 0.22));
  animation: premiumChocolateIn 0.72s cubic-bezier(.2,.9,.2,1) both;
}
.splash-copy {
  position: static;
  transform: none;
  width: 100%;
  text-align: center;
  animation: premiumCopyIn 0.48s ease-out both;
  animation-delay: 0.12s;
}
.splash-copy p {
  margin: 0 0 4px;
  color: #9a6740;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.splash-copy strong {
  display: block;
  margin: 0;
  color: #6f3f22;
  font-size: clamp(1.15rem, 5.6vw, 1.7rem);
  line-height: 1.08;
}
.splash-copy span {
  display: block;
  margin-top: 6px;
  color: #8e6142;
  font-size: 0.92rem;
}
@keyframes premiumLogoIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes premiumChocolateIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.90); }
  60% { opacity: 1; transform: translateY(0) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes premiumCopyIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 420px) {
  .splash-scene.premium-intro {
    width: min(94vw, 340px);
    min-height: min(60vh, 340px);
    gap: 10px;
  }
  .splash-logo {
    width: 48px;
    height: 48px;
  }
  .splash-product {
    width: min(86vw, 255px);
  }
  .splash-img-main {
    max-height: 140px;
  }
  .splash-copy span {
    font-size: 0.84rem;
  }
}


/* --- Ultra fina: overlay más premium, micro-zoom y salida más suave --- */
body.intro-mode {
  overflow: hidden;
}
body.intro-mode .app-shell,
body.intro-mode .bottom-nav {
  opacity: 0;
  transform: scale(1.01);
  filter: blur(6px);
  pointer-events: none;
}
.app-shell,
.bottom-nav {
  transition: opacity 520ms ease, transform 520ms ease, filter 520ms ease;
}
.splash-screen {
  background:
    radial-gradient(circle at 50% 46%, rgba(255,245,232,0.28) 0%, rgba(226,197,165,0.18) 28%, rgba(79,46,27,0.12) 68%, rgba(34,18,11,0.22) 100%) !important;
  backdrop-filter: blur(4px) saturate(1.05) !important;
}
.splash-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.06), transparent 56%),
    linear-gradient(180deg, rgba(36,20,12,0.12), rgba(0,0,0,0.14));
}
.splash-screen.is-exiting {
  opacity: 1;
}
.splash-screen.is-exiting .splash-scene {
  animation: premiumExit 360ms cubic-bezier(.22,.8,.22,1) forwards;
}
.splash-scene.premium-intro {
  position: relative;
  z-index: 1;
  gap: 16px;
}
.splash-logo {
  animation: premiumLogoIn 0.38s ease-out both, premiumFloat 2.6s ease-in-out infinite 0.5s;
}
.splash-product {
  transform-origin: center center;
}
.splash-img-main {
  animation: premiumChocolateIn 0.82s cubic-bezier(.2,.9,.2,1) both, premiumPulse 1.9s ease-in-out 0.35s 1;
}
.splash-copy {
  animation: premiumCopyIn 0.52s ease-out both;
  animation-delay: 0.18s;
}
.splash-copy strong,
.splash-copy span,
.splash-copy p {
  text-shadow: 0 1px 0 rgba(255,255,255,0.24), 0 10px 24px rgba(92,52,30,0.10);
}
@keyframes premiumFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes premiumPulse {
  0% { transform: translateY(12px) scale(0.90); }
  60% { transform: translateY(0) scale(1.02); }
  100% { transform: translateY(0) scale(1.00); }
}
@keyframes premiumExit {
  from { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  to { opacity: 0; transform: translateY(-4px) scale(1.06); filter: blur(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .splash-logo,
  .splash-img-main,
  .splash-copy,
  .splash-screen.is-exiting .splash-scene {
    animation: none !important;
  }
  .app-shell,
  .bottom-nav,
  .splash-screen {
    transition: none !important;
  }
}


/* --- Integración marca ChocoCalc --- */
.brand-wordmark {
  display: block;
  width: min(100%, 310px);
  max-height: 92px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 4px 0 rgba(45, 20, 9, 0.18));
}
.hero-card {
  grid-template-columns: minmax(0, 1fr) 92px;
}
.hero-art {
  width: 92px;
  height: 66px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  overflow: visible;
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 5px 8px rgba(42, 20, 10, 0.22));
}
.home-result.empty-state img {
  width: 78px;
  height: 56px;
  object-fit: contain;
}
.splash-scene.brand-intro {
  width: min(94vw, 620px);
  min-height: min(62vh, 390px);
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 16px;
}
.splash-brand {
  width: min(88vw, 520px);
  max-height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 16px 26px rgba(61, 31, 15, 0.24));
  animation: brandIntroIn 0.72s cubic-bezier(.2,.9,.2,1) both, brandTinyPulse 1.2s ease-in-out 0.4s 1;
}
.splash-scene.brand-intro .splash-copy {
  position: static;
  transform: none;
  text-align: center;
  animation: premiumCopyIn 0.52s ease-out both;
  animation-delay: 0.18s;
}
.splash-scene.brand-intro .splash-copy p {
  margin-bottom: 6px;
}
.splash-scene.brand-intro .splash-copy span {
  display: block;
  color: #8e6142;
  font-size: 0.94rem;
  text-shadow: 0 1px 0 rgba(255,255,255,0.24);
}
.splash-screen.is-exiting .brand-intro {
  animation: brandExit 360ms cubic-bezier(.22,.8,.22,1) forwards;
}
@keyframes brandIntroIn {
  0% { opacity: 0; transform: translateY(10px) scale(0.94); }
  62% { opacity: 1; transform: translateY(0) scale(1.015); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes brandTinyPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.018); }
}
@keyframes brandExit {
  from { opacity: 1; transform: scale(1); filter: blur(0); }
  to { opacity: 0; transform: scale(1.055); filter: blur(4px); }
}
@media (max-width: 420px) {
  .brand-wordmark {
    width: min(100%, 240px);
    max-height: 72px;
  }
  .hero-card {
    grid-template-columns: minmax(0, 1fr) 76px;
  }
  .hero-art {
    width: 76px;
    height: 54px;
  }
  .splash-scene.brand-intro {
    width: min(96vw, 360px);
    min-height: min(56vh, 320px);
  }
  .splash-brand {
    width: min(91vw, 330px);
    max-height: 138px;
  }
}
@media (min-width: 720px) {
  .brand-wordmark {
    width: min(100%, 430px);
    max-height: 120px;
  }
  .hero-card {
    grid-template-columns: minmax(0, 1fr) 128px;
  }
  .hero-art {
    width: 128px;
    height: 90px;
  }
}


/* --- Mezcla final: portada clásica + intro nueva --- */
.hero-card-classic {
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: start;
}
.hero-card-classic .hero-copy {
  grid-column: 1;
  grid-row: 1;
}
.hero-card-classic .hero-art {
  grid-column: 2;
  grid-row: 1;
  width: 112px;
  height: 80px;
  justify-self: end;
  align-self: start;
  background: rgba(0,0,0,0.04);
  border-top: 1px solid var(--edge-light);
  border-left: 1px solid var(--edge-light);
  border-right: 1px solid var(--edge-dark);
  border-bottom: 1px solid var(--edge-dark);
  border-radius: 2px;
  padding: 3px;
  overflow: hidden;
}
.hero-card-classic .hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}
.hero-card-classic h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.02;
}
.hero-card-classic h1 span {
  font-size: 0.75em;
  vertical-align: middle;
}
.hero-card-classic .brand-wordmark { display: none !important; }
.home-result.empty-state {
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: center;
}
.home-result.empty-state img {
  width: 78px;
  height: 34px;
  object-fit: contain;
  object-position: center center;
}
@media (max-width: 720px) {
  .hero-card-classic {
    grid-template-columns: minmax(0, 1fr) 92px;
  }
  .hero-card-classic .hero-art {
    width: 92px;
    height: 66px;
  }
  .hero-card-classic h1 {
    font-size: clamp(1.8rem, 8vw, 2.55rem);
  }
}
@media (max-width: 420px) {
  .hero-card-classic {
    grid-template-columns: minmax(0, 1fr) 78px;
  }
  .hero-card-classic .hero-art {
    width: 78px;
    height: 56px;
  }
  .home-result.empty-state {
    grid-template-columns: 64px 1fr;
  }
  .home-result.empty-state img {
    width: 64px;
    height: 28px;
  }
}


/* --- PWA final limpia: sin neblina blanca en móvil --- */
html, body {
  background: #2b1b14;
  overscroll-behavior: none;
}
body {
  min-height: 100dvh;
  padding-top: calc(8px + env(safe-area-inset-top));
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 34px);
  background: linear-gradient(180deg, #3a2418 0%, #2b1b14 36%, #24150f 100%);
}
body::before {
  opacity: 0.03;
}
.hero-card,
.main-panel,
.stat-card,
.sheet,
.calculated-card,
.recipe-card,
.quick-tips,
.info-grid article,
.home-result,
.steps-list li,
.mini-disclosure,
.empty-list,
.form-total,
.ingredient-field,
.ingredient-row,
.mini-value,
.objective,
.tip-pill,
.toast,
.bottom-nav {
  box-shadow: 1px 1px 0 var(--edge-mid), 0 10px 16px rgba(0,0,0,0.22);
}
.bottom-nav {
  background: #5a4031 !important;
  backdrop-filter: none !important;
  box-shadow: 0 10px 24px rgba(0,0,0,0.36), 1px 1px 0 var(--edge-mid);
  border-top-color: #b18461;
}
.bottom-nav button {
  background: linear-gradient(180deg, #6c4a39, #4b3327);
}
.toast, .sheet {
  backdrop-filter: none !important;
}
.modal-backdrop {
  background: rgba(18, 10, 7, 0.72);
}
.splash-screen {
  background: radial-gradient(circle at center, rgba(76,46,31,0.50) 0%, rgba(37,23,16,0.72) 58%, rgba(21,12,9,0.85) 100%) !important;
  backdrop-filter: none !important;
}
.splash-screen::before {
  background: linear-gradient(180deg, rgba(22,12,9,0.12), rgba(0,0,0,0.24));
}
.splash-copy p, .splash-copy span, .splash-copy strong {
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}
.hero-card-classic {
  grid-template-columns: minmax(0,1fr) 122px;
}
.hero-card-classic .hero-art {
  width: 122px;
  height: 76px;
  background: rgba(0,0,0,0.10);
}
.hero-card-classic .hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  transform: none;
}
.home-result.empty-state img {
  width: 78px;
  height: 44px;
  object-fit: contain;
  object-position: center center;
}
@media (max-width: 768px) {
  body {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 54px);
  }
  .hero-card-classic {
    grid-template-columns: minmax(0,1fr) 96px;
    align-items: start;
  }
  .hero-card-classic .hero-art {
    width: 96px;
    height: 138px;
    padding: 4px;
  }
  .hero-card-classic .hero-art img {
    transform: rotate(90deg) scale(1.05);
  }
  .home-result.empty-state {
    grid-template-columns: 66px 1fr;
  }
  .home-result.empty-state img {
    width: 66px;
    height: 38px;
  }
  .bottom-nav {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 460px) {
  body::before { display: none; }
  .hero-card-classic {
    grid-template-columns: minmax(0,1fr) 84px;
  }
  .hero-card-classic .hero-art {
    width: 84px;
    height: 122px;
  }
  .hero-card-classic h1 {
    font-size: clamp(1.95rem, 9vw, 2.9rem);
  }
  .quick-tips {
    gap: 6px;
  }
}


/* --- Corrección: hero envuelto horizontal, estado vacío con tableta simple --- */
.hero-card-classic .hero-art {
  width: 122px;
  height: 76px;
}
.hero-card-classic .hero-art img {
  transform: none !important;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}
.home-result.empty-state {
  grid-template-columns: 98px 1fr;
}
.home-result.empty-state img {
  width: 98px;
  height: 48px;
  object-fit: contain;
  object-position: center center;
}
@media (max-width: 768px) {
  .hero-card-classic {
    grid-template-columns: minmax(0,1fr) 104px;
  }
  .hero-card-classic .hero-art {
    width: 104px;
    height: 66px;
  }
}
@media (max-width: 460px) {
  .hero-card-classic {
    grid-template-columns: minmax(0,1fr) 90px;
  }
  .hero-card-classic .hero-art {
    width: 90px;
    height: 58px;
  }
  .home-result.empty-state {
    grid-template-columns: 82px 1fr;
  }
  .home-result.empty-state img {
    width: 82px;
    height: 40px;
  }
}
