/* Width follows the available window, including iPad Split View and Slide Over. */
.tablet-workspace{min-width:0}
.tablet-master,.tablet-detail{min-width:0;overflow-wrap:anywhere}
.tablet-master-only{display:none}
.tablet-master button{width:100%;text-align:left;margin-bottom:8px;white-space:normal}
.tablet-master [aria-current]{background:var(--fill);color:var(--accent);border-color:var(--accent)}
.tablet-placeholder{display:none}
.exercise-desktop{display:none}
.strength-primary{display:grid;gap:12px}
.strength-library,.strength-form{max-width:720px}
.tablet-detail>p,.card>p,.health-detail>p{max-width:720px}
#app form{max-width:720px;width:100%}
#app input:not([type=checkbox]):not([type=radio]),#app select,#app textarea{max-width:100%;min-width:0}
button,.button,input:not([type=checkbox]):not([type=radio]),select,summary{min-height:44px}
button,.button{min-width:44px}
.check{min-height:44px}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(hover:none){.summary-tile:hover{background:var(--card)}}
@media(min-width:640px){
  .has-navigation header.top{padding-top:max(14px,env(safe-area-inset-top));padding-right:max(20px,env(safe-area-inset-right),var(--sportone-cutout-right,0px))}
  .has-navigation main{padding-right:max(20px,calc(env(safe-area-inset-right,0px) - var(--sportone-cutout-right,0px)));padding-bottom:calc(56px + env(safe-area-inset-bottom))}
  .app-nav{padding-top:max(12px,env(safe-area-inset-top));padding-left:max(8px,env(safe-area-inset-left));padding-bottom:max(12px,env(safe-area-inset-bottom))}
  /* Keep the navigation pinned to the viewport throughout long pages. */
  .app-nav{position:fixed;top:0;bottom:auto;height:100vh;height:100dvh;overflow-y:auto}
  .strength-primary{grid-template-columns:repeat(3,minmax(0,1fr));align-items:end}
  .strength-primary .field{margin:0}
}
@media(min-width:1100px){
  .exercise-desktop{display:grid}
  .tablet-workspace{display:grid;grid-template-columns:minmax(230px,30%) minmax(0,1fr);gap:24px;align-items:start;margin-block:16px}
  .tablet-master-only,.tablet-placeholder{display:block}
  .tablet-placeholder{padding:24px;background:var(--raised);border-radius:16px}
  .tablet-master .summary-grid{grid-template-columns:1fr}
  .tablet-master .health-summary{padding:12px}
  .tablet-master .card{margin-bottom:12px}
  .tablet-master .activity-card .summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tablet-detail .panels{grid-template-columns:minmax(0,1fr)}
  .tablet-detail .summary-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,140px),1fr))}
  .strength-library:has(.tablet-workspace){max-width:none}
  .explorer #map{height:360px}
  .tablet-detail .chart{min-height:240px}
}
@media(min-width:1000px){.home-content{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:1300px){.home-content{grid-template-columns:repeat(3,minmax(0,1fr))}}
.home-content{grid-auto-flow:row;align-items:stretch}
.home-widget{align-self:stretch}
.home-widget>.card{height:100%}
.home-widget[data-widget="adaptive_plan"] .summary-tile,
.home-widget[data-widget="weekly_load"] .summary-tile{min-height:0}
.home-widget[data-widget="adaptive_plan"] .summary-secondary,
.home-widget[data-widget="weekly_load"] .summary-secondary{margin-top:0}
@media(min-width:640px) and (max-width:999px){.home-content{grid-template-columns:minmax(0,1fr)}}
@media(max-width:700px){
  .has-navigation header.top{flex-wrap:nowrap}
  .row,.actions{flex-wrap:wrap}
  .strength-primary{grid-template-columns:1fr}
  .tablet-master,.tablet-detail{width:100%}
}
@media(max-width:430px){
  .has-navigation header.top{gap:4px}
  .has-navigation header.top>.brand{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #profile-shortcut{flex:none;width:44px;min-width:44px;padding:5px}
  #profile-shortcut .profile-label{display:none}
}

/* Let WebKit own the safe area once; never infer a device-specific side column. */
html,body{width:100%;min-width:0}
.actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.section-chips{column-gap:8px;row-gap:10px}
@media(max-width:700px){
  body.has-navigation{padding-left:0;--sidebar-width:0px}
  body.has-navigation main{width:100%;max-width:none;margin:0;padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,calc(env(safe-area-inset-right,0px) - var(--sportone-cutout-right,0px)));padding-bottom:calc(88px + env(safe-area-inset-bottom))}
  .has-navigation header.top{padding-top:calc(6px + env(safe-area-inset-top));padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right),var(--sportone-cutout-right,0px))}
  .app-nav{top:auto;left:0;right:0;bottom:0;width:auto;height:auto;border-right:0;overflow-y:visible;padding:4px max(6px,calc(env(safe-area-inset-right,0px) - var(--sportone-cutout-right,0px))) calc(6px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))}
  .nav-items{display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}
  .app-nav .nav-link{flex-direction:column;gap:2px;padding:4px 0;font-size:12px;min-height:48px;min-width:0}
  .app-nav .nav-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .app-nav .nav-label small{display:none}
  .nav-desktop-toggle,.nav-submenu{display:none!important}
  #app input:not([type=checkbox]):not([type=radio]),#app select,#app textarea{font-size:16px}
  .admin-section-body,.admin-section-body .card,.admin-section-body form,.admin-section-body .row>*{min-width:0;max-width:100%}
  .admin-section-body{overflow-wrap:anywhere}
  .admin-section-body .actions{gap:12px}
  .admin-section-body button{margin:4px 4px 4px 0;max-width:100%;white-space:normal}
  .admin-table{overflow:visible}
  .admin-table table{min-width:0;width:100%}
  .admin-table tbody,.admin-table tr,.admin-table td{display:block;width:100%}
  .admin-table thead{display:block}
  .admin-table thead tr{display:flex;flex-wrap:wrap;gap:8px}
  .admin-table thead th{display:block}
  .admin-table tbody tr{border:1px solid var(--sep);border-radius:14px;padding:12px;margin-block:12px;background:var(--card)}
  .admin-table td{padding:8px 0;white-space:normal;overflow-wrap:anywhere}
  .admin-table td::before{content:attr(data-label);display:block;font-size:13px;color:var(--muted)}
}

.tablet-detail>.tablet-placeholder{max-width:none}
@media(min-width:1100px){.tablet-detail{position:sticky;top:16px}}

/* Cabecera común encima de la lista y el detalle; la lista arranca a la altura del contenido. */
.tablet-head{min-width:0}
.tablet-head>h1,.tablet-head .activity-head{margin-bottom:4px}
.tablet-head>p.muted{margin-top:0}
@media(min-width:1100px){
  .tablet-workspace.has-head{row-gap:12px}
  .tablet-workspace.has-head>.tablet-head{grid-column:1/-1}
  .tablet-workspace.has-head>.tablet-master{margin-top:0}
}
@media(min-width:1100px){.tablet-workspace.has-head .health-detail>.health-periods:first-child{margin-top:0}}
