/* Catálogo de BOLT, listas por página y Pruebas de columna */


/* ---------- Aviso de cada sección ---------- */
.section-banner[hidden] { display: none; }
.mode-banner .mode-text { flex: 1; min-width: 0; }
.mode-banner .mode-switch { flex: none; }
.mode-banner .mode-switch button:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Tarjetas de Spheros con color, quitar y acción ---------- */
.robots { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.robot { position: relative; cursor: default; }
.robot.on { border-color: var(--ink); }
.robot .color-btn { top: 10px; right: 10px; }
.robot-remove { position: absolute; top: 12px; right: 48px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, 0.7); color: var(--ink-2); font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.robot-remove:hover:not(:disabled) { background: var(--surface); color: var(--bad); }
.robot-remove:disabled { opacity: 0.35; cursor: not-allowed; }
.robot-top { padding-right: 70px; }
.robot-action { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
/* Conectar y Desconectar: el color pleno de la Sphero (el del círculo), no el pastel */
.btn.tinted { background: var(--robot-color, var(--bg)); color: var(--robot-soft, #fff); border-color: transparent; }
.btn.tinted:hover:not(:disabled) { background: var(--robot-color, var(--line)); filter: brightness(0.9); }
.robot-lock { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.robot-lock svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.robot.add { background: transparent; border: 2px dashed var(--line-strong); align-items: center; justify-content: center; min-height: 120px; padding: 12px; }
.robots.compact .robot.add { min-height: 0; }
.add-robot { gap: 8px; }
.add-robot .plus, .btn .plus { font-size: 20px; line-height: 1; font-weight: 700; }
.warn-text { color: var(--warn); }

/* ---------- Menú para añadir y popup para agregar una BOLT ---------- */
.picker.menu { width: min(320px, calc(100vw - 32px)); gap: 10px; }
.menu-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.menu-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--bg); }
.menu-item .menu-id { font-size: 12.5px; color: var(--ink-3); }
.menu-item .menu-note { grid-column: 2 / 4; font-size: 12px; color: var(--warn); }
.menu-item.new { grid-template-columns: auto minmax(0, 1fr); color: var(--accent-deep); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.add-bolt { width: min(380px, calc(100vw - 32px)); }
.add-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.add-fields .tape-field input { width: 100%; font-size: 18px; padding: 8px 12px; }
.id-field { display: inline-flex; align-items: center; border: 2px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.id-field:focus-within { border-color: var(--accent); }
.id-prefix { padding: 0 2px 0 12px; font-size: 18px; font-weight: 700; color: var(--ink-3); }
.add-fields .id-field input { width: 76px; border: 0; padding: 8px 10px 8px 2px; text-transform: uppercase; }
.add-fields .id-field input:focus { outline: none; }
.add-pages { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.btn.danger.small { padding: 8px 14px; font-size: 14px; }

/* ---------- Catálogo ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.catalog-grid { margin-bottom: var(--gap); }
.catalog-card { cursor: grab; }
.catalog-card.dragging, .page-chip.dragging { opacity: 0.45; }
.page-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.page-card { display: flex; flex-direction: column; gap: 10px; transition: box-shadow 0.12s ease, border-color 0.12s ease; border: 2px solid transparent; }
.page-card.over { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.page-card > .card-head { margin-bottom: 4px; }
/* Con las tres listas lado a lado, las tarjetas comparten filas (título, texto, lista, Añadir):
   cada parte queda a la misma altura en las tres aunque el texto o la lista de una sea más largo */
@media (min-width: 1181px) {
  .page-card { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 10px; }
  .page-card > .card-head { grid-row: 1; }
  .page-card > .note { grid-row: 2; }
  .page-card > .page-list { grid-row: 3; }
  .page-card > .add-robot { grid-row: 4; }
}
.page-list { display: flex; flex-direction: column; gap: 6px; min-height: 60px; }
.page-chip { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label tools" "name tools"; align-items: center; gap: 0 8px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--robot-soft, var(--bg)); cursor: grab; font-weight: 700; font-size: 14.5px; }
.page-chip .chip-label { grid-area: label; min-height: 16px; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.page-chip .name-cell { grid-area: name; }
.page-chip .chip-note { font-size: 12px; color: var(--good); font-weight: 600; }
.page-chip .chip-tools { grid-area: tools; display: flex; gap: 4px; align-items: center; }
.page-chip .robot-remove { position: static; }
.chip-move { width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, 0.7); color: var(--ink-2); font-weight: 700; cursor: pointer; padding: 0; }
.chip-move:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.chip-move:disabled { opacity: 0.3; cursor: not-allowed; }
.drop-hint { border: 2px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; }

/* ---------- Mediciones con varias Spheros ---------- */
.review-table input { width: 110px; font-size: 18px; font-weight: 700; padding: 6px 10px; border: 2px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.review-table input:focus { border-color: var(--accent); outline: none; }
.review-table input[aria-invalid="true"] { border-color: var(--bad); }
.review-table .badges { margin-top: 4px; }

/* ---------- Pruebas de columna ---------- */
.tape-card { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tape-question { font-size: 26px; font-weight: 700; line-height: 1.2; margin: 4px 0 6px; }
.sequence-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sequence-input { flex: 1 1 180px; min-width: 0; font-size: 20px; font-weight: 700; letter-spacing: 0.08em; padding: 9px 14px; border: 2px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.sequence-input:focus { border-color: var(--accent); outline: none; }
.sequence-input[aria-invalid="true"] { border-color: var(--bad); }
.ruler-wrap { border-radius: 12px; overflow: hidden; }
.ruler-canvas { display: block; width: 100%; height: 190px; }
.steps-table tr.pending td { color: var(--ink-3); }
.steps-table tr.current td { background: var(--accent-soft); }
.tape-key { display: inline-block; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 10px solid var(--ink-2); }

@media (max-width: 1180px) {
  .page-lists { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .add-fields { grid-template-columns: minmax(0, 1fr); }
}
