body.eco-app *,
body.eco-guest * {
    box-sizing: border-box;
}

body.eco-app h1,
body.eco-app h2,
body.eco-app h3,
body.eco-app h4,
body.eco-guest h1,
body.eco-guest h2,
body.eco-guest h3,
body.eco-guest h4 {
    margin: 0;
    font-family: var(--eco-font-display);
    color: var(--eco-text);
    line-height: 1.04;
}

body.eco-app p,
body.eco-guest p {
    line-height: 1.6;
}

body.eco-app .subtle,
body.eco-guest .subtle {
    color: var(--eco-text-soft);
}

body.eco-app .kpi,
body.eco-guest .kpi {
    font-family: var(--eco-font-display);
    font-size: clamp(1.8rem, 2vw, 2.6rem);
    color: var(--eco-text);
}

body.eco-app .badge,
body.eco-guest .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--eco-primary), var(--eco-primary-soft));
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(46, 125, 50, 0.18);
}

body.eco-app .badge-success,
body.eco-guest .badge-success {
    background: linear-gradient(135deg, var(--eco-accent), #ffb74d);
}

body.eco-app .badge-event-insufficient,
body.eco-guest .badge-event-insufficient {
    background: linear-gradient(135deg, #c62828, #ef5350);
    box-shadow: 0 10px 20px rgba(198, 40, 40, 0.22);
}

body.eco-app .actions,
body.eco-guest .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

body.eco-app .page-head,
body.eco-guest .page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

body.eco-app .page-head h1,
body.eco-guest .page-head h1 {
    font-size: clamp(2rem, 3.6vw, 3rem);
}

body.eco-app .page-head h2,
body.eco-guest .page-head h2 {
    font-size: clamp(1.45rem, 2vw, 2rem);
}

body.eco-app .grid,
body.eco-app .grid-cards,
body.eco-guest .grid,
body.eco-guest .grid-cards {
    display: grid;
    gap: 1.25rem;
}

body.eco-app .grid-cards,
body.eco-guest .grid-cards {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body.eco-app .split,
body.eco-guest .split {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.eco-app .rank-list,
body.eco-guest .rank-list {
    display: grid;
    gap: 1rem;
}

body.eco-app .rank-item,
body.eco-guest .rank-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

body.eco-app .rank-position,
body.eco-guest .rank-position {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 213, 79, 0.92), rgba(251, 140, 0, 0.92));
    color: #654100;
    font-weight: 900;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.eco-app .progress,
body.eco-guest .progress {
    width: 100%;
    height: 0.8rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(46, 125, 50, 0.1);
}

body.eco-app .progress span,
body.eco-guest .progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--eco-secondary), var(--eco-mission), var(--eco-primary-soft));
}

body.eco-app .flash,
body.eco-guest .flash {
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
    border-radius: var(--eco-radius-sm);
    border: 1px solid transparent;
    box-shadow: var(--eco-shadow-sm);
    animation: ecoPop 0.26s ease;
}

body.eco-app .flash::after,
body.eco-guest .flash::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 -30%;
    width: 28%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    animation: ecoShimmer 2.8s infinite linear;
}

body.eco-app .flash-success,
body.eco-guest .flash-success {
    background: rgba(67, 160, 71, 0.12);
    border-color: rgba(67, 160, 71, 0.22);
    color: #1e6b30;
}

body.eco-app .flash-error,
body.eco-guest .flash-error {
    background: rgba(229, 57, 53, 0.1);
    border-color: rgba(229, 57, 53, 0.18);
    color: #b42321;
}

body.eco-app .guest-title,
body.eco-guest .guest-title,
body.eco-guest .auth-login-title {
    margin-top: 1.4rem;
}

body.eco-app .guest-actions,
body.eco-guest .guest-actions {
    margin-top: 1rem;
}

@media (max-width: 960px) {
    body.eco-app .split,
    body.eco-guest .split {
        grid-template-columns: 1fr;
    }

    body.eco-app .page-head,
    body.eco-guest .page-head {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    body.eco-app .rank-item,
    body.eco-guest .rank-item {
        grid-template-columns: 1fr;
        justify-items: flex-start;
    }

    body.eco-app .ranking-page .rank-item,
    body.eco-guest .ranking-page .rank-item {
        grid-template-columns: auto minmax(0, 1fr);
        justify-items: stretch;
        align-items: start;
        column-gap: 0.85rem;
        row-gap: 0.25rem;
    }

    body.eco-app .ranking-page .ranking-item-meta,
    body.eco-guest .ranking-page .ranking-item-meta {
        display: grid;
        gap: 0.2rem;
        min-width: 0;
    }

    body.eco-app .ranking-page .ranking-item-meta strong,
    body.eco-guest .ranking-page .ranking-item-meta strong,
    body.eco-app .ranking-page .ranking-item-meta .subtle,
    body.eco-guest .ranking-page .ranking-item-meta .subtle {
        margin: 0;
        white-space: normal;
    }

    body.eco-app .ranking-page .ranking-item-meta strong,
    body.eco-guest .ranking-page .ranking-item-meta strong {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.eco-app .ranking-page .ranking-item-subline,
    body.eco-guest .ranking-page .ranking-item-subline {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        min-width: 0;
    }

    body.eco-app .ranking-page .ranking-item-subline .subtle,
    body.eco-guest .ranking-page .ranking-item-subline .subtle {
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1 1 auto;
    }

    body.eco-app .ranking-page .ranking-item-value,
    body.eco-guest .ranking-page .ranking-item-value {
        flex: 0 0 auto;
        justify-self: auto;
        text-align: right;
        white-space: nowrap;
    }
}
