/* Selector de herramientas (shell común). Colores solo por tokens de humano-tokens.css. */
.hs { position: relative; display: inline-block; }
.hs-toggle {
  display: inline-flex; align-items: center; gap: var(--space-2, 8px);
  min-height: 44px; padding: 0 var(--space-3, 12px);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-pill, 999px);
  background: var(--bg-surface); color: var(--text-main);
  font: 600 14px/1 var(--font-base); cursor: pointer;
}
.hs-toggle svg { width: 18px; height: 18px; flex: none; }
.hs-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.hs-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 1000;
  width: min(92vw, 360px); max-height: 70vh; overflow: auto;
  padding: var(--space-4, 16px); border-radius: var(--radius-card, 20px);
  background: var(--bg-surface); color: var(--text-main);
  border: 1px solid var(--border-subtle); box-shadow: var(--shadow-neo-lg);
}
.hs-panel[hidden] { display: none; }
.hs-group + .hs-group { margin-top: var(--space-4, 16px); padding-top: var(--space-4, 16px); border-top: 1px solid var(--border-subtle); }
.hs-group__title { margin: 0 0 var(--space-2, 8px); font: 600 12px/1.3 var(--font-base); color: var(--text-muted); }
.hs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1, 4px); }
.hs-link {
  display: block; padding: var(--space-2, 8px) var(--space-3, 12px); min-height: 44px; box-sizing: border-box;
  border-radius: var(--radius-btn, 14px); color: inherit; text-decoration: none;
}
.hs-link:hover { background: var(--bg-hover); }
.hs-link[aria-current="page"] { background: var(--accent-container); }
/* Sobre el fondo del elemento actual el gris tenue no llega a 4.5:1: la descripción usa el texto principal. */
.hs-link[aria-current="page"] .hs-link__desc { color: var(--text-main); }
.hs-link__name { display: block; font: 600 15px/1.3 var(--font-base); }
.hs-link__desc { display: block; font: 400 13px/1.35 var(--font-base); color: var(--text-muted); }

/* En pantallas estrechas solo el ícono: el nombre sigue siendo accesible (visualmente oculto). */
@media (max-width: 480px) {
  .hs-toggle { padding: 0; width: 44px; justify-content: center; }
  .hs-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* En móvil el panel ocupa el ancho de la ventana, para que nunca se corte. */
@media (max-width: 480px) {
  /* top, left, width y max-height los fija shell.js al abrir (compensa ancestros con backdrop-filter). */
  .hs-panel { position: fixed; left: var(--space-3, 12px); top: 64px; width: calc(100vw - 24px); max-height: calc(100vh - 80px); }
}
