/* Shared app layouts apply at every screen width; narrow-screen refinements
   remain responsive. Desktop sizing is defined at the end of this file. */
.mobile-app-tabs, .mobile-app-brand{ display: none; }
.mobile-app-header-actions { display: flex; align-items: center; gap: 10px; }
body.maxprogress-app .client-dashboard-start-card { padding: 24px; text-align: left; }
.mobile-home-hero-top { display: flex; align-items: center; justify-content: space-between; }
.mobile-home-eyebrow { color: #a0a0a0; font-size: .7rem; font-weight: 750; letter-spacing: .16em; }
.mobile-home-symbol { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #383838; border-radius: 14px; }
.mobile-home-symbol .ui-icon { width: 22px; height: 22px; }
body.maxprogress-app .client-dashboard-start-card h1 { margin: 14px 0 6px; font-size: clamp(2rem, 7vw, 3rem); line-height: 1.02; letter-spacing: -.045em; }
body.maxprogress-app .client-dashboard-start-card p { margin: 0 0 24px; font-size: 1rem; color: #aaa; }
body.maxprogress-app .client-dashboard-start-card .hero-main-action { min-height: 56px; gap: 12px; border-radius: 16px; background: #fff; color: #080808; }
body.maxprogress-app .client-dashboard-start-card .hero-main-action .ui-icon { width: 22px; height: 22px; }
body.maxprogress-app .client-dashboard-start-card .hero-main-action .ui-icon:last-child { margin-left: auto; }
body.maxprogress-app .client-dashboard-start-card .hero-main-action span { margin-right: auto; }

@media screen {
    html { scroll-padding-top: calc(76px + env(safe-area-inset-top, 0px)); }
    body.maxprogress-app.shell-nav-present {
        --mobile-tab-height: 72px;
        --mobile-tab-space: calc(var(--mobile-tab-height) + env(safe-area-inset-bottom, 0px));
        color-scheme: dark;
        overscroll-behavior-y: none;
    }
    body.maxprogress-app.shell-nav-present .app-shell,
    body.maxprogress-app.shell-nav-present.portal-role .app-shell {
        width: 100%; max-width: 100%; margin: 0; min-height: 100svh;
        padding: calc(76px + env(safe-area-inset-top, 0px)) 16px calc(var(--mobile-tab-space) + 24px);
    }
    body.maxprogress-app.shell-nav-present .app-main { width: 100%; min-width: 0; padding: 0; }
    body.maxprogress-app.shell-nav-present .shell-menu-header,
    body.maxprogress-app.shell-nav-present .dashboard-home-shell .shell-menu-header {
        position: fixed; inset: 0 0 auto; z-index: 100;
        display: flex; align-items: center; justify-content: space-between;
        width: 100%; max-width: none; height: calc(64px + env(safe-area-inset-top, 0px));
        margin: 0; padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
        border: 0; border-bottom: 1px solid #202020; border-radius: 0;
        background: rgba(8,8,8,.96); backdrop-filter: blur(18px); transform: none;
    }
    .mobile-app-brand { display: block; color: #fff; font-size: 1.2rem; font-weight: 800; letter-spacing: -.025em; text-decoration: none; } body.maxprogress-app.shell-nav-present .shell-mobile-drawer-toggle {
        position: relative; display: grid; place-items: center; width: 44px; height: 44px;
        min-width: 44px; min-height: 44px; margin: 0; padding: 11px;
        border: 1px solid #292929; border-radius: 15px; color: #fff; background: #151515; box-shadow: none;
    }
    body.maxprogress-app .mobile-app-tabs {
        position: fixed; inset: auto 0 0; z-index: 110; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
        height: var(--mobile-tab-space); padding: 8px max(6px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(6px, env(safe-area-inset-left, 0px));
        border-top: 1px solid #292929; background: rgba(16,16,16,.97); backdrop-filter: blur(20px);
    }
    body.maxprogress-app .mobile-app-tab {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
        min-width: 0; min-height: 56px; padding: 0 2px 5px; border: 0; border-radius: 14px;
        background: transparent; color: #858585; text-decoration: none; font-size: .66rem; font-weight: 700; line-height: 1; text-transform: none; letter-spacing: .01em;
    }
    .mobile-app-tab-icon { display: grid; place-items: center; width: 48px; height: 29px; border-radius: 11px; }
    .mobile-app-tab .ui-icon { width: 22px; height: 22px; stroke-width: 1.8; }
    body.maxprogress-app .mobile-app-tab.is-active { color: #fff; }
    .mobile-app-tab.is-active .mobile-app-tab-icon { background: #303030; }
    .mobile-app-tab:active { background: #242424; transform: scale(.96); }
    .mobile-app-tab:focus-visible{ outline: 2px solid #fff; outline-offset: -2px; }
    body.maxprogress-app.shell-nav-present .shell-mobile-drawer {
        z-index: 151; top: auto; right: 8px; bottom: max(8px, env(safe-area-inset-bottom, 0px)); left: 8px;
        width: auto; max-width: none; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 32px);
        padding: 24px 20px; border: 1px solid #353535; border-radius: 28px; background: #171717;
        overflow-y: auto; overscroll-behavior: contain; transform: translateY(110%); visibility: hidden;
        transition: transform .22s ease, visibility .22s;
    }
    body.maxprogress-app.shell-nav-present .shell-mobile-drawer.is-open { transform: translateY(0); visibility: visible; }
    body.maxprogress-app.shell-nav-present .shell-mobile-drawer-backdrop { z-index: 150; background: rgba(0,0,0,.65); }
    body.maxprogress-app.shell-nav-present .shell-drawer-link { min-height: 52px; border-radius: 14px; }
    body.maxprogress-app.shell-nav-present :where(.minimal-dashboard, .minimal-workspace, .page-shell, .history-shared-page, .progress-hub-shell, .account-shell) {
        width: 100%; min-width: 0; margin: 0; padding: 0;
    }
    body.maxprogress-app.shell-nav-present :where(h1) { font-size: clamp(1.65rem, 6.5vw, 2.2rem); line-height: 1.08; letter-spacing: -.035em; overflow-wrap: anywhere; }
    body.maxprogress-app.shell-nav-present :where(h2, h3) { letter-spacing: -.02em; }
    body.maxprogress-app.shell-nav-present :where(.minimal-header, .page-header, .history-hero) { margin-bottom: 22px; }
    body.maxprogress-app.shell-nav-present :where(.minimal-panel, .history-session, .card, .minimal-hero-card) { border-radius: 22px; }
    body.maxprogress-app.shell-nav-present :where(input:not([type='checkbox']):not([type='radio']):not([type='hidden']), select, textarea) { font-size: 16px; }
    body.maxprogress-app.shell-nav-present :where(.btn, .icon-button) { min-height: 44px; }
    body.maxprogress-app.shell-nav-present :where(.minimal-grid.two-col, .client-dashboard-primary-grid, .client-dashboard-secondary-grid, .client-profile-data-grid, .account-grid) { grid-template-columns: minmax(0,1fr); }
    body.maxprogress-app .minimal-dashboard-portal { display: grid; gap: 24px; }
    body.maxprogress-app .client-dashboard-start-card { margin: 0; padding: 22px; border: 1px solid #2c2c2c; border-radius: 26px; background: linear-gradient(140deg,#222,#121212 75%); }
    body.maxprogress-app .client-dashboard-start-card h1 { margin: 12px 0 6px; font-size: clamp(2.15rem, 8.5vw, 3rem); }
    body.maxprogress-app .client-dashboard-primary-grid, body.maxprogress-app .client-dashboard-secondary-grid { display: grid; gap: 24px; margin: 0; }
    body.maxprogress-app .minimal-dashboard-portal .minimal-section { margin: 0; padding: 0; }
    body.maxprogress-app .minimal-dashboard-portal .minimal-section-head { margin-bottom: 12px; }
    body.maxprogress-app .minimal-dashboard-portal .minimal-section-head h3 { font-size: 1.15rem; }
    body.maxprogress-app .trainer-analysis-attendance, body.maxprogress-app .client-dashboard-exercise-card, body.maxprogress-app .running-dashboard-panel { padding: 20px; border: 0 !important; background: #151515 !important; border-radius: 22px; }
    body.maxprogress-app .client-activity-calendar-grid { max-width: none; }
    body.maxprogress-app .client-activity-calendar-grid .trainer-attendance-day.is-done,
    body.maxprogress-app .client-activity-calendar-grid .trainer-attendance-day.is-record { color: #fff !important; background: #303030 !important; }
    body.maxprogress-app .client-activity-calendar-grid .trainer-attendance-day::after { background: #fff; border-color: #fff; }
    body.maxprogress-app .workout-start-heading { margin-bottom: 24px; }
    body.maxprogress-app .workout-start-picker { gap: 28px; }
    body.maxprogress-app .workout-start-section h2 { margin-bottom: 12px; font-size: 1.08rem; }
    body.maxprogress-app .workout-start-plan-button { min-height: 84px; padding: 16px; border-radius: 20px; background: #171717; border: 1px solid #303030; }
    body.maxprogress-app .workout-start-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    body.maxprogress-app .workout-start-action-button { min-height: 178px; padding: 20px 14px; border: 1px solid #303030; border-radius: 24px; background: #171717; }
    body.maxprogress-app .workout-start-action-button strong { font-size: 1.15rem; }
    body.maxprogress-app .client-profile-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
    body.maxprogress-app .client-profile-tab { flex: 0 0 auto; min-width: 80px; padding: 14px; border-radius: 16px; }
    body.maxprogress-app .minimal-chip-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
    body.maxprogress-app .minimal-chip { flex: 0 0 auto; min-height: 44px; }
    body.maxprogress-app .history-stats-grid { gap: 10px; }
    body.maxprogress-app .history-stat-card { min-width: 0; padding: 16px; border-radius: 18px; }
    body.maxprogress-app .history-summary { padding: 16px; gap: 10px; }
    body.maxprogress-app .history-summary h3 { font-size: 1rem; line-height: 1.2; }
    body.maxprogress-app .history-body { padding: 0 14px 16px; }
    body.maxprogress-app .history-training-table-wrap { max-width: 100%; overflow-x: auto; }
    body.maxprogress-app .cookie-consent { bottom: calc(var(--mobile-tab-space) + 10px); max-height: 65dvh; overflow-y: auto; }
    body.maxprogress-app.workout-bottom-active .mobile-app-tabs,
    body.maxprogress-app.trainer-live-active .mobile-app-tabs,
    body.maxprogress-app.embedded-group-live .mobile-app-tabs,
    body.workout-summary-open .mobile-app-tabs,
    html.is-keyboard-open .mobile-app-tabs { display: none; }
    body.maxprogress-app.embedded-group-live .shell-menu-header { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .mobile-app-tab, body.maxprogress-app.shell-nav-present .shell-mobile-drawer { transition: none; }
}

@media screen {
    body.maxprogress-app.shell-nav-present .minimal-workspace { padding-top: 0; }
    body.maxprogress-app.shell-nav-present .shell-mobile-drawer-toggle { display: none; }
    body.maxprogress-app .workout-start-heading { margin-bottom: 6px; text-align: left; }
    body.maxprogress-app .workout-start-picker { margin-top: 12px; }
    body.maxprogress-app .workout-start-section h2 { text-align: left; }
    body.maxprogress-app .workout-start-heading h1 { font-size: 1.8rem; }
}

@media screen {
    body.maxprogress-app .running-simple-form .running-simple-actions .btn { width: 100%; min-height: 54px; border-radius: 16px; }
}
@media screen {
    body.maxprogress-app .client-profile-page { gap: 20px; }
    body.maxprogress-app .client-profile-page .client-profile-header { margin-bottom: 0; }
    body.maxprogress-app .client-profile-page .client-profile-tabs { gap: 8px; margin: 0; }
    body.maxprogress-app .client-profile-page .client-profile-tab {
        flex-direction: column; justify-content: center; gap: 6px; min-width: 78px; min-height: 74px; padding: 10px 12px;
        border: 1px solid #292929 !important; border-radius: 18px; background: #171717 !important;
    }
    body.maxprogress-app .client-profile-page .client-profile-tab.is-active { border-color: #777 !important; background: #292929 !important; box-shadow: none !important; }
    body.maxprogress-app .client-profile-page .client-profile-tab-icon { width: 26px; height: 26px; padding: 0; background: transparent; }
    body.maxprogress-app .client-profile-page .client-profile-tab strong { font-size: .75rem; }
    body.maxprogress-app .client-profile-page .client-profile-panel .minimal-panel { padding: 18px; }
    body.maxprogress-app.shell-nav-present .shell-nav-counter { background: #fff; color: #080808; }
}
@media screen {
    body.maxprogress-app .running-simple-form .workout-clean-finish-btn { min-height: 54px; border-radius: 16px; }
}

/* The home screen starts directly with the training action. */
@media screen {
    body.maxprogress-app.shell-nav-present .mobile-home-header { display: none; }
    body.maxprogress-app.shell-nav-present .dashboard-home-shell {
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
    }
    body.maxprogress-app .client-dashboard-start-card {
        padding: 0; border: 0; background: transparent; border-radius: 16px;
    }
}
@media screen {
    body.maxprogress-app.shell-nav-present .app-shell .shell-menu-header.mobile-home-header { display: none; }
    body.maxprogress-app.shell-nav-present.portal-role .app-shell.dashboard-home-shell { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
    body.maxprogress-app .minimal-dashboard-portal .client-dashboard-start-card { padding: 0; border: 0; background: transparent; }
}

@media screen {
    body.maxprogress-app .minimal-dashboard-portal .client-dashboard-start-card { display: none; }
    body.maxprogress-app .mobile-app-tab.mobile-app-tab-start {
        position: relative; justify-content: flex-start; gap: 8px; overflow: visible;
        margin-top: -24px; padding-top: 0; color: #fff;
    }
    body.maxprogress-app .mobile-app-tab-start .mobile-app-tab-icon {
        flex: 0 0 54px; width: 54px; height: 54px; border-radius: 50%;
        background: #fff; color: #080808; box-shadow: 0 0 0 6px #101010;
    }
    body.maxprogress-app .mobile-app-tab-start .ui-icon { width: 26px; height: 26px; stroke-width: 2; }
    body.maxprogress-app .mobile-app-tab-start > span:last-child { font-size: .65rem; white-space: nowrap; }
    body.maxprogress-app .mobile-app-tab-start:active { transform: scale(.94); background: transparent; }
}
/* Compact secondary tools: details stay available without filling the screen. */
.mobile-calendar-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mobile-calendar-summary span { color: #a0a0a0; font-size: .85rem; }
.mobile-secondary-panel, .mobile-account-overview { border: 1px solid #303030; border-radius: 20px; padding: 16px; background: #151515; }
.mobile-secondary-panel > summary, .mobile-account-overview > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 750; list-style: none; }
.mobile-secondary-panel > summary::after, .mobile-account-overview > summary::after { content: '+'; color: #aaa; font-size: 1.3rem; }
.mobile-secondary-panel[open] > summary::after, .mobile-account-overview[open] > summary::after { content: '−'; }
.mobile-secondary-panel[open] > summary, .mobile-account-overview[open] > summary { margin-bottom: 16px; }
.mobile-secondary-panel .running-dashboard-section { margin: 0; }
@media screen {
    body.maxprogress-app.shell-nav-present.portal-role .app-shell.portal-shell {
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(var(--mobile-tab-space) + 36px);
    }
    body.maxprogress-app.portal-role .shell-menu-header { display: none !important; }
    body.maxprogress-app.portal-role :where(.minimal-workspace, .workout-session-stack, .plan-overview-shell, .portal-data-page, .progress-hub-shell) { min-width: 0; max-width: 100%; margin-top: 0; }
    body.maxprogress-app.portal-role :where(.minimal-header, .history-hero, .workout-start-heading) { min-height: 0; padding: 0; margin: 0 0 20px; }
    body.maxprogress-app.portal-role :where(.minimal-header h1, .history-hero h1, .app-hero h1) { margin: 0; font-size: 1.8rem; line-height: 1.12; }
    body.maxprogress-app.portal-role .mobile-account-page > .minimal-header .static-icon { display: none; }
    body.maxprogress-app.portal-role .minimal-header > div > p.hint { display: none; }
    body.maxprogress-app.portal-role :where(.form-grid, .running-summary-grid, .running-feedback-grid, .running-chart-grid, .measurements-chart-grid, .portal-glory-grid.three-col, .client-dashboard-calendar-layout) { grid-template-columns: minmax(0, 1fr); }
    body.maxprogress-app.portal-role .client-profile-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); overflow: visible; }
    body.maxprogress-app.portal-role .client-profile-page .client-profile-tab { min-width: 0; }
    body.maxprogress-app.portal-role :where(.portal-data-card, .portal-glory-section, .plan-minimal-card, .plan-calendar-panel, .running-summary-card) { padding: 18px; border-radius: 22px; }
    body.maxprogress-app.portal-role :where(.portal-data-hero, .progress-hero-card) { padding: 0; border: 0 !important; background: transparent !important; }
    body.maxprogress-app.portal-role :where(.minimal-action-row-wrap, .section-head, .portal-glory-section-head) { gap: 10px; flex-wrap: wrap; }
    body.maxprogress-app.portal-role :where(.minimal-action-row-wrap .btn, .running-summary-actions .btn) { flex: 1 1 auto; }
    body.maxprogress-app.portal-role .history-stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0 0 18px; }
    body.maxprogress-app.portal-role .history-stat-card { min-height: 0; padding: 12px; border-radius: 16px; }
    body.maxprogress-app.portal-role .history-stat-card small { display: none; }
    body.maxprogress-app.portal-role .history-stat-mark { display: none; }
    body.maxprogress-app.portal-role .history-stat-label { font-size: .72rem; }
    body.maxprogress-app.portal-role .history-list { display: grid; gap: 10px; }
    body.maxprogress-app.portal-role .history-summary-mark { width: 32px; height: 32px; flex: 0 0 32px; }
    body.maxprogress-app.portal-role .history-summary-meta { font-size: .72rem; flex-wrap: wrap; }
    body.maxprogress-app.portal-role .history-summary-action { padding: 8px; min-width: 44px; min-height: 44px; }
    body.maxprogress-app.portal-role .history-summary-action > span:last-child,
    body.maxprogress-app.portal-role .summary-toggle-label { display: none; }
    body.maxprogress-app.portal-role .mobile-record-table { display: block; width: 100%; min-width: 0; border: 0; }
    body.maxprogress-app.portal-role .mobile-record-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    body.maxprogress-app.portal-role .mobile-record-table tbody { display: grid; gap: 12px; }
    body.maxprogress-app.portal-role .mobile-record-table tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 16px; border: 1px solid #303030; border-radius: 18px; background: #171717; }
    body.maxprogress-app.portal-role .mobile-record-table td { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; font-size: .9rem; }
    body.maxprogress-app.portal-role .mobile-record-table td::before { content: attr(data-mobile-label); color: #999; font-size: .7rem; font-weight: 600; }
    body.maxprogress-app.portal-role .mobile-record-table td:first-child,
    body.maxprogress-app.portal-role .mobile-record-table td[colspan] { grid-column: 1 / -1; }
    body.maxprogress-app.portal-role .portal-data-table-wrap { overflow: visible; }
    body.maxprogress-app.portal-role .plan-summary-strip { grid-template-columns: 1fr 1fr; gap: 10px; }
    body.maxprogress-app.portal-role .plan-summary-card { min-width: 0; padding: 14px; }
    body.maxprogress-app.portal-role .plan-calendar-grid { min-width: 0; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; }
    body.maxprogress-app.portal-role .plan-calendar-day { min-width: 0; min-height: 76px; padding: 5px 3px; border-radius: 10px; }
    body.maxprogress-app.portal-role .plan-calendar-item { min-width: 0; padding: 4px; }
    body.maxprogress-app.portal-role .plan-calendar-item strong { font-size: .63rem; overflow-wrap: anywhere; }
    body.maxprogress-app.portal-role .plan-calendar-item span { display: none; }
    body.maxprogress-app.portal-role .client-schedule-week-panel { display: none; }
    body.maxprogress-app.portal-role .running-dashboard-metrics { grid-template-columns: 1fr 1fr; gap: 12px; }
    body.maxprogress-app.portal-role .running-dashboard-insights { grid-template-columns: 1fr; gap: 14px; }
    body.maxprogress-app.portal-role :where( .running-segment-item, .running-simple-card) { padding: 18px; border-radius: 22px; }
    body.maxprogress-app.portal-role .mobile-account-page > .minimal-grid { display: flex; flex-direction: column; gap: 16px; }
    body.maxprogress-app.portal-role .mobile-account-overview { order: 2; padding: 12px 16px; }
    body.maxprogress-app.portal-role .minimal-chip-nav { gap: 6px; }
    body.maxprogress-app.portal-role .minimal-chip { padding: 10px 14px; }
    body.maxprogress-app.portal-role .client-profile-panel { min-width: 0; }
}
@media screen {
    body.maxprogress-app .client-activity-calendar-grid { width: 100% !important; max-width: none !important; }
    body.maxprogress-app .client-activity-calendar-grid .trainer-attendance-day.is-done::after,
    body.maxprogress-app .client-activity-calendar-grid .trainer-attendance-day.is-record::after { background: #fff !important; border-color: #fff !important; }
    body.maxprogress-app.portal-role .client-profile-chart-grid { display: grid; grid-template-columns: 1fr; }
    body.maxprogress-app.portal-role .mobile-secondary-panel .minimal-panel-head { margin-top: 12px; }
}
@media screen {
    body.maxprogress-app.portal-role .client-profile-page .mobile-secondary-panel,
    body.maxprogress-app.portal-role .mobile-account-overview {
        display: block; min-height: 0; height: auto; margin: 0; padding: 12px 16px;
        border: 1px solid #303030 !important; border-radius: 18px; background: #151515 !important;
    }
    body.maxprogress-app.portal-role .client-profile-page .mobile-secondary-panel > summary { min-height: 44px; margin: 0; }
    body.maxprogress-app.portal-role .client-profile-page .mobile-secondary-panel[open] > summary { margin-bottom: 16px; }
    body.maxprogress-app.portal-role .client-profile-panel > .minimal-grid { gap: 12px; }
}
@media screen {
    body.maxprogress-app.portal-role .history-shared-page { display: grid; gap: 16px; }
    body.maxprogress-app.portal-role .history-hero { display: block; min-height: 0; margin: 0; padding: 0 !important; border: 0 !important; background: transparent !important; text-align: left; }
    body.maxprogress-app.portal-role .history-hero-copy { padding: 0; text-align: left; }
    body.maxprogress-app.portal-role .history-stats-grid { margin: 0; }
    body.maxprogress-app.portal-role .history-session { min-height: 0; padding: 0 !important; margin: 0; border-radius: 18px; }
    body.maxprogress-app.portal-role .history-summary { display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between; min-height: 86px; padding: 14px !important; gap: 10px; }
    body.maxprogress-app.portal-role .history-summary-main { flex: 1; min-width: 0; margin: 0; }
    body.maxprogress-app.portal-role .history-summary-main h3 { margin: 0 0 6px; }
    body.maxprogress-app.portal-role .history-summary-actions { display: flex; flex-direction: row; align-items: center; flex: 0 0 auto; gap: 6px; width: auto; margin: 0; }
    body.maxprogress-app.portal-role .history-summary-action { width: 40px; min-width: 40px; height: 44px; min-height: 44px; padding: 8px; }
    body.maxprogress-app.portal-role .summary-toggle { width: 32px; min-width: 32px; height: 36px; padding: 8px; margin: 0; }
}
@media screen {
    body.maxprogress-app.portal-role .mobile-account-page { display: grid; gap: 18px; }
    body.maxprogress-app.portal-role .mobile-account-page > .minimal-header { margin: 0; }
    body.maxprogress-app.portal-role .mobile-account-page .minimal-header h1 { font-size: 1.8rem; }
    body.maxprogress-app.portal-role .mobile-account-page .minimal-chip-nav { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 6px; margin: 0; padding-bottom: 4px; overflow-x: auto; }
    body.maxprogress-app.portal-role .mobile-account-page .minimal-chip { display: flex; flex: 0 0 auto; align-items: center; width: auto; min-height: 44px; padding: 10px 14px; border-radius: 14px; white-space: nowrap; }
}

@media screen {
    body.maxprogress-app.shell-nav-present .shell-drawer-link.shell-drawer-tab-duplicate { display: none; }
}
body.maxprogress-app .calendar-day-hint { margin: 0 0 12px; color: #999; font-size: .8rem; line-height: 1.4; }
body.maxprogress-app .client-activity-calendar-grid .calendar-day-link { display: grid; place-items: center; min-height: 44px; color: inherit; text-decoration: none; cursor: pointer; touch-action: manipulation; }
body.maxprogress-app .calendar-day-link:hover { background: #242424 !important; color: #fff !important; }
body.maxprogress-app .calendar-day-link:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
body.maxprogress-app .day-history-actions { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 18px; }
body.maxprogress-app .day-history-actions a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; border: 1px solid #303030; border-radius: 14px; color: #ddd; text-decoration: none; font-size: .85rem; }
body.maxprogress-app .calendar-selected-day[hidden] { display: none !important; }
body.maxprogress-app .calendar-selected-day { margin-top: 18px; padding-top: 16px; border-top: 1px solid #303030; }
body.maxprogress-app .calendar-selected-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
body.maxprogress-app .calendar-selected-heading strong { font-size: .9rem; }
body.maxprogress-app .calendar-selected-heading a { display: inline-flex; align-items: center; min-height: 44px; color: #aaa; font-size: .75rem; text-decoration: none; }
body.maxprogress-app .calendar-activity-icons { display: flex; flex-wrap: wrap; gap: 16px; }
body.maxprogress-app .calendar-activity-chip { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100px; padding: 4px; border-radius: 14px; text-align: center; text-decoration: none; color: #ddd; font-size: .75rem; line-height: 1.25; }
body.maxprogress-app .calendar-activity-symbols { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
body.maxprogress-app .calendar-activity-symbol { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #444; border-radius: 50%; color: #fff; background: #252525; }
body.maxprogress-app .calendar-activity-symbol .ui-icon { width: 24px; height: 24px; stroke-width: 1.7; }
body.maxprogress-app .calendar-activity-chip:hover .calendar-activity-symbol { border-color: #fff; }
body.maxprogress-app .calendar-activity-chip:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
body.maxprogress-app .client-activity-calendar-grid .calendar-day-link.is-selected { background: #fff !important; color: #080808 !important; }
body.maxprogress-app .client-activity-calendar-grid .calendar-day-link.is-selected::after { background: #080808 !important; border-color: #080808 !important; }
body.maxprogress-app .calendar-day-empty { margin: 0; color: #aaa; font-size: .85rem; }
body.maxprogress-app .calendar-selected-day { scroll-margin-bottom: calc(var(--mobile-tab-space, 80px) + 28px); }
/* Activity calendar: completed days carry their sport icon directly in the grid. */
body.maxprogress-app .trainer-attendance-grid.client-activity-calendar-grid {
    column-gap: 6px !important; row-gap: 16px !important; padding: 12px 0;
}
body.maxprogress-app .client-activity-calendar-grid .calendar-day-link {
    position: relative; justify-self: center; width: clamp(32px, 9vw, 46px) !important;
    height: clamp(32px, 9vw, 46px) !important; min-height: 0; padding: 0;
    border: 1px solid transparent; border-radius: 50%; background: #232323 !important;
    color: #ddd !important; font-size: 1rem; font-weight: 500;
}
body.maxprogress-app .client-activity-calendar-grid .calendar-day-link::after { display: none; }
body.maxprogress-app .client-activity-calendar-grid .calendar-day-link.has-workout {
    background: #fff !important; color: #090909 !important;
}
body.maxprogress-app .calendar-grid-activity-icon { width: 25px; height: 25px; color: #090909; stroke-width: 1.9; }
body.maxprogress-app .client-activity-calendar-grid .calendar-day-link.is-selected {
    outline: 2px solid #aaa; outline-offset: 4px;
}
body.maxprogress-app .client-activity-calendar-grid .calendar-day-link:not(.has-workout).is-selected { background: #373737 !important; color: #fff !important; }
body.maxprogress-app .client-activity-calendar-grid .calendar-day-link:hover { outline: 1px solid #777; outline-offset: 3px; }
body.maxprogress-app .calendar-more-workouts {
    position: absolute; top: -3px; right: -3px; display: grid; place-items: center;
    min-width: 16px; height: 16px; border: 2px solid #151515; border-radius: 50%;
    background: #fff; color: #080808; font-size: 9px; font-weight: 800;
}
body.maxprogress-app .client-activity-calendar-weekdays { font-size: .72rem; color: #999; }
body.maxprogress-app .trainer-attendance-grid.client-activity-calendar-grid,
body.maxprogress-app .client-activity-calendar-weekdays { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; width: 100%; }
body.maxprogress-app .client-activity-calendar-weekdays { column-gap: 6px; }
body.maxprogress-app .client-activity-calendar-weekdays { max-width: none !important; }
/* Compact phone calendar: the month remains visible above the bottom navigation. */
@media screen {
    body.maxprogress-app .client-dashboard-calendar-section > .minimal-section-head { margin-bottom: 10px; }
    body.maxprogress-app .client-dashboard-calendar-section > .minimal-section-head h3 { font-size: 1rem; }
    body.maxprogress-app .client-dashboard-calendar-section .trainer-analysis-attendance { padding: 14px !important; border-radius: 20px; }
    body.maxprogress-app .mobile-calendar-summary { margin-bottom: 8px; }
    body.maxprogress-app .mobile-calendar-summary strong { font-size: .9rem; }
    body.maxprogress-app .mobile-calendar-summary span { font-size: .7rem; }
    body.maxprogress-app .calendar-day-hint { margin-bottom: 8px; font-size: .7rem; }
    body.maxprogress-app .client-activity-calendar-weekdays { margin: 8px 0 4px; font-size: .62rem; }
    body.maxprogress-app .trainer-attendance-grid.client-activity-calendar-grid { column-gap: 4px !important; row-gap: 6px !important; padding: 6px 0; }
    body.maxprogress-app .client-activity-calendar-grid .calendar-day-link {
        width: 32px !important; height: 32px !important; min-height: 0 !important;
        font-size: .8rem; border-radius: 50%;
    }
    body.maxprogress-app .calendar-grid-activity-icon { width: 19px; height: 19px; stroke-width: 1.8; }
    body.maxprogress-app .calendar-more-workouts { min-width: 13px; height: 13px; font-size: 8px; }
    body.maxprogress-app .client-activity-calendar-grid .calendar-day-link.is-selected { outline-offset: 2px; }
    body.maxprogress-app .calendar-selected-day { margin-top: 12px; padding-top: 10px; }
    body.maxprogress-app .calendar-selected-heading { margin-bottom: 6px; }
    body.maxprogress-app .calendar-activity-icons { gap: 10px; }
    body.maxprogress-app .calendar-activity-chip { width: 80px; gap: 6px; font-size: .7rem; }
    body.maxprogress-app .calendar-activity-symbol { width: 34px; height: 34px; }
    body.maxprogress-app .calendar-activity-symbol .ui-icon { width: 20px; height: 20px; }
}
body.maxprogress-app img.sport-icon { display: block; flex: 0 0 auto; width: 24px; height: 24px; object-fit: contain; }
body.maxprogress-app .calendar-day-link.has-workout img.sport-icon { width: 22px; height: 22px; }
body.maxprogress-app .calendar-activity-symbol img.sport-icon { width: 26px; height: 26px; filter: invert(1); }
body.maxprogress-app .history-summary-mark.history-sport-mark { display: grid; place-items: center; min-width: 38px; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #080808; }
body.maxprogress-app .history-sport-mark img.sport-icon { width: 28px; height: 28px; }
