/*
 * Additional responsive tiers for the authenticated dashboard.
 * Loaded after dashboard.css so the compact viewport rules stay isolated.
 */

@media (min-width: 44.01rem) and (max-width: 90rem),
       (min-width: 44.01rem) and (max-height: 62rem) {
    .dashboard-page {
        overflow: hidden;
    }

    .dashboard-page .site-header__inner {
        min-height: 2.9rem;
        padding-block: 0.18rem;
    }

    .dashboard-page .brand__icon {
        width: 1.9rem;
        height: 1.9rem;
    }

    .dashboard-page .brand__wordmark {
        height: 1.35rem;
    }

    .dashboard-page .main-navigation__link,
    .dashboard-page .main-navigation__button {
        min-height: 1.9rem;
        padding: 0.28rem 0.46rem;
        font-size: 0.71rem;
    }

    .dashboard-page .page-shell {
        width: 100%;
        max-width: none;
        height: calc(100dvh - 2.9rem);
        min-height: 0;
        padding: 0.42rem clamp(0.48rem, 1vw, 0.8rem);
        overflow: hidden;
    }

    .dashboard-page .site-footer {
        display: none;
    }

    .teachflow-dashboard {
        height: 100%;
        min-height: 0;
        gap: 0.45rem;
        grid-template-rows: auto auto minmax(10rem, 1fr);
    }

    .teachflow-dashboard__hero {
        padding: 0.62rem 0.8rem;
        grid-template-columns: minmax(0, 1fr) minmax(13rem, auto);
        align-items: center;
        gap: 0.8rem;
        border-radius: 0.85rem;
    }

    .teachflow-dashboard__hero h1 {
        max-width: none;
        margin: 0.15rem 0 0.28rem;
        font-size: clamp(1.3rem, 2.1vw, 1.8rem);
        line-height: 1.05;
        letter-spacing: -0.025em;
    }

    .teachflow-dashboard__lead {
        max-width: 80ch;
        font-size: 0.76rem;
        line-height: 1.3;
    }

    .teachflow-dashboard__date-row {
        margin-top: 0.35rem;
        gap: 0.28rem;
    }

    .teachflow-dashboard__date-row time,
    .teachflow-dashboard__date-row span {
        padding: 0.2rem 0.42rem;
        font-size: 0.65rem;
    }

    .teachflow-dashboard__hero-actions {
        min-width: 0;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.3rem;
    }

    .teachflow-dashboard__hero-actions .button {
        min-height: 1.95rem;
        padding: 0.28rem 0.48rem;
        font-size: 0.7rem;
    }

    .teachflow-dashboard__top-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(13.5rem, 0.62fr);
        gap: 0.45rem;
    }

    .dashboard-day-card,
    .dashboard-panel,
    .dashboard-quote-card {
        border-radius: 0.78rem;
    }

    .dashboard-day-card {
        padding: 0.52rem;
        gap: 0.4rem;
    }

    .dashboard-card-heading {
        gap: 0.45rem;
    }

    .teachflow-dashboard__eyebrow {
        font-size: 0.57rem;
        letter-spacing: 0.07em;
    }

    .dashboard-card-heading h2 {
        margin-top: 0.08rem;
        font-size: 1rem;
    }

    .dashboard-card-heading time,
    .dashboard-card-heading p {
        font-size: 0.62rem;
    }

    .dashboard-day-card__counts {
        gap: 0.08rem;
    }

    .dashboard-day-card__counts span {
        font-size: 0.56rem;
    }

    .dashboard-day-card__counts strong {
        font-size: 0.68rem;
    }

    .dashboard-agenda {
        gap: 0.22rem;
    }

    .dashboard-agenda__item {
        min-height: 1.9rem;
        padding: 0.27rem 0.36rem;
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        gap: 0.34rem;
        border-left-width: 0.18rem;
        border-radius: 0.5rem;
    }

    .dashboard-agenda__time {
        font-size: 0.59rem;
    }

    .dashboard-agenda__kind {
        width: 1.2rem;
        height: 1.2rem;
        border-radius: 0.32rem;
        font-size: 0.52rem;
    }

    .dashboard-agenda__content strong {
        font-size: 0.68rem;
    }

    .dashboard-agenda__content span,
    .dashboard-agenda__location {
        font-size: 0.57rem;
    }

    .dashboard-quote-card {
        min-height: 0;
        padding: 0.72rem;
        gap: 0.45rem;
    }

    .dashboard-quote-card__mark {
        top: -1.5rem;
        font-size: 7rem;
    }

    .dashboard-quote-card h2 {
        margin-top: 0.1rem;
        font-size: 0.92rem;
    }

    .dashboard-quote-card blockquote {
        font-size: 0.82rem;
        line-height: 1.28;
    }

    .dashboard-quote-card > span {
        font-size: 0.55rem;
    }

    .teachflow-dashboard__content-grid {
        min-height: 0;
        grid-template-columns: minmax(15rem, 0.82fr) minmax(0, 1.18fr);
        gap: 0.45rem;
        align-items: stretch;
    }

    .dashboard-panel {
        min-height: 0;
        padding: 0.52rem;
        gap: 0.38rem;
        overflow: hidden;
    }

    .dashboard-card-heading--panel {
        align-items: flex-end;
    }

    .dashboard-card-heading--panel > a {
        font-size: 0.58rem;
    }

    .dashboard-week-list,
    .dashboard-exam-list {
        min-height: 0;
        max-height: none;
        gap: 0.2rem;
        overflow: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    .dashboard-week-list__item,
    .dashboard-exam-list__item {
        min-height: 2rem;
        padding: 0.3rem 0.38rem;
        gap: 0.38rem;
        border-radius: 0.48rem;
    }

    .dashboard-week-list__item {
        grid-template-columns: minmax(4.6rem, auto) minmax(0, 1fr) auto;
    }

    .dashboard-exam-list__item {
        grid-template-columns: auto minmax(6.8rem, auto) minmax(0, 1fr) auto;
    }

    .dashboard-week-list__date,
    .dashboard-week-list__meta strong,
    .dashboard-exam-list__date strong {
        font-size: 0.58rem;
    }

    .dashboard-week-list__content strong,
    .dashboard-exam-list__content strong {
        font-size: 0.67rem;
    }

    .dashboard-week-list__content span,
    .dashboard-week-list__meta span,
    .dashboard-exam-list__content span,
    .dashboard-exam-list__date span {
        font-size: 0.55rem;
    }

    .dashboard-exam-list__number {
        width: 1.2rem;
        height: 1.2rem;
        border-radius: 0.32rem;
        font-size: 0.52rem;
    }

    .dashboard-exam-list__arrow {
        font-size: 0.95rem;
    }

    .dashboard-empty-state {
        padding: 0.7rem 0.55rem;
    }

    .dashboard-empty-state strong {
        font-size: 0.75rem;
    }

    .dashboard-empty-state p {
        margin-top: 0.18rem;
        font-size: 0.62rem;
        line-height: 1.3;
    }
}

@media (min-width: 44.01rem) and (max-width: 82rem),
       (min-width: 44.01rem) and (max-height: 52rem) {
    .teachflow-dashboard__lead {
        display: none;
    }

    .teachflow-dashboard__hero-eyebrow {
        display: none;
    }
}

@media (min-width: 44.01rem) and (max-width: 70rem) {
    .teachflow-dashboard {
        grid-template-rows: auto auto minmax(9.5rem, 1fr);
    }

    .teachflow-dashboard__hero {
        padding: 0.45rem 0.58rem;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.5rem;
    }

    .teachflow-dashboard__hero h1 {
        margin: 0 0 0.18rem;
        font-size: clamp(1.08rem, 2.4vw, 1.38rem);
    }

    .teachflow-dashboard__date-row {
        margin-top: 0.18rem;
    }

    .teachflow-dashboard__hero-actions {
        display: block;
    }

    .teachflow-dashboard__hero-actions .button {
        width: auto;
        min-height: 1.8rem;
        padding-inline: 0.55rem;
        white-space: nowrap;
    }

    .dashboard-action--tablet-hidden {
        display: none !important;
    }

    .teachflow-dashboard__top-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-quote-card {
        display: none;
    }

    .dashboard-card-heading--panel > a,
    .dashboard-card-heading--panel p {
        display: none;
    }

    .dashboard-panel {
        padding: 0.44rem;
    }

    .dashboard-week-list__item {
        grid-template-columns: minmax(4.2rem, auto) minmax(0, 1fr) auto;
    }

    .dashboard-exam-list__item {
        grid-template-columns: minmax(6.5rem, auto) minmax(0, 1fr) auto;
    }

    .dashboard-exam-list__number,
    .dashboard-exam-list__arrow {
        display: none;
    }
}

@media (min-width: 44.01rem) and (max-width: 70rem) and (max-height: 52rem) {
    .dashboard-page .page-shell {
        padding-block: 0.3rem;
    }

    .teachflow-dashboard {
        gap: 0.32rem;
        grid-template-rows: auto auto minmax(8.5rem, 1fr);
    }

    .teachflow-dashboard__hero {
        padding-block: 0.32rem;
    }

    .teachflow-dashboard__date-row time,
    .teachflow-dashboard__date-row span {
        padding-block: 0.14rem;
    }

    .dashboard-day-card {
        padding: 0.42rem;
        gap: 0.28rem;
    }

    .dashboard-agenda {
        gap: 0.14rem;
    }

    .dashboard-agenda__item {
        min-height: 1.62rem;
        padding-block: 0.18rem;
    }

    .dashboard-agenda__content > span {
        display: none;
    }

    .dashboard-panel {
        padding: 0.35rem;
        gap: 0.25rem;
    }

    .dashboard-week-list__item,
    .dashboard-exam-list__item {
        min-height: 1.72rem;
        padding-block: 0.2rem;
    }
}

@media (max-width: 44rem) {
    .dashboard-page {
        overflow: auto;
    }

    .dashboard-page .page-shell {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .dashboard-page .site-footer {
        display: block;
    }

    .teachflow-dashboard {
        height: auto;
        min-height: 0;
        grid-template-rows: none;
    }

    .teachflow-dashboard__top-grid,
    .teachflow-dashboard__content-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-quote-card {
        display: grid;
    }

    .dashboard-action--tablet-hidden {
        display: inline-flex;
    }

    .dashboard-week-list,
    .dashboard-exam-list {
        max-height: none;
        overflow: visible;
    }
}

/*
 * Prevent browser-specific invisible horizontal overflow on the mobile
 * dashboard. This stylesheet is loaded only on the dashboard page.
 */
@media (max-width: 44rem) {
    html,
    body.dashboard-page {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }
}
