/* ==========================================================================
   PatitasFind · Documentos legales (Términos y Aviso de Privacidad)
   Estilo compartido — marca PatitasFind (Baloo 2, teal / lila / violeta)
   ========================================================================== */

:root {
  --teal: #33C7BE;
  --teal-dark: #1E8F88;
  --lila: #DCC7FA;
  --violet: #8E66D9;
  --violet-ink: #5E3BA6;      /* violeta oscurecido para texto/enlaces (contraste AA) */
  --ink: #1D2233;
  --ink-soft: #3B4157;
  --muted: #5A607A;
  --paper: #FFFFFF;
  --mint: #E8F8F6;
  --peach: #F6D9C4;
  --warn-bg: #FFF4D6;
  --warn-border: #1D2233;
  --radius: 22px;
  --radius-sm: 14px;
  --border: 2px solid var(--ink);
  --shadow: 0 4px 0 var(--ink);
  --bg: linear-gradient(165deg, #E8F8F6 0%, #EBDFFC 42%, #DCC7FA 72%, #F6D9C4 100%);
  --font: 'Baloo 2', ui-rounded, 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17.5px;
  font-weight: 400;
  line-height: 1.68;
  color: var(--ink);
  background-color: #EBDFFC;
  background-image: var(--bg);
  background-attachment: fixed;
  overflow-wrap: break-word;
}

a { color: var(--violet-ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ink); text-decoration-color: var(--teal); }
a:focus-visible,
summary:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 12px; font-weight: 700;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Cabecera ---------- */
.site-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 26px; letter-spacing: -0.3px;
}
.brand-badge {
  width: 46px; height: 46px; display: grid; place-items: center;
  background: var(--teal); border: var(--border); border-radius: 15px; box-shadow: var(--shadow);
}
.brand-badge svg { width: 30px; height: 30px; fill: var(--ink); }
.brand span b { color: var(--violet-ink); font-weight: 800; }
.header-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: var(--border); border-radius: 999px; background: var(--paper);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; box-shadow: 0 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.pill:hover { transform: translateY(1px); box-shadow: 0 2px 0 var(--ink); color: var(--ink); }
.pill.primary { background: var(--teal); }

/* ---------- Estructura ---------- */
.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 16px 64px;
  display: grid;
  grid-template-columns: 290px minmax(0, 760px);
  gap: 28px;
  justify-content: center;
  align-items: start;
}

.card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Índice (TOC) ---------- */
.toc {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 16px 14px 16px 16px;
  font-size: 15px;
  line-height: 1.35;
  scrollbar-width: thin;
}
.toc summary {
  cursor: pointer; list-style: none; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "▾"; font-size: 16px; transition: transform .15s ease; }
.toc details:not([open]) summary::after { transform: rotate(-90deg); }
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: none; }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 5px 8px; border-radius: 10px; color: var(--ink-soft); text-decoration: none; font-weight: 600;
}
.toc a:hover { background: var(--mint); color: var(--ink); }
.toc a .n { display: inline-block; min-width: 26px; color: var(--violet-ink); font-weight: 800; }
.toc .toc-sub a { padding-left: 34px; font-weight: 500; font-size: 14px; }
.toc .toc-cross { margin-top: 12px; padding-top: 10px; border-top: 2px dashed var(--lila); font-size: 14px; }

/* ---------- Documento ---------- */
.doc { min-width: 0; }
.doc-hero { padding: 26px 26px 22px; margin-bottom: 20px; }
.doc-hero .eyebrow {
  display: inline-block; background: var(--lila); border: var(--border); border-radius: 999px;
  padding: 2px 12px; font-weight: 800; font-size: 14px; letter-spacing: .3px; text-transform: uppercase;
}
.doc-hero h1 { margin: 12px 0 6px; font-size: clamp(30px, 5vw, 42px); line-height: 1.08; font-weight: 800; letter-spacing: -0.5px; }
.doc-hero .lead { margin: 8px 0 0; font-size: 18.5px; color: var(--ink-soft); }
.meta {
  display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 15px;
}
.meta li { background: var(--mint); border: 2px solid var(--ink); border-radius: 12px; padding: 3px 10px; font-weight: 600; }

.ai-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--warn-bg); border: 2px solid var(--warn-border); border-radius: var(--radius-sm);
  box-shadow: 0 3px 0 var(--ink); padding: 12px 14px; margin: 18px 0 0; font-weight: 700; line-height: 1.45;
}
.ai-note .ico { font-size: 22px; line-height: 1; flex-shrink: 0; }

.section { padding: 24px 26px 18px; margin-bottom: 20px; scroll-margin-top: 16px; }
.section h2 {
  margin: 0 0 12px; font-size: clamp(23px, 3.4vw, 28px); line-height: 1.18; font-weight: 800; letter-spacing: -0.2px;
  display: flex; gap: 12px; align-items: flex-start;
}
.section h2 .num {
  flex-shrink: 0; display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px;
  background: var(--teal); border: var(--border); border-radius: 12px; font-size: 19px; box-shadow: 0 2px 0 var(--ink);
}
.section h3 { margin: 22px 0 8px; font-size: 20.5px; line-height: 1.25; font-weight: 800; scroll-margin-top: 16px; }
.section h4 { margin: 16px 0 6px; font-size: 18px; font-weight: 800; }
.section p { margin: 0 0 12px; }
.section ul, .section ol { margin: 0 0 14px; padding-left: 24px; }
.section li { margin: 4px 0; }
.section li::marker { color: var(--violet-ink); font-weight: 800; }
.section ol.alpha { list-style: lower-alpha; }
.section ol.roman { list-style: upper-roman; }
strong, b { font-weight: 700; }

.ph {
  background: #FFE7A3; border: 1.5px dashed #9A6B00; border-radius: 6px; padding: 0 4px;
  font-weight: 700; font-size: .95em; white-space: normal;
}

.callout {
  border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: 12px 14px; margin: 14px 0;
  background: var(--mint);
}
.callout.lila { background: #F3EBFE; }
.callout.peach { background: #FDEEE3; }
.callout.danger { background: #FFE3E3; }
.callout > :last-child { margin-bottom: 0; }
.callout-title { display: block; font-weight: 800; margin-bottom: 4px; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 10px 0 4px; }
.summary-grid .tile { border: 2px solid var(--ink); border-radius: 16px; padding: 10px 12px; background: #fff; }
.summary-grid .tile b { display: block; font-size: 16px; margin-bottom: 2px; }
.summary-grid .tile span { font-size: 15.5px; color: var(--ink-soft); line-height: 1.45; display: block; }

.table-wrap { width: 100%; overflow-x: auto; margin: 10px 0 16px; border: 2px solid var(--ink); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; min-width: 560px; }
th, td { text-align: left; vertical-align: top; padding: 9px 11px; border-bottom: 1.5px solid #D9D3E8; }
th { background: var(--lila); font-weight: 800; border-bottom: 2px solid var(--ink); }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: #FAF8FE; }
td code, p code, li code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: #F1ECFA; padding: 1px 5px; border-radius: 6px; }

.simplified {
  border: 2px solid var(--ink); border-radius: var(--radius-sm); background: #F7FFFE; padding: 14px 16px; margin: 6px 0 14px;
}
.simplified p:last-child { margin-bottom: 0; }

.signature { font-size: 15px; color: var(--muted); }
.legal-refs { font-size: 15px; color: var(--ink-soft); }

.doc-footer { padding: 18px 22px; font-size: 15px; display: flex; gap: 10px 18px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.doc-footer nav { display: flex; gap: 8px; flex-wrap: wrap; }

.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 20;
  width: 48px; height: 48px; display: grid; place-items: center; text-decoration: none;
  background: var(--teal); color: var(--ink); border: var(--border); border-radius: 16px; box-shadow: var(--shadow);
  font-weight: 800; font-size: 20px;
}
.to-top:hover { color: var(--ink); transform: translateY(1px); box-shadow: 0 3px 0 var(--ink); }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 760px); gap: 18px; }
  .toc { position: static; max-height: none; }
}
@media (max-width: 560px) {
  body { font-size: 16.5px; line-height: 1.65; }
  .brand { font-size: 22px; }
  .brand-badge { width: 40px; height: 40px; }
  .doc-hero, .section { padding: 18px 16px 14px; }
  .section h2 .num { min-width: 34px; height: 34px; font-size: 16px; }
  .header-nav .pill { font-size: 14px; padding: 6px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pill, .to-top { transition: none; }
}

/* ---------- Impresión ---------- */
@media print {
  @page { margin: 18mm 16mm; }
  body { background: #fff !important; color: #000; font-size: 10.5pt; line-height: 1.45; }
  .site-header .header-nav, .toc, .to-top, .skip-link, .doc-footer nav { display: none !important; }
  .site-header { padding: 0 0 8px; border-bottom: 1px solid #000; margin-bottom: 10px; }
  .brand-badge { box-shadow: none; background: #fff; }
  .shell { display: block; padding: 0; max-width: none; }
  .card, .section, .doc-hero { box-shadow: none !important; border: 0 !important; border-radius: 0; padding: 0 0 6px; margin: 0 0 10px; background: #fff; }
  .section h2 { page-break-after: avoid; break-after: avoid; font-size: 15pt; }
  .section h2 .num { box-shadow: none; background: #fff; border: 1px solid #000; height: auto; }
  .section h3, .section h4 { page-break-after: avoid; break-after: avoid; }
  .callout, .simplified, .ai-note, .summary-grid .tile { box-shadow: none; border: 1px solid #000; background: #fff !important; page-break-inside: avoid; break-inside: avoid; }
  .table-wrap { overflow: visible; border: 1px solid #000; }
  table { min-width: 0; font-size: 9pt; }
  th { background: #eee !important; }
  tr, td, th { page-break-inside: avoid; break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
  .section a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8.5pt; word-break: break-all; }
  .ph { background: #fff; border: 1px dashed #000; }
  .meta li { border: 1px solid #000; background: #fff; }
}

/* ==========================================================================
   Centro legal y de transparencia · componentes nuevos (2026-10-17)
   Tarjeta «Lo esencial», hub, acciones rápidas, insignias, bloques de
   identidad, zonas de formularios y tableros (los llena app/legal/js/*.js),
   listas de verificación, glosario, preguntas frecuentes y pie compartido.
   ========================================================================== */

/* ---------- Tarjeta «Lo esencial» ---------- */
#esencial ul { margin: 6px 0 0; padding-left: 22px; }
#esencial li { margin: 5px 0; }
#esencial li::marker { color: var(--violet-ink); font-weight: 800; }
.esencial-nota { margin: 10px 0 0; font-size: 14.5px; color: var(--ink-soft); }

/* ---------- Acciones rápidas (Reportar, ARCO, Quejas) ---------- */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 18px 0 0; }
.action {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  background: var(--paper); color: var(--ink); text-decoration: none;
  border: var(--border); border-radius: var(--radius-sm); box-shadow: 0 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.action:hover { color: var(--ink); transform: translateY(1px); box-shadow: 0 2px 0 var(--ink); }
.action b { display: block; font-size: 17px; line-height: 1.25; }
.action small { display: block; font-size: 14.5px; line-height: 1.4; color: var(--ink-soft); margin-top: 2px; }
.action-ico { font-size: 22px; line-height: 1.2; flex-shrink: 0; }
.action.report { background: #FFE9E9; }
.action.arco { background: var(--mint); }
.action.quejas { background: #F3EBFE; }

/* ---------- Hub: tarjetas por tema y por rol ---------- */
.hub-version { margin: 4px 0 10px; font-size: 15px; color: var(--ink-soft); }
.hub-grid { list-style: none; margin: 10px 0 6px; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hub-grid > li { margin: 0 !important; }
.hub-grid > li::marker { content: none; }
.hub-card {
  height: 100%; padding: 12px 13px; background: #fff; border: 2px solid var(--ink); border-radius: 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.hub-card a { font-weight: 800; font-size: 16.5px; line-height: 1.3; }
.hub-card p { margin: 0 !important; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.hub-card .badge { align-self: flex-start; margin-top: 4px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 10px 0 4px; }
.role { border: 2px solid var(--ink); border-radius: 16px; padding: 10px 12px; background: #FAF8FE; }
.role h3 { margin: 0 0 6px !important; font-size: 17px !important; }
.role ul { margin: 0 !important; padding-left: 18px !important; font-size: 15.5px; }

/* ---------- Insignias de estado ---------- */
.badge {
  display: inline-block; padding: 1px 9px; border: 1.5px solid var(--ink); border-radius: 999px;
  font-size: 13px; font-weight: 800; line-height: 1.5; background: #fff; white-space: nowrap; vertical-align: middle;
}
.badge.ok { background: #D9F5EF; }
.badge.pend { background: #FFF4D6; }
.badge.warn { background: #FFE3E3; }
.badge.info { background: #EBDFFC; }

/* ---------- Datos de identidad y contacto ---------- */
.kv { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: 0; margin: 10px 0 16px; border: 2px solid var(--ink); border-radius: var(--radius-sm); overflow: hidden; }
.kv dt, .kv dd { margin: 0; padding: 9px 12px; border-bottom: 1.5px solid #D9D3E8; }
.kv dt { font-weight: 800; background: #F3EBFE; }
.kv dd { background: #fff; overflow-wrap: anywhere; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.id-block { border: 2px dashed var(--violet-ink); border-radius: var(--radius-sm); padding: 10px 14px; margin: 10px 0 14px; background: #FCFAFF; font-size: 15.5px; }
.id-block p { margin: 0 !important; }

/* ---------- Zonas donde los scripts montan formularios y tableros ---------- */
.mount { margin: 12px 0 16px; padding: 14px; border: 2px dashed var(--teal-dark); border-radius: var(--radius-sm); background: #F7FFFE; min-height: 72px; }
.mount > div:empty::before { content: "Cargando…"; color: var(--muted); font-weight: 600; }
.mount noscript p { margin: 0; }
.mount + .mount { margin-top: 8px; }

/* ---------- Tablas ---------- */
.table-wrap caption { caption-side: top; text-align: left; padding: 9px 11px; font-weight: 800; background: #F3EBFE; border-bottom: 2px solid var(--ink); }
table.compact { min-width: 480px; }
tbody th[scope="row"] { background: #FCFAFF; font-weight: 800; border-bottom: 1.5px solid #D9D3E8; }
td a, th a { overflow-wrap: anywhere; }

/* ---------- Listas de verificación ---------- */
.checklist { list-style: none; padding-left: 0 !important; }
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before { content: "✓"; position: absolute; left: 4px; top: 0; font-weight: 800; color: var(--teal-dark); }
.checklist.no li::before { content: "✕"; color: #B42318; }

/* ---------- Glosario y preguntas frecuentes ---------- */
.glossary { margin: 6px 0 14px; }
.glossary dt { font-weight: 800; margin-top: 12px; }
.glossary dd { margin: 2px 0 0 0; padding-left: 14px; border-left: 3px solid var(--lila); }
.faq details { border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: 10px 14px; margin: 10px 0; background: #fff; }
.faq summary { cursor: pointer; font-weight: 800; }
.faq details[open] summary { margin-bottom: 6px; }
.faq details > :last-child { margin-bottom: 0; }

/* ---------- Pie compartido ---------- */
.doc-footer .footer-id { order: 3; flex: 1 1 100%; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.doc-footer [data-cookie-prefs] {
  display: inline-flex; align-items: center; padding: 7px 14px; border: var(--border); border-radius: 999px;
  background: var(--mint); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; box-shadow: 0 3px 0 var(--ink);
}
.doc-footer [data-cookie-prefs]:hover { color: var(--ink); box-shadow: 0 2px 0 var(--ink); }

@media (max-width: 560px) {
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 2px; }
  .quick-actions { grid-template-columns: 1fr; }
  .hub-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .action { transition: none; }
}

@media print {
  .quick-actions, .mount.form, .doc-footer [data-cookie-prefs] { display: none !important; }
  .mount { border: 1px solid #000; background: #fff; min-height: 0; }
  .hub-card, .role, .kv, .id-block, .faq details { box-shadow: none; border: 1px solid #000; background: #fff !important; break-inside: avoid; }
  .faq details > * { display: block; }
  .badge { border: 1px solid #000; background: #fff !important; }
}

/* ---------- Registro de versiones (js/historial.js) ---------- */
.hv-intro { margin: 0 0 10px; font-weight: 600; color: var(--ink-soft); }
.hv-doc { border: 2px solid var(--ink); border-radius: var(--radius-sm); background: #fff; margin: 0 0 10px; padding: 10px 12px; }
.hv-doc > summary { cursor: pointer; font-size: 16.5px; line-height: 1.35; }
.hv-doc[open] > summary { margin-bottom: 8px; }
.hv-sum-ver { color: var(--muted); font-weight: 700; }
.hv-version { margin: 8px 0; }
.hv-head { margin: 0 0 6px; }
.hv-kv { margin: 6px 0 10px; }
code.sha256 { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; overflow-wrap: anywhere; word-break: break-all; background: #F3EBFE; border-radius: 6px; padding: 1px 5px; }
.hv-table td { font-size: 14px; }
.hv-table td:nth-child(6) { min-width: 180px; }
@media print {
  .hv-doc { border: 1px solid #000; }
  .hv-doc:not([open]) > :not(summary) { display: block; }
  code.sha256 { background: none; }
}

/* ==========================================================================
   Centro de solicitudes (js/solicitudes.js) e informe de transparencia
   (js/transparencia.js) · formularios, acuse con folio, seguimiento y tableros
   ========================================================================== */

/* ---------- Formularios de solicitudes ---------- */
.sol-form, .sol-track { display: grid; gap: 14px; }
.sol-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.sol-field { display: grid; gap: 4px; min-width: 0; }
.sol-field label, .sol-form legend, .sol-track label { font-weight: 800; font-size: 16px; line-height: 1.35; }
.sol-form input[type="text"], .sol-form input[type="email"], .sol-form input[type="tel"], .sol-form input[type="url"],
.sol-form input:not([type]), .sol-form select, .sol-form textarea, .sol-track input, .tr-controls select {
  width: 100%; max-width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: var(--border); border-radius: 12px; padding: 9px 12px; min-height: 44px;
}
.sol-form textarea { resize: vertical; min-height: 110px; }
.sol-form input[readonly] { background: var(--mint); }
.sol-form input:focus-visible, .sol-form select:focus-visible, .sol-form textarea:focus-visible, .sol-track input:focus-visible,
.sol-check input:focus-visible, .sol-btn:focus-visible, .tr-btn:focus-visible, .tr-controls select:focus-visible {
  outline: 3px solid var(--teal); outline-offset: 2px;
}
.sol-form fieldset { border: 2px dashed var(--lila); border-radius: var(--radius-sm); padding: 10px 14px 6px; margin: 0; min-width: 0; }
.sol-form fieldset[hidden], .sol-extra[hidden] { display: none; }
.sol-form legend { padding: 0 6px; }
.sol-check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; font-size: 16px; line-height: 1.45; }
.sol-check input { width: 22px; height: 22px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--teal-dark); }
.sol-check label { font-weight: 600; }
.sol-hint { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); }
.sol-account { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--mint); font-size: 15.5px; }
.sol-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sol-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sol-btn, .tr-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 20px;
  font: inherit; font-weight: 800; font-size: 16px; color: var(--ink); background: var(--teal); border: var(--border);
  border-radius: 999px; box-shadow: 0 3px 0 var(--ink); cursor: pointer;
}
.sol-btn:hover, .tr-btn:hover { transform: translateY(1px); box-shadow: 0 2px 0 var(--ink); }
.sol-btn:disabled { opacity: .6; cursor: progress; transform: none; }
.sol-btn.ghost, .tr-btn { background: #fff; }
.tr-btn { min-height: 36px; padding: 5px 14px; font-size: 14.5px; box-shadow: 0 2px 0 var(--ink); }
.sol-status { margin: 0; padding: 8px 12px; border-radius: 12px; font-weight: 600; font-size: 15.5px; background: #F3EBFE; }
.sol-status.error { background: #FFE3E3; }
.sol-status.ok { background: #D9F5EF; }
.sol-status[hidden] { display: none; }

/* ---------- Acuse, enlaces del correo y seguimiento ---------- */
.sol-ack { border: var(--border); border-radius: var(--radius-sm); background: #F7FFFE; padding: 14px 16px; margin: 0 0 14px; }
.sol-ack.error { background: #FFE3E3; }
.sol-ack:focus { outline: 3px solid var(--teal); outline-offset: 2px; }
.sol-ack ul { margin: 6px 0 10px; padding-left: 22px; }
.sol-ack p { margin: 0 0 8px; }
.sol-ack-title { font-weight: 800; font-size: 18px; margin: 0 0 6px; }
.sol-folio { font-size: 20px; }
.sol-folio strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .5px; background: var(--mint); padding: 2px 8px; border-radius: 8px; overflow-wrap: anywhere; }
.sol-warn { padding: 8px 12px; border-radius: 12px; background: var(--warn-bg); }
.sol-answer { border-left: 4px solid var(--violet); background: #FAF8FE; padding: 8px 12px; border-radius: 0 12px 12px 0; margin: 8px 0 12px; white-space: pre-line; }
.sol-h { margin: 16px 0 6px; font-size: 17.5px; font-weight: 800; }
.sol-tl { list-style: none; margin: 0 0 10px; padding: 0 0 0 16px; border-left: 3px solid var(--lila); }
.sol-tl li { margin: 0 0 8px; position: relative; }
.sol-tl li::before { content: ""; position: absolute; left: -23px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--teal); border: 2px solid #fff; }
.sol-tl-date { display: block; font-size: 14px; color: var(--muted); }
.sol-tl-note { display: block; font-size: 15px; color: var(--ink-soft); white-space: pre-line; }
.sol-result:empty, .sol-mine:empty { display: none; }
.sol-item { border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: 10px 14px; margin: 10px 0; background: #fff; }
.sol-item summary { cursor: pointer; font-size: 16px; overflow-wrap: anywhere; }
.sol-desc { white-space: pre-line; color: var(--ink-soft); }

/* ---------- Informe de transparencia ---------- */
.tr-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.tr-controls label { font-weight: 800; }
.tr-controls select { width: auto; min-width: 210px; }
.tr-meta { font-size: 15px; color: var(--ink-soft); margin: 0 0 10px; }
.tr-h { margin: 22px 0 8px; font-size: 19px; font-weight: 800; }
.tr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.tr-tile, .tr-meter { border: 2px solid var(--ink); border-radius: 14px; background: #fff; padding: 9px 12px; display: grid; gap: 2px; align-content: start; }
.tr-tile-label { font-size: 14.5px; font-weight: 700; color: var(--ink-soft); line-height: 1.3; }
.tr-tile-value { font-size: 22px; font-weight: 800; line-height: 1.2; font-variant-numeric: proportional-nums; overflow-wrap: anywhere; }
.tr-tile-note { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.tr-meter { margin: 0 0 14px; }
.tr-meter-track { display: block; height: 12px; border-radius: 999px; background: #D9F5EF; overflow: hidden; margin-top: 4px; }
.tr-meter-track > span { display: block; height: 100%; width: 0; background: #008C7E; border-radius: 999px; }
table.tr-bars { min-width: 320px; }
.tr-bars td { white-space: nowrap; }
.tr-bar { display: inline-block; vertical-align: middle; width: min(28vw, 240px); height: 12px; margin-right: 8px; }
.tr-bar > span { display: block; height: 100%; width: 0; min-width: 2px; background: #008C7E; border-radius: 0 4px 4px 0; }
.tr-bar-value { font-variant-numeric: tabular-nums; font-weight: 700; }
.tr-sup { font-size: 13.5px; color: var(--muted); font-style: italic; white-space: nowrap; }
.tr-empty { color: var(--muted); font-size: 15.5px; }
.tr-note { padding: 8px 12px; border-radius: 12px; background: #F3EBFE; font-size: 15.5px; }
.tr-note.warn { background: var(--warn-bg); }
table.tr-money { min-width: 980px; }
.tr-money td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-money thead th { text-align: center; position: relative; }  /* contiene a .tr-sr dentro del desplazamiento */
.tr-money thead tr:first-child th[scope="col"] { text-align: left; }
.tr-money .badge { display: inline-block; margin-top: 4px; font-size: 12.5px; }
.tr-sub { display: block; font-weight: 500; font-size: 13.5px; color: var(--muted); }
.tr-others th, .tr-others td { background: #F3EBFE !important; }
.tr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tr-charts { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 6px 0 8px; }
.tr-chart { margin: 0; border: 2px solid var(--ink); border-radius: var(--radius-sm); background: #fff; padding: 10px 10px 4px; min-width: 0; }
.tr-chart figcaption { font-weight: 800; font-size: 15.5px; margin: 0 0 4px; }
.tr-chart svg { display: block; width: 100%; height: auto; }
.tr-grid { stroke: #E7E3F0; stroke-width: 1; }
.tr-baseline { stroke: #B9B3C9; stroke-width: 1; }
.tr-axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.tr-val { fill: var(--ink); font-size: 12.5px; font-weight: 700; font-family: var(--font); }
.tr-hit { fill: transparent; }
.tr-chart g:hover .tr-hit { fill: rgba(142, 102, 217, .08); }
.tr-c1 { fill: #008C7E; }
.tr-c2 { fill: #6A43C2; }
.tr-details { margin: 4px 0 12px; }
.tr-details summary { cursor: pointer; font-weight: 700; }
.tr-detail { margin: 16px 0 0; padding: 14px 16px; border: var(--border); border-radius: var(--radius-sm); background: #FCFAFF; }
.tr-detail:focus { outline: 3px solid var(--teal); outline-offset: 2px; }
.tr-detail[hidden] { display: none; }

@media (min-width: 640px) {
  .sol-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .tr-charts { grid-template-columns: 1fr 1fr; }
}
@media (forced-colors: active) {
  .tr-bar > span, .tr-meter-track > span { background: CanvasText; }
  .tr-c1, .tr-c2 { fill: CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  .sol-btn, .tr-btn { transition: none; }
}
@media print {
  .tr-controls, .sol-actions, .tr-btn { display: none !important; }
  .tr-tile, .tr-meter, .tr-chart, .sol-ack, .sol-item { box-shadow: none; border: 1px solid #000; background: #fff !important; break-inside: avoid; }
}

/* ==========================================================================
   Formularios públicos de reportes, derechos de autor y apelaciones (js/reportes.js)
   ========================================================================== */
.rep-mount { margin: 12px 0 16px; padding: 16px; border: 2px solid var(--ink); border-radius: var(--radius-sm); background: #fff; box-shadow: 0 3px 0 var(--ink); }
.rep-mount + .rep-mount { margin-top: 16px; }
.rep-title { margin: 0 0 4px !important; font-size: 19px !important; }
.rep-form { display: grid; gap: 12px; margin: 10px 0 0; }
.rep-field { display: grid; gap: 4px; min-width: 0; }
.rep-field label, .rep-fieldset legend { font-weight: 800; font-size: 16px; line-height: 1.3; }
.rep-opt { font-weight: 500; color: var(--muted); }
.rep-form input[type="text"], .rep-form input[type="email"], .rep-form input[type="tel"], .rep-form select, .rep-form textarea {
  width: 100%; min-width: 0; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 12px; background: #FCFAFF;
  color: var(--ink); font: inherit; font-size: 16px; line-height: 1.4;
}
.rep-form textarea { resize: vertical; }
.rep-form input:focus-visible, .rep-form select:focus-visible, .rep-form textarea:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rep-fieldset { margin: 0; padding: 8px 12px 10px; border: 2px solid #D9D3E8; border-radius: 12px; }
.rep-check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; }
.rep-check input { flex-shrink: 0; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--violet-ink); }
.rep-check label { font-size: 15.5px; line-height: 1.45; }
.rep-hint { margin: 0 !important; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); }
.rep-note { padding: 8px 12px; border-radius: 12px; background: var(--mint); border: 1.5px solid var(--teal-dark); }
.rep-note.danger, .rep-warning { background: #FFE3E3; border: 1.5px solid #B42318; }
.rep-warning { padding: 10px 12px; border-radius: 12px; font-size: 15px; line-height: 1.45; }
.rep-extra { display: grid; gap: 12px; }
.rep-mount [hidden] { display: none !important; }
.rep-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rep-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 22px;
  border: var(--border); border-radius: 999px; background: var(--teal); color: var(--ink); font: inherit; font-weight: 800;
  font-size: 16.5px; cursor: pointer; box-shadow: 0 3px 0 var(--ink);
}
.rep-btn:hover { transform: translateY(1px); box-shadow: 0 2px 0 var(--ink); }
.rep-btn:disabled { opacity: .6; cursor: progress; transform: none; }
.rep-btn.secondary { background: var(--lila); }
.rep-status { margin: 0 !important; padding: 8px 12px; border-radius: 12px; font-weight: 700; }
.rep-status.is-error { background: #FFE3E3; border: 1.5px solid #B42318; color: #7A1610; }
.rep-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.rep-ack { padding: 14px 16px; border: 2px solid var(--teal-dark); border-radius: var(--radius-sm); background: var(--mint); }
.rep-ack p { margin: 0 0 8px !important; }
.rep-ack-title { font-weight: 800; font-size: 18px; }
.rep-folio strong { font-size: 20px; letter-spacing: .5px; overflow-wrap: anywhere; }
.rep-track { margin-top: 14px; border-top: 2px dashed var(--lila); padding-top: 10px; }
.rep-track summary { cursor: pointer; font-weight: 800; }
.rep-result p { margin: 6px 0 0 !important; }

@media (max-width: 560px) {
  .rep-mount { padding: 12px; }
  .rep-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .rep-btn { transition: none; } }
@media print { .rep-mount { display: none !important; } }

/* ---------- Tabla de conservación en vivo (js/conservacion.js) ---------- */
.ct-meta { margin: 0 0 10px !important; }
.ct-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 0 0 6px; }
.ct-tools label { display: block; font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.ct-tools input, .ct-tools select {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px; background: #fff;
  color: var(--ink); font: inherit; font-size: 16px;
}
.ct-tools input:focus-visible, .ct-tools select:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; }
.ct-table th[scope="row"] { background: transparent; border-bottom: 1.5px solid #D9D3E8; font-weight: 800; }
.ct-table tr[hidden] { display: none; }
@media (max-width: 640px) {
  .ct-wrap { border: 0; overflow: visible; }
  .ct-table { min-width: 0; }
  .ct-table caption { display: block; width: 100%; border: 2px solid var(--ink); border-radius: var(--radius-sm); margin-bottom: 8px; }
  .ct-table thead { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
  .ct-table, .ct-table tbody, .ct-table tr, .ct-table th, .ct-table td { display: block; width: 100%; }
  .ct-table tr { border: 2px solid var(--ink); border-radius: var(--radius-sm); margin: 0 0 10px; background: #fff; overflow: hidden; }
  .ct-table tbody tr:nth-child(even) td { background: #fff; }
  .ct-table th[scope="row"] { background: #F3EBFE; border-bottom: 2px solid var(--ink); }
  .ct-table td { border-bottom: 1.5px solid #D9D3E8; }
  .ct-table td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
}

/* ---------- Tablero de estado (js/estado.js) ---------- */
.es-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; margin: 0 0 12px;
  border: 2px solid var(--ink); border-radius: var(--radius-sm); background: #fff; }
.es-banner .badge { font-size: 15px; padding: 3px 12px; }
.es-banner.es-operativo { background: #EFFBF8; }
.es-banner.es-degradado { background: #FFF9E8; }
.es-banner.es-mantenimiento { background: #F3EBFE; }
.es-banner.es-interrupcion { background: #FFF0F0; }
.es-components { list-style: none; margin: 0 0 14px !important; padding: 0 !important; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.es-component { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px;
  padding: 9px 12px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; margin: 0 !important; }
.es-name { font-weight: 800; }
.es-detail { flex-basis: 100%; margin: 0; }
.es-incidents { list-style: none; margin: 0 0 8px !important; padding: 0 !important; }
.es-incident { padding: 10px 12px; border: 2px solid var(--ink); border-radius: var(--radius-sm); background: #fff; margin: 0 0 8px !important; }
.es-incident p { margin: 0 0 4px !important; }
.es-incident-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media print { .ct-tools { display: none !important; } }
