/* Manual operativo · capa interactiva. Se carga después de legal.css. */
.manual-page { --t: #365ee8; --t-soft: #edf3ff; --t-line: #d8e4ff; --t-ink: #294eaa; }
.manual-page [data-tono="verde"] { --t: #0f9d6b; --t-soft: #e8f7f1; --t-line: #c5ebdc; --t-ink: #0b7550; }
.manual-page [data-tono="violeta"] { --t: #7a5af5; --t-soft: #f0ecff; --t-line: #ddd4ff; --t-ink: #5a3fd1; }
.manual-page [data-tono="ambar"] { --t: #d98a0b; --t-soft: #fff6e3; --t-line: #f6dfaa; --t-ink: #9a6205; }
.manual-page [data-tono="rosa"] { --t: #e0475b; --t-soft: #fff0f2; --t-line: #fbd0d6; --t-ink: #b02a3d; }
.manual-sr { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; position: absolute; width: 1px; }

/* Barra superior */
.manual-toolbar { gap: .6rem; }
.manual-search { gap: .5rem; }
.manual-search > svg { color: #7487a8; flex: 0 0 auto; height: 17px; width: 17px; }
.manual-search kbd { background: #f2f5fb; border: 1px solid #dbe3f0; border-radius: 5px; color: #647089; font: 700 .72rem/1 inherit; padding: .22rem .42rem; }
.manual-search:focus-within kbd { display: none; }
.manual-actions { align-items: center; display: flex; gap: .5rem; margin-left: auto; }
.manual-ghost { align-items: center; background: #fff; border: 1px solid #dbe3f0; border-radius: 9px; color: #294eaa; cursor: pointer; display: inline-flex; font: 700 .82rem/1 inherit; gap: .4rem; padding: .62rem .8rem; transition: background .15s, border-color .15s; }
.manual-ghost:hover { background: #f3f7ff; border-color: #b9ccf7; }
.manual-ghost svg { height: 16px; width: 16px; }
.manual-results { color: #647089; font-size: .82rem; font-weight: 600; margin: 0; padding: 0 1.15rem; }

/* Filtros por categoría */
.manual-filters { display: flex; gap: .45rem; margin-top: .4rem; overflow-x: auto; padding: .1rem 0 .4rem; scrollbar-width: thin; }
.manual-filter-chip { align-items: center; background: #fff; border: 1px solid #dbe3f0; border-radius: 99px; color: #4b5563; cursor: pointer; display: inline-flex; font-size: .78rem; font-weight: 600; gap: .35rem; padding: .38rem .72rem; transition: all .15s ease; white-space: nowrap; }
.manual-filter-chip:hover { background: #f0f4ff; border-color: #9db8fa; color: #294eaa; }
.manual-filter-chip.is-active { background: #365ee8; border-color: #365ee8; color: #fff; box-shadow: 0 2px 6px rgba(54, 94, 232, .25); }
.manual-filter-chip svg { height: 14px; width: 14px; }

/* Resaltado de búsqueda */
mark.manual-highlight { background-color: #fef08a; border-radius: 3px; color: #854d0e; font-weight: 700; padding: 0 2px; }

/* Tarjeta de solución a problemas comunes */
.manual-trouble { background: #fffbeb; border: 1px solid #fef3c7; border-left: 3px solid #d98a0b; border-radius: 8px; margin-top: .8rem; padding: .65rem .85rem; font-size: .86rem; }
.manual-trouble summary { align-items: center; color: #92400e; cursor: pointer; display: flex; font-weight: 700; gap: .45rem; list-style: none; user-select: none; }
.manual-trouble summary::-webkit-details-marker { display: none; }
.manual-trouble summary svg { height: 15px; width: 15px; }
.manual-trouble p { color: #78350f; font-size: .84rem; line-height: 1.5; margin: .4rem 0 0; }

/* Índice lateral con iconos y avance */
.manual-progress { border-bottom: 1px solid #edf0f5; margin-bottom: .7rem; padding-bottom: .8rem; }
.manual-progress-head { align-items: baseline; display: flex; justify-content: space-between; }
.manual-progress-head strong { color: #1d2f50; font-size: .82rem; }
.manual-progress-head span { color: #365ee8; font-size: .82rem; font-weight: 800; }
.manual-bar, .manual-mini-bar { background: #e8edf6; border-radius: 99px; height: 7px; margin-top: .5rem; overflow: hidden; }
.manual-bar span, .manual-mini-bar span { background: linear-gradient(90deg, #365ee8, #0f9d6b); border-radius: inherit; display: block; height: 100%; transition: width .35s ease; width: 0; }
.manual-link { background: none; border: 0; color: #647089; cursor: pointer; font: 600 .74rem/1 inherit; margin-top: .55rem; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.manual-link:hover { color: #294eaa; }
.manual-toc nav { max-height: calc(100vh - 17rem); overflow: auto; }
.manual-toc a { align-items: center; border-left: 3px solid transparent; border-radius: 0 8px 8px 0; display: flex; gap: .5rem; padding: .45rem .5rem; }
.manual-toc a[hidden] { display: none; }
.manual-toc a > svg:first-child { color: var(--t); flex: 0 0 auto; height: 16px; width: 16px; }
.manual-toc a span { flex: 1; }
.manual-toc a:hover { background: var(--t-soft); color: var(--t-ink); }
.manual-toc a.is-active { background: var(--t-soft); border-left-color: var(--t); color: var(--t-ink); }
.manual-toc .manual-toc-ok { color: #0f9d6b; display: none; height: 15px; width: 15px; }
.manual-toc a.is-done .manual-toc-ok { display: block; }

/* Tarjeta de sección */
.manual-section { border-left: 4px solid var(--t); transition: box-shadow .2s, border-color .2s; }
.manual-section:target, .manual-section:hover { box-shadow: 0 6px 22px rgba(33, 52, 98, .07); }
.manual-section.is-done { border-color: var(--t-line); border-left-color: #0f9d6b; }
.manual-section-head { align-items: flex-start; display: flex; gap: .8rem; }
.manual-icon { background: var(--t-soft); border-color: var(--t-line); border-radius: 12px; color: var(--t); flex: 0 0 auto; height: 44px; width: 44px; }
.manual-icon svg { height: 22px; stroke-width: 1.9; width: 22px; }
.manual-section-copy { flex: 1; min-width: 0; }
.manual-section-copy h2 { font-size: 1.22rem; margin: 0 0 .15rem; }
.manual-section-copy p { margin-bottom: .2rem; max-width: 70ch; }
.manual-section-head + .manual-route { margin-top: 1rem; }
.manual-copy { background: transparent; border: 1px solid transparent; border-radius: 8px; color: #8a98b2; cursor: pointer; flex: 0 0 auto; height: 34px; width: 34px; }
.manual-copy svg { height: 16px; width: 16px; }
.manual-copy:hover { background: #f2f5fb; color: #294eaa; }
.manual-copy.is-copied { background: #e8f7f1; color: #0f9d6b; }

.manual-route { background: var(--t-soft); border-color: var(--t-line); }
.manual-route-label { align-items: center; color: var(--t-ink); display: flex; gap: .3rem; letter-spacing: .02em; text-transform: none; font-size: .76rem; }
.manual-route-label svg { height: 14px; width: 14px; }
.manual-route li { color: var(--t-ink); }
.manual-route li span { border-color: var(--t-line); }

/* Procedimiento con casillas */
.manual-section details { padding-top: .6rem; }
.manual-section summary { align-items: center; display: flex; gap: .6rem; list-style: none; padding: .35rem 0; user-select: none; }
.manual-section summary::-webkit-details-marker { display: none; }
.manual-section summary > span:first-child { align-items: center; color: var(--t-ink); display: inline-flex; flex: 1; gap: .45rem; }
.manual-section summary svg { height: 17px; width: 17px; }
.manual-count { background: var(--t-soft); border-radius: 99px; color: var(--t-ink); font-size: .72rem; font-weight: 800; padding: .2rem .55rem; }
.manual-chevron { color: #8a98b2; transition: transform .2s; }
details[open] > summary .manual-chevron { transform: rotate(180deg); }
.manual-mini-bar { height: 4px; margin: .35rem 0 .2rem; }
.manual-mini-bar span { background: var(--t); }
.manual-section ol.manual-steps { list-style: none; margin: .6rem 0 0; padding: 0; }
.manual-steps li + li { margin-top: .25rem; }
.manual-step { align-items: flex-start; border-radius: 9px; cursor: pointer; display: flex; gap: .65rem; padding: .5rem .55rem; transition: background .15s; }
.manual-step:hover { background: #f6f8fd; }
.manual-step input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.manual-check { background: #fff; border: 2px solid #c5d0e4; border-radius: 6px; flex: 0 0 auto; height: 20px; margin-top: .1rem; position: relative; transition: background .15s, border-color .15s; width: 20px; }
.manual-check::after { border: solid #fff; border-width: 0 2px 2px 0; content: ""; height: 9px; left: 5.5px; opacity: 0; position: absolute; top: 1.5px; transform: rotate(45deg); transition: opacity .15s; width: 5px; }
.manual-step input:checked + .manual-check { background: var(--t); border-color: var(--t); }
.manual-step input:checked + .manual-check::after { opacity: 1; }
.manual-step input:focus-visible + .manual-check { box-shadow: 0 0 0 3px var(--t-line); }
.manual-step-text { color: #3f506b; font-size: .9rem; line-height: 1.55; }
.manual-step-text b { color: var(--t); font-size: .78rem; margin-right: .45rem; }
.manual-step input:checked ~ .manual-step-text { color: #8a98b2; text-decoration: line-through; text-decoration-color: #c5d0e4; }

.manual-tip strong { align-items: center; color: #0b7550; display: flex; gap: .35rem; }
.manual-tip strong svg { height: 16px; width: 16px; }
.manual-tip { background: #f1faf6; border-color: #cfeee0; }
.manual-example > svg { height: 20px; width: 20px; }
.manual-sections { gap: 1.1rem; }

/* Accesibilidad y adaptación */
.manual-page a:focus-visible, .manual-page button:focus-visible, .manual-section summary:focus-visible { outline: 3px solid #9db8fa; outline-offset: 2px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .manual-page * { transition: none !important; }
}
@media (max-width: 960px) {
  .manual-toc nav { max-height: none; }
}
@media (max-width: 640px) {
  .manual-actions { margin-left: 0; width: 100%; }
  .manual-actions > * { flex: 1; justify-content: center; text-align: center; }
  .manual-section-head { flex-wrap: wrap; }
  .manual-icon { height: 38px; width: 38px; }
  .manual-count { display: none; }
}
@media print {
  .manual-toolbar, .manual-filters, .manual-toc, .manual-copy, .legal-header, .manual-actions { display: none !important; }
  .manual-layout { display: block; }
  .manual-section { break-inside: avoid; border: 1px solid #dbe3f0; border-left: 4px solid var(--t); margin-bottom: 1.5rem; box-shadow: none !important; }
  .manual-section details { display: block !important; }
  .manual-section details[open] { display: block !important; }
  .manual-step input { display: none; }
  .manual-step-text { color: #111; }
}
