/* TUTORIAL-1 (14-nov-2026) · Sección /tutoriales/ y /en/tutorials/. Va DESPUÉS de styles.css y usa sus tokens
   (--green, --text, --bg-card, --border…; claro y oscuro por [data-theme] del <html>). La generan
   tools/tutoriales/build-tutoriales.js y contenido.{es,en}.js; no hay JS para navegar (pestañas = enlaces y :target). */

/* ── Imágenes por tema, sin JS: dos <img> y se ve la del tema del <html> ── */
.only-dark { display: none !important; }
[data-theme="dark"] .only-light { display: none !important; }
[data-theme="dark"] .only-dark { display: block !important; }

.tut-main { --tut-nav: 76px; --tut-tabs: 62px; }
@media (max-width: 599px) { .tut-main { --tut-nav: 58px; } }
@media (min-width: 861px) { .tut-main { --tut-tabs: 96px; } }

/* ── Barra de pestañas de los tutoriales (fija bajo la barra de arriba) ── */
.tut-tabs {
  position: sticky; top: var(--tut-nav); z-index: 40;
  background: var(--nav-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.tut-tabs-row {
  position: relative; display: flex; gap: 6px; max-width: 1160px; margin: 0 auto; padding: 8px 22px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 22px;
}
.tut-tabs-row::-webkit-scrollbar { display: none; }
.tut-tabs a {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-soft); font-size: 14px; font-weight: 600; white-space: nowrap; line-height: 1;
  transition: border-color .2s, color .2s, background-color .2s;
}
.tut-tabs a:hover { color: var(--text); border-color: var(--accent-green-border); }
.tut-tabs a b { font-family: var(--font-display); font-size: 12px; color: var(--green-text, #0B7A58); }
.tut-tabs a[aria-current="page"] {
  color: var(--text); border-color: var(--green); background: var(--accent-green-bg);
  box-shadow: inset 0 0 0 1px var(--green); scroll-initial-target: nearest;
}
.tut-tabs a:focus-visible, .tut-sub a:focus-visible, .tut-btn:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
/* En PC todas a la vista (dos filas si hace falta); en el móvil, una fila que se desliza. */
@media (min-width: 861px) {
  .tut-tabs-row { flex-wrap: wrap; overflow: visible; justify-content: center; }
  .tut-tabs a { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
}
/* L1/L2 · en el móvil, pestañas de 44 px de alto y letra de 15 px (antes 40 y 14). */
@media (max-width: 860px) {
  .tut-tabs a { min-height: 44px; font-size: 15px; }
  .tut-tabs a b { font-size: 15px; }
}
@media (max-width: 599px) {
  .tut-tabs-row { padding: 8px 16px; scroll-padding-inline: 16px; }
  .tut-tabs a { padding: 0 13px; }
}

/* ── Cabecera de cada tutorial ── */
.tut-hero { padding: 40px 0 8px; }
.tut-hero .pill { margin-bottom: 12px; }
.tut-hero h1 { font-size: clamp(28px, 4.2vw, 44px); line-height: 1.12; margin: 0 0 12px; font-weight: 800; }
.tut-lead { font-size: clamp(16px, 1.7vw, 19px); color: var(--text-soft); max-width: 720px; margin: 0 0 18px; line-height: 1.55; }
.tut-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 6px; padding: 0; list-style: none; }
/* G4 · display: block (antes inline-flex: cada trozo de texto o enlace era una columna, «Lo / necesitas: | tu tarifa / …»). */
.tut-meta li {
  display: block; padding: 7px 12px; border-radius: 12px;
  background: var(--bg-alt); border: 1px solid var(--border); font-size: 15px; color: var(--text); line-height: 1.45;
}
.tut-meta li span { color: var(--text-soft); font-weight: 600; }
.tut-wrap { max-width: 980px; margin: 0 auto; }
.tut-sec { padding: 26px 0; }
.tut-sec h2 { font-size: clamp(22px, 2.6vw, 30px); margin: 0 0 14px; line-height: 1.2; }
.tut-sec p, .tut-sec li { font-size: 17px; line-height: 1.6; }
.tut-sec p { margin: 0 0 14px; }
.tut-sec a:not(.btn):not(.tut-btn):not(.tut-card) { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.tut-sec strong, .tut-pasos strong { color: var(--text); }

/* ── Vídeo ── */
.tut-video { margin: 8px 0 0; max-width: 980px; }
.tut-video-box { display: flex; justify-content: center; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 20px; padding: 18px; }
.tut-video video { border-radius: 14px; background: #0b0f17; box-shadow: var(--shadow); max-height: 78vh; width: auto; }
.tut-video--m video { width: 300px; aspect-ratio: 390 / 844; height: auto; }
.tut-video--pc video { width: 100%; aspect-ratio: 16 / 10; height: auto; }
.tut-video--split video { width: 100%; max-width: 640px; aspect-ratio: 796 / 844; height: auto; }
.tut-video figcaption { margin-top: 10px; font-size: 15px; color: var(--text-soft); text-align: center; }
.tut-video-falta { padding: 40px 18px; text-align: center; color: var(--text-soft); font-size: 15px; }

/* Dos vídeos (móvil + PC): en PC uno al lado del otro; en el móvil, uno debajo del otro. */
.tut-videos { display: grid; gap: 16px; }
@media (min-width: 861px) {
  .tut-videos--dos { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }
  .tut-videos--dos .tut-video--m video { width: 100%; }
}

/* ── Mapas de un vistazo (T4 «qué precio va en cada sitio», T5 «tus enlaces») ── */
.tut-mapa { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 6px 0 4px; }
.tut-mapa > div { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 16px 16px 14px; }
.tut-mapa h3 { font-size: 17px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.tut-mapa h3 i { font-style: normal; font-size: 20px; }
.tut-mapa p { font-size: 15px !important; color: var(--text-soft); margin: 0 0 6px !important; line-height: 1.5 !important; }
.tut-mapa code { font-size: 13px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
.tut-mapa .tut-mapa-donde { font-size: 15px !important; color: var(--text) !important; }
@media (max-width: 760px) { .tut-sec .tut-mapa code { font-size: 15px; } }

/* ── Pestañas de segundo nivel: En el móvil | En el ordenador (sin JS: :target) ──
   El bloque del ordenador va ANTES en el HTML; si es el :target se ve él y se esconde el del móvil (~). Cada bloque
   lleva su propia fila de pestañas, con la suya marcada: como solo se ve un bloque, siempre está bien marcada. */
.tut-flujo { scroll-margin-top: calc(var(--tut-nav) + var(--tut-tabs) + 12px); }
.tut-flujo--pc { display: none; }
.tut-flujo--pc:target { display: block; }
.tut-flujo--pc:target ~ .tut-flujo--m { display: none; }
/* un enlace a un paso del ordenador (#pc-09) también abre su pestaña */
.tut-flujo--pc:has(:target) { display: block; }
.tut-flujo--pc:has(:target) ~ .tut-flujo--m { display: none; }
.tut-sub { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 18px; border-radius: 14px; background: var(--bg-alt); border: 1px solid var(--border); max-width: 100%; }
.tut-sub a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 16px; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--text-soft); white-space: nowrap;
}
.tut-sub a[aria-current="true"] { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tut-sub a svg { width: 16px; height: 16px; flex-shrink: 0; }
@media (max-width: 380px) { .tut-sub a { padding: 0 11px; } }

/* ── Pasos ── */
.tut-grupo { font-size: 19px; margin: 26px 0 4px; padding-top: 18px; border-top: 2px solid var(--accent-green-border); color: var(--text); }
.tut-flujo > .tut-grupo:first-of-type, .tut-wrap > .tut-grupo:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
.tut-pasos { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.tut-paso {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 300px; gap: 6px 18px; align-items: start;
  padding: 22px 0; border-top: 1px solid var(--border);
  /* L15 · con #pc-09 / #m-09 el paso quedaba debajo de la barra fija (cabecera + pestañas, ~165 px a 1280). */
  scroll-margin-top: calc(var(--tut-nav) + var(--tut-tabs) + 14px);
}
.tut-paso:first-child { border-top: 0; padding-top: 6px; }
.tut-paso-n {
  grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: #04130c; font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1;
}
.tut-paso-t { font-size: 18px; line-height: 1.5; margin: 4px 0 0; color: var(--text); }
.tut-paso-t strong { font-weight: 800; }
.tut-ojo { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--blue); background: rgba(20,103,139,.07); border-radius: 0 10px 10px 0; font-size: 15px !important; line-height: 1.5 !important; color: var(--text); }
[data-theme="dark"] .tut-ojo { border-left-color: #38bdf8; background: rgba(56,189,248,.08); }
.tut-ojo b { color: var(--text); }
.tut-shot { grid-column: 3; grid-row: 1 / span 2; margin: 0; }
.tut-shot img { width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--bg-alt); }
.tut-paso--pc { grid-template-columns: 40px minmax(0, 1fr); }
.tut-paso--pc .tut-shot { grid-column: 2; grid-row: auto; margin-top: 10px; }
.tut-paso--pc .tut-shot img { border-radius: 12px; }
.tut-paso--sin { grid-template-columns: 40px minmax(0, 1fr); }
@media (max-width: 760px) {
  .tut-paso, .tut-paso--pc, .tut-paso--sin { grid-template-columns: 36px minmax(0, 1fr); gap: 6px 12px; }
  .tut-paso-n { width: 32px; height: 32px; font-size: 16px; }
  .tut-shot, .tut-paso--pc .tut-shot { grid-column: 1 / -1; grid-row: auto; margin-top: 12px; }
  .tut-shot img { max-width: 300px; margin: 0 auto; }
  .tut-paso--pc .tut-shot img { max-width: 100%; }
  .tut-paso-t { font-size: 17px; }
}

/* ── «Aquí se atasca la gente» (ámbar) ── */
.tut-atasco { margin: 8px 0 0; padding: 18px 20px 6px; border-radius: 16px; border: 1px solid #f0b54a; background: #fff8eb; }
.tut-atasco h2 { font-size: 21px !important; margin: 0 0 10px !important; display: flex; align-items: center; gap: 8px; color: #6b4300; }
.tut-atasco ul { margin: 0; padding: 0; list-style: none; }
.tut-atasco li { position: relative; padding: 0 0 12px 22px; font-size: 16px !important; color: #3d2a00; }
.tut-atasco li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: #e09a1a; }
.tut-atasco li b { color: #2b1d00; }
.tut-atasco a { color: #3d2a00 !important; text-decoration-color: #e09a1a !important; }
[data-theme="dark"] .tut-atasco { border-color: rgba(240,181,74,.5); background: rgba(240,181,74,.09); }
[data-theme="dark"] .tut-atasco h2 { color: #ffd28a; }
[data-theme="dark"] .tut-atasco li, [data-theme="dark"] .tut-atasco li b, [data-theme="dark"] .tut-atasco a { color: #f6e7cc !important; }

/* ── «Ábrelo en la app» y siguiente tutorial ── */
.tut-abrir { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* G2 · en el HTML va primero «En el móvil»; en PC se pone delante la del ordenador, con su botón. */
.tut-abrir-pc { order: -1; }
.tut-ruta--pc { display: none; }
.tut-abrir > div { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.tut-abrir h3 { font-size: 16px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.tut-abrir h3 svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; }
.tut-abrir p { font-size: 15px !important; color: var(--text-soft); margin: 0 0 12px !important; }
.tut-ruta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-weight: 700; color: var(--text); font-size: 16px; }
.tut-ruta i { font-style: normal; color: var(--text-soft); }
.tut-btn { white-space: normal; text-align: center; }
@media (max-width: 640px) { .tut-abrir { grid-template-columns: 1fr; } }
/* G2 · por debajo de 760 px: «En el móvil» primero y en grande; la del ordenador, sin botón (desde el teléfono /app#… acaba
   en /m#hoy), solo con la ruta en texto. */
@media (max-width: 760px) {
  .tut-abrir { grid-template-columns: 1fr; }
  .tut-abrir-pc { order: 0; padding: 14px 18px !important; }
  .tut-abrir-pc .tut-btn, .tut-abrir-pc .tut-abrir-txt { display: none; }
  .tut-abrir-pc h3 { margin-bottom: 6px; }
  .tut-ruta--pc { display: block; font-size: 15px; font-weight: 600; color: var(--text-soft); margin: 0 !important; }
  .tut-ruta--pc b { color: var(--text-soft); font-weight: 600; }
  .tut-ruta--pc span { color: var(--text); font-weight: 700; }
  .tut-ruta--pc i { font-style: normal; margin: 0 5px; }
  .tut-abrir-m { border: 2px solid var(--green) !important; background: var(--accent-green-bg) !important; padding: 20px 18px !important; }
  .tut-abrir-m h3 { font-size: 19px; }
  .tut-abrir-m .tut-ruta { font-size: 20px; gap: 6px 8px; }
  .tut-abrir-m p { color: var(--text) !important; }
}
.tut-sig {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 8px; padding: 18px 20px;
  border-radius: 16px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); text-decoration: none !important;
}
.tut-sig:hover { border-color: var(--green); }
.tut-sig span { color: var(--text-soft); font-size: 15px; display: block; }
/* L22 · la guía de la web va debajo de «Siguiente», en pequeño. */
.tut-guia { margin: 14px 2px 0 !important; font-size: 15px !important; color: var(--text-soft); }
.tut-sig b { font-family: var(--font-display); font-size: 19px; line-height: 1.25; }
.tut-sig i { font-style: normal; font-size: 24px; color: var(--green); }

/* ── Índice (T0) ── */
/* L12 · texto seguido (antes flex: a 360/390 la flecha → se quedaba sola en una línea); la flecha va pegada con &nbsp;. */
.tut-empieza { display: block; margin: 6px 0 0; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--accent-green-border); background: var(--accent-green-bg); line-height: 1.55; }
.tut-empieza b { display: block; font-size: 16px; margin-bottom: 4px; }
.tut-empieza span[aria-hidden] { white-space: nowrap; margin-right: 4px; }
.tut-empieza a { font-weight: 700; color: var(--text); text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 3px; }
.tut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tut-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); text-decoration: none; transition: border-color .2s, transform .15s;
}
.tut-card:hover { border-color: var(--green); transform: translateY(-1px); }
.tut-card-ico { font-size: 24px; line-height: 1; }
.tut-card h3 { font-size: 18px; margin: 2px 0 0; line-height: 1.25; }
.tut-card p { font-size: 15px !important; color: var(--text-soft); margin: 0 !important; line-height: 1.5 !important; }
.tut-card small { margin-top: auto; padding-top: 6px; font-size: 15px; color: var(--green-text, #0B7A58); font-weight: 700; }
.tut-card--clave { border-color: var(--accent-green-border); box-shadow: inset 0 0 0 1px var(--accent-green-border); }

/* ── Soluciones rápidas (TS) ── */
.tut-faq { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 4px 18px; margin-bottom: 10px; scroll-margin-top: calc(var(--tut-nav) + var(--tut-tabs) + 12px); }
.tut-faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 0; font-size: 17px; }
.tut-faq summary::-webkit-details-marker { display: none; }
.tut-faq summary::after { content: "+"; flex-shrink: 0; color: var(--green); font-size: 24px; line-height: 1; transition: transform .2s; }
.tut-faq[open] summary::after { transform: rotate(45deg); }
.tut-faq p { margin: 0 0 12px !important; color: var(--text-soft); }
.tut-faq p a { color: var(--text) !important; }

/* La barra de abajo no tapa nada: los tutoriales no llevan la barra fija «Descargar app» de la portada. */
.tut-main .section { padding: 34px 0; }
@media (max-width: 599px) { .tut-hero { padding-top: 26px; } .tut-sec { padding: 20px 0; } }
@media print { .tut-tabs, .tut-sub, .tut-video { display: none !important; } .tut-flujo--pc { display: block !important; } }

/* Banderas flotantes de idioma (PC): las mismas reglas que llevan las guías y las páginas de función en su <style>. */
.lang-switch{position:fixed;right:0;top:50%;transform:translateY(-50%);z-index:9000;display:flex;flex-direction:column;gap:6px;padding:8px 6px;background:color-mix(in srgb,var(--bg-card,#fff) 90%,transparent);backdrop-filter:blur(8px);border:1px solid var(--border,#e4e9f0);border-right:0;border-radius:12px 0 0 12px;box-shadow:0 8px 24px rgba(0,0,0,.18)}
.lang-switch a{display:block;width:26px;height:19px;border-radius:4px;overflow:hidden;opacity:.55;transition:opacity .15s,transform .15s;box-shadow:0 0 0 1px var(--border,#e4e9f0);line-height:0}
.lang-switch a:hover{opacity:1;transform:scale(1.12)}.lang-switch a.active{opacity:1;outline:2px solid var(--brand,#16C784);outline-offset:1px}
.lang-switch:not(.open) a:not(.active){display:none}.lang-switch.open a{opacity:1}.lang-switch svg{width:26px;height:19px;display:block}
@media(max-width:640px){.lang-switch{top:auto;bottom:84px;transform:none;flex-direction:row;border-radius:12px 0 0 12px}}
.tut-sub a, .tut-tabs a { text-decoration: none !important; }
/* El hueco del final de la fila de pestañas: Chromium no cuenta el padding final al desplazar, y la última quedaba cortada. */
.tut-tabs-row::after { content: ""; flex: 0 0 10px; }
@media (min-width: 861px) { .tut-tabs-row::after { display: none; } }
.tut-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.tut-sec code { font-size: .88em; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .tut-sub { display: flex; width: 100%; }
  .tut-sub a { flex: 1 1 0; justify-content: center; padding: 0 6px; font-size: 15px; gap: 6px; }
}

/* Cierre B · el póster de cada tema lo pone js/tutoriales.js (data-poster-light / -dark) solo en el vídeo que se ve: con
   poster="" en dos <video> el navegador bajaba los dos, y como fondo CSS Chromium lo tapa con su gris. */
/* En el móvil no se enseña el vídeo del ordenador cuando hay dos (su póster de PC pesaba 100 KB y en el teléfono no se
   lee); la pestaña «En el ordenador» sigue con sus capturas. */
@media (max-width: 860px) { .tut-videos--dos .tut-video--pc { display: none; } }

/* ═══ Arreglador LD (14-nov-2026) ═══ */
/* L11/L15 · puntos del ámbar distintos en cada pestaña: solo se ve el de la abierta (sin JS, con :target como las pestañas). */
.tut-solo-pc { display: none; }
.tut-main:has(.tut-flujo--pc:target) .tut-solo-pc, .tut-main:has(.tut-flujo--pc :target) .tut-solo-pc { display: list-item; }
.tut-main:has(.tut-flujo--pc:target) .tut-solo-m, .tut-main:has(.tut-flujo--pc :target) .tut-solo-m { display: none; }
@media print { .tut-solo-pc { display: list-item !important; } }

/* L14 · ▶ grande en el centro del póster (lo pone js/tutoriales.js; sin JS quedan los controles de siempre). En el móvil, también
   «⛶ Pantalla completa» (L4). Se esconde al reproducir y vuelve al acabar. */
.tut-video-box { position: relative; }
.tut-play-capa { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; pointer-events: none; }
.tut-play-capa[hidden] { display: none; }
.tut-play, .tut-fs { pointer-events: auto; cursor: pointer; font: inherit; }
.tut-play {
  width: 84px; height: 84px; border-radius: 50%; border: 3px solid rgba(255,255,255,.9); background: var(--green); color: #04130c;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .15s;
}
.tut-play:hover { transform: scale(1.06); }
.tut-play svg { width: 34px; height: 34px; margin-left: 5px; }
.tut-play:focus-visible, .tut-fs:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.tut-fs {
  display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0;
  background: rgba(4, 19, 12, .82); color: #fff; font-size: 15px; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.tut-video-aviso { display: none; }
@media (max-width: 760px) {
  .tut-fs { display: inline-flex; }
  /* L4 · el vídeo partido (dueño | cliente) a sangre: todo el ancho del teléfono, sin marco. */
  .tut-video--split .tut-video-box { margin: 0 -22px; padding: 0; border-radius: 0; border-left: 0; border-right: 0; }
  .tut-video--split video { max-width: none; width: 100%; border-radius: 0; box-shadow: none; }
  .tut-video-aviso { display: block; margin-top: 4px; font-weight: 600; color: var(--text); }
}

/* L1 · «Ábrelo en la app»: el botón del ordenador, 44 px. */
.tut-btn { min-height: 44px; }
