/* ==========================================================================
   Buscador público de Descriptores de Cargo · HRA · v1.7.1 (RC30)
   Rediseño visual. Mantiene IDs, clases funcionales y comportamiento de app.js.
   Paleta: cian HRA + azul DO, neutros fríos. Modo institucional claro exclusivo.
   ========================================================================== */
:root{
  color-scheme:only light;
  --font:"Public Sans","Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",Arial,sans-serif;
  --bg:#f3f7f9;--bg-grad:#e8f3f7;
  --surface:#ffffff;--surface-2:#f6fafb;--surface-3:#ebf2f5;
  --line:#dde7ec;--line-strong:#c6d6de;
  --ink:#10283a;--ink-2:#2f4a5c;--muted:#5d7485;--faint:#8398a6;
  --brand:#0f7cb4;--brand-hover:#0b6a9b;--brand-strong:#0f7cb4;--brand-strong-hover:#0b6a9b;--brand-ink:#0b5f8a;--brand-soft:#e3f2f9;--brand-soft-2:#cfe8f4;
  --cyan:#1aa6c9;
  --green:#157a4f;--green-soft:#e2f4ea;--green-dot:#1f9d63;
  --yellow:#8a5a00;--yellow-soft:#fdf1d3;--yellow-dot:#dba017;
  --orange:#a94c12;--orange-soft:#fdebdd;--orange-dot:#e0762d;
  --red:#ae2535;--red-soft:#fce8ea;--red-dot:#d7394a;--red-line:#f0bcc3;
  --blue-dot:#2d8fc4;
  --shadow-sm:0 1px 2px rgba(16,40,58,.05);
  --shadow:0 1px 2px rgba(16,40,58,.04),0 8px 24px -12px rgba(16,40,58,.18);
  --shadow-lg:0 24px 60px -18px rgba(8,30,46,.38);
  --backdrop:rgba(9,26,38,.42);
  --r-sm:9px;--r:12px;--r-lg:16px;--r-xl:20px;
  --ease:cubic-bezier(.2,.8,.2,1);
}


/* ---------- Base ---------- */
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;display:flex;flex-direction:column;background:linear-gradient(180deg,var(--bg-grad) 0,var(--bg) 360px);color:var(--ink);font-family:var(--font);font-size:15.5px;line-height:1.45;-webkit-font-smoothing:antialiased}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer}
::selection{background:var(--brand-soft-2)}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
.i{width:18px;height:18px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;display:inline-block;vertical-align:middle}
.i-sm{width:14px;height:14px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip-link{position:absolute;left:12px;top:-60px;z-index:100;background:var(--brand);color:#fff;padding:9px 14px;border-radius:var(--r-sm);font-weight:700;text-decoration:none}
.skip-link:focus{top:12px}

/* ---------- Encabezado ---------- */
.site-header{background:var(--surface);border-bottom:1px solid var(--line);position:relative}
.site-header::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;background:linear-gradient(90deg,var(--cyan),var(--brand) 55%,#2a5ba8)}
.header-inner{max-width:1440px;margin:0 auto;padding:22px 32px 24px;display:flex;align-items:center;gap:26px}
.brand-logos{display:flex;align-items:center;gap:16px;flex:0 0 auto;padding:6px 4px}
.logo{object-fit:contain;display:block}
.logo-hra{width:52px;height:68px}
.logo-do{width:70px;height:68px}
.brand-divider{width:1px;height:54px;background:var(--line-strong)}
.brand-copy{min-width:0}
.eyebrow,.section-kicker{margin:0;color:var(--brand-ink);font-weight:700;text-transform:uppercase;letter-spacing:.1em;font-size:11.5px}
.brand-copy h1{margin:4px 0 3px;font-size:clamp(25px,2.6vw,34px);line-height:1.1;letter-spacing:-.02em;color:var(--ink);font-weight:800}
.lede{margin:0;color:var(--muted);font-size:15px}


/* ---------- Estructura ---------- */
.page-shell{flex:1;width:100%;max-width:1440px;margin:0 auto;padding:26px 32px 120px}

/* ---------- Tarjeta de búsqueda ---------- */
.search-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);box-shadow:var(--shadow);padding:20px}
.search-row{display:flex;gap:10px;align-items:stretch}
.query-control{flex:1;min-width:0;display:grid;gap:1px;border:1px solid var(--line-strong);background:var(--surface-2);border-radius:var(--r);padding:8px 14px 6px;min-height:60px;transition:border-color .15s var(--ease),box-shadow .15s var(--ease),background-color .15s var(--ease);cursor:text}
.query-control:hover{border-color:color-mix(in srgb,var(--brand) 45%,var(--line-strong))}
.query-control:focus-within{border-color:var(--brand);background:var(--surface);box-shadow:0 0 0 4px color-mix(in srgb,var(--brand) 16%,transparent)}
.query-control small{font-size:11.5px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.input-wrap{position:relative;display:block;min-width:0}
.input-icon{position:absolute;left:0;top:50%;transform:translateY(-50%);color:var(--brand);width:19px;height:19px;pointer-events:none}
.query-control input{width:100%;border:0;background:transparent;outline:none;font-size:17px;padding:3px 4px 3px 28px;height:30px;color:var(--ink)}
.query-control input::placeholder{color:var(--faint)}
.query-control input::-webkit-search-cancel-button{cursor:pointer}
.btn-search{min-width:132px;font-size:16px;border-radius:var(--r)}
.filters-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-top:10px}
.filter-trigger{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:54px;padding:7px 10px 7px 13px;border:1px solid var(--line);background:var(--surface);border-radius:var(--r);text-align:left;color:var(--ink);transition:border-color .15s var(--ease),background-color .15s var(--ease),transform .1s var(--ease)}
.filter-trigger:hover{border-color:var(--line-strong);background:var(--surface-2)}
.filter-trigger:active{transform:scale(.99)}
.filter-trigger span{min-width:0;display:grid;gap:1px}
.filter-trigger small{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.filter-trigger strong{font-size:14px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.filter-trigger .chev{color:var(--faint);width:17px;height:17px;transition:transform .15s var(--ease)}
.filter-trigger.has-value{border-color:color-mix(in srgb,var(--brand) 50%,transparent);background:var(--brand-soft)}
.filter-trigger.has-value strong{color:var(--brand-ink)}
.filter-trigger.has-value .chev{color:var(--brand)}
.filter-trigger.has-value::before{content:"";position:absolute;top:8px;right:9px;width:7px;height:7px;border-radius:50%;background:var(--brand)}
.search-foot{display:flex;align-items:center;justify-content:space-between;gap:12px 18px;margin-top:14px;flex-wrap:wrap}
.search-foot-right{display:flex;align-items:center;gap:14px;margin-left:auto}
.active-filters{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
.active-filters:empty{display:none}
.filter-chip{display:inline-flex;align-items:center;gap:6px;background:var(--brand-soft);color:var(--brand-ink);border-radius:999px;padding:4px 11px;font-size:13px;font-weight:650;max-width:100%}
.filter-chip small{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.updated-info{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--muted)}
.updated-info .i{color:var(--faint)}

/* ---------- Botones ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:var(--r-sm);padding:10px 15px;font-weight:700;font-size:14.5px;line-height:1.2;white-space:nowrap;transition:background-color .15s var(--ease),border-color .15s var(--ease),color .15s var(--ease),transform .1s var(--ease),box-shadow .15s var(--ease)}
.btn:active:not(:disabled){transform:scale(.98)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn-sm{padding:7px 11px;font-size:13.5px}
.btn-sm .i{width:16px;height:16px}
.btn-primary{background:var(--brand-strong);color:#fff;box-shadow:0 1px 0 rgba(255,255,255,.18) inset,0 6px 16px -8px color-mix(in srgb,var(--brand) 70%,transparent)}
.btn-primary:hover:not(:disabled){background:var(--brand-strong-hover)}
.btn-ghost{background:transparent;color:var(--ink-2);border-color:var(--line-strong)}
.btn-ghost:hover:not(:disabled){background:var(--surface-3)}
.btn-ghost-light{background:rgba(255,255,255,.1);color:#fff;border-color:rgba(255,255,255,.28)}
.btn-ghost-light:hover{background:rgba(255,255,255,.18)}
.btn-report{background:var(--red-soft);color:var(--red);border-color:var(--red-line)}
.btn-report:hover:not(:disabled){background:color-mix(in srgb,var(--red-soft) 70%,var(--red-dot) 12%);border-color:color-mix(in srgb,var(--red-dot) 55%,transparent)}
.icon-btn{width:38px;height:38px;border-radius:var(--r-sm);border:1px solid var(--line);background:var(--surface);color:var(--ink-2);display:grid;place-items:center;flex:0 0 auto}
.icon-btn:hover{background:var(--surface-3)}

/* ---------- Barra de resultados ---------- */
.results-section{margin-top:26px}
.results-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:14px 20px;margin-bottom:12px;flex-wrap:wrap}
.results-heading h2{margin:0 0 4px;font-size:22px;letter-spacing:-.015em}
.result-count{margin:0;display:flex;align-items:center;flex-wrap:wrap;gap:6px 14px;color:var(--muted);font-size:14px}
.count-main strong{color:var(--ink);font-size:15px;font-variant-numeric:tabular-nums}
.count-of{color:var(--faint)}
.tallies{display:inline-flex;flex-wrap:wrap;gap:4px 12px}
.tally{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-variant-numeric:tabular-nums;color:var(--ink-2)}
.tally i{width:8px;height:8px;border-radius:50%}
.tally-green i{background:var(--green-dot)}.tally-yellow i{background:var(--yellow-dot)}.tally-orange i{background:var(--orange-dot)}.tally-red i{background:var(--red-dot)}
.toolbar-controls{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.compact-select{display:grid;gap:4px}
.compact-select>span{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.compact-select select,.pager select{appearance:none;-webkit-appearance:none;border:1px solid var(--line-strong);background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378909f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E") right 10px center/16px no-repeat;color:var(--ink);border-radius:var(--r-sm);padding:9px 34px 9px 12px;min-height:42px;font-size:14px;font-weight:600;outline:none;cursor:pointer}
.compact-select select{min-width:210px}
.compact-select select:focus,.pager select:focus{border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 16%,transparent)}
.view-toggle{display:flex;gap:2px;padding:3px;border-radius:11px;background:var(--surface-3);border:1px solid var(--line)}
.view-toggle button{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;color:var(--muted);border-radius:8px;padding:7px 12px;min-height:34px;font-size:13.5px;font-weight:700;transition:background-color .15s var(--ease),color .15s var(--ease)}
.view-toggle button .i{width:16px;height:16px}
.view-toggle button.active{background:var(--surface);color:var(--brand-ink);box-shadow:var(--shadow-sm)}
.toolbar-controls .btn-report{min-height:42px}

/* ---------- Paginación ---------- */
.pager{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:8px 10px 8px 14px;margin:0 0 10px}
.pager label{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13.5px}
.pager select{min-height:34px;padding:5px 30px 5px 10px}
.pager-nav{display:flex;align-items:center;gap:6px}
.pager-nav button{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line);background:var(--surface);color:var(--ink-2);border-radius:var(--r-sm);padding:6px 11px;min-height:34px;font-size:13.5px;font-weight:650}
.pager-nav button:hover:not(:disabled){background:var(--surface-3)}
.pager-nav button:disabled{opacity:.4;cursor:not-allowed}
.pager-nav button .i{width:16px;height:16px}
.pager-nav span{font-size:13.5px;color:var(--muted);min-width:112px;text-align:center;font-variant-numeric:tabular-nums}
.table-scroll-top{height:14px;overflow-x:auto;overflow-y:hidden;margin:0 0 6px;border-radius:999px;background:var(--surface-3)}
.table-scroll-top>div{height:1px}

/* ---------- Estados ---------- */
.loading-state,.empty-state{background:var(--surface);border:1px dashed var(--line-strong);border-radius:var(--r-lg);padding:40px 20px;text-align:center;color:var(--muted);display:grid;justify-items:center;gap:8px}
.loading-state strong,.empty-state h3{color:var(--ink);font-size:17px;margin:0}
.empty-state p{margin:0;max-width:44ch}
.loading-state small{font-size:13px}
.empty-state.compact{padding:26px 14px;border:0}
.skeleton-list{width:min(640px,100%);display:grid;gap:10px;margin-bottom:12px}
.skeleton-list i{display:block;height:44px;border-radius:10px;background:linear-gradient(90deg,var(--surface-3),color-mix(in srgb,var(--surface-3) 40%,var(--surface)),var(--surface-3));background-size:200% 100%;animation:shimmer 1.3s ease-in-out infinite}
.skeleton-list i:nth-child(2){width:88%}.skeleton-list i:nth-child(3){width:94%}.skeleton-list i:nth-child(4){width:76%}
@keyframes shimmer{from{background-position:120% 0}to{background-position:-80% 0}}
.loading-state.is-error{border-style:solid;border-color:var(--red-line);background:var(--red-soft)}
.loading-state.is-error .empty-icon{background:var(--surface);color:var(--red)}
.empty-icon{width:50px;height:50px;border-radius:14px;display:grid;place-items:center;background:var(--brand-soft);color:var(--brand)}
.empty-icon .i{width:24px;height:24px}

/* ---------- Estados de vigencia ---------- */
.badge{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:3px 10px 3px 8px;font-size:12px;font-weight:700;letter-spacing:.01em;white-space:nowrap;background:var(--surface-3);color:var(--ink-2)}
.badge::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor;opacity:.9}
.badge.valid-green{background:var(--green-soft);color:var(--green)}
.badge.valid-yellow{background:var(--yellow-soft);color:var(--yellow)}
.badge.valid-orange{background:var(--orange-soft);color:var(--orange)}
.badge.valid-red{background:var(--red-soft);color:var(--red)}
.badge.valid-blue{background:var(--brand-soft);color:var(--brand-ink)}
.tag{display:inline-flex;align-items:center;border-radius:7px;padding:3px 8px;font-size:12.5px;font-weight:650;background:var(--surface-3);color:var(--ink-2)}
.tag-grade{font-variant-numeric:tabular-nums}

/* ---------- Selección ---------- */
.select-btn{width:32px;height:32px;border-radius:9px;border:1.5px solid var(--line-strong);background:var(--surface);color:var(--muted);display:grid;place-items:center;flex:0 0 auto;transition:background-color .15s var(--ease),border-color .15s var(--ease),color .15s var(--ease)}
.select-btn .i{width:17px;height:17px;stroke-width:2.2}
.select-btn:hover{border-color:var(--brand);color:var(--brand)}
.selected .select-btn,.selected-row .select-btn{background:var(--brand);border-color:var(--brand);color:#fff}

/* ---------- Mosaico ---------- */
.results-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}
.dc-card{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:15px 16px 14px;display:flex;flex-direction:column;gap:8px;box-shadow:var(--shadow-sm);transition:border-color .15s var(--ease),box-shadow .2s var(--ease),transform .2s var(--ease);overflow:hidden}
.dc-card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--blue-dot)}
.dc-card.tone-green::before{background:var(--green-dot)}.dc-card.tone-yellow::before{background:var(--yellow-dot)}.dc-card.tone-orange::before{background:var(--orange-dot)}.dc-card.tone-red::before{background:var(--red-dot)}
.dc-card:hover{border-color:var(--line-strong);box-shadow:var(--shadow);transform:translateY(-1px)}
.dc-card.selected{border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 16%,transparent)}
.card-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.dc-code{font-size:12.5px;font-weight:700;color:var(--brand-ink);letter-spacing:.02em;font-variant-numeric:tabular-nums}
.dc-card h3{margin:-2px 0 0;font-size:17px;line-height:1.3;letter-spacing:-.01em;color:var(--ink)}
.dc-tags{display:flex;flex-wrap:wrap;gap:5px}
.dc-tags:empty{display:none}
.dc-structure{margin:2px 0 0;display:grid;gap:3px;font-size:13.5px}
.dc-structure div{display:grid;grid-template-columns:104px minmax(0,1fr);gap:8px}
.dc-structure dt{color:var(--muted);font-size:12.5px;padding-top:1px}
.dc-structure dd{margin:0;color:var(--ink-2);font-weight:600;overflow-wrap:anywhere}
.dc-actions{margin-top:auto;padding-top:11px;border-top:1px solid var(--line);display:flex;gap:8px;align-items:center}
.btn-doc,.btn-copy{display:inline-flex;align-items:center;justify-content:center;gap:6px;border-radius:var(--r-sm);padding:7px 11px;min-height:36px;font-size:13.5px;font-weight:700;text-decoration:none;white-space:nowrap;border:1px solid transparent;transition:background-color .15s var(--ease),border-color .15s var(--ease)}
.btn-doc{background:var(--red-soft);color:var(--red);border-color:var(--red-line)}
.btn-doc:hover{border-color:color-mix(in srgb,var(--red-dot) 55%,transparent)}
.btn-doc .i-sm{opacity:.7}
.btn-copy{background:transparent;color:var(--ink-2);border-color:var(--line-strong)}
.btn-copy:hover{background:var(--surface-3)}
.btn-copy.icon-only{width:34px;min-height:34px;padding:0}
.no-pdf{font-size:13px;color:var(--faint);font-weight:600}

/* ---------- Lista (tabla) ---------- */
.results-grid.list-view{display:block;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);overflow-x:auto;box-shadow:var(--shadow-sm)}
.dc-table{width:100%;border-collapse:separate;border-spacing:0;min-width:1060px}
.dc-table th{position:sticky;top:0;z-index:1;background:var(--surface-2);color:var(--muted);text-align:left;padding:11px 12px;font-size:11.5px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;border-bottom:1px solid var(--line);white-space:nowrap}
.dc-table th.sorted{color:var(--brand-ink)}
.dc-table td{padding:11px 12px;border-bottom:1px solid var(--line);vertical-align:middle;font-size:14px;color:var(--ink-2)}
.dc-table tbody tr{transition:background-color .12s var(--ease)}
.dc-table tbody tr:hover{background:var(--surface-2)}
.dc-table tr:last-child td{border-bottom:0}
.dc-table tr.selected-row{background:color-mix(in srgb,var(--brand-soft) 70%,transparent)}
.dc-table tr.selected-row td:first-child{box-shadow:inset 3px 0 0 var(--brand)}
.col-sel{width:52px}
.col-code{font-weight:700;color:var(--brand-ink);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:13.5px}
.col-grade{font-variant-numeric:tabular-nums;text-align:center}
.table-cargo{font-weight:700;color:var(--ink);min-width:220px;max-width:340px;font-size:14.5px}
.table-sort{appearance:none;border:0;background:transparent;color:inherit;font:inherit;font-weight:inherit;text-transform:inherit;letter-spacing:inherit;padding:2px 0;display:inline-flex;align-items:center;gap:5px;cursor:pointer}
.table-sort:hover{color:var(--brand-ink)}
.table-sort .sort-ico{width:14px;height:14px;opacity:.45}
th.sorted .table-sort .sort-ico{opacity:1}
.structure-cell{display:grid;gap:3px;min-width:240px}
.structure-cell span{display:grid;grid-template-columns:88px minmax(0,1fr);gap:6px;align-items:baseline}
.structure-cell small{color:var(--muted);font-size:11.5px;font-weight:600}
.structure-cell strong{color:var(--ink-2);font-size:13.5px;font-weight:600}
.table-actions{display:flex;gap:6px;align-items:center}
.table-actions .btn-doc{min-height:34px;padding:6px 10px;font-size:13px}

/* ---------- Barra de selección ---------- */
.selection-bar{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);z-index:30;width:min(820px,calc(100% - 24px));background:#0f2f45;color:#fff;border-radius:var(--r-lg);padding:11px 12px 11px 14px;box-shadow:var(--shadow-lg);display:flex;justify-content:space-between;align-items:center;gap:14px;animation:rise .22s var(--ease)}

@keyframes rise{from{opacity:0;transform:translate(-50%,12px)}}
.selection-info{display:flex;align-items:center;gap:11px;min-width:0}
.selection-dot{width:32px;height:32px;border-radius:50%;background:var(--cyan);display:grid;place-items:center;flex:0 0 auto}
.selection-dot .i{width:17px;height:17px;stroke-width:2.4}
.selection-info div{display:grid;gap:1px;min-width:0}
.selection-info strong{font-size:15px}
.selection-info span{font-size:12.5px;opacity:.78}
.selection-actions{display:flex;gap:8px;flex:0 0 auto}
.selection-bar .btn-report{background:#fff;color:#a51f30;border-color:#fff}
.selection-bar .btn-report:hover:not(:disabled){background:#ffeef0}

/* ---------- Filtro (modal / hoja) ---------- */
.sheet-backdrop{position:fixed;inset:0;background:var(--backdrop);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);z-index:50;animation:fade .18s var(--ease)}
@keyframes fade{from{opacity:0}}
.filter-sheet{position:fixed;z-index:51;left:50%;top:50%;transform:translate(-50%,-50%);width:min(560px,calc(100vw - 24px));max-height:min(720px,calc(100vh - 32px));background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);box-shadow:var(--shadow-lg);display:flex;flex-direction:column;overflow:hidden;animation:pop .2s var(--ease)}
@keyframes pop{from{opacity:0;transform:translate(-50%,-48%) scale(.98)}}
.filter-sheet-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 18px 14px 20px;border-bottom:1px solid var(--line)}
.filter-sheet-head h2{margin:3px 0 0;font-size:21px;letter-spacing:-.015em}
.sheet-hint{margin:2px 0 0;font-size:13px;color:var(--muted)}
.filter-search{padding:14px 18px 0;display:grid;gap:6px}
.filter-search .input-wrap{display:block}
.filter-search .input-icon{left:12px}
.filter-search input{width:100%;border:1px solid var(--line-strong);background:var(--surface-2);border-radius:var(--r);padding:11px 12px 11px 38px;outline:none;font-size:15px}
.filter-search input:focus{border-color:var(--brand);background:var(--surface);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 16%,transparent)}
.filter-search small{color:var(--muted);font-size:12.5px}
.filter-options{padding:12px 14px 14px;overflow:auto;display:grid;gap:4px;align-content:start;flex:1;min-height:120px;overscroll-behavior:contain}
.filter-option{display:flex;align-items:center;gap:11px;border:1px solid transparent;background:transparent;border-radius:10px;padding:10px 10px;color:var(--ink);text-align:left;transition:background-color .12s var(--ease),border-color .12s var(--ease)}
.filter-option:hover{background:var(--surface-2)}
.filter-option span{flex:1;min-width:0;font-weight:600;font-size:14.5px;overflow-wrap:anywhere}
.filter-option small{font-size:12px;font-weight:700;color:var(--muted);background:var(--surface-3);border-radius:999px;padding:2px 8px;font-variant-numeric:tabular-nums}
.opt-box{width:20px;height:20px;border-radius:6px;border:1.5px solid var(--line-strong);display:grid;place-items:center;flex:0 0 auto;color:transparent;transition:background-color .12s var(--ease),border-color .12s var(--ease)}
.opt-box .i{width:14px;height:14px;stroke-width:3}
.filter-option.selected{background:var(--brand-soft);border-color:color-mix(in srgb,var(--brand) 30%,transparent)}
.filter-option.selected span{color:var(--brand-ink)}
.filter-option.selected .opt-box{background:var(--brand);border-color:var(--brand);color:#fff}
.filter-sheet-actions{padding:12px 18px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:8px;background:var(--surface-2)}

/* ---------- Toast y pie ---------- */
.toast{position:fixed;right:20px;bottom:20px;z-index:80;background:var(--ink);color:var(--surface);border-radius:var(--r);padding:11px 15px;box-shadow:var(--shadow-lg);max-width:360px;font-weight:650;font-size:14.5px;animation:rise-r .2s var(--ease)}
@keyframes rise-r{from{opacity:0;transform:translateY(8px)}}
.site-footer{border-top:1px solid var(--line);background:var(--surface);color:var(--muted);display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;padding:18px 20px;font-size:13px}
.site-footer i{font-style:normal;color:var(--faint)}
.footer-mark{width:22px;height:22px;object-fit:contain}

/* ---------- Adaptación ---------- */
@media (max-width:1180px){
  .filters-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:760px){
  body{font-size:15px}
  .header-inner{padding:14px 16px 16px;gap:10px;flex-direction:column;align-items:flex-start}
  .hide-sm{display:none}
  .brand-logos{gap:10px;padding:4px 2px}
  .logo-hra{width:36px;height:47px}
  .logo-do{width:48px;height:46px}
  .brand-divider{height:38px}
  .eyebrow{font-size:10.5px;letter-spacing:.08em}
  .brand-copy h1{font-size:23px}
  .lede{font-size:13.5px}
  .page-shell{padding:14px 12px 130px}
  .search-card{padding:12px;border-radius:var(--r-lg)}
  .search-row{gap:6px}
  .btn-search{min-width:0;width:56px;padding:0}
  .btn-search span{display:none}
  .btn-search .i{width:22px;height:22px}
  .query-control input{font-size:16px}
  .updated-info{font-size:12px}
  .filters-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .filter-trigger{min-height:50px;padding:6px 9px 6px 11px}
  .filter-trigger strong{font-size:13.5px}
  .search-foot{margin-top:10px}
  .search-foot-right{margin-left:0;width:100%;justify-content:space-between}
  .results-section{margin-top:20px}
  .results-toolbar{align-items:stretch;flex-direction:column}
  .toolbar-controls{display:grid;grid-template-columns:1fr auto;align-items:end}
  .compact-select select{min-width:0;width:100%}
  .toolbar-controls .btn-report{grid-column:1/-1;width:100%}
  .view-toggle button span{display:none}
  .view-toggle button{padding:7px 10px}
  .results-grid{grid-template-columns:1fr}
  .pager{flex-direction:column;align-items:stretch;padding:8px 10px}
  .pager-nav{justify-content:space-between}
  .pager-nav button span{display:none}
  .pager-nav button{width:40px;justify-content:center;padding:0}
  .dc-table{min-width:940px}
  .dc-structure div{grid-template-columns:96px minmax(0,1fr)}
  .selection-bar{bottom:calc(10px + env(safe-area-inset-bottom,0px));gap:10px;padding:9px 9px 9px 11px}
  .selection-info div span{display:none}
  .selection-info strong{white-space:nowrap}
  .selection-info{gap:9px}
  .selection-dot{width:28px;height:28px}
  .selection-bar{flex-wrap:wrap}
  .selection-info{flex:1}
  .selection-actions{display:contents}
  .selection-actions .btn-ghost-light{padding:7px 12px;font-size:13.5px}
  .selection-actions .btn-report{flex-basis:100%;min-height:42px}
  .filter-sheet{top:auto;bottom:0;left:0;right:0;transform:none;width:100%;max-height:86vh;border-radius:var(--r-xl) var(--r-xl) 0 0;border-bottom:0;animation:sheet-up .24s var(--ease)}
  .filter-sheet-actions{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .filter-sheet-actions .btn{flex:1}
  .toast{left:12px;right:12px;bottom:auto;top:12px;max-width:none;text-align:center}
}
@keyframes sheet-up{from{transform:translateY(30px);opacity:.3}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.001ms!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}
@media print{.site-header,.search-card,.results-section,.selection-bar,.sheet-backdrop,.filter-sheet,.toast,.site-footer,.skip-link{display:none!important}}


/* ---------- Header institucional compartido con do-hra.cl · RC30 ---------- */
.site-header .icon{width:24px;height:24px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.site-header .icon-sm{width:18px;height:18px}
:root{--public-header-h:72px}
.site-header{position:sticky;top:0;z-index:100;background:rgba(255,255,255,.97);border-bottom:1px solid transparent;transition:border-color .2s var(--ease),box-shadow .2s var(--ease)}
.site-header::after{display:none}
.site-header.is-scrolled{border-bottom-color:var(--line);box-shadow:0 6px 20px -16px rgba(11,47,79,.35)}
.public-header-container{width:100%;max-width:1280px;margin:0 auto;padding-left:20px;padding-right:20px}
.site-header .header-inner{height:var(--public-header-h);display:flex;align-items:center;gap:20px;padding-top:0;padding-bottom:0}
.site-header .brand{display:flex;align-items:center;gap:14px;text-decoration:none;color:#0b2f4f;flex:0 0 auto;border-radius:10px}
.site-header .brand-logos{display:flex;align-items:center;gap:12px;padding:0}
.site-header .brand-logos img{width:auto;object-fit:contain;display:block;height:48px}
.site-header .brand-logos .logo-hra{height:46px;width:auto}
.site-header .brand-sep{width:1px;height:36px;background:#cddbe4}
.site-header .brand-text{display:none;line-height:1.2}
.site-header .brand-text strong{display:block;font-size:.9875rem;font-weight:800;letter-spacing:-.01em}
.site-header .brand-text span{display:block;font-size:.8125rem;color:#5a6d7c;font-weight:500}
.site-header .main-nav{margin-left:auto;display:none}
.site-header .main-nav ul{list-style:none;display:flex;align-items:center;gap:2px;margin:0;padding:0}
.site-header .main-nav a{display:block;padding:9px 12px;border-radius:9px;color:#35495a;font-weight:600;font-size:.96875rem;text-decoration:none;transition:color .15s var(--ease),background-color .15s var(--ease)}
.site-header .main-nav a:hover{color:#0c416f;background:#f3f9fc}
.site-header .main-nav a[aria-current="page"]{color:#0b5a96;background:#e7f3f9}
.site-header .header-cta{display:none;min-height:42px;padding:9px 16px;font-size:.9375rem;border-radius:10px;background:#fff;color:#0c416f;border-color:#cddbe4;box-shadow:none}
.site-header .header-cta:hover{border-color:#0b5a96;color:#0c416f;background:#f3f9fc}
.site-header .nav-toggle{margin-left:auto;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:48px;height:46px;padding:0 14px;border:1px solid #cddbe4;border-radius:12px;background:#fff;color:#0b2f4f;font:inherit;font-weight:700;font-size:.9375rem;cursor:pointer}
.site-header .nav-toggle .icon-close{display:none}
.site-header .nav-toggle[aria-expanded="true"] .icon-open{display:none}
.site-header .nav-toggle[aria-expanded="true"] .icon-close{display:inline-block}
.site-header .mobile-nav{position:fixed;inset:var(--public-header-h) 0 0 0;z-index:99;background:#fff;border-top:1px solid #e1e9ef;overflow-y:auto;padding:12px 20px calc(32px + env(safe-area-inset-bottom,0px))}
.site-header .mobile-nav ul{list-style:none;display:grid;gap:2px;margin:0;padding:0}
.site-header .mobile-nav a:not(.btn){display:flex;align-items:center;justify-content:space-between;min-height:56px;padding:0 6px;border-bottom:1px solid #e1e9ef;color:#0b2f4f;font-weight:700;font-size:1.1875rem;text-decoration:none}
.site-header .mobile-nav a[aria-current="page"]{color:#0b5a96}
.site-header .mobile-agenda{margin-top:22px;width:100%;min-height:50px;font-size:1rem;border-radius:12px}
.site-header .mobile-nav-meta{margin:22px 0 0;font-size:.9375rem;color:#5a6d7c}
.nav-open{overflow:hidden}
@media (min-width:480px){
  .public-header-container{padding-left:28px;padding-right:28px}
  .site-header .brand-logos img{height:52px}.site-header .brand-logos .logo-hra{height:50px}
}
@media (min-width:1080px){
  :root{--public-header-h:84px}
  .public-header-container{padding-left:40px;padding-right:40px}
  .site-header .nav-toggle,.site-header .mobile-nav{display:none!important}
  .site-header .main-nav{display:block}
  .site-header .brand-logos img{height:58px}.site-header .brand-logos .logo-hra{height:56px}
  .site-header .brand-sep{height:44px}
}
@media (min-width:1320px){.site-header .brand-text{display:block}.site-header .header-cta{display:inline-flex}}

/* ---------- Optimización móvil · RC32 ---------- */
/* Título de página: oculto visualmente en escritorio (se conserva para lectores de pantalla), visible en móvil. */
.dc-intro{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.dc-intro h1{margin:0}
/* El header compartido siempre en una fila (anula la regla antigua de columna en móvil) */
.site-header .header-inner{flex-direction:row;align-items:center;max-width:1280px}
@media (max-width:760px){
  .site-header .header-inner{flex-direction:row!important;align-items:center!important;gap:12px;padding-top:0!important;padding-bottom:0!important}
  .site-header .public-header-container{padding-left:20px!important;padding-right:20px!important}
  .site-header .nav-toggle{height:44px;padding:0 12px}
  .page-shell{padding:18px 16px 140px}
  .dc-intro{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;margin:0 2px 14px}
  .dc-intro-eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:11.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--brand-ink)}
  .dc-intro-eyebrow::before{content:"";width:18px;height:2px;border-radius:2px;background:currentColor}
  .dc-intro h1{margin:6px 0 4px;font-size:clamp(25px,6.9vw,31px);line-height:1.1;letter-spacing:-.025em;color:var(--ink);font-weight:800}
  .dc-intro p{margin:0;font-size:14.5px;color:var(--muted);line-height:1.5}
  .search-card{padding:12px;border-radius:var(--r-lg)}
  .query-control{min-height:56px;padding:7px 12px 5px}
  .btn-search{width:54px}
  .filters-grid{gap:6px;margin-top:8px}
  .filter-trigger{min-height:48px;padding:6px 9px 6px 11px;border-radius:11px}
  .filter-trigger small{font-size:10.5px}
  .search-foot{gap:10px;margin-top:10px}
  .search-foot-right{flex-wrap:wrap;gap:8px 12px}
  .updated-info{flex:1 1 100%;order:2;font-size:12px}
  .search-foot-right .btn{order:1;width:100%;min-height:42px}
  .results-heading h2{font-size:20px}
  .result-count{gap:4px 12px;font-size:13.5px}
  .tallies{gap:4px 10px}
  .toolbar-controls{gap:8px}
  .compact-select>span{font-size:10.5px}
  .compact-select select{min-height:44px}
  .view-toggle button{min-height:38px;min-width:44px;justify-content:center}
  .toolbar-controls .btn-report{min-height:46px}
  .pager{gap:8px;padding:8px 10px}
  .pager label{font-size:13px}
  .pager-nav button{width:44px;height:40px}
  .results-grid{gap:10px}
  .dc-card{padding:14px 14px 12px}
  .dc-card h3{font-size:16.5px}
  .dc-structure div{grid-template-columns:92px minmax(0,1fr);gap:6px}
  .dc-actions{gap:8px;flex-wrap:wrap}
  .dc-actions .btn-doc{flex:1 1 auto;min-height:42px}
  .dc-actions .btn-copy{flex:1 1 auto;min-height:42px}
  .select-btn{width:40px;height:40px;border-radius:11px}
  .site-footer{padding:18px 16px calc(18px + env(safe-area-inset-bottom,0px));text-align:center;line-height:1.5}
}
@media (max-width:380px){
  .site-header .public-header-container{padding-left:16px!important;padding-right:16px!important}
  .site-header .brand-logos{gap:9px}
  .site-header .brand-logos img{height:44px}.site-header .brand-logos .logo-hra{height:42px}
  .site-header .brand-sep{height:30px}
  .page-shell{padding-left:12px;padding-right:12px}
  .dc-structure div{grid-template-columns:1fr;gap:0}
  .dc-structure dt{font-size:11.5px;text-transform:uppercase;letter-spacing:.05em}
}
/* Capas: el filtro y su fondo quedan sobre el header compartido */
.sheet-backdrop{z-index:150}
.filter-sheet{z-index:151}
.toast{z-index:160}
.site-header .mobile-agenda,.site-header .header-cta{text-decoration:none}
