/* Acordis — hoja compartida de la aplicación.
   La cargan el panel (index.html), las páginas públicas (solicitud, firma,
   acuse, constancia, aviso), los impresos y la plataforma interna.
   Sistema "Tinta notarial": ver DESIGN.md en la raíz del repo.

   Reglas que esta hoja fija para todos:
   - Un solo juego de tokens. Ningún archivo vuelve a declarar :root.
   - Seis tamaños de texto (--t-*). Si un tamaño no está aquí, no existe.
   - Tres botones: .btn (primario), .btn--secondary, .btn--quiet. Una
     acción primaria por vista.
   - El radio dice el material: papel 2px, controles 8px, tarjetas 10px,
     sellos 2px.
   - El foco siempre se ve. Nadie pone outline: none. */

:root {
  --paper: #f2f0e9;
  --paper-deep: #e8e5d8;
  --surface: #fcfbf7;
  --line: #ddd9ca;
  --line-soft: #e7e4d8;
  --ink: #1c1b18;
  --ink-soft: #5b6353;
  /* 4.65:1 sobre --paper. Sirve para texto informativo pequeño; el valor
     anterior (#8b927f, 3.1:1) solo servía para decoración. */
  --ink-faint: #676e5b;
  /* Identidad "Corte diagonal" (oct 2026): verde #123c2c, ámbar #b9812e. */
  --brand: #123c2c;
  --brand-deep: #0b2419;
  --brand-tint: #e4ece5;
  --brand-line: #b5c9ba;
  /* Ámbar para texto (≥4.5:1 sobre papel y sobre --cobre-tint). El ámbar
     de la marca (--ambar) no llega a 4.5:1: solo gráficos y bordes. */
  --cobre: #8a5a1c;
  --cobre-tint: #f5ecdc;
  --cobre-line: #dcc49c;
  --ambar: #b9812e;
  --marca-simbolo: url("/marca/simbolo.svg");
  --ok: #1e6e3f;
  --ok-tint: #ddefdd;
  --ok-line: #a9d4ae;
  --warn: #8a5a10;
  --warn-tint: #f4e8cf;
  --warn-line: #dcc389;
  --err: #ab3226;
  --err-tint: #f6e0da;
  --err-line: #e4b1a7;
  --btn-ink: #fdfcf3;

  /* Alias de compatibilidad: el panel los usaba sin haberlos definido. */
  --card: var(--surface);
  --gray: var(--ink-faint);

  --radius: 8px;          /* controles */
  --radius-card: 10px;    /* tarjetas y paneles */
  --radius-paper: 2px;    /* hojas y sellos */
  --shadow-1: 0 1px 2px rgba(30, 36, 29, .06);
  --shadow-2: 0 10px 28px -14px rgba(30, 36, 29, .28);
  --doc-shadow: rgba(30, 36, 29, .3);
  --doc-edge: rgba(30, 36, 29, .09);
  --velo: rgba(18, 60, 44, .38);

  --font-ui: 'Public Sans', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;

  /* Escala tipográfica. Seis pasos y nada más. */
  --t-xs: .72rem;    /* sellos, folios, etiquetas mono */
  --t-sm: .8rem;     /* meta, ayudas, pies */
  --t-md: .9rem;     /* cuerpo de interfaz */
  --t-lg: 1.05rem;   /* títulos de tarjeta y de sección */
  --t-xl: 1.55rem;   /* título de vista */
  --t-num: 2rem;     /* la cifra que importa */

  --btn-h: 40px;
  --btn-h-sm: 32px;
  --input-h: 44px;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; }
/* El atributo hidden y la clase .hidden ganan siempre. */
[hidden], .hidden { display: none !important; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
.mono { font-family: var(--font-mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:is(button, a, input, select, textarea, summary, canvas, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Marca ────────────────────────────────────────────────────────────── */
/* Símbolo (el corte diagonal) + "Acordis" en Fraunces. El símbolo va de
   fondo para que el nombre siga siendo texto. Sobre fondo oscuro, la página
   cambia --marca-simbolo a /marca/simbolo-claro.svg. */
.wordmark {
  display: inline-flex; align-items: baseline;
  font-family: var(--font-display); font-variation-settings: "opsz" 30;
  font-weight: 600; font-size: 1.45rem; letter-spacing: -.012em; line-height: 1;
  color: var(--brand); text-decoration: none;
}
.wordmark::before {
  content: ""; flex: none; align-self: center; width: 1.3em; height: 1.3em; margin-right: .34em;
  background: var(--marca-simbolo) center / contain no-repeat;
}
.wordmark i, .wordmark em { font-style: italic; }
@media print { .wordmark::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Membrete de la inmobiliaria: logo si lo subió, si no el nombre. Es lo
   primero que ve el inquilino en cualquier página pública. */
.membrete {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.membrete__marca { display: flex; align-items: center; gap: 12px; min-width: 0; }
.membrete__logo { display: block; max-height: 44px; max-width: 180px; object-fit: contain; }
.membrete__nombre {
  font-family: var(--font-display); font-variation-settings: "opsz" 24;
  font-weight: 600; font-size: 1.2rem; line-height: 1.15; letter-spacing: -.01em;
}
.membrete__sub {
  display: block; font-family: var(--font-mono); font-size: var(--t-xs);
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px;
}
.membrete__meta { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-faint); text-align: right; }

/* Pie de página pública: quién lo hace posible y a quién escribir. */
.pie-acordis {
  margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 8px 20px; flex-wrap: wrap;
  font-size: var(--t-sm); color: var(--ink-faint);
}
.pie-acordis .wordmark { font-size: 1.05rem; color: var(--ink-soft); }
.pie-acordis a { color: var(--ink-soft); }

/* ── Botones ──────────────────────────────────────────────────────────── */
.btn, .btn-primary,
.btn--secondary, .btn-secondary,
.btn--quiet, .btn-quiet {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-weight: 600; font-size: .88rem; line-height: 1.2;
  min-height: var(--btn-h); padding: 0 18px; border-radius: var(--radius);
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn, .btn-primary { background: var(--brand); border-color: var(--brand); color: var(--btn-ink); }
.btn:hover, .btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn--secondary, .btn-secondary { background: transparent; border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn--secondary:hover, .btn-secondary:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--ink); }
.btn--quiet, .btn-quiet {
  background: transparent; border-color: transparent; color: var(--brand-deep);
  min-height: var(--btn-h-sm); padding: 0 8px; font-size: var(--t-sm);
  text-decoration: underline; text-underline-offset: 3px;
}
.btn--quiet:hover, .btn-quiet:hover { background: var(--brand-tint); }
.btn--small { min-height: var(--btn-h-sm); padding: 0 12px; font-size: var(--t-sm); }
.btn--block { width: 100%; }
.btn--danger:hover, .btn-secondary.danger:hover { border-color: var(--err); color: var(--err); background: var(--err-tint); }
/* Deshabilitado se ve deshabilitado. En firma.html el botón bloqueado era
   idéntico al activo y el usuario tocaba sin que pasara nada. */
:is(.btn, .btn-primary, .btn--secondary, .btn-secondary, .btn--quiet, .btn-quiet):is(:disabled, [aria-disabled="true"]) {
  opacity: .45; cursor: not-allowed; pointer-events: auto;
}
:is(.btn, .btn-primary):is(:disabled, [aria-disabled="true"]):hover { background: var(--brand); border-color: var(--brand); }

/* ── Sellos ───────────────────────────────────────────────────────────── */
/* Rectangular, mono, mayúsculas, borde y tinte: el sello de estatus del
   sistema. 11.5px mínimo; a 9.6px era la etiqueta más frecuente del panel y
   la menos legible. */
.sello {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 600;
  line-height: 1.2; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 7px; border: 1px solid var(--brand-line); border-radius: var(--radius-paper);
  background: var(--brand-tint); color: var(--brand-deep); white-space: nowrap; vertical-align: middle;
}
.sello--ok { background: var(--ok-tint); border-color: var(--ok-line); color: var(--ok); }
.sello--warn { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.sello--err { background: var(--err-tint); border-color: var(--err-line); color: var(--err); }
.sello--cobre { background: var(--cobre-tint); border-color: var(--cobre-line); color: var(--cobre); }
.sello--soft { background: var(--paper); border-color: var(--line); color: var(--ink-soft); }
.sello--solido { background: var(--err); border-color: var(--err); color: #fff; }
.sello--punteado { border-style: dashed; background: transparent; }
/* La estampa: el sello grande de un documento (Firmado, Sin firmas, Pagado,
   Borrador). Sin tinte de fondo, borde grueso, ligeramente girado. */
.sello--estampa {
  flex-direction: column; gap: 2px; background: transparent;
  border-width: 2px; border-color: currentColor; color: var(--brand);
  font-size: .8rem; padding: 7px 12px 6px; letter-spacing: .12em;
  transform: rotate(-6deg);
}
.sello--estampa small { font-size: .58rem; font-weight: 500; letter-spacing: .06em; }
.sello--estampa.sello--soft { color: var(--ink-faint); }
.sello--estampa.sello--warn { color: var(--warn); }
.sello--estampa.sello--err { color: var(--err); }
.sello--estampa.sello--cobre { color: var(--cobre); }
.sello--estampa.sello--ok { color: var(--ok); }

/* ── Tarjetas, avisos y estados ───────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow-1);
}
.card__titulo { font-size: var(--t-lg); font-weight: 700; margin-bottom: 4px; }
.card__sub { font-size: var(--t-sm); color: var(--ink-soft); margin-bottom: 14px; }

.aviso {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  padding: 13px 16px; font-size: var(--t-md); color: var(--ink); margin-bottom: 16px;
}
.aviso--ok { background: var(--ok-tint); border-color: var(--ok-line); color: var(--ok); }
.aviso--warn { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.aviso--err { background: var(--err-tint); border-color: var(--err-line); color: var(--err); }
.aviso--brand { background: var(--brand-tint); border-color: var(--brand-line); color: var(--brand-deep); }

/* Estado vacío: invita a actuar y trae la acción adentro. */
.vacio {
  padding: 28px 20px; border: 1px dashed var(--line); border-radius: var(--radius-card);
  text-align: center; color: var(--ink-soft); font-size: var(--t-md);
}
.vacio .btn, .vacio .btn-primary, .vacio .btn--secondary { margin-top: 12px; }
.estado { text-align: center; color: var(--ink-soft); padding: 48px 20px; font-size: var(--t-md); }
.estado--err { color: var(--err); }

/* Pantalla de éxito: check dibujado, título y qué sigue. */
.exito { text-align: center; padding: 8px 4px 4px; }
.exito__check {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--ok-tint); border: 1.5px solid var(--ok);
  display: flex; align-items: center; justify-content: center;
}
.exito__check svg { width: 30px; height: 30px; }
.exito__check svg path {
  stroke: var(--ok); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 24; stroke-dashoffset: 24;
  animation: exitoCheck .5s .15s ease forwards;
}
@keyframes exitoCheck { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .exito__check svg path { animation: none; stroke-dashoffset: 0; } }
.exito__titulo { font-family: var(--font-display); font-variation-settings: "opsz" 30; font-weight: 600; font-size: 1.45rem; margin-bottom: 8px; }
.exito__texto { color: var(--ink-soft); max-width: 44ch; margin: 0 auto; }
.exito__pasos { list-style: none; margin: 22px 0 0; padding: 0; text-align: left; border-top: 1px solid var(--line); }
.exito__pasos li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.exito__pasos li span { font-size: var(--t-md); }

/* Guía de pasos numerados para flujos públicos (solicitud, firma). */
.num-paso {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 24px; height: 24px; border-radius: var(--radius-paper);
  background: var(--brand); color: var(--btn-ink);
  font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 600;
}
.num-paso--hecho { background: var(--ok); }
.num-paso--pendiente { background: var(--paper-deep); color: var(--ink-faint); }
.titulo-paso { display: flex; align-items: center; gap: 10px; font-size: var(--t-lg); font-weight: 700; margin-bottom: 4px; }

/* ── Campos ───────────────────────────────────────────────────────────── */
.campo { margin-bottom: 14px; }
.campo > label, .campo > legend { display: block; font-size: var(--t-sm); font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.campo :is(input, select, textarea),
.input {
  width: 100%; min-height: var(--input-h); padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font-size: 1rem; font-family: var(--font-ui);
}
.campo textarea { min-height: 72px; resize: vertical; }
.campo :is(input, select, textarea):focus, .input:focus {
  border-color: var(--brand); background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
/* El anillo de teclado se pega al borde del campo: el halo de tinte ya da
   el aire. Nunca outline: none. */
.campo :is(input, select, textarea):focus-visible, .input:focus-visible { outline-offset: 0; }
.campo [aria-invalid="true"] { border-color: var(--err); }
.campo__ayuda { font-size: var(--t-sm); color: var(--ink-soft); margin-top: 5px; }
.campo__ayuda--err { color: var(--err); font-weight: 600; }
.campo-fila { display: flex; gap: 12px; flex-wrap: wrap; }
.campo-fila .campo { flex: 1 1 200px; min-width: 0; }
.opcion-check { display: flex; align-items: flex-start; gap: 10px; }
.opcion-check input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; accent-color: var(--brand); }

/* ── Progreso de subidas y descargas (progreso-carga.js) ──────────────── */
/* Barra delgada pegada al borde superior y una etiqueta breve debajo. El
   avance lo simula el script; aquí solo se pinta --carga-valor (0 a 1). */
.carga {
  --carga-valor: 0;
  position: fixed; top: 0; left: 0; right: 0; z-index: 210;
  pointer-events: none;
  opacity: 0; transition: opacity .25s ease;
}
.carga--activa { opacity: 1; }
.carga--fin { transition-delay: .2s; opacity: 0; }
.carga__barra {
  height: 3px; background: var(--brand-line);
  position: relative; overflow: hidden;
}
.carga__barra::before {
  content: ""; position: absolute; inset: 0;
  background: var(--brand);
  transform-origin: left center;
  transform: scaleX(var(--carga-valor));
  transition: transform .2s linear;
}
/* Brillo que recorre la parte llena: da la sensación de movimiento aunque
   el avance se haya frenado cerca del final. */
.carga__barra::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: carga-brillo 1.1s ease-in-out infinite;
}
@keyframes carga-brillo { from { left: -30%; } to { left: 100%; } }
.carga__etiqueta {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  box-shadow: var(--shadow-2);
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .carga__barra::after { display: none; }
}

/* ── Toasts ───────────────────────────────────────────────────────────── */
#toast-zone, .toast-zone {
  position: fixed; right: 16px; bottom: 16px; left: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius); padding: 11px 16px;
  font-size: var(--t-sm); font-weight: 500;
  box-shadow: var(--shadow-2);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .25s ease;
  max-width: min(360px, 100%);
}
.toast.ok::before, .toast--ok::before { content: "✓"; color: var(--brand-line); font-weight: 700; }
.toast.err, .toast--err { background: var(--err); color: #fff; }
.toast.err::before, .toast--err::before { content: "!"; font-weight: 700; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.saliendo { opacity: 0; transition: opacity .3s ease; }

/* ── Puerta de sesión (impresos y páginas que exigen panel) ───────────── */
.puerta { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.puerta__card {
  width: 100%; max-width: 360px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 32px 28px; box-shadow: var(--shadow-2);
}
.puerta__card h1 { font-family: var(--font-display); font-variation-settings: "opsz" 24; font-weight: 600; font-size: 1.3rem; margin-bottom: 8px; }
.puerta__card p { font-size: var(--t-md); color: var(--ink-soft); margin: 0 0 18px; }

/* ── Lienzo de firma ──────────────────────────────────────────────────── */
/* Una caja de papel con línea base y la cruz notarial: se entiende "aquí
   firmas" sin leer nada. Misma caja en firma.html y acuse.html. */
.lienzo-firma { position: relative; }
.lienzo-firma canvas {
  width: 100%; height: 200px; display: block;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-paper);
  touch-action: none; cursor: crosshair;
}
.lienzo-firma::before {
  content: ""; position: absolute; left: 24px; right: 24px; bottom: 44px; height: 1px;
  background: var(--line); pointer-events: none;
}
.lienzo-firma::after {
  content: "×"; position: absolute; left: 12px; bottom: 30px;
  font-family: var(--font-mono); font-size: 1.1rem; color: var(--ink-faint); pointer-events: none;
}
.lienzo-firma__acciones { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: var(--t-sm); color: var(--ink-soft); }

/* ── Guía ─────────────────────────────────────────────────────────────── */
/* Panel de ayuda del panel (guia.js). Complementario, no modal: nunca
   atenúa la pantalla de trabajo; solo el resaltado de "Muéstrame dónde"
   pone velo, y por debajo de la guía (65 contra 70). */

/* Botón al pie de la barra lateral, encima del usuario. Toma él el
   margin-top: auto que antes empujaba a .sidebar__user (0,2,0 gana a la
   regla de index.html). */
.sidebar__guia { margin-top: auto; padding: 0 0 10px; }
.sidebar__guia ~ .sidebar__user { margin-top: 0; }
.guia-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: var(--btn-h); padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-soft);
  font-size: var(--t-sm); font-weight: 500; text-align: left;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.guia-btn svg { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; }
.guia-btn:hover { border-color: var(--brand); background: var(--brand-tint); }
.guia-btn[aria-expanded="true"] { border-color: var(--brand); color: var(--brand-deep); }
.guia-btn__contador { margin-left: auto; font-size: var(--t-xs); color: var(--brand-deep); }
.guia-btn__contador:empty { display: none; }
.guia-btn__punto { width: 7px; height: 7px; border-radius: 50%; background: var(--cobre); flex-shrink: 0; }
.guia-btn__contador:empty + .guia-btn__punto { margin-left: auto; }
.guia-invitacion { font-size: var(--t-xs); color: var(--ink-soft); margin: 6px 2px 0; }
.guia-invitacion .btn--quiet { min-height: var(--btn-h-sm); padding: 0 6px; font-size: var(--t-xs); }
.guia-btn--movil { display: none; }

/* Panel lateral. top respeta la franja de la demo (--franja-h la publica
   demo/simulador.js; en el panel real no existe y vale 0). */
.guia {
  position: fixed; right: 0; top: var(--franja-h, 0px); bottom: 0; width: 368px; z-index: 70;
  background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
  animation: guia-entra .22s ease-out both;
}
@keyframes guia-entra { from { transform: translateX(24px); opacity: 0; } }
@media (min-width: 769px) and (max-width: 1279px) { .guia { box-shadow: var(--shadow-2); } }
/* Con espacio de sobra empuja el contenido en vez de taparlo. */
@media (min-width: 1280px) { body.guia-abierta .main { margin-right: 368px; } }

.guia__scroll { flex: 1; overflow-y: auto; padding: 18px 20px 20px; }
.guia__cabeza { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.guia__cabeza h2 { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; flex: 1; }
.guia__x {
  min-width: var(--btn-h); min-height: var(--btn-h); display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius); background: none; color: var(--ink-soft);
}
.guia__x:hover { background: var(--brand-tint); color: var(--ink); }
.guia__x svg { width: 18px; height: 18px; stroke: currentColor; }
.guia__linea { font-size: var(--t-sm); color: var(--ink-soft); margin: 0 0 16px; }

/* Portada */
.guia__seguir {
  background: var(--brand-tint); border: 1px solid var(--brand-line); border-radius: var(--radius-card);
  padding: 12px 14px; margin-bottom: 18px;
}
.guia__seguir p { margin: 0 0 10px; font-size: var(--t-sm); color: var(--brand-deep); }
.guia__seguir strong { display: block; font-size: var(--t-md); color: var(--ink); }
.guia__todos { font-size: var(--t-sm); color: var(--ink-soft); margin: 0 0 16px; }
.guia__temas { list-style: none; margin: 0; padding: 0; position: relative; }
/* Hilo vertical: los 4 temas son el ciclo de una renta. Pasa por el centro
   de los folios (28px de ancho, pegados a la izquierda). */
.guia__temas::before {
  content: ""; position: absolute; left: 14px; top: 28px; bottom: 28px; width: 1px; background: var(--line);
}
.guia__tema {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 56px; padding: 8px 4px 8px 0; border: 0; border-radius: var(--radius);
  background: none; text-align: left; color: var(--ink);
}
.guia__tema:hover { background: var(--brand-tint); }
.guia__tema-texto { flex: 1; min-width: 0; }
.guia__tema-nombre { display: block; font-size: var(--t-md); font-weight: 600; }
.guia__tema-estado { display: block; font-size: var(--t-sm); color: var(--ink-faint); }
.guia__chevron { width: 16px; height: 16px; stroke: var(--ink-faint); flex-shrink: 0; }
.guia__folio {
  position: relative; flex-shrink: 0; width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-soft);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-paper);
}
.guia__folio--hecho { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.guia__folio--hecho svg { width: 14px; height: 14px; stroke: currentColor; }
.guia__folio--curso { border-color: var(--brand); color: var(--brand-deep); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand); }
.guia__pie { font-size: var(--t-sm); color: var(--ink-faint); margin: 20px 0 0; }
.guia__pie a { color: var(--brand-deep); }

/* Paso */
.guia__ruta {
  flex: 1; min-width: 0; font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.guia__volver { padding: 0 8px; }
.guia__progreso { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.guia__segmentos { flex: 1; display: flex; gap: 4px; }
.guia__segmentos span { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.guia__segmentos span.hecho { background: var(--brand); }
.guia__cuenta { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-soft); white-space: nowrap; }
.guia__ilus { margin: 0 -20px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.guia__ilus svg { width: 100%; aspect-ratio: 16 / 9; display: block; }
.guia__titulo { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; margin: 0 0 6px; }
.guia__cuerpo { font-size: var(--t-md); color: var(--ink-soft); margin: 0 0 10px; }
.guia__demo { font-size: var(--t-sm); color: var(--ink-faint); margin: 0 0 12px; }
.guia__senalado { font-size: var(--t-sm); color: var(--brand-deep); margin: 8px 0 0; }
.guia__aviso { margin: 10px 0 0; }
.guia__mira { width: 15px; height: 15px; stroke: currentColor; }
.guia__pieFijo {
  margin-top: auto; border-top: 1px solid var(--line); background: var(--surface);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px;
}
.guia__pieFijo .btn:only-child { margin-left: auto; }

/* Tema completado */
/* El sello entra girado -6 grados: aire arriba para que no pise la barra. */
.guia__hecho-sello { margin: 16px 0 14px; }
.guia__sigue {
  border: 1px solid var(--line); border-radius: var(--radius-card); padding: 12px 14px; margin: 16px 0 12px;
  display: flex; align-items: center; gap: 12px;
}
.guia__sigue-texto { flex: 1; min-width: 0; font-size: var(--t-sm); color: var(--ink-soft); }
.guia__sigue-texto strong { display: block; font-size: var(--t-md); color: var(--ink); }
.guia__otras { display: flex; flex-wrap: wrap; gap: 6px; }

/* Movimiento de las ilustraciones: una vez al entrar, sin bucle. La regla
   global de movimiento reducido los deja en su estado final (both). */
.gm { animation: 1.4s ease-out both; transform-box: fill-box; }
.gm--baja { animation-name: guia-baja; }
.gm--llena { animation-name: guia-llena; transform-origin: left center; }
.gm--estampa { animation-name: guia-estampa; transform-origin: center; }
.gm--aparece { animation-name: guia-aparece; }
@keyframes guia-baja { from { transform: translateY(-10px); opacity: 0; } }
@keyframes guia-llena { from { transform: scaleX(.33); } }
@keyframes guia-estampa {
  0%, 40% { transform: scale(1.4) rotate(-6deg); opacity: 0; }
  70% { transform: scale(.96) rotate(-6deg); opacity: 1; }
  100% { transform: scale(1) rotate(-6deg); opacity: 1; }
}
@keyframes guia-aparece { from { opacity: 0; } }

/* Resaltado de "Muéstrame dónde": el anillo no recibe clics, así el botón
   real se puede pulsar a través de él. El velo es su sombra enorme. */
.guia-anillo {
  position: fixed; z-index: 65; pointer-events: none;
  border: 2px solid var(--brand); border-radius: var(--radius);
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 9999px var(--velo);
}
.guia-anillo--sin-velo { box-shadow: 0 0 0 4px var(--surface); }
/* Pulso del halo, sin desplazamiento. */
.guia-anillo--late { animation: guia-late .5s ease-out 2; }
.guia-anillo--sin-velo.guia-anillo--late { animation-name: guia-late-sin-velo; }
@keyframes guia-late {
  50% { box-shadow: 0 0 0 4px var(--surface), 0 0 0 8px var(--brand-line), 0 0 0 9999px var(--velo); }
}
@keyframes guia-late-sin-velo {
  50% { box-shadow: 0 0 0 4px var(--surface), 0 0 0 8px var(--brand-line); }
}
.guia-nota {
  position: fixed; z-index: 66; max-width: 280px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--brand-line); border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}
.guia-nota__aqui { display: block; font-family: var(--font-mono); font-size: var(--t-xs); color: var(--brand-deep); letter-spacing: .12em; }
.guia-nota__frase { margin: 2px 0 8px; font-size: var(--t-sm); color: var(--ink); }
.guia-nota__pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--t-xs); color: var(--ink-faint); }

/* Barra plegada: solo en el celular, mientras se señala algo. */
.guia__plegada { display: none; }

@media (max-width: 768px) {
  .sidebar__marca { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .sidebar__guia { display: none; }
  .guia-btn--movil { display: flex; width: auto; min-height: 40px; }
  /* Hoja inferior al 64% del alto, sin pasar debajo de la franja. */
  .guia {
    top: auto; left: 0; width: auto; height: 64dvh;
    max-height: calc(100dvh - var(--franja-h, 0px) - 56px);
    border-left: 0; border-top: 1px solid var(--line);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    box-shadow: var(--shadow-2);
    animation-name: guia-sube;
  }
  .guia::before {
    content: ""; display: block; flex-shrink: 0; width: 36px; height: 4px; margin: 8px auto 0;
    border-radius: 2px; background: var(--line);
  }
  .guia--plegada { height: auto; }
  .guia--plegada .guia__scroll, .guia--plegada .guia__pieFijo { display: none; }
  .guia--plegada .guia__plegada {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 12px;
    font-size: var(--t-sm); color: var(--ink-soft);
  }
  .guia__plegada span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@keyframes guia-sube { from { transform: translateY(24px); opacity: 0; } }

/* ── Contrato de administración (ficha del propietario) ──────────────── */
/* La tarjeta reutiliza .item-card, .aviso y .crud-field; aquí solo lo que
   no existe: el panel de Generar, la tabla de inmuebles de la vista previa
   y el historial plegado. Solo tokens. */
.adm-tarjeta { display: grid; gap: 10px; }
.adm-tarjeta .aviso { margin-bottom: 8px; }
.adm-generar {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 14px 16px; display: grid; gap: 10px;
}
.adm-subt { font-size: var(--t-sm); font-weight: 600; color: var(--ink); margin: 6px 0 4px; }
.adm-nota { font-size: var(--t-xs); color: var(--ink-soft); }
.adm-lista { margin: 4px 0 8px 18px; font-size: var(--t-sm); }
.adm-tabla { width: 100%; border-collapse: collapse; font-size: var(--t-sm); margin-bottom: 8px; }
.adm-tabla th, .adm-tabla td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.adm-tabla th { color: var(--ink-soft); font-weight: 600; }
.adm-historial summary { cursor: pointer; font-size: var(--t-sm); color: var(--ink-soft); padding: 4px 0; }
.adm-historial .item-card { margin-top: 8px; }
/* Modelos de contrato: los encabezados de las dos listas. */
.plantillas-tipo-t { font-size: var(--t-md); font-weight: 700; color: var(--ink); margin: 18px 0 8px; }
