/* MIRIFEL · sistema visual
   Base clara. Un solo acento: el vino. El festón (orilla de encaje) es el detalle de marca. */

/* Fuentes locales: la app no depende de internet. */
@font-face {
  font-family: "Marcellus";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/marcellus-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/nunito-sans-latin.woff2") format("woff2");
}

:root {
  /* Primitivos de marca */
  --crema: #FEEFAC;
  --crema-suave: #FFF8DA;
  --vino: #9C324E;
  --vino-oscuro: #7D2840;
  --vino-tenue: #F7E8EC;
  --beige: #EDCAA6;
  --beige-suave: #F9EEE2;
  --blanco: #FFFFFF;

  /* Semánticos */
  --fondo: var(--blanco);
  --texto: #3A2730;
  --texto-2: #6A5059;
  --linea: #EEDFD0;
  --borde-campo: #A8856A;
  --acento: var(--vino);
  --acento-hover: var(--vino-oscuro);
  --aviso-fondo: var(--crema);
  --aviso-texto: #6B4E00;
  --sombra-1: 0 1px 2px rgb(58 39 48 / 0.06), 0 2px 8px rgb(58 39 48 / 0.06);
  --sombra-2: 0 2px 4px rgb(58 39 48 / 0.06), 0 12px 32px rgb(58 39 48 / 0.12);

  /* Espaciado: múltiplos de 4 */
  --e1: 4px; --e2: 8px; --e3: 12px; --e4: 16px; --e5: 24px; --e6: 32px; --e7: 48px; --e8: 64px;

  /* Radios concéntricos: externo = interno + relleno */
  --r-chico: 8px;
  --r: 12px;
  --r-grande: 20px;

  /* Tipografía: tres tamaños y una nota */
  --f-titulo: "Marcellus", "Times New Roman", serif;
  --f-texto: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --t-1: 2rem;      /* títulos de pantalla y cifras grandes */
  --t-2: 1.25rem;   /* secciones y cifras */
  --t-3: 1rem;      /* texto */
  --t-nota: 0.875rem;

  --curva: cubic-bezier(0.2, 0, 0, 1);
  --rail: 232px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--f-texto);
  font-size: var(--t-3);
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--acento); text-underline-offset: 3px; }
a:hover { color: var(--acento-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.num, .cifra { font-variant-numeric: tabular-nums lining-nums; }
.oculto-visual { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--vino); outline-offset: 2px; border-radius: 4px; }

.icono { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icono.chico { width: 16px; height: 16px; }

/* ------------------------------------------------------------ marco */

.marco {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100dvh;
}

.banda {
  grid-column: 1 / -1;
  position: relative;
  background: var(--crema);
  padding: var(--e4) var(--e6) var(--e5);
  display: grid;
  grid-template-columns: calc(var(--rail) - var(--e6)) minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--e5);
}
/* El festón: orilla de encaje de ropón al pie de la banda */
.banda::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -10px;
  height: 10px;
  background: var(--crema);
  -webkit-mask: radial-gradient(circle at 10px 0, #000 9.5px, transparent 10px) 0 0 / 20px 10px repeat-x;
  mask: radial-gradient(circle at 10px 0, #000 9.5px, transparent 10px) 0 0 / 20px 10px repeat-x;
  pointer-events: none;
}
/* Puntitos de bordado inglés, encima del festón */
.banda::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 4px;
  background: radial-gradient(circle at 10px 2px, rgb(156 50 78 / 0.28) 1.5px, transparent 2px) 0 0 / 20px 4px repeat-x;
  pointer-events: none;
}

.marca { display: block; width: 148px; align-self: center; border-radius: var(--r-chico); }
.marca img { width: 100%; height: auto; }

.banda-texto { min-width: 0; }
.titulo {
  font-family: var(--f-titulo);
  font-weight: 400;
  font-size: var(--t-1);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--texto);
  text-wrap: balance;
}
.subtitulo { color: var(--texto-2); margin-top: var(--e1); }
.volver {
  display: inline-flex; align-items: center; gap: var(--e1);
  color: var(--texto-2); text-decoration: none; font-weight: 600; font-size: var(--t-nota);
  margin-bottom: var(--e2); min-height: 32px;
}
.volver:hover { color: var(--vino); }
.banda-acciones { display: flex; flex-wrap: wrap; gap: var(--e3); justify-content: flex-end; }

/* Riel de navegación */
.riel {
  position: sticky; top: 0;
  align-self: start;
  height: 100dvh;
  padding: var(--e6) var(--e4) var(--e5);
  display: flex; flex-direction: column; gap: var(--e1);
}
.riel a, .riel button.nav {
  display: flex; align-items: center; gap: var(--e3);
  min-height: 48px; padding: 0 var(--e4);
  border-radius: var(--r);
  color: var(--texto-2); text-decoration: none; font-weight: 600;
  background: transparent; border: 0; width: 100%; text-align: left; cursor: pointer;
  transition-property: background-color, color; transition-duration: 150ms; transition-timing-function: var(--curva);
}
.riel a:hover, .riel button.nav:hover { background: var(--beige-suave); color: var(--texto); }
.riel a[aria-current="page"] { background: var(--vino-tenue); color: var(--vino); }
.riel .separa { flex: 1; }
.riel .quien { padding: var(--e2) var(--e4); color: var(--texto-2); font-size: var(--t-nota); }

.contenido {
  min-width: 0;
  padding: var(--e7) var(--e6) var(--e8);
  max-width: 1120px;
  width: 100%;
}

/* Barra inferior (teléfono) */
.barra { display: none; }
.hoja-mas { display: none; }

@media (max-width: 1023px) {
  :root { --rail: 104px; }
  /* Tablet: el título a lo ancho y los botones en su propio renglón, para que nada se apriete. */
  .banda { grid-template-columns: 88px minmax(0, 1fr); padding: var(--e4) var(--e5) var(--e5); row-gap: var(--e4); }
  .banda-acciones { grid-column: 1 / -1; justify-content: flex-start; }
  .banda-acciones .boton-ayuda { margin-left: auto; }
  .marca { width: 88px; }
  .riel { padding: var(--e6) var(--e2); align-items: stretch; }
  .riel a, .riel button.nav { flex-direction: column; justify-content: center; gap: var(--e1); padding: var(--e2) var(--e1); min-height: 64px; text-align: center; font-size: var(--t-nota); line-height: 1.3; }
  .riel .quien { display: none; }
  .contenido { padding: var(--e6) var(--e5) var(--e8); }
}

@media (max-width: 639px) {
  .marco { grid-template-columns: minmax(0, 1fr); }
  .riel { display: none; }
  .banda { grid-template-columns: minmax(0, 1fr); gap: var(--e3); padding: var(--e3) var(--e4) var(--e4); }
  .marca { width: 72px; }
  .banda-acciones { justify-content: flex-start; }
  .banda-acciones .boton, .hoy-acciones .boton { flex: 1 1 auto; }
  .titulo { font-size: 1.75rem; }
  .contenido { padding: var(--e6) var(--e4) calc(96px + env(safe-area-inset-bottom)); }
  .avisos { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .barra {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--blanco);
    box-shadow: 0 -1px 0 var(--linea), 0 -8px 24px rgb(58 39 48 / 0.06);
    padding: var(--e1) var(--e1) calc(var(--e1) + env(safe-area-inset-bottom));
  }
  .barra a, .barra button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 56px; border: 0; background: none; color: var(--texto-2); text-decoration: none;
    font-size: 0.75rem; font-weight: 700; border-radius: var(--r); cursor: pointer; min-width: 0;
  }
  @media (max-width: 359px) { .barra a, .barra button { font-size: 0.6875rem; letter-spacing: -0.01em; } }
  .barra a[aria-current="page"] { color: var(--vino); }
  .barra a[aria-current="page"] .icono { stroke-width: 2.25; }
}

/* ------------------------------------------------------------ botones */

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--e2);
  min-height: 48px; padding: 0 var(--e5);
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--vino); color: var(--blanco);
  font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition-property: background-color, color, border-color, scale; transition-duration: 150ms; transition-timing-function: var(--curva);
}
.boton:hover { background: var(--vino-oscuro); color: var(--blanco); }
.boton:active { scale: 0.96; }
.boton.secundario { background: var(--blanco); color: var(--vino); border-color: var(--beige); }
.boton.secundario:hover { background: var(--vino-tenue); border-color: var(--vino); color: var(--vino-oscuro); }
.banda .boton.secundario { border-color: rgb(156 50 78 / 0.35); }
.boton.suave { background: var(--beige-suave); color: var(--texto); }
.boton.suave:hover { background: var(--beige); color: var(--texto); }
.boton.texto { background: none; color: var(--vino); padding: 0 var(--e3); min-height: 44px; }
.boton.texto:hover { background: var(--vino-tenue); }
.boton.chico { min-height: 40px; padding: 0 var(--e4); font-size: var(--t-nota); border-radius: var(--r-chico); }
.boton.ancho { width: 100%; }
.boton[aria-busy="true"] { cursor: progress; opacity: 1; background: var(--vino-oscuro); color: var(--blanco); }
.boton[disabled] { background: var(--beige-suave); color: var(--texto-2); cursor: not-allowed; scale: 1; }
.boton-icono {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r);
  border: 0; background: transparent; color: var(--texto-2); cursor: pointer;
  transition-property: background-color, color, scale; transition-duration: 150ms; transition-timing-function: var(--curva);
}
.boton-icono:hover { background: var(--beige-suave); color: var(--texto); }
.boton-icono:active { scale: 0.96; }
form.en-linea { display: inline; }

/* ------------------------------------------------------------ secciones y texto */

* + .seccion { margin-top: var(--e7); }
.seccion-cabeza { display: flex; align-items: baseline; justify-content: space-between; gap: var(--e4); margin-bottom: var(--e4); flex-wrap: wrap; }
h2.sub {
  font-family: var(--f-titulo); font-weight: 400; font-size: var(--t-2); line-height: 1.3; letter-spacing: 0;
}
.nota { font-size: var(--t-nota); color: var(--texto-2); }
.texto-2 { color: var(--texto-2); }
.vacio {
  padding: var(--e6) var(--e5); text-align: center; color: var(--texto-2);
  background: var(--beige-suave); border-radius: var(--r-grande);
}
.vacio p + p { margin-top: var(--e2); }
.vacio .boton { margin-top: var(--e4); }
.dos-columnas { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--e7); align-items: start; }
.dos-columnas.iguales { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1023px) { .dos-columnas, .dos-columnas.iguales { grid-template-columns: minmax(0, 1fr); gap: var(--e6); } }

/* Superficie: panel blanco con sombra suave, sin borde de color */
.panel { background: var(--blanco); border-radius: var(--r-grande); box-shadow: var(--sombra-1), 0 0 0 1px var(--linea); padding: var(--e5); }
.panel.compacto { padding: var(--e4); }
.panel-crema { background: var(--crema-suave); border-radius: var(--r-grande); padding: var(--e5); }

/* ------------------------------------------------------------ cifras del día y del periodo */

.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: var(--e5) var(--e4); }
.cifras > div { padding: var(--e1) 0 var(--e1) var(--e4); box-shadow: inset 1px 0 0 var(--linea); }
.cifras dt { color: var(--texto-2); font-size: var(--t-nota); font-weight: 600; }
.cifras dd { font-size: var(--t-1); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; margin-top: var(--e1); font-variant-numeric: tabular-nums; }
.cifras dd small { display: block; font-size: var(--t-nota); font-weight: 600; color: var(--texto-2); letter-spacing: 0; margin-top: var(--e1); }
@media (max-width: 479px) { .cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cifras dd { font-size: 1.625rem; } }

.hoy {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--e5); align-items: center;
}
.hoy-cifras { display: flex; flex-wrap: wrap; gap: var(--e2) var(--e6); align-items: baseline; }
.hoy-cifras .grande { font-size: var(--t-1); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hoy-acciones { display: flex; flex-wrap: wrap; gap: var(--e3); justify-content: flex-end; }
@media (max-width: 767px) { .hoy { grid-template-columns: minmax(0, 1fr); } .hoy-acciones { justify-content: flex-start; } }

/* ------------------------------------------------------------ segmentos (periodos, pestañas) */

.segmentos { display: inline-flex; padding: var(--e1); gap: var(--e1); background: var(--beige-suave); border-radius: var(--r); flex-wrap: wrap; }
.segmentos a {
  min-height: 40px; display: inline-flex; align-items: center; padding: 0 var(--e4);
  border-radius: var(--r-chico); text-decoration: none; color: var(--texto-2); font-weight: 600; font-size: var(--t-nota);
  transition-property: background-color, color; transition-duration: 150ms;
}
.segmentos a:hover { color: var(--texto); }
.segmentos a[aria-current="true"] { background: var(--blanco); color: var(--vino); box-shadow: var(--sombra-1); }

/* ------------------------------------------------------------ gráficas */

.grafica { position: relative; padding-left: 64px; }
.grafica-area { position: relative; height: 200px; }
.grafica .guia { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--linea); }
.grafica .guia span {
  position: absolute; right: calc(100% + 8px); top: 0; translate: 0 -50%;
  font-size: 0.75rem; font-weight: 600; color: var(--texto-2); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.grafica .columnas { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; }
.grafica .mes { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; border-radius: 6px; }
.grafica .mes:focus-visible { outline: 2px solid var(--vino); outline-offset: 2px; }
.grafica .barra-dato {
  width: 62%; min-height: 0; border-radius: 4px 4px 0 0; background: var(--beige);
  transition: background-color 150ms var(--curva);
}
.grafica .mes.actual .barra-dato { background: var(--vino); }
.grafica .mes:hover .barra-dato, .grafica .mes:focus-visible .barra-dato { background: var(--vino-oscuro); }
.grafica .valor-barra { font-size: 0.75rem; font-weight: 800; margin-bottom: var(--e1); white-space: nowrap; font-variant-numeric: tabular-nums; }
.etiquetas-meses { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; margin-top: var(--e2); }
.etiquetas-meses span { text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--texto-2); }
.tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--texto); color: var(--blanco); border-radius: var(--r-chico);
  padding: var(--e2) var(--e3); font-size: var(--t-nota); line-height: 1.4; white-space: nowrap;
  box-shadow: var(--sombra-2); transform: translate(-50%, calc(-100% - 8px));
  opacity: 0; transition: opacity 150ms var(--curva);
}
.tip.visible { opacity: 1; }
.tip strong { font-variant-numeric: tabular-nums; }

.ranking li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--e1) var(--e3);
  padding: var(--e3) 0; align-items: baseline;
}
.ranking li + li { box-shadow: 0 -1px 0 var(--linea); }
.ranking .pos { color: var(--texto-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.ranking .nombre { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.ranking .nombre a { color: var(--texto); text-decoration: none; }
.ranking .nombre a:hover { color: var(--vino); text-decoration: underline; }
.ranking .valor { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.ranking .detalle { grid-column: 2 / -1; display: flex; justify-content: space-between; gap: var(--e3); color: var(--texto-2); font-size: var(--t-nota); }
.ranking .medida { grid-column: 2 / -1; height: 4px; border-radius: 2px; background: var(--beige-suave); overflow: hidden; }
.ranking .medida span { display: block; height: 100%; border-radius: 2px; background: var(--vino); }

/* ------------------------------------------------------------ listas */

.lista > li, .lista > .fila { padding: var(--e4) 0; }
.lista > li + li, .lista > .fila + .fila { box-shadow: 0 -1px 0 var(--linea); }
.lista > li:has(> .fila-link) { padding: var(--e1) 0; }
.fila-link {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--e1) var(--e4); align-items: center;
  text-decoration: none; color: inherit; border-radius: var(--r);
  margin: 0 calc(var(--e3) * -1); padding: var(--e3);
  transition: background-color 150ms var(--curva);
}
.fila-link:hover { background: var(--beige-suave); color: inherit; }
.fila-link .principal { font-weight: 700; }
.fila-link .secundario { color: var(--texto-2); font-size: var(--t-nota); }
.fila-link .derecha { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ etiquetas de estado */

.marca-estado {
  display: inline-flex; align-items: center; gap: var(--e1);
  min-height: 24px; padding: 0 var(--e2); border-radius: 999px;
  font-size: 0.8125rem; font-weight: 700; white-space: nowrap;
  background: var(--beige-suave); color: var(--texto);
}
.marca-estado.aviso { background: var(--aviso-fondo); color: var(--aviso-texto); }
.marca-estado.vino { background: var(--vino-tenue); color: var(--vino); }
.marca-estado.listo { background: var(--vino); color: var(--blanco); }
.marca-estado .punto { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ------------------------------------------------------------ inventario */

.filtros { display: flex; flex-wrap: wrap; gap: var(--e3); align-items: center; margin-bottom: var(--e5); }
.buscar-campo { position: relative; flex: 1 1 280px; }
.buscar-campo > .icono { position: absolute; left: 14px; bottom: 14px; color: var(--texto-2); pointer-events: none; }
.buscar-campo input[type="search"], .buscar-campo input[type="text"] { padding-left: 44px; }
.campo-escaner { display: grid; gap: var(--e2); }
.campo-escaner > .etiqueta { font-weight: 700; font-size: var(--t-nota); }
.chips-cat { display: flex; gap: var(--e2); overflow-x: auto; padding-bottom: var(--e1); margin-bottom: var(--e5); scrollbar-width: none; }
.chips-cat::-webkit-scrollbar { display: none; }
.chips-cat a {
  flex: none; min-height: 40px; display: inline-flex; align-items: center; gap: var(--e2); padding: 0 var(--e4);
  border-radius: 999px; background: var(--beige-suave); color: var(--texto); text-decoration: none; font-weight: 600; font-size: var(--t-nota);
  transition-property: background-color, color; transition-duration: 150ms;
}
.chips-cat a:hover { background: var(--beige); }
.chips-cat a[aria-current="true"] { background: var(--vino); color: var(--blanco); }
.chips-cat .n { font-variant-numeric: tabular-nums; opacity: 0.75; }

.modelos > li { padding: var(--e1) 0; content-visibility: auto; contain-intrinsic-size: auto 120px; }
.modelos > li + li { box-shadow: 0 -1px 0 var(--linea); }
.modelo-fila {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--e2) var(--e4); align-items: start;
  text-decoration: none; color: inherit; border-radius: var(--r);
  margin: 0 calc(var(--e3) * -1); padding: var(--e3);
  transition: background-color 150ms var(--curva);
}
.modelo-fila:hover { background: var(--beige-suave); color: inherit; }
.miniatura {
  width: 56px; height: 56px; border-radius: var(--r-chico); background: var(--crema-suave); object-fit: cover;
  outline: 1px solid oklch(0 0 0 / 0.1); outline-offset: -1px;
  display: grid; place-items: center; color: var(--texto-2); font-family: var(--f-titulo); font-size: var(--t-2);
}
.modelo-fila .nombre { font-weight: 700; font-size: 1.0625rem; }
.modelo-fila .datos { color: var(--texto-2); font-size: var(--t-nota); }
.modelo-fila .total { text-align: right; font-variant-numeric: tabular-nums; }
.modelo-fila .total strong { display: block; font-size: var(--t-2); line-height: 1.2; }
.modelo-fila .total span { color: var(--texto-2); font-size: var(--t-nota); }
.tallas { display: flex; flex-wrap: wrap; gap: var(--e2); margin-top: var(--e2); }
.talla {
  display: inline-flex; align-items: center; gap: var(--e1); min-height: 30px; padding: 0 3px 0 var(--e2);
  border-radius: var(--r-chico); background: var(--beige-suave); font-size: var(--t-nota); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.talla b { font-weight: 800; background: var(--blanco); border-radius: 6px; min-width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0 var(--e1); margin-left: 2px; }
.talla .color { color: var(--texto-2); font-weight: 600; }
.talla.poco { background: var(--aviso-fondo); color: var(--aviso-texto); }
.talla.poco .color { color: var(--aviso-texto); }
.talla.cero { background: var(--blanco); box-shadow: inset 0 0 0 1px var(--linea); color: var(--texto-2); }
.talla.cero b { background: var(--beige-suave); }
.sin-foto .miniatura { display: none; }
.sin-foto .modelo-fila { grid-template-columns: minmax(0, 1fr) auto; }

.resumen-inv { display: flex; flex-wrap: wrap; gap: var(--e1) var(--e5); color: var(--texto-2); font-size: var(--t-nota); margin-bottom: var(--e4); }
.resumen-inv strong { color: var(--texto); font-variant-numeric: tabular-nums; }

/* Tablas */
.tabla-envoltura { overflow-x: auto; margin: 0 calc(var(--e2) * -1); }
table.tabla { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tabla th { text-align: left; font-size: var(--t-nota); font-weight: 700; color: var(--texto-2); padding: var(--e2); white-space: nowrap; }
.tabla td { padding: var(--e3) var(--e2); border-top: 1px solid var(--linea); vertical-align: middle; }
.tabla .num, .tabla th.num { text-align: right; }
.tabla .clave { font-weight: 700; letter-spacing: 0.01em; }
.tabla tfoot td { font-weight: 700; border-top: 2px solid var(--linea); }
.tabla a { font-weight: 700; color: var(--texto); text-decoration: none; }
.tabla a:hover { color: var(--vino); text-decoration: underline; }
.tabla a.boton { color: var(--vino); }

/* ------------------------------------------------------------ formularios */

.campo { display: grid; gap: var(--e2); }
.campo > label, .campo > .etiqueta { font-weight: 700; font-size: var(--t-nota); }
.campo .ayuda { font-size: var(--t-nota); color: var(--texto-2); }
.entrada, input[type="text"], input[type="search"], input[type="tel"], input[type="number"], input[type="date"],
input[type="password"], select, textarea {
  width: 100%; min-height: 48px; padding: 0 var(--e4);
  border: 1px solid var(--borde-campo); border-radius: var(--r);
  background: var(--blanco); font-size: 1rem;
  transition-property: border-color, box-shadow; transition-duration: 150ms;
}
textarea { padding: var(--e3) var(--e4); min-height: 96px; resize: vertical; line-height: 1.5; }
select {
  appearance: none; padding-right: 40px; background-color: var(--blanco); color: var(--texto);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236A5059' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 20px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--vino); box-shadow: 0 0 0 3px rgb(156 50 78 / 0.18);
}
input[type="number"] { font-variant-numeric: tabular-nums; }
input.dinero-campo { text-align: right; }
.rejilla { display: grid; gap: var(--e4); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.rejilla.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rejilla.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 639px) { .rejilla.dos, .rejilla.tres { grid-template-columns: minmax(0, 1fr); } }
.formulario { display: grid; gap: var(--e5); }
.acciones-form { display: flex; flex-wrap: wrap; gap: var(--e3); align-items: center; }
.acciones-form.fin { justify-content: flex-end; }

/* Interruptor (opción encendida o apagada) */
.opcion {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--e1) var(--e5); align-items: center;
  padding: var(--e4) 0;
}
.lista-opciones > .opcion + .opcion, .lista-opciones > * + * { box-shadow: 0 -1px 0 var(--linea); }
.opcion .titulo-op { font-weight: 700; }
.opcion .ayuda { color: var(--texto-2); font-size: var(--t-nota); grid-column: 1; max-width: 60ch; }
.opcion .control { grid-row: 1 / span 2; grid-column: 2; }
.interruptor { position: relative; display: inline-block; width: 52px; height: 32px; }
.interruptor input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.interruptor span {
  position: absolute; inset: 0; border-radius: 16px; background: #CDB8A5;
  transition: background-color 200ms var(--curva);
}
.interruptor span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--blanco); box-shadow: 0 1px 3px rgb(58 39 48 / 0.25);
  transition: translate 200ms var(--curva);
}
.interruptor input:checked + span { background: var(--vino); }
.interruptor input:checked + span::after { translate: 20px 0; }
.interruptor input:focus-visible + span { outline: 2px solid var(--vino); outline-offset: 2px; }
.opcion .control input[type="text"] { width: 280px; }
@media (max-width: 639px) {
  .opcion:has(input[type="text"], input[type="number"]) { grid-template-columns: minmax(0, 1fr); }
  .opcion:has(input[type="text"], input[type="number"]) .control { grid-row: auto; grid-column: 1; }
  .opcion .control input[type="text"] { width: 100%; }
}

.radios { display: flex; flex-wrap: wrap; gap: var(--e2); }
.radios label {
  display: inline-flex; align-items: center; gap: var(--e2); min-height: 44px; padding: 0 var(--e4);
  border-radius: var(--r); background: var(--beige-suave); font-weight: 600; cursor: pointer;
  transition-property: background-color, color; transition-duration: 150ms;
}
.radios input { accent-color: var(--vino); width: 18px; height: 18px; margin: 0; }
.radios label:has(input:checked) { background: var(--vino-tenue); color: var(--vino); }

/* ------------------------------------------------------------ captura (ventas, entradas, apartados) */

.captura { display: grid; gap: var(--e5); }
.buscador { position: relative; }
.resultados {
  position: absolute; left: 0; right: 0; top: calc(100% + var(--e2)); z-index: 15;
  background: var(--blanco); border-radius: var(--r-grande); box-shadow: var(--sombra-2), 0 0 0 1px var(--linea);
  padding: var(--e2); max-height: min(420px, 60dvh); overflow-y: auto;
  transform-origin: top center;
  animation: aparecer 160ms var(--curva);
}
.resultados[hidden] { display: none; }
.resultados button {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--e4); text-align: left;
  padding: var(--e3); border: 0; background: none; border-radius: var(--r); cursor: pointer;
}
.resultados button:hover, .resultados button[aria-selected="true"] { background: var(--beige-suave); }
.resultados button[disabled] { opacity: 1; color: var(--texto-2); cursor: not-allowed; }
.resultados .r-nombre { font-weight: 700; }
.resultados .r-datos { color: var(--texto-2); font-size: var(--t-nota); }
.resultados .r-derecha { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.resultados .r-derecha small { display: block; font-weight: 600; color: var(--texto-2); }
.resultados .r-vacio { padding: var(--e4); color: var(--texto-2); }

.renglones > li {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-flow: column; grid-auto-columns: auto; gap: var(--e2) var(--e4); align-items: center;
  padding: var(--e4) 0;
}
.renglones > li + li { box-shadow: 0 -1px 0 var(--linea); }
.renglones > li { position: relative; isolation: isolate; }
/* Algo recién agregado o guardado se ilumina un momento: solo opacidad, sin mover nada. */
.renglones > li.recien::before, li.ilumina::before, .fila.ilumina::before {
  content: ""; position: absolute; inset: 0 calc(var(--e2) * -1); z-index: -1;
  border-radius: var(--r); background: var(--crema); pointer-events: none;
  animation: iluminar 250ms ease-out 400ms both;
}
/* En tablas, la luz va dentro de cada celda: un ::before en la fila crearía una celda extra. */
tr.ilumina > td { position: relative; isolation: isolate; }
tr.ilumina > td::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--crema); pointer-events: none;
  animation: iluminar 250ms ease-out 400ms both;
}
li.ilumina, .fila.ilumina { position: relative; isolation: isolate; }
.renglones .r-nombre { font-weight: 700; }
.renglones .r-datos { color: var(--texto-2); font-size: var(--t-nota); }
.renglones .importe { min-width: 96px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.renglones select { min-height: 44px; width: auto; min-width: 160px; }
.renglones input.precio { width: 120px; min-height: 44px; text-align: right; }
@media (max-width: 767px) {
  .renglones > li { grid-auto-flow: row; grid-template-columns: repeat(3, auto); justify-content: space-between; }
  .renglones > li > :first-child { grid-column: 1 / -1; }
}

.contador { display: inline-flex; align-items: center; border-radius: var(--r); background: var(--beige-suave); }
.contador button { width: 44px; height: 44px; border: 0; background: none; border-radius: var(--r); cursor: pointer; display: grid; place-items: center; color: var(--texto); }
.contador button:hover { background: var(--beige); }
.contador button:active { scale: 0.96; }
.contador button[disabled] { color: #B9A79C; cursor: not-allowed; background: none; }
.contador output { min-width: 32px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

.total-captura {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--e4);
  padding: var(--e4) var(--e5); background: var(--crema-suave); border-radius: var(--r-grande);
}
.total-captura .monto { font-size: var(--t-1); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.total-captura .etiqueta { color: var(--texto-2); font-weight: 600; font-size: var(--t-nota); }

.escaner-nota { display: flex; align-items: center; gap: var(--e2); color: var(--texto-2); font-size: var(--t-nota); }

/* Rejilla de tallas para la entrada */
.tallas-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--e3); }
.tallas-rejilla .t {
  display: grid; gap: var(--e2); padding: var(--e3); border-radius: var(--r); background: var(--beige-suave);
  transition: background-color 150ms var(--curva);
}
.tallas-rejilla .t:has(output:not([data-v="0"])) { background: var(--crema); }
.tallas-rejilla .t .nombre-t { font-weight: 800; }
.tallas-rejilla .contador { background: var(--blanco); justify-content: space-between; }

.paso {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--e4); align-items: start;
}
.paso + .paso { margin-top: var(--e6); }
.paso .n {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--vino-tenue); color: var(--vino); font-weight: 800; font-variant-numeric: tabular-nums;
}
.paso h2 { margin-bottom: var(--e4); padding-top: 2px; }

.elegido {
  display: flex; align-items: center; justify-content: space-between; gap: var(--e4);
  padding: var(--e3) var(--e4); background: var(--crema-suave); border-radius: var(--r);
}
.elegido strong { display: block; }

/* ------------------------------------------------------------ detalle (apartados, pedidos) */

.saldo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--e4); }
.saldo div { padding: var(--e4); background: var(--beige-suave); border-radius: var(--r); }
.saldo div.falta { background: var(--crema); }
.saldo dt { font-size: var(--t-nota); color: var(--texto-2); font-weight: 600; }
.saldo dd { font-size: var(--t-2); font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 479px) { .saldo { grid-template-columns: minmax(0, 1fr); } }

.pasos-estado { display: flex; flex-wrap: wrap; gap: var(--e2); }
.pasos-estado li { display: flex; align-items: center; gap: var(--e2); color: var(--texto-2); font-weight: 600; font-size: var(--t-nota); }
.pasos-estado li + li::before { content: ""; width: 24px; height: 1px; background: var(--borde-campo); }
.pasos-estado li.hecho { color: var(--texto); }
.pasos-estado li.actual { color: var(--vino); font-weight: 800; }
.pasos-estado .bolita { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 2px currentColor; }
.pasos-estado .hecho .bolita, .pasos-estado .actual .bolita { background: currentColor; }

.datos-lista { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--e2) var(--e5); }
.datos-lista dt { color: var(--texto-2); font-size: var(--t-nota); font-weight: 600; padding-top: 2px; }
.datos-lista dd { font-weight: 600; }

/* ------------------------------------------------------------ avisos emergentes */

.avisos {
  position: fixed; bottom: var(--e5); left: 50%; translate: -50% 0; z-index: 60;
  display: grid; gap: var(--e2); width: min(560px, calc(100vw - 32px));
}
.aviso-emergente {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: var(--e3); align-items: center;
  padding: var(--e3) var(--e2) var(--e3) var(--e4);
  border-radius: var(--r-grande); background: var(--texto); color: var(--blanco);
  box-shadow: var(--sombra-2); font-weight: 600;
  animation: bajar 240ms var(--curva);
}
.aviso-emergente.error { background: var(--vino); }
.aviso-emergente .boton-icono { color: var(--blanco); width: 40px; height: 40px; }
.aviso-emergente .boton-icono:hover { background: rgb(255 255 255 / 0.14); color: var(--blanco); }
.aviso-emergente .palomita { animation: palomita 220ms var(--curva) 80ms both; }
.aviso-emergente .aviso-accion { background: var(--blanco); color: var(--vino); }
.aviso-emergente .aviso-accion:hover { background: var(--vino-tenue); color: var(--vino-oscuro); }
.aviso-emergente.saliendo { opacity: 0; translate: 0 6px; transition: opacity 180ms ease-out, translate 180ms ease-out; }

/* Aviso fijo dentro de la página (texto + ícono, nunca solo color) */
.recuadro {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--e3); align-items: start;
  padding: var(--e4); border-radius: var(--r); background: var(--crema-suave);
}
.recuadro .icono { color: var(--aviso-texto); margin-top: 2px; }
.recuadro.vino { background: var(--vino-tenue); }
.recuadro.vino .icono { color: var(--vino); }

/* ------------------------------------------------------------ diálogos */

dialog {
  border: 0; padding: 0; border-radius: var(--r-grande); background: var(--blanco); color: var(--texto);
  box-shadow: var(--sombra-2); width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
}
dialog::backdrop { background: rgb(58 39 48 / 0.4); }
dialog { overscroll-behavior: contain; }
dialog[open] { animation: aparecer 200ms var(--curva); }
dialog[open]::backdrop { animation: velo 200ms var(--curva); }
.dialogo { padding: var(--e5); display: grid; gap: var(--e5); }
.dialogo-cabeza { display: flex; justify-content: space-between; align-items: start; gap: var(--e3); }
.dialogo h2 { font-family: var(--f-titulo); font-weight: 400; font-size: var(--t-2); }

/* Hoja "Más" en teléfono */
@media (max-width: 639px) {
  dialog.hoja { margin: auto 0 0; width: 100%; max-width: none; border-radius: var(--r-grande) var(--r-grande) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  dialog.hoja[open] { animation: subir 240ms var(--curva); }
}
.hoja nav a, .hoja nav button {
  display: flex; align-items: center; gap: var(--e3); min-height: 56px; padding: 0 var(--e4);
  border-radius: var(--r); text-decoration: none; color: var(--texto); font-weight: 600; border: 0; background: none; width: 100%; cursor: pointer;
}
.hoja nav a:hover, .hoja nav button:hover { background: var(--beige-suave); }

/* ------------------------------------------------------------ pieza */

.codigo-barras { background: var(--blanco); padding: var(--e3); border-radius: var(--r); box-shadow: 0 0 0 1px var(--linea); display: inline-block; }
.codigo-barras svg { display: block; max-width: 100%; height: 56px; width: auto; }

.movs li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--e4); padding: var(--e3) 0; align-items: baseline; }
.movs li + li { box-shadow: 0 -1px 0 var(--linea); }
.movs .delta { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.movs .saldo-m { color: var(--texto-2); font-size: var(--t-nota); font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }

/* ------------------------------------------------------------ entrar */

.entrar-marco { min-height: 100dvh; display: grid; place-items: center; background: var(--crema); padding: var(--e5); }
.entrar-caja { width: min(420px, 100%); background: var(--blanco); border-radius: var(--r-grande); padding: 0 var(--e6) var(--e6); box-shadow: var(--sombra-2); display: grid; gap: var(--e5); overflow: hidden; }
/* El logo conserva su proporción (640x466) y llena el borde superior de la tarjeta. */
.entrar-caja img { display: block; width: calc(100% + 2 * var(--e6)); max-width: none; height: auto; aspect-ratio: 640 / 466; margin: 0 calc(-1 * var(--e6)); object-fit: contain; }
@media (max-width: 480px) { .entrar-marco { padding: var(--e4); } .entrar-caja { padding: 0 var(--e5) var(--e5); } .entrar-caja img { width: calc(100% + 2 * var(--e5)); margin: 0 calc(-1 * var(--e5)); } }

/* ------------------------------------------------------------ animaciones (solo para mostrar qué cambió) */

@keyframes aparecer { from { opacity: 0; scale: 0.98; } to { opacity: 1; scale: 1; } }
@keyframes velo { from { opacity: 0; } to { opacity: 1; } }
@keyframes bajar { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
@keyframes subir { from { translate: 0 24px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes iluminar { from { opacity: 1; } to { opacity: 0; } }
@keyframes palomita { from { opacity: 0; scale: 0.25; } to { opacity: 1; scale: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .boton:active, .boton-icono:active, .contador button:active { scale: 1; }
}

/* ------------------------------------------------------------ impresión (tickets y etiquetas) */

.solo-impresion { display: none; }
@media print {
  .riel, .barra, .banda, .avisos, .no-imprimir { display: none !important; }
  .marco { display: block; }
  .contenido { padding: 0; max-width: none; }
  .solo-impresion { display: block; }
  body { background: #fff; }
}

/* ------------------------------------------------------------ probar lector */

.lectura-grande {
  margin-top: var(--e5); padding: var(--e5); border-radius: var(--r-grande); background: var(--crema-suave);
  display: grid; gap: var(--e2); min-height: 120px; align-content: center;
}
.codigo-leido {
  font-size: var(--t-1); font-weight: 800; line-height: 1.2; letter-spacing: 0.01em;
  overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
}
.lector-cifras { margin-top: var(--e5); }
.pasos-lista { list-style: decimal; padding-left: var(--e5); display: grid; gap: var(--e3); }
.pasos-lista li { padding-left: var(--e1); line-height: 1.5; }

/* Cifras que suben: el valor final reserva el ancho, el que cuenta va encima. */
.contar { display: inline-grid; }
.contar > .contar-fin, .contar > .contar-vivo { grid-area: 1 / 1; }
.contar > .contar-fin { visibility: hidden; }
.contar > .contar-vivo { justify-self: start; }

/* ------------------------------------------------------------ ayuda y tutorial */

.boton-ayuda { width: 48px; height: 48px; color: var(--vino); }
.boton-ayuda .icono { width: 24px; height: 24px; }
.banda .boton-ayuda:hover { background: rgb(255 255 255 / 0.6); color: var(--vino-oscuro); }

.menu-ayuda { display: grid; gap: var(--e1); }
.menu-ayuda a, .menu-ayuda button {
  display: flex; align-items: center; gap: var(--e3); min-height: 56px; padding: 0 var(--e4);
  border-radius: var(--r); border: 0; background: none; width: 100%; text-align: left;
  color: var(--texto); font-weight: 700; font-size: 1.0625rem; text-decoration: none; cursor: pointer;
  transition: background-color 150ms var(--curva);
}
.menu-ayuda a:hover, .menu-ayuda button:hover { background: var(--beige-suave); }
.menu-ayuda .icono { color: var(--vino); }

#bienvenida { width: min(440px, calc(100vw - 32px)); }
#bienvenida .dialogo { text-align: center; gap: var(--e4); padding: var(--e6) var(--e5); }
#bienvenida h2 { font-family: var(--f-titulo); font-weight: 400; font-size: var(--t-1); line-height: 1.2; text-wrap: balance; }
#bienvenida p { font-size: 1.0625rem; }
.bienvenida-logo { width: 150px; height: auto; margin: 0 auto; border-radius: var(--r); }
.bienvenida-botones { display: grid; gap: var(--e3); margin-top: var(--e2); }
.bienvenida-botones .boton { min-height: 56px; font-size: 1.0625rem; }

/* Aviso de práctica: claro y siempre visible mientras dura. */
.practica-aviso {
  position: sticky; top: 0; z-index: 70;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--e2) var(--e4);
  padding: var(--e2) var(--e4); background: var(--vino); color: var(--blanco); font-size: 1rem;
}
.practica-aviso .icono { color: var(--crema); }
.practica-aviso .boton { background: var(--blanco); color: var(--vino); min-height: 40px; }
.practica-aviso .boton:hover { background: var(--crema); color: var(--vino-oscuro); }
@media (max-width: 639px) {
  .practica-aviso { flex-wrap: nowrap; justify-content: space-between; text-align: left; font-size: var(--t-nota); line-height: 1.35; }
  .practica-aviso > .icono { display: none; }
  .practica-aviso .boton { flex: none; padding: 0 var(--e3); }
}

.tour { position: fixed; inset: 0; z-index: 80; }
.tour-velo { position: absolute; inset: 0; }
.tour-foco {
  position: fixed; border-radius: var(--r); pointer-events: none;
  box-shadow: 0 0 0 3px var(--crema), 0 0 0 6px var(--vino), 0 0 0 200vmax rgb(58 39 48 / 0.55);
}
.tour-tarjeta {
  position: fixed; width: min(440px, calc(100vw - 32px));
  background: var(--blanco); color: var(--texto); border-radius: var(--r-grande);
  box-shadow: var(--sombra-2); padding: var(--e5); display: grid; gap: var(--e3);
}
.tour-tarjeta.abajo { left: var(--e4) !important; right: var(--e4); bottom: calc(var(--e4) + env(safe-area-inset-bottom)); width: auto; }
.tour-tarjeta.entra { animation: tarjeta-entra 200ms var(--curva); }
.tour-donde { display: flex; justify-content: space-between; gap: var(--e3); font-size: var(--t-nota); font-weight: 700; color: var(--texto-2); }
.tour-donde [data-tour-pantalla] { color: var(--vino); }
.tour-texto { font-size: var(--t-2); line-height: 1.4; font-weight: 600; text-wrap: pretty; }
.tour-botones { display: flex; align-items: center; gap: var(--e2); flex-wrap: wrap; margin-top: var(--e1); }
.tour-botones .tour-espacio { flex: 1; }
.tour-botones .boton { min-height: 52px; }
.tour-botones .boton[disabled] { visibility: hidden; }
@media (max-width: 479px) {
  .tour-botones { display: grid; grid-template-columns: 1fr 1fr; }
  .tour-botones .tour-espacio { display: none; }
  .tour-botones [data-tour-saltar] { grid-column: 1 / -1; grid-row: 2; }
}
@keyframes tarjeta-entra { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
[id] { scroll-margin-top: var(--e5); }

/* ------------------------------------------------------------ switch «Datos de ejemplo» (tablet primero) */

.ejemplo-aviso {
  position: sticky; top: 0; z-index: 71;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--e2) var(--e4);
  padding: var(--e2) var(--e4); background: var(--texto); color: var(--blanco); font-size: 1rem;
}
.ejemplo-aviso .icono { color: var(--crema); }
.ejemplo-aviso .boton { background: var(--crema); color: var(--texto); min-height: 44px; }
.ejemplo-aviso .boton:hover { background: var(--blanco); color: var(--texto); }
@media (max-width: 639px) {
  .ejemplo-aviso { flex-wrap: nowrap; justify-content: space-between; text-align: left; font-size: var(--t-nota); line-height: 1.35; }
  .ejemplo-aviso > .icono { display: none; }
  .ejemplo-aviso .boton { flex: none; padding: 0 var(--e3); }
}

/* Interruptor pequeño dentro de botones (riel, hoja Más, Ajustes) */
.mini-switch {
  position: relative; flex: none; width: 40px; height: 24px; border-radius: 12px; background: #CDB8A5;
  transition: background-color 200ms var(--curva);
}
.mini-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--blanco); box-shadow: 0 1px 3px rgb(58 39 48 / 0.25);
  transition: translate 200ms var(--curva);
}
[aria-checked="true"] > .mini-switch { background: var(--vino); }
[aria-checked="true"] > .mini-switch::after { translate: 16px 0; }
.mini-switch.grande { width: 52px; height: 32px; border-radius: 16px; }
.mini-switch.grande::after { width: 26px; height: 26px; }
[aria-checked="true"] > .mini-switch.grande::after { translate: 20px 0; }

.riel .nav-switch { flex-wrap: nowrap; }
.riel .nav-switch .nav-switch-texto { flex: 1; }
.riel .nav-switch[aria-checked="true"] { background: var(--vino-tenue); color: var(--vino); }
@media (max-width: 1023px) {
  .riel .nav-switch .nav-switch-texto { flex: none; }
  .riel .nav-switch .mini-switch { margin-top: 2px; }
}
.hoja nav .hoja-switch { justify-content: flex-start; }
.hoja nav .hoja-switch span:not(.mini-switch) { flex: 1; text-align: left; }
.interruptor-boton {
  display: inline-grid; place-items: center; min-width: 64px; min-height: 48px; border: 0; background: none;
  cursor: pointer; border-radius: var(--r);
}
