/* Shared theme aliases used by the feedback and document modules. */
:root{--tribal-navy:#10243b;--tribal-orange:#ea580c}

/* Labels may be uppercase; values and explanatory text must retain their case. */
body.tribal-portal-mode :is(input:not([type=button]):not([type=submit]):not([type=reset]),select,textarea){text-transform:none!important;letter-spacing:normal!important;font-weight:500;min-width:0;box-sizing:border-box}
body.tribal-portal-mode label :is(small,.description){text-transform:none;letter-spacing:normal;font-weight:400;line-height:1.5}
.tf-profile-fields label small{display:block;margin-top:6px;font-size:12px;text-transform:none!important;letter-spacing:normal;font-weight:400}
body.tribal-portal-mode :is(input,select,textarea,[contenteditable=true]){scroll-margin-block:100px 180px}

/* Native editor dialogs scroll independently and retain their exit/actions. */
body.tribal-portal-mode:has(dialog[open]){overflow:hidden!important}
body.tribal-portal-mode :is(#tfl-editor,.tt-dialog){overscroll-behavior:contain;scroll-padding-block:80px 90px}
body.tribal-portal-mode #tfl-editor .tfl-dialog-heading{position:sticky;top:-1px;z-index:3;background:#fff;padding:10px 0;border-bottom:1px solid #e4e7ec}
body.tribal-portal-mode #tfl-editor footer.tfl-actions{position:sticky;bottom:-1px;z-index:3;background:#fff;padding:12px 0;border-top:1px solid #e4e7ec;box-shadow:0 -8px 18px #fff}
body.tribal-portal-mode :is(.tfl-dialog-heading button,.tt-dialog .tt-close){width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;flex-shrink:0;padding:0!important;display:inline-flex;align-items:center;justify-content:center;font-size:24px!important;line-height:1}
body.tribal-portal-mode .tt-dialog>.tt-close{position:sticky;top:0;z-index:4;float:right;margin:0 0 10px 12px}
/* Keep exercise names in a consistent column instead of centring each result. */
#tribal-workouts button.tw-exercise{display:flex!important;justify-content:flex-start!important;align-items:center;gap:10px;text-align:left!important;min-height:64px;padding:10px!important;width:100%}
#tribal-workouts button.tw-exercise>img{width:48px;height:48px;flex:0 0 48px;object-fit:cover;border-radius:7px}
#tribal-workouts button.tw-exercise>span{flex:1;min-width:0}
#tribal-workouts button.tw-exercise strong{display:block;font-size:14px!important;line-height:1.4;overflow-wrap:anywhere}
#tribal-workouts button.tw-exercise small{display:block;font-size:12px!important;line-height:1.4;margin-top:3px}
#tribal-workouts button.tw-exercise>b{flex:0 0 20px;font-size:20px}
/* Intake forms already sit inside a card; a second card wastes phone width. */
body.tribal-portal-mode .tsa details.tsa-card>form.tsa-card{padding:0!important;margin:12px 0 0!important;border:0!important;box-shadow:none!important}
@media(max-width:767px){
 body.tribal-portal-mode .tf-surveys [data-question-builder]>.tf-editor-savebar{grid-row:auto;top:auto!important;bottom:calc(72px + env(safe-area-inset-bottom))!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:8px;align-self:end}
 body.tribal-portal-mode .tf-surveys .tf-editor-savebar .tribal-btn{min-width:0!important;width:100%!important;min-height:44px;padding:7px 4px!important;font-size:11px!important;white-space:normal}
 body.tribal-portal-mode .tf-surveys .tf-editor-savebar small{grid-column:1/-1}
 body.tribal-portal-mode .tsa form.tsa-card fieldset{padding:12px!important;min-width:0}
 body.tribal-portal-mode :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){font-size:16px!important}
 body.tribal-portal-mode #tfl-editor{max-height:calc(100dvh - 24px);padding:12px}
 #tfbfd-builder-form .mce-toolbar .mce-btn button{min-width:40px;min-height:44px}
}

/* Preserve the player's filter states against the portal's generic button theme. */
body.tribal-portal-mode .tt-performance-history>header{position:sticky;top:0;z-index:2;background:#fff}
body.tribal-portal-mode .tt-performance-history>header button{flex:0 0 44px;min-width:44px;min-height:44px}
body.tribal-portal-mode .tt-performance-history :is(.tt-history-ranges,.tt-history-metrics){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
body.tribal-portal-mode .tt-performance-history :is(.tt-history-ranges,.tt-history-metrics) button{min-width:0!important;min-height:44px;padding:8px 5px!important;border:1px solid #d9e0e6!important;border-radius:10px!important;background:#f4f6f8!important;color:#35465a!important;font-size:12px!important;box-shadow:none!important}
body.tribal-portal-mode .tt-performance-history :is(.tt-history-ranges,.tt-history-metrics) button[aria-pressed=true]{border-color:#10243b!important;background:#10243b!important;color:#fff!important}
body.tribal-portal-mode .tt-performance-history :is(.tt-history-ranges,.tt-history-metrics) button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:767px){
 body.tribal-portal-mode .tribal-slot{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;gap:12px;text-align:left!important}
 body.tribal-portal-mode .tribal-slot>div{min-width:0;flex:1;text-align:left!important}
 body.tribal-portal-mode .tribal-slot>button{flex:0 0 auto;width:auto!important;min-width:72px;min-height:44px;margin:0!important}
}

/* An intrinsic grid track must not widen the report beyond its phone container. */
.tf-business-reports{grid-template-columns:minmax(0,1fr);box-sizing:border-box}
.tf-business-reports>*,.tf-report-head>*{min-width:0;max-width:100%;box-sizing:border-box}
.tf-report-head{overflow-wrap:break-word}
.tf-survey-tabs a.active{background:#10243b;color:#fff}
.tf-client-account>.tf-client-page-head{display:block!important;margin-bottom:24px}
.tf-client-account>.tf-client-page-head h1{margin:4px 0 8px}
.tf-client-account>.tf-client-page-head p{margin:0;max-width:70ch}

/* Keep technical payment configuration available without preceding every payment. */
:is(.tf-payments-page,.tf-schedule-page) .tf-desktop-disclosure{padding:0!important;overflow:hidden}
:is(.tf-payments-page,.tf-schedule-page) .tf-desktop-disclosure>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;list-style:none}
:is(.tf-payments-page,.tf-schedule-page) .tf-desktop-disclosure>summary::-webkit-details-marker{display:none}
:is(.tf-payments-page,.tf-schedule-page) .tf-desktop-disclosure>summary h2{margin:0;font-size:18px}
:is(.tf-payments-page,.tf-schedule-page) .tf-desktop-disclosure>summary p{margin:5px 0 0;color:#667085;font-size:13px}
:is(.tf-payments-page,.tf-schedule-page) .tf-desktop-disclosure>summary>span{flex-shrink:0}
:is(.tf-payments-page,.tf-schedule-page) .tf-desktop-disclosure[open]>summary{border-bottom:1px solid #e4e7ec}
:is(.tf-payments-page,.tf-schedule-page) .tf-desktop-disclosure-body{padding:16px;min-width:0}
@media(max-width:767px){
 body.tf-view-library :is(#tribal-workouts,#tribal-library,main) nav[aria-label="Library sections"]{display:flex!important;flex-flow:row nowrap!important;position:relative;gap:4px!important;max-width:100%!important;min-width:0;width:100%;padding:5px!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:thin;box-sizing:border-box}
 body.tf-view-library :is(#tribal-workouts,#tribal-library,main) nav[aria-label="Library sections"]>a{flex:0 0 auto!important;min-width:0!important;min-height:44px;display:flex!important;align-items:center;justify-content:center;padding:9px 12px!important;white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important}
 body.tf-view-library :is(#tribal-workouts,#tribal-library,main) nav[aria-label="Library sections"]>a[aria-current=page]{background:#10243b!important;color:#fff!important;border-radius:9px}
 body.tf-view-today:not(.tf-client-portal) .tf-today-page>.tf90-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important}
 .tf-today-page>.tf90-toolbar>a{padding-inline:5px;font-size:12px;white-space:nowrap}
 .tf-today-page>.tf90-toolbar>form{grid-column:1/-1}
 .tf-today-page>.tf90-toolbar input[type=date]{margin-top:0}
 .tf-report-sections,.tf-report-periods{margin-inline:0;box-sizing:border-box}
 :is(.tf-payments-page,.tf-schedule-page) .tf-desktop-disclosure>summary{align-items:flex-start}
 :is(.tf-payments-page,.tf-schedule-page) .tf-desktop-disclosure>summary>span{padding:8px;font-size:12px}
}
