/* Componentes comunes: misma lectura e interacción en todos los módulos.
   Conserva la paleta del tema y los colores de estado existentes. */
:root { --control-radius: 8px; --panel-radius: 12px; --control-height: 40px; }
.skip-content { position:fixed; top:8px; left:8px; z-index:10000; transform:translateY(-160%); padding:12px 18px; background:var(--surface); color:var(--text); border:2px solid var(--accent); border-radius:8px; }
.skip-content:focus { transform:none; }
body:has(#workspace[hidden]) .skip-content { display:none; }
#workspace :is(button,input,select,textarea), dialog :is(button,input,select,textarea) { font-family:inherit; border-radius:var(--control-radius); }
#workspace :is(button,input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select), dialog :is(button,input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select) { min-height:var(--control-height); }
#workspace :is(input,select,textarea), dialog :is(input,select,textarea) { max-width:100%; }
:is(button,a,input,select,textarea,summary):focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
#view :is(.panel,.card), dialog { border-radius:var(--panel-radius); }
#view :is(.toolbar,.report-filter), dialog .toolbar { gap:10px; flex-wrap:wrap; }
#view :is(.help,.empty,.loading), dialog .help { line-height:1.6; }
#view label, dialog label { line-height:1.45; }
#view :is(h2,h3,h4), dialog :is(h2,h3,h4) { line-height:1.3; text-wrap:balance; }
#view .table-wrap { border:1px solid var(--border-soft); border-radius:10px; overflow:auto; }
#view th { font-size:11px; line-height:1.4; }
#view td { line-height:1.5; }
#view :is(td.number,.metric-value,.fee-resumen strong) { font-variant-numeric:tabular-nums; }
#view tbody tr:focus-within { background:var(--row-hover); }
#view :is(.error,.notice), dialog .error { overflow-wrap:anywhere; line-height:1.5; }
#view .error:not(:empty), dialog .error:not(:empty) { padding:12px 14px; border-left:3px solid var(--danger); background:var(--danger-bg); border-radius:6px; }
#workspace button:disabled, dialog button:disabled { cursor:not-allowed; opacity:.6; }
.page-heading { gap:16px; }
.page-heading>div { min-width:0; }
#page-description { max-width:75ch; line-height:1.6; }
dialog .dialog-actions { gap:10px; flex-wrap:wrap; }
.robot-clave { padding:16px; border:1px solid var(--border-soft); border-radius:var(--panel-radius); background:var(--surface-2); }
.robot-vista { max-width:100%; height:auto; }
@media(max-width:640px) {
  :root { --control-height:44px; }
  #view :is(.toolbar,.report-filter)>label { min-width:0; max-width:100%; }
  #view .form-grid, dialog .form-grid { grid-template-columns:minmax(0,1fr); }
  #view :is(input,select,textarea), dialog :is(input,select,textarea) { font-size:16px; }
  .page-heading { flex-wrap:wrap; }
  dialog .dialog-actions>button { flex:1 1 120px; }
  #view .sticky-actions>button { flex:0 0 auto; height:auto; min-height:44px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
}
