/* Navegación y controles compartidos por Investigación y Grafo. */
.nav-toggle, .tools-toggle { display: none; }
.graph-tools { display: contents; }
.site-header > nav { min-width: 0; }
:where(button, a, input, select):focus-visible { outline: 3px solid #1a56db; outline-offset: 3px; }
.field-value, .result-name { overflow-wrap: anywhere; }
.result-grid > * { min-width: 0; }

@media (max-width: 1100px) {
  .site-header .logo-tagline { display: none; }
}
@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .nav-toggle, .tools-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 8px 14px; border: 1px solid var(--border);
    border-radius: 8px; background: var(--surface); color: var(--text-primary);
    font: 500 14px var(--font); cursor: pointer;
  }
  .nav-toggle { margin-left: auto; }
  .site-header > nav { display: none; width: 100%; flex-wrap: wrap; gap: 4px; }
  .site-header > nav.is-open { display: flex; }
  .site-header > nav > a { min-height: 44px; display: flex; align-items: center; }
  .site-header > nav .nav-sep { display: none; }
  #authNav { flex-basis: 100%; min-width: 0; flex-wrap: wrap; }
  .site-header > nav a.active { background: var(--accent-bg); }
  input, select, textarea { font-size: 16px !important; }
  .main { width: 100%; padding: 24px 16px 48px; }
  .search-card { padding: 16px; }
  .search-input { min-width: 0; max-width: 100%; }
  .search-row .search-input { flex-basis: 100%; }
  .search-row .btn-search { min-height: 44px; width: 100%; justify-content: center; }
  .mode-tabs { flex-wrap: wrap; }
  .mode-tab { min-height: 44px; flex: 1; justify-content: center; }
  .result-header { min-height: 44px; flex-wrap: wrap; gap: 6px; }
  .result-title { flex: 1; min-width: 0; font-size: 11px; line-height: 1.6; }
  .result-header > svg { flex-shrink: 0; }
  .result-count { font-size: 10px; }
  .result-grid { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
  .btn-bar { gap: 8px; flex-wrap: wrap; }
  .btn-bar > button { min-height: 44px; flex: 1 1 130px; justify-content: center; margin-left: 0; }
  .compare-inputs { flex-wrap: wrap; }
  .compare-field { min-width: 0; flex-basis: 100%; }
  .compare-inputs button { min-height: 44px; width: 100%; justify-content: center; }

  body.graph-page { height: 100dvh; }
  .graph-page .site-header { max-height: 45dvh; overflow-y: auto; }
  .graph-page .top-bar { padding: 8px 12px; gap: 8px; }
  .graph-page #queryInput { flex: 1 1 150px; width: auto; min-height: 44px; }
  .graph-page .top-bar button, .graph-page .top-bar select { min-height: 44px; }
  .graph-page .top-bar > .btn-divider { display: none; }
  .graph-page .graph-tools { display: none; width: 100%; flex-wrap: wrap; gap: 8px; max-height: 30dvh; overflow-y: auto; padding: 3px; }
  .graph-page .graph-tools.is-open { display: flex; }
  .graph-tools .btn-divider { display: none; }
  .graph-tools > button, .graph-tools > select { flex: 1 1 120px; justify-content: center; }
  .graph-tools #graphSearch { width: 100% !important; flex-basis: 100%; min-height: 44px; }
  .graph-page .status-txt { flex-basis: 100%; }
  .graph-page .legend { display: none; }
  .graph-page .graph-wrap { min-height: 0; }
  .graph-page .empty-state { width: calc(100% - 40px); }
  .graph-page .empty-state p { font-size: 12px; }
  .graph-page .node-panel { width: min(320px, 100%); z-index: 30; }
  .graph-page .panel-close, .graph-page .modal-x { min-width: 44px; min-height: 44px; }
  .graph-page .entity-palette, .graph-page .ep-toggle-btn, .graph-page #minimap { display: none !important; }
  .graph-page .hallazgos-panel { left: 12px !important; min-width: 0; max-width: calc(100% - 24px); font-size: 11px; }
  .graph-page .modal-overlay { padding: 12px; }
  .graph-page .modal-card { max-height: calc(100dvh - 24px); }
}
@media print { .nav-toggle, .tools-toggle { display: none; } }
