/* ==========================================================================
   Bancada — Ayuda en el lugar (el "?" y su globito)
   Lo maneja js/ui/ayuda.js. Ningún color literal: todo sale de tokens.css,
   así el dibujo acompaña el cambio de tema sin tocar JavaScript.
   ========================================================================== */

/* ---- El botoncito "?" ---------------------------------------------------- */
.pista {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  width: 19px; height: 19px; padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--paper-2);
  color: var(--ink-3);
  font-family: var(--font);
  font-size: 11px; font-weight: 700; line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
/* El círculo se ve de 19 px pero se toca en 33: un dedo con aserrín encima
   no acierta un objetivo de 19 px, y agrandar el círculo rompe las barras. */
.pista::after {
  content: "";
  position: absolute; inset: -7px;
  border-radius: 50%;
}
.pista:hover { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-ink); }
.pista:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--acc); }
.pista--abierta { background: var(--acc); border-color: var(--acc); color: var(--surface); }
:root[data-theme="dark"] .pista--abierta { color: var(--paper); }

/* El "?" de adentro de .pista-texto no se toca solo: manda el botón de afuera */
.pista--inerte { pointer-events: none; }
.pista--inerte::after { display: none; }

/* ---- El texto entero como botón (barras finitas) ------------------------- */
.pista-texto {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 7px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  color: inherit;
  font-family: inherit; font-size: inherit; font-weight: inherit;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.pista-texto:hover { background: var(--surface); border-color: var(--line-2); }
.pista-texto:focus-visible { outline: none; border-color: var(--acc); box-shadow: var(--ring); }
.pista-texto[aria-expanded="true"] { background: var(--acc-soft); border-color: var(--acc-line); }
.pista-texto__cuerpo { display: inline-flex; align-items: center; gap: 4px; }

/* ---- El globo ------------------------------------------------------------ */
.ayuda-globo {
  position: fixed; z-index: 240;
  width: 320px; max-width: calc(100vw - 20px);
  padding: var(--s4) var(--s4) 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  animation: ayuda-in var(--t-fast) var(--ease-out);
}
.ayuda-globo:focus { outline: none; }
@keyframes ayuda-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.ayuda-globo__punta {
  position: absolute; top: -6px;
  width: 11px; height: 11px; margin-left: -5.5px;
  background: var(--surface);
  border-left: 1px solid var(--line-2);
  border-top: 1px solid var(--line-2);
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}
.ayuda-globo--arriba .ayuda-globo__punta {
  top: auto; bottom: -6px;
  border: 0;
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  border-radius: 0 0 2px 0;
}

.ayuda-globo__cabecera {
  display: flex; align-items: flex-start; gap: var(--s2);
  margin-bottom: var(--s2);
}
.ayuda-globo__titulo {
  flex: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-md); font-weight: 640;
  letter-spacing: -.012em;
  color: var(--ink);
  line-height: var(--lh-snug);
}
.ayuda-globo__cerrar {
  flex: none;
  width: 26px; height: 26px; margin: -3px -4px 0 0;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-4);
  cursor: pointer;
}
.ayuda-globo__cerrar:hover { background: var(--paper-2); color: var(--ink-2); }
.ayuda-globo__cerrar:focus-visible { outline: none; box-shadow: var(--ring); }

.ayuda-globo__p {
  margin: 0 0 8px;
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  color: var(--ink-2);
}
.ayuda-globo__p:last-child { margin-bottom: 0; }

/* ---- El dibujito --------------------------------------------------------- */
.ayuda-globo__dibujo {
  display: flex; justify-content: center;
  padding: var(--s2) 0 var(--s3);
  margin-bottom: 2px;
}
.ayuda-globo__dibujo svg { width: 100%; height: auto; max-width: 260px; }

.ayuda-globo__dibujo .tablero { fill: var(--plan-board); stroke: var(--plan-edge); stroke-width: 1.2; }
.ayuda-globo__dibujo .pieza { fill: var(--plan-piece); stroke: var(--plan-piece-line); stroke-width: 1.2; }
.ayuda-globo__dibujo .descarte { fill: var(--plan-waste); stroke: var(--plan-waste-line); stroke-width: 1.1; }
.ayuda-globo__dibujo .sobrante { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 1.2; }
.ayuda-globo__dibujo .corte { fill: var(--acc-soft-2); stroke: var(--acc); stroke-width: 1.1; }
.ayuda-globo__dibujo .canto { fill: var(--acc); stroke: none; }
.ayuda-globo__dibujo .acento { stroke: var(--acc); stroke-width: 1.5; }
.ayuda-globo__dibujo .acento-2 { stroke: var(--steel); stroke-width: 1.5; }
.ayuda-globo__dibujo .veta { stroke: var(--plan-grain); stroke-width: 1.1; }
.ayuda-globo__dibujo .veta-2 { stroke: var(--plan-piece-line); stroke-width: 1; opacity: .75; }
.ayuda-globo__dibujo .mal { stroke: var(--bad); }
.ayuda-globo__dibujo .pieza.mal { fill: var(--bad-soft); stroke: var(--bad); }
.ayuda-globo__dibujo .rotulo {
  fill: var(--ink-3); stroke: none;
  font-family: var(--font-num); font-size: 9px; font-weight: 600;
  text-anchor: middle;
}
.ayuda-globo__dibujo .rotulo.ok { fill: var(--ok); }

/* ==========================================================================
   Enganches — dónde se apoyan las pistas hoy
   (viven acá y no en app.css para no pisarle el archivo a nadie)
   ========================================================================== */

/* ---- Barra de estado: disco, etapas y recorte de borde ------------------- */
.statusbar__grupo { display: flex; align-items: center; gap: 2px; min-width: 0; }
.statusbar__grupo .pista-texto { font-size: var(--fs-xs); color: var(--ink-3); }
.statusbar__grupo .pista-texto b { color: var(--ink-2); font-weight: 600; }
.statusbar__grupo .pista { width: 16px; height: 16px; font-size: 10px; }
.statusbar__punto { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); opacity: .55; flex: none; }

/* ---- Dock: el "?" del aprovechamiento ------------------------------------ */
.dock__titulo-txt { display: inline-flex; align-items: center; gap: 7px; }
.dock__titulo-txt .pista { width: 17px; height: 17px; font-size: 10px; letter-spacing: 0; }

/* ---- Cinta del trabajo de ejemplo ---------------------------------------- */
.st-ejemplo {
  display: inline-flex; align-items: center; gap: var(--s2);
  height: 22px; padding: 0 4px 0 10px;
  border-radius: var(--r-pill);
  background: var(--acc-soft);
  border: 1px solid var(--acc-line);
  color: var(--acc-ink);
  font-size: var(--fs-xs); font-weight: 600;
  white-space: nowrap;
}
.st-ejemplo__btn {
  height: 18px; padding: 0 9px;
  border: 0; border-radius: var(--r-pill);
  background: var(--acc); color: var(--surface);
  font-family: inherit; font-size: var(--fs-xs); font-weight: 620;
  cursor: pointer;
}
:root[data-theme="dark"] .st-ejemplo__btn { color: var(--paper); }
.st-ejemplo__btn:hover { background: var(--acc-hover); }
.st-ejemplo__btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* En pantallas de 1366 la barra de estado se apretuja: primero se va el texto
   del guardado, nunca las pistas. */
@media (max-width: 1100px) {
  .statusbar__grupo .pista-texto__cuerpo { gap: 3px; }
}
