/* Desktop workspace adaptation. The established compact shell remains the tablet/mobile experience. */
.desktop-brand{display:none}
.app-shell .bottom-nav>a.desktop-brand{display:none}
.profile-account a.button{color:#fff}
.brand img{display:block;width:clamp(168px,24vw,218px);height:auto}
.site-footer img{display:block;width:min(184px,54vw);height:auto}
.app-wordmark{display:flex;flex:none;align-items:center;width:clamp(132px,38vw,174px);line-height:0}
.app-wordmark img{display:block;width:100%;height:auto}
.home-header-title{display:none}
.app-shell .users-page>.detail-header{position:static;top:auto;z-index:auto;background:transparent;backdrop-filter:none}
.workout-page #workout-status.status-loading{display:flex;align-items:center;justify-content:center;gap:13px;width:min(100%,440px);min-height:86px;margin:clamp(30px,9vh,96px) auto;padding:20px 24px;border:1px solid #e2eae5;border-radius:16px;background:#fff;box-shadow:0 8px 28px #193b3408;color:#536761;font-size:14px;font-weight:550;line-height:1.45}
.workout-loading-spinner{display:block;flex:none;width:27px;height:27px;border:3px solid #dcebe4;border-top-color:#176f62;border-right-color:#176f62;border-radius:50%;animation:move-workout-spin .85s linear infinite}
@keyframes move-workout-spin{to{transform:rotate(360deg)}}
.workout-page #workout-status.status-error{width:min(100%,680px);margin:16px auto;padding:12px 16px;border:1px solid #f0d6d3;border-radius:12px;background:#fff8f7;color:#9d4a45;font-size:13px}
@media(prefers-reduced-motion:reduce){.workout-loading-spinner{animation-duration:2s}}

@media (min-width:1200px){
  body.app-shell{min-height:100vh;background:#f5f7f5}
  .app-shell .bottom-nav{
    position:fixed;inset:0 auto 0 0;z-index:40;transform:none;width:248px;max-width:none;height:100dvh;
    display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:7px;
    padding:26px 18px;border:0;border-right:1px solid #e4e9e6;border-radius:0;
    background:#fff;box-shadow:none;backdrop-filter:none
  }
  .app-shell .bottom-nav>a.desktop-brand{display:flex;flex-direction:row;align-items:center;gap:12px;height:56px;margin:0 8px 24px;color:#193b34;font-size:20px;font-weight:750;letter-spacing:-.6px}
  .desktop-brand img{display:block;width:190px;height:auto}
  .app-shell .app-wordmark{width:208px}
  .app-shell .bottom-nav>a:not(.desktop-brand){display:flex;flex-direction:row;justify-content:flex-start;align-items:center;gap:13px;min-height:48px;padding:7px 12px;border-radius:11px;color:#62716e;font-size:14px;font-weight:550}
  .app-shell .bottom-nav>a:not(.desktop-brand) .nav-icon{display:grid;place-items:center;flex:none;width:28px;height:28px;border-radius:8px;background:transparent}
  .app-shell .bottom-nav .nav-icon .ui-icon,.app-shell .bottom-nav .ui-icon{width:21px;height:21px}
  .app-shell .bottom-nav>a:not(.desktop-brand).selected{background:#e8f3ef;color:#176f62;font-weight:650}
  .app-shell .bottom-nav>a:not(.desktop-brand).selected .nav-icon{background:transparent}
  .app-shell .bottom-nav>a:not(.desktop-brand):hover:not(.selected){background:#f4f7f5;color:#344b44}

  .app-shell .app-header{position:sticky;top:0;z-index:30;width:auto;max-width:none;height:76px;margin:0 0 0 248px;padding:0 clamp(32px,4vw,68px);border-bottom:1px solid #e6ebe8;background:rgba(255,255,255,.96);backdrop-filter:blur(14px)}
  .app-shell[data-page="workout"]:not([data-workout-view="editor"]):not([data-workout-view="summary"]) .app-header{width:auto;max-width:none;margin-left:248px;margin-right:0}
  .app-shell .app-header h1{font-size:23px;letter-spacing:-.55px}
  .app-shell[data-page="home"] .app-header .app-wordmark{display:none}
  .app-shell[data-page="home"] .app-header .home-header-title{display:block;margin:0;font-size:23px;letter-spacing:-.55px}
  .app-shell .app-header .header-actions{gap:18px}
  .app-shell .page{width:auto;max-width:1320px;margin:0 clamp(32px,4vw,76px) 0 calc(248px + clamp(32px,4vw,68px));padding:36px 0 72px;min-height:calc(100vh - 76px)}
  .app-shell .page-heading{margin:0 0 24px}
  .app-shell .section-heading{margin:0 0 16px}
  .app-shell .section-heading h2{font-size:19px}
  .app-shell .empty-card{max-width:680px;margin:40px auto;padding:60px 32px;border:1px solid #e4eae6;border-radius:20px;background:white;box-shadow:0 8px 28px #193b3408}

  /* Home is a social training feed with enough width for two readable workout cards. */
  .app-shell[data-page="home"] .home-page{max-width:1320px;padding-top:30px}
  .home-page{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:18px 24px}
  .home-page>.feed-heading{grid-column:1/-1;position:static;margin:0 0 2px;padding:0;background:transparent;backdrop-filter:none}
  .home-page>.empty-card{grid-column:1/-1;width:min(100%,720px)}
  .home-page>.feed-workout{height:100%;margin:0;padding:20px;border:1px solid #e3e9e5;border-radius:16px;background:#fff;box-shadow:0 5px 20px #193b3407}
  .home-page .feed-social{margin-top:auto}

  /* Workout planning uses a clear primary action and a real routine library. */
  .app-shell[data-page="workout"]:not([data-workout-view="editor"]):not([data-workout-view="summary"]) .page{max-width:1320px}
  .workout-page #workout-content{display:block}
  .workout-page .start-empty{max-width:none;min-height:76px;padding:18px 22px;font-size:16px}
  .workout-page .routine-shortcuts{max-width:760px;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:16px auto 40px}
  .workout-page .routine-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
  .workout-page .routine-card{padding:20px;border-radius:15px;box-shadow:0 4px 18px #193b3407}
  .workout-page .routine-card>.button{margin-top:6px}
  .workout-page .resume-card{max-width:none;padding:20px 22px}

  /* The exercise catalogue becomes browsable cards, while preserving full-body artwork. */
  .app-shell .catalogue-page{max-width:1440px}
  .catalogue-page>.quiet-link{display:inline-flex;margin-bottom:16px}
  .app-shell .catalogue-page .exercise-search{max-width:760px;margin:8px 0 28px}
  .app-shell .catalogue-page .exercise-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:20px}
  .app-shell .catalogue-page .exercise-card{display:flex;flex-direction:column;align-items:stretch;gap:0;min-height:0;padding:0;overflow:hidden;border:1px solid #e2e9e5;border-radius:16px;background:#fff;box-shadow:0 4px 20px #193b3407;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
  .app-shell .catalogue-page .exercise-card:hover{transform:translateY(-3px);border-color:#c8d9d1;box-shadow:0 12px 26px #193b3412}
  .app-shell .catalogue-page .exercise-card .exercise-poster{width:100%;height:auto;aspect-ratio:1.35;object-fit:contain;border-radius:0;background:#f3f6f4}
  .app-shell .catalogue-page .exercise-card>div{display:grid;align-content:start;gap:5px;padding:15px 16px 18px}
  .app-shell .catalogue-page .exercise-card .eyebrow{display:block;margin:0;color:#71817a;font-size:10px;letter-spacing:.04em;text-transform:uppercase}
  .app-shell .catalogue-page .exercise-card h2{margin:0;font-size:15px;line-height:1.35}
  .app-shell .catalogue-page .exercise-card p{margin:0;font-size:12px;line-height:1.45}
  .app-shell .catalogue-page .exercise-card .text-link{display:inline-flex;margin-top:5px;color:#176f62;font-size:12px;font-weight:650}

  /* Profile separates identity/progress from the workout history stream. */
  .app-shell .profile-page[data-guest-history]{max-width:1440px;display:grid;grid-template-columns:minmax(310px,.78fr) minmax(0,1.22fr);align-items:start;gap:36px}
  .profile-page[data-guest-history] .profile-overview{grid-column:1;display:grid;align-content:start;gap:0;min-width:0}
  .profile-page[data-guest-history] .profile-history{grid-column:2;grid-row:1;min-width:0}
  .profile-history>.section-heading{position:sticky;top:76px;z-index:4;padding:10px 0;background:rgba(245,247,245,.96);backdrop-filter:blur(10px)}
  .profile-page[data-guest-history] .profile-overview .profile-identity{padding:10px 0 18px}
  .profile-page[data-guest-history] .profile-overview .profile-progress{margin:12px 0 22px;padding:16px;border-radius:14px}
  .profile-page[data-guest-history] .profile-overview .profile-progress .activity-chart{max-height:180px}
  .profile-page[data-guest-history] .profile-overview>.section-heading{margin:8px 0 12px}
  .profile-page[data-guest-history] .profile-overview .profile-links{grid-template-columns:1fr}
  .profile-page[data-guest-history] .profile-overview .profile-account{margin-top:24px;padding:20px 0;border-top:1px solid #e1e8e4}
  .profile-history>.feed-workout{margin:0 0 16px;padding:20px;border:1px solid #e2e9e5;border-radius:15px;background:white}
  .profile-history>.empty-card{margin:20px 0;max-width:none;padding:48px 24px}
  .profile-history>.guest-local-history{margin:0}

  .app-shell .profile-page:not([data-guest-history]){max-width:1160px;display:grid;grid-template-columns:minmax(280px,.8fr) minmax(0,1.2fr);align-items:start;gap:18px 36px}
  .profile-page:not([data-guest-history])>.detail-header{grid-column:1/-1}
  .profile-page:not([data-guest-history])>.profile-identity,.profile-page:not([data-guest-history])>.profile-progress{grid-column:1}
  .profile-page:not([data-guest-history])>.profile-progress{align-self:start;padding:18px;background:#fff;border:1px solid #e2e9e5;border-radius:14px}
  .profile-page:not([data-guest-history])>h2,.profile-page:not([data-guest-history])>.feed-workout,.profile-page:not([data-guest-history])>.empty-card{grid-column:2}
  .profile-page:not([data-guest-history])>.feed-workout{margin:0 0 16px;padding:20px;border:1px solid #e2e9e5;border-radius:15px;background:#fff}
  .profile-page:not([data-guest-history])>.profile-identity+.profile-bio{grid-column:1}

  /* Settings get a wider form grid; controls remain grouped by task. */
  .app-shell .settings-page{max-width:1120px;padding-top:38px}
  .settings-header{margin-bottom:28px}
  .settings-account{max-width:760px;margin-bottom:18px}
  .settings-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:12px 22px;border:0}
  .settings-section{padding:0;border:1px solid #e2e9e5;border-radius:14px;background:white;overflow:hidden}
  .settings-section>summary{min-height:76px;padding:16px 18px}
  .settings-section[open]{padding-bottom:0}
  .settings-section[open]>summary{border-bottom:1px solid #edf1ee}
  .settings-section form,.settings-section[open]{padding-bottom:16px}
  .settings-section .settings-form{padding:0 18px 8px}
  .settings-controls{padding:0 18px}
  .settings-section>.button,.settings-section>form>.button{margin-left:18px;margin-right:18px}
  .settings-preferences{display:contents}
  .settings-section .settings-inline-status{margin-left:18px}
  .settings-logout{margin-top:24px}

  /* Focused logging is a spacious work surface; the persistent navigation steps away. */
  body.app-shell[data-workout-view="editor"] .page,body.app-shell[data-workout-view="summary"] .page{width:min(1480px,calc(100% - 80px));max-width:1480px;margin:0 auto;padding:24px 0 72px;background:transparent}
  body[data-workout-view="editor"] .logger-toolbar,body[data-workout-view="summary"] .logger-toolbar{position:sticky;top:0;margin:0;padding:10px 0;height:72px;background:rgba(245,247,245,.96);backdrop-filter:blur(10px)}
  body[data-workout-view="editor"] .session-meta{max-width:760px}
  body[data-workout-view="editor"] #workout-content>.exercise-log-card{display:inline-block;vertical-align:top;width:calc(50% - 12px);margin-right:18px;padding:22px;border:1px solid #e2e9e5;border-radius:15px;background:white;box-shadow:0 4px 18px #193b3407}
  body[data-workout-view="editor"] #workout-content>.exercise-log-card:nth-of-type(2n){margin-right:0}
  body[data-workout-view="editor"] .logger-bottom{max-width:760px}
  body[data-workout-view="summary"] .summary-heading,body[data-workout-view="summary"] .workout-metrics{max-width:820px}
  body[data-workout-view="summary"] .summary-exercise{max-width:960px;padding:18px 0}
  .rest-clock{left:auto;right:32px;bottom:24px;transform:none;width:min(560px,calc(100% - 64px));padding:12px 16px;border:1px solid #d5e5dd;border-radius:16px}
  body[data-workout-view="list"] .rest-clock{bottom:24px}

  .app-shell .social-page,.app-shell .finish-page,.app-shell .share-page,.app-shell .workout-detail-page{max-width:1040px}
  .social-page .detail-header,.profile-page .detail-header{top:76px}
  .people-list{padding:0 20px}
  .app-shell .finish-page form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 28px}
  .finish-page form>.detail-header,.finish-page form>.workout-metrics,.finish-page form>.photo-picker,.finish-page form>.photo-preview,.finish-page form>button[type="submit"],.finish-page form>#finish-status{grid-column:1/-1}
  .app-shell .exercise-detail{width:auto;max-width:1440px;margin:0 32px 0 280px;padding:0 28px 72px;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(360px,.8fr);align-content:start;gap:0 32px;background:transparent}
  .exercise-detail>.detail-header,.exercise-detail>.exercise-tabs{grid-column:1/-1}
  .exercise-detail>.detail-header{position:sticky;top:0;z-index:31;height:64px;min-height:64px;margin:0;padding:8px 0;border-bottom:1px solid #e5ebe7;background:rgba(245,247,245,.98);backdrop-filter:blur(10px)}
  .exercise-detail>.exercise-tabs{position:sticky;top:64px;z-index:30;background:#fff;box-shadow:0 1px 0 #e2e8e5}
  .exercise-detail>.exercise-video,.exercise-detail>.exercise-temporary{grid-column:1;grid-row:3;margin:18px 0;align-self:start}
  .exercise-detail>.exercise-video{height:min(72vh,760px);max-height:none;overflow:hidden;border:1px solid #e2e9e5;border-radius:16px}
  .exercise-detail>.exercise-video video{display:block;width:100%;height:100%;max-height:none;object-fit:contain}
  .exercise-detail>.exercise-detail-content{position:relative;z-index:0;grid-column:2;grid-row:3;padding:18px 0;min-width:0}
  .exercise-detail:not(:has(.exercise-video,.exercise-temporary))>.exercise-detail-content{grid-column:1/-1;grid-row:auto;max-width:1000px;margin:0 auto}
  .app-shell .share-page{width:auto;max-width:1220px;margin:0 48px 0 296px;padding:0 24px 72px;display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,.72fr);align-content:start;align-items:start;gap:10px 32px}
  .share-page>.detail-header{grid-column:1/-1}
  .share-page>.share-preview{grid-column:1;grid-row:2/span 6;max-width:620px;margin:0 auto;padding:12px 0 0}
  .share-page>.share-preview canvas{width:100%;height:auto}
  .share-page>#share-status,.share-page>.share-variants,.share-page>.theme-choice,.share-page>.share-actions,.share-page>.share-explanation,.share-page>#share-text-fallback{grid-column:2;margin-left:0;margin-right:0}
  .share-page>.share-actions{grid-template-columns:1fr 1fr}
}

@media (min-width:1600px){
  .app-shell .page{max-width:1480px}
  .app-shell .catalogue-page .exercise-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
  .workout-page .routine-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}

@media (min-width:1200px){
  body.app-shell main.page.social-page{max-width:1040px}
}
