/**
 * Auth / dashboard chrome (Back to home + language).
 * Always in its own row: floating gutters overlap the wide DoR card
 * (~1100px) until the viewport is huge, and collide again while resizing.
 */

.auth-screen,
.dashboard-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
        "back lang"
        "main main";
    align-items: stretch;
    justify-items: stretch;
    gap: 8px 12px;
    padding: 0.7rem 0.85rem 0.85rem;
    padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
}

/* Dashboard: «Volver» + «Ayudanos a mejorar» (mailto) comparten la celda `back`. */
.dashboard-screen .coach-app-chrome-links {
    grid-area: back;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dashboard-screen .coach-app-chrome-links .coach-app-back-website {
    flex: 0 1 auto;
    min-width: 0;
}

.dashboard-screen .coach-app-feedback-link {
    color: color-mix(in srgb, var(--rtp-brand-primary) 80%, var(--rtp-brand-text));
}

@media (max-width: 560px) {
    /* Teléfono: no hay lugar junto al selector de idioma; el mailto sigue en el footer de la landing. */
    .dashboard-screen .coach-app-feedback-link {
        display: none;
    }
}

.auth-screen .coach-app-back-website,
.dashboard-screen .coach-app-back-website {
    grid-area: back;
    position: static;
    top: auto;
    left: auto;
    z-index: 1;
    justify-self: start;
    align-self: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-screen .coach-app-lang,
.dashboard-screen .coach-app-lang {
    grid-area: lang;
    position: static;
    top: auto;
    right: auto;
    z-index: 1;
    justify-self: end;
    align-self: center;
}

.auth-screen .auth-card {
    grid-area: main;
    justify-self: center;
    align-self: center;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
}

.dashboard-screen #vue-dashboard-app {
    grid-area: main;
    justify-self: center;
    align-self: stretch;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
}

#vue-dashboard-app .vue-dashboard-card {
    height: 100%;
    min-height: 0;
    max-height: 100%;
}

@media (max-width: 1400px) {
    #vue-dashboard-app .vue-dashboard-card {
        padding: 20px 16px 24px;
    }

    #vue-dashboard-app .dashboard-header {
        gap: 10px;
        flex-wrap: wrap;
    }

    #vue-dashboard-app .dashboard-coach-title {
        max-width: min(100%, 22rem);
    }
}

@media (max-width: 720px) {
    #vue-dashboard-app .dashboard-coach-title {
        max-width: 100%;
        white-space: normal;
    }

    #vue-dashboard-app .dashboard-header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    #vue-dashboard-app .dashboard-profile-btn,
    #vue-dashboard-app .logout-btn {
        padding: 8px 10px;
        font-size: 0.74rem;
    }
}
