/* ============================================================
   PAPERTOOLS · HUB PRINCIPAL (INICIO) — DISEÑO "DASHBOARD AZUL"
   Sidebar azul marino, hero con Doc, tarjetas de estadísticas con
   sparkline, grid de herramientas de colores, actividad y consejo.
   Todo está acotado a body.hub-home-page para no afectar módulos.
   ============================================================ */

.hub-home-page {
    --home-accent: #1f6fe5;
    --home-accent-2: #3b8bff;
    --home-accent-deep: #1450b8;
    --home-bg: #eef3fb;
    --home-card: #ffffff;
    --home-card-border: rgba(31, 111, 229, 0.08);
    --home-text: #12203a;
    --home-text-2: #4a5873;
    --home-text-3: #8392ab;
    --home-shadow: 0 1px 2px rgba(18, 32, 58, 0.04), 0 8px 24px rgba(31, 75, 150, 0.08);
    --home-shadow-hover: 0 2px 4px rgba(18, 32, 58, 0.05), 0 16px 36px rgba(31, 75, 150, 0.14);
    --home-radius: 20px;
}

[data-mode="dark"] .hub-home-page {
    --home-bg: #0d1424;
    --home-card: #141d31;
    --home-card-border: rgba(255, 255, 255, 0.06);
    --home-text: #eef3ff;
    --home-text-2: #a9b6cf;
    --home-text-3: #6f7d98;
    --home-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px rgba(0, 0, 0, 0.35);
    --home-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 38px rgba(0, 0, 0, 0.5);
}

.hub-home-page,
.hub-home-page .app-layout-with-sidebar {
    background: var(--home-bg);
}

.hub-home-page .app-main-content {
    background: var(--home-bg);
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    color: var(--home-text);
}

/* ------------------------------------------------------------
   TOPBAR: BUSCADOR + ACCIONES + USUARIO
   ------------------------------------------------------------ */
.home-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.75rem 0.5rem;
}

.home-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: none;
    background: var(--home-card);
    color: var(--home-text);
    box-shadow: var(--home-shadow);
    font-size: 1.05rem;
    cursor: pointer;
    flex-shrink: 0;
}

.home-search {
    position: relative;
    flex: 1;
    max-width: 520px;
}

.home-search > i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--home-text);
    font-size: 1rem;
    pointer-events: none;
}

.home-search input {
    width: 100%;
    height: 48px;
    padding: 0 1.1rem 0 3rem;
    border-radius: 999px;
    border: 1px solid var(--home-card-border);
    background: var(--home-card);
    color: var(--home-text);
    font-family: inherit;
    font-size: 0.9rem;
    box-shadow: var(--home-shadow);
    outline: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-search input::placeholder {
    color: var(--home-text-3);
}

.home-search input:focus {
    border-color: rgba(31, 111, 229, 0.45);
    box-shadow: 0 0 0 4px rgba(31, 111, 229, 0.12), var(--home-shadow);
}

.home-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--home-card);
    border: 1px solid var(--home-card-border);
    border-radius: 18px;
    box-shadow: var(--home-shadow-hover);
    padding: 6px;
    display: none;
    max-height: 360px;
    overflow-y: auto;
}

.home-search-results.is-open {
    display: block;
}

.home-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--home-text);
    text-decoration: none;
    font-size: 0.88rem;
}

.home-search-result:hover,
.home-search-result.is-active {
    background: rgba(31, 111, 229, 0.08);
    text-decoration: none;
}

.home-search-result i {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 111, 229, 0.1);
    color: var(--home-accent);
    flex-shrink: 0;
}

.home-search-result small {
    display: block;
    color: var(--home-text-3);
    font-size: 0.76rem;
}

.home-search-empty {
    padding: 14px;
    color: var(--home-text-3);
    font-size: 0.85rem;
    text-align: center;
}

.home-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.home-icon-btn {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--home-card);
    color: var(--home-text);
    box-shadow: var(--home-shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.home-icon-btn:hover {
    transform: translateY(-1px);
}

.home-icon-btn .notif-badge-pill {
    top: 2px !important;
    right: 2px !important;
}

.home-install-btn {
    display: none;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(31, 111, 229, 0.3);
    background: var(--home-card);
    color: var(--home-accent);
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
}

.home-topbar-divider {
    width: 1px;
    height: 32px;
    background: rgba(18, 32, 58, 0.1);
}

[data-mode="dark"] .home-topbar-divider {
    background: rgba(255, 255, 255, 0.1);
}

.home-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 4px 4px;
    border: none;
    background: transparent;
    color: var(--home-text);
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.9rem;
}

.home-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a78, #0e2a5e);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.92rem;
    overflow: hidden;
    flex-shrink: 0;
}

.home-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.home-user-name {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ------------------------------------------------------------
   CONTENEDOR GENERAL
   ------------------------------------------------------------ */
.home-wrap {
    padding: 0.75rem 1.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.home-card {
    background: var(--home-card);
    border: 1px solid var(--home-card-border);
    border-radius: var(--home-radius);
    box-shadow: var(--home-shadow);
}

/* ------------------------------------------------------------
   HERO
   ------------------------------------------------------------ */
.home-hero-row {
    display: grid;
    grid-template-columns: minmax(0, 2.85fr) minmax(0, 1fr);
    gap: 1.4rem;
}

.home-hero {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    padding: 2.4rem 2.2rem;
    border-radius: 28px;
    background:
        radial-gradient(circle at 78% 40%, rgba(120, 175, 255, 0.55), transparent 55%),
        linear-gradient(120deg, #ffffff 0%, #f3f8ff 45%, #dbe9ff 100%);
    border: 1px solid var(--home-card-border);
    box-shadow: var(--home-shadow);
}

[data-mode="dark"] .home-hero {
    background:
        radial-gradient(circle at 78% 40%, rgba(59, 139, 255, 0.35), transparent 55%),
        linear-gradient(120deg, #141d31 0%, #16233f 55%, #1a2f5a 100%);
}

.home-hero-text {
    position: relative;
    z-index: 2;
    max-width: 420px;
}

.home-hero-hello {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.4rem, 4vw, 3.3rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--home-text);
    margin: 0 0 0.6rem;
}

.home-hero-hello .wave {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: homeWave 2.4s ease-in-out 0.6s 2;
}

@keyframes homeWave {
    0%, 60%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
}

.home-hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    font-weight: 700;
    color: var(--home-text);
    margin: 0 0 0.6rem;
    letter-spacing: -0.01em;
}

.home-hero-title span {
    color: var(--home-accent);
    font-weight: 800;
}

.home-hero-sub {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--home-text-2);
    margin: 0 0 1.5rem;
}

.home-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--home-accent-2), var(--home-accent-deep));
    color: #ffffff;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(31, 111, 229, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(31, 111, 229, 0.45);
    color: #ffffff;
    text-decoration: none;
}

.home-btn-primary.is-small {
    padding: 0.6rem 1.25rem;
    font-size: 0.86rem;
}

/* Ilustración: Doc + mosaicos flotantes */
.home-hero-art {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 58%;
    pointer-events: none;
}

.home-hero-doc {
    position: absolute;
    right: 9%;
    bottom: -5%;
    height: 104%;
    width: auto;
    filter: drop-shadow(0 18px 30px rgba(20, 80, 184, 0.28));
    animation: homeFloat 6s ease-in-out infinite;
}

.home-tile {
    position: absolute;
    width: 62px;
    height: 62px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(31, 75, 150, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    animation: homeFloat 5s ease-in-out infinite;
}

.home-tile.t1 { left: 4%; top: 20%; color: #1f6fe5; transform: rotate(-10deg); animation-delay: -1s; }
.home-tile.t2 { left: 24%; top: 4%; color: #12203a; font-family: 'Outfit', sans-serif; font-weight: 900; transform: rotate(-4deg); animation-delay: -2s; }
.home-tile.t3 { right: 4%; top: 10%; color: #12203a; transform: rotate(6deg); animation-delay: -3s; }
.home-tile.t4 { left: 0; bottom: 18%; color: #1f6fe5; width: 54px; height: 54px; transform: rotate(-12deg); animation-delay: -4s; }
.home-tile.t5 { right: 6%; bottom: 14%; color: #f7a823; width: 54px; height: 54px; transform: rotate(8deg); animation-delay: -2.5s; }

@keyframes homeFloat {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -8px; }
}

/* Tarjeta promo lateral */
.home-promo {
    position: relative;
    overflow: hidden;
    padding: 1.9rem 1.6rem;
    border-radius: 28px;
    background:
        radial-gradient(circle at 85% 15%, rgba(120, 190, 255, 0.45), transparent 45%),
        linear-gradient(150deg, #1f6fe5 0%, #1450b8 50%, #0e2a5e 100%);
    color: #ffffff;
    box-shadow: 0 16px 34px rgba(20, 80, 184, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 260px;
}

.home-promo::after {
    content: '';
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: -40px;
    height: 90px;
    background: radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, 0.22), transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 255, 255, 0.16), transparent 60%);
    pointer-events: none;
}

.home-promo-rocket {
    font-size: 2.6rem;
    margin-bottom: auto;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.2));
}

.home-promo-spark {
    position: absolute;
    right: 1.6rem;
    top: 3.4rem;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
}

.home-promo h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 1rem 0 0.5rem;
    color: #ffffff;
}

.home-promo p {
    font-size: 0.9rem;
    line-height: 1.45;
    color: rgba(235, 243, 255, 0.88);
    margin: 0 0 1.1rem;
}

.home-btn-light {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.62rem 1.2rem;
    border-radius: 999px;
    background: #ffffff;
    color: #12203a;
    font-weight: 800;
    font-size: 0.86rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.home-btn-light:hover {
    transform: translateY(-1px);
    color: #12203a;
    text-decoration: none;
}

/* ------------------------------------------------------------
   ESTADÍSTICAS (reutiliza IDs/clases que actualiza stats.js)
   ------------------------------------------------------------ */
.hub-home-page .community-stats-banner.home-stats {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.home-stats .community-stats-header {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.hub-home-page .home-stats .community-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
}

.hub-home-page .home-stats .community-stat-item {
    --stat-color: #1f6fe5;
    --stat-soft: rgba(31, 111, 229, 0.12);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.3rem;
    min-height: 92px;
    background: var(--home-card);
    border: 1px solid var(--home-card-border);
    border-radius: var(--home-radius);
    box-shadow: var(--home-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hub-home-page .home-stats .community-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--home-shadow-hover);
}

.hub-home-page .home-stats .community-stat-item:nth-child(2) { --stat-color: #22b573; --stat-soft: rgba(34, 181, 115, 0.13); }
.hub-home-page .home-stats .community-stat-item:nth-child(3) { --stat-color: #8b5cf6; --stat-soft: rgba(139, 92, 246, 0.13); }
.hub-home-page .home-stats .community-stat-item:nth-child(4) { --stat-color: #f59e0b; --stat-soft: rgba(245, 158, 11, 0.14); }

.hub-home-page .home-stats .community-stat-icon {
    position: relative;
    z-index: 1;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--stat-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    flex-shrink: 0;
    box-shadow: none;
    border: none;
}

.hub-home-page .home-stats .community-stat-item > div:not(.community-stat-icon) {
    position: relative;
    z-index: 1;
    max-width: 62%;
}

.hub-home-page .home-stats .community-stat-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--home-text);
    line-height: 1.1;
    background: none;
    -webkit-text-fill-color: currentColor;
}

.hub-home-page .home-stats .community-stat-label {
    font-size: 0.8rem;
    color: var(--home-text-2);
    font-weight: 600;
}

.hub-home-page .community-stats-banner.home-stats::before,
.hub-home-page .community-stats-banner.home-stats::after,
.hub-home-page .home-stats .community-stat-item::before,
.hub-home-page .home-stats .community-stat-item::after {
    display: none;
}

.home-sparkline {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 40%;
    height: 62%;
    pointer-events: none;
    color: var(--stat-color);
}

/* ------------------------------------------------------------
   NUESTRAS HERRAMIENTAS
   ------------------------------------------------------------ */
.home-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.home-section-head h2 {
    position: relative;
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--home-text);
    margin: 0 0 0.2rem;
    padding-left: 1rem;
}

.home-section-head h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 5px;
    border-radius: 4px;
    background: var(--home-accent);
}

.home-section-head p {
    margin: 0 0 0 1rem;
    font-size: 0.92rem;
    color: var(--home-text-2);
}

.home-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--home-accent);
    font-weight: 800;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.home-link:hover {
    text-decoration: underline;
    color: var(--home-accent-deep);
}

.home-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
}

.home-tool-card {
    --tool-color: #1f6fe5;
    --tool-tint: #e6efff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 168px;
    padding: 1.1rem 1.2rem 1.1rem;
    border-radius: var(--home-radius);
    background:
        radial-gradient(circle at 95% 0%, color-mix(in srgb, var(--tool-color) 22%, transparent), transparent 55%),
        linear-gradient(160deg, var(--tool-tint) 0%, var(--home-card) 75%);
    border: 1px solid color-mix(in srgb, var(--tool-color) 22%, transparent);
    box-shadow: var(--home-shadow);
    color: var(--home-text);
    text-decoration: none;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
}

/* Modo oscuro: superficie oscura con un halo del color de la herramienta
   (la especificidad extra gana a los .c-* que fijan el tinte claro) */
html[data-mode="dark"] .home-tool-card.home-tool-card {
    background:
        radial-gradient(160px 130px at 15% 10%, color-mix(in srgb, var(--tool-color) 34%, transparent), transparent 70%),
        linear-gradient(165deg, color-mix(in srgb, var(--tool-color) 12%, #141d31) 0%, #111a2d 65%);
    border-color: color-mix(in srgb, var(--tool-color) 26%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 30px rgba(0, 0, 0, 0.35);
}

html[data-mode="dark"] .home-tool-card.home-tool-card:hover {
    border-color: color-mix(in srgb, var(--tool-color) 55%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px color-mix(in srgb, var(--tool-color) 22%, rgba(0, 0, 0, 0.45));
}

html[data-mode="dark"] .home-tool-emoji {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.95rem;
    background: color-mix(in srgb, var(--tool-color) 20%, transparent);
    border: 1px solid color-mix(in srgb, var(--tool-color) 32%, transparent);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--tool-color) 22%, transparent);
    filter: none;
}

html[data-mode="dark"] .home-tool-card p {
    color: #9fb0cc;
}

/* Ícono QR propio (el emoji 🔳 se veía como un cuadro vacío) */
.home-tool-qr {
    width: 1em;
    height: 1em;
    display: block;
    color: var(--tool-color);
}

.home-tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--home-shadow-hover);
    color: var(--home-text);
    text-decoration: none;
}

.home-tool-card.c-blue { --tool-color: #1f6fe5; --tool-tint: #e8f1ff; }
.home-tool-card.c-purple { --tool-color: #7c4dff; --tool-tint: #f1ebff; }
.home-tool-card.c-green { --tool-color: #16a36a; --tool-tint: #e5f8ef; }
.home-tool-card.c-orange { --tool-color: #f28a12; --tool-tint: #fff1e0; }
.home-tool-card.c-violet { --tool-color: #9b4dff; --tool-tint: #f4eaff; }

.home-tool-emoji {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 0.7rem;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.12));
    transition: transform 0.25s ease;
}

.home-tool-card:hover .home-tool-emoji {
    transform: scale(1.08) rotate(-4deg);
}

.home-tool-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 0.3rem;
    color: var(--home-text);
}

.home-tool-card p {
    margin: 0;
    padding-right: 44px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--home-text-2);
}

.home-tool-arrow {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--tool-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 6px 14px color-mix(in srgb, var(--tool-color) 45%, transparent);
    transition: transform 0.2s ease;
}

.home-tool-card:hover .home-tool-arrow {
    transform: translateX(3px);
}

/* ------------------------------------------------------------
   ACTIVIDAD RECIENTE + CONSEJO DEL DÍA
   ------------------------------------------------------------ */
.home-bottom-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
    gap: 1.4rem;
}

.home-activity {
    padding: 1.2rem 1.4rem;
}

.home-activity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.home-activity-head h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--home-text);
}

.home-activity-head h3 i {
    color: var(--home-text-2);
}

.home-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.6rem 0;
    border-top: 1px solid rgba(18, 32, 58, 0.06);
    font-size: 0.88rem;
}

[data-mode="dark"] .home-activity-item {
    border-top-color: rgba(255, 255, 255, 0.06);
}

.home-activity-item:first-child {
    border-top: none;
}

.home-activity-item a {
    flex: 1;
    min-width: 0;
    color: var(--home-text);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-activity-item a:hover {
    color: var(--home-accent);
}

.home-activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(31, 111, 229, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.home-activity-time {
    color: var(--home-text-3);
    font-size: 0.78rem;
    white-space: nowrap;
}

.home-activity-empty {
    padding: 0.4rem 0 0.2rem;
    color: var(--home-text-3);
    font-size: 0.86rem;
    line-height: 1.5;
    text-align: center;
}

.home-tip {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.3rem 1.6rem;
    background:
        radial-gradient(circle at 90% 50%, rgba(120, 175, 255, 0.35), transparent 50%),
        linear-gradient(110deg, var(--home-card) 0%, #eef5ff 100%);
}

[data-mode="dark"] .home-tip {
    background:
        radial-gradient(circle at 90% 50%, rgba(59, 139, 255, 0.25), transparent 50%),
        linear-gradient(110deg, var(--home-card) 0%, #182748 100%);
}

.home-tip-body {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.home-tip-body h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 0.45rem;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--home-text);
}

.home-tip-body p {
    margin: 0 0 1rem;
    max-width: 440px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--home-text-2);
}

.home-tip-body p strong {
    color: var(--home-text);
}

.home-tip-art {
    height: 150px;
    width: auto;
    margin: -1rem 0 -1.3rem;
    flex-shrink: 0;
    filter: drop-shadow(0 12px 20px rgba(20, 80, 184, 0.22));
}

/* Separación para las secciones detalladas existentes debajo */
.hub-home-page .pillars-interactive-container {
    padding-top: 0.5rem;
}

/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 1280px) {
    .home-tools-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .home-hero-row,
    .home-bottom-row {
        grid-template-columns: 1fr;
    }

    .hub-home-page .home-stats .community-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .home-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .home-topbar,
    .home-wrap {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .home-topbar {
        flex-wrap: wrap;
    }

    .home-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .home-user-name,
    .home-topbar-divider {
        display: none;
    }

    .home-hero {
        padding: 1.8rem 1.4rem 13rem;
    }

    .home-hero-art {
        top: auto;
        height: 13rem;
        width: 100%;
    }

    .home-hero-doc {
        right: 50%;
        transform: translateX(50%);
        height: 100%;
        bottom: -4%;
    }

    .home-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-tip-art {
        display: none;
    }
}

@media (max-width: 460px) {
    .hub-home-page .home-stats .community-stats-grid,
    .home-tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero-doc,
    .home-tile,
    .home-hero-hello .wave {
        animation: none;
    }
}


/* ------------------------------------------------------------
   TARJETAS DE HERRAMIENTAS (inicio): grupos, insignias y etiquetas
   ------------------------------------------------------------ */
.home-tools-group-head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0 .75rem; }
.home-tools-group-head:first-of-type { margin-top: .5rem; }
.home-tools-group-head h3 { margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--home-text); }
.home-tools-group-head span { font-size: .82rem; color: var(--home-muted, #6b7a99); }
.home-tools-grid + .home-tools-group-head { margin-top: 1.75rem; }
.home-tool-card { min-height: 210px; }
.home-tool-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.home-tool-card h3 { margin: 0 0 .25rem; }
.home-tool-card p { flex: 1; margin: 0 0 .7rem; }
.home-tool-badge { font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .2rem .5rem; border-radius: 6px; color: var(--tool-color); background: color-mix(in srgb, var(--tool-color) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tool-color) 35%, transparent); }
.home-tool-badge.is-ia { color: var(--tool-color); }
.home-tool-chips { display: flex; flex-wrap: wrap; gap: 0 .35rem; padding-right: 2.4rem; font-size: .72rem; font-weight: 600; color: #6b7a99; }
.home-tool-chips span { padding: 0; border: 0; background: none; color: inherit; }
.home-tool-chips span + span::before { content: '\00b7'; margin-right: .35rem; }
.home-tool-card.c-pink { --tool-color: #ec4899; --tool-tint: #fdeaf4; }
.home-tool-card.c-teal { --tool-color: #0ea5a4; --tool-tint: #e0f7f6; }
.home-tool-card.c-red { --tool-color: #ef4444; --tool-tint: #feeaea; }
.home-tool-card.c-gold { --tool-color: #d99a06; --tool-tint: #fff6dc; }


/* ------------------------------------------------------------
   PRIMEROS PASOS (inicio)
   ------------------------------------------------------------ */
.home-onb { margin-bottom: 1.6rem; }
.home-onb-card { border: 1px solid var(--border-card, rgba(148, 163, 184, .35)); border-radius: 22px; padding: 1.2rem 1.3rem; background: var(--bg-card, #fff); display: grid; gap: .9rem; }
.home-onb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.home-onb-head h2 { margin: 0; font: 900 1.25rem 'Outfit', sans-serif; }
.home-onb-head p { margin: .2rem 0 0; font-size: .88rem; color: var(--text-muted, #6b7a99); }
.home-onb-hide { border: 0; background: transparent; color: var(--text-muted, #6b7a99); font: 700 .78rem 'Plus Jakarta Sans', sans-serif; cursor: pointer; text-decoration: underline; flex-shrink: 0; }
.home-onb-bar { height: 8px; border-radius: 999px; background: rgba(148, 163, 184, .25); overflow: hidden; }
.home-onb-bar i { display: block; height: 100%; background: var(--color-primary, #1f6fe5); border-radius: 999px; transition: width .6s cubic-bezier(.22, 1, .36, 1); }
.home-onb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.home-onb-list li { display: flex; align-items: center; gap: .8rem; padding: .65rem .8rem; border-radius: 16px; background: rgba(148, 163, 184, .1); }
.home-onb-list li.is-done { opacity: .6; }
.home-onb-list li > div { flex: 1; min-width: 0; }
.home-onb-list strong { display: block; font-size: .92rem; }
.home-onb-list small { display: block; color: var(--text-muted, #6b7a99); font-size: .78rem; margin-top: .1rem; }
.home-onb-list em { font-style: normal; font-weight: 800; font-size: .78rem; color: #16a34a; }
.home-onb-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--color-primary, #1f6fe5) 14%, transparent); color: var(--color-primary, #1f6fe5); flex-shrink: 0; }
.home-onb-list li.is-done .home-onb-ic { background: rgba(22, 163, 74, .16); color: #16a34a; }
@media (max-width: 560px) { .home-onb-list li { flex-wrap: wrap; } .home-onb-list li > a, .home-onb-list li > em { margin-left: 3.4rem; } }

/* ------------------------------------------------------------
   TARJETAS DE HERRAMIENTAS: captura en reposo, tutorial en video al pasar el cursor
   ------------------------------------------------------------ */
.hub-home-page .tool-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 26px;
    margin-top: 1.4rem;
}
.tool-tile {
    --tile-line: #14284f;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 2px solid var(--tile-line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 5px 5px 0 var(--tile-line);
    transition: transform .18s ease, box-shadow .18s ease;
    cursor: pointer;
}
[data-mode="dark"] .tool-tile { --tile-line: rgba(255, 255, 255, .22); }
.tool-tile:hover, .tool-tile:focus-visible {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 var(--tile);
    border-color: var(--tile);
    outline: none;
}
.tool-tile-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0e2a5e;
    border-bottom: 2px solid var(--tile-line);
    overflow: hidden;
}
.tool-tile:hover .tool-tile-media, .tool-tile:focus-visible .tool-tile-media { border-bottom-color: var(--tile); }
.tool-tile-media img, .tool-tile-media video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; object-position: top center;
    display: block;
}
.tool-tile-media video { opacity: 0; transition: opacity .3s ease; background: #fff; }
.tool-tile.is-playing .tool-tile-media video { opacity: 1; }
.tool-tile-tag {
    position: absolute; top: 12px; right: 12px;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 11px 5px 9px;
    background: #fff; color: #14284f;
    border: 2px solid #14284f; border-radius: 999px;
    font: 800 .72rem 'Outfit', sans-serif; letter-spacing: .02em;
}
.tool-tile-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--tile); display: block; }
.tool-tile.is-active .tool-tile-tag b { font-size: 0; }
.tool-tile.is-active .tool-tile-tag b::after { content: 'Reproduciendo'; font-size: .72rem; }
.tool-tile.is-playing .tool-tile-tag i { animation: tileDot 1.1s ease-in-out infinite; }
@keyframes tileDot { 50% { transform: scale(1.7); opacity: .5; } }
.tool-tile-play { display: none; }
.tool-tile-bar {
    position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
    background: rgba(255, 255, 255, .35);
    opacity: 0; transition: opacity .2s;
}
.tool-tile-bar i { display: block; height: 100%; width: 0; background: var(--tile); }
.tool-tile.is-playing .tool-tile-bar { opacity: 1; }
.tool-tile-body {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 18px 18px;
}
.tool-tile-text h3 {
    margin: 0 0 3px;
    font: 800 1.2rem 'Outfit', sans-serif;
    letter-spacing: -.01em;
}
.tool-tile-text p { margin: 0; font-size: .86rem; line-height: 1.4; color: var(--text-muted); }
.tool-tile-go {
    flex: none; width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--tile); color: #fff;
    border: 2px solid #14284f;
    transition: transform .18s ease;
}
[data-mode="dark"] .tool-tile-go { border-color: rgba(255, 255, 255, .3); }
.tool-tile:hover .tool-tile-go { transform: translateX(3px); }

@media (hover: none), (pointer: coarse) {
    .tool-tile-play {
        position: absolute; left: 12px; bottom: 12px;
        width: 44px; height: 44px; border-radius: 50%;
        display: grid; place-items: center;
        background: #fff; color: #14284f;
        border: 2px solid #14284f;
        font-size: .95rem; padding-left: 2px;
    }
    .tool-tile.is-active .tool-tile-play i::before { content: '\f04c'; }
    .tool-tile.is-active .tool-tile-play { padding-left: 0; }
}
@media (max-width: 760px) {
    .hub-home-page .tool-tiles { grid-template-columns: 1fr; gap: 22px; }
    .tool-tile-text h3 { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .tool-tile, .tool-tile-go { transition: none; }
    .tool-tile:hover, .tool-tile:focus-visible { transform: none; }
}

.tool-tile-extra { margin: 8px 0 0 !important; font-size: .84rem !important; line-height: 1.5 !important; color: var(--text-primary) !important; opacity: .82; }
.tool-tile-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }
.tool-tile-chips li {
    padding: 3px 10px; border-radius: 999px;
    font: 700 .7rem 'Outfit', sans-serif;
    color: var(--text-primary);
    border: 1.5px solid var(--tile);
    background: color-mix(in srgb, var(--tile) 12%, transparent);
}
