/* ==========================================================================
   Glopy · Screen 09 — Perfil (the user's control center)
   "Todo lo que Glopy sabe sobre ti, en un solo lugar."
   ========================================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

.pf-body {
    background: var(--gl-bg);
    color: var(--gl-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.pf-app {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--gl-bg);
    overflow: hidden;
}

/* Tone helpers ------------------------------------------------------------- */
.pf-tone--red { color: var(--gl-red); }
.pf-tone--blue { color: var(--gl-blue-soft); }
.pf-tone--green { color: var(--gl-green); }
.pf-tone--amber { color: var(--gl-amber); }
.pf-tone--violet { color: var(--gl-violet); }
.pf-tone--cyan { color: var(--gl-cyan); }

/* Top bar ------------------------------------------------------------------ */
.pf-topbar {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(env(safe-area-inset-top) + 16px) 16px 10px;
    position: relative;
    z-index: 60;          /* so the notifications panel overlays the page content */
}
.pf-topbar h1 { margin: 0; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.pf-topbar__lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pf-back { text-decoration: none; }
.pf-topbar__actions { display: flex; gap: 10px; }
.pf-iconbtn {
    position: relative;
    width: 42px; height: 42px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--gl-surface-hover); border: 1px solid var(--gl-line);
    color: var(--gl-text-soft); font-size: 1.1rem; cursor: pointer;
}
.pf-iconbtn:active { transform: scale(0.94); }
/* En móvil la campana se encoge a 34px (notifications.css) y el engranaje se
   quedaba en 42: dos botones de la misma fila con distinto tamaño. Se igualan. */
@media (max-width: 480px) {
    .pf-iconbtn { width: 34px; height: 34px; font-size: 1rem; }
}
.pf-iconbtn__badge {
    position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 9px; background: var(--gl-blue); color: #fff;
    font-size: 0.66rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid var(--gl-bg);
}

/* Scroll ------------------------------------------------------------------- */
.pf-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 6px 16px 22px; -webkit-overflow-scrolling: touch; }

/* Section headings --------------------------------------------------------- */
.pf-h3 {
    display: flex; align-items: center; justify-content: space-between;
    margin: 22px 2px 12px; font-size: 1.18rem; font-weight: 800; letter-spacing: -0.01em;
}
.pf-h3__link { font-size: 0.85rem; font-weight: 600; color: var(--gl-blue-soft); text-decoration: none; }

/* Profile header card ------------------------------------------------------ */
.pf-user {
    display: flex; align-items: center; gap: 14px;
    background: var(--gl-card); border: 1px solid var(--gl-line); border-radius: 18px;
    padding: 15px; text-decoration: none; color: inherit;
}
.pf-avatar {
    flex: 0 0 64px; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 38%, #18305e 0%, #0b1426 72%);
    border: 1.5px solid rgba(61, 134, 255, 0.6); box-shadow: 0 0 18px rgba(16, 96, 255, 0.45);
}
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-user__info { flex: 1 1 auto; min-width: 0; }
.pf-user__info h2 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
.pf-user__email { margin: 2px 0 0; font-size: 0.84rem; color: var(--gl-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-user__loc { margin: 5px 0 0; font-size: 0.84rem; color: var(--gl-blue-soft); display: flex; align-items: center; gap: 5px; }
.pf-badge {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
    padding: 4px 11px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; text-decoration: none;
    color: var(--gl-amber); background: rgba(245, 196, 81, 0.12); border: 1px solid rgba(245, 196, 81, 0.4);
}
.pf-badge--guest { color: var(--gl-blue-soft); background: rgba(58, 130, 247, 0.12); border-color: rgba(58, 130, 247, 0.4); }
.pf-user__chev { color: var(--gl-muted); font-size: 1.1rem; }

/* Personal stats ----------------------------------------------------------- */
.pf-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px;
    background: var(--gl-card); border: 1px solid var(--gl-line); border-radius: 18px; padding: 16px 10px;
}
.pf-stat { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.pf-stat__icon { font-size: 1.15rem; }
.pf-stat b { font-size: 1.2rem; font-weight: 800; }
.pf-stat small { font-size: 0.66rem; color: var(--gl-muted); line-height: 1.2; }

/* Premium card ------------------------------------------------------------- */
.pf-premium {
    display: flex; align-items: center; gap: 13px; margin-top: 14px; padding: 16px;
    border-radius: 18px; text-decoration: none; color: inherit;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.22), rgba(16, 96, 255, 0.16));
    border: 1px solid rgba(176, 124, 255, 0.4);
}
.pf-premium__crown {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f5c451, #f0a93a); color: #2a1d00; font-size: 1.35rem;
}
.pf-premium__txt { flex: 1 1 auto; min-width: 0; }
.pf-premium__txt b { display: block; font-size: 1.05rem; font-weight: 800; }
.pf-premium__txt small { font-size: 0.8rem; color: var(--gl-text-soft); line-height: 1.35; }
.pf-premium__btn {
    flex: 0 0 auto; padding: 9px 16px; border-radius: 11px; font-size: 0.84rem; font-weight: 700; color: #fff;
    background: linear-gradient(180deg, var(--gl-violet), #7c4dff);
}

/* My tools ----------------------------------------------------------------- */
.pf-tools { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.pf-tools::-webkit-scrollbar { display: none; }
.pf-tool {
    flex: 0 0 108px; width: 108px;
    display: flex; flex-direction: column; gap: 6px;
    background: var(--gl-card); border: 1px solid var(--gl-line); border-radius: 16px;
    padding: 14px 12px; text-decoration: none; color: inherit;
}
.pf-tool__icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--gl-surface-hover); font-size: 1.2rem;
}
.pf-tool b { font-size: 0.9rem; font-weight: 700; line-height: 1.2; }
.pf-tool small { font-size: 0.74rem; font-weight: 600; }

/* My activity -------------------------------------------------------------- */
.pf-activity { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
/* Ahora es un <a>: hay que neutralizar el estilo de enlace. */
.pf-act {
    display: block; text-decoration: none; color: inherit;
    background: var(--gl-card); border: 1px solid var(--gl-line); border-radius: 16px; padding: 14px;
}
.pf-act:active { transform: scale(0.985); }
.pf-act__top { font-size: 1.15rem; }
.pf-act__title { display: block; margin-top: 8px; font-size: 0.82rem; color: var(--gl-muted); }
.pf-act__val { display: block; margin-top: 4px; font-size: 1.4rem; font-weight: 800; }
.pf-act small { display: block; font-size: 0.72rem; color: var(--gl-muted); }

/* Search preferences ------------------------------------------------------- */
.pf-prefs {
    background: var(--gl-card); border: 1px solid var(--gl-line); border-radius: 18px;
    padding: 4px 4px; overflow: hidden;
}
.pf-pref {
    display: flex; align-items: center; gap: 12px; padding: 13px 12px;
    text-decoration: none; color: inherit; border-bottom: 1px solid var(--gl-line);
}
.pf-pref:last-child { border-bottom: none; }
.pf-pref__icon { color: var(--gl-blue-soft); font-size: 1.05rem; width: 20px; text-align: center; }
.pf-pref__label { flex: 1 1 auto; font-size: 0.92rem; font-weight: 600; }
.pf-pref__value { font-size: 0.86rem; color: var(--gl-muted); text-align: right; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-pref__chev { color: var(--gl-muted); font-size: 0.85rem; }

.pf-aibtn {
    display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; padding: 14px;
    border-radius: 14px; text-decoration: none; font-size: 0.95rem; font-weight: 700; color: var(--gl-text);
    background: linear-gradient(135deg, rgba(16, 96, 255, 0.18), rgba(124, 77, 255, 0.14));
    border: 1px solid rgba(58, 130, 247, 0.4);
}
.pf-aibtn__avatar {
    width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 38%, #18305e 0%, #0b1426 72%); border: 1px solid rgba(61, 134, 255, 0.6);
}
.pf-aibtn__avatar img { width: 80%; height: 80%; object-fit: contain; }

/* Hunter mode -------------------------------------------------------------- */
.pf-hunters {
    background: var(--gl-card); border: 1px solid var(--gl-line); border-radius: 18px; padding: 6px;
}
.pf-hunter {
    display: flex; align-items: center; gap: 12px; padding: 10px;
    text-decoration: none; color: inherit; border-bottom: 1px solid var(--gl-line);
}
.pf-hunter:last-of-type { border-bottom: none; }
/* Icono en vez de foto: un cazador es un criterio de búsqueda, no un anuncio
   concreto, así que no hay ninguna imagen que le corresponda de verdad (las
   que había eran de archivo). */
.pf-hunter__icon {
    position: relative;
    flex: 0 0 52px; width: 52px; height: 52px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(16, 96, 255, 0.14);
    border: 1px solid rgba(58, 130, 247, 0.35);
    color: var(--gl-blue-soft); font-size: 1.3rem;
}
.pf-hunter__icon.is-paused {
    background: var(--gl-surface-hover);
    border-color: var(--gl-line);
    color: var(--gl-muted);
}
/* Detecciones sin ver desde la última visita. */
.pf-hunter__badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--gl-red); color: #fff;
    font-size: 0.66rem; font-weight: 800;
}
.pf-hunter__status.is-paused { color: var(--gl-muted); }
.pf-hunter__status.is-paused .pf-dot { background: var(--gl-muted); box-shadow: none; }
.pf-ring--empty { color: var(--gl-muted); font-size: 1.1rem; }
.pf-hunters__empty {
    margin: 0; padding: 16px 12px 18px;
    color: var(--gl-muted); font-size: 0.86rem; line-height: 1.5; text-align: center;
}
.pf-newhunter--locked {
    background: rgba(245, 196, 81, 0.1);
    border-color: rgba(245, 196, 81, 0.5);
    color: var(--gl-amber);
}
.pf-hunter__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pf-hunter__body b { font-size: 0.95rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-hunter__status { font-size: 0.78rem; color: var(--gl-green); display: flex; align-items: center; gap: 6px; }
.pf-hunter__status .pf-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gl-green); box-shadow: 0 0 6px var(--gl-green); }
.pf-hunter__body small { font-size: 0.74rem; color: var(--gl-muted); }
.pf-hunter__score { flex: 0 0 auto; text-align: center; }
.pf-hunter__score small { display: block; font-size: 0.64rem; font-weight: 600; margin-top: 2px; }

.pf-ring {
    --val: 80; --ring: #26d07c;
    width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 800; color: var(--gl-text);
    background: radial-gradient(closest-side, var(--gl-card) 72%, transparent 73%),
                conic-gradient(var(--ring) calc(var(--val) * 1%), rgba(255, 255, 255, 0.1) 0);
    margin: 0 auto;
}

.pf-newhunter {
    width: 100%; margin-top: 4px; padding: 14px; border-radius: 13px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(16, 96, 255, 0.1); border: 1px dashed rgba(58, 130, 247, 0.5);
    color: var(--gl-blue-soft); font-size: 0.92rem; font-weight: 700; font-family: inherit;
    text-decoration: none;   /* ahora es un enlace a los filtros, no un botón */
}
.pf-newhunter:active { transform: scale(0.98); }

/* Bloque bloqueado hasta tener Plus --------------------------------------- */
.mk-locked {
    display: flex; align-items: center; gap: 12px;
    margin-top: 12px; padding: 15px 14px; border-radius: 16px;
    background: rgba(176, 124, 255, 0.1); border: 1px solid rgba(176, 124, 255, 0.4);
    color: inherit; text-decoration: none;
}
.mk-locked > i:first-child { color: var(--gl-violet); font-size: 1.15rem; flex: 0 0 auto; }
.mk-locked > i:last-child { color: var(--gl-muted); font-size: 0.9rem; flex: 0 0 auto; }
.mk-locked div { flex: 1 1 auto; min-width: 0; }
.mk-locked b { display: block; font-size: 0.88rem; margin-bottom: 3px; }
.mk-locked small { color: var(--gl-muted); font-size: 0.79rem; line-height: 1.45; }

/* Informe de mercado ------------------------------------------------------- */
.mk-picker { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.mk-city { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 1.25rem; font-weight: 800; }
.mk-city i { color: var(--gl-blue-soft); }
.mk-h2 { margin: 28px 0 12px; font-size: 1.05rem; font-weight: 800; }

.mk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mk-stat {
    padding: 15px 14px; border-radius: 16px;
    background: var(--gl-card); border: 1px solid var(--gl-line);
}
.mk-stat small { display: block; color: var(--gl-muted); font-size: 0.76rem; margin-bottom: 5px; }
.mk-stat b { font-size: 1.32rem; font-weight: 800; letter-spacing: -0.02em; }

.mk-range {
    margin-top: 12px; padding: 16px 14px; border-radius: 16px;
    background: rgba(16, 96, 255, 0.08); border: 1px solid rgba(58, 130, 247, 0.3);
}
.mk-range > b { font-size: 0.86rem; font-weight: 700; }
.mk-range__vals {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 10px 0 8px; font-size: 1.15rem; font-weight: 800;
}
.mk-range__vals i { color: var(--gl-blue-soft); font-size: 0.95rem; }
.mk-range small { color: var(--gl-muted); font-size: 0.76rem; line-height: 1.45; }
.mk-note { margin: 12px 2px 0; color: var(--gl-muted); font-size: 0.8rem; line-height: 1.5; }

.mk-compare { background: var(--gl-card); border: 1px solid var(--gl-line); border-radius: 16px; overflow: hidden; }
.mk-row {
    display: flex; align-items: center; gap: 10px; padding: 13px 14px;
    color: inherit; text-decoration: none; border-bottom: 1px solid var(--gl-line);
}
.mk-row:last-child { border-bottom: none; }
.mk-row__city { flex: 1 1 auto; font-size: 0.9rem; font-weight: 600; }
.mk-row__m2 { color: var(--gl-blue-soft); font-size: 0.85rem; font-weight: 700; }
.mk-row__n { color: var(--gl-muted); font-size: 0.76rem; min-width: 46px; text-align: right; }
.mk-row > i { color: var(--gl-muted); font-size: 0.9rem; }

.mk-empty { text-align: center; padding: 40px 20px; }
.mk-empty i { font-size: 2.4rem; color: var(--gl-blue-soft); }
.mk-empty h3 { margin: 12px 0 6px; font-size: 1.1rem; font-weight: 800; }
.mk-empty p { margin: 0 auto; max-width: 320px; color: var(--gl-muted); font-size: 0.87rem; line-height: 1.55; }

.mk-source {
    display: flex; gap: 8px; margin: 26px 2px 0;
    color: var(--gl-muted); font-size: 0.78rem; line-height: 1.55;
}
.mk-source i { flex: 0 0 auto; margin-top: 2px; }

/* Preferencias de búsqueda — un solo botón --------------------------------- */
.pf-prefbtn {
    display: block; padding: 15px 16px; border-radius: 18px;
    background: var(--gl-card); border: 1px solid var(--gl-line);
    color: inherit; text-decoration: none;
}
.pf-prefbtn:active { transform: scale(0.995); }
.pf-prefbtn__top { display: flex; align-items: center; gap: 11px; }
.pf-prefbtn__top > i:first-child { color: var(--gl-blue-soft); font-size: 1.2rem; }
.pf-prefbtn__top b { flex: 1 1 auto; font-size: 0.98rem; font-weight: 700; }
.pf-prefbtn__chev { color: var(--gl-muted); font-size: 1rem; }
.pf-prefbtn small { display: block; margin-top: 7px; color: var(--gl-muted); font-size: 0.82rem; line-height: 1.45; }
/* Resumen de lo configurado. Sólo salen los valores puestos: siete filas con
   "Sin definir" ocupaban media pantalla sin aportar nada. */
.pf-prefbtn__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pf-prefbtn__chips em {
    font-style: normal; padding: 5px 10px; border-radius: 999px;
    background: var(--gl-surface-hover); border: 1px solid var(--gl-line);
    color: var(--gl-text-soft); font-size: 0.76rem; font-weight: 600;
}

/* Pantallas de Cuenta ------------------------------------------------------ */
.ac-flash {
    display: flex; align-items: flex-start; gap: 9px;
    margin: 4px 0 16px; padding: 12px 14px; border-radius: 13px;
    font-size: 0.86rem; line-height: 1.45;
}
.ac-flash--ok  { background: rgba(38, 208, 124, 0.12); border: 1px solid rgba(38, 208, 124, 0.4); color: var(--gl-green); }
.ac-flash--bad { background: rgba(255, 77, 87, 0.12); border: 1px solid rgba(255, 77, 87, 0.4); color: var(--gl-red); }

.ac-block { margin-bottom: 26px; }
.ac-h2 { margin: 0 2px 10px; font-size: 1.02rem; font-weight: 800; }
.ac-note { margin: 0 2px 12px; color: var(--gl-muted); font-size: 0.86rem; line-height: 1.5; }
.ac-form { display: flex; flex-direction: column; gap: 14px; }

.ac-field { display: flex; flex-direction: column; gap: 6px; }
.ac-field > span { font-size: 0.82rem; font-weight: 600; color: var(--gl-muted); padding-left: 2px; }
.ac-field input, .ac-field select {
    width: 100%; padding: 13px 14px; border-radius: 13px;
    background: var(--gl-card); border: 1px solid var(--gl-line);
    /* 16px floor: below this iOS Safari auto-zooms the whole page on focus. */
    color: var(--gl-text); font: inherit; font-size: 1rem;
}
.ac-field input:focus, .ac-field select:focus {
    outline: none; border-color: var(--gl-blue-soft);
}
.ac-field input::placeholder { color: var(--gl-muted); }

.ac-check {
    display: flex; align-items: center; gap: 10px; padding: 13px 14px;
    border-radius: 13px; background: var(--gl-card); border: 1px solid var(--gl-line);
    font-size: 0.9rem; cursor: pointer;
}
.ac-check input { width: 18px; height: 18px; accent-color: var(--gl-blue); flex: 0 0 auto; }

.ac-radios { display: flex; gap: 10px; }
.ac-radio {
    flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 10px; border-radius: 13px; cursor: pointer;
    background: var(--gl-card); border: 1px solid var(--gl-line);
    font-size: 0.9rem; font-weight: 600;
}
/* El radio va oculto, pero la etiqueta TIENE que reaccionar al pulsarla. Antes
   el resaltado sólo lo ponía el servidor al recargar, así que tocar "Claro" no
   producía ningún cambio visible y parecía que el ajuste no funcionaba. */
.ac-radio input { position: absolute; opacity: 0; pointer-events: none; }
.ac-radio.is-on,
.ac-radio:has(input:checked) {
    border-color: var(--gl-blue-soft);
    background: rgba(16, 96, 255, 0.12);
    color: var(--gl-blue-soft);
}
/* Navegadores sin :has() — la clase la pone el JS al cambiar de opción. */
.ac-radio:focus-within { border-color: var(--gl-blue-soft); }

.ac-submit {
    width: 100%; margin-top: 4px; padding: 15px; border-radius: 14px; cursor: pointer;
    background: linear-gradient(180deg, var(--gl-blue-soft), var(--gl-blue));
    border: none; color: #fff; font: inherit; font-size: 0.95rem; font-weight: 700;
}
.ac-submit:active { transform: scale(0.99); }
.ac-submit--ghost {
    background: none; border: 1px solid var(--gl-line); color: var(--gl-muted);
}

/* Cambio de correo a medias: se avisa de que el antiguo sigue siendo el válido. */
.ac-pending {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 14px; border-radius: 13px; margin-bottom: 12px;
    background: rgba(245, 196, 81, 0.1); border: 1px solid rgba(245, 196, 81, 0.4);
}
.ac-pending i { color: var(--gl-amber); font-size: 1.15rem; }
.ac-pending b { display: block; font-size: 0.9rem; margin-bottom: 3px; }
.ac-pending small { color: var(--gl-muted); font-size: 0.8rem; line-height: 1.45; }

.ac-help { margin: 26px 2px 0; text-align: center; color: var(--gl-muted); font-size: 0.84rem; }
.ac-help a { color: var(--gl-blue-soft); font-weight: 600; text-decoration: none; }

/* Documentos legales ------------------------------------------------------- */
.lg-draft {
    display: flex; align-items: flex-start; gap: 11px;
    margin: 4px 0 18px; padding: 13px 14px; border-radius: 13px;
    background: rgba(245, 196, 81, 0.1); border: 1px solid rgba(245, 196, 81, 0.4);
}
.lg-draft i { color: var(--gl-amber); font-size: 1.1rem; flex: 0 0 auto; }
.lg-draft b { display: block; font-size: 0.88rem; margin-bottom: 3px; }
.lg-draft small { color: var(--gl-muted); font-size: 0.8rem; line-height: 1.5; }
.lg-draft--data { background: rgba(16, 96, 255, 0.1); border-color: rgba(58, 130, 247, 0.4); }
.lg-draft--data i { color: var(--gl-blue-soft); }
.lg-draft code {
    background: var(--gl-surface-hover); padding: 1px 5px; border-radius: 4px; font-size: 0.94em;
}

.lg-doc { padding-bottom: 8px; }
.lg-doc h2 {
    margin: 24px 0 9px; font-size: 1rem; font-weight: 800;
    color: var(--gl-text); letter-spacing: -0.01em;
}
.lg-doc h2:first-child { margin-top: 4px; }
.lg-doc p { margin: 0 0 11px; color: var(--gl-text-soft); font-size: 0.89rem; line-height: 1.65; }
.lg-doc ul { margin: 0 0 12px; padding-left: 20px; }
.lg-doc li { margin-bottom: 7px; color: var(--gl-text-soft); font-size: 0.89rem; line-height: 1.6; }

.lg-links {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px;
    padding-top: 18px; border-top: 1px solid var(--gl-line);
}
.lg-links a {
    padding: 9px 14px; border-radius: 999px;
    background: var(--gl-card); border: 1px solid var(--gl-line);
    color: var(--gl-blue-soft); font-size: 0.8rem; font-weight: 600; text-decoration: none;
}

.lg-odr { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--gl-line); }
.lg-odr h2 { margin: 0 0 10px; font-size: 0.98rem; font-weight: 800; }
.lg-odr p { margin: 0 0 10px; color: var(--gl-muted); font-size: 0.85rem; line-height: 1.6; }
.lg-odr a { color: var(--gl-blue-soft); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.lg-odr__entity { font-size: 0.78rem; }

/* El textarea comparte estilo con el resto de campos del formulario. */
.ac-field textarea {
    width: 100%; padding: 13px 14px; border-radius: 13px; resize: vertical;
    background: var(--gl-card); border: 1px solid var(--gl-line);
    /* 16px floor: below this iOS Safari auto-zooms the whole page on focus. */
    color: var(--gl-text); font: inherit; font-size: 1rem; line-height: 1.5;
}
.ac-field textarea:focus { outline: none; border-color: var(--gl-blue-soft); }
.ac-field textarea::placeholder { color: var(--gl-muted); }

/* Pantalla Modo Cazador ---------------------------------------------------- */
.cz-topbar { gap: 12px; }
.cz-topbar h1 { flex: 1 1 auto; font-size: 1.35rem; }
.cz-intro { margin: 4px 2px 14px; color: var(--gl-muted); font-size: 0.88rem; line-height: 1.5; }
.cz-row { border-bottom: 1px solid var(--gl-line); }
.cz-row:last-of-type { border-bottom: none; }
.cz-row .pf-hunter { border-bottom: none; }
.cz-actions { display: flex; gap: 8px; padding: 0 10px 12px; }
.cz-act {
    flex: 1 1 auto; padding: 9px 10px; border-radius: 10px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--gl-surface-hover); border: 1px solid var(--gl-line);
    color: var(--gl-text-soft); font-family: inherit; font-size: 0.8rem; font-weight: 600;
}
.cz-act--danger { color: var(--gl-red); border-color: rgba(255, 77, 87, 0.35); }
.cz-limit { margin: 14px 2px 0; color: var(--gl-muted); font-size: 0.82rem; text-align: center; }
.cz-limit a { color: var(--gl-amber); font-weight: 700; text-decoration: none; }

/* Premium subscription ----------------------------------------------------- */
.pf-sub {
    margin-top: 20px; padding: 16px; border-radius: 18px;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.2), rgba(16, 96, 255, 0.14));
    border: 1px solid rgba(176, 124, 255, 0.4);
}
.pf-sub__head { font-size: 0.82rem; font-weight: 700; color: var(--gl-text-soft); display: flex; align-items: center; gap: 7px; }
.pf-sub__head i { color: var(--gl-amber); }
.pf-sub__body { display: flex; align-items: center; gap: 13px; margin: 13px 0; }
.pf-sub__crown {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f5c451, #f0a93a); color: #2a1d00; font-size: 1.35rem;
}
.pf-sub__info b { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; font-weight: 800; }
.pf-sub__tag { padding: 2px 9px; border-radius: 999px; font-size: 0.66rem; font-weight: 700; color: var(--gl-green); background: rgba(38, 208, 124, 0.16); }
.pf-sub__info small { font-size: 0.8rem; color: var(--gl-text-soft); }
.pf-sub__btn {
    display: block; width: 100%; padding: 13px; border-radius: 12px; cursor: pointer; font-family: inherit;
    background: var(--gl-surface-hover); border: 1px solid rgba(176, 124, 255, 0.5);
    color: var(--gl-text); font-size: 0.92rem; font-weight: 700; text-align: center; text-decoration: none;
}

/* Account + legal ---------------------------------------------------------- */
.pf-cols { display: grid; grid-template-columns: 1fr; gap: 0; }
.pf-rows { background: var(--gl-card); border: 1px solid var(--gl-line); border-radius: 16px; overflow: hidden; }
.pf-row {
    display: flex; align-items: center; gap: 12px; padding: 14px 14px;
    text-decoration: none; color: inherit; border-bottom: 1px solid var(--gl-line); font-size: 0.92rem; font-weight: 600;
}
.pf-row:last-child { border-bottom: none; }
.pf-row > i:first-child { color: var(--gl-blue-soft); font-size: 1.02rem; width: 20px; text-align: center; }
.pf-row > span { flex: 1 1 auto; }
.pf-row > i:last-child { color: var(--gl-muted); font-size: 0.82rem; }

/* Log out ------------------------------------------------------------------ */
.pf-logout {
    display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 22px; padding: 15px;
    border-radius: 14px; text-decoration: none; font-size: 0.96rem; font-weight: 700;
    color: var(--gl-red); background: rgba(255, 77, 87, 0.08); border: 1px solid rgba(255, 77, 87, 0.3);
}
.pf-logout--in { color: var(--gl-blue-soft); background: rgba(58, 130, 247, 0.1); border-color: rgba(58, 130, 247, 0.4); }

/* Toast -------------------------------------------------------------------- */
.pf-toast {
    position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px);
    z-index: 1200; max-width: 90%; padding: 12px 18px; border-radius: 14px;
    background: rgba(20, 28, 46, 0.97); border: 1px solid var(--gl-line);
    color: var(--gl-text); font-size: 0.88rem; font-weight: 600;
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
}
.pf-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Desktop — roomier profile grid inside the shared shell frame. */
@media (min-width: 900px) {
    .pf-cols { grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
    .pf-activity { grid-template-columns: repeat(4, 1fr); }
}

/* ==========================================================================
   ESCRITORIO (>=1024px) - maqueta del cliente (Perfil).
   Tres columnas: identidad y contadores; herramientas y actividad; ajustes,
   cuenta y legal. Los envoltorios .pf-colA/B/C valen display:contents por
   debajo de este ancho, asi que el movil se pinta igual que siempre.
   ========================================================================== */
.pf-colA,
.pf-colB,
.pf-colC { display: contents; }

@media (min-width: 1024px) {
    .gl-shell--full .pf-app { max-width: none; height: 100vh; }

    /* Cabecera */
    .gl-shell--full .pf-topbar { padding: 26px 32px 14px; }
    .gl-shell--full .pf-topbar h1 { font-size: 2.6rem; }
    .gl-shell--full .pf-topbar__actions { gap: 14px; }
    .gl-shell--full .pf-iconbtn { width: 52px; height: 52px; font-size: 1.25rem; }

    /* Tres columnas */
    .gl-shell--full .pf-scroll--cols {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
        gap: 22px;
        padding: 10px 32px 32px;
    }
    .gl-shell--full .pf-colA,
    .gl-shell--full .pf-colB,
    .gl-shell--full .pf-colC {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    /* El primer titulo de cada columna no necesita el margen superior que
       lleva cuando las secciones van una detras de otra. */
    .gl-shell--full .pf-colB > .pf-h3:first-child,
    .gl-shell--full .pf-colC > .pf-h3:first-child { margin-top: 4px; }

    /* Contadores 2x2, como la maqueta (en movil van los cuatro en fila). */
    .gl-shell--full .pf-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        padding: 18px 14px;
    }
    .gl-shell--full .pf-stat { gap: 6px; padding: 10px 4px; }
    .gl-shell--full .pf-stat__icon { font-size: 1.5rem; }

    /* Herramientas 2x2: en movil es un carrusel horizontal. */
    .gl-shell--full .pf-tools {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        overflow: visible;
    }
    .gl-shell--full .pf-tool { flex: 1 1 auto; width: auto; padding: 18px 16px; }

    /* Actividad 2x2 (la regla de 900px la pone en cuatro columnas). */
    .gl-shell--full .pf-activity { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

    /* Cuenta y "Ayuda y legal" van una debajo de otra dentro de la columna. */
    .gl-shell--full .pf-cols { grid-template-columns: minmax(0, 1fr); gap: 0; }

    .gl-shell--full .pf-logout { margin-top: 12px; padding: 13px; }

    /* Compactado: la maqueta cabe entera en pantalla, sin scroll. Los margenes
       y rellenos de movil (pensados para una sola columna larga) sumaban
       demasiado alto y dejaban "Cerrar sesion" fuera de la vista. */
    .gl-shell--full .pf-h3 { margin: 8px 2px 8px; font-size: 1.1rem; }
    .gl-shell--full .pf-colA > .pf-h3:first-child { margin-top: 4px; }
    .gl-shell--full .pf-user { padding: 14px; }
    .gl-shell--full .pf-stats { padding: 14px 12px; gap: 10px; margin-top: 12px; }
    .gl-shell--full .pf-stat { gap: 4px; padding: 8px 4px; }
    .gl-shell--full .pf-stat__icon { font-size: 1.35rem; }
    .gl-shell--full .pf-premium { padding: 14px; margin-top: 12px; }
    .gl-shell--full .pf-tool { padding: 14px; gap: 4px; }
    .gl-shell--full .pf-tools,
    .gl-shell--full .pf-activity { gap: 12px; }
    .gl-shell--full .pf-act { padding: 14px; }
    .gl-shell--full .pf-prefbtn { padding: 13px 14px; }
    .gl-shell--full .pf-aibtn { padding: 11px 14px; margin-top: 8px; }
    .gl-shell--full .pf-row { padding: 11px 14px; }
    .gl-shell--full .pf-hunters { gap: 10px; }
    .gl-shell--full .pf-newhunter { padding: 13px; }
}

/* ==========================================================================
   ESCRITORIO (>=1024px) - "Preferencias de la app" (pantalla de Cuenta).
   Aspecto y Avisos por correo pasan a dos tarjetas lado a lado, y el boton de
   guardar a una tarjeta ancha debajo junto al enlace de ayuda.
   Los envoltorios valen display:contents por debajo de este ancho: en movil el
   formulario se pinta exactamente igual que antes.
   ========================================================================== */
.ac-group,
.ac-save { display: contents; }

@media (min-width: 1024px) {
    .gl-shell--full .pf-app .cz-topbar { padding: 26px 32px 18px; gap: 20px; }
    /* Cuenta reutiliza .pf-scroll pero NO es la rejilla de tres columnas
       del perfil (esa lleva .pf-scroll--cols). */
    .gl-shell--full .pf-scroll { padding: 10px 32px 32px; }
    /* Las otras secciones de Cuenta (datos, correo y contrasena) son
       formularios de una columna: sin tope se quedaban con campos de 1.200px
       de ancho al pasar del marco de 480px al ancho completo. */
    .gl-shell--full .pf-scroll > .ac-form:not(.ac-form--prefs),
    .gl-shell--full .pf-scroll > .ac-block,
    .gl-shell--full .pf-scroll > .ac-flash { max-width: 720px; }
    .gl-shell--full .ac-form:not(.ac-form--prefs) + .ac-help,
    .gl-shell--full .ac-block + .ac-help { max-width: 720px; text-align: center; }
    .gl-shell--full .pf-app .cz-topbar h1 { font-size: 2.1rem; }

    .gl-shell--full .ac-form--prefs {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
        gap: 22px;
        max-width: 1400px;
    }

    .gl-shell--full .ac-form--prefs .ac-group {
        display: block;
        padding: 26px;
        border-radius: 20px;
        background: var(--gl-card);
        border: 1px solid var(--gl-line);
    }
    /* Titulo de tarjeta, con el subrayado azul de la maqueta. */
    .gl-shell--full .ac-form--prefs .ac-h2 {
        margin: 0 0 22px;
        padding-bottom: 12px;
        font-size: 1.4rem;
        border-bottom: 2px solid var(--gl-blue);
    }
    .gl-shell--full .ac-form--prefs .ac-radios { gap: 16px; }
    .gl-shell--full .ac-form--prefs .ac-radio { padding: 22px 16px; border-radius: 16px; font-size: 1.05rem; }
    .gl-shell--full .ac-form--prefs .ac-check { padding: 20px; border-radius: 16px; font-size: 1.05rem; }
    .gl-shell--full .ac-form--prefs .ac-field { margin-top: 22px; }
    .gl-shell--full .ac-form--prefs .ac-field > span { font-size: 1rem; }
    .gl-shell--full .ac-form--prefs .ac-field select { padding: 18px 16px; font-size: 1.05rem; border-radius: 14px; }

    /* Guardar: tarjeta ancha. Se une visualmente con el enlace de ayuda de
       abajo (mitad superior aqui, mitad inferior en .ac-help). */
    .gl-shell--full .ac-form--prefs .ac-save {
        display: block;
        grid-column: 1 / -1;
        padding: 28px 26px 22px;
        border-radius: 20px 20px 0 0;
        background: var(--gl-card);
        border: 1px solid var(--gl-line);
        border-bottom: 0;
        text-align: center;
    }
    .gl-shell--full .ac-form--prefs .ac-submit {
        width: auto;
        min-width: 440px;
        padding: 20px 32px;
        font-size: 1.15rem;
    }
    .gl-shell--full .ac-form--prefs + .ac-help {
        margin: 0;
        padding: 0 26px 26px;
        border-radius: 0 0 20px 20px;
        background: var(--gl-card);
        border: 1px solid var(--gl-line);
        border-top: 0;
        font-size: 1rem;
        text-align: center;
    }
}

/* ===== Tema claro (punto 17) =====
Perfil, cuenta, legales, cazadores e informe de mercado en tema claro.
   ========================================================================== */

:root[data-theme="light"] .pf-avatar, :root[data-theme="light"] .pf-aibtn__avatar { box-shadow: 0 0 12px rgba(16, 96, 255, 0.28); }
:root[data-theme="light"] .pf-badge { background: rgba(154, 98, 0, 0.08); border-color: rgba(154, 98, 0, 0.28); }
:root[data-theme="light"] .pf-badge--guest { background: rgba(16, 96, 255, 0.07); border-color: rgba(16, 96, 255, 0.28); }
:root[data-theme="light"] .pf-premium, :root[data-theme="light"] .pf-sub { background: linear-gradient(135deg, rgba(124, 77, 255, 0.10), rgba(16, 96, 255, 0.06)), #fff; border-color: rgba(116, 66, 224, 0.22); }
:root[data-theme="light"] .pf-aibtn { background: linear-gradient(135deg, rgba(16, 96, 255, 0.07), rgba(124, 77, 255, 0.05)), #fff; border-color: rgba(16, 96, 255, 0.2); }
:root[data-theme="light"] .pf-hunter__icon { background: rgba(16, 96, 255, 0.07); border-color: rgba(16, 96, 255, 0.22); }
:root[data-theme="light"] .pf-newhunter--locked { background: rgba(154, 98, 0, 0.06); border-color: rgba(154, 98, 0, 0.3); }
:root[data-theme="light"] .pf-ring { --ring: #08824a; background: radial-gradient(closest-side, var(--gl-card) 72%, transparent 73%), conic-gradient(var(--ring) calc(var(--val) * 1%), rgba(15, 23, 42, 0.10) 0); }
:root[data-theme="light"] .pf-newhunter { background: rgba(16, 96, 255, 0.05); border-color: rgba(16, 96, 255, 0.35); }
:root[data-theme="light"] .mk-locked { background: rgba(116, 66, 224, 0.06); border-color: rgba(116, 66, 224, 0.25); }
:root[data-theme="light"] .mk-range { background: rgba(16, 96, 255, 0.05); border-color: rgba(16, 96, 255, 0.2); }
:root[data-theme="light"] .ac-flash--ok { background: rgba(8, 130, 74, 0.07); border-color: rgba(8, 130, 74, 0.28); }
:root[data-theme="light"] .ac-flash--bad { background: rgba(212, 42, 53, 0.06); border-color: rgba(212, 42, 53, 0.28); }
:root[data-theme="light"] .ac-radio.is-on, :root[data-theme="light"] .ac-radio:has(input:checked) { background: rgba(16, 96, 255, 0.07); }
:root[data-theme="light"] .ac-pending, :root[data-theme="light"] .lg-draft { background: rgba(154, 98, 0, 0.06); border-color: rgba(154, 98, 0, 0.28); }
:root[data-theme="light"] .lg-draft--data { background: rgba(16, 96, 255, 0.05); border-color: rgba(16, 96, 255, 0.22); }
:root[data-theme="light"] .cz-act--danger { border-color: rgba(212, 42, 53, 0.3); }
:root[data-theme="light"] .pf-sub__tag { background: rgba(8, 130, 74, 0.10); }
:root[data-theme="light"] .pf-sub__btn { border-color: rgba(116, 66, 224, 0.35); }
:root[data-theme="light"] .pf-logout { background: rgba(212, 42, 53, 0.05); border-color: rgba(212, 42, 53, 0.25); }
:root[data-theme="light"] .pf-logout--in { background: rgba(16, 96, 255, 0.05); border-color: rgba(16, 96, 255, 0.25); }
:root[data-theme="light"] .pf-toast { background: #fff; color: var(--gl-text); border: 1px solid var(--gl-border); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); }
