/* Diseño del ticket — vista previa en vivo (Empresa > Impresión). Usa las variables del panel (modo claro y oscuro). */
.tk-estudio {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--borde);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tk-cabecera h3 {
  margin: 0 0 4px;
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--texto);
}
.tk-cabecera p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--texto-suave);
  max-width: 62ch;
}

.tk-rejilla {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 470px);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .tk-rejilla { grid-template-columns: minmax(0, 1fr); }
}

.tk-bloque-titulo {
  display: block;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texto-suave);
}

/* ---- Tipo de letra ---- */
.tk-fuentes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 640px) {
  .tk-fuentes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tk-fuente {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 64px;
  padding: 8px 6px;
  background: var(--card-subtle);
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  color: var(--texto);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}
.tk-fuente:hover { border-color: var(--naranja-linea); }
.tk-fuente:focus-visible, .tk-paso:focus-visible, .tk-segmento button:focus-visible, .tk-accion:focus-visible {
  outline: 2px solid var(--naranja);
  outline-offset: 2px;
}
.tk-fuente.activo {
  border-color: var(--naranja);
  background: var(--naranja-suave);
}
.tk-fuente-muestra {
  font-family: var(--tk-fam);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.tk-fuente-nombre {
  font-size: 11px;
  font-weight: 600;
  color: var(--texto-suave);
  text-align: center;
  line-height: 1.2;
}
.tk-fuente.activo .tk-fuente-nombre { color: var(--texto); }

/* ---- Lista de secciones ---- */
.tk-secciones {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--borde);
  border-radius: 14px;
  overflow: hidden;
}
.tk-sec {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 86px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--blanco);
  border-bottom: 1px solid var(--borde);
  transition: background-color 0.15s ease;
}
.tk-sec:last-child { border-bottom: 0; }
.tk-sec:hover, .tk-sec.resaltada { background: var(--card-subtle); }
@media (max-width: 560px) {
  .tk-sec { grid-template-columns: minmax(0, 1fr) auto; }
  .tk-nivel { display: none; }
}
.tk-sec-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tk-codigo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--naranja);
}
.tk-detalle {
  font-size: 12px;
  line-height: 1.35;
  color: var(--texto-suave);
}
.tk-ctrl { display: flex; align-items: center; gap: 6px; }
.tk-paso {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-subtle);
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  color: var(--texto);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--borde);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}
.tk-paso:hover:not(:disabled) { border-color: var(--naranja); background: var(--naranja-suave); }
.tk-paso:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--borde); }
.tk-paso:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.tk-medidor { display: flex; align-items: flex-end; gap: 3px; height: 26px; padding: 0 2px; }
.tk-pip {
  display: block;
  width: 7px;
  border-radius: 2px;
  background: var(--borde);
  transition: background-color 0.18s ease;
}
.tk-pip:nth-child(1) { height: 8px; }
.tk-pip:nth-child(2) { height: 12px; }
.tk-pip:nth-child(3) { height: 16px; }
.tk-pip:nth-child(4) { height: 21px; }
.tk-pip:nth-child(5) { height: 26px; }
.tk-pip.on { background: var(--naranja); }
.tk-nivel {
  font-size: 12px;
  font-weight: 600;
  color: var(--texto-suave);
  text-align: right;
}
.tk-nivel[data-nivel="3"] { color: var(--texto-muted); font-weight: 500; }

/* ---- Barra de acciones ---- */
.tk-barra { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tk-accion {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.tk-accion.primaria {
  background: var(--naranja);
  border: 1.5px solid var(--naranja-osc);
  color: #fff;
  box-shadow: 0 3px 0 var(--naranja-osc);
}
.tk-accion.primaria:hover:not(:disabled) { background: var(--naranja-osc); }
.tk-accion.primaria:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--naranja-osc); }
.tk-accion.secundaria {
  background: var(--blanco);
  border: 1.5px solid var(--borde);
  color: var(--texto);
  box-shadow: 0 3px 0 var(--borde);
}
.tk-accion.secundaria:hover:not(:disabled) { border-color: var(--naranja); }
.tk-accion.secundaria:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--borde); }
.tk-accion:disabled { opacity: 0.55; cursor: progress; }
.tk-accion svg { flex-shrink: 0; }
.tk-estado { font-size: 12.5px; color: var(--texto-suave); }
.tk-estado.pendiente { color: var(--naranja); font-weight: 600; }
.tk-estado.ok { color: var(--verde); font-weight: 600; }
.tk-estado.error { color: var(--rojo); font-weight: 600; }

/* ---- Vista previa ---- */
.tk-vista { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }
@media (max-width: 1100px) { .tk-vista { position: static; } }
.tk-herramientas { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-segmento {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--card-subtle);
  border: 1px solid var(--borde);
  border-radius: 12px;
}
.tk-segmento button {
  min-height: 38px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: var(--texto-suave);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tk-segmento button:hover { color: var(--texto); }
.tk-segmento button[aria-pressed="true"] {
  background: var(--naranja);
  color: #fff;
}

.tk-celular-zona { display: flex; justify-content: center; }
.tk-celular {
  position: relative;
  padding: 26px 12px 18px;
  background: #121212;
  border-radius: 40px;
  box-shadow: 0 0 0 2px #2c2c2c, 0 24px 48px rgba(0, 0, 0, 0.35);
  max-width: 100%;
}
.tk-celular::before {
  content: '';
  position: absolute;
  top: 9px;
  left: 50%;
  width: 64px;
  height: 8px;
  margin-left: -32px;
  background: #050505;
  border-radius: 8px;
}
.tk-pantalla {
  height: 560px;
  overflow: auto;
  padding: 16px 18px 28px;
  background-color: #dcd7cf;
  background-image: radial-gradient(rgba(0, 0, 0, 0.07) 1px, transparent 1px);
  background-size: 14px 14px;
  border-radius: 24px;
  scrollbar-width: thin;
}
.tk-papel {
  margin: 0 auto;
  position: relative;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22), 0 1px 0 rgba(0, 0, 0, 0.1);
}
.tk-papel iframe {
  display: block;
  border: 0;
  background: #fff;
  transform-origin: 0 0;
}
.tk-nota-datos { margin: 0; font-size: 12px; line-height: 1.45; color: var(--texto-suave); text-align: center; }
.tk-nota-datos strong { color: var(--texto); }

.tk-impresion {
  padding: 12px 14px;
  background: var(--card-subtle);
  border: 1px solid var(--borde);
  border-radius: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .tk-fuente, .tk-paso, .tk-pip, .tk-accion, .tk-sec, .tk-segmento button { transition: none; }
}

.tk-nota-lista { margin: 8px 2px 0; font-size: 12px; line-height: 1.45; color: var(--texto-suave); }
.tk-nota-lista:empty { display: none; }
.tk-k { margin-left: 4px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; color: var(--naranja); }
