/* Keep the dashboard shortcuts in normal grid cells, including hover clearance. */
#menu-page #top-right-ui-cluster.dashboard-shortcuts-card {
    position: absolute;
    inset: 0 0 auto auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    justify-items: center;
    gap: 12px 8px;
    width: 300px;
    max-width: 100%;
    padding: 16px 12px;
    margin: 0;
    box-sizing: border-box;
    border: 2px solid #dfe3e8;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(32, 38, 46, 0.08);
    z-index: 50;
}
#menu-page .dashboard-shortcuts-card > :is(div, a) {
    position: static !important;
    inset: auto !important;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    align-self: center;
    justify-self: center;
    z-index: auto;
}
#menu-page .dashboard-shortcuts-card #dashboard-excel-link {
    grid-area: 1 / 1;
    width: 82px;
    height: 64px;
}
#menu-page .dashboard-shortcuts-card #hivemind-icon-container {
    grid-area: 1 / 3;
    order: 0;
    width: 100%;
}
#menu-page .dashboard-shortcuts-card #hivemind-icon {
    width: 100%;
    max-width: 88px;
    height: auto;
}
#menu-page .dashboard-shortcuts-card #hivemind-icon-text:empty { display: none; }
#menu-page .dashboard-shortcuts-card #check-game-mode-wrapper { grid-area: 2 / 1; }
#menu-page .dashboard-shortcuts-card #check-live-lessons-wrapper { grid-area: 2 / 2; }
#menu-page .dashboard-shortcuts-card #check-live-sessions-wrapper { grid-area: 2 / 3; }
#menu-page .dashboard-shortcuts-card :is(#check-game-mode-wrapper, #check-live-lessons-wrapper, #check-live-sessions-wrapper) {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 4px 0;
}
#menu-page .dashboard-shortcuts-card p {
    max-width: 100%;
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}
/* Reserve clearance between the card and the separately framed avatar below. */
#menu-page { --dashboard-avatar-top: 224px; }
/* Narrow views retain their existing stacked order. */
.dashboard-overview { display: contents; }
#menu-page .page-container #streak-wheel-main-container.hm-verified-enabled {
    width: min(280px, 100%);
}
/* Let the taller rail set the header height instead of overlapping practice cards. */
@media (min-width: 1101px), (min-width: 961px) and (orientation: landscape) {
    #menu-page .dashboard-overview {
        display: grid;
        grid-template-columns: 280px minmax(0, 1fr) 300px;
        grid-template-rows: repeat(5, auto);
        gap: 0 16px;
        align-items: start;
    }
    #menu-page .dashboard-overview #streak-wheel-main-container {
        position: static;
        grid-column: 1;
        grid-row: 1 / 6;
        margin: 20px 0 0;
    }
    #menu-page .dashboard-overview #top-right-ui-cluster {
        position: static;
        grid-column: 3;
        grid-row: 1 / 4;
    }
    #menu-page .dashboard-overview .dashboard-side-widget-stack {
        position: static;
        grid-column: 3;
        grid-row: 1 / 6;
        justify-self: end;
        margin: var(--dashboard-avatar-top) 10px 0 0;
    }
    #menu-page .dashboard-overview #welcome-message {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
        margin-right: 0;
    }
    #menu-page .dashboard-overview #broadcast-message-area { grid-column: 2; grid-row: 2; }
    #menu-page .dashboard-overview :is(#broadcast-message-area, #live-sessions-display-area):empty {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    #menu-page .dashboard-overview .hivemind-banner-container {
        grid-column: 2;
        grid-row: 3;
        transform: none;
    }
    #menu-page .dashboard-overview .hivemind-banner-branding { max-width: 100%; }
    #menu-page .dashboard-overview #live-sessions-display-area { grid-column: 2; grid-row: 4; }
    #menu-page .dashboard-overview .dashboard-center-feedback-slot {
        grid-column: 2;
        grid-row: 5;
        /* Balance the visible icons between the banner and the practice cards,
           retaining the overview height reserved for the flower and avatar. */
        transform: translateY(-30px);
    }
    #menu-page .dashboard-content-layer > .mode-container { margin-top: 24px; }
}
/* Keep full-width landscape iPads horizontal; stack only portrait/narrow views. */
@media (max-width: 960px), (max-width: 1100px) and (orientation: portrait) {
    #menu-page #top-right-ui-cluster.dashboard-shortcuts-card {
        position: relative !important;
        display: grid !important;
        inset: auto;
        width: min(100%, 340px);
        margin: 0 auto 24px;
    }
    #menu-page #streak-wheel-main-container,
    #menu-page .dashboard-side-widget-stack {
        position: relative !important;
        inset: auto;
        margin: 20px auto;
    }
    #menu-page #streak-wheel-main-container { width: fit-content; max-width: 100%; }
}
@media (min-width: 1101px), (min-width: 961px) and (orientation: landscape) {
    #menu-page #welcome-message {
        margin-left: 240px;
        margin-right: 320px;
    }
}
@media (min-width: 961px) and (max-width: 1100px) and (orientation: landscape) {
    #menu-page .hivemind-banner-branding { max-width: min(58%, calc(100% - 600px)); }
}
