/* VS_Remote — estilos del manual (manual.html, generado por tools/web/gen_manual.py). Va después de site.css. */
.manual-page { --side-w: 290px; --text-2: #d6dadf; --code-bg: #0e1113; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 3000; background: var(--orange); color: #111; padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { left: 8px; }

/* ---------- Encabezado ---------- */
.manual-head { padding: 120px 0 44px; }
.manual-head .lead { max-width: 680px; }
.manual-head .meta { margin-top: 16px; color: #7d858e; font-size: 0.88rem; letter-spacing: 0.02em; }

/* ---------- Columnas ---------- */
.manual { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: 56px; padding-top: 44px; padding-bottom: 96px; align-items: start; }

/* ---------- Índice lateral ---------- */
.side { position: sticky; top: 92px; max-height: calc(100vh - 112px); display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.side-head { display: none; }
.search { position: relative; padding: 14px 14px 6px; }
.search svg { position: absolute; left: 26px; top: 50%; margin-top: 4px; transform: translateY(-50%); width: 18px; height: 18px; color: #7d858e; pointer-events: none; }
.search input { width: 100%; background: var(--code-bg); border: 1px solid var(--border); border-radius: 999px; color: var(--text); font: 400 0.95rem "Roboto", sans-serif; padding: 10px 14px 10px 38px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.search input::placeholder { color: #7d858e; }
.search input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 173, 181, 0.2); }
.q-status { min-height: 0; padding: 0 20px; font-size: 0.8rem; color: var(--cyan); }
.q-status:not(:empty) { padding-bottom: 6px; }
.toc-tree { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 8px 16px; scrollbar-width: thin; scrollbar-color: #3a4047 transparent; overscroll-behavior: contain; }
.toc-tree ol, .toc-tree ul { list-style: none; }
.toc-tree a { display: flex; gap: 8px; align-items: baseline; text-decoration: none; color: #c3c8cd; padding: 5px 10px; border-radius: 8px; border-left: 2px solid transparent; font-size: 0.9rem; line-height: 1.35; transition: background 0.15s, color 0.15s; }
.toc-tree a:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }
.toc-tree a .n { flex: none; min-width: 1.6em; font-variant-numeric: tabular-nums; color: #7d858e; font-size: 0.82rem; }
.toc-tree a .t { flex: 1; min-width: 0; }
.toc-tree a .c { flex: none; align-self: center; background: rgba(0, 173, 181, 0.16); color: #8fe7ec; border-radius: 999px; font-size: 0.7rem; font-weight: 700; padding: 1px 7px; }
.toc-tree li.ch > a { font-weight: 500; color: #e6e8ea; margin-top: 2px; }
.toc-tree li.ch > a .n { color: var(--orange); font-family: "Orbitron", sans-serif; font-size: 0.72rem; font-weight: 600; }
.toc-tree ul { margin: 0 0 4px 18px; border-left: 1px solid #2b3036; }
.toc-tree ul a { font-size: 0.84rem; padding: 4px 10px; color: #a3a9b0; }
.toc-tree a.on { background: rgba(255, 153, 0, 0.1); color: var(--orange); border-left-color: var(--orange); }
.toc-tree a.on .n { color: var(--orange); }
.toc-tree li.ch.in > a:not(.on) { color: #fff; }
.toc-tree mark { background: rgba(255, 153, 0, 0.3); color: #fff; border-radius: 3px; padding: 0 1px; }
/* Buscando: se ven solo las entradas que coinciden (y el capítulo que las contiene, atenuado) */
.side.searching .toc-tree li { display: none; }
.side.searching .toc-tree li.match, .side.searching .toc-tree li.ctx { display: block; }
.side.searching .toc-tree li.ctx:not(.match) > a { opacity: 0.55; }

/* ---------- Contenido ---------- */
.doc { max-width: 800px; min-width: 0; color: var(--text-2); font-size: 1.04rem; line-height: 1.7; }
.doc section { padding: 0; }
.doc .chapter { padding-top: 8px; margin-bottom: 64px; }
.doc .chapter + .chapter { border-top: 1px solid #23282d; padding-top: 48px; }
.doc .sub { margin-top: 40px; }
.doc h2, .doc h3, .doc h4 { position: relative; color: #fff; line-height: 1.25; }
.doc h2 { font-family: "Orbitron", sans-serif; font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 22px; letter-spacing: 0.01em; }
.doc h2 .num { display: inline-grid; place-items: center; min-width: 1.9em; height: 1.9em; padding: 0 0.35em; margin-right: 0.35em; border-radius: 10px; background: rgba(255, 153, 0, 0.12); border: 1px solid rgba(255, 153, 0, 0.45); color: var(--orange); font-size: 0.72em; vertical-align: 0.12em; }
.doc h3 { font-size: 1.28rem; font-weight: 700; margin-bottom: 14px; }
.doc h3 .num { color: var(--cyan); font-family: "Orbitron", sans-serif; font-size: 0.85em; margin-right: 0.3em; }
.doc h4 { font-size: 1.08rem; margin: 24px 0 10px; }
.doc h5 { font-size: 1.05rem; font-weight: 700; color: var(--orange, #ff9f1c); margin: 26px 0 10px; line-height: 1.3; }
.doc .anchor { margin-left: 0.4em; color: #5c646d; text-decoration: none; font-weight: 400; font-family: "Roboto", sans-serif; opacity: 0; transition: opacity 0.15s, color 0.15s; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc .anchor:focus { opacity: 1; }
.doc .anchor:hover, .doc .anchor:focus { color: var(--orange); }
@media (hover: none) { .doc .anchor { opacity: 0.45; } }

.doc p { margin: 0 0 16px; }
.doc strong { color: #fff; font-weight: 700; }
.doc em { color: #e9ecee; }
.doc a { color: var(--orange); text-decoration: underline; text-decoration-color: rgba(255, 153, 0, 0.4); text-underline-offset: 3px; }
.doc a:hover { text-decoration-color: var(--orange); }
.doc a.xref { white-space: nowrap; }
.doc code { font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.88em; background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.1em 0.4em; color: #8fe7ec; overflow-wrap: anywhere; }
.doc p.addr code { display: inline-block; font-size: 1.05rem; color: #7dff8f; padding: 0.4em 0.9em; letter-spacing: 0.03em; box-shadow: inset 0 0 12px rgba(67, 160, 71, 0.15); }

.doc ul, .doc ol { margin: 0 0 18px; padding-left: 1.5em; }
.doc li { margin: 6px 0; padding-left: 0.2em; }
.doc li > ul, .doc li > ol { margin: 6px 0 4px; }
.doc ul > li::marker { color: var(--orange); }
.doc ol > li::marker { color: var(--cyan); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Tablas */
.doc .doc-table { margin: 6px 0 26px; background: var(--card); }
.doc .doc-table:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.doc .doc-table table { min-width: 0; font-size: 0.95rem; background: transparent; }
.doc .doc-table.wide table { min-width: 560px; }
.doc .doc-table th, .doc .doc-table td { padding: 11px 16px; }
.doc .doc-table td { color: var(--text-2); }
.doc .doc-table td:first-child { white-space: normal; color: #f1f3f4; font-weight: 500; width: 36%; }
.doc .doc-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.025); }
.doc .doc-table tbody tr:hover td { background: rgba(0, 173, 181, 0.06); }

/* Recuadros (blockquotes) */
.doc .callout { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 24px; padding: 16px 20px; border-radius: 12px; border: 1px solid rgba(0, 173, 181, 0.35); background: linear-gradient(90deg, rgba(0, 173, 181, 0.11), rgba(0, 173, 181, 0.03)); color: #cfe9eb; font-size: 0.98rem; }
.doc .callout-ico { flex: none; width: 22px; height: 22px; margin-top: 2px; background: var(--cyan); -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 110 20 10 10 0 010-20zm-1 8v7h2v-7h-2zm0-4v2h2V6h-2z'/%3E%3C/svg%3E"); }
.doc .callout-body { min-width: 0; }
.doc .callout-body > :last-child { margin-bottom: 0; }
.doc .callout p { margin-bottom: 10px; }
.doc .callout-title { font-weight: 700; color: #fff; font-size: 1.05rem; }
.doc .callout.warn { border-color: rgba(255, 153, 0, 0.5); background: linear-gradient(90deg, rgba(255, 153, 0, 0.13), rgba(255, 153, 0, 0.03)); color: #f5e3c8; }
.doc .callout.warn .callout-ico { background: var(--orange);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2L1 21h22L12 2zm-1 7h2v6h-2V9zm0 8h2v2h-2v-2z'/%3E%3C/svg%3E"); }

/* Capturas */
.doc .shot-fig { margin: 8px 0 30px; text-align: center; }
.doc .shot-fig .zoom { display: inline-block; max-width: 100%; padding: 8px; background: #0b0c0d; border: 1px solid #2b2f34; border-radius: 16px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5); cursor: zoom-in; transition: border-color 0.2s, transform 0.2s; }
.doc .shot-fig .zoom:hover { border-color: rgba(255, 153, 0, 0.6); }
.doc .shot-fig .zoom:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.doc .shot-fig img { display: block; border-radius: 9px; width: auto; max-width: 100%; height: auto; max-height: 70vh; margin: 0 auto; }
.doc .shot-fig.portrait img { max-height: min(70vh, 640px); }
.doc .shot-fig figcaption { margin: 10px auto 0; max-width: 620px; color: var(--muted); font-size: 0.9rem; }

/* Resultados del buscador en el texto */
.doc mark.hit { background: rgba(255, 153, 0, 0.32); color: #fff; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 153, 0, 0.45); }

/* ---------- Botones flotantes, aviso y visor ---------- */
.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 900; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 153, 0, 0.55); background: rgba(18, 20, 22, 0.92); color: var(--orange); cursor: pointer; display: grid; place-items: center; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.25s, transform 0.25s, background 0.2s; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.to-top svg { width: 26px; height: 26px; }
.to-top.on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--orange); color: #111; }
.toc-fab { display: none; }
.scrim { position: fixed; inset: 0; z-index: 1090; background: rgba(0, 0, 0, 0.55); }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 2100; transform: translate(-50%, 20px); background: var(--cyan); color: #04191b; font-weight: 700; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px); overflow-wrap: anywhere; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.manual-page .lightbox { display: flex; }
.manual-page .lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox figure img { max-height: calc(100vh - 100px); object-fit: contain; }
.lightbox figcaption { color: #cfd3d7; font-size: 0.95rem; text-align: center; max-width: 720px; }
.lb-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #444; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 1.1rem; cursor: pointer; }
body.lb-open { overflow: hidden; }

/* ---------- Pantallas medianas y chicas: el índice pasa a ser un cajón ---------- */
@media (max-width: 1000px) {
  .manual { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .doc { margin: 0 auto; width: 100%; }
  .side { position: fixed; z-index: 1100; top: 0; bottom: 0; left: 0; width: min(88vw, 360px); max-height: none; border-radius: 0 var(--radius) var(--radius) 0; border-left: none; transform: translateX(-105%); transition: transform 0.28s ease, visibility 0.28s; visibility: hidden; box-shadow: 20px 0 50px rgba(0, 0, 0, 0.6); }
  .side.open { transform: none; visibility: visible; }
  .side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 4px 20px; }
  .side-title { font-family: "Orbitron", sans-serif; color: var(--orange); font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; }
  .side-close { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 1rem; cursor: pointer; }
  .toc-tree a { padding-top: 7px; padding-bottom: 7px; }
  .toc-fab { position: fixed; left: 16px; bottom: 18px; z-index: 950; display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px 11px 14px; border-radius: 999px; border: 1px solid rgba(0, 173, 181, 0.6); background: rgba(13, 20, 22, 0.94); color: #bfe9ec; font: 700 0.95rem "Roboto", sans-serif; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .toc-fab svg { width: 20px; height: 20px; color: var(--cyan); }
  body.drawer-open { overflow: hidden; }
  .to-top { right: 16px; bottom: 18px; }
}
@media (max-width: 600px) {
  .manual-head { padding: 100px 0 30px; }
  .doc { font-size: 1rem; }
  .doc .chapter { margin-bottom: 44px; }
  .doc .chapter + .chapter { padding-top: 36px; }
  .doc h2 .num { border-radius: 8px; }
  .doc .callout { padding: 14px 14px; gap: 10px; }
  .doc .doc-table th, .doc .doc-table td { padding: 10px 12px; }
  /* Tablas de dos columnas: cada fila pasa a ser una tarjeta */
  .doc .doc-table:not(.wide) { background: transparent; border: none; border-radius: 0; overflow: visible; }
  .doc .doc-table:not(.wide) table, .doc .doc-table:not(.wide) tbody, .doc .doc-table:not(.wide) tr, .doc .doc-table:not(.wide) td { display: block; width: auto; }
  .doc .doc-table:not(.wide) thead { display: none; }
  .doc .doc-table:not(.wide) tr { background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
  .doc .doc-table:not(.wide) td { border: none; background: transparent !important; padding: 4px 14px 12px; }
  .doc .doc-table:not(.wide) td:first-child { padding-top: 12px; width: auto; color: #fff; }
  .doc .shot-fig .zoom { padding: 5px; border-radius: 12px; }
  .doc .shot-fig.portrait .zoom { max-width: 78%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .side, .to-top, .toast { transition: none; }
}
