/* ==========================================================================
   Tokka — capa de refinamiento visual (panel, login/registro, escáner,
   contactos). Se carga DESPUÉS de tokka-style.css y solo corrige cómo se usan
   los colores de siempre: tipografía (DM Sans), escala de tamaños, radios,
   bordes finos en vez de sombras y espaciado en múltiplos de 4.

   El perfil público (.tokka-profile-body) y la tienda NO entran aquí.

   Todo va dentro de :where(...) para que el alcance no sume especificidad:
   las reglas empatan con las originales y ganan solo por orden, así que los
   temas oscuros del panel (body.tokka-dash-theme-*, más específicos) siguen
   mandando en colores. Donde hace falta color, se usan sus mismas variables
   (--tokka-dash-*) con el valor claro de respaldo.
   ========================================================================== */

@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
    src: url("../fonts/dm-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
    src: url("../fonts/dm-sans-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:where(body.tokka-body:not(.tokka-profile-body)) {
    /* Radios: 3 niveles + píldora. */
    --r-sm: 12px;       /* chips, controles chicos */
    --r-md: 14px;       /* campos, tarjetas internas */
    --r-lg: 28px;       /* tarjetas principales */
    --r-pill: 999px;

    /* Líneas finas (en vez de sombras). En temas oscuros se usan las
       variables --tokka-dash-border* del tema. */
    --r-line: rgba(17, 17, 17, 0.08);
    --r-line-strong: rgba(17, 17, 17, 0.16);
    --r-ring: rgba(17, 17, 17, 0.10);
    --r-muted: #5b616b;   /* = --tokka-gray */
    --r-label: #374151;

    --tokka-radius-sm: 14px;
    --tokka-radius-md: 14px;
    --tokka-radius-lg: 28px;
}

:where(body.tokka-body[class*="tokka-dash-theme-"]) {
    --r-ring: rgba(255, 255, 255, 0.14);
    --r-muted: var(--tokka-dash-text-soft);
    --r-label: var(--tokka-dash-text-soft);
}

/* ---------- Base ----------
   Los estilos globales del tema (Twenty Twenty-Five) ponen text-align:right,
   line-height:1 y letter-spacing negativo a todo el sitio; aquí se regresa a
   lo normal solo en las páginas de la app. Esta regla sí lleva
   especificidad real (sin :where) para ganarle al "body { ... }" del tema. */
body.tokka-body:not(.tokka-profile-body) {
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    letter-spacing: normal;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Los controles de formulario no heredan la fuente por default (por eso
   salían en Arial). */
:where(body.tokka-body:not(.tokka-profile-body)) :is(input, select, textarea, button) {
    font-family: inherit;
    letter-spacing: inherit;
}

/* Los enlaces traen su propia fuente desde los estilos globales del tema
   (y algunas reglas viejas fijan "Afacad Flux"): selector real para ganar. */
body.tokka-body:not(.tokka-profile-body) :is(a, h1, h2, h3, h4, p, span, label, summary) {
    font-family: inherit;
}

/* ---------- Tarjetas principales ---------- */
:where(body.tokka-body:not(.tokka-profile-body)) :is(.tokka-auth-card, .tokka-dash-card) {
    border-radius: var(--r-lg);
    padding: 28px 24px;
    border: 1px solid var(--tokka-dash-border-soft, var(--r-line));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* ---------- Tipografía ---------- */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-dash-hello {
    font-size: 30px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-auth-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-dash-card h2 {
    margin-top: 28px;
    padding-top: 20px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    border-top: 1px solid var(--tokka-dash-border-soft, var(--r-line));
}

:where(body.tokka-body:not(.tokka-profile-body)) :is(.tokka-auth-card, .tokka-dash-card) label {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--r-label);
}

/* El panel se pidió más ligero que login/registro. */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-dash-card label {
    font-weight: 400;
}

:where(body.tokka-body:not(.tokka-profile-body)) :is(.tokka-auth-card, .tokka-dash-card) form {
    gap: 8px;
}

/* Textos de ayuda: 300 a 12px en gris claro casi no se leía en celular. */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-field-hint,
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-dash-card .tokka-field-hint {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--r-muted);
}

:where(body.tokka-body:not(.tokka-profile-body)) :is(.tokka-scan-count, .tokka-photo-label) {
    font-size: 13px;
    color: var(--r-muted);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-style-group-label {
    margin: 16px 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--r-muted);
}

/* ---------- Campos ---------- */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-dash-card :is(input[type=text], input[type=email], input[type=url], input[type=password], input[type=tel], input[type=number], textarea, select),
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-cc-select,
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-map-search-row input {
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--tokka-dash-border, var(--r-line-strong));
    border-radius: var(--r-md);
    background: var(--tokka-dash-surface-2, #fff);
    color: inherit;
    font-size: 16px; /* 16px evita el zoom automático de iPhone al enfocar */
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-dash-card textarea {
    min-height: 104px;
    resize: vertical;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-cc-select { padding: 10px 8px; }

/* Login/registro: se quedan en píldora para ir con el botón de Google
   (ese lo dibuja Google y no se puede cambiar de forma). */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-auth-card input:not([type=checkbox]):not([type=radio]):not([type=hidden]) {
    min-height: 48px;
    padding: 12px 20px !important;
    border: 1px solid var(--tokka-dash-border, var(--r-line-strong));
    border-radius: var(--r-pill) !important;
    font-size: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

:where(body.tokka-body:not(.tokka-profile-body)) :is(.tokka-auth-card, .tokka-dash-card) :is(input, textarea, select)::placeholder {
    color: #9ca3af;
    opacity: 1;
}

:where(body.tokka-body:not(.tokka-profile-body)) :is(.tokka-auth-card, .tokka-dash-card) :is(input, textarea, select):focus,
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-map-search-row input:focus {
    outline: none;
    border-color: var(--tokka-dash-text, var(--tokka-black));
    box-shadow: 0 0 0 3px var(--r-ring);
}

/* Campos con prefijo (ej. "@", "wa.me/"): el borde lo lleva el contenedor. */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-prefix-row {
    border: 1px solid var(--tokka-dash-border, var(--r-line-strong));
    border-radius: var(--r-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-dash-card .tokka-prefix-row input {
    border: none;
    border-radius: 0;
    box-shadow: none;
    min-height: 42px;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-prefix-row:focus-within {
    border-color: var(--tokka-dash-text, var(--tokka-black));
    box-shadow: 0 0 0 3px var(--r-ring);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-prefix { padding: 0 12px; font-size: 15px; }

/* Configurador de conexiones: prefijo fijo ("linkedin.com/in/") + solo la
   extensión. En celular un prefijo largo ("link.mercadopago.com.mx/") se
   recorta por la izquierda (rtl + <bdi>) para que siempre se vea el final. */
#tokka-configurator-dialog .tokka-prefix-row { display: flex; }
#tokka-configurator-dialog .tokka-prefix {
    flex: 0 1 auto;
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: rtl;
    padding-right: 2px;
}
#tokka-configurator-dialog .tokka-prefix.tokka-suffix { direction: ltr; padding: 0 12px 0 2px; }
#tokka-configurator-dialog .tokka-prefix-row input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding-left: 2px;
    background: transparent;
}
#tokka-configurator-dialog .tokka-conn-paste-hint { margin: 6px 0 0; }
#tokka-config-preview.tokka-field-error { color: #dc2626; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-map-search-btn {
    width: 44px;
    border: 1px solid var(--tokka-dash-border, var(--r-line-strong));
    border-radius: var(--r-md);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-hours-time-inputs input[type=time] {
    border: 1px solid var(--tokka-dash-border, var(--r-line-strong));
    border-radius: 10px;
    font-size: 13px;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-hours-row { border-radius: var(--r-sm); }

/* ---------- Botones ----------
   Sin "brinco" al pasar el mouse: solo cambio de tono + un brillo interior
   muy sutil (como los botones oscuros del documento de referencia). */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-btn-primary {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: background-color 0.15s ease, transform 0.1s ease;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-dash-card .tokka-btn-primary { font-weight: 500; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-btn-primary:hover {
    transform: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

:where(body.tokka-body:not(.tokka-profile-body)) :is(.tokka-btn-primary, .tokka-btn-secondary, .tokka-pill):active {
    transform: scale(0.985);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-btn-secondary {
    min-height: 48px;
    padding: 12px 20px;
    border: 1px solid var(--tokka-dash-border, var(--r-line-strong));
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
}

:where(body.tokka-body:not(.tokka-profile-body)) :is(.tokka-btn-primary, .tokka-btn-secondary, .tokka-pill, .tokka-link-btn, .tokka-quickadd-btn):focus-visible {
    outline: 2px solid var(--tokka-dash-text, var(--tokka-black));
    outline-offset: 2px;
}

/* Píldoras chicas del encabezado (Ver mi perfil / Cerrar sesión / + Escanear). */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-pill {
    min-height: 36px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

/* "Cerrar sesión": acción secundaria, no debe competir con la principal. Mismo
   rojo, pero como contorno en vez de relleno. */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-pill-danger {
    background: transparent;
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-pill-danger:hover { background: rgba(220, 38, 38, 0.06); }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-dash-pills { gap: 8px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-link-btn {
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-link-btn:hover { text-decoration: underline; }

/* ---------- Login / registro ---------- */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-auth-card form { gap: 12px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-auth-switch { font-size: 14px; margin-top: 20px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-auth-forgot a {
    font-size: 13px;
    font-style: normal;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-auth-divider { margin: 20px 0; font-size: 13px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-auth-divider::before,
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-auth-divider::after {
    border-bottom-color: var(--r-line);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-auth-divider span { padding: 0 12px; }

/* ---------- Panel: secciones, conexiones, fotos ---------- */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-section-collapsible {
    margin-top: 16px;
    padding: 0 16px;
    border: 1px solid var(--tokka-dash-border-soft, var(--r-line));
    border-radius: var(--r-md);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-section-collapsible summary {
    padding: 16px 28px 16px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-section-collapsible summary::after { top: 12px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-quickadd-grid { gap: 8px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-quickadd-btn {
    gap: 8px;
    padding: 16px 8px;
    border: 1px solid var(--tokka-dash-border-soft, var(--r-line));
    border-radius: var(--r-md);
    font-size: 13px;
    font-weight: 500;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-quickadd-btn:hover {
    transform: none;
    border-color: var(--tokka-dash-border, var(--r-line-strong));
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-conn-list { gap: 8px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-conn-card {
    gap: 12px;
    padding: 12px 12px 12px 8px;
    border: 1px solid var(--tokka-dash-border-soft, var(--r-line));
    border-radius: var(--r-md);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-conn-card-name { font-size: 15px; font-weight: 500; }
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-conn-card-value { font-size: 13px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-conn-menu-popover {
    border: 1px solid var(--r-line);
    border-radius: var(--r-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-conn-menu-popover button { padding: 8px 12px; font-size: 14px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-photo-upload { border-color: var(--tokka-dash-border, #d1d5db); }
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-photo-wide { border-radius: var(--r-md); }
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-photo-row { gap: 16px; margin: 8px 0 4px; }
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-name-row { gap: 8px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-bg-swatch { border-radius: var(--r-sm); }

/* ---------- Diálogos (flotan de verdad: aquí sí va sombra) ---------- */
:where(body.tokka-body:not(.tokka-profile-body)) :is(.tokka-picker-dialog, .tokka-tile-dialog) {
    border-radius: 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-picker-head h3 { font-size: 18px; font-weight: 600; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-picker-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--r-muted);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-picker-row {
    border: 1px solid var(--r-line);
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 500;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-picker-row-badge { font-size: 10px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-picker-category summary { font-size: 14px; font-weight: 600; }

/* ---------- Menú inferior ---------- */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-bottom-nav {
    gap: 32px;
    padding: 8px 28px;
    border: 1px solid var(--r-line);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-bnav-item {
    gap: 2px;
    font-size: 11px;
    font-weight: 500;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-bnav-scan { box-shadow: 0 6px 16px rgba(0, 163, 144, 0.28); }
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-bnav-scan:hover { transform: none; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-lang-switch {
    border: 1px solid var(--r-line);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

/* ---------- Escáner ---------- */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-scan-capture-btn {
    margin-top: 20px;
    padding: 40px 20px;
    border-radius: var(--r-md);
    font-size: 15px;
    font-weight: 500;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-scan-preview { border-radius: var(--r-md); }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-scan-error {
    border-radius: var(--r-sm);
    padding: 12px 16px;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-scan-error .tokka-error { font-size: 14px; line-height: 1.45; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-error,
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-success { line-height: 1.45; }

/* ---------- Contactos ---------- */
:where(body.tokka-body:not(.tokka-profile-body)) .tokka-contacts-list { gap: 8px; }

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-contact-card {
    gap: 12px;
    padding: 12px;
    border-radius: var(--r-md);
    border: 1px solid var(--tokka-dash-border-soft, var(--r-line));
    background: var(--tokka-dash-surface-2, #fafafa);
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-contact-avatar {
    width: 40px;
    height: 40px;
    font-size: 14px;
    font-weight: 600;
}

:where(body.tokka-body:not(.tokka-profile-body)) .tokka-contact-name { font-size: 15px; line-height: 1.3; }

:where(body.tokka-body:not(.tokka-profile-body)) :is(.tokka-contact-sub, .tokka-contact-detail) {
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--r-muted);
}

/* ==========================================================================
   Login / registro: tarjeta dividida (panel con degradado + formulario).
   /login y /registro son la MISMA página (templates/auth-split.php) con
   data-mode="login" | "register": el cambio es instantáneo, sin recargar.
   Login: panel a la izquierda. Registro: panel a la derecha (el JS de la
   plantilla anima el recorrido). En celular el panel va arriba.
   ========================================================================== */

/* Solo se ve lo del modo activo. */
.tokka-auth-split[data-mode="login"] [data-for="register"],
.tokka-auth-split[data-mode="register"] [data-for="login"] { display: none; }

.tokka-auth-wrap.tokka-auth-split {
    max-width: 440px;
    margin: 24px auto 0;
    padding: 0 16px 48px;
}

.tokka-auth-shell {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--r-line);
    border-radius: var(--r-lg);
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* El formulario ya no es una tarjeta propia: vive dentro del contenedor. */
.tokka-auth-split .tokka-auth-card {
    position: relative;
    z-index: 1;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 24px 16px 16px;
}

.tokka-auth-heading {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--tokka-black);
}

.tokka-auth-sub {
    margin: 6px 0 24px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--r-muted);
}

/* Al cambiar de modo, el formulario nuevo aparece mientras el panel pasa. */
.tokka-auth-card-enter { animation: tokka-auth-fade-in 0.4s ease 0.18s both; }
@keyframes tokka-auth-fade-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Panel con degradado (solo teals de la marca) ---------- */
.tokka-auth-panel {
    position: relative;
    z-index: 2; /* pasa POR ENCIMA del formulario al cambiar de lado */
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    min-height: 176px;
    padding: 20px;
    border-radius: 20px;
    background: #008F85;
    color: #fff;
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
    will-change: transform;
}

/* El degradado vive en un pseudo-elemento más grande que el panel y se mueve
   con transform (lo mueve la GPU, no repinta cada cuadro). */
.tokka-auth-panel::before {
    content: "";
    position: absolute;
    inset: -35%;
    z-index: -1;
    background:
        radial-gradient(38% 42% at 72% 26%, rgba(126, 232, 234, 0.85) 0%, rgba(126, 232, 234, 0) 100%),
        radial-gradient(45% 45% at 22% 78%, rgba(0, 40, 35, 0.9) 0%, rgba(0, 40, 35, 0) 100%),
        radial-gradient(40% 40% at 60% 70%, rgba(0, 163, 144, 0.9) 0%, rgba(0, 163, 144, 0) 100%),
        linear-gradient(155deg, #00A390 0%, #008F85 45%, #00726a 100%);
    animation: tokka-auth-drift 18s ease-in-out infinite alternate;
}

@keyframes tokka-auth-drift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    50%  { transform: translate(-6%, 4%) rotate(8deg); }
    100% { transform: translate(5%, -3%) rotate(-6deg); }
}

/* El logo regresa a la página de inicio. */
.tokka-auth-panel-logo-link {
    display: inline-flex;
    align-self: flex-start; /* el panel es flex en columna: sin esto se estira */
    border-radius: 8px;
    transition: opacity 0.15s ease;
}
.tokka-auth-panel-logo-link:hover { opacity: 0.85; }
.tokka-auth-panel-logo-link:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

.tokka-auth-panel-logo {
    display: block;
    width: auto;
    height: 22px;
    filter: brightness(0) invert(1);
}

/* Los dos mensajes ocupan la misma celda y se cruzan con un fundido (el
   inactivo no usa display:none aquí, para poder animarlo). */
.tokka-auth-panel-copies { display: grid; }

.tokka-auth-split .tokka-auth-panel-copy {
    grid-area: 1 / 1;
    align-self: end;
    display: block;
    opacity: 1;
    transform: none;
    transition: opacity 0.35s ease 0.2s, transform 0.45s ease 0.2s;
}

.tokka-auth-split[data-mode="login"] .tokka-auth-panel-copy[data-for="register"],
.tokka-auth-split[data-mode="register"] .tokka-auth-panel-copy[data-for="login"] {
    display: block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    visibility: hidden;
}

.tokka-auth-panel-kicker {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.85;
}

.tokka-auth-panel-title {
    margin: 0;
    max-width: 22ch;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

/* ---------- Escritorio: dos columnas ---------- */
@media (min-width: 900px) {
    .tokka-auth-wrap.tokka-auth-split {
        max-width: 1000px;
        margin-top: 24px;
        padding-bottom: 48px;
    }

    .tokka-auth-shell {
        display: grid;
        grid-template-columns: 1fr 1fr;
        min-height: 620px;
        padding: 12px;
    }

    .tokka-auth-panel {
        min-height: 0;
        padding: 36px;
        border-radius: 20px;
    }

    .tokka-auth-panel-logo { height: 28px; }
    .tokka-auth-panel-kicker { font-size: 16px; margin-bottom: 10px; }
    .tokka-auth-panel-title { font-size: 36px; line-height: 1.12; }

    .tokka-auth-split .tokka-auth-card {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 48px 56px;
    }

    .tokka-auth-heading { font-size: 32px; }

    /* Registro: panel del lado derecho. */
    .tokka-auth-split[data-mode="register"] .tokka-auth-panel { order: 2; }
}

@media (prefers-reduced-motion: reduce) {
    .tokka-auth-panel,
    .tokka-auth-split .tokka-auth-panel-copy { transition: none; }
    .tokka-auth-panel::before,
    .tokka-auth-card-enter { animation: none; }
}


/* ==========================================================================
   Panel (dashboard): menú + ancho completo.
   Menú (tokka_app_nav() en helpers.php): en celular, barra inferior con el
   botón de escanear al centro; desde 1024px, barra lateral oscura con el
   logo arriba y los íconos centrados. En computadora el contenido usa todo
   el ancho que deja la barra.
   ========================================================================== */
.tokka-app-nav {
    position: fixed;
    z-index: 50;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: 520px;
    margin: 0 auto;
    background: var(--tokka-dash-surface, #fff);
    border: 1px solid var(--tokka-dash-border-soft, rgba(17, 17, 17, 0.08));
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.tokka-app-nav-logo { display: none; }

.tokka-app-nav-items {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 64px;
    padding: 0 8px;
}

.tokka-app-nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    height: 100%;
    color: var(--tokka-dash-text-soft, #9ca3af);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    transition: color 0.15s ease;
}

.tokka-app-nav-icon { display: flex; }
.tokka-app-nav-item svg { display: block; }

.tokka-app-nav-item.is-active { color: var(--tokka-dash-text, var(--tokka-black)); }
.tokka-app-nav-item.is-active .tokka-app-nav-icon { color: var(--tokka-nav-teal); }

/* Botón central de escanear: círculo teal que sobresale de la barra. */
.tokka-app-nav-fab { flex: 0 0 auto; width: 72px; }
.tokka-app-nav-fab .tokka-app-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-top: -28px;
    border-radius: 50%;
    background: var(--tokka-nav-teal);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 163, 144, 0.3), 0 0 0 5px var(--tokka-dash-surface, #fff);
    transition: transform 0.1s ease;
}
.tokka-app-nav-fab .tokka-app-nav-label { margin-top: 2px; }
.tokka-app-nav-fab:active .tokka-app-nav-icon { transform: scale(0.95); }
.tokka-app-nav-fab.is-active .tokka-app-nav-icon { color: #fff; }

.tokka-app-nav-item:focus-visible { outline: 2px solid var(--tokka-nav-teal); outline-offset: -4px; border-radius: 16px; }

/* Espacio para que la barra no tape el final de la página. */
.tokka-page-with-navbar { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }

/* ---------- Contenido del perfil: una columna en celular ---------- */
.tokka-dash-grid,
.tokka-dash-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

@media (min-width: 1024px) {
    /* ---------- Barra lateral ---------- */
    .tokka-app-nav {
        left: 16px;
        right: auto;
        top: 16px;
        bottom: 16px;
        width: 80px;
        max-width: none;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 24px 0;
        background: var(--tokka-black);
        border: none;
        border-radius: 24px;
        box-shadow: none;
    }

    .tokka-app-nav-logo {
        display: flex;
        justify-content: center;
        width: 56px;
        padding: 8px 0;
        border-radius: 12px;
    }
    .tokka-app-nav-logo img { display: block; width: 52px; height: auto; filter: brightness(0) invert(1); }
    .tokka-app-nav-logo:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

    /* Íconos centrados verticalmente en la barra. */
    .tokka-app-nav-items {
        flex: 1;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        height: auto;
        padding: 0;
    }

    .tokka-app-nav-item,
    .tokka-app-nav-fab {
        position: relative;
        flex: 0 0 auto;
        width: 52px;
        height: 52px;
        border-radius: 16px;
        color: rgba(255, 255, 255, 0.6);
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .tokka-app-nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
    .tokka-app-nav-item.is-active { background: rgba(255, 255, 255, 0.14); color: #fff; }
    .tokka-app-nav-item.is-active .tokka-app-nav-icon { color: #fff; }

    .tokka-app-nav-fab .tokka-app-nav-icon {
        width: 52px;
        height: 52px;
        margin: 0;
        border-radius: 16px;
        box-shadow: none;
    }
    .tokka-app-nav-fab:hover { background: transparent; }
    .tokka-app-nav-fab:hover .tokka-app-nav-icon { background: var(--tokka-teal); }

    /* La etiqueta aparece como globo a la derecha al pasar el mouse. */
    .tokka-app-nav-label {
        position: absolute;
        left: calc(100% + 14px);
        top: 50%;
        transform: translate(-4px, -50%);
        padding: 6px 10px;
        border-radius: 8px;
        background: var(--tokka-black);
        color: #fff;
        font-size: 13px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s ease, transform 0.15s ease;
    }
    .tokka-app-nav-fab .tokka-app-nav-label { margin: 0; }
    .tokka-app-nav-item:hover .tokka-app-nav-label,
    .tokka-app-nav-item:focus-visible .tokka-app-nav-label { opacity: 1; transform: translate(0, -50%); }

    /* ---------- Contenido a todo el ancho ---------- */
    .tokka-dash-wrap.tokka-page-with-navbar {
        max-width: 1440px;
        margin: 0;
        padding: 16px 32px 48px 128px;
    }

    .tokka-dash-wrap.tokka-page-with-navbar.tokka-dash-narrow { max-width: 760px; margin: 0 auto; padding-left: 128px; }

    .tokka-page-with-navbar .tokka-dash-card { padding: 32px 40px; }

    .tokka-dash-header {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        column-gap: 24px;
    }
    .tokka-dash-header .tokka-scan-count { grid-column: 1; }
    .tokka-dash-header .tokka-dash-pills { grid-column: 2; grid-row: 1; }

    /* Perfil en dos columnas: datos | enlaces + contacto. */
    .tokka-dash-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 56px;
        align-items: start;
    }
    .tokka-dash-col > h2:first-child { margin-top: 28px; }

    #tokka-dash-form > #tokka-dash-submit {
        align-self: flex-end;
        min-width: 280px;
    }
}

/* ==========================================================================
   Estadísticas (templates/dashboard-stats.php). Una sola serie a la vez en
   la gráfica (teal #008F85, validado contra el fondo blanco), barras de un
   solo tono, cuadrícula de líneas finas. Las tarjetas de resumen eligen la
   métrica de la gráfica.
   ========================================================================== */
.tokka-stats { display: flex; flex-direction: column; gap: 16px; }
.tokka-stats { --stats-accent: #008F85; --stats-ink: var(--tokka-black); --stats-soft: #5b616b; --stats-grid: rgba(17, 17, 17, 0.08); }

.tokka-stats-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 4px 0;
}
.tokka-stats-head .tokka-field-hint { margin: 6px 0 0; }

.tokka-stats-range {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--r-line);
    border-radius: 999px;
}
.tokka-stats-range a {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--stats-soft);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.tokka-stats-range a:hover { color: var(--stats-ink); }
.tokka-stats-range a.is-active { background: var(--stats-ink); color: #fff; }

/* ---------- Resumen (KPI) ---------- */
.tokka-stats-kpis { display: grid; grid-template-columns: 1fr; gap: 12px; }

.tokka-stats-kpi {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--r-line);
    border-radius: 20px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: var(--stats-ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tokka-stats-kpi:hover { border-color: var(--r-line-strong); }
.tokka-stats-kpi.is-active { border-color: var(--stats-accent); box-shadow: inset 0 0 0 1px var(--stats-accent); }
.tokka-stats-kpi:focus-visible { outline: 2px solid var(--stats-ink); outline-offset: 2px; }

.tokka-stats-kpi-label { font-size: 14px; font-weight: 500; color: var(--stats-soft); }
.tokka-stats-kpi-value { font-size: 36px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.tokka-stats-kpi-delta { font-size: 13px; color: var(--stats-ink); }
.tokka-stats-kpi-delta.is-flat { color: var(--stats-soft); }
.tokka-stats-kpi-vs { color: var(--stats-soft); }

/* ---------- Tarjetas ---------- */
.tokka-stats-card {
    position: relative; /* el globo del detalle se posiciona dentro */
    padding: 20px;
    background: #fff;
    border: 1px solid var(--r-line);
    border-radius: 20px;
    min-width: 0;
}
.tokka-stats-card-title { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.tokka-stats-card-title span { font-weight: 400; color: var(--stats-soft); }

/* ---------- Gráfica ---------- */
.tokka-stats-chart { width: 100%; }
.tokka-stats-chart svg { display: block; overflow: visible; }
.tokka-chart-grid { stroke: var(--stats-grid); stroke-width: 1; }
.tokka-chart-tick { fill: var(--stats-soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.tokka-chart-line { fill: none; stroke: var(--stats-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tokka-chart-area { fill: var(--stats-accent); opacity: 0.1; }
.tokka-chart-dot { fill: var(--stats-accent); stroke: #fff; stroke-width: 2; }
.tokka-chart-cross { stroke: var(--r-line-strong); stroke-width: 1; }
.tokka-stats-chart rect:focus { outline: none; }
.tokka-stats-chart rect:focus-visible { outline: 2px solid var(--stats-ink); outline-offset: 2px; }

.tokka-stats-tooltip {
    position: absolute;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    background: var(--stats-ink);
    color: #fff;
    border-radius: 10px;
    pointer-events: none;
    white-space: nowrap;
}
.tokka-stats-tooltip[hidden] { display: none; }
.tokka-stats-tooltip strong { font-size: 16px; font-weight: 600; }
.tokka-stats-tooltip span { font-size: 12px; opacity: 0.8; }

.tokka-stats-table { margin-top: 12px; }
.tokka-stats-table summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--stats-soft); }
.tokka-stats-table summary:hover { color: var(--stats-ink); }
.tokka-stats-table table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 14px; }
.tokka-stats-table th, .tokka-stats-table td { padding: 8px; text-align: right; border-bottom: 1px solid var(--r-line); font-variant-numeric: tabular-nums; }
.tokka-stats-table th:first-child, .tokka-stats-table td:first-child { text-align: left; }
.tokka-stats-table th { font-weight: 500; color: var(--stats-soft); }

/* ---------- Barras (ranking) ---------- */
.tokka-stats-split { display: grid; grid-template-columns: 1fr; gap: 16px; }
.tokka-stats-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tokka-stats-bars li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "label value" "bar bar";
    column-gap: 12px;
    row-gap: 6px;
    align-items: baseline;
}
.tokka-stats-bar-label { grid-area: label; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tokka-stats-bar-value { grid-area: value; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tokka-stats-bar-track { grid-area: bar; display: block; height: 8px; }
.tokka-stats-bar { display: block; height: 100%; background: var(--stats-accent); border-radius: 0 4px 4px 0; }
.tokka-stats-empty { margin: 0; font-size: 14px; color: var(--stats-soft); }
.tokka-stats-credit { margin: 16px 0 0; font-size: 12px; color: var(--stats-soft); }
.tokka-stats-credit a { color: inherit; }

/* Celular: las tres en fila, compactas. */
@media (max-width: 719px) {
    .tokka-stats-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .tokka-stats-kpi { padding: 12px; border-radius: 16px; gap: 2px; }
    .tokka-stats-kpi-label { font-size: 12px; line-height: 1.25; min-height: 2.5em; }
    .tokka-stats-kpi-value { font-size: 24px; }
    .tokka-stats-kpi-delta { font-size: 12px; }
    .tokka-stats-kpi-vs { display: none; }
}

@media (min-width: 720px) {
    .tokka-stats-kpis { grid-template-columns: repeat(3, 1fr); }
    .tokka-stats-split { grid-template-columns: 1fr 1fr; }
    .tokka-stats-card { padding: 24px; }
}

@media (min-width: 1024px) {
    .tokka-dash-wrap.tokka-page-with-navbar.tokka-stats { gap: 20px; }
    .tokka-stats-kpi { padding: 24px; }
}


/* ==========================================================================
   Contactos (templates/dashboard-contacts.php): tarjetas con acciones
   (descargar vCard / borrar); en computadora, cuadrícula a todo el ancho.
   ========================================================================== */
.tokka-pill.tokka-pill-ghost {
    background: transparent;
    color: var(--tokka-black);
    border: 1px solid var(--r-line-strong);
}
.tokka-pill.tokka-pill-ghost:hover { background: rgba(17, 17, 17, 0.04); }

.tokka-contacts-search {
    width: 100%;
    min-height: 44px;
    margin-top: 16px;
    padding: 10px 16px;
    border: 1px solid var(--r-line-strong);
    border-radius: var(--r-pill);
    font: inherit;
    font-size: 16px;
    background: #fff;
}
.tokka-contacts-search:focus { outline: none; border-color: var(--tokka-black); box-shadow: 0 0 0 3px var(--r-ring); }

.tokka-contacts-page .tokka-contact-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
}
.tokka-contact-card[hidden] { display: none; }
.tokka-contact-top { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.tokka-contact-detail a { color: inherit; text-decoration: none; }
.tokka-contact-detail a:hover { color: var(--tokka-black); text-decoration: underline; }

.tokka-contact-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--r-line);
}
.tokka-contact-vcard {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--r-pill);
    color: var(--tokka-teal);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.tokka-contact-vcard svg { width: 18px; height: 18px; }
.tokka-contact-vcard:hover { background: rgba(0, 143, 133, 0.08); }
.tokka-contact-vcard:focus-visible { outline: 2px solid var(--tokka-teal); outline-offset: 2px; }
.tokka-contacts-page .tokka-contact-delete-btn { border-radius: var(--r-pill); padding: 8px; }
.tokka-contacts-page .tokka-contact-delete-btn:hover { background: rgba(220, 38, 38, 0.06); }

/* Barra de contactos: buscar + filtros (chips) + empresa/orden (selects). */
.tokka-contacts-toolbar { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.tokka-contacts-toolbar .tokka-contacts-search { margin-top: 0; }
/* Celular: orden, filtros y empresa en UNA fila que se desliza de lado (sin barra visible). */
.tokka-contacts-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px;
}
.tokka-contacts-controls::-webkit-scrollbar { display: none; }
.tokka-contacts-chips { display: flex; gap: 6px; flex: none; }
.tokka-chip {
    flex: none;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--r-line-strong);
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--tokka-black);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.tokka-chip:hover { background: rgba(17, 17, 17, 0.04); }
.tokka-chip[aria-pressed="true"] { background: var(--tokka-black); border-color: var(--tokka-black); color: #fff; }
.tokka-chip:focus-visible, .tokka-select-pill:focus-visible { outline: 2px solid var(--tokka-teal); outline-offset: 2px; }
.tokka-contacts-selects { display: flex; gap: 6px; flex: none; }
.tokka-contacts-controls select.tokka-select-pill { /* gana a los select genéricos de .tokka-dash-card */
    height: 36px;
    min-height: 36px;
    line-height: 34px;
    max-width: 200px;
    padding: 0 34px 0 14px;
    border: 1px solid var(--r-line-strong);
    border-radius: var(--r-pill);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
    -webkit-appearance: none;
    appearance: none;
    color: var(--tokka-black);
    font: inherit;
    font-size: 16px; /* menos de 16px y el iPhone hace zoom al tocarlo */
    font-weight: 500;
    text-overflow: ellipsis;
    cursor: pointer;
    flex: none;
}

/* Encabezado de letra (o de empresa): fijo arriba mientras bajas por su grupo. */
.tokka-contacts-group {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 8px 0 -2px;
    padding: 6px 4px;
    background: var(--tokka-dash-surface, #fff);
    color: var(--r-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.tokka-contacts-group:first-child { margin-top: 0; }

/* Índice A–Z a la orilla derecha (solo con muchos contactos, ver JS). */
.tokka-contacts-index {
    position: fixed;
    right: 4px;
    top: 50%;
    z-index: 5;
    display: flex;
    flex-direction: column;
    transform: translateY(-50%);
}
.tokka-contacts-index[hidden] { display: none; }
.tokka-contacts-index button {
    min-width: 24px;
    min-height: 20px;
    padding: 1px 4px;
    border: none;
    background: none;
    color: var(--tokka-teal);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.tokka-contacts-none { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 16px; }
.tokka-contacts-none.tokka-hidden { display: none; }
.tokka-contacts-none .tokka-field-hint { margin: 0; font-size: 14px; }

/* Editar contacto: la tarjeta entera se puede tocar; "Editar" es el camino con teclado. */
.tokka-contacts-page .tokka-contact-card { cursor: pointer; transition: border-color 0.15s ease; }
.tokka-contacts-page .tokka-contact-card:hover { border-color: var(--r-line-strong); }
.tokka-contact-actions .tokka-contact-vcard { margin-right: auto; }
.tokka-contact-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    order: -1;
    margin-right: 4px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--tokka-black);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.tokka-contact-edit-btn:hover { background: rgba(17, 17, 17, 0.05); }
.tokka-contact-edit-btn:focus-visible { outline: 2px solid var(--tokka-teal); outline-offset: 2px; }
.tokka-contact-vcard { white-space: nowrap; }
/* Celular: solo el lápiz (tocar la tarjeta ya edita); si no, "Descargar contacto" se parte en dos renglones. */
@media (max-width: 1023px) {
    .tokka-contact-edit-btn { padding: 8px; }
    .tokka-contact-edit-btn span { display: none; }
}

.tokka-contact-edit { max-width: 440px; }
.tokka-contact-edit [hidden] { display: none !important; }
.tokka-contact-edit-form { display: grid; gap: 12px; }
.tokka-contact-edit-form label { display: grid; gap: 6px; margin: 0; font-size: 13px; font-weight: 500; }
.tokka-contact-edit-form :is(input, textarea) { width: 100%; font-size: 16px; }
.tokka-contact-edit-form textarea { resize: vertical; min-height: 72px; font: inherit; }
.tokka-contact-edit-form .tokka-crop-dialog-actions { margin-top: 6px; }
.tokka-contact-edit-form .tokka-error { margin: 0; }
.tokka-contact-edit-note {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff7e6;
    color: #7a4b00;
    font-size: 13px;
    line-height: 1.4;
}
.tokka-contact-edit-alert { display: grid; justify-items: center; gap: 8px; text-align: center; }
.tokka-contact-resync { display: grid; justify-items: center; gap: 4px; width: 100%; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--r-line); text-align: center; }
.tokka-contact-edit-form .tokka-contact-resync { justify-items: start; text-align: left; margin-top: 0; }
.tokka-contact-resync .tokka-field-hint { margin: 0; }
.tokka-contact-resync-btn {
    padding: 6px 0;
    border: none;
    background: none;
    color: var(--tokka-teal);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.tokka-contact-resync-btn:hover { text-decoration: underline; }
.tokka-contact-new {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    background: rgba(0, 143, 133, 0.12);
    color: #00726a;
    font-size: 11px;
    font-weight: 600;
    vertical-align: 2px;
}
.tokka-contact-detail a.tokka-contact-profile { color: var(--tokka-teal); font-weight: 500; }
.tokka-contact-edit-alert-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff1d6;
    color: #b25e00;
}
.tokka-contact-edit-alert p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--r-muted); }
.tokka-contact-edit-alert .tokka-contact-edit-alert-title { font-size: 16px; font-weight: 600; color: var(--tokka-black); }
.tokka-contact-edit-alert .tokka-crop-dialog-actions { width: 100%; margin-top: 12px; }

@media (min-width: 1024px) {
    .tokka-contacts-page .tokka-contacts-search { max-width: 420px; }
    /* En la cuadrícula un encabezado por letra deja una tarjeta por renglón:
       aquí solo se ordena, sin encabezados ni índice. */
    .tokka-contacts-page .tokka-contacts-group, .tokka-contacts-index { display: none !important; }
    .tokka-contacts-controls { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; gap: 8px; }
    .tokka-contacts-controls select.tokka-select-pill { font-size: 14px; }
    .tokka-contacts-page .tokka-contacts-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 16px;
    }
}

/* ==========================================================================
   Ajustes (templates/dashboard-settings.php): grupos de filas tipo "lista
   de ajustes" del celular. En computadora, columna legible de 720px.
   ========================================================================== */
.tokka-settings { display: flex; flex-direction: column; gap: 20px; }

.tokka-settings-group {
    background: #fff;
    border: 1px solid var(--r-line);
    border-radius: 20px;
    overflow: hidden;
}
.tokka-settings-group-title {
    margin: 0;
    padding: 16px 20px 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--r-muted);
    letter-spacing: 0.02em;
}

.tokka-settings-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    min-height: 56px;
    padding: 14px 20px;
    border-top: 1px solid var(--r-line);
    color: var(--tokka-black);
    text-decoration: none;
}
.tokka-settings-group-title + .tokka-settings-row { border-top: none; }
.tokka-settings-text { flex: 1 1 220px; min-width: 0; }
.tokka-settings-label { margin: 0; font-size: 15px; font-weight: 500; }
.tokka-settings-hint { margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: var(--r-muted); }
.tokka-settings-value { font-size: 15px; color: var(--r-muted); }
.tokka-settings-link:hover { background: rgba(17, 17, 17, 0.03); }
.tokka-settings-link:focus-visible { outline: 2px solid var(--tokka-black); outline-offset: -2px; }
.tokka-settings-chevron { color: var(--r-muted); font-size: 18px; }

/* Selector segmentado 12 h / 24 h. */
.tokka-segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #f4f4f5;
    border-radius: 999px;
}
.tokka-segmented label { margin: 0; cursor: pointer; }
.tokka-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.tokka-segmented span {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--r-muted);
    transition: background-color 0.15s ease, color 0.15s ease;
}
.tokka-segmented small { font-size: 12px; font-weight: 400; opacity: 0.8; }
.tokka-segmented input:checked + span { background: #fff; color: var(--tokka-black); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.tokka-segmented input:focus-visible + span { outline: 2px solid var(--tokka-black); outline-offset: 2px; }

/* Zona de peligro. */
.tokka-settings-danger { border-color: rgba(220, 38, 38, 0.25); }
.tokka-settings-danger .tokka-settings-group-title { color: #dc2626; }
.tokka-settings-danger > .tokka-error { margin: 0; padding: 0 20px 16px; }
.tokka-btn-danger-outline {
    min-height: 40px;
    padding: 8px 16px;
    background: transparent;
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.35);
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.tokka-btn-danger-outline:hover { background: rgba(220, 38, 38, 0.06); }
.tokka-btn-primary.tokka-btn-danger { background: #dc2626; }
.tokka-btn-primary.tokka-btn-danger:hover { background: #b91c1c; }
.tokka-btn-primary.tokka-btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

.tokka-delete-dialog { max-width: 440px; }
.tokka-delete-dialog h3 { margin: 0 0 8px; font-size: 20px; font-weight: 600; }
.tokka-delete-dialog p { margin: 0 0 8px; font-size: 15px; }
.tokka-delete-list { margin: 0 0 16px; padding-left: 20px; font-size: 14px; line-height: 1.5; color: var(--r-muted); }
.tokka-delete-dialog label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 500; }
.tokka-delete-dialog input[type=text] {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--r-line-strong);
    border-radius: 14px;
    font: inherit;
    font-size: 16px;
    letter-spacing: 0.08em;
}
.tokka-delete-dialog input[type=text]:focus { outline: none; border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }

@media (min-width: 1024px) {
    .tokka-dash-wrap.tokka-page-with-navbar.tokka-settings { max-width: 720px; margin: 0 auto; padding-left: 128px; }
}


/* Aviso de cambios en documentos legales (Tokka_Legal::render_notice()). */
.tokka-legal-dialog { max-width: 420px; }
.tokka-legal-dialog h3 { margin: 0 0 8px; font-size: 20px; font-weight: 600; line-height: 1.25; }
.tokka-legal-dialog p { margin: 0 0 16px; font-size: 15px; line-height: 1.5; color: var(--r-muted); }
.tokka-legal-docs { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tokka-legal-docs li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    border: 1px solid var(--r-line);
    border-radius: 14px;
}
.tokka-legal-docs a { color: var(--tokka-teal); font-weight: 600; text-decoration: none; }
.tokka-legal-docs a:hover { text-decoration: underline; }
.tokka-legal-docs span { font-size: 13px; color: var(--r-muted); }
.tokka-legal-dialog .tokka-btn-primary { width: 100%; margin-top: 0; }

/* ==========================================================================
   Temas oscuros del panel (Fondo del perfil = Negro / Verde oscuro):
   diálogos, menús y botones. Los diálogos se quedaban blancos mientras los
   botones e inputs de adentro tomaban los colores del tema (ej. "Cancelar"
   con texto claro sobre blanco = invisible). Aquí todo lo que flota toma la
   superficie del tema. Mismas variables --tokka-dash-* de tokka-style.css.
   ========================================================================== */
body[class*="tokka-dash-theme-"] { color-scheme: dark; }

/* Diálogos: configurador, picker, recorte de foto */
body[class*="tokka-dash-theme-"] :is(.tokka-tile-dialog, .tokka-picker-dialog) {
    background: var(--tokka-dash-surface);
    color: var(--tokka-dash-text);
    border: 1px solid var(--tokka-dash-border-soft);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
body[class*="tokka-dash-theme-"] :is(.tokka-tile-dialog, .tokka-picker-dialog) h3 { color: var(--tokka-dash-text); }
body[class*="tokka-dash-theme-"] :is(.tokka-tile-dialog, .tokka-picker-dialog)::backdrop { background: rgba(0, 0, 0, 0.7); }
body[class*="tokka-dash-theme-"] .tokka-tile-dialog input[type=text] {
    background: var(--tokka-dash-surface-2);
    border-color: var(--tokka-dash-border);
    color: var(--tokka-dash-text);
}
body[class*="tokka-dash-theme-"] .tokka-prefix-row input { background: transparent; }
body[class*="tokka-dash-theme-"] #tokka-config-preview.tokka-field-error { color: #f87171; }

/* Picker de conexiones */
body[class*="tokka-dash-theme-"] .tokka-picker-close {
    background: var(--tokka-dash-surface-2);
    color: var(--tokka-dash-text);
}
body[class*="tokka-dash-theme-"] .tokka-picker-search-row {
    background: var(--tokka-dash-surface-2);
    color: var(--tokka-dash-text-soft);
}
body[class*="tokka-dash-theme-"] #tokka-picker-search {
    background: transparent;
    border: none;
    box-shadow: none;
    min-height: 0;
    padding: 0;
    color: var(--tokka-dash-text);
}
body[class*="tokka-dash-theme-"] .tokka-picker-search-row input::placeholder { color: var(--tokka-dash-text-soft); }
body[class*="tokka-dash-theme-"] .tokka-picker-row {
    background: var(--tokka-dash-surface-2);
    border-color: var(--tokka-dash-border-soft);
    color: var(--tokka-dash-text);
}
body[class*="tokka-dash-theme-"] .tokka-picker-row:hover { border-color: var(--tokka-dash-border); }
body[class*="tokka-dash-theme-"] .tokka-picker-row-badge { color: #5fd4c4; }
body[class*="tokka-dash-theme-"] .tokka-picker-category { border-top-color: var(--tokka-dash-border-soft); }
body[class*="tokka-dash-theme-"] .tokka-picker-category summary { color: var(--tokka-dash-text); }
body[class*="tokka-dash-theme-"] :is(.tokka-picker-section-title, .tokka-picker-empty) { color: var(--tokka-dash-text-soft); }

/* Logos de marca negros (TikTok, X, Threads, GitHub, Medium, Notion) se
   perdían sobre fondo oscuro: se pintan blancos. Sin color en la URL =
   picker/Agregar rápido; con /000000 o /181717 = tarjeta de "Mis conexiones". */
body[class*="tokka-dash-theme-"] img.tokka-conn-brand-icon:is([src$="/tiktok"], [src$="/x"], [src$="/threads"], [src$="/github"], [src$="/medium"], [src$="/notion"], [src$="/000000"], [src$="/181717"]) {
    filter: brightness(0) invert(1);
}

/* Botones: el primario negro casi no se distinguía de la tarjeta gris
   oscuro; en tema oscuro se invierte (claro con texto oscuro). */
body[class*="tokka-dash-theme-"] .tokka-btn-primary:not(.tokka-btn-danger):not(.tokka-btn-teal) {
    background: var(--tokka-dash-text);
    color: #111111;
    box-shadow: none;
}
body[class*="tokka-dash-theme-"] .tokka-btn-primary:not(.tokka-btn-danger):not(.tokka-btn-teal):hover { background: #ffffff; }
body[class*="tokka-dash-theme-"] .tokka-btn-secondary { background: transparent; }

/* Tarjetas de "Mis conexiones" y su menú ⋮ */
body[class*="tokka-dash-theme-"] .tokka-conn-card-name { color: var(--tokka-dash-text); }
body[class*="tokka-dash-theme-"] .tokka-conn-card-value { color: var(--tokka-dash-text-soft); }
body[class*="tokka-dash-theme-"] .tokka-conn-menu-btn { color: var(--tokka-dash-text-soft); }
body[class*="tokka-dash-theme-"] .tokka-conn-menu-btn:hover { background: var(--tokka-dash-surface); }
body[class*="tokka-dash-theme-"] .tokka-conn-menu-popover {
    background: var(--tokka-dash-surface);
    border: 1px solid var(--tokka-dash-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
body[class*="tokka-dash-theme-"] .tokka-conn-menu-popover button { color: var(--tokka-dash-text); }
body[class*="tokka-dash-theme-"] .tokka-conn-menu-popover button:hover { background: var(--tokka-dash-surface-2); }
body[class*="tokka-dash-theme-"] .tokka-conn-menu-popover .tokka-conn-menu-delete { color: #f87171; }

/* Horario de atención */
body[class*="tokka-dash-theme-"] .tokka-hours-row { background: var(--tokka-dash-surface-2); }
body[class*="tokka-dash-theme-"] .tokka-hours-day-toggle { color: var(--tokka-dash-text); }
body[class*="tokka-dash-theme-"] .tokka-hours-row-off .tokka-hours-day-toggle { color: var(--tokka-dash-text-soft); }
body[class*="tokka-dash-theme-"] .tokka-hours-time-inputs input[type=time] {
    background: var(--tokka-dash-surface);
    border-color: var(--tokka-dash-border);
    color: var(--tokka-dash-text);
}
body[class*="tokka-dash-theme-"] .tokka-hours-time-inputs span { color: var(--tokka-dash-text-soft); }

/* Botón de buscar del mapa */
body[class*="tokka-dash-theme-"] .tokka-map-search-btn {
    background: var(--tokka-dash-surface-2);
    border-color: var(--tokka-dash-border);
    color: var(--tokka-dash-text);
}
body[class*="tokka-dash-theme-"] .tokka-map-search-btn:hover { background: var(--tokka-dash-surface); }

/* WhatsApp en el configurador: el input del número tenía width:100% y,
   junto al <select> de país, se salía del borde derecho del diálogo. */
#tokka-configurator-dialog .tokka-phone-row input { flex: 1 1 0; width: auto; min-width: 0; }

/* Buscador del picker: la píldora gris ya es el campo; el estilo general de
   inputs le dibujaba otra caja con borde adentro. */
#tokka-picker-search,
#tokka-picker-search:focus {
    border: none;
    background: transparent;
    box-shadow: none;
    outline: none;
    min-height: 0;
    padding: 0;
}
.tokka-picker-search-row:focus-within { box-shadow: 0 0 0 2px var(--tokka-dash-border, var(--r-line-strong)); }

/* ==========================================================================
   Panel en tarjetas (templates/dashboard.php, .tokka-bento-*).
   Celular: las tarjetas van una debajo de otra, en el orden del HTML
   (Editar perfil, fotos, estilo, agregar rápido, conexiones, contacto).
   Computadora: cuadrícula tipo "bento" que cabe en la pantalla, sin líneas
   divisorias ni barras de scroll visibles. Desde 1280px, 4 columnas para que
   Estilo e Información de contacto se vean completos:
       [ Identidad     ][ Estilo ][ Info. de contacto ][ Mis conexiones ]
       [ Editar perfil ][        ][                   ][ Agregar rápido ]
   De 1024 a 1279px, 3 columnas:
       [ Identidad     ][ Estilo            ][ Mis conexiones ]
       [ Editar perfil ][ Info. de contacto ][ Agregar rápido ]
   Agregar rápido es la misma fila de 6 círculos que en celular, y Mis
   conexiones muestra 4 + "Ver todas (N)", que en computadora abre un popup.
   Si el contenido de una tarjeta no cabe, se desliza por dentro (sin barra)
   con un difuminado abajo.
   ========================================================================== */
.tokka-bento-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tokka-bento-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.tokka-bento-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
}
.tokka-dash-card .tokka-bento-head h2 {
    flex: 1;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 17px;
    font-weight: 600;
}
.tokka-bento-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tokka-black);
    color: #fff;
}
.tokka-bento-icon svg { width: 16px; height: 16px; }
.tokka-bento-action {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--tokka-dash-border, var(--r-line-strong, rgba(17, 17, 17, 0.16)));
    color: var(--tokka-dash-text, var(--tokka-black));
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.tokka-bento-action:hover { background: var(--tokka-dash-surface-2, #f3f4f6); }

/* Temas oscuros: el círculo del ícono se invierte para no perderse. */
body[class*="tokka-dash-theme-"] .tokka-bento-icon { background: var(--tokka-dash-text); color: #111; }

/* Identidad: en celular ya están las fotos arriba; el nombre sobra. */
.tokka-bento-id-text { display: none; }

/* Agregar rápido fuera de las tarjetas (p. ej. register-connections.php):
   nombre, o "✓ Agregado". En el panel en celular ver más abajo. */
.tokka-quickadd-status { display: none; }
.tokka-quickadd-added .tokka-quickadd-name { display: none; }
.tokka-quickadd-added .tokka-quickadd-status { display: inline; }


/* En celular "Estilo del perfil" ya es un desplegable con su título: sin encabezado repetido. */
.tokka-bento-style > .tokka-bento-head { display: none; }

/* El botón de guardar de arriba es solo de computadora. */
.tokka-pill-save { display: none; }

@media (min-width: 1024px) and (min-height: 600px) {
    /* ---------- Página y contenedor del alto de la ventana ---------- */
    .tokka-dash-wrap.tokka-page-with-navbar:not(.tokka-dash-narrow):has(.tokka-bento) {
        max-width: none;
        height: 100vh;
        height: 100dvh;
        padding-top: 16px;
        padding-bottom: 16px;
        display: flex;
        flex-direction: column;
    }
    .tokka-page-with-navbar .tokka-dash-card:has(.tokka-bento) {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        padding: 24px 28px 28px;
    }
    .tokka-dash-card:has(.tokka-bento) .tokka-dash-header { flex-shrink: 0; padding: 0 4px; }
    .tokka-dash-card:has(.tokka-bento) > .tokka-success { margin: 8px 4px 0; }

    #tokka-dash-form:has(.tokka-bento) {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        margin-top: 16px;
    }
    #tokka-dash-form > #tokka-dash-submit { display: none; }

    .tokka-pill-save {
        display: inline-flex;
        align-items: center;
        border: none;
        background: var(--tokka-dash-text, var(--tokka-black));
        color: var(--tokka-dash-surface, #fff);
        cursor: pointer;
        font-family: inherit;
    }
    .tokka-pill-save:disabled { opacity: 0.6; cursor: default; }

    /* ---------- Cuadrícula ---------- */
    .tokka-bento {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr);
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "ident style conns"
            "info  more  conns"
            "info  more  quick";
        gap: 16px;
        /* la regla de 2 columnas de arriba (.tokka-dash-grid) trae align-items:start */
        align-items: stretch;
    }
    .tokka-bento-quick    { grid-area: quick; }
    .tokka-bento-identity { grid-area: ident; }
    .tokka-bento-conns    { grid-area: conns; }
    .tokka-bento-style    { grid-area: style; }
    .tokka-bento-info     { grid-area: info; }
    .tokka-bento-more     { grid-area: more; }

    .tokka-bento-conns .tokka-conn-add-btn { align-self: stretch; }

    /* ---------- Tarjeta ---------- */
    .tokka-bento-card {
        min-height: 0;
        gap: 14px;
        padding: 18px 18px 0;
        border-radius: 24px;
        background: #f6f6f8;
        overflow: hidden;
    }
    body[class*="tokka-dash-theme-"] .tokka-bento-card { background: rgba(255, 255, 255, 0.04); }

    .tokka-bento-head { margin-top: 0; flex-shrink: 0; }
    .tokka-bento-style > .tokka-bento-head { display: flex; }
    .tokka-dash-card .tokka-bento-head h2 { font-size: 16px; }

    /* Cuerpo deslizable sin barra visible + difuminado al final. */
    .tokka-bento-body {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
        padding: 2px 2px 18px;
        margin: -2px -2px 0;
        -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
                mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
    }
    .tokka-bento-body::-webkit-scrollbar { display: none; }

    /* Los desplegables dentro de tarjetas: sin línea, como filas suaves. */
    .tokka-bento .tokka-section-collapsible {
        border: none;
        border-radius: 16px;
        background: var(--tokka-dash-surface-2, #fff);
        padding: 0 14px;
    }

    /* ---------- Identidad (como la tarjeta de perfil de la referencia) ---------- */
    .tokka-bento-identity { padding: 12px 12px 16px; align-items: stretch; justify-content: center; gap: 0; }
    .tokka-bento-identity .tokka-photo-row {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas: "cover" "avatar";
        margin: 0;
        gap: 0;
    }
    .tokka-bento-identity .tokka-photo-row > div:first-child { grid-area: avatar; justify-self: center; margin-top: -44px; position: relative; z-index: 1; }
    .tokka-bento-identity .tokka-photo-row > div:last-child { grid-area: cover; }
    .tokka-bento-identity .tokka-photo-label { display: none; }
    .tokka-bento-identity .tokka-photo-round {
        width: 88px;
        height: 88px;
        border: 4px solid #f6f6f8;
        border-style: solid;
        background: #eceef1;
    }
    body[class*="tokka-dash-theme-"] .tokka-bento-identity .tokka-photo-round { border-color: var(--tokka-dash-surface); }
    .tokka-bento-identity .tokka-photo-wide {
        width: 100%;
        height: 96px;
        aspect-ratio: auto;
        border-radius: 16px;
    }
    .tokka-bento-id-text { display: block; text-align: center; margin-top: 8px; }
    .tokka-bento-id-name { margin: 0; font-size: 18px; font-weight: 600; color: var(--tokka-dash-text, var(--tokka-black)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tokka-bento-id-tagline { margin: 2px 0 0; font-size: 13px; color: var(--tokka-dash-text-soft, var(--tokka-gray)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* ---------- Mis conexiones ---------- */
    .tokka-bento-conns .tokka-conn-add-btn { margin-top: 4px; }
    .tokka-bento-conns .tokka-conn-card { background: var(--tokka-dash-surface-2, #fff); border-color: transparent; }

    /* ---------- Estilo: siempre abierto, sin el renglón del desplegable ---------- */
    .tokka-bento-style .tokka-section-collapsible { background: transparent; padding: 0; }
    .tokka-bento-style .tokka-section-collapsible > summary { display: none; }
    .tokka-bento-style .tokka-section-collapsible-body { padding-bottom: 0; }
    .tokka-bento-style .tokka-style-group-label:first-child { margin-top: 0; }

    /* ---------- Información de contacto ---------- */
    .tokka-bento-more .tokka-style-group-label { margin: 10px 0 0; }
    .tokka-bento-more .tokka-section-collapsible + label { margin-top: 6px; }
}

/* ==========================================================================
   Panel en celular (todo lo que NO es el layout de tarjetas de computadora).
   ========================================================================== */
/* ---------- Agregar rápido (celular y computadora): una fila de 6 íconos; los ya agregados resaltan ---------- */
.tokka-bento-quick .tokka-quickadd-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin: 4px 0 0;
}
body.tokka-body .tokka-bento-quick .tokka-quickadd-btn {
    position: relative;
    width: 100%;
    max-width: 52px;
    aspect-ratio: 1;
    justify-self: center;
    padding: 0;
    gap: 0;
    border: 1px solid var(--tokka-dash-border-soft, var(--r-line, #ececec));
    border-radius: 50%;
    background: transparent;
}
.tokka-bento-quick :is(.tokka-quickadd-name, .tokka-quickadd-status),
.tokka-bento-quick .tokka-quickadd-added :is(.tokka-quickadd-name, .tokka-quickadd-status) { display: none; }
.tokka-bento-quick .tokka-quickadd-icon { width: 24px; height: 24px; }
.tokka-bento-quick .tokka-quickadd-btn:not(.tokka-quickadd-added) .tokka-quickadd-icon { filter: grayscale(1); opacity: 0.45; }
body.tokka-body .tokka-bento-quick .tokka-quickadd-btn.tokka-quickadd-added {
    border: 2px solid var(--tokka-teal, #008F85);
    background: color-mix(in srgb, var(--brand, #008F85) 14%, transparent);
}
.tokka-bento-quick .tokka-quickadd-added::after {
    content: "✓";
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--tokka-dash-surface, #fff);
    background: var(--tokka-teal, #008F85);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Mis conexiones: con 5+ se muestran 4 y "Ver todas (N)" (en computadora abre #tokka-conns-dialog) ---------- */
.tokka-conn-list-collapsed > .tokka-conn-card:nth-child(n+5) { display: none; }
.tokka-conn-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--tokka-dash-text, var(--tokka-black));
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.tokka-conn-more-btn::after { content: "▾"; font-size: 12px; transition: transform 0.15s ease; }
.tokka-conn-more-btn[aria-expanded="true"]::after { transform: rotate(180deg); }
.tokka-conn-more-btn[hidden] { display: none; }

@media not all and (min-width: 1024px) and (min-height: 600px) {
    /* ---------- Información de contacto ---------- */
    .tokka-bento-more .tokka-style-group-label { margin: 16px 0 0; }
}

/* Conexión oculta: la opacidad va en el contenido, NO en la tarjeta. Un
   opacity en .tokka-conn-card crea un contexto de apilamiento que encierra
   su menú ⋮ debajo de la tarjeta siguiente, y el clic en "Mostrar" caía en
   esa otra tarjeta. La tarjeta con el menú abierto además va al frente. */
.tokka-conn-card.tokka-conn-card-hidden { opacity: 1; }
.tokka-conn-card.tokka-conn-card-hidden > :is(.tokka-conn-drag, .tokka-conn-card-icon, .tokka-conn-card-body) { opacity: 0.55; }
.tokka-conn-card:has(.tokka-conn-menu-popover.is-open) { z-index: 20; }
.tokka-conn-menu-popover.is-up { top: auto; bottom: 44px; }

/* ==========================================================================
   Computadora: 4 columnas, popup de Mis conexiones, Agregar rápido en círculos.
   ========================================================================== */
@media (min-width: 1024px) and (min-height: 600px) {
    .tokka-bento-quick .tokka-quickadd-grid { gap: 10px; margin: 0; }
    .tokka-bento-quick .tokka-quickadd-icon { width: 20px; height: 20px; }
    .tokka-bento-quick .tokka-quickadd-added::after { right: -5px; bottom: -5px; width: 16px; height: 16px; font-size: 9px; }

    /* En computadora solo 3 + "Ver todas (N)" (ver syncConnMore). */
    .tokka-conn-list-collapsed > .tokka-conn-card:nth-child(n+4) { display: none; }

    /* El "+" del encabezado ya agrega: el botón largo de abajo solo ocupaba alto. */
    .tokka-bento-conns .tokka-conn-add-btn { display: none; }
    .tokka-bento-quick { padding-bottom: 18px; }
    .tokka-bento-quick .tokka-bento-body { overflow: visible; -webkit-mask-image: none; mask-image: none; padding-bottom: 2px; }

    /* "Ver todas (N)" abre el popup: renglón con flecha hacia afuera. */
    .tokka-conn-more-btn.tokka-conn-more-popup {
        justify-content: space-between;
        padding: 12px 14px;
        border-radius: 14px;
        background: var(--tokka-dash-surface-2, #fff);
    }
    .tokka-conn-more-btn.tokka-conn-more-popup::after { content: "↗"; font-size: 14px; transform: none; }
    .tokka-conn-more-btn.tokka-conn-more-popup:hover { background: var(--tokka-dash-surface-2, #fff); filter: brightness(0.97); }
}

@media (min-width: 1280px) and (min-height: 600px) {
    .tokka-bento {
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1.05fr);
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "ident style more conns"
            "info  style more conns"
            "info  style more quick";
    }
}

/* Popup con todas las conexiones (usa la base de .tokka-picker-dialog). */
.tokka-picker-dialog.tokka-conns-dialog {
    width: min(760px, 92vw);
    max-width: none;
    max-height: 84vh;
    padding: 22px;
    flex-direction: column;
}
.tokka-conns-dialog[open] { display: flex; }
.tokka-conns-dialog-actions { display: flex; align-items: center; gap: 8px; }
.tokka-conns-dialog-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding: 2px 2px 8px;
}
.tokka-conns-dialog-body::-webkit-scrollbar { display: none; }
.tokka-conns-dialog-body .tokka-conn-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.tokka-conns-dialog-body .tokka-conn-card { background: var(--tokka-dash-surface-2, #f6f6f8); border-color: transparent; }

/* ==========================================================================
   Ajustes → Conecta tu CRM (templates/dashboard-settings.php, Tokka_CRM).
   ========================================================================== */
.tokka-crm-intro { margin: 0; padding: 0 20px 12px; font-size: 13px; line-height: 1.45; color: var(--r-muted); }
.tokka-crm-flash { margin: 0 20px 12px; }
.tokka-crm-block { align-items: flex-start; }
.tokka-crm-block .tokka-settings-text { flex-basis: 100%; }
.tokka-crm-form { display: flex; gap: 8px; flex: 1 1 100%; }
.tokka-crm-form input { flex: 1; min-width: 0; margin: 0; }
.tokka-crm-btn { flex: none; width: auto; min-height: 44px; margin: 0; padding: 10px 18px; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.tokka-crm-actions { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; }
.tokka-crm-actions a { color: var(--tokka-black); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.tokka-crm-actions a.is-busy { opacity: 0.6; pointer-events: none; }
.tokka-crm-actions .tokka-crm-danger { color: #dc2626; }
.tokka-crm-status { flex: 1 1 100%; margin: 0; font-size: 13px; }
.tokka-crm-status.is-ok { color: #047857; }
.tokka-crm-status.is-error { color: #dc2626; }
.tokka-crm-badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #DEEFE3; color: #047857; font-size: 12px; font-weight: 500; vertical-align: 1px; }
.tokka-crm-help { margin-top: 6px; font-size: 13px; }
.tokka-crm-help summary { cursor: pointer; color: var(--tokka-black); font-weight: 500; width: fit-content; }
.tokka-crm-help p { margin: 6px 0 0; line-height: 1.45; color: var(--r-muted); }

/* Contactos guardados desde un perfil Tokka: su foto en el círculo (dashboard-contacts.php). */
.tokka-contact-avatar.tokka-contact-avatar--photo { padding: 0; overflow: hidden; background: #eceef1; }
.tokka-contact-avatar--photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }


/* ==========================================================================
   Compartir perfil (dashboard.php → #tokka-share-*, imagen de Tokka_Share):
   botón del encabezado + "⋯", explicación (celular), más opciones y QR
   (computadora).
   ========================================================================== */
.tokka-dash-pills { flex-wrap: wrap; }
.tokka-share-group { display: inline-flex; gap: 8px; }
.tokka-pill.tokka-pill-share {
    gap: 6px;
    background: transparent;
    color: #00726a;
    border: 1px solid rgba(0, 143, 133, 0.45);
    cursor: pointer;
    font-family: inherit;
}
.tokka-pill.tokka-pill-share:hover { background: rgba(0, 143, 133, 0.08); }
.tokka-pill.tokka-pill-more { padding: 0; width: 40px; flex: none; }
/* "⋯" solo en pantallas táctiles: en computadora esas opciones ya van en el diálogo del QR. */
@media (pointer: fine) { .tokka-pill.tokka-pill-more { display: none; } }
body[class*="tokka-dash-theme-"] .tokka-pill.tokka-pill-share { color: #5fd3c6; border-color: rgba(95, 211, 198, 0.45); }
body[class*="tokka-dash-theme-"] .tokka-pill.tokka-pill-share:hover { background: rgba(95, 211, 198, 0.1); }
/* Celular: no caben las 3 píldoras en una fila; "Compartir perfil" va sola abajo, a lo ancho. */
@media not all and (min-width: 1024px) and (min-height: 600px) {
    .tokka-share-group { order: 3; flex-basis: 100%; }
    .tokka-share-group #tokka-share-open { flex: 1; }
}

.tokka-share-dialog { max-width: 400px; }
.tokka-share-dialog--desk { max-width: 460px; }
.tokka-share-dialog [hidden] { display: none !important; }
.tokka-share-thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    background: rgba(17, 17, 17, 0.06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.tokka-share-coach { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; }
.tokka-share-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: step; }
.tokka-share-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.35; }
.tokka-share-step-ico {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 143, 133, 0.1);
    color: #00726a;
}
body[class*="tokka-dash-theme-"] .tokka-share-step-ico { background: rgba(95, 211, 198, 0.12); color: #5fd3c6; }
.tokka-share-dialog :is(.tokka-btn-primary, .tokka-btn-secondary) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    text-decoration: none;
    font-family: inherit;
}
.tokka-share-go { margin-top: 20px !important; min-height: 52px; font-size: 16px; }
.tokka-share-go:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }
.tokka-share-hint { margin: 10px 0 0; text-align: center; }

.tokka-share-list { display: grid; gap: 4px; }
.tokka-share-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 0 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.tokka-share-item:hover, .tokka-share-item:focus-visible { background: rgba(17, 17, 17, 0.05); }
body[class*="tokka-dash-theme-"] .tokka-share-item { color: var(--tokka-dash-text); }
body[class*="tokka-dash-theme-"] .tokka-share-item:hover { background: var(--tokka-dash-surface-2); }
.tokka-share-bio p { margin: 0 0 16px; font-size: 14px; line-height: 1.5; }

.tokka-share-desk { display: grid; grid-template-columns: 200px 112px; justify-content: center; gap: 28px; align-items: center; }
.tokka-share-qr {
    aspect-ratio: 1;
    padding: 10px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(17, 17, 17, 0.08);
}
.tokka-share-qr svg { display: block; width: 100%; height: 100%; }
.tokka-share-qr.is-text { aspect-ratio: auto; font-size: 12px; word-break: break-all; color: #111; }
.tokka-share-lead { margin: 16px 0; font-size: 14px; line-height: 1.5; text-align: center; color: var(--tokka-dash-text-soft, #5b616b); }
.tokka-share-row { display: flex; gap: 8px; }
.tokka-share-row > * { flex: 1; }

.tokka-share-toast {
    position: fixed;
    left: 50%;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    z-index: 2147483000; /* arriba del aviso de cookies (tokka-consent.js) */
    max-width: calc(100vw - 32px);
    transform: translate(-50%, 8px);
    padding: 10px 16px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.tokka-share-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Intercambiar contacto (ver Tokka_Exchange)
   - Perfil público: botón debajo de "Descarga mi contacto" y hoja que sube
     desde abajo. La hoja siempre es blanca con texto negro, sin importar el
     estilo del perfil, para que el formulario se lea igual en todos.
   - Panel: botón "Formulario" en el encabezado y la página /dashboard/formulario.
   ========================================================================== */
.tokka-btn-exchange {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 50;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: calc(100% - 32px);
    min-height: 52px;
    margin: 0;
    padding: 14px 26px;
    box-sizing: border-box;
    background: var(--tokka-btn-bg, var(--tokka-black));
    color: var(--tokka-btn-text, #fff);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.12);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transform: translateX(-50%);
    animation: tokka-fab-in 0.4s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.tokka-btn-exchange span { overflow: hidden; text-overflow: ellipsis; }
.tokka-btn-exchange svg { flex: none; }
.tokka-btn-exchange:hover { filter: brightness(0.9); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32); }
.tokka-btn-exchange:focus-visible { outline: 3px solid var(--tokka-page-text, #111); outline-offset: 3px; }
@keyframes tokka-fab-in { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tokka-btn-exchange { animation: none; } }
/* Que el botón flotante no tape lo último del perfil. */
.tokka-profile-body:has(.tokka-btn-exchange) .tokka-profile-wrap { padding-bottom: 96px; }

html.tokka-exchange-lock, html.tokka-exchange-lock body { overflow: hidden; }

.tokka-exchange-sheet {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: 480px;
    max-height: calc(100dvh - 24px);
    margin: 0 auto;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    color: #111;
    border: 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
    text-align: left;
    line-height: 1.4;
    letter-spacing: normal;
}
.tokka-exchange-sheet[open] { animation: tokka-sheet-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.tokka-exchange-sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
@keyframes tokka-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .tokka-exchange-sheet[open] { animation: none; } }
@media (min-width: 560px) {
    .tokka-exchange-sheet { inset: 0; margin: auto; height: fit-content; border-radius: 24px; }
}

.tokka-exchange-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: #f4f4f5;
    color: #111;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.tokka-exchange-close:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

.tokka-exchange-form, .tokka-exchange-done { padding: 26px 22px calc(22px + env(safe-area-inset-bottom)); }
.tokka-exchange-sheet h2 { margin: 0 48px 6px 0; font-size: 21px; line-height: 1.2; font-weight: 700; color: #111; }
.tokka-exchange-intro { margin: 0 0 18px; font-size: 14px; color: #5b616b; }

.tokka-exchange-field { position: relative; margin: 0 0 10px; }
.tokka-exchange-field input,
.tokka-exchange-field textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 22px 16px 8px;
    background: #f4f4f5;
    color: #111;
    border: 1.5px solid transparent;
    border-radius: 14px;
    font: inherit;
    font-size: 16px; /* 16px: iOS no hace zoom al enfocar */
    line-height: 1.3;
    resize: none;
}
.tokka-exchange-field textarea { min-height: 76px; }
.tokka-exchange-field input:focus,
.tokka-exchange-field textarea:focus { outline: none; background: #fff; border-color: #111; }
.tokka-exchange-field [aria-invalid="true"] { border-color: #dc2626; background: #fff; }
.tokka-exchange-field label {
    position: absolute;
    top: 15px;
    left: 17px;
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    color: #6b7280;
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.15s ease, color 0.15s ease;
}
.tokka-exchange-field :focus + label,
.tokka-exchange-field :not(:placeholder-shown) + label { transform: translateY(-9px) scale(0.75); color: #5b616b; }
.tokka-exchange-err { margin: 4px 4px 0; font-size: 13px; color: #b91c1c; }
.tokka-exchange-err:empty { display: none; }
.tokka-exchange-err-main { margin: 0 0 10px; }
.tokka-exchange-hint { margin: 2px 4px 12px; font-size: 13px; color: #5b616b; }
.tokka-exchange-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.tokka-exchange-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin: 8px 0 12px;
    padding: 14px 20px;
    box-sizing: border-box;
    background: #111;
    color: #fff;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.tokka-exchange-submit:disabled { opacity: 0.6; cursor: default; }
.tokka-exchange-submit:focus-visible { outline: 2px solid #111; outline-offset: 3px; }
.tokka-exchange-legal { margin: 0; font-size: 12px; line-height: 1.45; color: #5b616b; text-align: center; }
.tokka-exchange-legal a, .tokka-exchange-promo a { color: #111; font-weight: 600; text-underline-offset: 2px; }

.tokka-exchange-done { text-align: center; outline: none; }
.tokka-exchange-done h2 { margin: 12px 0 6px; }
.tokka-exchange-done p { margin: 0 0 16px; font-size: 15px; color: #5b616b; }
.tokka-exchange-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-top: 8px;
    border-radius: 50%;
    background: rgba(0, 143, 133, 0.12);
    color: #00786F;
}
.tokka-exchange-done .tokka-exchange-promo { margin: 4px 0 0; font-size: 13px; }

/* Panel: botón "Formulario" y su página. */
.tokka-pill.tokka-pill-form { display: inline-flex; align-items: center; gap: 6px; }
body[class*="tokka-dash-theme-"] .tokka-pill.tokka-pill-form { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
body[class*="tokka-dash-theme-"] .tokka-pill.tokka-pill-form:hover { background: rgba(255, 255, 255, 0.08); }
.tokka-exform-intro { margin: 6px 0 0; max-width: 560px; font-size: 14px; line-height: 1.5; color: var(--r-muted); }
.tokka-exform-row .tokka-settings-label { flex: 1 1 120px; }
.tokka-exform-fields[data-off] .tokka-exform-row { opacity: 0.45; }
.tokka-exform-note { padding: 0 20px 16px; }
.tokka-exform-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 4px 0 24px; }
.tokka-exform-actions .tokka-btn-primary { width: auto; min-width: 160px; margin: 0; }
.tokka-exform-preview { font-size: 14px; font-weight: 600; color: var(--tokka-black); text-underline-offset: 3px; }
@media (max-width: 420px) {
    .tokka-exform-row .tokka-segmented { width: 100%; }
    .tokka-exform-row .tokka-segmented label { flex: 1; }
    .tokka-exform-row .tokka-segmented span { justify-content: center; width: 100%; box-sizing: border-box; padding: 8px 6px; font-size: 13px; }
}

/* Contactos: etiqueta "Intercambio". */
.tokka-contact-new.tokka-contact-exchange { background: rgba(17, 17, 17, 0.07); color: #374151; }

/* ==========================================================================
   Leyes de diseño (2026-09-28)
   ========================================================================== */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Checklist "Tu perfil: N de 6" (Zeigarnik / gradiente de meta) ---------- */
.tokka-checklist {
    margin: 16px 0 4px;
    padding: 16px 18px;
    background: var(--tokka-dash-surface-2, #f4f6f5);
    border: 1px solid var(--tokka-dash-border-soft, var(--r-line));
    border-radius: 20px;
    color: var(--tokka-dash-text, var(--tokka-black));
    text-align: left;
}
.tokka-checklist-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.tokka-checklist-hint { margin: 2px 0 10px; font-size: 13px; color: var(--tokka-dash-text-soft, var(--r-muted)); }
.tokka-checklist-bar { height: 8px; border-radius: 999px; background: var(--tokka-dash-border-soft, rgba(17, 17, 17, 0.08)); overflow: hidden; }
.tokka-checklist-bar span { display: block; height: 100%; border-radius: inherit; background: var(--tokka-teal); transition: width 0.4s ease; }
.tokka-checklist-items { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.tokka-checklist-items li { margin: 0; }
/* Los pasos listos desaparecen (ya los dice "N de 6"): solo se ve lo que falta. */
.tokka-checklist-items li:has(.is-done) { display: none; }
.tokka-checklist-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 12px;
    background: var(--tokka-dash-surface, #fff);
    color: inherit;
    border: 1px solid var(--tokka-dash-border, var(--r-line-strong));
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
.tokka-checklist .tokka-checklist-items label.tokka-checklist-item { display: inline-flex; margin: 0; font-size: 13px; line-height: normal; }
.tokka-checklist-item:hover { border-color: currentColor; }
.tokka-checklist-item:focus-visible { outline: 2px solid var(--tokka-teal); outline-offset: 2px; }
.tokka-checklist-item.is-next { border-color: var(--tokka-teal); box-shadow: inset 0 0 0 1px var(--tokka-teal); font-weight: 600; }
.tokka-checklist-item.is-done { background: transparent; border-color: transparent; color: var(--tokka-dash-text-soft, var(--r-muted)); cursor: default; padding-left: 4px; }
.tokka-checklist-item.is-done svg { color: var(--tokka-teal); }
.tokka-checklist-dot { width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 50%; opacity: 0.5; }
.tokka-checklist-item.is-next .tokka-checklist-dot { border-color: var(--tokka-teal); opacity: 1; }
body[class*="tokka-dash-theme-"] .tokka-checklist-bar span,
body[class*="tokka-dash-theme-"] .tokka-checklist-item.is-done svg { background: #5fd3c6; color: #5fd3c6; }
body[class*="tokka-dash-theme-"] .tokka-checklist-item.is-done svg { background: none; }
body[class*="tokka-dash-theme-"] .tokka-checklist-item.is-next { border-color: #5fd3c6; box-shadow: inset 0 0 0 1px #5fd3c6; }
@media (min-width: 1024px) and (min-height: 600px) {
    /* Computadora: una sola franja para no quitarle alto a la cuadrícula. */
    .tokka-dash-card:has(.tokka-bento) > .tokka-checklist {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 20px;
        margin: 12px 4px 0;
        padding: 10px 14px 10px 18px;
    }
    .tokka-dash-card:has(.tokka-bento) > .tokka-checklist .tokka-checklist-top { flex: 0 0 260px; }
    .tokka-dash-card:has(.tokka-bento) > .tokka-checklist .tokka-checklist-hint { margin-bottom: 6px; }
    .tokka-dash-card:has(.tokka-bento) > .tokka-checklist .tokka-checklist-items { flex: 1; margin: 0; justify-content: flex-end; }

}

/* ---------- Encabezado del panel: una sola acción principal (Von Restorff) ---------- */
.tokka-pill.tokka-pill-share.tokka-pill-share-main { background: #00786F; color: #fff; border-color: #00786F; }
.tokka-pill.tokka-pill-share.tokka-pill-share-main:hover { background: #00665e; }
body[class*="tokka-dash-theme-"] .tokka-pill.tokka-pill-share.tokka-pill-share-main { background: #5fd3c6; color: #062a26; border-color: #5fd3c6; }
body[class*="tokka-dash-theme-"] .tokka-dash-pills .tokka-pill.tokka-pill-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.35); }

/* ---------- Guardar (Fitts): se enciende solo con cambios ---------- */
@media (min-width: 1024px) and (min-height: 600px) {
    body:not(.tokka-dash-dirty) .tokka-dash-pills .tokka-pill-save {
        background: transparent;
        color: var(--tokka-dash-text-soft, var(--r-muted));
        box-shadow: inset 0 0 0 1px var(--tokka-dash-border, var(--r-line-strong));
    }
}
@media not all and (min-width: 1024px) and (min-height: 600px) {
    body.tokka-dash-dirty #tokka-dash-submit {
        position: fixed;
        z-index: 49;
        left: 16px;
        right: 16px;
        bottom: calc(118px + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-width: 488px;
        margin: 0 auto;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
        animation: tokka-save-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    body.tokka-dash-dirty .tokka-page-with-navbar { padding-bottom: calc(190px + env(safe-area-inset-bottom, 0px)); }
    /* Con conexiones, el "+" del encabezado basta; el botón largo queda solo para empezar (Hick). */
    .tokka-bento-conns .tokka-conn-add-btn:not(.tokka-conn-add-btn--empty) { display: none; }
}
@keyframes tokka-save-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { body.tokka-dash-dirty #tokka-dash-submit { animation: none; } }

/* ---------- Menú lateral (computadora): Escanear ya no roba la atención ---------- */
@media (min-width: 1024px) {
    .tokka-app-nav-fab .tokka-app-nav-icon { background: transparent; color: inherit; }
    .tokka-app-nav-fab.is-active .tokka-app-nav-icon,
    .tokka-app-nav-fab:hover .tokka-app-nav-icon { background: var(--tokka-nav-teal); color: #fff; }
}

/* ---------- Estadísticas vacías: siguiente paso ---------- */
.tokka-stats-start { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; }
.tokka-stats-start-title { margin: 0 0 2px; font-size: 17px; font-weight: 700; }
.tokka-stats-start .tokka-field-hint { margin: 0; max-width: 520px; }

/* ---------- Registro: "¡Ya casi!" ---------- */
.tokka-wizard-almost { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: #00786F; text-align: center; }

/* ---------- Contact form: aviso de guardado ---------- */
.tokka-exform-toast {
    position: fixed;
    left: 50%;
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    margin: 0;
    padding: 10px 16px;
    background: #111;
    color: #fff;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.tokka-exform-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.tokka-exform-toast.is-error { background: #b91c1c; }
@media (min-width: 1024px) { .tokka-exform-toast { bottom: 24px; } }
