/* ─────────────────────────────────────────────────────────────────────────
   tf.css — la base de Tracefold File Protect y sus componentes compartidos.

   Cada página la carga en {% block head %}, después de la carcasa (shell.css
   del núcleo) y del tema (theme.css). Todas las clases de TFP empiezan por
   «tf-»: las de la carcasa (btn-grad, btn-ghost, btn-sm-ghost, chip, inp, app-…,
   zt-…, menu-…) son del núcleo y aquí sólo se usan, nunca se redefinen. Lo que
   TFP necesita distinto de ellas es una variante propia con su «tf-».

   Los estados :hover / :active / :focus salen de las reglas [data-tf] de cada
   vista del diseño (design/views/**). El catálogo vivo, con cada estado, está
   en /dev/estilo (dev/templates/dev/style_guide.html); el marcado estático, en
   templates/partials/_components.html, y el comportamiento, en
   static/js/components/.

   Reglas de la casa:
   - Colores sólo con tokens (theme.css): el modo oscuro sale solo. Los únicos
     hex son los que el diseño fija igual en los dos temas (el blanco del QR,
     el texto blanco sobre el degradado o el rojo).
   - Propiedades lógicas (inline/block): la página vale en RTL.
   - Números que cambian o se comparan, tabulares.
   - A 720 px o menos, todo lo que se pulsa mide 44 px: o de verdad, o con
     una zona invisible (::before) cuando el diseño lo dibuja más pequeño (los
     segmentos de 36, el interruptor de 24, la «×» de un destinatario).
   - Con prefers-reduced-motion, TFP apaga sus propias animaciones y
     transiciones (al final de esta hoja y en la de cada página): la carcasa
     del núcleo no apaga las de una herramienta. Queda el último fotograma.
   - Un enlace de texto va en --pri-text, no en el --pri de la carcasa (02).

   Índice
     01 Base · 02 Texto · (03 la barra: tf-topbar.css) · 04 Tarjetas y paneles
     05 Botones · 06 Chips de estado, tipo y entrega · 07 Avisos
     08 Campos · 09 Controles de condiciones · 10 Destinatarios
     11 Cuenta atrás y aperturas · 12 Filas y tarjetas de envío
     13 Registro (timeline) · 14 Modal y destruir manteniendo pulsado
     15 Enlace, código y QR · 16 Código de 6 cifras · 17 Vacío y soltar
     18 Ficheros y cifrado · 19 Asistente y resumen · 20 Finales del
     destinatario · 21 Portada del destinatario e identidad · 22 Personas
   ───────────────────────────────────────────────────────────────────────── */

/* ── 01 Base ──────────────────────────────────────────────────────────── */

/* Iconos: Material Symbols Rounded 300, servidos desde static/fonts. */
@font-face {
  font-family: "Material Symbols Rounded";
  font-style: normal;
  font-weight: 300;
  font-display: block;
  src: url("../fonts/MaterialSymbolsRounded-300.woff2") format("woff2");
}

.tf-icon {
  font-family: "Material Symbols Rounded";
  font-weight: 300;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  display: inline-block;
  flex-shrink: 0;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
/* Los iconos que señalan una dirección (flechas, chevrons) se dan la vuelta en RTL. */
.tf-icon.tf-flip { transform: scaleX(var(--tf-flip)); }
.tf-icon-14 { font-size: 14px; }
.tf-icon-15 { font-size: 15px; }
.tf-icon-16 { font-size: 16px; }
.tf-icon-17 { font-size: 17px; }
.tf-icon-19 { font-size: 19px; }
.tf-icon-20 { font-size: 20px; }
.tf-icon-22 { font-size: 22px; }
.tf-icon-24 { font-size: 24px; }

/* Lo que va siempre de izquierda a derecha: códigos, IP, enlaces, emails, ficheros. */
.tf-ltr { direction: ltr; unicode-bidi: isolate; }
.tf-num { font-variant-numeric: tabular-nums; }

/* Sólo para el lector de pantalla, y fuera de la vista (copiar al portapapeles). */
.tf-sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tf-offscreen { position: fixed; inset-inline-start: -9999px; top: 0; opacity: 0; }

[hidden] { display: none !important; }

/* La raíz de cada página de TFP (el diseño apila con 18 px). */
.tf-page { display: flex; flex-direction: column; gap: 18px; }
/* Las páginas estrechas del destinatario: una columna de 540 px, centrada. */
.tf-narrow { width: 100%; max-width: 540px; margin-inline: auto; display: flex; flex-direction: column; gap: 14px; }
/* El asistente y el detalle: 900 px, centrados. */
.tf-wide { width: 100%; max-width: 900px; margin-inline: auto; display: flex; flex-direction: column; gap: 18px; }
.tf-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tf-stack-sm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tf-row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tf-grow { flex: 1 1 auto; min-width: 0; }
.tf-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-anywhere { overflow-wrap: anywhere; }

/* Animaciones de la casa: el punto «en directo», el giro de espera y el
   empujón cuando se suelta antes de tiempo «Destruir definitivamente». */
@keyframes tf-pulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes tf-spin { to { transform: rotate(360deg); } }
@keyframes tf-nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* Girando: 16 px, del color del texto (blanco sobre un botón lleno). */
.tf-spinner {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; display: inline-block;
  border: 2px solid currentColor; border-inline-end-color: transparent; box-sizing: border-box;
  animation: tf-spin .8s linear infinite;
}
.tf-spinner-sm { width: 13px; height: 13px; }
.tf-spinner-14 { width: 14px; height: 14px; }
.tf-spinner-pri { color: var(--pri); }

/* El punto que late («Se está viendo ahora»): 8 px, con su onda. */
.tf-pulse { position: relative; width: 8px; height: 8px; flex-shrink: 0; display: inline-block; }
.tf-pulse::before, .tf-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--pri); }
.tf-pulse::before { animation: tf-pulse 1.8s ease-out infinite; }
.tf-pulse--ok::before, .tf-pulse--ok::after { background: var(--ok); }
/* Un punto quieto (Activo). */
.tf-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; background: var(--ok); }

/* ── 02 Texto ─────────────────────────────────────────────────────────── */

.tf-display { margin: 0; font-size: 36px; line-height: 42px; font-weight: 700; letter-spacing: -0.6px; text-wrap: balance; }
/* Título de página (24/30) y su línea de debajo. */
.tf-title { margin: 0; font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.3px; }
.tf-title-count { font-weight: 500; color: var(--muted); font-size: 15px; letter-spacing: 0; }
.tf-subtitle { margin: 0; max-width: 720px; font-size: 13.5px; line-height: 20px; color: var(--muted); }
.tf-page-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tf-page-head--bar { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
/* Título de tarjeta del destinatario (21/28) y de diálogo (19/25). */
.tf-title-card { margin: 0; font-size: 21px; line-height: 28px; font-weight: 700; letter-spacing: -0.2px; text-wrap: balance; }
.tf-heading { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -0.2px; }
.tf-card-title { margin: 0; font-size: 17px; line-height: 23px; font-weight: 700; }
.tf-subheading { margin: 0; font-size: 15px; line-height: 22px; font-weight: 500; }
.tf-reading { font-size: 16px; line-height: 26px; }
.tf-body { margin: 0; font-size: 14px; line-height: 21px; color: var(--muted); text-wrap: pretty; }
.tf-small { margin: 0; font-size: 13px; line-height: 19px; color: var(--muted); }
.tf-muted { color: var(--muted); }
.tf-strong { font-weight: 700; }
/* Etiqueta de campo (12/16 · 700) y antetítulo en mayúsculas (12/16 · 700 · +0.8). */
.tf-label { margin: 0; font-size: 12px; line-height: 16px; font-weight: 700; color: var(--muted); }
.tf-label-note { font-weight: 400; }
.tf-overline {
  margin: 0; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted);
}
.tf-overline .tf-icon { font-size: 16px; }
.tf-overline--pri { color: var(--pri-text); }

/* Los enlaces de texto de TFP (las migas, uno dentro de un mensaje): la
   carcasa pinta todo enlace con --pri (body.app-shell a, especificidad
   0,1,2), el azul de relleno, que en oscuro se queda en 2,6:1 sobre una
   tarjeta. El texto va en --pri-text (en claro, el mismo azul). Sólo los que
   no llevan clase: los que la llevan (una pestaña, un botón que es un enlace)
   tienen su color en su regla, y :where() no suma, así que esto queda en
   0,2,1: gana a la carcasa sin pelear con ellas. El color, no --zt-link: con
   el ratón encima el núcleo cambia --zt-link a un azul más oscuro, que en
   oscuro tampoco se lee (el subrayado de encima sigue siendo suyo). El visor
   no: va en zt/bare.html, sin esa regla de la carcasa, y los enlaces de un
   mensaje van sobre su papel blanco en los dos temas (viewer.css). */
:root :where([data-tf-page]:not([data-tf-page="viewer"])) a:not([class]) { color: var(--pri-text); }

/* Migas de pan («Mis envíos › Nuevo envío»). */
.tf-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tf-breadcrumb a { font-weight: 700; }
.tf-breadcrumb .tf-icon { font-size: 16px; transform: scaleX(var(--tf-flip)); }

/* «— o —» entre dos caminos. */
.tf-or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; }
.tf-or::before, .tf-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Una línea con icono pequeño y texto apagado (pistas bajo un campo o una pieza). */
.tf-hint { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 19px; color: var(--muted); }
.tf-hint > .tf-icon { font-size: 18px; color: var(--pri-text); }
.tf-hint--warn > .tf-icon { color: var(--warn-strong); }
.tf-hint--sm { font-size: 12.5px; line-height: 18px; }
.tf-hint--sm > .tf-icon { font-size: 17px; }

/* ── 03 Los huecos de la barra del núcleo: static/css/tf-topbar.css ────── */
/* Las pestañas y «Nuevo envío» (topbar_start, topbar_end) tienen su hoja, que
   enlaza la macro sender_tabs() (partials/_sender_topbar.html) después de
   ésta y que manda sobre la carcasa con :root delante. */

/* ── 04 Tarjetas y paneles ────────────────────────────────────────────── */

/* Tarjeta: 18 px de radio, 22/24 de relleno. */
.tf-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--tf-r-card);
  padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; min-width: 0;
}
.tf-card--tight { gap: 12px; }
.tf-card--flush { padding: 0; gap: 0; overflow: hidden; }
/* La tarjeta del destinatario: con sombra y más aire (30/32). */
.tf-card--raised { box-shadow: var(--shadow-card); padding: 30px 32px; gap: 18px; }
.tf-card--center { align-items: center; text-align: center; }
/* Panel interior (14 px): el envío dentro de la portada, los ficheros. */
.tf-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--tf-r-panel); padding: 12px 14px; min-width: 0; }
.tf-inner { border: 1px solid var(--line); border-radius: var(--tf-r-inner); background: var(--panel); padding: 20px; }
/* Separador con su aire, dentro de una tarjeta. */
.tf-divider-top { padding-top: 16px; border-top: 1px solid var(--line); }
.tf-divider-bottom { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
/* Pie de tarjeta: acciones a la derecha y la letra pequeña a la izquierda. */
.tf-card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px 16px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); }
.tf-card-foot-note { flex: 1 1 220px; font-size: 12.5px; line-height: 18px; color: var(--muted); }
/* La fila de navegación del asistente: «Atrás» a un lado, «Siguiente» al otro. */
.tf-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tf-actions-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
/* Dos columnas: contenido y panel lateral de 300 px (asistente, «Listo»). */
.tf-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.tf-grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
@media (max-width: 720px) {
  .tf-split { grid-template-columns: minmax(0, 1fr); }
  .tf-card { padding: 20px 18px; }
  .tf-card--raised { padding: 24px 20px; }
}

/* ── 05 Botones ───────────────────────────────────────────────────────────
   El principal y el secundario son los del núcleo (btn-grad, btn-ghost,
   btn-sm-ghost), tal cual. Estas son las variantes propias de TFP. */

.tf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px; border: 0;
  font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1; white-space: nowrap;
  cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.tf-btn:hover { text-decoration: none; }
.tf-btn .tf-icon { font-size: 18px; }
.tf-btn[disabled], .tf-btn[aria-disabled="true"] { cursor: not-allowed; }
.tf-btn[aria-busy="true"] { cursor: progress; }
/* data-tf-state="hover|active|focus" fuerza un estado: sólo para enseñarlo
   quieto en el catálogo (/dev/estilo); las pantallas no lo usan. El foco es
   el anillo del núcleo (2 px de --pri, a 2 px; shell.css): TFP no pone uno
   suyo, como el programa de Windows (el dueño, 30-10). */
.tf-btn[data-tf-state~="focus"], .tf-btn-icon[data-tf-state~="focus"] { outline: 2px solid var(--pri); outline-offset: 2px; }

/* Terciario («Ver QR», «Ver registro», «Más información»): sin borde, color de acento. */
.tf-btn-tertiary { background: transparent; color: var(--pri-text); padding: 0 14px; transition: background .15s; }
.tf-btn-tertiary:hover, .tf-btn-tertiary[data-tf-state~="hover"] { background: var(--pri-fill-weak); color: var(--pri-text); }
.tf-btn-tertiary:active, .tf-btn-tertiary[data-tf-state~="active"] { background: var(--pri-fill); }
.tf-btn-tertiary[disabled], .tf-btn-tertiary[aria-disabled="true"] { background: transparent; color: var(--faint); }
/* Compacto, dentro de filas densas (34 px; 44 en el móvil). */
.tf-btn-compact { height: 34px; padding: 0 10px; border-radius: 10px; font-size: 13px; gap: 6px; }
.tf-btn-compact .tf-icon { font-size: 17px; }
/* Que tira del borde (sin hueco a la izquierda): «Volver», «Más información». */
.tf-btn-pull { margin-inline-start: -10px; padding: 0 10px; }

/* Discreto, en gris («Cancelar» junto al título del asistente). */
.tf-btn-quiet { height: 40px; padding: 0 12px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13.5px; transition: background .15s; }
.tf-btn-quiet:hover, .tf-btn-quiet[data-tf-state~="hover"] { background: var(--hover-fill); color: var(--ink); }

/* Secundario pequeño con borde (36 px; 44 en el móvil): «Rechazar», «Pantalla
   completa», «Cambiar archivo», los botones de prueba de los avisos. */
.tf-btn-small {
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 13px; gap: 6px; transition: background .15s, border-color .15s;
}
.tf-btn-small .tf-icon { font-size: 17px; }
.tf-btn-small:hover, .tf-btn-small[data-tf-state~="hover"] { border-color: var(--hover-line); background: var(--panel); color: var(--ink); }
.tf-btn-small:active, .tf-btn-small[data-tf-state~="active"] { background: var(--hover-fill); }
/* …y el principal pequeño («Aceptar» en una petición de acceso). */
.tf-btn-small--primary { border: 0; padding-inline: 10px 14px; background: linear-gradient(135deg, var(--pri), var(--acc)); color: #ffffff; transition: transform .12s, box-shadow .12s; }
.tf-btn-small--primary:hover, .tf-btn-small--primary[data-tf-state~="hover"] { background: linear-gradient(135deg, var(--pri), var(--acc)); color: #ffffff; transform: translateY(-1px); box-shadow: 0 8px 18px color-mix(in srgb, var(--pri) 24%, transparent); }
.tf-btn-small--primary:active { transform: translateY(0); filter: brightness(.92); }

/* El principal grande del destinatario («Abrir», «Enviarme el enlace»): 50 px, a todo lo ancho. */
.tf-btn-hero {
  width: 100%; height: 50px; padding: 0 22px; border-radius: 12px; gap: 8px;
  background: linear-gradient(135deg, var(--pri), var(--acc)); color: #ffffff; font-size: 16px;
  box-shadow: var(--shadow-btn); transition: transform .12s, box-shadow .12s;
}
.tf-btn-hero .tf-icon { font-size: 20px; }
.tf-btn-hero:hover, .tf-btn-hero[data-tf-state~="hover"] { color: #ffffff; transform: translateY(-1px); box-shadow: 0 12px 26px color-mix(in srgb, var(--pri) 28%, transparent); }
.tf-btn-hero:active, .tf-btn-hero[data-tf-state~="active"] { transform: translateY(0); box-shadow: 0 3px 8px color-mix(in srgb, var(--pri) 24%, transparent); filter: brightness(.92); }
.tf-btn-hero[disabled], .tf-btn-hero[aria-disabled="true"] { background: var(--disabled); box-shadow: none; transform: none; filter: none; }
.tf-btn-hero--15 { font-size: 15.5px; }
/* El secundario grande del destinatario («Tengo un QR»): 46 px, a todo lo ancho. */
.tf-btn-wide {
  width: 100%; height: 46px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 14.5px; transition: background .15s, border-color .15s;
}
.tf-btn-wide .tf-icon { font-size: 20px; }
.tf-btn-wide:hover { border-color: var(--hover-line); background: var(--panel); color: var(--ink); }
.tf-btn-wide:active { background: var(--hover-fill); }

/* Destruir · entrada: rojo suave, abre la confirmación (nunca destruye). */
.tf-btn-destroy {
  gap: 7px; padding-block: 0; padding-inline: 14px 18px; border: 1px solid var(--line);
  background: var(--surface); color: var(--danger-text); transition: background .15s, border-color .15s;
}
.tf-btn-destroy:hover, .tf-btn-destroy[data-tf-state~="hover"] { background: var(--danger-fill); border-color: var(--danger-line); color: var(--danger-text); }
.tf-btn-destroy:active, .tf-btn-destroy[data-tf-state~="active"] { background: var(--danger-fill); border-color: var(--danger); }
.tf-btn-destroy[disabled], .tf-btn-destroy[aria-disabled="true"] { background: var(--panel); color: var(--faint); border-color: var(--line); }

/* Destruir · lleno: sólo dentro de la confirmación. */
.tf-btn-danger { padding: 0 22px; background: var(--danger); color: #ffffff; font-size: 14.5px; transition: background .15s; }
.tf-btn-danger:hover, .tf-btn-danger[data-tf-state~="hover"] { background: color-mix(in srgb, var(--danger) 88%, #000000); color: #ffffff; }
.tf-btn-danger:active, .tf-btn-danger[data-tf-state~="active"] { background: color-mix(in srgb, var(--danger) 78%, #000000); }
.tf-btn-danger[disabled], .tf-btn-danger[aria-disabled="true"] { background: var(--disabled); }

/* Un .tf-btn también puede ser un enlace (/dev/estilo enseña uno), y la
   carcasa del núcleo pinta todo <a> con «body.app-shell a» (--pri, 0,1,2) y
   lo subraya con el ratón encima (0,2,2): gana a las clases de arriba. Con
   :root delante, sin nombrar una clase del núcleo, cada variante en un <a>
   vuelve a su color y sin subrayar. */
:root a.tf-btn, :root a.tf-btn:hover { text-decoration: none; }
:root a.tf-btn-tertiary, :root a.tf-btn-tertiary:hover { color: var(--pri-text); }
:root a.tf-btn-quiet { color: var(--muted); }
:root a.tf-btn-quiet:hover,
:root a.tf-btn-small, :root a.tf-btn-small:hover,
:root a.tf-btn-wide, :root a.tf-btn-wide:hover { color: var(--ink); }
:root a.tf-btn-destroy, :root a.tf-btn-destroy:hover { color: var(--danger-text); }
:root a.tf-btn-small--primary, :root a.tf-btn-small--primary:hover,
:root a.tf-btn-hero, :root a.tf-btn-hero:hover,
:root a.tf-btn-danger, :root a.tf-btn-danger:hover { color: #ffffff; }
:root a.tf-btn[aria-disabled="true"]:is(.tf-btn-tertiary, .tf-btn-destroy) { color: var(--faint); }

/* Botones de icono, siempre con aria-label: 44 px con borde (Copiar), 44 sin
   borde y en acento (Ver QR), 36 en gris dentro de filas (Más acciones). */
.tf-btn-icon {
  width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.tf-btn-icon .tf-icon { font-size: 20px; }
.tf-btn-icon:hover, .tf-btn-icon[data-tf-state~="hover"] { border-color: var(--hover-line); background: var(--panel); }
.tf-btn-icon--ghost { border: 0; background: transparent; color: var(--pri-text); }
.tf-btn-icon--ghost:hover, .tf-btn-icon--ghost[data-tf-state~="hover"] { background: var(--pri-fill-weak); }
.tf-btn-icon--more { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.tf-btn-icon--more:hover, .tf-btn-icon--more[data-tf-state~="hover"] { background: var(--hover-fill); color: var(--ink); }
/* «Quitar el acceso» en la lista de autorizados: igual, pero el fondo al pasar es el del panel. */
.tf-btn-icon--remove:hover, .tf-btn-icon--remove[data-tf-state~="hover"] { background: var(--panel); color: var(--ink); }
.tf-btn-icon--34 { width: 34px; height: 34px; }

/* Cerrar redondo de 38 px (el de los diálogos del núcleo). */
.tf-close {
  width: 38px; height: 38px; padding: 0; display: grid; place-items: center; flex-shrink: 0;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 22px; line-height: 1; cursor: pointer; transition: border-color .15s, color .15s;
}
.tf-close:hover, .tf-close[data-tf-state~="hover"] { border-color: var(--pri); color: var(--pri-text); }

@media (max-width: 720px) {
  .tf-btn-compact, .tf-btn-small, .tf-btn-quiet { height: 44px; }
  .tf-btn-icon--more, .tf-btn-icon--34 { width: 44px; height: 44px; }
  .tf-close { width: 44px; height: 44px; }
}

/* ── 06 Chips de estado, tipo y entrega ───────────────────────────────────
   Cada estado tiene su color, su forma y su palabra: punto (Activo), reloj de
   arena (Caduca pronto), reloj tachado (Caducado), raya con borde discontinuo
   (Destruido) y punto que late (Se está viendo ahora). Tres tamaños: 26 px
   (por defecto: cabecera del detalle, catálogo), 24 px (filas y tarjetas de
   «Mis envíos») y 20 px (listas densas). */

.tf-status {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding-block: 0; padding-inline: 7px 11px;
  border-radius: 999px; border: 1px solid var(--off-line); background: var(--off-fill); color: var(--off-text);
  font-size: 12.5px; font-weight: 700; line-height: 1; white-space: nowrap; flex-shrink: 0;
}
.tf-status > .tf-icon { font-size: 16px; }
.tf-status > .tf-dot { width: 8px; height: 8px; }
.tf-status--active { gap: 6px; padding-inline: 9px 11px; background: var(--ok-fill); border-color: var(--ok-line); color: var(--ok-text); }
.tf-status--soon { background: var(--warn-fill); border-color: var(--warn-line); color: var(--ink); }
.tf-status--soon > .tf-icon { color: var(--warn-strong); }
.tf-status--expired { background: var(--off-fill); border-color: var(--off-line); color: var(--off-text); }
.tf-status--destroyed { background: transparent; border-style: dashed; border-color: var(--faint); color: var(--off-text); }
.tf-status--live { gap: 7px; padding-inline: 10px 11px; background: var(--info-fill); border-color: var(--info-line); color: var(--ink); }
/* 24 px: filas y tarjetas de «Mis envíos». */
.tf-status--md { height: 24px; padding-inline: 7px 9px; font-size: 12px; }
.tf-status--md > .tf-icon { font-size: 15px; }
.tf-status--md > .tf-dot { width: 7px; height: 7px; margin-inline-start: 2px; }
.tf-status--md.tf-status--active { gap: 5px; padding-inline: 7px 9px; }
/* 20 px: listas densas. */
.tf-status--sm { height: 20px; gap: 4px; padding-inline: 5px 8px; font-size: 11.5px; }
.tf-status--sm > .tf-icon { font-size: 14px; }
.tf-status--sm > .tf-dot { width: 6px; height: 6px; }
.tf-status--sm.tf-status--active { gap: 5px; padding-inline: 7px 8px; }
.tf-status--sm.tf-status--live { gap: 5px; padding-inline: 7px 8px; }

/* Petición de acceso («1 petición de acceso»): 24 px, en acento. */
.tf-req-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding-inline: 7px 9px; border-radius: 999px;
  background: var(--pri-fill); border: 1px solid var(--pri-line); color: var(--pri-text);
  font-size: 12px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.tf-req-badge > .tf-icon { font-size: 15px; }

/* Tipo: «DOCUMENTO», «MENSAJE» (mayúsculas sobre el 8 % del acento). */
.tf-kind {
  display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 11px; line-height: 16px; font-weight: 700;
  text-transform: uppercase; background: color-mix(in srgb, var(--pri) 8%, transparent); color: var(--pri-text); white-space: nowrap;
}
/* Etiqueta de condición: «Ver una vez», «Marca de agua» (22 px, radio 8, sobre la pista). */
.tf-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 8px;
  background: var(--track); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.tf-tag > .tf-icon { font-size: 15px; }
/* Etiqueta de un evento del registro («Código bloqueado 15 min», «Aceptada», «Rechazada»). */
.tf-tag--warn, .tf-tag--ok, .tf-tag--off { border: 1px solid; color: var(--ink); }
.tf-tag--warn { background: var(--warn-fill); border-color: var(--warn-line); }
.tf-tag--ok { background: var(--ok-fill); border-color: var(--ok-line); }
.tf-tag--off { background: var(--off-fill); border-color: var(--off-line); }
/* «Recomendado» dentro de una tarjeta de opción. */
.tf-tag-recommended {
  display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 11px; line-height: 16px; font-weight: 700;
  background: var(--ok-fill); border: 1px solid var(--ok-line); color: var(--ok-text); white-space: nowrap;
}

/* Entrega: «Enlace + código», «Enlace todo en uno», «Fichero protegido» (con su icono .tfp). */
.tf-delivery {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding-inline: 8px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--control-line); color: var(--ink);
  font-size: 12.5px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.tf-delivery > .tf-icon { font-size: 16px; color: var(--muted); }
.tf-delivery > svg { display: block; flex-shrink: 0; width: 16px; height: 16px; }

/* Remitente verificado: 26 px, azul de información. */
.tf-verified {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding-inline: 7px 11px; border-radius: 999px;
  background: var(--info-fill); border: 1px solid var(--info-line); color: var(--ink);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.tf-verified > .tf-icon { font-size: 16px; color: var(--pri-text); }

/* Píldora de estado grande (34 px): «Nuevo intento en 10 s», «Podrás volver a intentarlo en 15:00». */
.tf-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px;
  background: var(--warn-fill); border: 1px solid var(--warn-line); color: var(--ink);
  font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.tf-pill > .tf-icon { font-size: 18px; color: var(--warn-strong); }

/* ── 07 Avisos dentro de la página ─────────────────────────────────────────
   info (azul), warn (ámbar: icono --warn-strong, texto en tinta), ok (verde),
   danger (sólo para destruir). Los toasts son del núcleo (zt.toast). */

.tf-note {
  margin: 0; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--info-line); background: var(--info-fill); color: var(--ink);
  font-size: 13px; line-height: 19px; text-align: start;
}
.tf-note > .tf-icon { font-size: 19px; color: var(--pri-text); }
.tf-note > .tf-pulse { margin-top: 5px; }
.tf-note-body { flex: 1; min-width: 0; }
.tf-note--warn { background: var(--warn-fill); border-color: var(--warn-line); }
.tf-note--warn > .tf-icon { color: var(--warn-strong); }
.tf-note--ok { background: var(--ok-fill); border-color: var(--ok-line); color: var(--ok-text); }
.tf-note--ok > .tf-icon { color: var(--ok-text); }
.tf-note--danger { background: var(--danger-fill); border-color: var(--danger-line); }
.tf-note--danger > .tf-icon { color: var(--danger); }
.tf-note--plain { background: var(--panel); border-color: var(--line); }
.tf-note--plain > .tf-icon { color: var(--muted); }
/* Más bajo (9/12): «Ahora lo está viendo…» dentro de un diálogo. */
.tf-note--tight { align-items: center; gap: 8px; padding: 9px 12px; line-height: 18px; }
.tf-note--tight > .tf-pulse { margin-top: 0; }
/* El resumen vivo («Ana podrá abrirlo 3 veces…»). */
.tf-note--summary { font-size: 13.5px; line-height: 20px; }
/* Más grande, con título (fallos de subida, sin conexión). */
.tf-note--big { flex-direction: column; gap: 14px; padding: 18px 20px; border-radius: 16px; }
.tf-note-head { display: flex; gap: 12px; align-items: flex-start; }
.tf-note-head > .tf-icon { font-size: 24px; color: var(--warn-strong); }
.tf-note-title { display: block; font-size: 15px; line-height: 21px; font-weight: 700; }
.tf-note-text { display: block; font-size: 13.5px; line-height: 20px; }

/* «Se está viendo ahora · Chrome · Windows · desde hace 4 min» (tarjetas de envío). */
.tf-live-strip {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
  background: var(--info-fill); border: 1px solid var(--info-line); font-size: 13px; line-height: 18px; min-width: 0;
}
.tf-live-strip strong { font-weight: 700; }
.tf-live-strip-sub { color: var(--muted); }

/* La franja de «Listo» (verde, con su check grande y las acciones). */
.tf-done {
  display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap;
  padding: 18px 20px; border-radius: 18px; background: var(--ok-fill); border: 1px solid var(--ok-line);
}
.tf-done-main { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.tf-done-main > .tf-icon { font-size: 26px; color: var(--ok-text); }
.tf-done-title { display: block; font-size: 16px; line-height: 22px; font-weight: 700; overflow-wrap: anywhere; }
.tf-done-text { display: block; font-size: 13.5px; color: var(--ok-text); }

/* ── 08 Campos ────────────────────────────────────────────────────────────
   La caja es la del núcleo (inp); TFP sólo pone la etiqueta, la pista, el
   error y lo que el núcleo no tiene (buscar con icono, código grande). */

.tf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tf-field-label { font-size: 12px; font-weight: 700; color: var(--muted); }
/* La etiqueta y su nota («· Opcional con enlace…») en una línea; si la nota
   no cabe, baja sola, sin el «·» delante. El punto va en el hueco que deja la
   etiqueta (margin-inline-end): la nota empieza 16 px antes (margen negativo,
   que su relleno devuelve a sus líneas) y sólo su primera línea vuelve a ellos
   (text-indent) para llevar el punto. En la misma línea, el punto queda entre
   las dos; al bajar, cae fuera de la caja por el principio de la línea y
   overflow lo recorta, y el texto (todas sus líneas) empieza en su sitio. Sin
   texto para el lector de pantalla (content: "·" / ""). */
.tf-field-labels { display: flex; align-items: baseline; gap: 2px 0; flex-wrap: wrap; overflow: hidden; }
.tf-field-labels > .tf-field-label { margin-inline-end: 16px; }
.tf-field-note { margin-inline-start: -16px; padding-inline-start: 16px; text-indent: -16px; font-size: 12px; color: var(--muted); }
/* text-indent se hereda: dentro del punto, a cero (si no, se va 16 px a un lado). */
.tf-field-note::before { content: "·"; content: "·" / ""; display: inline-block; width: 16px; text-indent: 0; text-align: center; }
.tf-field-hint { font-size: 12px; line-height: 17px; color: var(--muted); }
/* El error de un campo: icono ámbar, texto en tinta (nunca rojo). */
.tf-field-error { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); }
.tf-field-error > .tf-icon { font-size: 16px; color: var(--warn-strong); }
/* Un control con error (se añade junto a la clase del núcleo). */
.tf-invalid, .tf-invalid:focus-visible { border-color: var(--warn-strong) !important; }

/* Buscar: caja de 44 px con la lupa dentro. */
.tf-search { position: relative; display: block; flex: 1 1 240px; max-width: 320px; min-width: 0; }
.tf-search > .tf-icon { position: absolute; inset-inline-start: 12px; top: 12px; font-size: 20px; color: var(--muted); pointer-events: none; }
.tf-search-input {
  width: 100%; height: 44px; padding-block: 0; padding-inline: 40px 12px; border: 1px solid var(--control-line);
  border-radius: 12px; background: var(--surface); color: var(--ink); font-family: inherit; font-size: 14px;
  -webkit-appearance: none; appearance: none;
}
.tf-search-input:hover { border-color: color-mix(in srgb, var(--pri) 25%, var(--pri-line)); }
.tf-search-input:focus-visible { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 14%, transparent); }
.tf-search-input::placeholder { color: var(--muted); opacity: 1; }
.tf-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* El email grande del destinatario (48 px, 15 px). */
.tf-input-lg {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--control-line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font-family: inherit; font-size: 15px;
}
.tf-input-lg:hover { border-color: color-mix(in srgb, var(--pri) 25%, var(--pri-line)); }
.tf-input-lg:focus-visible { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 14%, transparent); }
.tf-input-lg::placeholder { color: var(--muted); opacity: 1; }

/* El cuerpo de un mensaje (textarea) con el aspecto de los controles. */
.tf-textarea {
  width: 100%; min-height: 160px; padding: 12px 14px; border: 1px solid var(--control-line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font-family: inherit; font-size: 15px; line-height: 23px; resize: vertical;
}
.tf-textarea:focus-visible { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 14%, transparent); }
.tf-textarea::placeholder { color: var(--muted); opacity: 1; }

/* ── 09 Controles de condiciones ──────────────────────────────────────── */

/* Segmentado («1 h · 24 h · 7 días · Fecha concreta») y filtros de la lista. */
.tf-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.tf-seg-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; flex-shrink: 0;
  border-radius: 999px; border: 1px solid var(--control-line); background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.tf-seg-btn:hover { border-color: var(--hover-line); background: var(--panel); }
.tf-seg-btn[aria-pressed="true"], .tf-seg-btn[aria-checked="true"] { border-color: var(--pri-line); background: var(--pri-fill); color: var(--pri-text); }
.tf-seg-btn[disabled] { color: var(--faint); background: var(--panel); cursor: not-allowed; }
.tf-seg-count { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.tf-seg-btn[aria-pressed="true"] .tf-seg-count { color: var(--pri-text); }
/* Filtros: un poco más estrechos (13 px a los lados), con su número. */
.tf-seg--filters { gap: 6px; flex: 1 1 420px; min-width: 0; padding: 2px; }
.tf-seg--filters .tf-seg-btn { padding: 0 13px; }

/* Más / menos («− 3 +»). */
.tf-stepper { display: inline-flex; align-items: center; border: 1px solid var(--control-line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.tf-stepper-btn {
  width: 44px; height: 44px; padding: 0; border: 0; background: var(--surface); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: background .15s;
}
.tf-stepper-btn .tf-icon { font-size: 20px; }
.tf-stepper-btn:hover:not([disabled]) { background: var(--hover-fill); }
.tf-stepper-btn[disabled] { color: var(--disabled); cursor: not-allowed; }
.tf-stepper-value {
  min-width: 44px; text-align: center; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums;
  border-inline: 1px solid var(--line); line-height: 44px;
}
.tf-stepper--40 .tf-stepper-btn { width: 40px; height: 40px; }
.tf-stepper--40 .tf-stepper-value { line-height: 40px; }

/* Interruptor (role="switch"): 40×24, bola de 18. */
.tf-switch {
  position: relative; width: 40px; height: 24px; flex-shrink: 0; padding: 0; border: 0; border-radius: 999px;
  background: var(--control-line); cursor: pointer; transition: background .15s;
}
.tf-switch::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 2px rgba(16, 24, 40, .25); transform: translateX(0); transition: transform .15s;
}
.tf-switch[aria-checked="true"] { background: var(--pri); }
.tf-switch[aria-checked="true"]::after { transform: translateX(calc(16px * var(--tf-flip))); }
.tf-switch[disabled] { opacity: .5; cursor: not-allowed; }
/* La fila: nombre y explicación a un lado, el control al otro. */
.tf-control-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.tf-control-text { display: flex; flex-direction: column; min-width: 0; }
.tf-control-name { font-size: 13.5px; font-weight: 500; }
.tf-control-hint { font-size: 12px; color: var(--muted); }
@media (max-width: 720px) {
  /* El interruptor se queda en 40×24, pero el dedo toca 44 px. */
  .tf-switch::before { content: ""; position: absolute; inset: -10px -2px; }
  /* Segmentos y filtros: 36 px, como el diseño a 375; el dedo toca 44 (la
     zona sale desde dentro del borde de 1 px: 5 + 1 por arriba y por abajo). */
  .tf-seg-btn { position: relative; }
  .tf-seg-btn::before { content: ""; position: absolute; inset: -5px 0; }
}

/* Tarjetas de opción (role="radio"): plantilla, forma de compartir. */
.tf-radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tf-radio-cards--wide { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tf-radio-card {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; min-width: 0;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: inherit; text-align: start; cursor: pointer; transition: border-color .15s, background .15s;
}
.tf-radio-card:hover { border-color: var(--hover-line); }
.tf-radio-card[aria-checked="true"] { border-color: var(--pri); background: var(--pri-fill-weak); }
.tf-radio-card[aria-disabled="true"], .tf-radio-card[disabled] { cursor: not-allowed; color: var(--muted); background: var(--panel); }
.tf-radio-cards--wide .tf-radio-card { padding: 14px; }
.tf-radio-dot {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--control-line);
  display: grid; place-items: center; margin-top: 1px;
}
.tf-radio-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.tf-radio-card[aria-checked="true"] .tf-radio-dot { border-color: var(--pri); }
.tf-radio-card[aria-checked="true"] .tf-radio-dot::after { background: var(--pri); }
.tf-radio-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tf-radio-cards:not(.tf-radio-cards--wide) .tf-radio-body { gap: 0; }
.tf-radio-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Un nombre que no cabe se parte en líneas parejas: «Confidencial 24 h» no deja la «h» sola. */
.tf-radio-title { font-size: 14px; line-height: 20px; font-weight: 700; text-wrap: balance; }
.tf-radio-hint { font-size: 12px; color: var(--muted); }
.tf-radio-cards--wide .tf-radio-hint { font-size: 12.5px; line-height: 18px; }
.tf-radio-card > svg { display: block; flex-shrink: 0; margin-inline-start: auto; }
/* La grande del paso 1 («Documento» / «Mensaje»): baldosa de 44 con su icono. */
.tf-radio-cards--big { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tf-radio-cards--big .tf-radio-card { align-items: center; gap: 14px; padding: 16px; border-radius: 16px; }
.tf-radio-cards--big .tf-radio-title { font-size: 15px; line-height: 21px; }
.tf-radio-cards--big .tf-radio-hint { font-size: 12.5px; }
.tf-radio-tile {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--pri-fill); color: var(--pri-text);
  display: grid; place-items: center; transition: background .15s;
}
.tf-radio-tile .tf-icon { font-size: 23px; }
.tf-radio-card[aria-checked="true"] .tf-radio-tile { background: var(--pri); color: #ffffff; }

/* ── 10 Destinatarios autorizados ─────────────────────────────────────────
   Chips de 32 px (40 en el móvil) dentro de una caja de controles. */

.tf-recipients {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 5px 6px;
  border: 1px solid var(--control-line); border-radius: 12px; background: var(--surface); cursor: text;
  transition: border-color .15s, box-shadow .15s;
}
.tf-recipients:hover { border-color: color-mix(in srgb, var(--pri) 25%, var(--pri-line)); }
.tf-recipients:focus-within { border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 14%, transparent); }
.tf-recipients[data-state="invalid"], .tf-recipients[data-state="duplicate"], .tf-recipients[data-state="required"] { border-color: var(--warn-strong); }
.tf-recipients[data-state="invalid"]:focus-within, .tf-recipients[data-state="required"]:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn-strong) 14%, transparent); }
.tf-recipient-chip {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%; height: 32px; padding-inline: 11px 0;
  border-radius: 999px; background: var(--pri-fill); border: 1px solid var(--pri-line); color: var(--ink); font-size: 13px;
}
.tf-recipient-chip > bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-recipient-x {
  width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
}
.tf-recipient-x .tf-icon { font-size: 17px; }
.tf-recipient-x:hover { color: var(--ink); }
.tf-recipients-input {
  flex: 1 1 160px; min-width: 0; height: 32px; padding: 0 6px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); font-family: inherit; font-size: 14px; text-align: start;
}
.tf-recipients-input:focus-visible { outline: none; }
.tf-recipients-input::placeholder { color: var(--muted); opacity: 1; }
@media (max-width: 720px) {
  .tf-recipient-chip { height: 40px; }
  /* La «×» de 40 toca 44; la caja de escribir mide 40, pero toda la caja
     (.tf-recipients, 44 o más) le pasa el foco al pulsarla. */
  .tf-recipient-x { position: relative; width: 40px; height: 40px; }
  .tf-recipient-x::before { content: ""; position: absolute; inset: -2px; }
  .tf-recipients-input { height: 40px; }
}

/* ── 11 Cuenta atrás y aperturas ──────────────────────────────────────── */

/* En línea: «Caduca en 1 d 23 h»; por debajo de un día, reloj y arena ámbar. */
.tf-countdown-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-variant-numeric: tabular-nums; }
.tf-countdown-inline > .tf-icon { font-size: 18px; color: var(--muted); }
.tf-countdown-inline--soon { font-weight: 500; }
.tf-countdown-inline--soon > .tf-icon { color: var(--warn-strong); }
.tf-countdown-inline--ended { color: var(--off-text); }
.tf-countdown-inline--ended > .tf-icon { color: var(--off-text); }
.tf-countdown-inline--none { color: var(--muted); }
.tf-countdown-inline--sm { gap: 5px; font-size: 13px; }
.tf-countdown-inline--sm > .tf-icon { font-size: 16px; }

/* En bloques: «01 días : 19 horas : 22 min : 54 seg» y su barra. */
.tf-countdown { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; min-width: 0; }
.tf-countdown-segs { display: flex; gap: 8px; font-variant-numeric: tabular-nums; direction: ltr; }
.tf-countdown-seg { display: flex; flex-direction: column; align-items: center; }
.tf-countdown-num { font-size: 30px; line-height: 34px; font-weight: 500; color: var(--ink); }
.tf-countdown-seg:last-child .tf-countdown-num { color: var(--muted); }
.tf-countdown-unit { font-size: 11.5px; color: var(--muted); }
.tf-countdown-sep { font-size: 26px; line-height: 34px; color: var(--faint); }
.tf-countdown-until { font-size: 12.5px; color: var(--muted); }
/* Grande (la del catálogo): 32/38, separador 28, barra de 8. */
.tf-countdown--lg { gap: 12px; }
.tf-countdown--lg .tf-countdown-segs { gap: 10px; }
.tf-countdown--lg .tf-countdown-seg { gap: 2px; }
.tf-countdown--lg .tf-countdown-num { font-size: 32px; line-height: 38px; }
.tf-countdown--lg .tf-countdown-sep { font-size: 28px; line-height: 38px; }
.tf-countdown--lg .tf-progress { height: 8px; }
.tf-countdown--soon .tf-overline > .tf-icon { color: var(--warn-strong); }

/* La barra de progreso (la del núcleo: degradado de marca sobre el acento al 10 %). */
.tf-progress { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--pri) 10%, var(--surface)); overflow: hidden; }
.tf-progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(var(--tf-line-angle), var(--brand-a), var(--brand-b)); transition: width .2s linear; }
.tf-progress--warn { background: var(--warn-fill); }
.tf-progress--warn .tf-progress-fill { background: var(--warn-strong); }
.tf-progress--8 { height: 8px; }

/* Aperturas: un segmento por apertura (hasta 6). Las gastadas, en gris; las que
   quedan, en acento; la última que queda, en ámbar. */
.tf-opens { display: flex; gap: 3px; }
.tf-opens-pip { width: 14px; height: 5px; border-radius: 999px; background: var(--pri); }
.tf-opens-pip--used { background: var(--control-line); }
.tf-opens-pip--last { background: var(--warn-strong); }
.tf-opens--lg { gap: 4px; }
.tf-opens--lg .tf-opens-pip { width: 20px; height: 6px; }
.tf-opens-cell { display: flex; flex-direction: column; gap: 5px; }
.tf-opens-text { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); }
.tf-opens-text--ended { color: var(--muted); }

/* Una línea de condiciones con icono («Caduca en 2 días · Te quedan 2 aperturas»). */
.tf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 0; }
.tf-meta-item { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); min-width: 0; }
.tf-meta-item > .tf-icon { font-size: 17px; color: var(--muted); }
.tf-meta-item--off { color: var(--off-text); }
/* En la tarjeta de 375 el plazo lleva el icono de su estado: arena ámbar por
   debajo de un día (texto 500) y, acabado, todo en el gris de lo apagado. En
   la del catálogo el reloj se queda gris (el diseño §06). */
.tf-meta-item--soon { font-weight: 500; }
.tf-meta-item--soon > .tf-icon { color: var(--warn-strong); }
.tf-item-card-meta .tf-meta-item--off > .tf-icon { color: var(--off-text); }
.tf-meta--sm { gap: 4px 12px; font-size: 12.5px; }
.tf-meta--sm .tf-meta-item { gap: 5px; }
.tf-meta--sm .tf-meta-item > .tf-icon { font-size: 16px; }

/* ── 12 Filas (escritorio) y tarjetas (375) de «Mis envíos» ──────────── */

.tf-table { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.tf-table-rows { margin-bottom: -1px; }
.tf-item-row, .tf-table-head {
  display: grid; grid-template-columns: minmax(0, 2.6fr) 150px 104px minmax(0, 1.3fr) minmax(0, 1.2fr) 84px;
  gap: 16px; padding: 10px 18px;
}
.tf-table-head {
  background: var(--panel); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted);
}
.tf-item-row { align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.tf-item-row:hover, .tf-item-row[data-tf-state~="hover"] { background: var(--hover-fill); }
.tf-item-row:focus-within { background: var(--hover-fill); }
.tf-item-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tf-item-tile {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; background: var(--pri-fill); color: var(--pri-text);
  display: grid; place-items: center;
}
.tf-item-tile .tf-icon { font-size: 20px; }
.tf-item-tile--off { background: var(--off-fill); color: var(--off-text); }
.tf-item-tile--40 { width: 40px; height: 40px; }
.tf-item-tile--40 .tf-icon { font-size: 21px; }
.tf-item-tile--42 { width: 42px; height: 42px; }
.tf-item-tile--42 .tf-icon { font-size: 22px; }
.tf-item-tile--46 { width: 46px; height: 46px; border-radius: 14px; }
.tf-item-tile--46 .tf-icon { font-size: 24px; }
.tf-item-text { display: flex; flex-direction: column; min-width: 0; }
/* El título es un botón (abre el detalle) que parece texto. */
.tf-item-title {
  padding: 0; border: 0; background: none; font-family: inherit; text-align: start; text-align: match-parent; cursor: pointer;
  font-size: 14px; line-height: 20px; font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.tf-item-title--destroyed { color: var(--muted); }
.tf-item-sub { font-size: 12.5px; line-height: 18px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-item-cell { display: flex; flex-direction: column; min-width: 0; }
.tf-item-line { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-item-line > .tf-icon { font-size: 16px; color: var(--muted); }
.tf-item-line--soon { font-weight: 500; }
.tf-item-line--soon > .tf-icon { color: var(--warn-strong); }
.tf-item-line--ended { color: var(--off-text); }
.tf-item-line--ended > .tf-icon { color: var(--off-text); }
.tf-item-line--live { gap: 7px; font-weight: 700; color: var(--pri-text); }
.tf-item-line-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-item-end { display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.tf-item-end > .tf-icon { font-size: 20px; color: var(--faint); transform: scaleX(var(--tf-flip)); }
.tf-item-file { width: 34px; height: 34px; display: grid; place-items: center; }
.tf-item-file > svg { display: block; width: 16px; height: 16px; }
.tf-item-badges { display: flex; margin-top: 5px; }

/* La tarjeta de 375 px (y la del catálogo). */
.tf-item-cards { display: flex; flex-direction: column; gap: 12px; }
.tf-item-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.tf-item-card:hover, .tf-item-card[data-tf-state~="hover"] { border-color: var(--hover-line); box-shadow: var(--shadow-card-hover); }
.tf-item-card-head { display: flex; gap: 12px; align-items: flex-start; }
.tf-item-card-head .tf-item-text { flex: 1; }
.tf-item-card .tf-item-title { font-size: 14.5px; }
.tf-item-card-meta { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.tf-item-card-meta .tf-meta-item { gap: 5px; }
.tf-item-card-meta .tf-meta-item > .tf-icon { font-size: 16px; }
.tf-item-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line);
}
.tf-item-card-foot-text { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-item-card-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
/* La del catálogo y el escritorio: 18 de relleno, 14 de hueco, título 15. */
.tf-item-card--roomy { gap: 14px; padding: 18px; }
.tf-item-card--roomy .tf-item-title { font-size: 15px; line-height: 21px; }

/* Las tres baldosas de arriba (Activos · Se están viendo ahora · Caducan pronto). */
.tf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tf-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink);
  font-family: inherit; text-align: start; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.tf-stat:hover, .tf-stat[data-tf-state~="hover"] { border-color: var(--hover-line); box-shadow: var(--shadow-card-hover); }
.tf-stat[aria-pressed="true"] { border-color: var(--pri-line); }
.tf-stat-head { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.tf-stat-head > .tf-icon { font-size: 18px; color: var(--warn-strong); }
.tf-stat-n { font-size: 26px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.tf-stat-label { font-size: 12.5px; line-height: 17px; color: var(--muted); }
@media (max-width: 720px) {
  .tf-stats { gap: 8px; }
  .tf-stat { padding: 12px; }
  .tf-stat-n { font-size: 22px; }
}

/* ── 13 Registro (timeline) ───────────────────────────────────────────────
   El más reciente arriba. El nodo dice el tipo (live, neutral, warn, change,
   request, end); la línea de abajo, quién, dónde y cómo. La hora, tabular y
   alineada al final. */

.tf-timeline { list-style: none; margin: 0; padding: 0; }
.tf-event { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 14px; padding-bottom: 20px; }
.tf-event-rail { position: absolute; inset-inline-start: 14px; top: 36px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--line); }
.tf-event:last-child .tf-event-rail { display: none; }
.tf-event-node-wrap { position: relative; width: 30px; height: 30px; }
.tf-event-node {
  position: relative; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--hover-fill); border: 1px solid var(--line); color: var(--ink);
}
.tf-event-node .tf-icon { font-size: 17px; }
.tf-event--live .tf-event-node { background: var(--pri); border-color: transparent; color: #ffffff; }
.tf-event--live .tf-event-node-wrap::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--pri); animation: tf-pulse 1.8s ease-out infinite;
}
.tf-event--warn .tf-event-node { background: var(--warn-fill); border-color: var(--warn-line); color: var(--warn-strong); }
.tf-event--change .tf-event-node, .tf-event--request .tf-event-node { background: var(--pri-fill); border-color: var(--pri-line); color: var(--pri-text); }
.tf-event--end .tf-event-node { background: var(--off-fill); border-style: dashed; border-color: var(--faint); color: var(--off-text); }
.tf-event--expired .tf-event-node { background: var(--off-fill); border-color: var(--off-line); color: var(--off-text); }
.tf-event-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 4px; }
.tf-event-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.tf-event-heading { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.tf-event-title { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.tf-event--live .tf-event-title { color: var(--pri-text); }
.tf-event-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-event-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; line-height: 18px; color: var(--muted); }
.tf-event-meta-item { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.tf-event-meta-item > .tf-icon { font-size: 15px; }
.tf-event-text { font-size: 12.5px; line-height: 18px; color: var(--muted); }
.tf-event-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
/* Los finales («Caducado», «Destruido por ti») sin raya: siempre lo último. */
.tf-event--final { padding-bottom: 0; }

/* ── 14 Modal y destruir manteniendo pulsado ──────────────────────────── */

.tf-modal {
  position: fixed; inset: 0; z-index: 60; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.tf-modal-card {
  position: relative; width: 100%; max-width: 460px; max-height: 92%; overflow: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-dialog); padding: 20px 20px 18px; text-align: start;
}
.tf-modal-card:focus { outline: none; }
.tf-modal-card--420 { max-width: 420px; }
.tf-modal-card--560 { max-width: 560px; }
.tf-modal-close { position: absolute; top: 10px; inset-inline-end: 10px; }
.tf-modal-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--pri-fill); color: var(--pri-text);
}
.tf-modal-icon .tf-icon { font-size: 24px; }
.tf-modal-icon--danger { background: var(--danger-fill); color: var(--danger); }
.tf-modal-title { margin: 14px 0 6px; padding-inline-end: 40px; font-size: 19px; line-height: 25px; font-weight: 700; letter-spacing: -0.2px; overflow-wrap: anywhere; }
.tf-modal-title:first-child, .tf-modal-close + .tf-modal-title { margin-top: 4px; }
.tf-modal-text { margin: 0; font-size: 14.5px; line-height: 22px; color: var(--muted); }
.tf-modal-text--sm { font-size: 14px; line-height: 21px; }
.tf-modal-body { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.tf-modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
/* El fondo no se mueve mientras hay un diálogo abierto. */
.tf-modal-open { overflow: hidden; }
@media (max-width: 520px) {
  .tf-modal { padding: 16px; align-items: flex-end; }
  .tf-modal-card { max-height: 88%; }
  .tf-modal-actions > * { flex: 1 1 auto; }
}

/* Destruir manteniendo pulsado: el relleno crece de inicio a fin en 1,5 s. */
.tf-hold {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--danger); color: #ffffff;
  font-family: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; touch-action: none; user-select: none;
  -webkit-user-select: none; -webkit-touch-callout: none;
}
.tf-hold-fill { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 0; background: rgba(0, 0, 0, .28); pointer-events: none; }
.tf-hold-label { position: relative; display: inline-flex; align-items: center; gap: 8px; pointer-events: none; }
.tf-hold-label .tf-icon { font-size: 19px; }
.tf-hold[data-state="nudge"] { animation: tf-nudge .3s ease-in-out; }
/* El máximo de la empresa bajo el plazo y bajo las aperturas (39), en el
   asistente y en el editor de plantillas: una nota pequeña, como la del
   programa de Windows (PROTECT-formulario-maximos). */
.tf-wz-limit { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.tf-wz-limit > .tf-icon { font-size: 18px; color: var(--pri-text); }

/* Lleno: «ocupado» mientras se destruye (el relleno entero sobre el rojo y el giro de espera). */
.tf-hold[data-state="busy"] { cursor: progress; }
.tf-hold[data-state="busy"] .tf-hold-fill { width: 100%; }
.tf-hold[disabled]:not([data-state="busy"]) { background: var(--disabled); cursor: not-allowed; }
.tf-hold-hint { margin: 10px 0 0; text-align: end; font-size: 12px; color: var(--muted); }
.tf-hold-hint[data-state="nudge"] { color: var(--ink); }

/* ── 15 Enlace, código y QR ───────────────────────────────────────────── */

/* La etiqueta numerada de cada pieza («① Enlace», «② Código de apertura»). */
.tf-piece { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tf-piece-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.tf-piece-n {
  width: 20px; height: 20px; border-radius: 50%; background: var(--pri); color: #ffffff;
  display: inline-grid; place-items: center; font-size: 11px; font-variant-numeric: tabular-nums;
}
.tf-copy-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tf-copy-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* El enlace: sólo lectura, monoespaciado, recortado con puntos suspensivos. */
.tf-link-box {
  flex: 1 1 240px; min-width: 0; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid var(--control-line); border-radius: 12px; background: var(--panel); color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; direction: ltr;
}
.tf-link-box > .tf-icon { font-size: 18px; color: var(--muted); }
.tf-link-box > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* El código: 3 + 3 cifras, grande y tabular, con borde discontinuo. */
.tf-code-display {
  flex: 1 1 200px; height: 60px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--control-line); border-radius: 12px; background: var(--panel); color: var(--ink);
  font-size: 32px; font-weight: 500; letter-spacing: 5px; font-variant-numeric: tabular-nums; direction: ltr;
}
.tf-code-display--sm { height: 56px; font-size: 30px; letter-spacing: 4px; }
/* El mensaje para acompañar el .tfp. */
.tf-message-box {
  margin: 0; padding: 12px 14px; border: 1px dashed var(--control-line); border-radius: 12px; background: var(--panel);
  font-size: 14px; line-height: 21px; overflow-wrap: anywhere;
}

/* El QR: siempre tinta sobre blanco, también en oscuro, para que lo lea cualquier móvil. */
.tf-qr {
  position: relative; width: 180px; height: 180px; flex-shrink: 0; border-radius: 14px; background: #ffffff;
  border: 1px solid var(--line); padding: 6px; overflow: hidden;
}
.tf-qr > svg { width: 100%; height: 100%; display: block; shape-rendering: crispEdges; }
.tf-qr--172 { width: 172px; height: 172px; }
.tf-qr--240 { width: 240px; height: 240px; }
/* Destruido o caducado: el QR borroso con su sello. */
.tf-qr--gone > svg { filter: blur(5px); opacity: .3; }
.tf-qr-stamp { position: absolute; inset: 0; display: grid; place-items: center; }
.tf-qr-stamp > span {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px;
  background: #ffffff; border: 1px dashed #8d9cae; color: #5a6b80; font-size: 12px; font-weight: 700;
}
.tf-qr-stamp .tf-icon { font-size: 16px; }
/* Las tarjetas que lo llevan. */
.tf-qr-card { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.tf-qr-card-body { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tf-qr-card-title { font-size: 17px; line-height: 23px; font-weight: 700; }
.tf-qr-card-text { font-size: 13.5px; line-height: 20px; color: var(--muted); }
/* «Pantalla completa» y «Copiar enlace» bajo el texto (36 px; 44 en el móvil). */
.tf-qr-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tf-qr-card-actions .tf-btn-small { padding: 0 12px; }
.tf-qr-card-actions .tf-btn-tertiary { height: 36px; padding: 0 10px; border-radius: 10px; font-size: 13px; gap: 6px; }
.tf-qr-card-actions .tf-btn-tertiary .tf-icon { font-size: 17px; }
.tf-qr-card > .tf-hint { flex-basis: 100%; }
@media (max-width: 720px) { .tf-qr-card-actions .tf-btn-tertiary { height: 44px; } }
.tf-qr-side { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.tf-qr-side-title { font-size: 15px; line-height: 21px; font-weight: 700; }
.tf-qr-side-text { font-size: 13px; line-height: 19px; color: var(--muted); }

/* ── 16 Código de 6 cifras ────────────────────────────────────────────────
   Sólo cifras, teclado numérico, pegar y autocompletar rellenan las seis.
   3 + 3, como el código del mensaje. Estados en data-state del grupo: idle,
   checking, wrong, locked, correct. */

.tf-code { display: flex; gap: 8px; justify-content: center; direction: ltr; }
.tf-code-digit {
  flex: 1 1 0; min-width: 0; max-width: 54px; height: 60px; padding: 0;
  border: 1px solid var(--control-line); border-radius: 12px; background: var(--surface); color: var(--ink);
  text-align: center; font-family: inherit; font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums;
  caret-color: var(--pri); -webkit-appearance: none; appearance: none; transition: border-color .15s;
}
.tf-code-digit:nth-child(3) { margin-inline-end: 14px; }
.tf-code-digit:hover { border-color: color-mix(in srgb, var(--pri) 25%, var(--pri-line)); }
.tf-code-digit:focus-visible { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 14%, transparent); }
.tf-code-digit[data-filled] { border-color: var(--muted); }
.tf-code[data-state="checking"] .tf-code-digit { border-color: var(--line); background: var(--panel); color: var(--muted); }
.tf-code[data-state="wrong"] .tf-code-digit { border-color: var(--warn-strong); }
.tf-code[data-state="correct"] .tf-code-digit { border-color: var(--ok); }
.tf-code[data-state="locked"] .tf-code-digit { border-color: var(--line); background: var(--panel); }
.tf-code-digit:disabled { cursor: not-allowed; opacity: 1; -webkit-text-fill-color: currentColor; }
.tf-code--start { justify-content: flex-start; }
@media (max-width: 520px) { .tf-code-digit:nth-child(3) { margin-inline-end: 8px; } }

/* El mensaje de debajo: pista en gris, error y bloqueo en ámbar, bien en verde. */
.tf-code-msg {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 12px;
  background: transparent; border: 1px solid transparent; font-size: 13.5px; line-height: 19px; color: var(--muted);
}
.tf-code-msg > .tf-icon { font-size: 19px; color: var(--faint); }
.tf-code-msg > .tf-spinner { width: 14px; height: 14px; color: var(--pri); }
.tf-code-msg-text { flex: 1; }
.tf-code-msg-time { font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.tf-code-msg[data-state="wrong"], .tf-code-msg[data-state="locked"], .tf-code-msg[data-state="warn"] { background: var(--warn-fill); border-color: var(--warn-line); color: var(--ink); }
.tf-code-msg[data-state="wrong"] > .tf-icon, .tf-code-msg[data-state="locked"] > .tf-icon, .tf-code-msg[data-state="warn"] > .tf-icon { color: var(--warn-strong); }
.tf-code-msg[data-state="correct"] { background: var(--ok-fill); border-color: var(--ok-line); color: var(--ok-text); }
.tf-code-msg[data-state="correct"] > .tf-icon { color: var(--ok); }


/* ── 17 Vacío y soltar ────────────────────────────────────────────────── */

.tf-empty {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 40px 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px;
}
.tf-empty--small { gap: 12px; }
.tf-empty-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--hover-fill); color: var(--muted);
  display: grid; place-items: center;
}
.tf-empty-icon .tf-icon { font-size: 26px; }
.tf-empty-title { margin: 0; font-size: 19px; line-height: 25px; font-weight: 700; letter-spacing: -0.2px; }
.tf-empty--small .tf-empty-title { font-size: 17px; line-height: 23px; letter-spacing: 0; }
.tf-empty-text { margin: 0; max-width: 380px; font-size: 14px; line-height: 21px; color: var(--muted); }
.tf-empty--small .tf-empty-text { max-width: 320px; }
.tf-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
/* El dibujo hecho de la propia interfaz: dos huecos y una tarjeta con el logo. */
.tf-empty-art { position: relative; width: 240px; height: 104px; margin-bottom: 6px; }
.tf-empty-art > span { position: absolute; border-radius: 12px; border: 1px dashed var(--control-line); }
.tf-empty-art > span:nth-child(1) { inset-inline: 28px; top: 0; height: 40px; }
.tf-empty-art > span:nth-child(2) { inset-inline: 14px; top: 16px; height: 44px; background: var(--surface); }
.tf-empty-art > div {
  position: absolute; inset-inline: 0; top: 36px; height: 58px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-card-hover); display: flex; align-items: center; gap: 10px; padding: 0 12px;
}
.tf-empty-art svg { display: block; flex-shrink: 0; }
.tf-empty-art-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tf-empty-art-lines > span { height: 8px; border-radius: 4px; background: var(--track); }
.tf-empty-art-lines > span:first-child { width: 80%; }
.tf-empty-art-lines > span:last-child { width: 50%; }
.tf-empty-art-pill { width: 40px; height: 16px; border-radius: 999px; background: var(--ok-fill); border: 1px solid var(--ok-line); }

/* Soltar un fichero: discontinuo en reposo, acento al arrastrar encima. */
.tf-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px;
  min-height: 230px; padding: 24px 18px; border: 1.5px dashed var(--control-line); border-radius: 16px;
  background: var(--panel); transition: background .15s, border-color .15s;
}
.tf-drop[data-state="over"] { background: var(--pri-fill-weak); border-color: var(--pri); }
.tf-drop[data-state="reading"] { border-style: solid; }
.tf-drop > svg { display: block; }
.tf-drop-title { font-size: 16px; line-height: 22px; font-weight: 700; }
.tf-drop-or { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tf-drop-or > span { font-size: 13px; color: var(--muted); }
.tf-drop-types { font-size: 12.5px; color: var(--muted); }
.tf-drop-reading { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.tf-drop-error {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; text-align: start;
  background: var(--warn-fill); border: 1px solid var(--warn-line); font-size: 13px; line-height: 19px; color: var(--ink);
}
.tf-drop-error > .tf-icon { font-size: 18px; color: var(--warn-strong); }
/* El input del fichero: fuera de la vista pero vivo (lo abre «Elegir»). */
.tf-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ── 18 Ficheros y cifrado ────────────────────────────────────────────── */

/* Un fichero o un envío: baldosa de 42, nombre y datos. */
.tf-file { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tf-file-text { display: flex; flex-direction: column; min-width: 0; }
/* El nombre va en su <bdi> (dirección propia); se alinea con la página (match-parent). */
.tf-file-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; text-align: match-parent; }
.tf-file-name--wrap { font-size: 14.5px; line-height: 20px; white-space: normal; overflow-wrap: anywhere; }
.tf-file-meta { font-size: 12.5px; color: var(--muted); }
/* El envío dentro de la portada del destinatario (panel de 14, relleno 12/14). */
.tf-item-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
/* Cifrado: el verde de «Listo para el paso siguiente». */
.tf-file--encrypted {
  justify-content: space-between; flex-wrap: wrap; padding: 16px 18px; border: 1px solid var(--ok-line);
  border-radius: 16px; background: var(--ok-fill);
}
.tf-file--encrypted .tf-item-tile { background: var(--surface); color: var(--ok-text); }
.tf-file--encrypted .tf-file-meta { color: var(--ok-text); }
.tf-file--encrypted .tf-btn-small { border-color: var(--ok-line); }
/* El fichero protegido (.tfp): icono de 48, nombre y «Cifrado · 2,5 MB». */
.tf-tfp-file {
  display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; padding: 14px 16px;
  border: 1px solid var(--control-line); border-radius: 14px; background: var(--panel);
}
.tf-tfp-file > svg { display: block; flex-shrink: 0; }
.tf-tfp-file .tf-file-text { gap: 2px; flex: 1 1 180px; }

/* Cifrando: el panel con su barra y los tres pasos. */
.tf-progress-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.tf-progress-title { font-size: 15.5px; line-height: 22px; font-weight: 700; }
.tf-progress-sub { font-size: 13.5px; color: var(--muted); }
.tf-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tf-steps-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink); }
.tf-steps-mark { width: 18px; height: 18px; display: grid; place-items: center; flex-shrink: 0; }
.tf-steps-mark > .tf-icon { font-size: 18px; color: var(--ok); }
.tf-steps-mark > .tf-spinner { width: 14px; height: 14px; color: var(--pri); }
.tf-steps-mark > i { width: 8px; height: 8px; border-radius: 50%; background: var(--control-line); }
.tf-steps-item[data-state="todo"] { color: var(--muted); }

/* ── 19 Asistente y resumen ───────────────────────────────────────────── */

/* «1 Qué quieres enviar · 2 Condiciones · 3 Compartir»: hecho, activo, pendiente. */
.tf-wizard { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tf-wizard-step { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tf-wizard-step[data-state="done"] { cursor: pointer; }
.tf-wizard-bar { height: 4px; border-radius: 999px; background: var(--control-line); transition: background .3s; }
.tf-wizard-step[data-state="done"] .tf-wizard-bar, .tf-wizard-step[data-state="active"] .tf-wizard-bar { background: var(--pri); }
.tf-wizard-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tf-wizard-n {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--surface); color: var(--muted); border: 1px solid var(--control-line);
  font-variant-numeric: tabular-nums;
}
.tf-wizard-n .tf-icon { font-size: 15px; }
.tf-wizard-text { font-size: 13.5px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-wizard-step[data-state="done"] .tf-wizard-n { background: var(--ok-fill); color: var(--ok-text); border-color: var(--ok-line); }
.tf-wizard-step[data-state="active"] .tf-wizard-n { background: var(--pri); color: #ffffff; border-color: var(--pri); }
.tf-wizard-step[data-state="active"] .tf-wizard-text { font-weight: 700; color: var(--ink); }
/* El paso hecho es un botón (vuelve a él); parece el resto. */
.tf-wizard-go { display: contents; }
.tf-wizard-step button.tf-wizard-label { padding: 0; border: 0; background: none; font-family: inherit; text-align: start; cursor: pointer; color: inherit; }
@media (max-width: 520px) { .tf-wizard-text { font-size: 12.5px; } }
@media (max-width: 720px) {
  /* El paso hecho (un botón de 24 px) toca 44: 10 por encima y por debajo. */
  .tf-wizard-step button.tf-wizard-label { position: relative; }
  .tf-wizard-step button.tf-wizard-label::before { content: ""; position: absolute; inset: -10px 0; }
}

/* El resumen lateral (pegado arriba al bajar, bajo la barra del núcleo: --zt-sticky-top). */
.tf-summary {
  position: sticky; top: calc(var(--zt-sticky-top, 66px) + 18px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 24px; display: flex; flex-direction: column; gap: 12px;
}
.tf-summary-title { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.tf-summary-text { margin: 0; font-size: 15px; line-height: 23px; color: var(--ink); }
.tf-summary-more { align-self: flex-start; height: 32px; padding: 0 8px; margin-inline-start: -8px; border-radius: 8px; font-size: 13px; gap: 4px; }
@media (max-width: 720px) {
  .tf-summary { position: static; }
  /* «Más información» se queda en 32 px; el dedo toca 44. */
  .tf-summary-more { position: relative; }
  .tf-summary-more::before { content: ""; position: absolute; inset: -6px 0; }
}

/* ── 20 Finales del destinatario ──────────────────────────────────────── */

.tf-end { align-items: center; text-align: center; gap: 14px; margin-top: 12px; }
.tf-end-icon {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--off-fill); border: 1px solid var(--line); color: var(--off-text);
}
.tf-end-icon .tf-icon { font-size: 30px; }
.tf-end-icon--dashed { border-style: dashed; border-color: var(--faint); }
.tf-end-icon--warn { background: var(--warn-fill); border-color: var(--warn-line); color: var(--warn-strong); }
.tf-end-icon--ok { background: var(--ok-fill); border-color: var(--ok-line); color: var(--ok-text); }
.tf-end-icon--pri { background: var(--pri-fill); border-color: var(--pri-line); color: var(--pri-text); }
.tf-end-text { margin: 0; max-width: 420px; font-size: 14.5px; line-height: 22px; color: var(--muted); text-wrap: pretty; overflow-wrap: anywhere; }
.tf-end-extra { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tf-end-about { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); width: 100%; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }

/* ── 21 Portada del destinatario e identidad ──────────────────────────── */

/* Quién lo envía: avatar con iniciales, nombre, empresa y «Remitente verificado». */
.tf-sender { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tf-sender-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 160px; }
.tf-sender-name { font-size: 15px; line-height: 21px; font-weight: 700; }
.tf-sender-org { font-size: 13px; color: var(--muted); }
.tf-avatar {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--pri), var(--acc)); color: #ffffff; font-size: 15px; font-weight: 700;
}
/* «Antes de abrirlo»: baldosas de 32 y texto de 15. */
.tf-conditions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tf-conditions > li { display: flex; align-items: center; gap: 10px; font-size: 15px; line-height: 21px; font-variant-numeric: tabular-nums; }
.tf-conditions-tile {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; background: var(--hover-fill); color: var(--ink);
  display: grid; place-items: center;
}
.tf-conditions-tile .tf-icon { font-size: 19px; }
/* Las notas de abajo (icono en acento, 13/19 en gris) con su raya encima. */
.tf-notes { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 19px; color: var(--muted); }
.tf-notes > li { display: flex; gap: 10px; align-items: flex-start; }
.tf-notes > li > .tf-icon { font-size: 18px; color: var(--pri-text); }
.tf-notes--plain { padding-top: 0; border-top: 0; }
/* La nota de privacidad de quien recibe (D4 d, decidido el 31-10): en las notas
   de la portada, de /abrir, de «¿Quién eres?» y de /confirmar/…. Un nombre de
   empresa largo parte la línea. El enlace va en --pri-text, como los de TFP
   sobre la tarjeta: en oscuro, el --pri de la carcasa se queda en 2,6:1
   (recipient.css, «Tracefold para Windows»). */
.tf-rcp-privacy-text { min-width: 0; overflow-wrap: anywhere; }
.tf-rcp-privacy-link { font-weight: 600; }
:root a.tf-rcp-privacy-link { color: var(--pri-text); }
/* La baldosa de cabecera de una tarjeta del destinatario (44, radio 12). */
.tf-card-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--pri-fill); color: var(--pri-text); display: grid; place-items: center; flex-shrink: 0; }
.tf-card-icon .tf-icon { font-size: 23px; }
.tf-card-icon--warn { background: var(--warn-fill); color: var(--warn-strong); }
.tf-card-head { display: flex; flex-direction: column; gap: 4px; }
.tf-card-head--6 { gap: 6px; }

/* ── 22 Personas (autorizados, «Quién puede abrirlo») ─────────────────── */

.tf-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tf-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tf-person--row { padding: 9px 0; border-bottom: 1px solid var(--line); }
.tf-person--row:first-child { border-top: 1px solid var(--line); }
.tf-person-avatar {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--pri-fill); color: var(--pri-text);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
}
.tf-person-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tf-person-email { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-person--row .tf-person-email { font-weight: 700; }
.tf-person-sub { font-size: 12px; color: var(--muted); }

/* ── Menos movimiento (prefers-reduced-motion) ────────────────────────────
   La carcasa del núcleo no apaga lo que anima una herramienta: TFP apaga lo
   suyo y deja el último fotograma. Los puntos «en directo», quietos y sin su
   onda; «Destruir…» soltado antes, sin el empujón (el aviso de «mantén
   pulsado» sigue: hold.js); los botones no se levantan al pasar por encima;
   barras, rellenos, interruptores y colores, sin transición (saltan a su
   valor; un retraso, como el de la lista ocupada, se queda: evita un parpadeo
   y no mueve nada). El giro de espera sigue, más despacio: es la única señal
   de que algo está en marcha, al lado de su texto (WCAG 2.3.3 deja el
   movimiento que hace falta para la función), y no desplaza nada. Las hojas
   de cada página apagan lo suyo (sender-detail, sender-new, viewer, landing,
   tour, recipient-identity). */
@media (prefers-reduced-motion: reduce) {
  [class*="tf-"], [class*="tf-"]::before, [class*="tf-"]::after { transition-duration: 0s !important; }
  .tf-pulse::before, .tf-event--live .tf-event-node-wrap::before { animation: none; opacity: 0; }
  .tf-hold[data-state="nudge"] { animation: none; }
  .tf-spinner { animation-duration: 2.4s; }
  .tf-btn-small--primary:hover, .tf-btn-small--primary[data-tf-state~="hover"], .tf-btn-small--primary:active,
  .tf-btn-hero:hover, .tf-btn-hero[data-tf-state~="hover"], .tf-btn-hero:active, .tf-btn-hero[data-tf-state~="active"] { transform: none; }
}

/* ── Impresión: nada de lo interactivo de TFP. ─────────────────────────── */
@media print {
  .tf-modal, .tf-hold, .tf-btn, .tf-new-item, .tf-tabs { display: none !important; }
}
