@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

/* Panel de operación. Blanco, como Stripe o Linear: la página es la
   superficie y las secciones se separan con títulos, aire y líneas finas, no
   con tarjetas. Una sola tipografía; las cifras con números de ancho fijo.
   Verde sube, rojo baja, ámbar es la caída; el color solo significa algo. */
:root {
  color-scheme: light;
  --page: #f6f6f6;
  --board: #ffffff;
  --raised: #f1f1f1;
  --raised-2: #e6e6e6;
  --line: #dcdcdc;
  --line-soft: #ececec;
  --ink: #111111;
  --soft: #5f5f5f;
  /* 5.0:1 sobre blanco y 4.6:1 sobre --page: cumple AA para texto chico. */
  --faint: #6e6e6e;
  --up: #0a9a63;
  --up-bg: rgba(10, 154, 99, 0.12);
  --down: #d6352a;
  --down-bg: rgba(214, 53, 42, 0.1);
  --amber: #a86500;
  --amber-bg: rgba(255, 178, 36, 0.2);
  --amber-solid: #ffb224;
  --brand: #0e1b18;
  --mint: #1fd18b;
  --brand-hover: #1f3a34;
  --cta-ink: #ffffff;
  --sans:
    "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: var(--sans);
  /* Verde y rojo para texto sobre blanco: tono oscuro, legible (AA). */
  --up-ink: #08754c;
  --down-ink: #b42318;
  --rail: 272px;
  --bar: 60px;
  /* Sistema de diseño: solo estos valores. Letra: 7 tamaños; grosor:
     400 texto, 600 énfasis, 700 títulos y cifras (800 solo el logo);
     esquinas: 3 radios más píldora; espacios: múltiplos de 4 px. */
  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-md: 0.9375rem;
  --t-lg: 1.0625rem;
  --t-xl: 1.25rem;
  --t-2xl: 1.625rem;
  --t-3xl: 2.125rem;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;
  --radius: var(--r-lg);
  /* Movimiento: rápido para respuestas a un toque, base para entradas,
     lento solo para cambios de lugar. Curva de salida para lo que llega. */
  /* Borde hecho de sombra: contorno fino más una sombra corta en dos capas. */
  --ring:
    0 0 0 1px rgba(0, 0, 0, 0.07), 0 1px 2px -1px rgba(0, 0, 0, 0.06),
    0 2px 4px 0 rgba(0, 0, 0, 0.04);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 280ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  background: var(--board);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Sin rebote de página con ratón; en táctil se deja el gesto del sistema. */
@media (pointer: fine) {
  html {
    overscroll-behavior: none;
  }
}
/* Toques rápidos sin la espera del doble toque (caja y comandas). */
button,
a,
input,
select,
textarea,
label,
[data-act] {
  touch-action: manipulation;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--board);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}
button:disabled {
  cursor: not-allowed;
}
h1,
h2,
h3,
p {
  margin: 0;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.hidden {
  display: none !important;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.soft {
  color: var(--soft);
}
.ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.logo {
  font-weight: 800;
  font-size: var(--t-2xl);
  letter-spacing: -0.045em;
  text-decoration: none;
  color: var(--ink);
}
.logo span {
  color: var(--mint);
}

/* ───────── Botones y campos ───────── */
/* Tres botones y nada más: principal (uno por zona), secundario (todo lo
   demás) y peligro. La caída solo se pinta de ámbar mientras está activa. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--board);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
  .btn:hover:not(:disabled) {
    background: var(--raised);
    border-color: var(--raised-2);
  }
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.4;
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--cta-ink);
}
@media (hover: hover) {
  .btn.primary:hover:not(:disabled) {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
  }
}
.btn.amber .ic {
  color: var(--amber);
}
.btn.amber.solid {
  background: var(--amber-solid);
  border-color: var(--amber-solid);
  color: #1a1204;
}
.btn.amber.solid .ic {
  color: inherit;
}
.btn.danger {
  border-color: rgba(214, 53, 42, 0.45);
  color: var(--down);
}
@media (hover: hover) {
  .btn.danger:hover:not(:disabled) {
    background: var(--down-bg);
    border-color: rgba(214, 53, 42, 0.45);
  }
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
@media (hover: hover) {
  .btn.ghost:hover:not(:disabled) {
    background: var(--raised);
    border-color: transparent;
  }
}
.btn.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: var(--t-md);
  border-radius: var(--r-sm);
}
.btn.wide {
  width: 100%;
}
.link {
  color: var(--soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}
@media (hover: hover) {
  .link:hover {
    color: var(--ink);
  }
}
.link.danger {
  color: var(--down);
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  color: var(--soft);
}
@media (hover: hover) {
  .icon-btn:hover {
    background: var(--raised);
    color: var(--ink);
  }
}
label {
  display: block;
  font-size: var(--t-sm);
  color: var(--soft);
  margin: 16px 0 8px;
}
input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--page);
  color: var(--ink);
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--ink);
  flex: none;
}
.select.compact {
  width: auto;
  min-height: 34px;
  padding: 4px 12px;
  font-size: var(--t-md);
}
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0 0;
  color: var(--ink);
  font-size: var(--t-md);
}
.check input {
  margin-top: 2px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-error {
  color: var(--down);
  font-size: var(--t-md);
  min-height: 0;
}
.form-error:not(:empty) {
  margin-top: 12px;
}
.hint {
  color: var(--soft);
  font-size: var(--t-sm);
  margin-top: 12px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}
.actions.start {
  justify-content: flex-start;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-size: var(--t-sm);
  white-space: nowrap;
}
.chip.up,
.chip.down,
.chip.amber {
  color: var(--ink);
}
.chip.up::before,
.chip.down::before,
.chip.amber::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  flex: none;
}
.chip.down::before {
  background: var(--down);
}
.chip.amber::before {
  background: var(--amber-solid);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}
.dot.small {
  width: 7px;
  height: 7px;
}
.dot.up {
  background: var(--up);
}
.dot.amber {
  background: var(--amber-solid);
}
.dot.down {
  background: var(--down);
}
.dot.off {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--faint);
}

/* ───────── Acceso (panel y /cuenta) ───────── */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth-card {
  width: min(100%, 420px);
  background: var(--board);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 28px 24px;
}
.auth-card .logo {
  display: inline-block;
  margin-bottom: 24px;
  font-size: var(--t-2xl);
}
.auth-card h1 {
  font-size: var(--t-2xl);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.auth-card .lead {
  color: var(--soft);
  margin-top: 8px;
}
.auth-card .btn.wide {
  margin-top: 24px;
}
.auth-card .aside {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 24px;
  margin-top: 20px;
  font-size: var(--t-md);
}
.auth-card .aside a,
.auth-card .aside button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.auth-card .field-hint {
  margin-top: 6px;
}
.auth-card .check {
  margin-top: 20px;
}
/* Código de invitación al contratar: discreto hasta que se abre. */
.invite {
  margin-top: 12px;
}
.invite .link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--t-md);
}
.invite label {
  margin-top: 4px;
}
#trial-code {
  max-width: 280px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
#trial-code::placeholder {
  text-transform: none;
  letter-spacing: 0;
}
input[aria-invalid="true"] {
  border-color: var(--down);
}
.field-error {
  margin-top: 6px;
  color: var(--down-ink);
  font-size: var(--t-sm);
}
.field-error:empty {
  display: none;
}
.invite-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--up-bg);
  color: var(--ink);
  font-size: var(--t-md);
  text-wrap: pretty;
}
.invite-note[hidden] {
  display: none;
}
.auth-card .aside a,
.auth-card .aside button {
  color: var(--soft);
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .auth-card .aside a:hover,
  .auth-card .aside button:hover {
    color: var(--ink);
  }
}

/* ───────── Estructura ───────── */
.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100dvh;
}
.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 12px 16px;
  border-right: 1px solid var(--line-soft);
  background: var(--page);
}
.rail-logo {
  padding: 2px 12px 0;
}
.logo-rest {
  font-weight: inherit;
}
.rail-venue {
  display: flex;
  flex-direction: column;
  padding: 16px 12px 16px;
  min-width: 0;
}
.rail-venue strong {
  font-size: var(--t-md);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-venue small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--r-md);
  color: var(--soft);
  font-weight: 600;
  text-decoration: none;
}
@media (hover: hover) {
  .nav-item:hover {
    background: var(--board);
    color: var(--ink);
  }
}
.nav-item[aria-current="page"] {
  background: var(--raised);
  color: var(--ink);
}
.nav-item[aria-current="page"] .ic {
  color: var(--ink);
}
.nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 0 8px;
  border-radius: var(--r-full);
  background: var(--raised-2);
  color: var(--soft);
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-align: center;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  text-align: left;
  color: var(--soft);
  border: 1px solid var(--line-soft);
}
.user-chip[aria-expanded="true"],
.user-chip.on {
  background: var(--board);
  color: var(--ink);
}
@media (hover: hover) {
  .user-chip:hover {
    background: var(--board);
    color: var(--ink);
  }
}
.user-chip .who {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.user-chip .chev {
  width: 16px;
  height: 16px;
  color: var(--faint);
}
/* Iniciales de la persona, como el avatar de Claude o ChatGPT. */
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: var(--cta-ink);
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.avatar.big {
  width: 48px;
  height: 48px;
  font-size: var(--t-lg);
}
.account-pop {
  padding: 6px;
}
.account-pop .acct-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 10px;
  min-width: 0;
}
.account-pop .acct-head div,
.profile-card div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.account-pop .acct-head strong,
.account-pop .acct-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-pop .acct-head small,
.profile-card small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.account-pop hr {
  margin: 4px 6px;
  border: 0;
  border-top: 1px solid var(--line-soft);
}
.account-pop button {
  gap: 12px;
  min-height: 42px;
}
.account-pop button .ic {
  color: var(--soft);
}
.account-pop button:focus-visible .ic {
  color: var(--ink);
}
@media (hover: hover) {
  .account-pop button:hover .ic {
    color: var(--ink);
  }
}
.menu-list hr {
  display: none;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.profile-card strong {
  font-size: var(--t-lg);
}
.profile-kv {
  margin-bottom: 8px;
}
.user-chip strong {
  color: var(--ink);
  font-size: var(--t-md);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip small {
  font-size: var(--t-sm);
}
.stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Barra de mercado: el estado del mercado y sus controles nunca salen de la pantalla. */
.marketbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--bar);
  padding: 0 28px;
  background: var(--board);
  border-bottom: 1px solid var(--line);
}
.mb-state {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  text-align: left;
}
.mb-state b {
  font-size: var(--t-lg);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.mb-note {
  color: var(--soft);
  font-size: var(--t-md);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.marketbar[data-state="open"] .dot {
  background: var(--up);
}
.marketbar[data-state="paused"] .dot {
  background: var(--amber-solid);
}
.marketbar[data-state="crash"] .dot {
  background: var(--amber-solid);
}
.mb-clock {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 4px;
  color: var(--soft);
  font-size: var(--t-sm);
  white-space: nowrap;
}
.mb-clock strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--t-xl);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.mb-actions {
  display: flex;
  gap: 8px;
}
.mb-actions:empty {
  display: none;
}
.mb-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.mb-tools .btn .dot {
  margin-left: 2px;
}
/* Avance del intervalo, pegado al reloj al que pertenece. */
.mb-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: var(--r-full);
  background: var(--line-soft);
  overflow: hidden;
}
.mb-progress i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--up);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform 1s linear;
}
.marketbar[data-state="crash"] {
  background: var(--amber-solid);
  border-color: var(--amber-solid);
  color: #1a1204;
}
.marketbar[data-state="crash"] .mb-note,
.marketbar[data-state="crash"] .mb-clock,
.marketbar[data-state="crash"] .mb-clock strong {
  color: #1a1204;
}
.marketbar[data-state="crash"] .dot {
  background: #1a1204;
}
.marketbar[data-state="crash"] .mb-progress {
  background: rgba(26, 18, 4, 0.15);
}
.marketbar[data-state="crash"] .mb-progress i {
  background: #1a1204;
}
.marketbar[data-state="crash"] .btn {
  border-color: rgba(26, 18, 4, 0.4);
  color: #1a1204;
  background: rgba(26, 18, 4, 0.08);
}
.marketbar[data-state="crash"] .mb-tools {
  border-color: rgba(26, 18, 4, 0.25);
}
.banners:empty {
  display: none;
}
.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 28px;
  background: var(--amber-bg);
  border-bottom: 1px solid rgba(255, 178, 36, 0.35);
  /* Texto en tinta: el ámbar sobre fondo ámbar no llega a 4.5:1. */
  color: var(--ink);
  font-size: var(--t-md);
}
.banner .ic {
  width: 18px;
  height: 18px;
  color: var(--amber);
}
.banner .btn {
  margin-left: auto;
}
.banner .btn + .btn {
  margin-left: 0;
}
.view {
  flex: 1;
  width: 100%;
  padding: 28px 32px 56px;
  outline: none;
}
.tabbar {
  display: none;
}

/* ───────── Vistas ───────── */
.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  margin-bottom: 32px;
}
.view-head h1 {
  font-size: var(--t-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.view-head .sub {
  color: var(--soft);
  margin-top: 4px;
  max-width: 62ch;
}
.view-head .sub:empty {
  display: none;
}
.view-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mobile-controls {
  display: none;
  gap: 8px;
  margin-bottom: 20px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 40px;
}
.stat {
  padding: 2px 24px;
  border-left: 1px solid var(--line-soft);
  min-width: 0;
}
.stat:first-child {
  border-left: 0;
  padding-left: 0;
}
.stat span {
  display: block;
  color: var(--soft);
  font-size: var(--t-sm);
}
.stat strong {
  display: block;
  margin-top: 6px;
  font-size: var(--t-3xl);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* La bolsa: una fila por bebida, como en la pantalla. */
.board {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--board);
  overflow: hidden;
  --cols: minmax(0, 1.6fr) 112px 104px 104px minmax(150px, 1fr) 112px;
}
.board-head,
.qrow {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  column-gap: 20px;
  padding: 0 20px;
}
.board-head {
  min-height: 38px;
  color: var(--soft);
  font-size: var(--t-sm);
  border-bottom: 1px solid var(--line);
}
.board-head .r,
.qrow .r {
  text-align: right;
  justify-self: end;
}
.qrow {
  min-height: 60px;
  border-top: 1px solid var(--line-soft);
  position: relative;
}
.board-head + .qrow {
  border-top: 0;
}
.qname {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
  padding: 12px 0;
}
.qname b {
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qname small {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  color: var(--soft);
  font-size: var(--t-sm);
}
.qname small .out {
  color: var(--down-ink);
  font-weight: 600;
}
.qname:disabled {
  cursor: default;
}
@media (hover: hover) {
  button.qname:not(:disabled):hover b {
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
  }
}
.qspark svg {
  display: block;
  width: 100%;
  height: 30px;
  overflow: visible;
}
.qspark polyline {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.qspark.up polyline {
  stroke: var(--up);
}
.qspark.down polyline {
  stroke: var(--down);
}
.qprice {
  font-size: var(--t-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: right;
}
.qchg,
.qbase {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--faint);
  line-height: 1.25;
}
.qbase {
  color: var(--ink);
  font-weight: 500;
}
.qbase small {
  color: var(--soft);
  font-size: var(--t-xs);
  font-weight: 400;
}
.qchg small {
  font-size: var(--t-xs);
  font-weight: 400;
  opacity: 0.85;
}
.qchg.up {
  color: var(--up-ink);
}
.qchg.down {
  color: var(--down-ink);
}
.rng {
  display: grid;
  grid-template-columns: auto minmax(40px, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--soft);
  font-size: var(--t-xs);
}
.rng-track {
  position: relative;
  height: 2px;
  background: var(--line);
  border-radius: var(--r-full);
}
.rng-dot {
  position: absolute;
  top: 50%;
  left: calc(var(--at, 50) * 1%);
  width: 9px;
  height: 9px;
  transition: left var(--dur-slow) var(--ease-in-out);
  border-radius: 50%;
  background: var(--ink);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--board);
}
.rng-note {
  grid-column: 1 / -1;
  font-family: var(--sans);
  font-size: var(--t-sm);
}
.qstate {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-size: var(--t-sm);
  white-space: nowrap;
}
.qrow.sold-out .qprice,
.qrow.sold-out .qname b {
  color: var(--faint);
}
.qrow.hit-up {
  animation: hit-up 1.4s ease-out;
}
.qrow.hit-down {
  animation: hit-down 1.4s ease-out;
}
@keyframes hit-up {
  from {
    background: rgba(10, 154, 99, 0.16);
  }
}
@keyframes hit-down {
  from {
    background: rgba(214, 53, 42, 0.14);
  }
}
.board-foot {
  min-height: 64px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: var(--t-sm);
}

/* Secciones y listas genéricas */
.panel {
  min-width: 0;
}
.panel + .panel {
  margin-top: 48px;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2,
.panel h2 {
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.panel-head p {
  color: var(--soft);
  font-size: var(--t-md);
}
.cols-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 48px;
}
.cols-2 > .panel + .panel {
  margin-top: 0;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  align-items: baseline;
}
.kv:first-of-type,
.panel-head + .kv,
.panel-head + .li,
.panel-head + * > .li:first-child,
.panel-head + * > .kv:first-child {
  border-top: 0;
}
.kv > span:first-child {
  color: var(--soft);
}
.kv strong,
.kv .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}
.kv.total {
  font-size: var(--t-lg);
}
.kv.total > span:first-child {
  color: var(--ink);
  font-weight: 600;
}
.kv small {
  display: block;
  color: var(--soft);
  font-family: var(--sans);
  font-weight: 400;
  font-size: var(--t-sm);
}
.li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.li:first-child {
  border-top: 0;
}
.li > div:first-child {
  flex: 1;
  min-width: 0;
}
.li strong {
  display: block;
  font-weight: 600;
}
.li small {
  display: block;
  color: var(--soft);
  font-size: var(--t-sm);
}
.li .amount {
  font-weight: 600;
  white-space: nowrap;
}
a.li,
.li.as-row {
  position: relative;
  width: calc(100% + 24px);
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
  border-top: 0;
  border-radius: var(--r-sm);
  text-decoration: none;
  text-align: left;
  transition: background var(--dur-fast) var(--ease-out);
}
a.li::before,
.li.as-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  border-top: 1px solid var(--line-soft);
}
.panel-head + a.li::before,
.panel-head + .li.as-row::before {
  display: none;
}
@media (hover: hover) {
  a.li:hover::before,
  a.li:hover + a.li::before,
  .li.as-row:hover::before,
  .li.as-row:hover + .li.as-row::before {
    display: none;
  }
}
@media (hover: hover) {
  a.li:hover,
  .li.as-row:hover {
    background: var(--raised);
  }
}
.empty {
  padding: 28px 0;
  color: var(--soft);
}
.empty strong {
  display: block;
  color: var(--ink);
  font-size: var(--t-lg);
  margin-bottom: 4px;
}
.empty .btn {
  margin-top: 16px;
}

/* Cuentas: lista a la izquierda, detalle a la derecha */
.split {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.tab-list {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--board);
  overflow: hidden;
}
.tab-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px;
  border-bottom: 1px solid var(--line);
}
.tab-list-head strong {
  font-size: var(--t-md);
}
.tab-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 16px 16px;
  text-align: left;
  border-top: 1px solid var(--line-soft);
}
.tab-item:first-of-type {
  border-top: 0;
}
@media (hover: hover) {
  .tab-item:hover {
    background: var(--raised);
  }
}
.tab-item[aria-current="true"] {
  background: var(--raised);
  box-shadow: inset 3px 0 0 var(--brand);
}
.tab-item > span:first-child {
  flex: 1;
  min-width: 0;
}
.tab-item strong {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tab-item small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.tab-item .amount {
  font-family: var(--mono);
  font-weight: 600;
}
.ticket {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--board);
  overflow: clip;
}
.ticket > :not(.ticket-body) {
  flex: none;
}
.ticket-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
  padding: 20px 20px;
  border-bottom: 1px solid var(--line);
}
.ticket-head h2 {
  font-size: var(--t-xl);
  letter-spacing: -0.025em;
}
.ticket-head small {
  color: var(--soft);
}
.ticket-due {
  text-align: right;
}
.ticket-due span {
  display: block;
  color: var(--soft);
  font-size: var(--t-sm);
}
.ticket-due strong {
  font-family: var(--mono);
  font-size: var(--t-2xl);
  letter-spacing: -0.04em;
}
.ticket-body {
  flex: 1 1 auto;
  padding: 4px 20px 8px;
  min-height: 120px;
  overflow-y: auto;
}
.line {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.line:first-child {
  border-top: 0;
}
.line > span:first-child {
  min-width: 0;
}
.line b {
  font-weight: 600;
}
.line small {
  display: block;
  color: var(--soft);
  font-size: var(--t-sm);
}
.line > span:first-child small {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
}
.line .line-note {
  color: var(--amber);
  font-weight: 600;
}
@media (hover: hover) {
  .line .line-cancel {
    opacity: 0;
    transition: opacity var(--dur-fast) var(--ease-out);
  }
  .line:hover .line-cancel,
  .line .line-cancel:focus-visible {
    opacity: 1;
  }
}
.line .amount {
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
}
.line.cancelled b,
.line.cancelled .amount {
  color: var(--faint);
  text-decoration: line-through;
}
.ticket-totals {
  padding: 4px 20px 12px;
  border-top: 1px solid var(--line);
  background: var(--page);
}
/* Dividir por persona: personas y consumos a la izquierda, saldos a la
   derecha en pantallas anchas; todo en una columna en el teléfono. */
.bill-split {
  display: grid;
  gap: 0 24px;
}
@media (min-width: 721px) {
  .bill-split:has(.split-balances) {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .bill-split > :not(.split-balances) {
    grid-column: 1;
  }
  .bill-split > .split-balances {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: start;
    margin-top: 0;
  }
}
.split-people {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.split-person {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--board);
  color: var(--ink);
  font-weight: 600;
  font-size: var(--t-md);
}
.split-person small {
  color: var(--soft);
  font-weight: 400;
  font-size: var(--t-xs);
}
.split-person[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--cta-ink);
}
.split-person[aria-pressed="true"] small {
  color: inherit;
}
.split-add {
  display: flex;
  gap: 8px;
  flex: 1 1 220px;
}
.split-add input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.split-lines,
.split-balances {
  border-top: 1px solid var(--line);
}
.split-balances {
  margin-top: 12px;
}
.split-line,
.split-due {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.split-line > div:first-child,
.split-due > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.split-line small,
.split-due small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.split-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ticket-online {
  padding: 4px 20px 12px;
  border-top: 1px solid var(--line);
}
.ticket-online .hint {
  margin: 8px 0 0;
}
.hint.warn {
  color: var(--amber);
}
.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.ticket-actions .grow {
  flex: 1;
}
.back-link {
  display: none;
}

/* Preparación: la pantalla de cocina y barra. El objeto es la comanda, como
   el ticket impreso de una ronda: su encabezado se pinta con el tiempo que
   lleva el cliente esperando (tinta, ámbar, rojo). Lo demás queda en blanco y
   negro para que solo el tiempo y las cancelaciones llamen la atención. */
.kds {
  --chit-text: var(--t-md);
  --chit-name: var(--t-lg);
  --chit-qty: var(--t-xl);
  --chit-min: 272px;
  display: grid;
  gap: 20px;
}
.kds[data-mode="kitchen"] {
  --chit-text: var(--t-lg);
  --chit-name: var(--t-xl);
  --chit-qty: var(--t-2xl);
  --chit-min: 288px;
}
.kds-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.kds-top h1 {
  font-size: var(--t-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.kds-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.kds-tools .segmented {
  margin-right: 8px;
}
.kds-tools .btn[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 650;
}

/* Cancelaciones: franja roja sólida, lo único que interrumpe. */
.kds-cancel {
  display: grid;
  gap: 2px;
}
.kds-cancel-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 12px 12px 16px;
  background: var(--down);
  color: #fff;
  font-size: var(--chit-text);
  line-height: 1.4;
}
.kds-cancel-row:first-child {
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.kds-cancel-row:last-child {
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}
.kds-cancel-row:only-child {
  border-radius: var(--r-sm);
}
.kds-cancel-row p {
  flex: 1;
  min-width: 0;
  text-wrap: pretty;
}
.kds-cancel-row .btn {
  flex: none;
  border-color: transparent;
  box-shadow: none;
}

/* Por preparar: lo pendiente sumado por producto, en una línea de texto. */
.kds-todo {
  display: flex;
  align-items: baseline;
  gap: 8px 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.kds-todo h2 {
  flex: none;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--soft);
}
.kds-todo ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--chit-text);
}
.kds-todo b {
  font-size: var(--chit-name);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 2px;
}

/* Comandas a la izquierda, lo listo para entregar a la derecha. */
.kds-body {
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 24px;
  align-items: start;
}
.chit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--chit-min)), 1fr));
  gap: 16px;
  align-items: start;
}
.kds-empty {
  padding: 48px 0;
  color: var(--soft);
  font-size: var(--chit-text);
}

.chit {
  display: flex;
  flex-direction: column;
  background: var(--board);
  border-radius: var(--r-sm);
  box-shadow: var(--ring);
  overflow: hidden;
}
.chit-head {
  --head: var(--brand);
  --head-ink: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 11px;
  background: var(--head);
  color: var(--head-ink);
}
.chit[data-tone="warm"] .chit-head {
  --head: var(--amber-solid);
  --head-ink: var(--ink);
}
.chit[data-tone="late"] .chit-head {
  --head: var(--down);
}
.chit-table {
  font-size: var(--chit-name);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.chit-where {
  margin-top: 1px;
  font-size: var(--t-sm);
  opacity: 0.82;
}
.chit-age {
  flex: none;
  display: flex;
  align-items: baseline;
  white-space: nowrap;
  line-height: 1;
  padding-top: 2px;
}
.chit-age b {
  font-size: var(--chit-qty);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.chit-age span span,
.chit-age b + span {
  margin-left: 3px;
  font-size: var(--t-sm);
  font-weight: 600;
}
.chit-lines {
  margin: 0;
  padding: 4px 0;
  list-style: none;
}
.chit-lines > li {
  display: grid;
  grid-template-columns: 2.2em minmax(0, 1fr) auto;
  align-items: start;
  gap: 0 6px;
  padding: 10px 14px;
  font-size: var(--chit-text);
}
.chit-lines > li + li {
  border-top: 1px solid var(--line-soft);
}
.chit-qty {
  font-size: var(--chit-qty);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.chit-item {
  min-width: 0;
  padding-top: 0.15em;
}
.chit-name {
  font-size: var(--chit-name);
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.chit-station {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--soft);
}
/* Modificadores: renglones debajo del platillo, como se escriben en la comanda. */
.chit-mods {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-weight: 650;
  line-height: 1.35;
}
.chit-mods li::before {
  content: "+ ";
  color: var(--soft);
  font-weight: 500;
}
.chit-note {
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--amber-bg);
  border-radius: 4px;
  line-height: 1.35;
  text-wrap: pretty;
}
.chit-one {
  align-self: start;
  min-height: 32px;
  margin: -2px -6px 0 0;
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
}
@media (hover: hover) {
  .chit-one:hover {
    background: var(--raised);
    color: var(--ink);
  }
}
.chit-foot {
  margin-top: auto;
  padding: 4px 14px 14px;
}
.chit-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 6px;
}
.chit-stage {
  font-size: var(--t-sm);
  color: var(--soft);
}
.chit-flag {
  margin-left: auto;
  min-height: 32px;
  padding: 0 8px;
  margin-right: -8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
}
@media (hover: hover) {
  .chit-flag:hover {
    background: var(--raised);
    color: var(--ink);
  }
}
.chit-flag + .chit-flag {
  margin-left: 0;
}
.chit-flag:has(+ .chit-flag) {
  margin-right: 0;
}
.chit-flag[aria-pressed="true"] {
  color: var(--down-ink);
}
/* Urgente: marco rojo grueso y la palabra arriba del nombre de la mesa. */
.chit[data-urgent] {
  box-shadow: 0 0 0 3px var(--down);
}
.chit-urgent {
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
}
/* Alergia: aparte de la nota, en rojo, antes de las opciones. */
.chit-allergy {
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--down-bg);
  color: var(--down-ink);
  border-radius: 4px;
  font-weight: 600;
  line-height: 1.35;
  text-wrap: pretty;
}
.kds-avg {
  margin-top: 4px;
  font-size: var(--t-sm);
  color: var(--soft);
}
.kds-avg b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kds-out {
  margin-top: -8px;
  font-size: var(--chit-text);
  color: var(--down-ink);
}
.soldout-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.soldout-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.soldout-list li + li {
  border-top: 1px solid var(--line-soft);
}
.soldout-list strong {
  display: block;
  font-weight: 600;
}
.soldout-list small {
  color: var(--soft);
}
.soldout-list .is-out small {
  color: var(--down-ink);
  font-weight: 600;
}
.chit-bump {
  width: 100%;
}
.kds[data-mode="kitchen"] .chit-bump {
  min-height: 52px;
  font-size: var(--t-lg);
}

/* Listo para entregar */
.pass {
  display: grid;
  gap: 12px;
}
.pass h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-lg);
  font-weight: 700;
}
.pass h2 .num {
  font-weight: 600;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}
.pass-hint,
.pass-empty {
  font-size: var(--t-sm);
  color: var(--soft);
}
.pass-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pass-row {
  display: grid;
  gap: 6px;
  padding: 12px 0 14px;
}
.pass-row + .pass-row {
  border-top: 1px solid var(--line-soft);
}
.pass-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.pass-top strong {
  font-size: var(--chit-name);
  font-weight: 700;
}
.pass-wait {
  flex: none;
  font-size: var(--t-sm);
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}
.pass-wait.cold {
  color: var(--down-ink);
  font-weight: 600;
}
.pass-items {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--chit-text);
  line-height: 1.4;
}
.pass-items b {
  font-variant-numeric: tabular-nums;
  margin-right: 2px;
}
.pass-items small {
  display: block;
  padding-left: 1.3em;
  font-size: var(--t-sm);
  color: var(--soft);
}
.pass-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.pass-recent {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.pass-toggle {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
}
.pass-toggle::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 0 3px 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.pass-toggle[aria-expanded="true"]::after {
  margin-bottom: -1px;
  transform: rotate(-135deg);
}
.pass-recent-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.pass-recent-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  font-size: var(--t-sm);
}
.pass-recent-list li + li {
  border-top: 1px solid var(--line-soft);
}
.pass-recent-list small {
  display: block;
  color: var(--soft);
}

@container (max-width: 760px) {
  .kds-body > * {
    grid-column: 1 / -1;
  }
}
@media (max-width: 1100px) {
  .kds-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .pass-list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    column-gap: 24px;
  }
  .pass-row + .pass-row {
    border-top: 0;
  }
  .pass-row {
    border-bottom: 1px solid var(--line-soft);
  }
}
@media (max-width: 640px) {
  .kds-todo {
    flex-direction: column;
    gap: 4px;
  }
  .kds-cancel-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Pantalla fija (tableta en la pared): solo el tablero, a pantalla completa. */
body.kds-wall[data-view="preparacion"] .shell {
  grid-template-columns: minmax(0, 1fr);
}
body.kds-wall[data-view="preparacion"] .rail,
body.kds-wall[data-view="preparacion"] .marketbar,
body.kds-wall[data-view="preparacion"] .banners,
body.kds-wall[data-view="preparacion"] .tabbar {
  display: none;
}
body.kds-wall[data-view="preparacion"] .view {
  padding: 16px 20px 24px;
}
body.kds-wall[data-view="preparacion"] .kds-top h1 {
  font-size: var(--t-xl);
}

/* Inventario de cocina y barra (docs/DISENO-INVENTARIO-COMPARTIDO.md).
   Cantidades grandes y alineadas, acciones a la derecha, nada de dinero. */
.stock {
  display: grid;
  gap: 24px;
}
.stock-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}
.stock-top h1 {
  font-size: var(--t-2xl);
}
.stock-top .sub {
  max-width: 60ch;
}
.stock-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.stock-list h2,
.stock-moves h2 {
  font-size: var(--t-lg);
  margin-bottom: 4px;
}
.stock-list ul,
.stock-moves ul,
.stock-recipes ul,
.count-sheet,
.pending-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.stock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.stock-name strong {
  display: block;
  font-weight: 600;
}
.stock-name small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.stock-qty {
  font-size: var(--t-xl);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.stock-row.is-low .stock-qty,
.stock-low {
  color: var(--down-ink);
}
.stock-low {
  font-weight: 600;
}
.stock-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.stock-more {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 24px;
  align-items: start;
}
.stock-recipes summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--t-lg);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.stock-recipes li,
.stock-moves li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.stock-recipes li {
  flex-direction: column;
  gap: 2px;
}
.stock-recipes li span,
.stock-moves small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.stock-moves strong {
  display: block;
  font-weight: 600;
}
.stock-moves .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .stock-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .stock-actions {
    grid-column: 1 / -1;
  }
}
/* Hoja de conteo completo */
.count-sheet li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.count-sheet label {
  margin: 0;
}
.count-sheet label strong {
  display: block;
}
.count-sheet small {
  color: var(--soft);
  font-weight: 400;
}
.count-input {
  display: flex;
  align-items: center;
  gap: 6px;
}
.count-input input {
  width: 7.5em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.count-input span {
  color: var(--soft);
  min-width: 2.5em;
}
/* Por revisar, en el Inventario del gerente */
.pending-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 0;
}
.pending-list li + li {
  border-top: 1px solid var(--line-soft);
}
.pending-list strong {
  display: block;
  font-weight: 600;
}
.pending-list small {
  color: var(--soft);
}
.pending-actions {
  display: flex;
  gap: 8px;
}
/* Mesas */
.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 12px;
}
.table-card {
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 14px 14px 12px;
  border-radius: var(--r-lg);
  background: var(--page);
  transition:
    background var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}
.table-card.busy {
  background: var(--board);
  box-shadow: var(--ring);
}
.table-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.table-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--t-lg);
  letter-spacing: -0.02em;
}
.table-card .table-due {
  margin-top: 10px;
  font-size: var(--t-2xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.table-card .table-facts {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  margin-top: 4px;
  color: var(--soft);
  font-size: var(--t-sm);
  flex: 1;
}
.table-card.free .table-facts {
  margin-top: 6px;
}
.table-card .actions {
  align-items: center;
  margin-top: 12px;
  justify-content: flex-start;
}
.table-card.free .btn:not(.ghost):not(.icon-only) {
  background: var(--board);
}

/* ───────── Ventanas (hojas) ───────── */
.sheet {
  width: min(560px, calc(100vw - 32px));
  max-height: min(88dvh, 860px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--board);
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}
.sheet.wide {
  width: min(760px, calc(100vw - 32px));
}
.sheet {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    overlay var(--dur-base) allow-discrete,
    display var(--dur-base) allow-discrete;
}
.sheet[open] {
  opacity: 1;
  transform: none;
}
@starting-style {
  .sheet[open] {
    opacity: 0;
    transform: translateY(12px);
  }
}
.sheet::backdrop {
  background: rgba(17, 17, 17, 0);
  transition:
    background-color var(--dur-base) var(--ease-out),
    overlay var(--dur-base) allow-discrete,
    display var(--dur-base) allow-discrete;
}
.sheet[open]::backdrop {
  background: rgba(17, 17, 17, 0.45);
}
@starting-style {
  .sheet[open]::backdrop {
    background: rgba(17, 17, 17, 0);
  }
}
.sheet-wrap {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px 16px;
}
.sheet-head h2 {
  font-size: var(--t-xl);
  letter-spacing: -0.025em;
}
.sheet-sub {
  color: var(--soft);
  font-size: var(--t-md);
  margin-top: 2px;
}
.sheet-sub:empty {
  display: none;
}
.sheet-body {
  padding: 0 24px 24px;
  overflow-y: auto;
}
.sheet-wrap > .form-error {
  padding: 0 24px 20px;
  margin: 0;
}
.sheet-body > p:first-child {
  color: var(--soft);
  margin-bottom: 4px;
}
.sheet-body h3 {
  font-size: var(--t-md);
  margin: 24px 0 8px;
  letter-spacing: -0.01em;
}
.menu-list {
  display: flex;
  flex-direction: column;
  margin: 8px 0 0;
}
.menu-list button,
.menu-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 4px;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  text-decoration: none;
  width: 100%;
}
.menu-list > :first-child {
  border-top: 0;
}
.menu-list .ic {
  color: var(--soft);
}
@media (hover: hover) {
  .menu-list button:hover,
  .menu-list a:hover {
    color: var(--ink);
  }
}
.pick {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  max-height: 38dvh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  border-top: 1px solid var(--line-soft);
}
.pick-row:first-child {
  border-top: 0;
}
@media (hover: hover) {
  .pick-row:hover {
    background: var(--raised);
  }
}
.pick-row[aria-pressed="true"] {
  background: var(--raised-2);
  box-shadow: inset 3px 0 0 var(--ink);
}
.pick-row:disabled {
  opacity: 0.4;
}
.pick-row > span:first-child {
  flex: 1;
  min-width: 0;
}
.pick-row b {
  display: block;
  font-weight: 600;
}
.pick-row small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.pick-row .amount {
  font-family: var(--mono);
  font-weight: 700;
}
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 4px;
}
.stepper button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
}
@media (hover: hover) {
  .stepper button:hover {
    background: var(--raised);
  }
}
.stepper output {
  min-width: 40px;
  text-align: center;
  font-family: var(--mono);
  font-size: var(--t-lg);
  font-weight: 600;
}
.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}
.quote-box {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--page);
}
.quote-box .name {
  display: block;
  font-size: var(--t-lg);
  font-weight: 700;
}
.quote-box .soft {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: var(--t-sm);
}
.quote-box .sum {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: var(--t-3xl);
  font-weight: 700;
  letter-spacing: -0.04em;
}
.quote-box small {
  display: block;
  margin-top: 8px;
  color: var(--amber);
  font-family: var(--mono);
}
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--page);
}
.segmented button {
  flex: 1;
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--soft);
  font-weight: 600;
  white-space: nowrap;
}
.view-actions .segmented {
  padding: 3px;
}
.view-actions .segmented button {
  min-height: 32px;
}
.segmented button[aria-pressed="true"] {
  background: var(--raised-2);
  color: var(--ink);
}
.receipt h3 {
  margin: 0 0 2px;
  font-size: var(--t-lg);
}
.receipt > p {
  color: var(--soft);
  font-size: var(--t-md);
  margin-bottom: 12px;
}
.qr-sheet {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px 12px;
  text-align: center;
  background: #fff;
  color: #101c19;
  border-radius: var(--r-lg);
  break-inside: avoid;
}
.qr-sheet .logo {
  color: #101c19;
  font-size: var(--t-2xl);
}
.qr-sheet h2 {
  font-size: var(--t-2xl);
}
.qr-sheet img {
  width: min(280px, 100%);
  height: auto;
  background: #fff;
}
.qr-sheet p {
  font-size: var(--t-sm);
}

/* Avisos */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--raised);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  font-weight: 600;
}
.toast.error {
  border-left-color: var(--down);
}
.view-loading {
  padding: 60px 0;
  text-align: center;
  color: var(--soft);
}

/* ───────── Adaptación ───────── */
@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 68px minmax(0, 1fr);
  }
  .rail {
    padding: 16px 8px;
    align-items: center;
  }
  .rail-logo {
    padding: 0;
    font-size: var(--t-2xl);
  }
  /* En la barra angosta el logo se reduce a su marca: «p.». */
  .rail-logo .logo-rest {
    display: none;
  }
  #mb-clock-label,
  #mb-note {
    display: none;
  }
  .rail-venue,
  .nav-item span,
  .user-chip .who,
  .user-chip .chev {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 0;
    width: 44px;
  }
  .nav-count {
    position: absolute;
    top: 2px;
    right: -2px;
    margin: 0;
    min-width: 18px;
    font-size: var(--t-xs);
  }
  .user-chip {
    padding: 12px;
  }
  .board {
    --cols: minmax(0, 1.6fr) 104px 104px minmax(140px, 1fr) 104px;
  }
  .qspark,
  .board-head .spark-h {
    display: none;
  }
}
@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }
  .split[data-selected="true"] .tab-list {
    display: none;
  }
  .split[data-selected="false"] .ticket,
  .split[data-selected="false"] .ticket-empty {
    display: none;
  }
  .back-link {
    display: inline-flex;
    margin-bottom: 12px;
  }
  .cols-2 {
    grid-template-columns: 1fr;
  }
  .board {
    --cols: minmax(0, 1.4fr) 100px 100px 104px;
  }
  .rng-col,
  .board-head .rng-h {
    display: none;
  }
  .mb-note {
    display: none;
  }
}
@media (max-width: 720px) {
  body {
    padding-bottom: 68px;
  }
  .shell {
    display: block;
  }
  .rail {
    display: none;
  }
  .marketbar {
    padding: 0 16px;
    gap: 12px;
  }
  .mb-actions,
  .mb-tools {
    display: none;
  }
  .mb-clock {
    margin-left: auto;
  }
  .mobile-controls {
    display: flex;
    flex-wrap: wrap;
  }
  .view {
    padding: 20px 16px 40px;
  }
  .banner {
    padding: 12px 16px;
  }
  .view-head h1 {
    font-size: var(--t-2xl);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 20px;
    margin-bottom: 32px;
  }
  .stat {
    padding: 0 0 0 16px;
  }
  .stat:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }
  .stat strong {
    font-size: var(--t-2xl);
  }
  .table-card,
  .table-card.free {
    min-height: 0;
  }
  .table-grid {
    grid-template-columns: 1fr;
  }
  .board {
    --cols: minmax(0, 1fr) 92px 80px;
  }
  .qbase,
  .board-head .qbase-h {
    display: none;
  }
  .board-head,
  .qrow {
    padding: 0 16px;
    column-gap: 12px;
  }
  .qspark,
  .board-head .spark-h {
    display: none;
  }
  .qprice {
    font-size: var(--t-xl);
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    height: 64px;
    border-top: 1px solid var(--line);
    background: var(--board);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tab-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--soft);
    font-size: var(--t-xs);
    font-weight: 600;
    text-decoration: none;
  }
  .tab-link[aria-current="page"] {
    color: var(--ink);
  }
  .tab-link .nav-count {
    position: absolute;
    top: 8px;
    left: calc(50% + 4px);
    margin: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid var(--board);
    background: var(--ink);
    color: var(--board);
    font-size: var(--t-xs);
    font-weight: 600;
    line-height: 14px;
  }
  .sheet {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 92dvh;
    border-bottom: 0;
  }
  .sheet.wide {
    width: 100%;
  }
  .toast {
    bottom: 80px;
  }
  .ticket-head {
    flex-direction: column;
  }
  .ticket-due {
    text-align: left;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-property: opacity, color, background-color, border-color,
      box-shadow !important;
  }
  .cart-line.added {
    animation: line-in 1.2s ease-out both !important;
  }
}

/* Comprobantes y QR: solo se imprime la hoja abierta. */
@media print {
  body {
    background: #fff;
    padding: 0;
  }
  body > *:not(dialog) {
    display: none !important;
  }
  .sheet {
    position: static;
    display: block !important;
    width: 100%;
    max-height: none;
    border: 0;
    background: #fff;
    color: #000;
    box-shadow: none;
    animation: none;
  }
  .sheet::backdrop {
    display: none;
  }
  .sheet-head,
  .actions,
  .sheet-wrap > .form-error,
  .hint {
    display: none !important;
  }
  .sheet-body {
    padding: 0;
    overflow: visible;
  }
  .receipt,
  .receipt .kv,
  .receipt .kv span,
  .receipt .line {
    color: #000;
  }
  .receipt .kv,
  .receipt .line {
    border-color: #ccc;
    break-inside: avoid;
  }
  .receipt .kv > span:first-child,
  .receipt small,
  .receipt > p {
    color: #444;
  }
}

/* Ajustes de espaciado usados en plantillas */
.flush {
  margin-top: 0 !important;
}
.tight {
  margin: -8px 0 8px;
}
.right {
  text-align: right;
}
.plan-price {
  font-size: var(--t-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.muted {
  color: var(--soft);
}
.auth-card .check a {
  color: var(--ink);
}

.line .amount small {
  font-family: var(--sans);
  font-weight: 400;
}
.cols-2 + .panel,
.cols-2 + .cols-2,
.panel + .cols-2 {
  margin-top: 48px;
}
@media (max-width: 900px) {
  .ticket-body {
    max-height: none;
  }
}
@media (max-width: 720px) {
  .ticket-actions {
    position: sticky;
    bottom: 64px;
    background: var(--board);
    z-index: 5;
  }
}

@media (hover: hover) {
  .line .link:hover {
    color: var(--down);
  }
}

/* Resumen y cocina */
.attention .li > div:first-child {
  flex: 1;
}
.attention .li strong {
  font-weight: 600;
}
.all-clear {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -16px 0 32px;
  color: var(--soft);
  font-size: var(--t-sm);
}
.all-clear .ic {
  width: 16px;
  height: 16px;
}
.all-clear .ic {
  color: var(--up);
}
a.li {
  color: inherit;
  text-decoration: none;
}
@media (hover: hover) {
  a.li:hover {
    background: var(--raised);
  }
}
.li .qchg {
  min-width: 72px;
  text-align: right;
}
.segmented.station button {
  min-width: 76px;
}
.cols-2.top {
  align-items: start;
}
/* Lo único que debe saltar a la vista en Resumen: fondo ámbar tenue. */
.panel.attention {
  margin-bottom: 40px;
  padding: 4px 20px 8px;
  border-radius: var(--r-lg);
  background: var(--amber-bg);
}
.panel.attention .panel-head {
  padding-top: 12px;
  border-bottom-color: rgba(168, 101, 0, 0.25);
}
.panel.attention .li {
  border-top-color: rgba(168, 101, 0, 0.15);
}
.li.wrap {
  flex-wrap: wrap;
}
.li.wrap > div:first-child {
  flex: 1 1 180px;
}
.li .amount.big {
  font-size: var(--t-xl);
}
@media (max-width: 720px) {
  .li.wrap .btn {
    min-height: 46px;
  }
  .li.wrap > .btn.primary {
    flex: 1 1 100%;
  }
}

/* ───────── Inventario y Programación ───────── */
.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.recipe-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.recipe-row select,
.recipe-row input {
  margin: 0;
}
.pick-list {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px 12px;
}
.pick-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.pick-item:last-child {
  border-bottom: 0;
}
.pick-item .check {
  margin: 0;
}
.pick-item .check span {
  display: grid;
}
.pick-item small {
  color: var(--soft);
}
.pick-item input[type="text"],
.pick-item input:not([type]) {
  margin: 0;
}
.form-row .end {
  align-self: end;
}
details.history {
  margin-top: 12px;
}
details.history summary {
  cursor: pointer;
  color: var(--soft);
  padding: 8px 0;
}
@media (max-width: 720px) {
  .row-actions {
    width: 100%;
    justify-content: flex-start;
  }
  /* Si solo queda el menú «…», se queda en su renglón, a la derecha. */
  .row-actions:has(> .icon-only:only-of-type):not(
      :has(> .btn:not(.icon-only))
    ) {
    width: auto;
  }
  .row-actions .btn {
    flex: 1 1 auto;
    min-height: 40px;
  }
}

/* ───────── Ajustes con secciones ───────── */
.subtabs {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  overflow-x: auto;
}
.subtabs a {
  padding: 8px 16px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  color: var(--soft);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
@media (hover: hover) {
  .subtabs a:hover {
    background: var(--raised);
  }
}
.subtabs a[aria-current="page"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--cta-ink);
}
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(168, 101, 0, 0.35);
  border-radius: var(--r-md);
  background: var(--amber-bg);
  color: var(--ink);
}
.notice .ic {
  flex: none;
  margin-top: 2px;
  color: var(--amber);
}
.pick-simple {
  margin: 0;
  padding: 8px 0;
}
.segmented.zones {
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.segmented.zones {
  display: inline-flex;
  width: auto;
  max-width: 100%;
}
.segmented.zones button {
  padding-left: 20px;
  padding-right: 20px;
}

/* ───────── Opciones de producto y foto ───────── */
.sub-actions {
  margin: 0 0 12px;
}
.opt-group {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.opt-group .form-row {
  grid-template-columns: minmax(0, 1fr) 84px 84px;
  margin-bottom: 8px;
}
.opt-group .recipe-row {
  grid-template-columns: minmax(0, 1fr) 110px 40px;
}
.product-photo {
  display: block;
  max-width: 100%;
  max-height: 260px;
  margin: 0 auto 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

/* ───────── Menú «más» ───────── */
.btn.icon-only {
  flex: none;
  width: 32px;
  padding: 0;
}
.btn.icon-only:not(.small) {
  width: 40px;
}
.actions .grow {
  flex: 1;
}
.pop {
  position: fixed;
  inset: auto;
  margin: 0;
  min-width: 200px;
  max-width: calc(100vw - 16px);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--board);
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  overscroll-behavior: contain;
  opacity: 0;
  transform: scale(0.97);
  transition:
    opacity 160ms var(--ease-out),
    transform 160ms var(--ease-out),
    overlay 160ms allow-discrete,
    display 160ms allow-discrete;
}
.pop:popover-open {
  opacity: 1;
  transform: none;
}
@starting-style {
  .pop:popover-open {
    opacity: 0;
    transform: scale(0.97);
  }
}
.pop button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  text-align: left;
  white-space: nowrap;
}
.pop button:focus-visible {
  background: var(--raised);
  outline: none;
}
@media (hover: hover) {
  .pop button:hover {
    background: var(--raised);
    outline: none;
  }
}
.pop button.danger {
  color: var(--down);
}
.row-actions .btn.icon-only {
  flex: none;
}
@media (max-width: 720px) {
  /* Controles del mercado en una sola fila de botones iguales. */
  .mobile-controls {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
  .mobile-controls .btn {
    min-height: 44px;
    padding: 0 8px;
    font-size: var(--t-sm);
    white-space: normal;
    line-height: 1.15;
    text-align: center;
  }
  .mobile-controls .btn .ic {
    display: none;
  }
}

/* Botón discreto para acciones repetidas en listas largas. */
.btn.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--soft);
}
@media (hover: hover) {
  .btn.quiet:hover:not(:disabled) {
    background: var(--raised);
    border-color: transparent;
    color: var(--ink);
  }
}
.table-card .actions {
  flex-wrap: nowrap;
  gap: 4px;
}
.nav-item {
  font-weight: 400;
}
.nav-item[aria-current="page"] {
  font-weight: 600;
}

/* ───────── Estructura: grupos del menú lateral ───────── */
.nav-group {
  margin: 0 0 16px;
  padding: 0 12px;
  color: var(--faint);
  font-size: var(--t-xs);
  font-weight: 600;
}
@media (max-width: 1180px) {
  /* En el riel angosto, el grupo es una línea divisoria. */
  .nav-group {
    width: 28px;
    height: 1px;
    margin: 8px auto;
    padding: 0;
    overflow: hidden;
    background: var(--line);
    color: transparent;
  }
}

/* ───────── Tomar pedido ───────── */
.sheet.wide:has(.order) {
  width: min(960px, calc(100vw - 32px));
}
.order {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.order-pane .pick {
  max-height: min(52dvh, 520px);
}
.cats {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cats button {
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  color: var(--soft);
  font-size: var(--t-sm);
  font-weight: 600;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.cats button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--board);
}
.in-cart {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-full);
  background: var(--ink);
  color: var(--board);
  font-size: var(--t-xs);
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}
.order-cart {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: min(64dvh, 640px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--page);
}
.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 16px 8px;
}
.cart-head h3 {
  margin: 0;
  font-size: var(--t-lg);
}
.cart-head .soft {
  font-size: var(--t-sm);
}
.cart-lines {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 16px;
}
.cart-lines .empty {
  padding: 40px 0;
}
.cart-line {
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.cart-line:first-child {
  border-top: 0;
}
.cart-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cart-name {
  flex: 1;
  min-width: 0;
}
.cart-name b {
  display: block;
  font-weight: 600;
}
.cart-name small {
  display: block;
  color: var(--soft);
  font-size: var(--t-sm);
}
.cart-name .warn {
  color: var(--down);
}
.cart-line .amount {
  min-width: 76px;
  font-family: var(--mono);
  font-weight: 600;
  text-align: right;
}
.stepper.small {
  padding: 2px;
}
.stepper.small button {
  width: 32px;
  height: 32px;
}
.stepper.small output {
  min-width: 24px;
  font-size: var(--t-md);
}
.line-note-toggle {
  margin-top: 4px;
  font-size: var(--t-sm);
}
.line-note {
  margin-top: 8px;
  min-height: 36px;
  font-size: var(--t-sm);
}
.cart-line.out .cart-name b {
  color: var(--faint);
}
.cart-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.cart-foot .kv {
  padding: 4px 0 0;
}
.cart-foot .hint {
  margin: 4px 0 12px;
}
.opt-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.opt-head h3 {
  margin: 0;
  font-size: var(--t-xl);
}
.opt-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
}
.opt-group {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}
.opt-group legend {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 0;
  font-weight: 600;
}
.opt-group legend small {
  color: var(--soft);
  font-size: var(--t-sm);
  font-weight: 400;
}
.opt-group .check {
  margin-top: 8px;
  align-items: center;
}
.opt-group .check small {
  margin-left: auto;
  color: var(--soft);
  font-size: var(--t-sm);
}
.opt-group .check:has(input:disabled) {
  color: var(--faint);
}
.opt-add {
  justify-content: space-between;
}
#opt-missing:empty {
  display: none;
}
.round-box {
  margin-top: 16px;
  padding: 4px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--page);
}
.round-lines {
  max-height: 40dvh;
  overflow-y: auto;
}
.round-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}
.round-total strong {
  font-size: var(--t-3xl);
  letter-spacing: -0.04em;
}
.round-change {
  margin: 8px 0 0;
  font-size: var(--t-sm);
  font-weight: 600;
}
.round-change.up {
  color: var(--up);
}
.round-change.down {
  color: var(--down);
}
.round-time {
  display: block;
  margin-top: 8px;
  color: var(--amber);
  font-family: var(--mono);
}
@media (max-width: 720px) {
  .order {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .order-pane .pick {
    max-height: 34dvh;
  }
  .order-cart {
    position: static;
    min-height: 0;
    max-height: none;
  }
}

/* Mesero: lo listo para llevar, arriba de sus cuentas. */
.ready-strip {
  margin-bottom: 16px;
}

/* ───────── Movimiento ───────── */
/* Cambio de sección: solo la zona de contenido se funde; el menú y la barra
   del mercado no se mueven. */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}
#view {
  view-transition-name: view;
}
::view-transition-group(view) {
  animation-duration: 0s;
}
::view-transition-old(view) {
  animation: fade-out var(--dur-fast) var(--ease-out) both;
}
::view-transition-new(view) {
  animation: rise-in var(--dur-base) var(--ease-out) both;
}
@keyframes fade-out {
  to {
    opacity: 0;
  }
}
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* Avisos: entran desde abajo y se desvanecen al irse. */
.toast {
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    display var(--dur-base) allow-discrete;
}
.toast.hidden {
  opacity: 0;
  transform: translate(-50%, 8px);
}
@starting-style {
  .toast {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

/* Carga: silueta de la sección en lugar de un texto. Aparece solo si la
   carga tarda, para no parpadear cuando la respuesta es inmediata. */
.skeleton {
  display: grid;
  gap: 12px;
  padding-top: 8px;
  opacity: 0;
  animation: appear var(--dur-base) var(--ease-out) 160ms forwards;
}
.sk {
  display: block;
  height: 16px;
  border-radius: var(--r-sm);
  background: linear-gradient(
    90deg,
    var(--raised) 30%,
    var(--raised-2) 50%,
    var(--raised) 70%
  );
  background-size: 300% 100%;
  animation: shimmer 1.6s linear infinite;
}
.sk-title {
  width: 220px;
  height: 32px;
}
.sk-sub {
  width: min(420px, 80%);
}
.sk-panel {
  display: grid;
  gap: 20px;
  margin-top: 16px;
  padding: 24px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--board);
}
.sk-row:nth-child(2n) {
  width: 64%;
}
.order-pane .skeleton,
#order-loading .skeleton {
  padding-top: 0;
}
@keyframes appear {
  to {
    opacity: 1;
  }
}
@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

/* Preparación: lo que llega entra y se marca un momento. */
.chit.arrive,
.pass-row.arrive {
  animation: arrive var(--dur-slow) var(--ease-out) both;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@keyframes line-in {
  from {
    background: var(--amber-bg);
  }
}

/* Tomar pedido: el renglón que se agrega se marca y el contador responde. */
.cart-line.added {
  animation: line-in 0.9s var(--ease-out) both;
}
.cart-line.added .stepper output {
  animation: pop var(--dur-base) var(--ease-out);
}
@keyframes pop {
  50% {
    transform: scale(1.18);
  }
}

/* Botones de categoría, filas y pestañas: el cambio de estado no salta. */
.pick-row,
.tab-item,
.nav-item,
.segmented button {
  transition: background-color var(--dur-fast) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    opacity: 1;
  }
}

/* ───────── Sucursales y planes ───────── */
.branch-row,
.branch-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 128px;
}
.with-sales .branch-row,
.with-sales .branch-total {
  grid-template-columns: minmax(0, 1fr) 140px 120px 128px;
}
.branch-row .chip {
  justify-self: start;
}
.branch-row .row-actions {
  align-items: center;
}
.branch-here {
  font-size: var(--t-sm);
}
.branch-total {
  border-top: 1px solid var(--line);
}
.branch-total .amount {
  font-size: var(--t-lg);
}
/* Organización: cifras del negocio con su cambio contra el periodo anterior
   y una tabla para comparar sucursales. Una barra delgada por fila muestra
   cuánto vende cada una frente a la que más vende; la cifra exacta va al
   lado, así que la barra no lleva leyenda. */
.org-stats .stat small {
  display: block;
  margin-top: 6px;
  font-size: var(--t-sm);
  color: var(--soft);
}
.org-stats .stat small span:not(.sr-only) {
  display: inline;
  font-size: inherit;
}
.org-stats .stat small .org-change > span:not(.sr-only) {
  color: inherit;
}
.org-change.up {
  color: var(--up-ink);
  font-weight: 600;
}
.org-change.down {
  color: var(--down-ink);
  font-weight: 600;
}
.org-table-wrap {
  margin-top: 8px;
}
.org-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.org-table th,
.org-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
.org-table th:first-child,
.org-table td:first-child {
  padding-left: 0;
}
.org-table thead th {
  padding-top: 0;
  font-size: var(--t-sm);
  font-weight: 400;
  color: var(--soft);
  border-bottom-color: var(--line);
}
.org-table .num {
  text-align: right;
  white-space: nowrap;
}
.org-table th[scope="row"] {
  font-weight: 400;
  min-width: 180px;
}
.org-table th[scope="row"] .chip {
  margin-left: 8px;
  vertical-align: 1px;
}
.org-table th[scope="row"] small {
  display: block;
  margin-top: 2px;
  font-size: var(--t-sm);
  color: var(--soft);
}
.org-sales {
  width: 26%;
}
.org-sales .amount {
  font-weight: 600;
  white-space: nowrap;
}
.org-bar {
  display: block;
  height: 4px;
  margin-top: 8px;
}
.org-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--brand);
}
.org-missing {
  color: var(--soft);
}
.org-actions {
  width: 1%;
  padding-right: 0;
  white-space: nowrap;
}
.org-actions .row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.org-total th,
.org-total td {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.org-total .amount,
.org-total td {
  font-weight: 600;
}
@media (max-width: 720px) {
  .org-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .org-table,
  .org-table tbody {
    display: block;
  }
  .org-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .org-table tr.org-total {
    border-top: 1px solid var(--line);
    border-bottom: 0;
  }
  .org-table th,
  .org-table td,
  .org-total th,
  .org-total td {
    display: block;
    padding: 0;
    border: 0;
    width: auto;
    min-width: 0;
  }
  .org-table th[scope="row"],
  .org-table .org-sales,
  .org-table .org-missing,
  .org-table .org-actions {
    grid-column: 1 / -1;
  }
  .org-table .num {
    text-align: left;
  }
  .org-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: var(--t-xs);
    font-weight: 400;
    color: var(--soft);
  }
  .org-table .org-sales::before {
    display: none;
  }
  .org-table .org-sales .amount {
    font-size: var(--t-xl);
  }
  .org-actions .row-actions {
    justify-content: flex-start;
  }
  .org-total td:empty {
    display: none;
  }
}
.seat-list {
  margin: 0;
  padding: 0;
  border: 0;
}
.plan-options {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}
.plan-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.plan-option:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.plan-option:has(input:disabled) {
  cursor: default;
}
.plan-option:has(input:disabled:not(:checked)) .plan-option-body {
  opacity: 0.6;
}
.plan-option.is-current {
  border-color: var(--ink);
}
.plan-option input {
  margin-top: 4px;
}
.plan-option-body {
  display: grid;
  flex: 1;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  align-items: baseline;
}
.plan-option-name {
  font-weight: 600;
  font-size: var(--t-lg);
}
.plan-option-price {
  grid-row: 1;
  grid-column: 2;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--t-lg);
  text-align: right;
}
.plan-option-price.tbd {
  font-family: var(--sans);
  font-size: var(--t-md);
  font-weight: 500;
  color: var(--soft);
}
.plan-option-cap {
  grid-column: 1;
  color: var(--soft);
  font-size: var(--t-sm);
}
.plan-option-body > small {
  grid-column: 2;
  grid-row: 2;
  color: var(--soft);
  font-size: var(--t-sm);
  text-align: right;
}
.plan-option-body > .plan-option-note {
  grid-column: 1 / -1;
  grid-row: auto;
  margin-top: 4px;
  text-align: left;
}
@media (max-width: 720px) {
  .branch-row,
  .with-sales .branch-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    row-gap: 8px;
  }
  .branch-row > div:first-child {
    grid-column: 1 / -1;
  }
  .branch-row .branch-sales {
    text-align: left;
  }
  .with-sales .branch-total {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* ───────── Reportes: gráfica por día y proporciones ───────── */
/* Una sola serie: un solo color, sin leyenda (el título la nombra), barras
   delgadas con punta redondeada sobre la base, rejilla tenue y el dato exacto
   al pasar el cursor o con el teclado. */
.chart {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding-top: 20px;
}
.chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 200px;
  margin-top: -7px;
  margin-bottom: -7px;
  color: var(--soft);
  font-size: var(--t-xs);
  text-align: right;
}
.chart-plot {
  position: relative;
  height: 200px;
  margin-bottom: 28px;
  background: linear-gradient(var(--line-soft), var(--line-soft)) 0 0 / 100%
      1px no-repeat,
    linear-gradient(var(--line-soft), var(--line-soft)) 0 50% / 100% 1px
      no-repeat;
  border-bottom: 1px solid var(--line);
}
.bars {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 2px;
  height: 100%;
}
.bar-col {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  outline: none;
}
.bar-col i {
  display: block;
  width: min(100%, 28px);
  height: max(var(--h), 2px);
  border-radius: 4px 4px 0 0;
  background: var(--brand);
  transform-origin: bottom;
  animation: bar-in var(--dur-slow) var(--ease-out) both;
}
.bar-col i.zero {
  background: var(--line);
}
.bar-col:focus-visible i {
  background: var(--brand-hover);
}
@media (hover: hover) {
  .bar-col:hover i {
    background: var(--brand-hover);
  }
}
.bar-col:focus-visible {
  background: var(--raised);
  border-radius: 4px 4px 0 0;
}
@media (hover: hover) {
  .bar-col:hover {
    background: var(--raised);
    border-radius: 4px 4px 0 0;
  }
}
@keyframes bar-in {
  from {
    transform: scaleY(0);
  }
}
.bar-x {
  position: absolute;
  top: calc(100% + 8px);
  color: var(--soft);
  font-size: var(--t-xs);
  white-space: nowrap;
}
.bar-tip {
  position: absolute;
  bottom: calc(var(--tip-at, 100%) + 8px);
  left: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  font-size: var(--t-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition:
    opacity var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.bar-tip b {
  font-size: var(--t-sm);
}
.bar-col:focus-visible .bar-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (hover: hover) {
  .bar-col:hover .bar-tip {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.bar-col:first-child .bar-tip {
  left: 0;
  transform: translate(0, 4px);
}
.bar-col:first-child:focus-visible .bar-tip {
  transform: none;
}
@media (hover: hover) {
  .bar-col:first-child:hover .bar-tip {
    transform: none;
  }
}
.bar-col:last-child .bar-tip {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}
.bar-col:last-child:focus-visible .bar-tip {
  transform: none;
}
@media (hover: hover) {
  .bar-col:last-child:hover .bar-tip {
    transform: none;
  }
}
.share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: 16px;
  row-gap: 8px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.panel-head + .share-row {
  border-top: 0;
}
.share-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-meta {
  color: var(--soft);
  font-size: var(--t-sm);
}
.share-amount {
  min-width: 92px;
  font-weight: 600;
  text-align: right;
}
.share-bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--line-soft);
  overflow: hidden;
}
.share-bar i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: var(--r-full);
  background: var(--brand);
}
[aria-busy="true"] > :not(.view-head) {
  opacity: 0.5;
  transition: opacity var(--dur-base) var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  .bar-col i {
    animation: none;
  }
}

/* ───────── Carta: tabla de artículos ───────── */
.items {
  --cols: minmax(0, 1.6fr) 96px 104px minmax(120px, 1fr) 128px 112px;
}
.item-row,
.item-cat {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  column-gap: 20px;
  min-height: 56px;
  border-top: 1px solid var(--line-soft);
}
.item-head {
  min-height: 36px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  font-size: var(--t-sm);
}
.item-cat {
  display: flex;
  justify-content: space-between;
  min-height: 0;
  padding: 28px 0 10px;
  border-top: 0;
  font-weight: 700;
  font-size: var(--t-lg);
  letter-spacing: -0.02em;
}
.item-cat .soft {
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: 0;
}
.item-cat + .item-row {
  border-top-color: var(--line);
}
.items .r {
  text-align: right;
  justify-self: end;
}
.item-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 12px;
  min-width: 0;
  padding: 8px 0;
}
.item-name strong {
  font-weight: 600;
}
.item-name small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.item-name small.out {
  color: var(--down-ink);
  font-weight: 600;
}
.item-station,
.item-market {
  color: var(--soft);
  font-size: var(--t-sm);
}
.item-row:not(.item-head) .item-market {
  color: var(--ink);
}
.item-price {
  font-weight: 600;
}
.item-row.off .item-name strong,
.item-row.off .item-price {
  color: var(--faint);
}
.item-row .row-actions {
  justify-content: flex-end;
  gap: 4px;
}
@media (max-width: 1180px) {
  .items {
    --cols: minmax(0, 1.6fr) 96px minmax(120px, 1fr) 120px 104px;
  }
  .items .item-station {
    display: none;
  }
}
@media (max-width: 720px) {
  .items {
    --cols: minmax(0, 1fr) auto auto;
  }
  .items .item-stock,
  .items .item-market {
    display: none;
  }
  .item-row,
  .item-cat {
    column-gap: 12px;
  }
}

/* Descripción de una sección: debajo del título, no pegada a la línea. */
.panel-head > div > p {
  margin-top: 2px;
  font-size: var(--t-sm);
}
.panel-head + .hint,
.panel-head + .hint.tight {
  margin: 12px 0 4px;
}

.hint + .panel,
.panel + .hint {
  margin-top: 48px;
}
.panel + .hint {
  margin-top: 16px;
}
@media (max-width: 720px) {
  .li.wrap .row-actions {
    justify-content: flex-start;
  }
  .mobile-controls .btn {
    white-space: nowrap;
    font-size: var(--t-sm);
    padding: 0 8px;
  }
}

/* Títulos sin palabra suelta al final; párrafos sin viudas. */
h1,
h2,
h3,
.empty strong {
  text-wrap: balance;
}
p,
small,
.hint,
.empty,
.sub {
  text-wrap: pretty;
}
.sheet-body {
  overscroll-behavior: contain;
}
/* Ir directo al contenido con el teclado. */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--board);
  font-weight: 600;
  transform: translateY(-160%);
}
.skip-link:focus-visible {
  transform: none;
}
/* En pantallas táctiles todo lo que se toca mide al menos 44 px, y los
   campos usan 16 px para que el iPhone no acerque la página al escribir. */
@media (pointer: coarse) {
  .btn,
  .btn.small {
    min-height: 44px;
  }
  .btn.icon-only,
  .btn.icon-only:not(.small) {
    width: 44px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* ───────── Revisión con las guías (Vercel, Kowalski, Krehel, Impeccable) ───────── */
/* Ícono a la izquierda: 2 px menos de aire de ese lado para que el botón se
   vea centrado (el ícono pesa menos que el texto). */
.btn > .ic:first-child:not(:only-child) {
  margin-left: -2px;
}
/* Enlaces de sección y «Cancelar» de una línea: zona de toque cómoda sin
   cambiar el alto de la fila. */
.panel-head .link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: -4px 0;
}
.line .line-cancel {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: -5px 0;
}
/* Párrafos a un largo de línea legible. */
/* 64ch de esta letra son unos 75 caracteres reales por renglón. */
#view p,
.hint,
.empty,
.view-head .sub {
  max-width: 64ch;
}
@media (pointer: coarse) {
  .panel-head .link,
  .line .line-cancel {
    min-height: 44px;
    margin: -12px 0;
  }
  .segmented button,
  .subtabs a,
  .chit-one,
  .pass-toggle,
  .mobile-controls .btn,
  input:not([type="checkbox"]):not([type="radio"]),
  select {
    min-height: 44px;
  }
  .subtabs a {
    display: inline-flex;
    align-items: center;
  }
}
/* En el celular el nombre de la bebida se lee completo, en dos renglones si
   hace falta, en lugar de cortarse. */
@media (max-width: 720px) {
  .qname b {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }
}
@media (pointer: coarse) {
  .view-actions .segmented button {
    min-height: 44px;
  }
  .panel-head .link {
    min-width: 44px;
    justify-content: flex-end;
  }
}

/* Revisión de las ventanas. */
#modal-close {
  flex: none;
}
.line-note-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: -4px 0 -6px;
}
.round-time {
  color: color-mix(in oklab, var(--amber) 82%, black);
}
.profile-card small {
  overflow-wrap: anywhere;
}
@media (pointer: coarse) {
  #modal-close {
    width: 44px;
    height: 44px;
    margin: -4px -6px 0 0;
  }
  .cats button {
    min-height: 44px;
  }
  .stepper.small button {
    width: 44px;
    height: 44px;
  }
  .line-note-toggle {
    min-height: 44px;
    margin: -10px 0 -10px;
  }
}
.sheet-head > div {
  min-width: 0;
}
#modal-sub {
  overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  .order {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (pointer: coarse) {
  .recipe-row .icon-btn {
    width: 44px;
    height: 44px;
  }
}
@media (pointer: coarse) {
  .recipe-row {
    grid-template-columns: minmax(0, 1fr) 96px 44px;
  }
}
/* Celular: el nombre de la bebida arriba; cantidad e importe debajo. */
@media (max-width: 720px) {
  .cart-main {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .cart-name {
    flex-basis: 100%;
  }
  .cart-line .amount {
    margin-left: auto;
  }
}
.sheet-body:focus {
  outline: none;
}
.file-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.file-pick label {
  margin: 0;
  cursor: pointer;
}
.file-pick label.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.file-pick label:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.file-pick #photo-name,
.file-pick #menu-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--t-sm);
}
/* El contenido usa todo el ancho; los formularios no se estiran más que
   una lectura cómoda de campo y etiqueta. */
#view .panel > form {
  max-width: 760px;
}

/* ───────── Terminal del personal ─────────
   Pensada para una tablet en la barra: nombres grandes y un teclado
   numérico con teclas de 64 px. */
.terminal-card {
  width: min(100%, 560px);
  background: var(--board);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 28px;
}
.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.terminal-head .logo {
  font-size: var(--t-2xl);
}
.terminal-where {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
  text-align: right;
}
.terminal-where small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.terminal-card h1 {
  font-size: var(--t-2xl);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.terminal-card .lead {
  margin-top: 6px;
  color: var(--soft);
}
.t-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 8px;
  margin-top: 20px;
  max-height: min(56dvh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.t-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--page);
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.t-person > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.t-person b {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.t-person small {
  color: var(--soft);
  font-size: var(--t-sm);
}
@media (hover: hover) {
  .t-person:hover {
    background: var(--raised);
  }
}
.t-person:active {
  transform: scale(0.98);
}
.t-people .empty {
  grid-column: 1 / -1;
}
.t-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: -12px 0 0 -4px;
  color: var(--soft);
}
.t-who {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  text-align: center;
}
.t-who h1 {
  margin-top: 6px;
}
.t-who small {
  color: var(--soft);
}
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  height: 16px;
  margin: 24px 0 8px;
}
.pin-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--faint);
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.pin-dots span.on {
  border-color: var(--ink);
  background: var(--ink);
}
.pin-dots.shake {
  animation: pin-shake 280ms var(--ease-out);
}
@keyframes pin-shake {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}
#t-error {
  min-height: 20px;
  text-align: center;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 320px;
  margin: 8px auto 0;
}
.keypad button {
  height: 64px;
  border-radius: var(--r-md);
  background: var(--page);
  font-size: var(--t-2xl);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.keypad button.soft-key {
  font-size: var(--t-md);
  color: var(--soft);
}
.keypad button.enter {
  background: var(--ink);
  color: var(--board);
  font-size: var(--t-md);
}
.keypad button:disabled {
  opacity: 0.4;
}
@media (hover: hover) {
  .keypad button:not(:disabled):not(.enter):hover {
    background: var(--raised);
  }
}
.keypad button:not(:disabled):active {
  transform: scale(0.96);
}
.terminal-card .aside {
  margin-top: 24px;
  text-align: center;
  font-size: var(--t-md);
}
.terminal-card .aside button {
  color: var(--soft);
  text-underline-offset: 3px;
}
@media (max-width: 720px) {
  .terminal-card {
    padding: 20px 18px;
  }
  .terminal.auth {
    place-items: start center;
  }
}
#t-pin-step:focus,
#t-owner-step:focus {
  outline: none;
}
/* Configurar el equipo: tres usos como filas que se eligen enteras. */
.t-setup .btn.wide,
#t-owner-step .btn.wide {
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
}
.t-setup input,
.t-setup select,
#t-owner-step input {
  min-height: 48px;
}
.t-use {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}
.t-use legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: var(--t-sm);
  color: var(--soft);
}
.t-use-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--page);
  color: var(--ink);
  font-size: var(--t-md);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.t-use-opt input {
  margin-top: 2px;
}
.t-use-opt span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.t-use-opt b {
  font-weight: 600;
}
.t-use-opt small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.t-use-opt:has(:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.t-use-opt:has(:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
/* El propietario se distingue del personal por su inicial en la marca. */
.t-owner .avatar,
#t-owner-avatar {
  background: var(--brand);
  color: var(--mint);
}
.t-hint {
  grid-column: 1 / -1;
  margin: 4px 2px 0;
}
.t-step {
  min-height: 20px;
  margin: 12px auto 0;
  max-width: 34ch;
  color: var(--soft);
  font-size: var(--t-md);
  text-align: center;
  text-wrap: balance;
}
.t-step:empty {
  margin: 0;
  min-height: 0;
}
/* El código de entrada se muestra una sola vez: grande y legible. */
.entry-code {
  margin: 8px 0 16px;
  padding: 20px 12px;
  border-radius: var(--r-md);
  background: var(--page);
  font-size: var(--t-3xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  text-align: center;
  user-select: all;
}
.sheet-body > .entry-code:first-child {
  margin-top: 8px;
  color: var(--ink);
}

/* Nombre de la mesa en el ranking, dentro de la cuenta abierta. */
.ticket-ranking {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.ticket-ranking > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ticket-ranking strong {
  overflow-wrap: anywhere;
}
.ticket-ranking small {
  color: var(--soft);
  font-size: var(--t-sm);
}

/* Asistencia: Equipo → Asistencia, Mi asistencia, Relojes checadores. */
.att-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 20px;
}
.att-periods {
  max-width: 100%;
  overflow-x: auto;
}
.att-periods button {
  flex: none;
}
.att-range {
  font-size: var(--t-sm);
}
.att-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.att-dates label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.att-dates input {
  width: auto;
  min-height: 38px;
}
.att-table-wrap {
  margin-top: 8px;
}
.att-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.att-table th,
.att-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}
.att-table th:first-child,
.att-table td:first-child {
  padding-left: 0;
}
.att-table td:last-child {
  padding-right: 0;
  text-align: right;
}
.att-table thead th {
  padding-top: 0;
  font-size: var(--t-sm);
  font-weight: 400;
  color: var(--soft);
  border-bottom-color: var(--line);
}
.att-table .num {
  text-align: right;
  white-space: nowrap;
}
.att-table th[scope="row"] {
  font-weight: 400;
}
.att-table th[scope="row"] small {
  display: block;
  margin-top: 2px;
  font-size: var(--t-sm);
  color: var(--soft);
}
.att-name {
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}
@media (hover: hover) {
  .att-name:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
.att-hours {
  font-weight: 600;
}
.att-status .chip + .chip {
  margin-left: 6px;
}
@media (max-width: 560px) {
  .att-periods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
}
@media (max-width: 720px) {
  .att-table thead {
    display: none;
  }
  .att-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .att-table th,
  .att-table td {
    padding: 0;
    border: 0;
  }
  .att-table td[data-label="Días"],
  .att-table .att-go {
    display: none;
  }
  .att-table .att-hours {
    grid-column: 2;
    grid-row: 1;
  }
  .att-table .att-status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    grid-column: 1 / -1;
  }
  .att-table .att-status .chip + .chip {
    margin-left: 0;
  }
  .att-table .att-status:empty {
    display: none;
  }
}
.att-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 16px;
}
.att-summary > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-right: auto;
}
.att-summary > div strong {
  font-size: var(--t-2xl);
  letter-spacing: -0.02em;
}
.att-summary > div span {
  color: var(--soft);
}
.att-list {
  margin-top: 4px;
}
.att-list .li .soft {
  font-size: var(--t-md);
}
.att-voided strong {
  color: var(--soft);
  text-decoration: line-through;
}
.att-map-select {
  width: auto;
  max-width: 55%;
  min-height: 38px;
}
.att-when {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.att-when.att-cols {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 560px) {
  .att-when,
  .att-when.att-cols {
    grid-template-columns: 1fr;
  }
}
/* Retardos y faltas (Asistencia) y Horarios. */
.att-punctual-sum {
  margin: 0 0 8px;
  color: var(--soft);
}
.att-punctual h3 {
  margin-top: 16px;
}
.sched-row {
  align-items: flex-start;
  gap: 14px;
}
.sched-row .avatar {
  flex: none;
}
.sched-main {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}
.sched-main small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.sched-week {
  margin: 4px 0 0;
  font-weight: 600;
}
.sched-week.soft {
  font-weight: 400;
}
.sched-changes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.sched-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-full);
  color: var(--soft);
  font-size: var(--t-sm);
}
.sched-undo {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--soft);
  cursor: pointer;
}
.sched-undo svg {
  width: 14px;
  height: 14px;
}
.sched-undo:hover,
.sched-undo:focus-visible {
  background: var(--line-soft);
  color: var(--ink);
}
.sched-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.sched-grid {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 8px 12px;
  align-items: center;
  margin: 12px 0;
}
.sched-grid .sched-on {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 400;
}
.sched-grid input[type="time"] {
  min-height: 40px;
}
.sched-grid input[type="time"]:disabled {
  opacity: 0.4;
}
@media (max-width: 560px) {
  .sched-row {
    flex-wrap: wrap;
  }
  .sched-actions {
    width: 100%;
    justify-content: flex-start;
    padding-left: 54px;
  }
}
.att-preview {
  margin: 0 0 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.att-preview table {
  border-collapse: collapse;
  font-size: var(--t-sm);
}
.att-preview th,
.att-preview td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}
.att-preview th {
  font-weight: 400;
  color: var(--soft);
}
.att-preview tr:last-child td {
  border-bottom: 0;
}

/* Terminal: registrar entrada o salida sin abrir sesión. */
.t-clock {
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
}
.t-kind {
  max-width: 320px;
  margin: 16px auto 0;
}
.t-kind button {
  min-height: 44px;
  font-size: var(--t-md);
}
.t-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 0 8px;
  text-align: center;
}
.t-done-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--cta-ink);
}
.t-done-mark .ic {
  width: 30px;
  height: 30px;
}
.t-done .btn {
  min-width: 200px;
  min-height: 52px;
  margin-top: 16px;
}

/* Organización: la pantalla del negocio, sin la barra ni los avisos del
   bar que se está operando. Elegir una sucursal muestra sus números. */
body[data-view="sucursales"] .marketbar,
body[data-view="sucursales"] #banners,
body[data-view="sucursales"] .rail-venue {
  display: none;
}
.org-name {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
@media (hover: hover) {
  .org-name:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
.org-detail {
  display: grid;
  gap: 20px;
}
.org-detail > .cols-2 {
  margin: 0;
}

/* Ajustes → Pagos en línea → Casos por revisar */
.recon .panel-head {
  flex-wrap: wrap;
  gap: 8px 12px;
}
.recon .panel-head .segmented {
  margin-left: auto;
}
.recon-case small {
  display: block;
}
.recon-case .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  word-break: break-all;
}
.recon-note {
  margin-top: 4px;
  color: var(--ink);
}

/* Facturación electrónica */
.receipt-fiscal {
  display: contents;
}
.receipt-fiscal[hidden] {
  display: none;
}
.cfdi-state {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.cfdi-detail .mono {
  font-family: var(--mono, ui-monospace, monospace);
  overflow-wrap: anywhere;
}
.cfdi-pick {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 12px 0;
  max-height: 280px;
  overflow-y: auto;
}
.cfdi-pick legend {
  padding: 0 4px;
  color: var(--soft);
}
.cfdi-link {
  display: grid;
  justify-items: start;
  gap: 8px;
}
.cfdi-link img {
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
  background: #fff;
  padding: 8px;
  border-radius: 8px;
}
.cfdi-link input {
  width: 100%;
}
.invoice-card .kv {
  margin-top: 8px;
}
.invoice-card .notice {
  margin-top: 16px;
}
.invoice-card .mono {
  overflow-wrap: anywhere;
  text-align: right;
}
.invoice-files {
  display: grid;
  gap: 8px;
}
.invoice-uuid .mono {
  color: var(--ink, inherit);
  font-weight: 600;
}
.cfdi-note {
  display: none;
}
@media print {
  .cfdi-note {
    display: block;
    font-size: 14pt;
  }
  .cfdi-link input,
  .cfdi-link label {
    display: none;
  }
}

/* Salida del bar a Organización para el propietario con varias sucursales.
   En la barra lateral completa va sobre el nombre del bar; con la barra
   angosta o en el celular, como franja arriba de la barra del mercado. */
.rail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  margin: 0 0 8px -4px;
  padding: 4px 8px 4px 4px;
  border-radius: 8px;
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
}
.rail-back .ic {
  width: 16px;
  height: 16px;
}
.rail-back[hidden],
.org-back[hidden] {
  display: none;
}
@media (hover: hover) {
  .rail-back:hover {
    color: var(--ink);
    background: var(--line);
  }
}
.org-back {
  display: none;
}
@media (max-width: 1180px) {
  .org-back:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px 0 10px;
    border-bottom: 1px solid var(--line);
    background: var(--board);
    color: var(--ink);
    font-size: var(--t-sm);
    font-weight: 600;
    text-decoration: none;
  }
  .org-back .ic {
    width: 18px;
    height: 18px;
  }
  .org-back small {
    margin-left: auto;
    overflow: hidden;
    color: var(--soft);
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
body[data-view="sucursales"] .org-back {
  display: none;
}

/* ───────── Entrar y crear cuenta ─────────
   Solo el acceso (CEO, 2026-11-19): logo arriba, el formulario al centro en
   una columna y los avisos legales abajo. Sin tarjeta ni panel decorativo. */
.auth.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: stretch;
  padding: 0;
  background: var(--board);
}
.auth-main {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 24px 16px 32px;
}
.auth-main > .logo {
  align-self: flex-start;
  font-size: var(--t-2xl);
}
.auth-form {
  width: min(100%, 384px);
  margin: auto;
  padding: 40px 0 16px;
}
.auth-form h1 {
  font-size: var(--t-3xl);
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.auth-form .lead {
  margin-top: 8px;
  color: var(--soft);
  font-size: var(--t-lg);
}
.auth-form .btn.wide {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
}
.auth-form input {
  min-height: 48px;
}
.auth-form .aside {
  margin-top: 12px;
  text-align: center;
}
.auth-form .aside .link {
  min-height: 44px;
  color: var(--soft);
}
.auth-providers {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}
.auth-providers[hidden],
.auth-or[hidden] {
  display: none;
}
.provider-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out);
}
.provider-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
/* Colores de las guías de cada marca: Apple negro, Google blanco con borde. */
.provider-btn.apple {
  background: #000000;
  color: #ffffff;
}
.provider-btn.apple svg {
  margin-top: -2px;
}
.provider-btn.google {
  border: 1px solid #747775;
  background: #ffffff;
  color: #1f1f1f;
}
@media (hover: hover) {
  .provider-btn.apple:hover {
    background: #2b2b2b;
  }
  .provider-btn.google:hover {
    background: #f2f2f2;
  }
}
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 4px;
  color: var(--soft);
  font-size: var(--t-sm);
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 8px;
}
.label-row label {
  margin: 0;
}
.label-row a {
  color: var(--soft);
  font-size: var(--t-sm);
  text-underline-offset: 3px;
}
.reveal {
  position: relative;
}
.reveal input {
  padding-right: 84px;
}
.reveal-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  min-width: 64px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--soft);
  font-size: var(--t-sm);
  font-weight: 600;
  transform: translateY(-50%);
}
@media (hover: hover) {
  .reveal-btn:hover,
  .label-row a:hover {
    color: var(--ink);
  }
}
.auth-switch {
  margin-top: 28px;
  color: var(--soft);
}
.auth-switch a,
.auth-switch .link {
  color: var(--ink);
  font-weight: 600;
  text-underline-offset: 3px;
}
/* En el celular el formulario va arriba (el teclado no lo tapa) y los
   avisos al fondo; en computadora, al centro. */
.auth-form {
  margin: 0 auto;
  padding-top: 48px;
}
.auth-foot {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  font-size: var(--t-sm);
}
.auth-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--soft);
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .auth-foot a:hover {
    color: var(--ink);
  }
}
@media (min-width: 960px) {
  .auth-main {
    padding: 32px 48px 24px;
  }
  .auth-form {
    margin: auto;
    padding-top: 40px;
  }
  .auth-foot {
    margin-top: 0;
  }
  .auth-form h1 {
    font-size: 2.5rem;
  }
}
.auth-step {
  margin-bottom: 12px;
  color: var(--soft);
  font-size: var(--t-sm);
  font-weight: 600;
}
.auth-step[hidden],
.auth-form .lead[hidden],
.auth-form form[hidden] {
  display: none;
}
.auth-form .field-hint {
  margin-top: 6px;
}
.auth-form .check {
  margin-top: 20px;
}
.auth-form .check a {
  text-underline-offset: 3px;
}
.auth-form .invite-note {
  margin-top: 20px;
}
.auth-switch .link {
  min-height: 44px;
  font-size: inherit;
  text-decoration: underline;
}
.auth-switch .btn.wide {
  width: 100%;
  min-height: 48px;
  margin-top: -4px;
  color: var(--cta-ink);
  text-decoration: none;
}

/* ───────── Organización: marco propio del propietario ─────────
   Sin el menú, el mercado ni las pestañas del bar. Arriba solo el logo y
   la cuenta; operar una sucursal lleva al panel de siempre. */
.org-top {
  display: none;
}
body[data-shell="org"] .shell {
  grid-template-columns: minmax(0, 1fr);
}
body[data-shell="org"] .rail,
body[data-shell="org"] .marketbar,
body[data-shell="org"] .tabbar,
body[data-shell="org"] .org-back {
  display: none;
}
body[data-shell="org"] .org-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--board);
}
body[data-shell="org"] .view {
  width: min(100%, 1280px);
  margin: 0 auto;
}
.org-top .logo {
  font-size: var(--t-xl);
}
.org-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--r-full);
  color: var(--ink);
  font-weight: 600;
}
.org-user .chev {
  width: 16px;
  height: 16px;
  color: var(--faint);
}
.org-user[aria-expanded="true"] {
  background: var(--page);
}
@media (hover: hover) {
  .org-user:hover {
    background: var(--page);
  }
}
@media (max-width: 720px) {
  body[data-shell="org"] {
    padding-bottom: 0;
  }
  body[data-shell="org"] .org-top {
    min-height: 56px;
    padding: 0 16px;
  }
  .org-user-name {
    display: none;
  }
}

/* ───────── Hoy: la jornada en vivo ─────────
   La misma página que Reportes y Contabilidad: título, cuatro cifras,
   secciones con su regla y una tabla por sucursal. Lo vendido y la
   ganancia estimada crecen solos; una sparkline (la línea de la bolsa)
   bajo lo vendido compara con ayer a la misma hora. Solo «Operar» sale
   de Organización. */
.today-live {
  margin-top: 8px;
}
.live-state {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-size: var(--t-sm);
  font-weight: 600;
}
.live-state.stale {
  color: var(--amber);
}
.live-state .ic {
  width: 16px;
  height: 16px;
}
/* Lo que subió desde la última lectura, un momento junto a la cifra. */
.live-grew {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: var(--r-full);
  background: var(--up-bg);
  color: var(--up-ink);
  font-size: var(--t-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  animation: live-grew 6s var(--ease-out) forwards;
}
@keyframes live-grew {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  8%,
  80% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .live-grew {
    animation: none;
  }
}
/* La sparkline: sin ejes ni rejilla, solo la línea de hoy, la de ayer
   punteada, una base y un punto en este momento. */
.spark {
  position: relative;
  min-width: 0;
}
.spark .live-plot {
  position: relative;
  height: 72px;
  touch-action: pan-y;
}
.spark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.spark-base {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.spark .live-tip {
  top: auto;
  bottom: calc(100% + 6px);
}
.today-spark {
  margin: -8px 0 40px;
}
.today-spark .spark {
  margin: 0;
}
.spark-x {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--faint);
  font-size: var(--t-xs);
  font-variant-numeric: tabular-nums;
}
.live-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 8px;
  padding: 0;
  color: var(--soft);
  font-size: var(--t-xs);
  list-style: none;
}
.live-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.live-legend .key {
  width: 16px;
  height: 0;
  border-top: 2px solid var(--up);
}
.live-legend .key.before {
  border-top: 2px dashed #8a8a8a;
}
.live-area {
  fill: var(--up-bg);
}
.live-line,
.live-before {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.live-line {
  stroke: var(--up);
  stroke-width: 2.5;
}
.live-before {
  stroke: #8a8a8a;
  stroke-width: 2;
  stroke-dasharray: 5 5;
}
.live-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid var(--board);
  border-radius: var(--r-full);
  background: var(--up);
  box-shadow: 0 0 0 4px var(--up-bg);
  pointer-events: none;
}
.live-tip {
  position: absolute;
  top: 8px;
  z-index: 2;
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: var(--cta-ink);
  font-size: var(--t-xs);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateX(8px);
  pointer-events: none;
}
.live-tip.flip {
  transform: translateX(calc(-100% - 8px));
}
.live-tip b {
  font-size: var(--t-sm);
}
.live-tip[hidden] {
  display: none;
}
.org-change .org-before {
  color: var(--soft);
  font-weight: 400;
}
.today-stats .stat strong [data-roll] {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
}
.today-stats .stat[data-grow] > span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
}
.today-note {
  margin: -24px 0 40px;
  max-width: 72ch;
}
.panel-head > div > p {
  margin-top: 2px;
  color: var(--soft);
  font-size: var(--t-sm);
}
.today-name {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .today-name:hover {
    text-decoration-color: currentColor;
  }
}
.today-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  color: var(--soft);
  font-size: var(--t-sm);
}
.today-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--faint);
}
.today-state.on {
  color: var(--up-ink);
}
.today-state.on::before {
  background: var(--up);
}
.today-state.off {
  color: var(--down-ink);
}
.today-state.off::before {
  background: var(--down);
}
.today-table .org-sales {
  width: 22%;
}
@media (max-width: 720px) {
  .today-note {
    margin-top: -16px;
  }
}

/* ───────── Campanita de avisos ───────── */
.org-end {
  display: flex;
  align-items: center;
  gap: 4px;
}
.org-bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  color: var(--ink);
}
.org-bell[hidden] {
  display: none;
}
.org-bell .ic {
  width: 22px;
  height: 22px;
}
.org-bell[aria-expanded="true"] {
  background: var(--page);
}
@media (hover: hover) {
  .org-bell:hover {
    background: var(--page);
  }
}
.org-bell:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.bell-count {
  position: absolute;
  top: 5px;
  right: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--board);
  border-radius: var(--r-full);
  background: #d4372c;
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.bell-count[hidden] {
  display: none;
}
.bell-pop {
  width: min(400px, calc(100vw - 16px));
  max-height: min(560px, calc(100dvh - 88px));
  padding: 0;
  overflow: hidden;
}
.bell-pop:popover-open {
  display: flex;
  flex-direction: column;
}
.bell-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.bell-head h2 {
  font-size: var(--t-lg);
}
.bell-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.bell-group {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.bell-group:last-child {
  border-bottom: 0;
}
.bell-branch {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.bell-branch h3 {
  font-size: var(--t-md);
}
.bell-branch .link,
.bell-group li .link {
  font-size: var(--t-sm);
}
.bell-group ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bell-group li {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--soft);
  font-size: var(--t-sm);
  line-height: 1.45;
}
.bell-group li .ic {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--amber-ink, #9a5b00);
}
.bell-group li.new {
  color: var(--ink);
  font-weight: 600;
}
.bell-group li.new::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin: 6px 0 0 auto;
  border-radius: var(--r-full);
  background: #d4372c;
}
.bell-group li a {
  color: var(--ink);
  font-weight: 600;
}
.bell-empty {
  display: flex;
  gap: 12px;
  padding: 20px 16px;
  color: var(--soft);
  font-size: var(--t-sm);
  line-height: 1.5;
}
.bell-empty .ic {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--up-ink);
}
.bell-empty strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
}
.bell-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: var(--t-xs);
}

/* Ventas por día con la parte de cada sucursal (paleta validada). */
.s1 {
  --c: #2a78d6;
}
.s2 {
  --c: #eb6834;
}
.s3 {
  --c: #1baf7a;
}
.s4 {
  --c: #eda100;
}
.s5 {
  --c: #e87ba4;
}
.s0 {
  --c: #8c8c87;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: var(--t-sm);
}
.chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chart-legend .key,
.tip-row .key {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 3px;
  background: var(--c);
}
.stack-col .stack {
  display: flex;
  flex-direction: column-reverse;
  width: min(100%, 28px);
  height: var(--h);
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  transform-origin: bottom;
  animation: bar-in var(--dur-slow) var(--ease-out) both;
}
.stack-col .stack.zero {
  height: 2px;
  background: var(--line);
}
.stack-col .seg {
  display: block;
  flex: none;
  height: var(--h);
  min-height: 2px;
  background: var(--c);
}
/* 2 px de separación entre la parte de una sucursal y la siguiente. */
.stack-col .seg + .seg {
  border-bottom: 2px solid var(--board);
  box-sizing: content-box;
  margin-bottom: -2px;
}
.stack-col:hover .stack,
.stack-col:focus-visible .stack {
  filter: brightness(0.92);
}
.bar-tip .tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.bar-tip .tip-v {
  margin-left: auto;
  padding-left: 12px;
  font-weight: 600;
}
@media (max-width: 720px) {
  .org-now {
    margin-right: -16px;
    margin-left: -16px;
    padding: 20px 16px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .now-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.now-before {
  color: var(--soft);
  font-size: var(--t-sm);
}

/* Selector de Organización: todo el negocio o una sucursal. El mismo en
   Inicio, Reportes, Contabilidad y Equipo, siempre primero en la fila. */
.pick-btn {
  gap: 8px;
  min-width: 0;
  max-width: 280px;
}
.pick-btn .pick-label {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-btn .ic:last-child {
  margin-left: 4px;
  color: var(--soft);
}
.pick-pop {
  min-width: 260px;
  max-height: min(70vh, 480px);
  overflow-y: auto;
}
.pick-pop button {
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}
.pick-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.pick-text small {
  color: var(--soft);
  font-size: var(--t-xs);
}
.pick-pop button .ic {
  flex: none;
  visibility: hidden;
}
.pick-pop button[aria-checked="true"] .ic {
  visibility: visible;
}
.pick-pop button[aria-checked="true"] .pick-name {
  font-weight: 600;
}
.pick-sep {
  height: 1px;
  margin: 4px 8px;
  background: var(--line);
}
@media (max-width: 720px) {
  .view-actions .pick-btn {
    flex: 1 1 100%;
    max-width: none;
    justify-content: flex-start;
  }
  .view-actions .pick-btn .ic:last-child {
    margin-left: auto;
  }
  /* El menú toma el ancho del botón, de orilla a orilla. */
  .pick-pop {
    right: 16px !important;
    left: 16px !important;
    width: auto;
    min-width: 0;
    max-width: none;
  }
  .org-now-head {
    flex-wrap: wrap;
  }
}

/* ───────── Organización: menú del negocio y Equipo del negocio ─────────
   Inicio, Equipo y Suscripción junto al logo; la sección actual se marca
   con una línea abajo, como las pestañas. */
.org-nav {
  display: none;
}
body[data-shell="org"] .org-nav {
  display: flex;
  flex: 1;
  align-self: stretch;
  gap: 4px;
  margin-left: 24px;
}
.org-nav a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 2px solid transparent;
  color: var(--soft);
  font-weight: 600;
  text-decoration: none;
}
.org-nav a[aria-current="page"] {
  border-bottom-color: var(--ink);
  color: var(--ink);
}
@media (hover: hover) {
  .org-nav a:hover {
    color: var(--ink);
  }
}
.org-nav a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -4px;
}
@media (max-width: 720px) {
  body[data-shell="org"] .org-nav {
    gap: 0;
    margin-left: 4px;
  }
  .org-nav a {
    padding: 0 8px;
    font-size: var(--t-sm);
  }
}
.person-row {
  align-items: flex-start;
  gap: 14px;
}
.person-row .avatar {
  flex: none;
}
.person-main {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}
.places {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.place {
  display: inline-flex;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-full);
  color: var(--soft);
  font-size: var(--t-sm);
}
.place b {
  color: var(--ink);
  font-weight: 600;
}
.place.on {
  border-color: var(--ink);
}
.person-all {
  flex: none;
  font-size: var(--t-sm);
}
.access-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 10px 16px;
  margin-top: 12px;
}
.access-list label {
  margin: 0;
}
/* Celulares angostos (320 a 420 px): logo, menú y cuenta en una línea. */
@media (max-width: 420px) {
  body[data-shell="org"] .org-top {
    gap: 8px;
    padding: 0 12px;
  }
  body[data-shell="org"] .org-top .logo {
    font-size: var(--t-lg);
  }
  body[data-shell="org"] .org-nav {
    margin-left: 0;
  }
  .org-nav a {
    padding: 0 6px;
  }
  .org-user {
    padding: 4px;
  }
  .org-user .chev {
    display: none;
  }
}
/* El detalle de cada barra se abre hacia adentro de la gráfica: las de la
   mitad izquierda alinean a su izquierda y las de la derecha, a su derecha.
   Así nunca sale de la pantalla, aunque sean 90 barras en un celular. */
.bar-col.tip-start .bar-tip {
  left: 0;
  right: auto;
  transform: translate(0, 4px);
}
.bar-col.tip-end .bar-tip {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}
.bar-col.tip-start:focus-visible .bar-tip,
.bar-col.tip-end:focus-visible .bar-tip {
  transform: none;
}
@media (hover: hover) {
  .bar-col.tip-start:hover .bar-tip,
  .bar-col.tip-end:hover .bar-tip {
    transform: none;
  }
}
/* La tabla de sucursales se desliza de lado si no cabe (tabletas). Es
   contenedor de posición para que sus textos solo para lector de pantalla
   no se salgan de la página. */
.org-table-wrap {
  position: relative;
  overflow-x: auto;
}

/* ───────── Perfil: formas de entrar ───────── */
.login-methods {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}
.method {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 4px;
  border-top: 1px solid var(--line-soft);
}
.method:first-child {
  border-top: 0;
}
.method > .ic {
  flex: none;
  color: var(--soft);
}
.method > div {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}
.method small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.method > .btn,
.method > .soft {
  flex: none;
}
.method > .soft {
  font-size: var(--t-sm);
}

/* Organización: el menú del negocio va centrado en la barra (pedido del
   CEO). En pantallas anchas se centra respecto a toda la barra; en el
   celular, en el espacio que dejan el logo y la cuenta. */
@media (min-width: 721px) {
  body[data-shell="org"] .org-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
  body[data-shell="org"] .org-nav {
    justify-content: center;
    margin-left: 0;
  }
  body[data-shell="org"] .org-top .logo {
    justify-self: start;
  }
  body[data-shell="org"] .org-end {
    justify-self: end;
  }
}
@media (max-width: 720px) {
  body[data-shell="org"] .org-nav {
    justify-content: center;
    margin-left: 0;
  }
}

.org-table th .link {
  font-weight: 600;
  text-align: left;
}
/* Los cinco periodos no caben en un celular: la fila se desliza. */
.view-head[data-biz-view] .view-actions {
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}
.view-head[data-biz-view] .segmented {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.view-head[data-biz-view] .segmented button {
  flex: none;
}

/* Contabilidad */
.acc-month {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.acc-month strong {
  min-width: 9.5em;
  text-align: center;
  font-size: var(--t-md);
}
.acc-next {
  display: inline-flex;
  transform: scaleX(-1);
}
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hint.flush {
  margin-top: 8px;
  margin-bottom: 8px;
}
.acc-notes {
  margin: 12px 0 0;
  padding-left: 1.2em;
  color: var(--amber);
  font-size: var(--t-sm);
}
.acc-notes li + li {
  margin-top: 4px;
}
.acc-expense {
  gap: 12px;
}
.acc-expense > div {
  flex: 1;
  min-width: 0;
}
.acc-kind {
  border: 0;
  margin: 0 0 8px;
  padding: 0;
}
.acc-kind legend {
  font-weight: 600;
  font-size: var(--t-md);
}
.kv-list {
  margin-bottom: 8px;
}

/* Organización en celular: con cuatro entradas el menú baja a su propia
   franja, a todo el ancho y centrado; logo y cuenta quedan arriba. */
@media (max-width: 560px) {
  body[data-shell="org"] .org-top {
    flex-wrap: wrap;
    row-gap: 0;
  }
  body[data-shell="org"] .org-nav {
    order: 3;
    flex: 0 0 calc(100% + 24px);
    min-height: 44px;
    margin: 0 -12px;
    padding: 0 6px;
    border-top: 1px solid var(--line-soft);
    justify-content: safe center;
    overflow-x: auto;
    scrollbar-width: none;
  }
  body[data-shell="org"] .org-nav::-webkit-scrollbar {
    display: none;
  }
  body[data-shell="org"] .org-nav a {
    flex: none;
  }
}
/* Gastos fijos en celular: importe y estado bajan a su propia línea. */
@media (max-width: 560px) {
  .acc-fixed {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .li.acc-fixed > div:first-child {
    flex-basis: 100%;
  }
  .acc-fixed .amount {
    margin-right: auto;
  }
}
/* Facturas de proveedores: descargas junto a cada factura. */
.acc-files {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

#invoice-usage h3 {
  margin: 20px 0 6px;
  font-size: 1rem;
}
#invoice-usage .hint {
  margin-bottom: 4px;
}

.pack-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 0 12px;
}
/* Vista previa de la importación: se desplaza dentro de la ventana. */
#import-preview:not(:empty) {
  margin-top: 16px;
}
.import-list {
  max-height: 320px;
  overflow-y: auto;
}
/* Opción compartida: a qué productos se aplica, por categoría. */
.set-products {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}
.set-products legend {
  font-weight: 650;
  padding: 0;
}
.set-cat {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.set-cat .check:not(.set-cat-head) {
  padding-left: 20px;
}
.set-cat-head span {
  font-weight: 650;
}
/* Presentaciones de un producto: nombre, precio y equivalencia. */
.size-row {
  display: grid;
  grid-template-columns: 1fr 96px 96px auto;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}
.size-row label {
  margin-top: 0;
}
.size-row .icon-btn {
  margin-bottom: 4px;
}
@media (max-width: 560px) {
  .size-row {
    grid-template-columns: 1fr 1fr auto;
  }
  .size-row > div:first-child {
    grid-column: 1 / -1;
  }
}
/* Ordenar la carta: categorías y, dentro, sus productos. */
.arrange,
.arrange ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.arrange {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.arrange ol {
  margin-left: 16px;
}
.arrange-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--line-soft);
}
.arrange-cat > .arrange-row {
  border-bottom-color: var(--line);
}
.arrange-btns {
  display: flex;
  gap: 4px;
}
.arrange-btns .icon-btn:disabled {
  opacity: 0.3;
}
/* Pistock Connect: resumen y «Agregar equipo» sobre la lista. */
.cx-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
/* Lista del traspaso que se va a enviar. */
.transfer-lines {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.transfer-lines li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px 6px 12px;
  border-radius: var(--r-sm);
  background: var(--raised);
}
.transfer-lines:empty {
  display: none;
}
/* Décimas de la botella abierta: diez botones grandes, cinco por fila en
   pantallas angostas. */
.tenths {
  margin: 16px 0 8px;
  padding: 0;
  border: 0;
}
.tenths legend {
  margin-bottom: 6px;
  padding: 0;
  font-weight: 600;
}
.tenths-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--page);
}
.tenths label {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.tenths input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.tenths span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: var(--r-sm);
  color: var(--soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tenths input:checked + span {
  background: var(--raised-2);
  color: var(--ink);
}
.tenths input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
@media (max-width: 560px) {
  .tenths-row {
    grid-template-columns: repeat(5, 1fr);
  }
}
.batch-needs {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}
.batch-needs li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--line, rgba(127, 127, 127, 0.25));
}
.stock-orders {
  margin: 0 0 20px;
}
.stock-orders h2 {
  font-size: var(--t-lg);
  margin-bottom: 4px;
}
.stock-orders ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.stock-orders li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.stock-orders strong {
  display: block;
  font-weight: 600;
}
.stock-orders small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.sub-head {
  margin: 18px 0 2px;
  font-size: var(--t-base, 1rem);
  font-weight: 600;
  color: var(--soft);
}
.count-line {
  margin-top: 4px;
}

.card-wait {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 1.05rem;
}

/* ── Organización → Equipo: una sola página ──
   Hoy en una frase, las personas con su estado de hoy (cada fila es un solo
   botón grande) y las horas para nómina al final. */
.team-today {
  margin: 4px 0 20px;
}
.team-today h2 {
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--soft);
}
.team-line {
  margin-top: 4px;
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 40ch;
  text-wrap: balance;
}
.team-warn,
.team-notes li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--t-md);
  line-height: 1.45;
}
.team-warn {
  margin-top: 10px;
}
.team-warn .ic,
.team-notes .ic {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--amber);
}
.team-notes {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
  padding: 14px 16px;
  list-style: none;
  background: var(--amber-bg);
  border-radius: var(--r-md);
  max-width: 72ch;
}
.team-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.team-list li + li {
  border-top: 1px solid var(--line-soft);
}
.team-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) minmax(0, auto) 20px;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 12px 8px;
  margin: 0 -8px;
  box-sizing: content-box;
  max-width: 100%;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.team-row .avatar {
  width: 40px;
  height: 40px;
}
@media (hover: hover) {
  .team-row:hover {
    background: var(--raised);
  }
}
.team-who {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.team-who strong {
  font-size: var(--t-lg);
  font-weight: 600;
}
.team-who small {
  color: var(--soft);
  font-size: var(--t-md);
}
.team-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--t-md);
  color: var(--soft);
}
.team-state i {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}
.team-state.up,
.team-state.down,
.team-state.amber {
  color: var(--ink);
  font-weight: 600;
}
.team-state.up i {
  background: var(--up);
}
.team-state.down i {
  background: var(--down);
}
.team-state.amber i {
  background: var(--amber-solid);
}
.team-go {
  color: var(--soft);
}
.team-go .ic {
  width: 18px;
  height: 18px;
  /* Abre la ficha: apunta hacia adelante, no hacia abajo. */
  transform: rotate(-90deg);
}
.team-owners {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--soft);
  font-size: var(--t-md);
}
.team-owners strong {
  color: var(--ink);
}
.team-pay {
  margin-top: 40px;
}
.team-pay .att-toolbar {
  margin-top: 12px;
}
.team-table .link {
  color: var(--ink);
  font-weight: 600;
  text-decoration-color: var(--line);
}
.team-table th[scope="row"] .link {
  font-weight: 400;
  color: var(--soft);
}
.team-table tbody th[scope="row"] > .link {
  font-weight: 600;
  color: var(--ink);
}
.team-pay-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}
/* Ficha de una persona: hoy, horario y sucursales arriba; luego sus marcas. */
.sheet-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px 28px;
  padding-bottom: 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.sheet-top h3,
.sheet-period {
  margin: 0 0 6px;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--soft);
}
.sheet-top p {
  font-size: var(--t-md);
}
.sheet-period {
  margin-top: 16px;
}
.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.sheet-actions .btn {
  max-width: 100%;
  white-space: normal;
  text-align: left;
}
.sheet-changes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.sheet-changes li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  font-size: var(--t-sm);
}
@media (max-width: 720px) {
  .team-row {
    grid-template-columns: 40px minmax(0, 1fr) 20px;
    gap: 4px 12px;
  }
  .team-row .avatar {
    grid-row: span 2;
  }
  .team-row .team-state {
    grid-column: 2;
    grid-row: 2;
  }
  .team-row .team-go {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
  .team-table td.num {
    display: inline-flex;
    gap: 6px;
    font-size: var(--t-md);
  }
  /* Todos los datos, también los días: pasan al renglón siguiente si no
     caben. */
  .team-table tr {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
  }
  .team-table th[scope="row"],
  .team-table .team-dl {
    flex-basis: 100%;
  }
  .team-table td.num::before {
    content: attr(data-label);
    color: var(--soft);
  }
  .team-table .team-dl {
    grid-column: 1 / -1;
    text-align: left;
  }
  .team-pay-foot .btn {
    width: 100%;
    justify-content: center;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .team-row {
    transition: background-color var(--dur-fast) var(--ease-out);
  }
}

/* Equipo del bar: guía de perfiles al final, desplegable. */
.team-guide {
  margin-top: 32px;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
  max-width: 72ch;
}
.team-guide summary {
  padding: 12px 0;
  font-weight: 600;
  cursor: pointer;
}
.team-guide dl {
  display: grid;
  gap: 12px;
  margin: 4px 0 8px;
}
.team-guide dt {
  font-weight: 600;
}
.team-guide dd {
  margin: 2px 0 0;
  color: var(--soft);
  font-size: var(--t-md);
  line-height: 1.45;
}
.team-notes a.link {
  white-space: nowrap;
}

/* Celda del nombre en el tablero del mercado: solo semántica de tabla. */
.qcell {
  display: contents;
}

/* ═════════ Lenguaje táctil (referencia del CEO: bluma.design, 2026-11-20) ═════════
   Lo que cambia es la materia de los controles, no el acomodo de las
   pantallas: letra Geist, neutros cálidos, controles redondos con un
   anillo blanco y una sombra larga y suave (se sienten piezas que se
   pueden presionar), menús flotantes con filas internas redondeadas,
   avisos en pastilla negra y movimiento con rebote corto. */
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --page: #f7f6f3;
  --raised: #f2f1ed;
  --raised-2: #e9e8e3;
  --line: #e4e3de;
  --line-soft: #eeede8;
  --ink: #111110;
  --soft: #5f5e59;
  --faint: #6c6b66;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --t-sm: 0.8125rem;
  --t-md: 0.875rem;
  --t-lg: 1rem;
  --t-xl: 1.1875rem;
  --t-2xl: 1.5rem;
  --t-3xl: 2rem;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 20px;
  --ring:
    0 0 0 1px rgba(17, 17, 16, 0.06), 0 1px 2px rgba(17, 17, 16, 0.04),
    0 8px 24px -12px rgba(17, 17, 16, 0.14);
  /* Pieza que se presiona: anillo blanco, contorno casi invisible y sombra
     larga hacia abajo. */
  --shell:
    0 0 0 4px #fff, 0 0 0 5px rgba(17, 17, 16, 0.06),
    0 12px 24px -12px rgba(17, 17, 16, 0.28);
  --shell-sm:
    0 0 0 1px rgba(17, 17, 16, 0.05), 0 1px 2px rgba(17, 17, 16, 0.06),
    0 6px 12px -8px rgba(17, 17, 16, 0.22);
  --float:
    0 0 0 1px rgba(17, 17, 16, 0.06), 0 2px 4px rgba(17, 17, 16, 0.04),
    0 16px 40px -12px rgba(17, 17, 16, 0.22);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}
h1,
h2,
h3,
.view-head h1 {
  font-weight: 600;
  letter-spacing: -0.022em;
}

/* Filas elegidas: pieza redondeada por dentro, sin barra de color. */
.tab-list {
  padding-bottom: 6px;
}
.tab-item {
  width: calc(100% - 12px);
  margin: 2px 6px 0;
}
.pick {
  padding: 6px;
}
.tab-item,
.pick-row {
  border-top: 0;
  border-radius: var(--r-md);
  transition: background var(--dur-fast) var(--ease-out);
}
.tab-item[aria-current="true"],
.pick-row[aria-pressed="true"] {
  background: var(--raised-2);
  box-shadow: none;
}

/* Botones: pastilla con materia. */
.btn {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--raised);
  box-shadow: var(--shell);
  font-weight: 500;
  transition:
    background var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform 160ms var(--spring);
}
@media (hover: hover) {
  .btn:hover:not(:disabled) {
    background: var(--raised-2);
    border-color: transparent;
  }
}
.btn:active:not(:disabled) {
  transform: scale(0.96);
  box-shadow:
    0 0 0 4px #fff,
    0 0 0 5px rgba(17, 17, 16, 0.06),
    0 4px 10px -6px rgba(17, 17, 16, 0.3);
}
.btn.primary {
  background: var(--brand);
  color: var(--cta-ink);
  box-shadow:
    0 0 0 4px #fff,
    0 0 0 5px rgba(17, 17, 16, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 26px -12px rgba(14, 27, 24, 0.55);
}
@media (hover: hover) {
  .btn.primary:hover:not(:disabled) {
    background: var(--brand-hover);
  }
}
.btn.danger {
  background: #fdeceb;
  color: var(--down-ink);
}
@media (hover: hover) {
  .btn.danger:hover:not(:disabled) {
    background: #fbdcda;
  }
}
.btn.ghost {
  background: transparent;
  box-shadow: none;
}
@media (hover: hover) {
  .btn.ghost:hover:not(:disabled) {
    background: var(--raised);
  }
}
.btn.small {
  min-height: 32px;
  padding: 0 14px;
  border-radius: var(--r-full);
  font-size: var(--t-md);
  box-shadow: var(--shell-sm);
  background: #fff;
}
@media (hover: hover) {
  .btn.small:hover:not(:disabled) {
    background: var(--raised);
  }
}
.btn.small.primary {
  background: var(--brand);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 6px 14px -8px rgba(14, 27, 24, 0.6);
}
.btn.small.ghost {
  background: transparent;
  box-shadow: none;
}
.btn.small:active:not(:disabled) {
  box-shadow: 0 0 0 1px rgba(17, 17, 16, 0.08);
}
.btn.amber.solid {
  box-shadow:
    0 0 0 4px #fff,
    0 0 0 5px rgba(17, 17, 16, 0.06),
    0 12px 24px -12px rgba(168, 101, 0, 0.55);
}
.btn.icon-only,
.icon-btn {
  border-radius: var(--r-full);
}
.icon-btn {
  transition:
    background var(--dur-fast) var(--ease-out),
    transform 160ms var(--spring);
}
.icon-btn:active {
  transform: scale(0.92);
}

/* Campos: hundidos en gris cálido; al enfocarlos se vuelven blancos. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--raised);
  box-shadow: inset 0 1px 2px rgba(17, 17, 16, 0.05);
  transition:
    background var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus,
textarea:focus {
  outline: none;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(17, 17, 16, 0.14),
    0 0 0 4px rgba(17, 17, 16, 0.06);
}
input[aria-invalid="true"] {
  box-shadow: 0 0 0 1px var(--down-ink);
}
@media (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
}
label {
  font-weight: 500;
  color: var(--ink);
}

/* Control segmentado: riel blanco y la opción elegida como pieza gris. */
.segmented {
  gap: 2px;
  padding: 4px;
  border: 0;
  border-radius: var(--r-full);
  background: #fff;
  box-shadow: var(--shell-sm);
}
.segmented button {
  border-radius: var(--r-full);
  font-weight: 500;
  transition:
    background var(--dur-base) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform 160ms var(--spring);
}
.segmented button:active {
  transform: scale(0.96);
}
.segmented button[aria-pressed="true"] {
  background: var(--raised-2);
  color: var(--ink);
}

/* Menú del bar: riel gris para que la sección actual, en blanco, resalte
   (pedido del CEO, 2026-11-20). Los textos del riel usan --soft: --faint
   no llega a 4.5:1 sobre este gris. */
.rail {
  background: #e8e7e2;
}
.rail .nav-group {
  color: var(--soft);
}
.rail .nav-count {
  background: #fff;
}
.rail .nav-item[aria-current="page"] .nav-count {
  background: var(--raised-2);
}
@media (max-width: 1180px) {
  .rail .nav-group {
    background: #d6d5cf;
    color: transparent;
  }
}
@media (hover: hover) {
  .rail .nav-item:not([aria-current="page"]):hover {
    background: #dfded8;
  }
}
.nav-item {
  min-height: 38px;
  border-radius: var(--r-full);
  font-weight: 500;
}
.nav-item[aria-current="page"] {
  background: #fff;
  box-shadow: var(--shell-sm);
  font-weight: 500;
}
@media (hover: hover) {
  .nav-item:hover {
    background: var(--raised-2);
  }
  .nav-item[aria-current="page"]:hover {
    background: #fff;
  }
}
.nav-count {
  background: var(--raised-2);
  font-family: var(--sans);
  font-weight: 500;
}

/* Menú de Organización: pastilla en lugar de subrayado. */
body[data-shell="org"] .org-nav {
  align-self: center;
}
.org-nav a {
  min-height: 36px;
  border-bottom: 0;
  border-radius: var(--r-full);
  font-weight: 500;
  transition: background var(--dur-base) var(--ease-out);
}
.org-nav a[aria-current="page"] {
  background: var(--raised-2);
}
@media (hover: hover) {
  .org-nav a:hover {
    background: var(--raised);
  }
}
.org-nav a:focus-visible {
  outline-offset: 2px;
}
@media (max-width: 720px) {
  body[data-shell="org"] .org-nav {
    align-items: center;
    gap: 2px;
    padding: 6px;
  }
  body[data-shell="org"] .org-nav a {
    min-height: 34px;
    padding: 0 12px;
  }
}

/* Ventanas y hojas: esquinas amplias, sombra flotante y entrada con rebote. */
.sheet {
  border: 0;
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(17, 17, 16, 0.06),
    0 32px 80px -24px rgba(17, 17, 16, 0.35);
  transform: translateY(12px) scale(0.97);
  transition:
    opacity var(--dur-base) var(--ease-out),
    transform 320ms var(--spring),
    overlay var(--dur-base) allow-discrete,
    display var(--dur-base) allow-discrete;
}
.sheet[open] {
  transform: none;
}
@starting-style {
  .sheet[open] {
    transform: translateY(12px) scale(0.97);
  }
}
.sheet[open]::backdrop {
  background: rgba(17, 17, 16, 0.32);
  backdrop-filter: blur(2px);
}

/* Listas de acciones (menú de cuenta, opciones): filas redondeadas por dentro. */
.menu-list {
  gap: 2px;
}
.menu-list button,
.menu-list a {
  min-height: 44px;
  padding: 0 12px;
  border-top: 0;
  border-radius: var(--r-md);
  transition: background var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
  .menu-list button:hover,
  .menu-list a:hover {
    background: var(--raised);
  }
}
/* Menús flotantes: esquinas amplias, filas redondeadas y entrada con rebote. */
.pop {
  padding: 6px;
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--float);
  transform: scale(0.94) translateY(-4px);
  transition:
    opacity 160ms var(--ease-out),
    transform 260ms var(--spring),
    overlay 160ms allow-discrete,
    display 160ms allow-discrete;
}
@starting-style {
  .pop:popover-open {
    transform: scale(0.94) translateY(-4px);
  }
}
.pop button {
  min-height: 40px;
  border-radius: var(--r-md);
}
.pop button.danger {
  color: var(--down-ink);
}

/* Aviso: pastilla negra con su señal, entra con rebote. */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 12px 14px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  box-shadow:
    0 0 0 1px rgba(17, 17, 16, 0.1),
    0 18px 40px -12px rgba(17, 17, 16, 0.5);
  animation: toast-in 360ms var(--spring);
}
.toast::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #22c55e
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}
.toast.error::before {
  background: #ef4444
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 16px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
  .btn,
  .icon-btn,
  .segmented button,
  .sheet {
    transition-duration: 0.01ms;
  }
}

/* Campanita del bar (decisión del CEO 2026-11-20): todos los avisos de la
   sucursal en un solo lugar, al final de la barra del mercado. */
.bar-bell {
  flex: none;
  margin-left: -8px;
}
.bar-bell .bell-count {
  border-color: var(--board);
}
.marketbar[data-state="crash"] .bar-bell {
  color: #1a1204;
}
.marketbar[data-state="crash"] .bar-bell .bell-count {
  border-color: var(--amber-solid);
}
body[data-shell="org"] .bar-bell {
  display: none;
}
.bell-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  font-weight: 400;
}
#bar-bell-pop .bell-group li {
  padding: 4px 0;
}
@media (max-width: 1180px) {
  .bar-bell {
    margin-left: 0;
  }
}
.bell-acts .btn {
  width: auto;
  justify-content: center;
  padding: 0 14px;
  white-space: nowrap;
}

/* Barra del mercado (CEO 2026-11-20): estado con sus controles, la acción
   del momento y los avisos. Nada más. */
.mb-state {
  flex: 0 1 auto;
  margin-left: -12px;
  padding: 8px 12px;
  border-radius: var(--r-full);
  transition: background-color 0.15s ease;
}
.mb-state .chev {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--soft);
  transition: transform 0.2s var(--spring);
}
.mb-state[aria-expanded="true"] {
  background: var(--raised);
}
.mb-state[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}
@media (hover: hover) {
  .mb-state:hover {
    background: var(--raised);
  }
  .marketbar[data-state="crash"] .mb-state:hover {
    background: rgba(26, 18, 4, 0.08);
  }
}
.mb-state:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.marketbar[data-state="crash"] .mb-state .chev {
  color: #1a1204;
}
.mb-actions {
  margin-left: auto;
}
.market-pop {
  width: min(300px, calc(100vw - 16px));
  padding: 6px;
}
.market-pop button {
  gap: 12px;
  min-height: 44px;
  white-space: normal;
}
.market-pop button > span {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}
.market-pop small {
  color: var(--soft);
  font-size: var(--t-sm);
  font-weight: 400;
}
.market-pop button .ic {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--soft);
}
.market-pop button.danger .ic {
  color: inherit;
}
.market-pop hr {
  margin: 4px 6px;
  border: 0;
  border-top: 1px solid var(--line-soft);
}
@media (max-width: 720px) {
  .mb-actions {
    display: flex;
  }
  .mb-actions .btn {
    min-height: 40px;
    padding: 0 14px;
  }
  .mb-state {
    margin-left: -8px;
    padding: 8px;
  }
  .mb-state b {
    font-size: var(--t-md);
  }
}
@media (max-width: 400px) {
  .mb-actions .btn .ic {
    display: none;
  }
}

/* Interruptor (CEO 2026-11-20: el de iOS, píldora con círculo). Para todo lo
   que se enciende o se apaga; las confirmaciones siguen como casilla. */
input[type="checkbox"].switch,
.check input[type="checkbox"]:not(.tick) {
  appearance: none;
  flex: none;
  position: relative;
  width: 51px;
  height: 31px;
  margin: 0;
  min-height: 31px;
  padding: 0;
  border: 0;
  border-radius: var(--r-full);
  background: #dddcd6;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
input[type="checkbox"].switch::before,
.check input[type="checkbox"]:not(.tick)::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.15),
    0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.28s var(--spring);
}
input[type="checkbox"].switch:checked,
.check input[type="checkbox"]:not(.tick):checked {
  background: var(--up);
}
input[type="checkbox"].switch:checked::before,
.check input[type="checkbox"]:not(.tick):checked::before {
  transform: translateX(20px);
}
input[type="checkbox"].switch:focus-visible,
.check input[type="checkbox"]:not(.tick):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
input[type="checkbox"].switch:disabled,
.check input[type="checkbox"]:not(.tick):disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* El texto a la izquierda y el interruptor a la derecha, como en iOS. */
.check:has(> input[type="checkbox"]:not(.tick)) {
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}
.check:has(> input[type="checkbox"]:not(.tick)) input {
  margin-top: 0;
}

/* Pistock Connect: tablero de mosaicos. El enlace de regreso es un <a>; el
   «‹ Cuentas» de la cuenta abierta es un botón que solo sale en una columna. */
a.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: -12px 0 4px -6px;
  padding: 0 6px;
  color: var(--soft);
  font-size: var(--t-md);
  font-weight: 500;
}
a.back-link .ic {
  width: 18px;
  height: 18px;
}
@media (hover: hover) {
  a.back-link:hover {
    color: var(--ink);
  }
}
.cx-add button small,
.cx-add a small {
  display: block;
  color: var(--soft);
  font-size: var(--t-sm);
  font-weight: 400;
}
.cx-add button > span,
.cx-add a > span {
  display: flex;
  flex-direction: column;
}
@media (prefers-reduced-motion: reduce) {
  input[type="checkbox"].switch::before,
  .check input[type="checkbox"]:not(.tick)::before {
    transition: none;
  }
}
/* Conectado: palomita blanca en círculo verde (CEO 2026-11-20). */
.cx-ok {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--up);
  color: #ffffff;
}
.cx-ok .ic {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}
/* Sin conectar: tache blanca en círculo rojo (CEO 2026-11-20). */
.cx-off {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--down, #d93a3a);
  color: #ffffff;
}
.cx-off .ic {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}
/* Tablero de Pistock Connect, como la app Casa: cada equipo es un mosaico.
   Conectado = encendido (blanco, en relieve); sin conectar = apagado
   (hundido en gris, con la tache roja). */
.cx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cx-tile {
  display: flex;
  flex-direction: column;
  min-height: 188px;
  border-radius: var(--r-lg);
  background: #ffffff;
  box-shadow: var(--shell-sm);
  transition:
    transform 0.25s var(--spring),
    box-shadow 0.2s ease;
}
.cx-tile.is-off {
  background: var(--page);
  box-shadow: inset 0 0 0 1px var(--line);
}
.cx-open {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  width: 100%;
  padding: 16px 16px 8px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  color: inherit;
  text-align: left;
  text-decoration: none;
}
button.cx-open,
a.cx-open {
  cursor: pointer;
}
@media (hover: hover) {
  .cx-tile:has(button.cx-open:hover, a.cx-open:hover) {
    transform: translateY(-2px);
  }
}
.cx-open:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.cx-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.cx-ic {
  flex: none;
  display: grid;
  place-items: center;
  background: var(--raised);
  color: var(--ink);
}
.cx-foot .btn.small:only-child {
  margin-left: auto;
}
.cx-tile .cx-ic {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}
.cx-tile .cx-ic .ic {
  width: 24px;
  height: 24px;
}
.cx-tile.is-on .cx-ic {
  background: var(--ink);
  color: #ffffff;
}
.cx-tile.is-off .cx-ic {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--soft);
}
.cx-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cx-name b {
  font-size: var(--t-lg, 17px);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cx-name small {
  color: var(--soft);
  font-size: var(--t-sm);
}
.cx-tile.is-off .cx-name b {
  color: var(--soft);
}
.cx-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  padding: 0 16px 14px;
}
.cx-word {
  color: var(--soft);
  font-size: var(--t-sm);
  font-weight: 500;
}
.cx-word.amber {
  color: var(--amber-ink, #9a5b00);
  font-weight: 600;
}
.cx-foot > .ic {
  width: 18px;
  height: 18px;
  color: var(--soft);
  transform: rotate(-90deg);
}
.cx-foot .btn.small {
  width: auto;
}
@media (max-width: 560px) {
  .cx-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .cx-tile {
    min-height: 168px;
  }
  .cx-open {
    gap: 14px;
    padding: 14px 14px 6px;
  }
  .cx-foot {
    padding: 0 14px 12px;
    min-height: 48px;
  }
  .cx-tile .cx-ic {
    width: 42px;
    height: 42px;
  }
  .cx-name b {
    font-size: var(--t-md);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cx-tile {
    transition: none;
  }
}
/* Motivos rápidos al abrir el cajón sin venta. */
#drawer-reasons { margin: 4px 0 12px; }

/* Teclado de Pistock (equipos táctiles sin teclado). Queda abajo, de borde a
   borde, con teclas de 56 px; lo que estaba debajo sube para no taparse. */
#osk {
  inset: auto 0 0 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px max(10px, calc((100vw - 1040px) / 2)) calc(10px + env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--raised);
  box-shadow: 0 -8px 24px rgb(0 0 0 / 0.08);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
#osk .osk-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}
#osk .osk-row + .osk-row {
  margin-top: 8px;
}
#osk button {
  flex: 1 1 0;
  min-width: 0;
  max-width: 96px;
  height: 56px;
  border: 0;
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.12);
}
#osk button:active {
  background: var(--raised-2);
}
#osk .osk-fn {
  flex-grow: 1.5;
  max-width: 144px;
  background: var(--raised-2);
  font-size: 16px;
}
#osk .osk-fn[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
#osk .osk-space {
  flex-grow: 5;
  max-width: 480px;
  font-size: 16px;
  color: var(--soft);
}
#osk .osk-done {
  flex-grow: 1.5;
  max-width: 160px;
  background: var(--brand);
  color: var(--cta-ink);
  font-size: 16px;
  font-weight: 600;
}
#osk[data-layout="num"] .osk-row {
  max-width: 420px;
  margin-inline: auto;
}
#osk[data-layout="num"] button {
  max-width: none;
  font-size: 24px;
}
#osk[data-layout="num"] .osk-done {
  font-size: 18px;
}
/* Con el teclado abierto, la ventana se acomoda arriba y la página deja
   espacio al final para que el campo quede a la vista. */
html.osk-open dialog[open] {
  margin-top: 12px;
  max-height: calc(100dvh - var(--osk-h, 0px) - 24px);
}
html.osk-open #view {
  padding-bottom: var(--osk-h, 0px);
}

/* Este equipo: cada preferencia en una fila, el control a la derecha. */
#device-prefs.narrow {
  max-width: 720px;
}
.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.pref-row:first-of-type {
  margin-top: 16px;
}
/* Justo bajo el título, la línea del título basta. */
.panel-head + .pref-row {
  margin-top: 0;
  border-top: 0;
}
.pref-title {
  display: block;
  margin: 0 0 4px;
  font-size: var(--t-md, 15px);
  font-weight: 600;
}
.pref-row label {
  display: block;
  font-weight: 400;
  cursor: pointer;
}
.pref-row .hint {
  display: block;
  margin: 0;
}
.pref-row .segmented {
  flex: none;
}
@media (max-width: 560px) {
  .pref-row:has(.segmented) {
    flex-direction: column;
    align-items: stretch;
  }
}
#osk[data-layout="num"] .osk-fn {
  flex-grow: 1;
  max-width: none;
}

/* Modo táctil: objetivos de 48 px (guía de Material y de los POS de mesa).
   Va al final porque el rediseño de botones y campos vive más arriba con la
   misma especificidad. Se enciende solo o desde Ajustes → Este equipo. */
@media (pointer: coarse) {
  .btn,
  .btn.small {
    min-height: 48px;
  }
  .btn.icon-only,
  .btn.icon-only:not(.small) {
    width: 48px;
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select {
    min-height: 48px;
  }
  .segmented button {
    min-height: 44px;
  }
  .line .line-cancel {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: -12px 0;
  }
  .nav-item {
    min-height: 48px;
  }
  .chit-flag {
    min-height: 44px;
  }
  /* «Editar» y «⋯» caben en la misma fila con botones de 48 px. */
  @media (min-width: 1181px) {
    .items {
      --cols: minmax(0, 1.6fr) 96px 104px minmax(120px, 1fr) 112px 156px;
    }
  }
  @media (min-width: 721px) and (max-width: 1180px) {
    .items {
      --cols: minmax(0, 1.6fr) 96px minmax(120px, 1fr) 104px 156px;
    }
  }
  .row-actions {
    flex-wrap: nowrap;
  }
  /* Riel angosto táctil (PC de punto de venta de 1024 px): cada sección
     con su nombre bajo el ícono, para que el mesero no adivine. */
  @media (min-width: 721px) and (max-width: 1180px) {
    .shell {
      grid-template-columns: 84px minmax(0, 1fr);
    }
    .rail {
      padding: 12px 6px;
    }
    .nav-item {
      position: relative;
      flex-direction: column;
      justify-content: center;
      gap: 3px;
      width: 72px;
      min-height: 52px;
      padding: 6px 0;
      border-radius: var(--r-md);
    }
    .nav-item span {
      display: block;
      max-width: 68px;
      overflow: hidden;
      font-size: 11px;
      line-height: 1.15;
      text-align: center;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .nav-count {
      top: 2px;
      right: 8px;
    }
    .nav-group {
      margin: 6px auto;
    }
  }
}

/* Nueva cuenta: mesas libres y cuenta de barra para tocar. */
.quick-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.quick-picks .btn {
  justify-content: flex-start;
  min-height: 56px;
  border: 1px solid var(--line);
  background: #fff;
}
/* Cobro en efectivo: billetes con un toque y el cambio debajo. */
.cash-picks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.cash-picks:empty {
  display: none;
}
.cash-picks .btn {
  border: 1px solid var(--line);
  background: #fff;
  font-variant-numeric: tabular-nums;
}
.cash-change {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Mesas (POS): plano de mesas a la izquierda y la cuenta de la mesa tocada a
   la derecha. Libre = gris, ocupada = blanca con su saldo, pagada = menta. */
.floor-split {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
}
.floor {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}
.floor .zones {
  margin: 0;
}
.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 10px;
}
.ftable {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  background: var(--page);
  color: var(--soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}
.ftable.round {
  border-radius: 999px;
  align-items: center;
  text-align: center;
  justify-content: center;
}
.ftable strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: var(--t-lg);
  letter-spacing: -0.02em;
}
.ftable-meta {
  display: grid;
  color: var(--ink);
  font-size: var(--t-md);
  font-weight: 600;
}
.ftable-meta small {
  color: var(--soft);
  font-size: var(--t-xs);
  font-weight: 400;
}
.ftable.free .ftable-meta {
  color: var(--soft);
}
.ftable.busy {
  background: var(--ink);
  color: var(--page);
}
.ftable.busy strong,
.ftable.busy .ftable-meta {
  color: var(--board);
}
.ftable.busy .ftable-meta small {
  color: var(--page);
  opacity: 0.8;
}
.ftable.busy.paid {
  background: var(--up-ink);
}
.ftable[aria-current="true"] {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.ftable:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
@media (hover: hover) {
  .ftable.free:hover {
    background: var(--board);
  }
}
.table-free .ticket-body .empty {
  margin: auto 0;
}
@media (max-width: 1180px) {
  .floor-split {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  }
}
@media (max-width: 900px) {
  .floor-split {
    grid-template-columns: 1fr;
  }
  .split[data-selected="true"] .floor {
    display: none;
  }
}

/* Corte de caja: piezas por billete y moneda con botones grandes para
   pantallas táctiles; el total contado siempre a la vista. */
.count-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 20px;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
}
.count-group legend {
  margin-bottom: 2px;
  color: var(--soft);
  font-size: var(--t-sm);
  font-weight: 600;
}
.count-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.count-label {
  display: grid;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.count-label small {
  color: var(--soft);
  font-size: var(--t-xs);
  font-weight: 400;
}
.count-step {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.count-step input {
  width: 56px;
  margin: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.count-label .count-sub {
  min-height: 1.2em;
  font-variant-numeric: tabular-nums;
}
.count-sum {
  display: flex;
  justify-content: space-between;
  margin: 12px 0 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  background: var(--board);
  font-size: var(--t-lg);
}
.count-sum strong {
  font-variant-numeric: tabular-nums;
}
#count-mode {
  margin-bottom: 4px;
}
.shift-result {
  display: grid;
  gap: 4px;
}
.shift-result > strong {
  font-size: var(--t-lg);
}
.shift-result .chip {
  justify-self: start;
  margin-bottom: 8px;
}
.sheet-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 20px;
}
.sheet-actions .grow {
  flex: 1;
}

/* Mesas: «listo para llevar» en la mesa, personas al abrir, filtros. */
.ftable {
  position: relative;
}
.ftable-ready {
  align-self: flex-start;
  margin-top: -2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--amber);
  color: #fff;
  font-size: var(--t-xs);
  font-weight: 700;
}
.floor-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.floor-filters .segmented {
  margin: 0;
}
.guest-pick {
  display: grid;
  gap: 12px;
  align-content: center;
  height: 100%;
}
.guest-pick > strong {
  font-size: var(--t-lg);
}
.guest-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.guest-grid .btn {
  justify-content: center;
  min-height: 52px;
  font-size: var(--t-lg);
  font-variant-numeric: tabular-nums;
}
.guest-grid .btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--board);
}

/* Tomar pedido en pantalla táctil: cada producto es un botón grande en
   cuadrícula, como en los POS de restaurante. Con ratón sigue la lista. */
@media (pointer: coarse) {
  #drink-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(128px, 100%), 1fr));
    align-content: start;
    gap: 8px;
    padding: 8px;
  }
  #drink-list .pick-row,
  #drink-list .pick-row:first-child {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    min-height: 92px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--board);
  }
  #drink-list .pick-row > span:first-child {
    flex: 0 0 auto;
    width: 100%;
    padding-right: 28px;
  }
  #drink-list .in-cart {
    position: absolute;
    top: 10px;
    right: 10px;
  }
  #drink-list .empty {
    grid-column: 1 / -1;
  }
}

/* Plano del local: Mesas lo muestra con cada mesa en su lugar; el editor
   deja arrastrarlas sobre una retícula de una mesa estándar. */
.plan-zone {
  display: grid;
  gap: 8px;
}
.plan-zone + .plan-zone {
  margin-top: 16px;
}
.plan-zone h2 {
  font-size: var(--t-md);
}
.plan {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--raised);
}
.plan .ftable {
  position: absolute;
  min-height: 0;
  padding: 6px 8px;
  gap: 2px;
  overflow: hidden;
  container-type: size;
}
.plan .ftable.round {
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.plan .ftable.dim {
  opacity: 0.35;
}
@container (max-height: 74px) {
  .ftable-meta small {
    display: none;
  }
}
@container (max-height: 52px) {
  .ftable-meta,
  .ftable-ready {
    display: none;
  }
}
.plan-edit {
  margin-top: 12px;
  touch-action: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
}
.ptable {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--board);
  color: var(--ink);
  font: inherit;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.ptable.round {
  border-radius: 50%;
}
.ptable small {
  color: var(--soft);
  font-size: var(--t-xs);
}
.ptable[aria-pressed="true"] {
  background: var(--ink);
  color: var(--board);
  box-shadow: 0 0 0 3px var(--board), 0 0 0 5px var(--ink);
  z-index: 1;
}
.ptable[aria-pressed="true"] small {
  color: var(--board);
}
.ptable.dragging {
  cursor: grabbing;
  z-index: 2;
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.18);
}
.plan-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-height: 48px;
  margin-top: 12px;
}
.plan-tools .segmented {
  margin: 0;
}
.plan .ftable strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@container (max-width: 96px) {
  .ftable strong {
    font-size: var(--t-sm);
  }
}
.plan .ftable > * {
  flex-shrink: 0;
  max-width: 100%;
}
.plan .ftable-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Descuento por porcentaje: vista previa del monto y del total. */
.discount-preview {
  min-height: 1.5em;
  margin: 4px 0 12px;
  font-variant-numeric: tabular-nums;
}

/* Alta y configuración de mesa: lugares con botones rápidos y casilla para
   otro número; «Forma» se rotula igual que las demás etiquetas. */
.field-label {
  display: block;
  margin: 16px 0 8px;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink);
}
.seat-pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
  align-items: stretch;
}
.seat-pick input {
  min-height: 52px;
  font-size: var(--t-lg);
  text-align: center;
}
@media (max-width: 460px) {
  .segmented.shape-pick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: var(--r-lg);
  }
}

/* Sin píldora dentro de píldora (CEO, 2026-11-20). Los selectores ya no son
   un riel con la opción elegida adentro: cada opción es su propio botón y la
   elegida va rellena en tinta, igual que los botones de lugares y personas. */
.segmented,
.view-actions .segmented {
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.segmented button {
  border-radius: var(--r-full);
  background: var(--raised);
  color: var(--ink);
}
@media (hover: hover) {
  .segmented button:not([aria-pressed="true"]):hover {
    background: var(--raised-2);
  }
}
.segmented button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--board);
}
@media (max-width: 460px) {
  .segmented.shape-pick {
    border-radius: 0;
  }
}
/* En el menú lateral ancho, el número de la sección va como texto, sin
   pastilla propia; en el riel compacto sigue siendo aviso en la esquina. */
@media (min-width: 1181px) {
  .rail .nav-count,
  .rail .nav-item[aria-current="page"] .nav-count {
    min-width: 0;
    padding: 0;
    background: none;
    color: var(--soft);
  }
}
.segmented.zones button {
  flex: none;
}
.floor-filters {
  gap: 8px 28px;
}

/* Botones planos y nítidos (CEO, 2026-11-20: «se nota como un blur dentro
   de la píldora»). Sin aro blanco, sin contorno difuso, sin sombra larga ni
   brillo interior: el botón es solo su color. Los pequeños blancos llevan una
   línea fina y nítida para no perderse sobre fondo blanco. El foco del
   teclado sigue con su contorno (accesibilidad). */
:root {
  --shell: none;
  --shell-sm: 0 0 0 1px rgba(17, 17, 16, 0.1);
}
.btn,
.btn.primary,
.btn.amber.solid,
.btn:active:not(:disabled),
.btn.primary:active:not(:disabled) {
  box-shadow: none;
}
.btn.small {
  box-shadow: 0 0 0 1px rgba(17, 17, 16, 0.12);
}
.btn.small.primary,
.btn.small.ghost,
.btn.small.danger {
  box-shadow: none;
}
.btn.small:active:not(:disabled) {
  box-shadow: 0 0 0 1px rgba(17, 17, 16, 0.12);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  box-shadow: none;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 1.5px var(--ink);
}
.ptable[aria-pressed="true"] {
  box-shadow: none;
}
/* En pantalla completa tampoco va la franja de «Operando…» del propietario. */
body.kds-wall[data-view="preparacion"] #org-back {
  display: none;
}
/* Mesero, personas y hora de la comanda: legibles sobre cualquier color de
   encabezado (verde, ámbar o rojo). */
.chit-where {
  opacity: 1;
  font-weight: 500;
}

/* Cambio de turno: aviso de las cuentas que pasan al turno nuevo. */
.carry-note {
  display: grid;
  gap: 4px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--raised);
}
.carry-note span {
  color: var(--soft);
  font-size: var(--t-sm, 14px);
}

/* ───────── Refinamiento del panel (CEO, 2026-11-21) ─────────
   Un solo sistema para todas las pantallas: ritmo de 4 y 8 px, tres alturas
   de control con puntero fino (32, 36 y 40; en táctil siguen en 44), una
   escala de letra (12, 13, 14, 16, 19, 24, 32), títulos en seminegrita y
   movimiento que frena suave, sin rebote. Va al final para ganar por orden,
   sin subir la especificidad. */
:root {
  /* Curva de las hojas de iOS: arranca decidida y se asienta sin pasarse.
     La anterior (1.4) rebotaba. */
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
}

/* Tipografía: los títulos de sección pesan lo mismo que el de la pantalla
   (600) y se distinguen por tamaño; los renglones se cortan parejo. */
.panel-head h2,
.panel h2 {
  font-weight: 600;
}
/* «Sin dato» se lee como ausencia, no como cifra. */
.nil {
  color: var(--faint);
  font-weight: 400;
}

/* Menú lateral: el nombre del grupo pertenece a lo que sigue, no a lo de
   arriba; más aire antes que después. */
@media (min-width: 1181px) {
  .rail .nav-group {
    margin: 20px 0 4px;
  }
}

/* Alturas de control con puntero fino: 32 (pequeño), 36 (opciones) y
   40 (principal). Nada de 38. */
@media (pointer: fine) {
  .segmented button,
  .cats button,
  .att-dates input {
    min-height: 36px;
  }
  .board-head {
    min-height: 40px;
  }
}

/* Equipo: la frase del día es un resumen, no un título; va debajo del
   título de la pantalla en tamaño y peso. */
.team-line {
  margin-top: 4px;
  font-size: var(--t-xl);
  line-height: 1.35;
}
/* Los avisos ocupan la columna completa, con el mismo relleno que el resto
   de los avisos; las líneas divisorias llegan de orilla a orilla. */
.team-notes {
  max-width: none;
  padding: 12px 16px;
}
#view .team-owners {
  max-width: none;
  margin-top: 0;
  padding-top: 16px;
}
.team-guide {
  max-width: none;
}
.team-guide dl,
.team-guide p {
  max-width: 72ch;
}
.team-pay-foot .hint {
  margin-top: 4px;
}
/* La última columna de la tabla de horas cierra en la misma orilla que sus
   cifras. */
.att-table thead th:last-child {
  padding-right: 0;
  text-align: right;
}

/* Barras de participación: acompañan a la cifra, no compiten con ella. */
.share-bar i,
.org-bar i {
  background: var(--soft);
}
.org-bar i {
  border-radius: var(--r-full);
}

/* Contabilidad: notas con sangría en la retícula y separadas de la tabla. */
.acc-notes {
  margin: 12px 0 16px;
  padding-left: 16px;
}

/* Ritmo vertical de las secciones: título, 8 px, explicación, 16 px y el
   contenido. Un estado vacío queda cerca de su título, no flotando. */
.hint.flush {
  margin-bottom: 16px;
}
.empty {
  padding: 24px 0;
}
.panel-head + .empty,
.hint + .empty {
  padding-top: 12px;
}
/* Las cifras de una tabla van a la derecha, también la columna con barra.
   En celular la tabla se vuelve tarjetas y conserva su acomodo. */
@media (min-width: 721px) {
  .org-table .org-sales {
    text-align: right;
  }
}
/* Eje de las gráficas: cada cifra centrada en su línea (arriba, mitad y
   base). La columna mide la gráfica más un renglón y se recorre medio
   renglón hacia arriba. */
.chart-y {
  height: calc(200px + 1lh);
  margin-top: calc(-0.5lh);
  margin-bottom: 0;
}
/* Mercado: la tabla es plana como las demás, sin caja alrededor; las filas
   llegan a la orilla del título. */
.board {
  border: 0;
  border-radius: 0;
  background: none;
}
.board-head,
.qrow {
  padding: 0;
}
/* Caja en celular: las acciones del turno en una cuadrícula pareja de dos
   columnas, todas con fondo; si quedan impares, la última (el corte) ocupa
   el ancho completo. */
@media (max-width: 720px) {
  .cash-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .cash-actions .btn {
    justify-content: center;
    width: 100%;
  }
  .cash-actions .btn.ghost {
    background: var(--raised);
  }
  .cash-actions .btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}
/* Ventanas: el primer campo arranca cerca del título (16 px de la cabecera
   más 4), no a 32 px. */
.sheet-body > label:first-child,
.sheet-body > form > label:first-child,
.sheet-body > form > .form-row:first-child label {
  margin-top: 4px;
}
/* El contorno de foco del primer campo de una ventana no se corta contra la
   cabecera: 2 px de margen dentro del área que se desplaza. */
@media screen {
  .sheet-head {
    padding-bottom: 14px;
  }
  .sheet-body {
    padding-top: 2px;
  }
}
/* Botones de solo texto al inicio de un bloque: el texto (o el ícono) se
   alinea con la orilla del párrafo de arriba y el fondo al pasar el puntero
   sale hacia el margen, como en las listas de iOS. */
.actions.start > .btn.ghost:first-child {
  margin-left: -18px;
}
.actions.start > .btn.small.ghost:first-child {
  margin-left: -14px;
}
.sheet-body .menu-list {
  margin-inline: -12px;
}
/* Ventanas: las acciones van al final de la fila, como en todo el panel;
   si hay un separador (.grow), la primera se queda a la izquierda. */
.sheet-actions {
  justify-content: flex-end;
}
/* ───────── Punto de venta ───────── */
/* Mesas: la cuenta elegida se queda a la vista bajo la barra del mercado
   mientras se recorre el plano; tocar una mesa de abajo ya no la deja
   fuera de la pantalla. */
@media (min-width: 901px) {
  .floor-split > .ticket,
  .floor-split > .ticket-empty {
    position: sticky;
    top: calc(var(--bar) + 16px);
    align-self: start;
  }
}
/* Zonas en una sola fila que se desliza, como las categorías de «Tomar
   pedido»; la orilla derecha se desvanece para indicar que hay más. */
.floor-filters .zones,
.cats {
  flex: 1 1 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: -4px;
  padding: 4px;
  mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}
.floor-filters .zones::-webkit-scrollbar,
.cats::-webkit-scrollbar {
  display: none;
}
.floor-filters .zones button {
  flex: none;
}
.cats {
  margin-top: 8px;
}
/* Categorías con el mismo control que el resto del panel: relleno gris,
   la elegida en tinta. */
.cats button {
  padding: 0 16px;
  border-color: transparent;
  background: var(--raised);
  color: var(--ink);
  font-size: var(--t-md);
  font-weight: 500;
}
@media (hover: hover) {
  .cats button:not([aria-pressed="true"]):hover {
    background: var(--raised-2);
  }
}
/* Tomar pedido en táctil: los productos no van dentro de otra caja. */
@media (pointer: coarse) {
  #drink-list {
    margin-inline: -4px;
    padding: 4px;
    border: 0;
    border-radius: 0;
  }
}
/* Botón de solo texto al inicio de la barra de la cuenta («QR»): su texto
   arranca en la orilla del contenido. */
.ticket-actions > .btn.ghost:first-child {
  margin-left: -18px;
}
/* Editar mesas: la tarjeta mide lo que su contenido, sin hueco en medio. */
.table-card {
  min-height: 0;
}
/* Preparación: sin etapa a la izquierda, «Marcar urgente» se alinea con
   los renglones de la comanda en vez de quedar suelto a la derecha. */
.chit-meta:not(:has(.chit-stage)) {
  justify-content: flex-start;
}
.chit-meta:not(:has(.chit-stage)) > .chit-flag:first-child {
  margin-left: -8px;
}
.pass-actions {
  gap: 8px;
}
/* El plano no se ensancha por la fila de zonas: la columna manda. */
.floor {
  grid-template-columns: minmax(0, 1fr);
}
/* Cuenta abierta: «Tomar pedido» y «Cobrar» comparten la primera fila a
   partes iguales; «Dividir por persona» y «⋯» van en la segunda, el texto
   alineado con el contenido y «⋯» al final. */
.ticket:not(.table-free) .ticket-actions > .btn:not(.ghost):not(.icon-only) {
  flex: 1 1 auto;
  justify-content: center;
}
.ticket:not(.table-free) .ticket-actions > .grow {
  flex: 0 0 0;
}
.ticket-actions > .grow:has(+ .btn.ghost) {
  flex-basis: 100%;
  height: 0;
  margin-top: -8px;
}
.ticket-actions > .grow + .btn.ghost {
  margin-left: -18px;
}
.ticket-actions > .icon-only {
  margin-left: auto;
}
/* El saldo no se parte en dos renglones. */
.ticket-due {
  flex: none;
  white-space: nowrap;
}
/* «Cuentas sin mesa»: el título y su número en la misma columna que el
   texto de las filas (que van 6 px adentro para su fondo redondeado). */
.tab-list-head {
  padding-inline: 22px;
}
/* Preparación en celular: la estación arriba a todo lo ancho y las
   herramientas en dos columnas, como en Caja; nada queda suelto. */
@media (max-width: 720px) {
  .kds-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .kds-tools .segmented {
    grid-column: 1 / -1;
    margin: 0 0 4px;
  }
  .kds-tools > .btn {
    justify-content: center;
  }
  .kds-tools > .btn.ghost {
    background: var(--raised);
  }
  .kds-tools > .btn:last-child:nth-child(even) {
    grid-column: 1 / -1;
  }
}
/* ───────── Acceso ───────── */
/* Una nota de texto bajo el formulario se lee como nota: alineada con el
   formulario y en gris, no centrada en negro. Las filas de enlaces
   («cerrar sesión») siguen centradas. */
.auth-form .aside:not(:has(a, button)) {
  display: block;
  margin-top: 12px;
  color: var(--soft);
  font-size: var(--t-sm);
  text-align: left;
}
/* «¿Quién eres?»: la indicación arranca en la orilla de las tarjetas, y el
   contorno de foco de una tarjeta no se corta en la lista que se desplaza. */
.t-hint {
  margin: 4px 0 0;
}
.t-people {
  margin-inline: -4px;
  padding: 4px;
}

/* Página de la cuenta: el campo con error conserva su contorno rojo aunque
   tenga el foco (antes el foco lo tapaba), y el aviso queda pegado al campo,
   a la misma distancia que su indicación. La casilla de aceptar condiciones
   es una casilla, no un interruptor: aceptar no es un ajuste. */
input[aria-invalid="true"]:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus {
  box-shadow:
    0 0 0 1px var(--down-ink),
    0 0 0 4px var(--down-bg);
}
#account-fields .form-error:not(:empty) {
  margin-top: 6px;
  font-size: var(--t-sm);
}
.auth-form .check input.tick[aria-invalid="true"] {
  outline: 2px solid var(--down-ink);
  outline-offset: 2px;
}
/* En táctil los campos miden 48 px; la casilla no debe heredarlo: mide lo
   que se ve y se alinea con la primera línea del texto. La etiqueta entera
   sigue siendo el área para tocar. */
.auth-form .check input.tick {
  min-height: 18px;
  height: 18px;
  margin-top: 1px;
}

/* Confirmaciones (y «Abrir sin pantalla»): una decisión, no un formulario.
   En pantalla ancha van más angostas, para leer la frase de un vistazo; en
   celular, los dos botones tienen el mismo ancho y quedan al alcance del
   pulgar, con el de descartar sobre fondo gris para que se vea tocable. */
@media (min-width: 721px) {
  .sheet:has(#confirm-ok, #open-anyway) {
    width: min(440px, calc(100vw - 32px));
  }
}
@media (max-width: 720px) {
  /* Lado a lado y del mismo ancho si caben; si no, uno sobre otro con la
     acción arriba (wrap-reverse), sin cortar ningún texto. */
  .sheet:has(#confirm-ok, #open-anyway) .actions {
    display: flex;
    flex-wrap: wrap-reverse;
    gap: 8px;
  }
  .sheet:has(#confirm-ok, #open-anyway) .actions > .btn {
    flex: 1 1 0;
    min-width: max-content;
    justify-content: center;
    margin: 0;
  }
  .sheet:has(#confirm-ok, #open-anyway) .actions > .btn.ghost {
    background: var(--raised);
  }
}

/* Campanita (las dos, Organización y bar): como un centro de avisos. El
   ícono dice el tema en gris, el texto va normal (los no vistos en tinta
   y con su punto, los vistos en gris) y la acción es un enlace de texto
   bajo el aviso, no un botón por renglón. */
.bell-group ul {
  gap: 4px;
}
.bell-group li,
#bar-bell-pop .bell-group li {
  gap: 12px;
  padding: 8px 0;
  font-weight: 400;
  line-height: 1.45;
}
.bell-group li .ic {
  color: var(--soft);
}
.bell-group li.new {
  font-weight: 500;
}
.bell-group li.new::after {
  background: var(--down);
}
.bell-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin-top: 2px;
  font-weight: 400;
}
.bell-acts > a,
.bell-acts > button,
.bell-acts > .btn,
.bell-group li .bell-acts a {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  white-space: nowrap;
}
@media (hover: hover) {
  .bell-acts > a:hover,
  .bell-acts > button:hover,
  .bell-acts > .btn:hover {
    background: none;
    text-decoration-color: currentColor;
  }
}
@media (pointer: coarse) {
  .bell-acts > a,
  .bell-acts > button,
  .bell-acts > .btn,
  .bell-group li .bell-acts a {
    min-height: 44px;
    margin-block: -8px;
  }
}
.bell-branch {
  margin-bottom: 0;
}
.bell-foot {
  color: var(--soft);
}
/* «Ver sucursal» a la derecha del nombre, alineado con los puntos. */
.bell-branch .link {
  flex: none;
  width: auto;
  margin-left: auto;
  /* El texto (no su relleno de 12 px) termina donde terminan los puntos. */
  margin-right: -12px;
}

/* Factura del cliente (/factura). En celular no hay tarjeta flotando a media
   pantalla: la página empieza arriba y usa el ancho, como /cuenta. El aviso
   de un campo queda debajo de ese campo, en rojo, y el campo marcado. */
select[aria-invalid="true"] {
  box-shadow: 0 0 0 1px var(--down-ink);
}
select[aria-invalid="true"]:focus {
  box-shadow:
    0 0 0 1px var(--down-ink),
    0 0 0 4px var(--down-bg);
}
.invoice-card form .form-error:not(:empty) {
  margin-top: 6px;
  font-size: var(--t-sm);
}
.invoice-files .btn.wide + .btn.wide {
  margin-top: 0;
}
@media (max-width: 560px) {
  .auth:has(.invoice-card) {
    place-items: start stretch;
    padding: 24px 20px;
  }
  .invoice-card {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }
}

/* Comprobante de consumo en pantalla. La nota final se imprime también: dice
   que el comprobante no es un CFDI, y por eso no usa .hint (que se oculta
   al imprimir). */
.receipt-note {
  margin: 16px 0 0;
  color: var(--soft);
  font-size: var(--t-sm);
}
.receipt .line + .kv {
  margin-top: 8px;
  border-top-color: var(--line);
}
@media print {
  .receipt-note {
    color: #444;
  }
}
.receipt .line b {
  font-weight: 400;
}
