/* maxitramites.es — estilo base, sin dependencias. Móvil primero. Tokens de la familia Maxi (guía de color v1.6) copiados de maxiguías.
   Principal de maxitrámites (decisión del usuario del 4-nov-2026): violeta ciruela #8657a7 (#c8a1e5 en oscuro, --c-tramites), con el mismo
   contraste que la terracota de maxiservicios (5,1:1 sobre la crema y 5,3:1 con blanco encima).
   Tema oscuro con [data-theme="dark"], que pone el guion del <head>, y con el del sistema si no hay JavaScript. */
:root {
  color-scheme: light;
  --accent: #e8a455; --bg-body: #fdf8f2; --bg-surface: #fffdfa; --bg-soft: #f8efe4; --border: #eadccb; --border-strong: #dcc7b1;
  --bg-dark: #2c2c2a; --on-dark: #f4ede4; --on-dark-muted: #d3cabf;
  --header-bg: #fffdfa; --header-border: #eadccb; --header-search-bg: #f6eee4; --header-search-border: #eadccb; --header-search-placeholder: #8a7b6e;
  --text-main: #2b2420; --text-muted: #5e5047; --text-light: #776a5e;
  --primary: #8657a7; --primary-hover: #744594; --primary-solid: #8657a7; --primary-solid-hover: #744594; --on-primary: #ffffff;
  --logo-maxi: #2C2C2A; --c-tramites: #8657a7; --c-guias: #347940;
  --c-servicios: #a9532f; --c-ocio: #a52e60; --c-tiendas: #297895;
  --max-w: 1180px; --radius-md: 10px; --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(61, 48, 40, 0.07); --shadow-md: 0 10px 25px -5px rgba(61, 48, 40, 0.10);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg-body: #262629; --bg-surface: #303033; --bg-soft: #2b2b2e; --border: #444447; --border-strong: #55524f;
  --bg-dark: #1c1c1e; --on-dark: #f4ede4; --on-dark-muted: #bdb3a8;
  --header-bg: #1c1c1e; --header-border: #444447; --header-search-bg: #303033; --header-search-border: #4a4a4d; --header-search-placeholder: #9a9187;
  --text-main: #f4ede4; --text-muted: #bdb3a8; --text-light: #a89f95;
  --primary: #c8a1e5; --primary-hover: #dcc3ef; --primary-solid: #8657a7; --primary-solid-hover: #744594; --on-primary: #ffffff;
  --logo-maxi: #f4ede4; --c-tramites: #c8a1e5; --c-guias: #75c783;
  --c-servicios: #e08b64; --c-ocio: #e479a6; --c-tiendas: #64bfe0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35); --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.55);
}
/* Sin JavaScript (sin data-theme), el tema del sistema */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg-body: #262629; --bg-surface: #303033; --bg-soft: #2b2b2e; --border: #444447; --border-strong: #55524f;
    --bg-dark: #1c1c1e; --on-dark: #f4ede4; --on-dark-muted: #bdb3a8;
    --header-bg: #1c1c1e; --header-border: #444447; --header-search-bg: #303033; --header-search-border: #4a4a4d; --header-search-placeholder: #9a9187;
    --text-main: #f4ede4; --text-muted: #bdb3a8; --text-light: #a89f95;
    --primary: #c8a1e5; --primary-hover: #dcc3ef; --primary-solid: #8657a7; --primary-solid-hover: #744594; --on-primary: #ffffff;
    --logo-maxi: #f4ede4; --c-tramites: #c8a1e5; --c-guias: #75c783;
    --c-servicios: #e08b64; --c-ocio: #e479a6; --c-tiendas: #64bfe0;
  }
}

* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text-main); background: var(--bg-body);
  -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); margin: 0 0 12px; font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin: 0 0 14px; font-weight: 750; }
p { margin: 0 0 12px; }
.ancho { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 8px 14px; border-radius: var(--radius-md); background: var(--primary-solid);
  color: var(--on-primary); }
.saltar:focus { top: 12px; }
.entradilla { font-size: 1.1rem; color: var(--text-muted); max-width: 62ch; }
.nota { font-size: .9rem; color: var(--text-light); margin-top: 14px; }

/* Cabecera: logotipo (la lupa y «trámites» en --c-tramites por currentColor; «maxi» en --logo-maxi), menú y botón de tema */
.cabecera { background: var(--header-bg); border-bottom: 1px solid var(--header-border); }
.cabecera .ancho { display: flex; align-items: center; gap: 8px 20px; min-height: 68px; flex-wrap: wrap; }
.marca { display: inline-flex; color: var(--c-tramites); margin-right: auto; }
.marca:hover .logotipo { opacity: .85; }
.logotipo { display: block; height: 42px; width: auto; }
.menu { display: flex; gap: 4px 18px; flex-wrap: wrap; font-size: .95rem; font-weight: 600; }
.menu a { color: var(--text-main); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.menu a:hover, .menu a[aria-current="page"] { border-bottom-color: var(--primary); }
.tema { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; flex-shrink: 0; cursor: pointer;
  color: var(--text-main); background: var(--header-search-bg); border: 1px solid var(--header-search-border); border-radius: 999px; }
.tema:hover { border-color: var(--primary); }
/* Móvil: logotipo y botón del tema en la primera línea; el menú, debajo y a todo el ancho */
@media (max-width: 599px) {
  .cabecera .ancho { gap: 0 12px; padding-top: 10px; min-height: 0; }
  .logotipo { height: 36px; }
  .menu { order: 3; flex-basis: 100%; gap: 22px; padding: 4px 0 2px; }
  .menu a { padding: 8px 0; }
}
.tema svg { width: 18px; height: 18px; }
.tema .sol { display: none; }
[data-theme="dark"] .tema .sol { display: block; }
[data-theme="dark"] .tema .luna { display: none; }


/* Páginas */
.pagina { padding-top: clamp(24px, 5vw, 48px); padding-bottom: 56px; max-width: 860px; }
.pagina h2 { margin-top: 36px; }
.pagina h3 { margin: 22px 0 8px; font-size: 1.1rem; }
.pagina h4 { margin: 14px 0 6px; font-size: 1rem; }
.migas { font-size: .9rem; color: var(--text-light); margin-bottom: 14px; }
.lista { padding-left: 1.2em; }
.lista li { margin-bottom: 6px; }
.boton { display: inline-block; font-weight: 700; text-decoration: none; border-radius: 999px; padding: 11px 22px; margin-top: 8px;
  border: 1px solid var(--border-strong); color: var(--text-main); background: var(--bg-surface); }
.boton:hover { border-color: var(--primary); }
.boton-principal { background: var(--primary-solid); color: var(--on-primary); border-color: transparent; }
.boton-principal:hover { background: var(--primary-solid-hover); }

/* Formulario «qué y dónde» */
.elegir { display: grid; gap: 12px; margin: 18px 0; padding: 16px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
@media (min-width: 720px) { .elegir { grid-template-columns: 1.3fr 1fr auto; align-items: end; } }
.campo { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; color: var(--text-muted); }
.campo select, .campo input { font: inherit; font-size: 1rem; color: var(--text-main); background: var(--bg-body); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); padding: 10px 12px; width: 100%; min-width: 0; }
.campo select:focus, .campo input:focus { outline: none; border-color: var(--primary); }
.elegir button { font: inherit; font-weight: 700; border: 0; border-radius: 999px; background: var(--primary-solid); color: var(--on-primary);
  padding: 11px 22px; cursor: pointer; }
.elegir button:hover { background: var(--primary-solid-hover); }

/* Campos con sugerencias («Qué» y «Dónde») y «Usar mi ubicación» (assets/lugar.js) */
.campo-combo { position: relative; }
.campo-lugar input[name="lugar"] { padding-right: 46px; }
.ubicacion { position: absolute; right: 5px; bottom: 5px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; cursor: pointer;
  color: var(--primary); background: transparent; border: 0; border-radius: 8px; }
.elegir .ubicacion { background: transparent; padding: 0; color: var(--primary); border-radius: 8px; }
.elegir .ubicacion:hover { background: var(--bg-soft); }
.ubicacion svg { width: 20px; height: 20px; }
.ubicacion:disabled { opacity: .5; cursor: progress; }
.sugerencias { max-height: min(420px, 60vh); overflow-y: auto; position: absolute; left: 0; top: 100%; min-width: 100%; width: max-content; max-width: min(460px, calc(100vw - 32px)); z-index: 5; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--bg-surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-weight: 600; color: var(--text-main); }
.sugerencias li { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.sugerencias li span { font-weight: 400; color: var(--text-light); font-size: .85rem; white-space: nowrap; }
.campo-tramite .sugerencias li { flex-direction: column; gap: 1px; }
.sugerencias li.grupo { position: sticky; top: -4px; z-index: 1; display: block; padding: 10px 10px 4px; cursor: default; font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--primary); background: var(--bg-surface); border-radius: 0; }
.sugerencias li.grupo:hover { background: var(--bg-surface); }
.sugerencias li:hover, .sugerencias li[aria-selected="true"] { background: var(--bg-soft); }
.ubicacion-msg { grid-column: 1 / -1; margin: 0; font-size: .88rem; color: var(--text-muted); }
.ubicacion-msg:empty { display: none; }

/* La respuesta */
.respuesta { margin-top: 24px; padding: 18px 20px; border: 1px solid var(--border); border-left: 4px solid var(--primary-solid);
  border-radius: var(--radius-lg); background: var(--bg-surface); }
.respuesta h2 { margin-top: 0; }
.organismo { font-size: 1.2rem; font-weight: 750; margin-bottom: 6px; }
.cita { margin: 14px 0; }
.cambio { padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-soft); }
.pendiente { padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-soft); color: var(--text-muted); font-size: .92rem; }
.oficinas { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.oficina { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-body); font-size: .95rem; }
.internet { padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-soft); }
.internet-estado { font-weight: 750; }
.datos { display: grid; gap: 10px; margin: 24px 0; }
@media (min-width: 600px) { .datos { grid-template-columns: 1fr 1fr; } }
.datos div { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.datos dt { font-size: .85rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: .04em; }
.datos dd { margin: 4px 0 0; }
.faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq details p { margin: 8px 0 0; color: var(--text-muted); }
.lugares { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lugares a { display: inline-block; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-surface);
  color: var(--text-main); text-decoration: none; font-weight: 600; font-size: .92rem; }
.lugares a:hover { border-color: var(--primary); color: var(--primary); }
.tramites { list-style: none; padding: 0; display: grid; gap: 10px; }
@media (min-width: 720px) { .tramites { grid-template-columns: 1fr 1fr; } }
.tramites a { display: grid; gap: 4px; height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-surface); text-decoration: none; color: var(--text-main); }
.tramites a:hover { border-color: var(--primary); }
.tramites-portada a { padding: 11px 14px; }
.tema-titulo { margin: 22px 0 10px; font-size: 1.05rem; color: var(--text-muted); }
.tramites span { font-size: .92rem; color: var(--text-muted); }

/* Otros trámites, por tema (partes/otros_tramites.php) */
.otros { margin-top: 44px; }
/* En columnas (sin huecos entre tarjetas de distinta altura); el tema del trámite actual, a todo el ancho encima */
.otros-temas { columns: 3 240px; column-gap: 14px; }
.otro-tema { break-inside: avoid; margin-bottom: 14px; padding: 12px 16px 6px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.otro-tema-actual { border-color: var(--primary); column-span: all; }
.pagina .otro-tema h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: .98rem; }
.otro-tema h3 small { display: block; font-size: .75rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; }
.otro-foto { flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.otro-tema ul { list-style: none; margin: 0; padding: 0; }
.otro-tema-actual ul { display: grid; column-gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.otro-tema li { border-top: 1px solid var(--border); }
.otro-tema a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; color: var(--text-main); text-decoration: none; font-size: .9rem;
  font-weight: 500; line-height: 1.35; }
.otro-tema a::after { content: "›"; color: var(--primary); font-weight: 800; }
.otro-tema a:hover { color: var(--primary); }

/* Gestorías de maxiservicios: separado de la respuesta oficial */
.gestoria { margin-top: 32px; padding: 16px 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.gestoria-etiqueta { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); margin-bottom: 6px; }
/* Fuentes oficiales: tarjeta con la fecha de comprobación y cada fuente con su web; debajo, el aviso de errores */
.fuentes { margin-top: 40px; padding: clamp(18px, 3vw, 26px); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.fuentes-cabeza { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.pagina .fuentes h2 { margin: 0; }
.comprobado { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700;
  color: var(--primary); background: var(--bg-soft); border: 1px solid var(--border); }
.comprobado svg { width: 15px; height: 15px; }
.fuentes-nota { color: var(--text-muted); font-size: .92rem; margin: 10px 0 16px; }
.fuentes-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 720px) { .fuentes-lista { grid-template-columns: 1fr 1fr; } }
.fuentes-lista a { display: grid; gap: 2px; height: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-body); text-decoration: none; color: var(--text-main); }
.fuentes-lista a:hover { border-color: var(--primary); }
.fuente-titulo { font-weight: 650; font-size: .95rem; line-height: 1.35; }
.fuente-web { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--primary); }
.fuente-web svg { width: 13px; height: 13px; }
.avisar { margin-top: 18px; padding: 0; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-md); }
.avisar summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; font-size: .95rem; color: var(--text-muted); }
.avisar summary::-webkit-details-marker { display: none; }
.avisar summary strong { color: var(--text-main); }
.avisar summary::after { content: "›"; margin-left: auto; font-size: 1.4rem; line-height: 1; color: var(--primary); transition: transform .15s; }
.avisar[open] summary::after { transform: rotate(90deg); }
.avisar-icono { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--primary-solid);
  color: var(--on-primary); font-weight: 800; }
.avisar form { display: grid; gap: 12px; padding: 0 16px 16px; margin: 0; }
.avisar textarea, .avisar input[type=email] { font: inherit; font-size: 1rem; color: var(--text-main); background: var(--bg-surface);
    border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: 10px 12px; width: 100%; box-sizing: border-box; }
.avisar textarea:focus, .avisar input[type=email]:focus { outline: none; border-color: var(--primary); }
.avisar button { justify-self: start; font: inherit; cursor: pointer; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Colores de los portales de la red (los logotipos toman currentColor) */
.p-maxiservicios { --pc: var(--c-servicios); }
.p-maxiocio { --pc: var(--c-ocio); }
.p-maxitiendas { --pc: var(--c-tiendas); }
.p-maxiguias { --pc: var(--logo-maxi); }

/* Portada por bandas, como maxiguías */
.portada { display: block; }
/* Héroe con foto a todo el ancho bajo un velo oscuro, más denso donde va el texto: en los dos temas, texto claro */
.heroe { position: relative; z-index: 2; isolation: isolate; background: var(--bg-dark); color: var(--on-dark); }
/* Sin overflow: hidden, para que las sugerencias del formulario salgan por debajo del héroe; la foto y el velo no se salen (inset: 0) */
.heroe-sin-foto { background: linear-gradient(120deg, #2a2030 0%, #3b2a4a 60%, #5a3d73 100%); }
/* La foto de fondo, en su propia capa recortada: el héroe no recorta (las sugerencias del formulario salen por debajo) */
.heroe-capa { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.heroe-fondo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.heroe::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(30, 22, 34, .88) 0%, rgba(30, 22, 34, .74) 48%, rgba(30, 22, 34, .2) 100%); }
.heroe-dentro { padding-top: clamp(44px, 8vw, 96px); padding-bottom: clamp(44px, 7vw, 88px); }
.heroe-foto { display: none; }
/* Ordenador: título y foto enmarcada arriba; el formulario y las píldoras, a todo el ancho debajo. El fondo, la misma foto desenfocada */
@media (min-width: 961px) {
  .heroe-dentro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); column-gap: clamp(32px, 5vw, 72px); align-items: center; }
  .heroe-dentro > .elegir, .heroe-dentro > .ejemplos { grid-column: 1 / -1; }
  .heroe-foto { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 72% 40%; border-radius: 22px;
    box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .6); }
  .heroe-fondo { filter: blur(26px) saturate(1.05); transform: scale(1.12); }
  .heroe::before { background: rgba(30, 22, 34, .72); }
}
.heroe h1 { max-width: 20ch; text-shadow: 0 1px 14px rgba(0, 0, 0, .3); }
.heroe .antetitulo, .heroe .entradilla, .heroe .ejemplos { color: var(--on-dark); }
/* El formulario y las píldoras, al ancho del resto de bloques; el título y la entradilla, a su medida de lectura (20ch y 62ch) */
.heroe .elegir { box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .6); margin: 24px 0 16px; }
.heroe .ejemplos a { color: var(--on-dark); background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .32); }
.heroe .ejemplos a:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .6); }
.heroe :focus-visible { outline-color: var(--on-dark); }
@media (max-width: 720px) { .heroe::before { background: rgba(30, 22, 34, .74); } }
.antetitulo { font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); margin-bottom: 14px; }
.ejemplos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; color: var(--text-light); }
.ejemplos span { font-weight: 600; margin-right: 2px; }
.ejemplos a { color: var(--text-main); text-decoration: none; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; }
.banda { padding: clamp(36px, 6vw, 64px) 0; }
.banda > .ancho > .entradilla { margin-bottom: 24px; }
.banda-suave { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* Los temas: tarjeta con foto y sus trámites */
.temas { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.tema-tarjeta { display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); scroll-margin-top: 16px; }
.tema-tarjeta:target { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.tema-foto { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 4px solid var(--primary-solid); }
.tema-cuerpo { padding: 16px 18px 12px; }
.tema-cuerpo h3 { margin: 0 0 8px; font-size: 1.12rem; }
.tema-cuerpo ul { list-style: none; margin: 0; padding: 0; }
.tema-cuerpo li + li { border-top: 1px solid var(--border); }
.tema-cuerpo a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; color: var(--text-main); text-decoration: none; font-weight: 600;
  font-size: .95rem; }
.tema-cuerpo a::after { content: "›"; color: var(--primary); font-weight: 800; }
.tema-cuerpo a:hover { color: var(--primary); }

/* Cómo funciona: tres pasos numerados */
.pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  counter-reset: paso; }
.pasos li { counter-increment: paso; display: grid; align-content: start; gap: 4px; padding: 20px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); }
.pasos li::before { content: counter(paso); display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 8px; border-radius: 999px;
  background: var(--primary-solid); color: var(--on-primary); font-weight: 800; }
.pasos strong { font-size: 1.08rem; }
.pasos span { color: var(--text-muted); }

/* Gestorías y por qué fiarse */
.dos { display: grid; gap: 24px 40px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: center; }
.bloque-oscuro { --relleno: clamp(22px, 4vw, 34px); background: var(--bg-dark); color: var(--on-dark); border-radius: var(--radius-lg);
  padding: var(--relleno); overflow: hidden; }
.bloque-foto { display: block; width: calc(100% + 2 * var(--relleno)); max-width: none; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  margin: calc(-1 * var(--relleno)) calc(-1 * var(--relleno)) 22px; }
.bloque-oscuro p { color: var(--on-dark-muted); }
.bloque-oscuro .gestoria-etiqueta { color: var(--on-dark-muted); }
.claves ul { margin: 0 0 14px; padding-left: 20px; }
.claves li { margin-bottom: 8px; color: var(--text-muted); }
.claves strong { color: var(--text-main); }

/* Páginas de un trámite: el título con la foto de su tema */
.cabeza.con-foto img { display: block; width: 100%; height: auto; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); margin: 8px 0 12px; }
@media (min-width: 760px) {
  .cabeza.con-foto { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 32px; align-items: center; }
  .cabeza.con-foto img { margin: 0; aspect-ratio: 3 / 2; }
}

/* Pie: marca y aviso, temas, más buscados y el sitio; debajo, la red maxiguías y la línea legal */
.pie { border-top: 1px solid var(--header-border); background: var(--header-bg); font-size: .9rem; color: var(--text-muted); padding: 40px 0 22px; }
.pie-columnas { display: grid; gap: 28px 40px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); padding-bottom: 28px; }
@media (min-width: 960px) { .pie-columnas { grid-template-columns: 1.5fr 1.2fr 1.2fr .8fr; } }
.pie .marca { margin-bottom: 12px; }
.pie .logotipo { height: 38px; }
.pie-aviso { font-size: .85rem; color: var(--text-light); }
.pie-aviso strong { color: var(--text-muted); }
.pie h2 { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-main); margin: 6px 0 12px; }
.pie nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.pie nav a { color: var(--text-muted); text-decoration: none; }
.pie nav a:hover { color: var(--primary); text-decoration: underline; }
.pie-red { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 18px 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.pie-red p { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.pie-otros { margin-left: auto !important; }
@media (max-width: 720px) { .pie-otros { margin-left: 0 !important; flex-basis: 100%; } }
.pie-red ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.pie-portal { display: inline-flex; color: var(--pc); }
.pie-portal:hover { opacity: .8; }
.logotipo-red { display: block; height: 26px; width: auto; }
.pie-legal { margin: 0; font-size: .82rem; color: var(--text-light); }

@media (prefers-reduced-motion: no-preference) {
  .tema-tarjeta, .ejemplos a, .tema, .boton, .tramites a { transition: border-color .15s, background-color .15s, color .15s; }
}

/* AdSense (app/Views/partes/anuncio.php): separado de la respuesta oficial, con su etiqueta y la altura reservada (sin saltos al cargar) */
.anuncio { margin: 32px 0; min-height: 280px; padding-top: 6px; border-top: 1px solid var(--border); }
.anuncio-etiqueta { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-light);
  margin-bottom: 6px; }

/* Legales: en una tarjeta, con pestañas para pasar de una a otra, como en maxiguías */
.legal-menu { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.legal-menu a { color: var(--text-main); text-decoration: none; font-size: .92rem; font-weight: 600; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; }
.legal-menu a:hover { border-color: var(--primary); }
.legal-menu a[aria-current="page"] { color: var(--on-primary); background: var(--primary-solid); border-color: var(--primary-solid); }
.legal { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px clamp(18px, 4vw, 32px) 24px; }
.legal h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-top: 20px; }
.legal h2 { font-size: 1.15rem; margin: 26px 0 8px; }
.legal li { margin: 4px 0; }
.tabla-scroll { overflow-x: auto; margin: 12px 0; }
.tabla-scroll table { border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.tabla-scroll th, .tabla-scroll td { border: 1px solid var(--border); padding: 6px 8px; vertical-align: top; text-align: left; }
.pie-enlaces { margin-bottom: 6px; }
.pie-enlaces a { color: var(--text-muted); }
