/* Only positive native folding context opts in. Ordinary iPhones retain every
   existing dashboard rule. Local container width, never a model/pixel size,
   determines columns. These styles never remount content or alter app state. */
html[data-native-dashboard] .app-shell:has(.home-dashboard) .topbar{height:auto;min-height:calc(76px + var(--safe-top));padding:calc(16px + var(--safe-top)) 24px 12px;gap:20px}
html[data-native-dashboard] .app-shell:has(.home-dashboard) .wordmark{min-height:44px}
html[data-native-dashboard] .app-shell:has(.home-dashboard) .avatar-button{width:44px;height:44px;flex-shrink:0}
html[data-native-dashboard] main:has(.home-dashboard){padding:16px 24px 24px}
html[data-native-dashboard] .home-dashboard{display:flex;flex-direction:column;min-height:0;gap:22px;max-width:1000px;margin-inline:auto;align-content:start}
html[data-native-dashboard] .dashboard-welcome{min-width:0;column-gap:24px;row-gap:12px;align-items:center;align-self:stretch}
html[data-native-dashboard] .dashboard-welcome>div{min-width:0}
html[data-native-dashboard] .dashboard-welcome h1{font-size:34px;line-height:1.1;letter-spacing:-.045em;margin-top:10px;overflow-wrap:anywhere}
html[data-native-dashboard] .dashboard-welcome .readiness-ring{width:100px;height:100px;margin:0}
html[data-native-dashboard] .dashboard-welcome .readiness-ring strong{font-size:34px}
html[data-native-dashboard] .dashboard-welcome .readiness-ring span{font-size:10px}
html[data-native-dashboard] .dashboard-checkin{margin-top:4px;padding:14px 16px;min-height:66px}
html[data-native-dashboard] .home-dashboard .dashboard-card{margin:0;padding:20px;gap:14px;align-self:stretch;grid-column:auto;grid-row:auto}
html[data-native-dashboard] .dashboard-card-label{min-height:44px;line-height:1.5}
html[data-native-dashboard] .dashboard-card-label button{margin-block:0;flex-shrink:0}
html[data-native-dashboard] .dashboard-card-copy h2{font-size:28px;line-height:1.16}
html[data-native-dashboard] .dashboard-card-copy p{margin-top:10px;font-size:14px;line-height:1.55;max-width:54ch}
html[data-native-dashboard] .dashboard-metrics{padding-block:12px;line-height:1.6}
html[data-native-dashboard] .dashboard-card-actions{display:grid;gap:8px}
html[data-native-dashboard] .dashboard-secondary{gap:4px 20px;align-items:center}
html[data-native-dashboard] .dashboard-secondary button{min-height:44px;line-height:1.5}
html[data-native-dashboard] .home-dashboard .week-peek{min-width:0;margin:0;align-self:stretch;grid-column:auto}
html[data-native-dashboard] .home-dashboard .section-heading{margin-bottom:8px}
html[data-native-dashboard] .home-dashboard .day{min-height:76px;gap:6px;padding-block:10px}
html[data-native-dashboard] .home-dashboard .day i{width:28px;height:28px}
html[data-native-dashboard] .home-dashboard .day small{font-size:9px}

/* Closed Today keeps the primary workout ahead of the secondary calendar.
   Natural heights and scrolling accommodate long titles/accessibility text. */
html[data-native-dashboard=compact] .app-shell:has(.home-dashboard) .topbar{display:grid;grid-template-columns:minmax(70px,1fr) auto 44px;gap:10px;padding:calc(12px + var(--safe-top)) 20px 10px;min-height:calc(66px + var(--safe-top))}
html[data-native-dashboard=compact] .app-shell:has(.home-dashboard) .topbar-actions{display:contents}
html[data-native-dashboard=compact] .app-shell:has(.home-dashboard) .wordmark{grid-column:1;grid-row:1;justify-self:start}
html[data-native-dashboard=compact] .app-shell:has(.home-dashboard) .wordmark-logo{height:30px}
html[data-native-dashboard=compact] .app-shell:has(.home-dashboard) #profile-button{grid-column:3;grid-row:1}
html[data-native-dashboard=compact] .app-shell:has(.home-dashboard) #streak-pill{grid-column:2;grid-row:1;justify-self:end;min-height:44px;max-width:100%;gap:6px;padding-inline:8px}
/* The existing complete accessible label still names the badge and streak. */
html[data-native-dashboard=compact] .app-shell:has(.home-dashboard) .streak-label,
html[data-native-dashboard=compact] .app-shell:has(.home-dashboard) .streak-award-name,
html[data-native-dashboard=compact] .app-shell:has(.home-dashboard) .streak-chevron{display:none}
html[data-native-dashboard=compact] main:has(.home-dashboard){padding:12px 20px 24px}
html[data-native-dashboard=compact] .home-dashboard{gap:16px}
html[data-native-dashboard=compact] .dashboard-welcome{column-gap:20px}
html[data-native-dashboard=compact] .dashboard-welcome h1{font-size:30px;line-height:1.12}
html[data-native-dashboard=compact] .dashboard-welcome .readiness-ring{width:80px;height:80px}
html[data-native-dashboard=compact] .home-dashboard .dashboard-card{padding:18px;gap:12px}
html[data-native-dashboard=compact] .dashboard-card-copy h2{font-size:26px}
html[data-native-dashboard=compact] .home-dashboard .section-heading{margin-bottom:4px}
html[data-native-dashboard=compact] .home-dashboard .day{min-height:64px;gap:4px;padding-block:6px}

/* Wide inner windows use adjacent sections at their natural height. Portrait
   and Split View keep a single column rather than stretching sparse cards. */
@container(min-width:760px){
  html[data-native-dashboard=expanded] .home-dashboard{display:grid;grid-template-columns:minmax(308px,.95fr) minmax(0,1.15fr);gap:20px 28px;align-items:start}
  html[data-native-dashboard=expanded] .dashboard-welcome{grid-column:1;grid-row:1}
  html[data-native-dashboard=expanded] .home-dashboard .dashboard-card{grid-column:2;grid-row:1/3;align-self:start}
  html[data-native-dashboard=expanded] .home-dashboard .week-peek{grid-column:1;grid-row:2;align-self:start}
}
@container(max-width:319px){
  html[data-native-dashboard] .dashboard-welcome{grid-template-columns:minmax(0,1fr);gap:16px}
  html[data-native-dashboard] .dashboard-welcome .readiness-ring{justify-self:start}
  html[data-native-dashboard] .home-dashboard .week-strip{grid-template-columns:repeat(4,minmax(44px,1fr))}
  html[data-native-dashboard] .home-dashboard .day{border-bottom:1px solid var(--line)}
}

/* Landscape is one coherent dashboard: shared context, primary workout, week.
   Columns belong INSIDE the main card, never beside an isolated oversized hero.
   Inner portrait retains its approved expanded rules above unchanged. */
html[data-native-dashboard=landscape] .home-dashboard{display:flex;flex-direction:column;gap:20px;max-width:960px}
html[data-native-dashboard=landscape] .dashboard-welcome{align-self:stretch;column-gap:24px}
html[data-native-dashboard=landscape] .dashboard-welcome h1{font-size:32px;line-height:1.12;margin-top:8px}
html[data-native-dashboard=landscape] .dashboard-welcome h1 br{display:none}
html[data-native-dashboard=landscape] .dashboard-welcome h1 em{margin-inline-start:.18em}
html[data-native-dashboard=landscape] .dashboard-welcome .readiness-ring{width:88px;height:88px}
html[data-native-dashboard=landscape] .dashboard-welcome .readiness-ring strong{font-size:34px}
html[data-native-dashboard=landscape] .dashboard-card-copy h2{font-size:28px}
html[data-native-dashboard=landscape] .dashboard-card-copy p{font-size:15px}
html[data-native-dashboard=landscape] .dashboard-metrics{font-size:13px}
html[data-native-dashboard=landscape] .dashboard-card-actions .primary-action{min-height:56px;font-size:16px}
html[data-native-dashboard=landscape] .dashboard-secondary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 16px}
html[data-native-dashboard=landscape] .dashboard-secondary button{min-width:0;font-size:13px;overflow-wrap:anywhere}
html[data-native-dashboard=landscape] .dashboard-secondary .reschedule-workout-link,
html[data-native-dashboard=landscape] .dashboard-secondary .reschedule-lock,
html[data-native-dashboard=landscape] .dashboard-secondary .train-anyway-action{grid-column:1/-1}
html[data-native-dashboard=landscape] .home-dashboard .dashboard-card{padding:20px;gap:12px}
html[data-native-dashboard=landscape] .home-dashboard .day{min-height:76px;gap:6px}
html[data-native-dashboard=landscape] .home-dashboard .day small{font-size:10px}
html[data-native-dashboard=landscape] .bottom-nav button{font-size:12px}
html[data-native-dashboard=landscape] .bottom-nav .nav-icon{font-size:24px}
@container(min-width:760px){
  html[data-native-dashboard=landscape] .home-dashboard .dashboard-card{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-template-rows:auto min-content 1fr;gap:12px 28px;align-items:start}
  html[data-native-dashboard=landscape] .dashboard-card-label{grid-column:1/-1}
  html[data-native-dashboard=landscape] .dashboard-card-copy{grid-column:1;grid-row:2}
  html[data-native-dashboard=landscape] .dashboard-metrics{grid-column:1;grid-row:3;align-self:start}
  html[data-native-dashboard=landscape] .dashboard-card-actions{grid-column:2;grid-row:2/4;align-self:start}
}
