/* PRIMELAB · app del equipo
   Paleta: papel mineral, tinta pizarra, verde frasco (acción) y rojo krill (alertas y rechazos).
   El elemento memorable es el comprobante por confirmar; el resto se mantiene sobrio. */

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #E9EEEA;
  --surface: #F7F9F7;
  --ink: #17242C;
  --muted: #56666C;
  --line: #C9D3CE;
  --teal: #1F5C4E;
  --teal-ink: #F2F7F4;
  --teal-soft: #D5E4DD;
  --krill: #B3263E;
  --krill-soft: #F4DADF;
  --ticket: #FFF3BF;
  --ticket-ink: #3B3210;
  --ticket-edge: #E6D58A;
  --user: #17242C;
  --user-ink: #EEF3F0;
  --focus: #2F6FE0;

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: 2rem;

  --r-sm: 6px;
  --r-md: 12px;
  --r-pill: 999px;
  --tabbar: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121A1E;
    --surface: #1A2429;
    --ink: #E3EAE6;
    --muted: #9AABA6;
    --line: #2E3C40;
    --teal: #5FB39C;
    --teal-ink: #0E1A16;
    --teal-soft: #1E3530;
    --krill: #F07A8E;
    --krill-soft: #3A1E25;
    --ticket: #3A3418;
    --ticket-ink: #F6EBC0;
    --ticket-edge: #5C5226;
    --user: #E3EAE6;
    --user-ink: #121A1E;
    --focus: #7EA8FF;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.5 var(--font);
}
/* Cifras alineadas solo donde se comparan números (en esta fuente tnum también ensancha la puntuación). */
.product-units, .badge { font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: var(--step-2); font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: var(--step-1); margin: 1.75rem 0 0.75rem; }
h4 { font-size: var(--step-0); margin-bottom: 0.75rem; }
p { margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---------------------------------------------------------------- controles */
.btn {
  font: 600 var(--step-0)/1 var(--font);
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  min-height: 44px;
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--teal); color: var(--teal-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--ink); }
.btn-danger { background: transparent; color: var(--krill); border-color: var(--krill); }
.btn-danger:hover { background: var(--krill-soft); }
.btn-block { width: 100%; }

label { display: grid; gap: 0.35rem; font-size: var(--step--1); font-weight: 600; color: var(--muted); }
input, select, textarea {
  font: 400 var(--step-0)/1.4 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.form-error { color: var(--krill); font-weight: 600; font-size: var(--step--1); }
.row-end { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* ---------------------------------------------------------------- marca */
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-name { font-weight: 800; font-size: var(--step-1); letter-spacing: -0.02em; }
.capsule {
  width: 14px; height: 30px; border-radius: var(--r-pill);
  background: linear-gradient(var(--teal) 0 50%, var(--krill) 50% 100%);
  transform: rotate(28deg);
  flex: none;
}

/* ---------------------------------------------------------------- login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.login-card { width: min(100%, 400px); }
.login-card .brand { margin-bottom: 2.5rem; }
.login-card h1 { margin-bottom: 0.75rem; max-width: 14ch; }
.login-card form { display: grid; gap: 1rem; margin: 2rem 0 1.25rem; }

/* ---------------------------------------------------------------- estructura */
.app { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.account {
  font: 600 var(--step--1)/1.2 var(--font); color: var(--ink);
  background: none; border: 1.5px solid var(--line); border-radius: var(--r-pill);
  padding: 0.45rem 0.85rem; cursor: pointer; display: flex; gap: 0.4rem; align-items: baseline; min-height: 40px;
}
.account .role { color: var(--muted); font-weight: 500; }
.menu {
  position: absolute; right: 1rem; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  display: grid; padding: 0.35rem; min-width: 200px;
  box-shadow: 0 12px 30px -12px rgba(23, 36, 44, 0.35);
}
.menu button {
  font: 500 var(--step-0)/1.2 var(--font); color: var(--ink); text-align: left;
  background: none; border: 0; border-radius: var(--r-sm); padding: 0.7rem 0.8rem; cursor: pointer;
}
.menu button:hover { background: var(--paper); }

.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 6;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
}
.tab {
  flex: 1; position: relative;
  display: grid; justify-items: center; align-content: center; gap: 2px;
  font: 600 0.72rem/1 var(--font); color: var(--muted);
  background: none; border: 0; cursor: pointer;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tab[aria-current="page"] { color: var(--teal); }
.tab[aria-current="page"] svg { stroke-width: 2.4; }
.badge {
  position: absolute; top: 8px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--krill); color: #fff; font: 700 0.7rem/18px var(--font); text-align: center;
}

.view { padding: 1.25rem 1rem calc(var(--tabbar) + 2rem); width: 100%; max-width: 820px; margin: 0 auto; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-title { margin: 2rem 0 1rem; }

@media (min-width: 900px) {
  .app { grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; padding: 0.9rem 1.5rem; }
  .tabs {
    position: sticky; top: 66px; inset: auto; height: calc(100dvh - 66px);
    flex-direction: column; justify-content: flex-start; gap: 0.25rem; padding: 1.25rem 0.75rem;
    border-top: 0; border-right: 1px solid var(--line); background: var(--paper);
  }
  .tab {
    flex: none; display: flex; justify-content: flex-start; gap: 0.75rem; padding: 0.8rem 0.9rem;
    font-size: var(--step-0); border-radius: var(--r-md);
  }
  .tab[aria-current="page"] { background: var(--teal-soft); }
  .badge { position: static; margin-left: auto; }
  .view { padding: 2rem 2rem 3rem; }
}

/* ---------------------------------------------------------------- chat */
.view-chat { display: flex; flex-direction: column; min-height: calc(100dvh - 60px - var(--tabbar)); padding-bottom: calc(var(--tabbar) + 1rem); }
@media (min-width: 900px) { .view-chat { min-height: calc(100dvh - 66px); padding-bottom: 1.5rem; } }
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.chat-head p { max-width: 46ch; }
.chat-head .btn { flex: none; padding: 0.55rem 0.9rem; min-height: 38px; font-size: var(--step--1); }

.messages { list-style: none; margin: 1rem 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.msg { max-width: min(62ch, 88%); overflow-wrap: anywhere; }
.msg-user {
  align-self: flex-end; background: var(--user); color: var(--user-ink);
  padding: 0.65rem 0.95rem; border-radius: 18px 18px 4px 18px; white-space: pre-wrap;
}
.msg-assistant { align-self: flex-start; padding-left: 0.9rem; border-left: 3px solid var(--teal); }
.msg-assistant p { margin: 0 0 0.5rem; }
.msg-assistant p:last-child { margin: 0; }
.msg-assistant ul { margin: 0.25rem 0 0.5rem; padding-left: 1.2rem; }
.msg-system { align-self: center; color: var(--muted); font-size: var(--step--1); text-align: center; white-space: pre-wrap; max-width: 46ch; }
.msg-thinking { color: var(--muted); }
.msg-thinking::after { content: "…"; animation: dots 1.2s steps(4) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }
.empty-chat { color: var(--muted); margin: auto 0; max-width: 40ch; }
.empty-chat strong { color: var(--ink); display: block; font-size: var(--step-1); margin-bottom: 0.4rem; }

/* El comprobante: la acción que espera tu confirmación */
.ticket {
  position: relative; margin: 0 0 1rem;
  background: var(--ticket); color: var(--ticket-ink);
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: 1.35rem 1.1rem 1rem;
  border: 1px solid var(--ticket-edge); border-top: 0;
  animation: ticket-in 260ms cubic-bezier(.2,.8,.2,1);
}
.ticket::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: -8px; height: 9px;
  background: radial-gradient(circle at 7px 0, transparent 5px, var(--ticket) 5.5px) -7px 0 / 14px 9px repeat-x;
}
.ticket h3 { margin: 0 0 0.6rem; font-size: var(--step-1); font-weight: 800; }
.ticket ul { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.35rem; }
.ticket li { padding-left: 1.1rem; position: relative; font-weight: 500; }
.ticket li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.ticket .actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.ticket .btn { flex: 1 1 140px; }
.ticket .btn-quiet { color: var(--ticket-ink); border-color: var(--ticket-edge); }
@keyframes ticket-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.composer {
  position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 0.5rem);
  display: flex; gap: 0.5rem; align-items: flex-end;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 24px; padding: 0.4rem;
}
@media (min-width: 900px) { .composer { bottom: 1.5rem; } }
.composer:focus-within { border-color: var(--ink); }
.composer textarea {
  border: 0; background: transparent; resize: none; max-height: 9rem; padding: 0.6rem 0.7rem; min-height: 44px;
}
.composer textarea:focus { outline: none; }
.composer .btn { flex: none; }

/* ---------------------------------------------------------------- hoy e inventario */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.fact { background: var(--surface); padding: 0.9rem 1rem; }
.fact .value { font-size: var(--step-2); font-weight: 800; letter-spacing: -0.02em; display: block; }
.fact .label { color: var(--muted); font-size: var(--step--1); }
.fact.alert .value { color: var(--krill); }

.stock { display: grid; gap: 1.25rem; }
.product { border-top: 2px solid var(--ink); padding-top: 0.75rem; }
.product-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.product-name { font-weight: 700; font-size: var(--step-1); }
.product-sku { color: var(--muted); font-size: var(--step--1); }
.product-units { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.product-units small { font-size: var(--step--1); font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 0.3rem; }
.product-price { color: var(--muted); }
.product-price.missing { color: var(--krill); font-weight: 600; }
.lots { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.25rem; }
.lots li { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--step--1); padding: 0.35rem 0; border-bottom: 1px dashed var(--line); }
.lots li.soon { color: var(--krill); font-weight: 600; }

/* ---------------------------------------------------------------- listas y paneles */
.list { display: grid; gap: 0.75rem; }
.item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 1rem; display: grid; gap: 0.6rem;
}
.item-title { font-weight: 700; }
.item-amount { font-size: var(--step-2); font-weight: 800; letter-spacing: -0.02em; }
.item .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.item .actions .btn { flex: 1 1 130px; }
.empty { color: var(--muted); padding: 1rem 0; }

.forms { display: grid; gap: 1rem; margin-top: 1.75rem; }
@media (min-width: 900px) { .forms { grid-template-columns: 1fr 1fr; align-items: start; } .forms #form-lote { grid-column: 1 / -1; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.1rem; display: grid; gap: 0.9rem; }
.panel h3, .panel h4 { margin: 0; }
.grid2 { display: grid; gap: 0.9rem; }
@media (min-width: 600px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.panel .btn { justify-self: start; }

.member { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.member .who { display: grid; }
.member .who span { color: var(--muted); font-size: var(--step--1); }
.member.inactive .who strong { text-decoration: line-through; color: var(--muted); }
.member .btn { padding: 0.5rem 0.9rem; min-height: 38px; font-size: var(--step--1); }

/* ---------------------------------------------------------------- avisos */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 1rem); z-index: 20;
  background: var(--ink); color: var(--paper); padding: 0.75rem 1.1rem; border-radius: var(--r-md);
  max-width: calc(100% - 2rem); font-weight: 600; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
}
.toast.error { background: var(--krill); color: #fff; }
@media (min-width: 900px) { .toast { bottom: 2rem; } }

.dialog { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); padding: 1.25rem; width: min(92vw, 380px); }
.dialog::backdrop { background: rgba(18, 26, 30, 0.45); }
.dialog form { display: grid; gap: 0.75rem; }
.dialog h3 { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Equipo: acciones compactas en una fila */
.member .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.member .actions .btn { flex: none; }
#team + .panel { margin-top: 1rem; }

/* ---------------------------------------------------------------- catálogo (app y enlace público) */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
@media (min-width: 600px) { .cat-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; } }
.cat-card { display: grid; align-content: start; gap: 0.6rem; }
.cat-photo {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface);
}
.cat-photo:hover .cat-img { transform: scale(1.03); }
.cat-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 240ms ease; }
.cat-ph {
  width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 0.75rem; padding: 1rem;
  background: linear-gradient(160deg, var(--teal-soft), var(--surface)); color: var(--muted);
  font-weight: 700; font-size: var(--step--1); text-align: center;
}
.cat-ph .capsule { width: 22px; height: 46px; }
.cat-chip {
  position: absolute; left: 0.6rem; top: 0.6rem;
  background: var(--krill); color: #fff; font: 700 0.75rem/1 var(--font); letter-spacing: 0.02em;
  padding: 0.4rem 0.6rem; border-radius: var(--r-pill);
}
.sold-out .cat-img, .sold-out .cat-ph { filter: grayscale(0.7); opacity: 0.75; }
.cat-name { margin: 0; font-size: var(--step-0); font-weight: 700; }
.cat-pres { color: var(--muted); font-size: var(--step--1); }
.cat-price { font-weight: 800; font-size: var(--step-1); letter-spacing: -0.01em; }
.cat-price.ask, .sheet-price.ask { color: var(--muted); font-weight: 600; font-size: var(--step-0); }

/* Ficha ampliada */
.sheet {
  border: 0; padding: 0; border-radius: var(--r-md); background: var(--surface); color: var(--ink);
  width: min(94vw, 760px); max-height: 92dvh; overflow: auto;
}
.sheet::backdrop { background: rgba(18, 26, 30, 0.6); }
.sheet[open] { animation: sheet-in 200ms cubic-bezier(.2,.8,.2,1); }
@keyframes sheet-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-close {
  position: sticky; top: 0.6rem; float: right; margin: 0.6rem 0.6rem -3.4rem 0; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink); font: 400 1.8rem/1 var(--font);
  box-shadow: 0 4px 16px -6px rgba(0,0,0,.35);
}
.sheet-photo { position: relative; background: var(--paper); aspect-ratio: 1; max-height: 62dvh; width: 100%; }
.sheet-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sheet-photo .cat-ph { font-size: var(--step-1); }
.sheet-photo .cat-chip { left: 1rem; top: 1rem; font-size: 0.85rem; }
.sheet-body { padding: 1.25rem 1.25rem 1.5rem; display: grid; gap: 0.35rem; }
.sheet-price { font-size: var(--step-2); font-weight: 800; letter-spacing: -0.02em; margin: 0.25rem 0 0.5rem; }
.sheet-section { border-top: 1px solid var(--line); padding-top: 0.9rem; margin-top: 0.5rem; }
.sheet-section h4 { margin: 0 0 0.4rem; font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sheet-text { white-space: pre-wrap; margin: 0; }
@media (min-width: 760px) {
  .sheet[open] { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
  .sheet-close { position: absolute; top: 0.75rem; right: 0.75rem; margin: 0; float: none; }
  .sheet-photo { aspect-ratio: auto; max-height: none; height: 100%; min-height: 420px; }
  .sheet-body { max-height: 92dvh; overflow: auto; padding: 1.75rem 1.5rem; align-content: start; }
}

/* Edición de la ficha (dueño e inventario) */
.sheet-edit { border-top: 2px solid var(--ink); margin-top: 1rem; padding-top: 1rem; display: grid; gap: 0.9rem; }
.sheet-edit textarea { min-height: 7rem; resize: vertical; }
.sheet-edit .row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.sheet-edit .row .btn { flex: 1 1 140px; }
.file-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Enlace para clientes */
.share {
  display: grid; gap: 0.6rem; margin-bottom: 1.5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem;
}
.share-url { font: 600 var(--step--1)/1.4 var(--font); overflow-wrap: anywhere; }
.share .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.share .btn { padding: 0.55rem 1rem; min-height: 40px; font-size: var(--step--1); }

/* Página pública */
.public { min-height: 100dvh; }
.pub-head { padding: 1rem; border-bottom: 1px solid var(--line); }
.pub-main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.pub-intro { margin-bottom: 1.5rem; }
.pub-intro h1 { margin-bottom: 0.4rem; }
.pub-foot { margin-top: 2.5rem; max-width: 60ch; }
@media (min-width: 900px) { .pub-head { padding: 1rem 2rem; } .pub-main { padding: 2.5rem 2rem 4rem; } }
.sheet-edit h3, .sheet-edit p { margin: 0; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* Una ficha cerrada nunca se ve (las reglas de diseño no deben anular el oculto del navegador). */
.sheet:not([open]) { display: none; }

/* Tabla nutricional (estilo etiqueta) */
.nutri { display: grid; gap: 0.35rem; }
.nutri-line { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--step--1); border-bottom: 1px solid var(--line); padding-bottom: 0.25rem; }
.nutri-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); font-variant-numeric: tabular-nums; border-top: 6px solid var(--ink); margin-top: 0.25rem; }
.nutri-table thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); text-align: right; padding: 0.35rem 0 0.3rem 0.6rem; border-bottom: 2px solid var(--ink); }
.nutri-table th[scope="row"] { text-align: left; font-weight: 600; padding: 0.35rem 0; }
.nutri-table td { text-align: right; padding: 0.35rem 0 0.35rem 0.6rem; white-space: nowrap; }
.nutri-table tbody tr { border-bottom: 1px solid var(--line); }
.nutri-table tbody tr:last-child { border-bottom: 2px solid var(--ink); }
.nutri-table tr.sub th[scope="row"] { font-weight: 400; padding-left: 1rem; }
.nutri-foot { font-size: 0.75rem; color: var(--muted); margin: 0.2rem 0 0; }
.nutri-extra { font-size: var(--step--1); margin: 0.3rem 0 0; }
.nutri-allergen strong { color: var(--krill); }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }

/* Corregir lote */
.lot-right { display: inline-flex; align-items: center; gap: 0.6rem; }
.lot-edit { font: 600 0.75rem/1 var(--font); color: var(--ink); background: none; border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 0.3rem 0.6rem; cursor: pointer; }
.lot-edit:hover { border-color: var(--ink); }
.lots li.soon .lot-edit { color: var(--ink); font-weight: 600; }

/* Pedido desde el catálogo público */
.order-box { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin: 0.25rem 0 0.5rem; }
.order-box .btn { flex: 1 1 180px; }
.order-note { margin: 0.25rem 0 0.5rem; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
.qty-btn { width: 2.5rem; height: 2.5rem; border: 0; background: none; font: 600 1.2rem/1 var(--font); color: var(--ink); cursor: pointer; }
.qty-value { min-width: 1.8rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -16px rgba(0,0,0,.35); }
body.has-cart .pub-main { padding-bottom: 6rem; }
@media (min-width: 760px) { .cart-bar { left: 50%; right: auto; bottom: 1.25rem; transform: translateX(-50%); width: min(560px, calc(100% - 2rem));
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0.6rem 0.6rem 0.6rem 1.25rem; } }
.order-dialog { width: min(96vw, 560px); max-height: 92dvh; overflow: auto; padding: 1.25rem; }
.order-dialog form { display: grid; gap: 0.9rem; }
.order-head { display: flex; justify-content: space-between; align-items: center; }
.order-head h2 { margin: 0; }
.order-head .sheet-close { position: static; }
.order-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.order-items li { display: grid; gap: 0.4rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.oi-ctrl { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.oi-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.oi-del { margin-left: auto; background: none; border: 0; color: var(--krill); font: 600 var(--step--1)/1 var(--font); cursor: pointer; padding: 0.4rem; }
.order-total { display: flex; justify-content: space-between; margin: 0; font-size: var(--step-1); }
.order-fields { border: 0; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.order-fields legend { font-weight: 700; margin-bottom: 0.25rem; padding: 0; }
.order-fields label.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 500; color: var(--ink); }
.order-fields label.check input { width: 1.2rem; height: 1.2rem; margin-top: 0.1rem; flex: none; }
.order-send { width: 100%; }
.order-done { display: grid; gap: 0.9rem; text-align: center; padding: 1rem 0; }
.order-done h2 { margin: 0; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Pedidos web en la app del equipo */
.count-chip { display: inline-block; min-width: 1.5rem; padding: 0.1rem 0.5rem; border-radius: var(--r-pill); background: var(--krill); color: #fff;
  font-size: var(--step--1); text-align: center; vertical-align: middle; }
.web-order { display: grid; gap: 0.45rem; }
.web-order-contact { font-size: var(--step--1); }
.web-order-contact a { color: var(--ink); }
.web-order-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; font-size: var(--step--1); }
.web-order-items li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding: 0.2rem 0; }
.web-order-total { display: flex; justify-content: space-between; font-size: var(--step-0); }
.order-fields .opt { font-weight: 400; }
