/* Fit the available width through reflow, without clipping fields or controls. */
main,#content,#panel,dialog,.box{min-width:0;max-width:100%;box-sizing:border-box}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.panel,.card,.toolbar,.row,.training-card,section,form,fieldset,label,.actions,.training-actions,.tablewrap,.assessment-scroll,.assessment-chart-scroll){min-width:0;max-width:100%;box-sizing:border-box}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.grid,.stats,.shared-form-grid,.client-details,.planner-layout,.nutrition-layout)>*{min-width:0}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(p,span,strong,small,h2,h3,h4,dd,td,th){overflow-wrap:anywhere}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(input,select,textarea){min-width:0;max-width:100%;box-sizing:border-box}textarea{resize:vertical}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.toolbar,.row,.actions,.training-actions,.client-quick-actions){flex-wrap:wrap}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.tablewrap,.assessment-scroll){width:100%;overflow:visible;container:befit-table / inline-size}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.tablewrap,.assessment-scroll) table{width:100%!important;min-width:0!important;max-width:100%;table-layout:fixed!important}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.tablewrap,.assessment-scroll) :is(th,td){min-width:0!important;width:auto;white-space:normal!important;overflow-wrap:anywhere}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.student-identity,.trainer-identity){min-width:0;max-width:100%;white-space:normal!important}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.student-identity,.trainer-identity)>span:last-child{min-width:0;flex-shrink:1;white-space:normal!important;overflow-wrap:anywhere}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.tablewrap,.assessment-scroll) :is(.btn,.badge,.actions,.person-inline-actions){white-space:normal;max-width:100%;flex-wrap:wrap}
:is(#content,#panel,dialog:not(.screen-lock-cover)) .student-status-scroll{overflow:visible;max-width:100%}
:is(#content,#panel,dialog:not(.screen-lock-cover)) .student-status-list{min-width:0;width:100%}
:is(#content,#panel,dialog:not(.screen-lock-cover)) .student-status-row{min-width:0;flex-wrap:wrap;white-space:normal}
:is(#content,#panel,dialog:not(.screen-lock-cover)) .assessment-chart-scroll{overflow:visible}.assessment-chart{max-width:100%;min-width:0}
:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.training-day-tabs,.shared-client-tabs,.planner-day-tabs,.tabs){max-width:100%;min-width:0;overflow:visible;flex-wrap:wrap}
:is(#content,#panel,dialog:not(.screen-lock-cover)) img{max-width:100%}
dialog:not(.screen-lock-cover){max-width:calc(100vw - 24px);overflow-y:auto;box-sizing:border-box}
@container befit-table (max-width:1050px){
 table.responsive-data-table{display:block}table.responsive-data-table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 table.responsive-data-table tbody{display:block;width:100%}table.responsive-data-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px;padding:18px;width:100%;border-bottom:1px solid #e0e5d8}
 :is(#content,#panel,dialog:not(.screen-lock-cover)) table.responsive-data-table tbody :is(td,th){display:block;border:0;padding:0;min-width:0;width:auto}
 table.responsive-data-table tbody :is(td,th)::before{content:attr(data-column-label);display:block;color:#63715e;font-size:10px;letter-spacing:.04em;font-weight:650;margin-bottom:6px}
 table.responsive-data-table tbody :is(td,th):first-child,table.responsive-data-table .responsive-wide-cell{grid-column:1/-1}
 table.responsive-data-table tbody td:last-child:has(button){grid-column:1/-1;display:flex!important;align-items:center;flex-wrap:wrap;gap:8px}table.responsive-data-table tbody td:last-child:has(button)::before{width:100%}
}
@container befit-table (max-width:360px){table.responsive-data-table tbody tr{grid-template-columns:minmax(0,1fr);padding:12px}}
@media(max-width:760px){:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.directory-filters,.habitual-slot-grid,.assessment-overview,.nutrition-score-grid){grid-template-columns:repeat(2,minmax(0,1fr))}:is(#content,#panel,dialog:not(.screen-lock-cover)) :is(.toolbar,.row)>*{min-width:0;max-width:100%}nav{max-width:100%;flex-wrap:wrap;overflow:visible}nav button{white-space:normal}}

/* Numeric columns take only the space needed for a short amount. */
@container befit-table (min-width:1051px){
 :is(#content,#panel,dialog:not(.screen-lock-cover)) table.responsive-data-table th.compact-numeric-column{width:100px!important;padding:12px 8px;letter-spacing:.02em}
 :is(#content,#panel,dialog:not(.screen-lock-cover)) table.responsive-data-table td.compact-numeric-column{padding:12px 8px;font-variant-numeric:tabular-nums}
}

/* Secondary text stays beside its value rather than on a new line. */
:is(#content,#panel,dialog:not(.screen-lock-cover)) table.responsive-data-table td>small{display:inline;margin:0 0 0 6px}
:is(#content,#panel,dialog:not(.screen-lock-cover)) table.responsive-data-table td>.student-trainer-entry{display:inline-flex;align-items:center;gap:8px;margin:0 6px 0 0}
:is(#content,#panel,dialog:not(.screen-lock-cover)) table.responsive-data-table td>:is(.actions,.person-inline-actions){display:inline-flex;vertical-align:middle;margin:0 0 0 6px;gap:6px}
@container befit-table (min-width:1051px){
 :is(#content,#panel,dialog:not(.screen-lock-cover)) table.responsive-data-table.table-single-line{table-layout:auto!important;font-size:var(--table-row-font,13px)}
 :is(#content,#panel,dialog:not(.screen-lock-cover)) table.responsive-data-table.table-single-line :is(th,td){padding:10px 7px;white-space:nowrap!important;vertical-align:middle}
 :is(#content,#panel,dialog:not(.screen-lock-cover)) table.responsive-data-table.table-single-line :is(.student-identity,.trainer-identity,.student-identity>span:last-child,.trainer-identity>span:last-child,.badge){white-space:nowrap!important;overflow-wrap:normal}
 :is(#content,#panel,dialog:not(.screen-lock-cover)) table.responsive-data-table.table-single-line :is(td,td small,td strong){font-size:var(--table-row-font,13px)}
 :is(#content,#panel,dialog:not(.screen-lock-cover)) table.responsive-data-table.table-single-line .icon-button{width:36px;height:36px;min-height:36px;padding:7px;margin:0 3px}
}

/* Account student filters retain their full labels on a phone. */
@media(max-width:650px){#shared-students .shared-toolbar:has(#shared-search){display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:14px}#shared-students .shared-toolbar:has(#shared-search)>label{width:100%;min-width:0;margin:0;flex-basis:100%}#shared-students .shared-toolbar:has(#shared-search) :is(input,select){display:block;width:100%;min-width:0;max-width:100%;font-size:16px}#shared-students #shared-refresh{justify-self:start;width:auto}}
#panel #shared-students .shared-student>div:first-child>small.finance-badge{display:inline-block;color:#263d29;background:#edf3dc;padding:7px 10px;border-radius:9px;width:auto}
