:root {
  --ink: #3a3a38;
  --soft: #6e6e6a;
  --line: #e4dccb;
  --bg: #faf6ee;
  --surface: #fff;
  --deep: #2c7a7b;
  --deep-soft: #e3efec;
  --teal: #7fb8d3;
  --leaf: #8fbf7f;
  --clay: #e8895a;
  --clay-soft: #f4a97f;
  --sand: #c9a227;
  --r: 18px;
  --shadow: 0 2px 0 rgba(58, 58, 56, 0.04), 0 12px 30px rgba(58, 58, 56, 0.1);
  --safe: env(safe-area-inset-bottom, 0px);

  /* Escala de tamaños. Antes había 18 medidas sueltas (9,5 · 10,5 · 11 · 11,5 …):
     diferencias de medio píxel que nadie ve y que no hay cómo mantener.
     Piso de 12px en todo lo que se lee: el celular se usa parada y al sol. */
  --t-micro: 10px; /* sellos sobre miniaturas: no se leen, se reconocen */
  --t-xs: 12px; /* pastillas, rótulos, la barra de abajo */
  --t-sm: 13.5px; /* textos de ayuda y renglones de apoyo */
  --t-md: 15px; /* el tamaño de base */
  --t-lg: 17px; /* títulos de tarjeta y precios de mostrador */
  --t-xl: 19px; /* títulos de sección */
  --t-2xl: 27px;
  --t-3xl: 30px; /* el total del mostrador */
  --t-4xl: 40px; /* el precio del calculador */
  /* 16px es el mínimo que evita que iOS haga zoom solo al tocar un campo */
  --t-input: 16px;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font:
    var(--t-md)/1.55 Nunito,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  -webkit-text-size-adjust: 100%;
}
.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 14px calc(96px + var(--safe));
}
@media (min-width: 900px) {
  .wrap {
    max-width: 880px;
  }
}
h1,
h2,
h3 {
  font-family: Fredoka, Nunito, sans-serif;
  font-weight: 600;
  margin: 0;
}
.num {
  font-family: Nunito, sans-serif;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
img {
  max-width: 100%;
  display: block;
}

header.top {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}
/* el bloque del nombre es el que cede: sin esto empuja a los botones */
header.top > div:not(.logo):not(.sync) {
  flex: 1;
  min-width: 0;
}
.logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex: none;
  overflow: hidden;
  background: transparent;
  display: grid;
  place-items: center;
}
.logo b {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--teal), var(--leaf));
}
.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
header.top h1 {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: var(--t-xl);
  letter-spacing: -0.005em;
  color: #1f5758;
}
header.top h1 i {
  font-style: normal;
  font-weight: 700;
  color: var(--clay);
}
header.top p {
  margin: 1px 0 0;
  font-size: var(--t-sm);
  color: var(--soft);
}
.verCat {
  margin-left: auto;
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: var(--t-sm);
  color: var(--deep);
  text-decoration: none;
  border: 1.5px solid var(--line);
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.salirBtn {
  margin-left: 8px;
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: var(--t-sm);
  color: var(--soft);
  background: none;
  border: 1.5px solid var(--line);
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.salirBtn:hover {
  color: #a8483a;
  border-color: #e8c6be;
}
body.modoventa .salirBtn {
  margin-left: auto;
}
.sync {
  margin-left: 10px;
  font-size: var(--t-xs);
  color: var(--soft);
  text-align: right;
  line-height: 1.3;
}
@media (max-width: 430px) {
  .sync span {
    display: none;
  }
}
/* En el celular el encabezado no entra y partía "Play Mind 3d" en tres renglones.
   Se va lo que no hace falta ahí: el subtítulo no dice nada que ella no sepa, y
   el catálogo ya está en Ajustes › Los tres accesos, con su botón Abrir. */
@media (max-width: 560px) {
  header.top p,
  .verCat {
    display: none;
  }
  header.top h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.sync i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cfc3ae;
  margin-right: 4px;
}
.sync.on i {
  background: var(--leaf);
}
.sync.err i {
  background: var(--clay);
}

nav.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--surface);
  border-top: 1.5px solid var(--line);
  padding: 6px 6px calc(6px + var(--safe));
  gap: 2px;
}
nav.tabs button {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 7px 1px;
  border-radius: 10px;
  font-family: Fredoka, sans-serif;
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--soft);
  display: grid;
  gap: 3px;
  justify-items: center;
  overflow: hidden;
}
nav.tabs button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
nav.tabs button[aria-selected="true"] {
  color: var(--deep);
  background: var(--deep-soft);
  border-radius: 999px;
}
nav.tabs button:focus-visible {
  outline: 2px solid var(--deep);
  outline-offset: -2px;
}
nav.tabs button[data-tab="rad"] {
  display: none;
}
@media (min-width: 700px) {
  nav.tabs {
    position: static;
    border: 0;
    border-radius: 14px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    padding: 6px;
  }
  nav.tabs button {
    flex-direction: row;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: var(--t-md);
    padding: 9px;
  }
  .wrap {
    padding-bottom: 40px;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin-bottom: 15px;
}
.card > h2 {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: var(--t-xl);
  color: #1f5758;
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.01em;
}
.card > .hint {
  font-size: var(--t-sm);
  line-height: 1.55;
  color: var(--soft);
  margin: 6px 0 16px;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 11px 12px;
  align-items: stretch;
}
.grid > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.grid > div > label.f {
  flex: 1 0 auto;
}
.grid > div > input,
.grid > div > select,
.grid > div > textarea,
.grid > div > .dual {
  margin-top: auto;
}
.grid > div > .mut {
  display: none;
}
.grid.ins {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.grid.ins label.f {
  font-size: var(--t-sm);
  line-height: 1.3;
}
.tira {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 4px;
}
.tira:empty {
  display: none;
}
.minifoto {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--line);
  cursor: pointer;
  background: var(--deep-soft);
}
.minifoto.tapa {
  border-color: var(--deep);
}
.minifoto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.minifoto .sello {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--deep);
  color: #fff;
  font:
    800 var(--t-micro) Nunito,
    sans-serif;
  text-align: center;
  padding: 2px 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.minifoto button.x {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 0;
  background: rgba(32, 64, 78, 0.82);
  color: #fff;
  font-size: var(--t-sm);
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips span {
  background: var(--deep-soft);
  color: var(--deep);
  border-radius: 20px;
  padding: 4px 11px;
  font-size: var(--t-sm);
  font-weight: 600;
}
.chips .none {
  background: transparent;
  color: var(--soft);
  font-weight: 400;
  padding: 4px 0;
}
.dual {
  display: flex;
  gap: 8px;
}
.dual > .suffix {
  flex: 1;
  min-width: 0;
  display: block;
}
.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: var(--t-sm);
  color: var(--soft);
  cursor: pointer;
}
.chk input {
  width: auto;
  margin: 0;
  flex: none;
  accent-color: var(--deep);
  width: 17px;
  height: 17px;
}
.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

label.f {
  display: block;
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--soft);
  margin-bottom: 6px;
}
input,
select,
textarea {
  width: 100%;
  font:
    var(--t-input)/1.4 Nunito,
    sans-serif;
  color: var(--ink);
  background: #fdfbf6;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
}
select,
textarea,
input[type="text"],
input[type="date"] {
  font-family: Nunito, sans-serif;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--deep);
  background: #fff;
}
.suffix {
  position: relative;
}
.suffix em {
  position: absolute;
  right: 12px;
  bottom: 0;
  height: 41px;
  display: flex;
  align-items: center;
  font-style: normal;
  font-size: var(--t-xs);
  color: var(--soft);
  pointer-events: none;
}
.suffix input {
  padding-right: 42px;
}
.suffix button.verClave {
  position: absolute;
  right: 4px;
  bottom: 4px;
  height: 33px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--deep);
  font-family: Fredoka, sans-serif;
  font-size: var(--t-xs);
  font-weight: 600;
  cursor: pointer;
}

button.btn {
  font-family: Fredoka, sans-serif;
  font-size: var(--t-md);
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--deep);
  background: var(--deep);
  color: #fff;
  padding: 11px 22px;
  border-radius: 999px;
}
button.btn:active {
  transform: scale(0.98);
}
button.btn.ghost {
  background: transparent;
  color: var(--deep);
}
button.btn.mini {
  padding: 7px 15px;
  font-size: var(--t-sm);
  border-radius: 999px;
}
button.btn.danger {
  border-color: #e8c6be;
  color: #a8483a;
  background: transparent;
}
button.btn.wide {
  width: 100%;
}
button.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.stack {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  margin: 4px 0 12px;
}
.layer {
  height: 26px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #25203f;
  font-size: var(--t-sm);
  font-weight: 600;
  min-width: 118px;
  overflow: hidden;
  white-space: nowrap;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.5) 0 1px,
    transparent 1px 4px
  );
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: var(--t-sm);
  color: var(--soft);
}
.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 4px;
}

button.btn.vender {
  width: 100%;
  font-size: var(--t-xl);
  padding: 16px;
  margin-bottom: 13px;
  background: var(--leaf);
  border-color: var(--leaf);
  box-shadow: 0 6px 16px rgba(143, 191, 127, 0.35);
}
/* ---- punto de venta ---- */
.pos {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.pos[hidden] {
  display: none !important;
}
.pos header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.pos header h2 {
  font-family: Fredoka, sans-serif;
  font-size: var(--t-xl);
  color: #1f5758;
  flex: 1;
}
.pos .cerrarpos {
  border: 0;
  background: none;
  font-size: var(--t-2xl);
  line-height: 1;
  color: var(--soft);
  cursor: pointer;
  padding: 0 4px;
}
.posbuscar {
  padding: 11px 14px 0;
}
.posbuscar input {
  width: 100%;
}
.posbuscar {
  padding: 10px 14px 0;
}
.posbuscar input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-family: Nunito, sans-serif;
  font-size: var(--t-input);
}
.posgrid {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
}
.chatMsgs {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chatDica {
  background: var(--deep-soft);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: var(--t-sm);
  color: var(--ink);
}
.chatDica p {
  margin: 0 0 8px;
  line-height: 1.5;
}
.chatMsg {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: var(--t-sm);
  line-height: 1.5;
  white-space: pre-wrap;
}
.chatMsg.eu {
  align-self: flex-end;
  background: var(--deep);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chatMsg.bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.chatMsg img {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  margin-top: 6px;
}
/* La respuesta tarda varios segundos: sin esto no se sabe si salió o se colgó */
.chatMsg.pensando {
  color: var(--soft);
  letter-spacing: 2px;
  animation: latir 1.1s ease-in-out infinite;
}
@keyframes latir {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}
.chatErr {
  align-self: flex-start;
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 14px;
  background: #fbefec;
  border: 1px solid #e8c6be;
  color: #a8483a;
  font-size: var(--t-sm);
  line-height: 1.5;
}
.chatBar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chatBar input[type="text"] {
  flex: 1;
  min-width: 0;
}
.chatBar .icono {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 17px;
  display: grid;
  place-items: center;
}
/* Miniatura de lo que se va a mandar: pegando con Ctrl+V no hay otra forma
   de saber que la foto entró. */
.chatFoto {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  font-size: var(--t-xs);
  color: var(--soft);
}
.chatFoto[hidden] {
  display: none !important;
}
.chatFoto img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex: none;
}
.chatFoto button {
  margin-left: auto;
  border: 0;
  background: none;
  font-size: var(--t-lg);
  line-height: 1;
  color: var(--soft);
  cursor: pointer;
  padding: 0 4px;
}

/* El cerebro flotante: la Mind siempre a mano, en cualquier pestaña. */
.mindFab {
  position: fixed;
  right: 16px;
  /* la barra de abajo es fixed en el celular: el cerebro va arriba de ella */
  bottom: calc(74px + var(--safe));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px 0 15px;
  border: 0;
  border-radius: 999px;
  background: var(--deep);
  color: #fff;
  font-family: Fredoka, sans-serif;
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(31, 87, 88, 0.38);
  transition: transform 0.12s;
}
.mindFab i {
  font-style: normal;
  font-size: 23px;
  line-height: 1;
}
.mindFab:active {
  transform: scale(0.93);
}
/* Con el punto de venta, el login o la propia ventana abiertos, estorba. */
body:has(#pos:not([hidden])) .mindFab,
body:has(.entrada:not([hidden])) .mindFab,
body:has(#chatCad:not([hidden])) .mindFab {
  display: none;
}

/* Ventana chica: hoja que sube desde abajo. Hereda de .pos el header, el
   pie y el layout en columna; acá sólo se cambia dónde y cuánto ocupa. */
.mindWin {
  inset: auto 0 0 0;
  height: 76vh;
  height: 76dvh;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 30px rgba(58, 58, 56, 0.24);
  overflow: hidden;
}
.mindWin.grande {
  inset: 0;
  height: auto;
  border-radius: 0;
}
.mindWin header .expandirMind {
  border: 0;
  background: none;
  font-size: var(--t-lg);
  line-height: 1;
  color: var(--soft);
  cursor: pointer;
  padding: 2px 6px;
}
.mindWin .chatDica {
  flex: none;
  margin: 12px 14px 0;
}
@media (min-width: 700px) {
  /* en pantalla grande la barra de abajo deja de ser fixed */
  .mindFab {
    bottom: 24px;
  }
  .mindWin {
    inset: auto 20px 20px auto;
    width: 390px;
    height: 580px;
    max-height: calc(100vh - 40px);
    border-radius: 20px;
    border: 1px solid var(--line);
  }
  .mindWin.grande {
    inset: 24px;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 20px;
  }
}
.postile {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  padding: 0;
  font-family: inherit;
  overflow: hidden;
}
.postile.on {
  border-color: var(--leaf);
  box-shadow: 0 0 0 2px rgba(143, 191, 127, 0.3);
}
/* 1) foto: apaisada. Cuadrada entraban 2 piezas y media en pantalla; así entran
   el doble, que es lo que importa parada en la feria con alguien esperando. */
.postile .im {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--deep-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-3xl);
  overflow: hidden;
}
.postile .stockBadge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--leaf);
  color: #fff;
  font-weight: 800;
  font-size: var(--t-xs);
  display: grid;
  place-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.postile .im img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 2) nombre: hasta tres renglones, sin cortar a la mitad */
.postile b {
  display: block;
  padding: 9px 10px 0;
  font:
    600 var(--t-sm)/1.3 Fredoka,
    sans-serif;
  color: var(--ink);
  word-break: break-word;
}
/* 3) precio */
.postile u {
  display: block;
  padding: 5px 10px 0;
  text-decoration: none;
  font-weight: 800;
  font-size: var(--t-lg);
  color: var(--deep);
}
/* 4) stock */
.postile i.st {
  display: block;
  padding: 3px 10px 11px;
  font-style: normal;
  font-size: var(--t-xs);
  font-weight: 800;
  /* "a pedido" no es un detalle gris: es la que hay que imprimir y gasta
     filamento. Que se note antes de cobrarla, no después. */
  color: #8a5320;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.postile i.st.hay {
  color: var(--leaf);
}
.postile .n {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--leaf);
  color: #fff;
  font-weight: 800;
  font-size: var(--t-sm);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(58, 58, 56, 0.25);
}
.postile .menos {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(58, 58, 56, 0.6);
  color: #fff;
  font-weight: 800;
  font-size: var(--t-lg);
  display: grid;
  place-items: center;
}
.pospie {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 14px 16px calc(14px + var(--safe));
}
.postotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.postotal span {
  font-weight: 700;
  font-size: var(--t-md);
  color: var(--soft);
}
.postotal b {
  font-family: Fredoka, sans-serif;
  font-weight: 700;
  font-size: var(--t-3xl);
  color: #1f5758;
}
.formas {
  display: flex;
  gap: 9px;
  margin-bottom: 11px;
}
.formas button {
  flex: 1;
  padding: 13px 6px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: var(--t-md);
  color: var(--soft);
  cursor: pointer;
}
.formas button.on {
  border-color: var(--deep);
  background: var(--deep-soft);
  color: var(--deep);
}
/* Fiado no es una forma de cobro más: es que la plata no entró. Se marca en
   ámbar para que no se confunda con haber cobrado. */
.formas button[data-forma="fiado"].on {
  border-color: var(--sand);
  background: #fdf4dd;
  color: #8a6512;
}
.posdatos {
  display: flex;
  gap: 9px;
  margin-bottom: 11px;
}
.posdatos > * {
  flex: 1;
  min-width: 0;
}
.postotal .desc {
  display: block;
  font-size: var(--t-xs);
  font-weight: 800;
  color: var(--clay);
}
.result {
  background: linear-gradient(160deg, #20404e, #2c6480);
  color: #fff;
  border-radius: var(--r);
  padding: 17px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.result h2 {
  font-family: Fredoka, sans-serif;
  font-size: var(--t-md);
  color: #bfd8e2;
  font-weight: 500;
}
.price {
  font-family: Fredoka, sans-serif;
  font-weight: 700;
  font-size: var(--t-4xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 5px 0 2px;
}
.result .sub {
  font-size: var(--t-sm);
  color: #a8c4cf;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 9px;
  margin-top: 14px;
}
.kpi {
  background: rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  padding: 9px 11px;
}
.kpi u {
  display: block;
  text-decoration: none;
  font-size: var(--t-xs);
  color: #a8c4cf;
  margin-bottom: 2px;
}
.kpi b {
  font-family: Nunito, sans-serif;
  font-size: var(--t-md);
  font-weight: 700;
}

.item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0eadd;
}
.item .info {
  min-width: 0;
}
/* La primera columna de 52px es para la miniatura. Las filas que no tienen
   foto (las ventas, los insumos del editor) metían el nombre y la fecha en
   esos 52px y el texto se amontonaba encima de sí mismo. */
.item.sinFoto {
  grid-template-columns: 1fr auto;
}
.item .ctrl {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.item:last-child {
  border-bottom: 0;
}
.thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex: none;
  background: var(--deep-soft);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: var(--t-xl);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.item .info {
  flex: 1;
  min-width: 0;
}
.item .info b {
  display: block;
  font-size: var(--t-md);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item .info span {
  font-size: var(--t-sm);
  color: var(--soft);
}
.item .val {
  text-align: right;
  flex: none;
}
.item .val b {
  font-family: Nunito, sans-serif;
  font-size: var(--t-md);
  display: block;
}
.item .val span {
  font-size: var(--t-xs);
  color: var(--soft);
}
.qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.qty button {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: var(--t-lg);
  line-height: 1;
  color: var(--deep);
  cursor: pointer;
  font-family: Fredoka, sans-serif;
}
.stockcol {
  display: flex;
  align-items: center;
  gap: 7px;
}
.stockcol .stlbl {
  margin: 0;
}
.stlbl {
  font-size: var(--t-xs);
  font-weight: 800;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.qty.chico button {
  width: 28px;
  height: 28px;
  font-size: var(--t-md);
}
.stnum {
  font-style: normal;
  min-width: 22px;
  text-align: center;
  font-weight: 800;
  font-size: var(--t-md);
  color: var(--soft);
}
.stnum.hay {
  color: var(--leaf);
}
.qty input {
  width: 48px;
  text-align: center;
  padding: 6px 2px;
  font-size: var(--t-input);
}
.pill {
  display: inline-block;
  font-size: var(--t-xs);
  font-weight: 800;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--deep-soft);
  color: var(--deep);
}
.pill {
  white-space: nowrap;
}
.pill.g {
  background: #e4f0da;
  color: #4a7127;
}
.verlink {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: var(--t-lg);
  line-height: 1;
  border-radius: 10px;
}
.pill.y {
  background: #fbeedc;
  color: #8a5320;
}
.empty {
  text-align: center;
  color: var(--soft);
  font-size: var(--t-sm);
  padding: 22px 8px;
}
.warn {
  background: #fbf1e2;
  border: 1.5px solid #efd8b8;
  border-radius: 12px;
  padding: 11px 13px;
  font-size: var(--t-sm);
  color: #7a5a2e;
  margin-bottom: 12px;
}
.warn.grave {
  background: #fbefec;
  border-color: #e8c6be;
  color: #a8483a;
}
.warn.grave {
  background: #fbefec;
  border-color: #e8c6be;
  color: #a8483a;
}
.entrada {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 24px;
}
.entrada[hidden] {
  display: none !important;
}
.entrada > div {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.entrada img {
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  object-fit: contain;
}
.entrada h1 {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: var(--t-2xl);
  color: #1f5758;
}
.entrada h1 i {
  font-style: normal;
  font-weight: 700;
  color: var(--clay);
}
.entrada p {
  color: var(--soft);
  font-size: var(--t-md);
  margin: 8px 0 20px;
}
.entrada label {
  display: block;
  text-align: left;
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--soft);
  margin: 12px 0 6px;
}
.entrada .err {
  color: #a8483a;
  font-weight: 700;
  font-size: var(--t-sm);
  margin: 12px 0 0;
}
.entrada .mut {
  font-size: var(--t-sm);
  margin-top: 16px;
}
.toast {
  position: fixed;
  left: 50%;
  top: 10px;
  bottom: auto;
  transform: translateX(-50%) translateY(-200%);
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: var(--t-sm);
  box-shadow: var(--shadow);
  z-index: 60;
  transition: transform 0.3s;
  max-width: 88vw;
  text-align: center;
}
.toast.on {
  transform: translateX(-50%) translateY(0);
}
/* Arriba de todo: si no, los avisos quedaban tapados por el punto de venta
   y por la ventana de la Mind, que son opacos y van en 85. */
.toast {
  z-index: 95;
}
.sheet {
  position: fixed;
  inset: 0;
  background: rgba(32, 64, 78, 0.45);
  z-index: 50;
  display: none;
  align-items: flex-end;
}
.sheet.on {
  display: flex;
}
.sheet > div {
  background: var(--surface);
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(20px + var(--safe));
  max-width: 900px;
  margin: 0 auto;
}
@media (min-width: 700px) {
  .sheet {
    align-items: center;
  }
  .sheet > div {
    border-radius: 18px;
    max-width: 620px;
  }
}
.mut {
  font-size: var(--t-sm);
  color: var(--soft);
}
.ficha {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  margin-bottom: 7px;
  background: #fff;
  overflow: hidden;
}
.ficha[open] {
  background: #fdfbf6;
  border-color: var(--deep);
}
.ficha > summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--t-md);
}
.ficha > summary::-webkit-details-marker {
  display: none;
}
.ficha > summary:after {
  content: "›";
  margin-left: auto;
  color: var(--soft);
  font-size: var(--t-xl);
  line-height: 1;
  transform: rotate(90deg);
  flex: none;
}
.ficha[open] > summary:after {
  transform: rotate(-90deg);
}
.ficha > summary b {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ficha > summary .det {
  font:
    400 var(--t-sm)/1.2 Nunito,
    sans-serif;
  color: var(--soft);
  white-space: nowrap;
  flex: none;
}
.ficha > div {
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 12px;
}
.ficha > div[style] {
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 12px !important;
}
.swatch {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.5px solid rgba(32, 64, 78, 0.18);
  flex: none;
}
.bajo {
  color: #a8483a;
  font-weight: 700;
}
.buscador {
  margin-bottom: 10px;
}
.vithead {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.vithead img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  object-fit: cover;
  flex: none;
}
.vitcat {
  font:
    600 var(--t-sm) Fredoka,
    sans-serif;
  color: var(--clay);
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vitcat:first-child {
  margin-top: 4px;
}
.vitcat:after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.vitgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.vitem {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fdfbf6;
}
.vitem .ph {
  position: relative;
  aspect-ratio: 1;
  background: var(--deep-soft);
  display: grid;
  place-items: center;
  font-size: var(--t-3xl);
}
.vitem .ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s;
}
.vitem .ph img.on {
  opacity: 1;
}
.vitem .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  color: var(--deep);
  font-size: var(--t-lg);
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}
.vitem .nav.prev {
  left: 5px;
}
.vitem .nav.next {
  right: 5px;
}
.vitem .cnt {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(58, 58, 56, 0.6);
  color: #fff;
  font:
    800 var(--t-micro) Nunito,
    sans-serif;
  padding: 2px 7px;
  border-radius: 999px;
  z-index: 2;
}
.playbtn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(31, 87, 88, 0.88);
  color: #fff;
  font-size: var(--t-sm);
  cursor: pointer;
  padding: 0;
  line-height: 34px;
}
.vitem .ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vitem .txt {
  padding: 9px 10px 11px;
}
.vitem .txt b {
  display: block;
  font:
    600 var(--t-sm) Fredoka,
    sans-serif;
  color: var(--ink);
}
.vitem .txt p {
  margin: 3px 0 7px;
  font-size: var(--t-sm);
  line-height: 1.4;
  color: var(--soft);
  min-height: 2.4em;
}
.vitem .txt u {
  text-decoration: none;
  font:
    700 var(--t-md) Nunito,
    sans-serif;
  color: var(--deep);
}
.mkt {
  margin-top: 14px;
  padding: 13px;
  border-radius: 13px;
  background: #fdfbf6;
  border: 1.5px solid var(--line);
}
.mkt .bar {
  position: relative;
  height: 34px;
  margin: 12px 0 6px;
}
.mkt .track {
  position: absolute;
  top: 15px;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 3px;
  background: var(--line);
}
.mkt .mk,
.mkt .yo {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}
.mkt .mk i,
.mkt .yo i {
  display: block;
  width: 3px;
  height: 22px;
  border-radius: 2px;
  margin: 0 auto;
}
.mkt .mk i {
  background: var(--soft);
}
.mkt .yo i {
  background: var(--deep);
}
.mkt .mk b,
.mkt .yo b {
  font:
    700 var(--t-xs) Nunito,
    sans-serif;
  display: block;
  margin-top: 3px;
}
.mkt .mk b {
  color: var(--soft);
}
.mkt .yo b {
  color: var(--deep);
}
.mkt p {
  margin: 8px 0 0;
  font-size: var(--t-sm);
  line-height: 1.45;
}
.mkt.alta {
  background: #fbf1e2;
  border-color: #efd8b8;
}
.mkt.baja {
  background: #fbefec;
  border-color: #e8c6be;
}
.mkt.ok {
  background: #f1f6ea;
  border-color: #d9e7c6;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0 16px;
}
body.modoventa nav.tabs button[data-tab="calc"],
body.modoventa nav.tabs button[data-tab="ped"],
body.modoventa nav.tabs button[data-tab="vit"],
body.modoventa nav.tabs button[data-tab="rad"],
body.modoventa nav.tabs button[data-tab="cfg"] {
  display: none;
}
body.modoventa .verCat {
  display: none;
}
.salirventa {
  display: none;
}
body.modoventa .salirventa {
  display: flex;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
