/* Batch 3: trainer composition only; shared logging styles remain in client-polish.css. */
.trainer-polish { --tp-gap: 22px; }
.trainer-polish h2 { font-size: 1.2rem; line-height: 1.3; }
.trainer-polish .ui-surface { margin: 0; min-width: 0; }
.trainer-polish .button, .trainer-polish select, .trainer-polish input { min-height: 44px; }
.trainer-polish button { touch-action: manipulation; }
.trainer-polish summary { cursor: pointer; }
.trainer-polish .tp-caption { color: var(--muted); font-size: .78rem; line-height: 1.65; }
.tp-command { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 28px; border: 1px solid #dbe5ca; border-radius: 20px; background: #f0f5e7; margin-bottom: 28px; }
.tp-command h2 { font-size: clamp(1.35rem,2vw,1.8rem); }
.tp-command-intro > p:not(.eyebrow) { max-width: 42ch; font-size: .85rem; color: #626e56; line-height: 1.6; }
.tp-command-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; align-items: center; }
.tp-command-stats > * { border: 0; background: none; text-align: left; padding: 10px 12px; border-left: 1px solid #d6dfc9; min-width: 0; }
.tp-command-stats strong { display: block; font-size: 2rem; color: var(--ink); }
.tp-command-stats span { display: block; font-size: .75rem; line-height: 1.5; color: #627050; margin-top: 8px; }
.tp-command-stats button:hover { background: #e5edda; border-radius: 10px; }
.tp-fetch-note { padding: 12px; margin-bottom: 20px; font-size: .8rem; background: #fff3db; border-radius: 10px; }
.tp-roster-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; }
.tp-roster-tools .ui-search { flex: 1; min-width: 200px; }
.tp-client-grid .ui-client-card { align-content: start; }
.tp-client-open { grid-column: 1 / -1; font-size: .7rem; color: var(--lime-dark); font-weight: 650; }
.tp-roster-footer { margin-top: 28px; padding: 16px 0; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); font-size: .8rem; }
.tp-roster-footer > span { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.tp-client-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.tp-client-switch label { width: min(280px,55%); }
.tp-client-switch select { width: 100%; font-size: .8rem; }
.tp-client-workspace > .ui-page-heading { margin-bottom: 22px; }
.tp-client-workspace .ui-client-tabs { margin-bottom: 24px; }
.tp-workspace-layout, .tp-client-content { min-width: 0; }
.tp-client-rail { display: none; }
.tp-overview-grid, .tp-details-grid, .tp-metric-grid, .tp-intelligence-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--tp-gap); }
.tp-overview-grid > .ui-surface, .tp-details-grid > .ui-surface, .tp-intelligence-grid > .ui-surface { padding: 24px; }
.tp-program-brief { background: #f4f7ee; border-color: #dce5ce; }
.tp-program-brief > .button { margin-top: 12px; }
.tp-program-brief > p:not(.eyebrow) { color: var(--muted); font-size: .83rem; line-height: 1.6; }
.tp-stat-row { display: flex; gap: 20px; margin: 22px 0; }
.tp-stat-row > div { min-width: 0; flex: 1; }
.tp-stat-row > div + div { border-left: 1px solid var(--line); padding-left: 20px; }
.tp-stat-row strong { display: block; font-size: 1.55rem; line-height: 1.35; letter-spacing: -.04em; }
.tp-stat-row span { display: block; margin-top: 6px; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.tp-section-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tp-section-top .eyebrow, .tp-section-top h2 { margin: 0; }
.tp-section-top .eyebrow + h2 { margin-top: 8px; }
.tp-section-top > .ui-icon { color: var(--lime-dark); }
.tp-attention-list { margin: 14px 0; }
.tp-attention-list button { display: grid; grid-template-columns: minmax(0,1fr) 20px; text-align: left; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; gap: 5px 10px; }
.tp-attention-list button strong { font-size: .87rem; }
.tp-attention-list button span { grid-column: 1; color: var(--muted); font-size: .73rem; }
.tp-attention-list .ui-icon { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.tp-volume-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 20px 0; }
.tp-volume-summary > div { padding: 12px; border-radius: 10px; background: var(--paper); }
.tp-volume-summary span { display: block; color: var(--muted); font-size: .76rem; }
.tp-volume-summary strong { display: block; margin-top: 8px; font-size: 1.25rem; }
.tp-volume-summary small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.tp-session-link { display: grid; grid-template-columns: 36px minmax(0,1fr) 20px; align-items: center; gap: 12px; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; width: 100%; }
.tp-session-link > span:first-child { display: grid; place-items: center; background: var(--ui-accent-soft); color: var(--lime-dark); width: 36px; height: 36px; border-radius: 10px; }
.tp-session-link strong { font-size: .87rem; display: block; }
.tp-session-link small { display: block; margin-top: 6px; color: var(--muted); font-size: .72rem; }
.tp-note-copy { font-size: .86rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.tp-reminder-wrap { min-width: 0; }
.tp-reminder-wrap > .reminder-card { height: 100%; margin: 0; }
.tp-feedback { grid-column: 1 / -1; }
.tp-feedback article { padding: 14px 0; border-top: 1px solid var(--line); font-size: .83rem; }
.tp-feedback article p { line-height: 1.6; }
.tp-program-context { padding: 24px; margin-bottom: 24px !important; }
.trainer-polish .program-context { padding: 0; background: none; border: 0; margin: 20px 0 0; }
.trainer-polish .program-selector { min-width: 0; flex: 1 1 200px; }
.trainer-polish .program-selector select { width: 100%; }
.tp-timeline-wrap { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.tp-timeline-wrap > summary { font-size: .82rem; font-weight: 700; padding: 8px 0; }
.tp-timeline-wrap > summary > span { font-weight: 400; color: var(--muted); margin-left: 10px; }
.tp-timeline { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 12px; margin-top: 14px; }
.tp-timeline > button { border: 1px solid var(--line); border-radius: 13px; padding: 16px; background: var(--paper); display: grid; gap: 10px; text-align: left; }
.tp-timeline > button[aria-pressed=true] { background: #f0f6e5; border-color: #bfd397; box-shadow: inset 0 0 0 1px #bfd397; }
.tp-block-step { display: flex; justify-content: space-between; align-items: center; color: #65764c; font-size: .75rem; }
.tp-block-step > span { font-size: .67rem; }
.tp-timeline strong { font-size: .86rem; line-height: 1.5; }
.tp-timeline small { font-size: .69rem; color: var(--muted); line-height: 1.5; }
.tp-subnav { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; background: #eaece5; border: 1px solid var(--line); border-radius: 13px; margin: 0 0 24px; width: fit-content; max-width: 100%; }
.tp-subnav button { min-height: 44px; padding: 10px 16px; border: 0; background: none; border-radius: 9px; font-size: .8rem; font-weight: 650; color: #62675a; }
.tp-subnav [aria-pressed=true] { background: white; color: var(--ink); box-shadow: 0 2px 6px #1c241010; }
.tp-subnav b { display: inline-block; min-width: 20px; border-radius: 20px; background: var(--lime); color: #263114; margin-left: 8px; padding: 2px 5px; font-size: .65rem; }
.tp-intelligence-primary { background: #f0f5e7; }
.tp-intelligence-grid p { font-size: .83rem; line-height: 1.75; color: var(--muted); }
.tp-intelligence-points { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 24px; font-size: .74rem; color: #62724c; }
.tp-intelligence-points span { border-top: 1px solid #dbe4ce; padding-top: 10px; }
.tp-setup { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.tp-setup p { margin-bottom: 0; }
.trainer-polish .workout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
.trainer-polish .workout-card { min-width: 0; }
.tp-day-exercises { margin: 16px 0; border-block: 1px solid var(--line); }
.tp-day-exercises > summary { padding: 14px 0; font-size: .76rem; font-weight: 650; color: var(--muted); }
.tp-day-exercises .exercise-preview { margin-top: 0; }
.trainer-polish .week-navigator { flex-wrap: wrap; margin: 16px 0; }
.trainer-polish .week-navigator strong { font-size: .85rem; }
.tp-empty { padding: 20px; background: #f3f4ee; border-radius: 12px; font-size: .85rem; line-height: 1.65; }
.tp-empty p { margin: 8px 0 0; color: var(--muted); }
.tp-history-picker { display: grid; margin: 20px 0; gap: 8px; }
.tp-progress-overview { margin-bottom: 22px !important; }
.tp-explore { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.tp-explore > button { background: white; border: 1px solid var(--line); padding: 22px; border-radius: 16px; display: grid; grid-template-columns: minmax(0,1fr) 22px; gap: 8px 12px; text-align: left; }
.tp-explore strong { font-size: .9rem; }
.tp-explore span { grid-column: 1; font-size: .77rem; color: var(--muted); line-height: 1.5; }
.tp-explore .ui-icon { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.tp-details { margin: 20px 0 0; }
.tp-details dt { font-size: .72rem; color: var(--muted); margin-top: 20px; }
.tp-details dd { margin: 6px 0 0; font-size: .85rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.tp-account { grid-column: 1 / -1; }
.tp-account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.tp-question-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.tp-question-toolbar .tp-subnav { margin: 0; }
.tp-question-toolbar select { min-width: 180px; max-width: 100%; }
.tp-conversations { display: grid; gap: 18px; }
.tp-conversation { border: 1px solid var(--line); border-radius: 18px; background: white; overflow: hidden; }
.tp-conversation > summary { display: flex; align-items: center; gap: 14px; padding: 22px; }
.tp-conversation > summary > span:nth-child(2) { flex: 1; min-width: 0; }
.tp-conversation > summary strong { font-size: .95rem; }
.tp-conversation > summary small { display: block; margin-top: 7px; font-size: .79rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-conversation .ui-badge { font-size: .64rem; white-space: nowrap; }
.tp-conversation .ask-history { padding: 0 22px 22px; }
.tp-conversation .ask-history-item { margin: 0; box-shadow: none; }
/* Existing adaptive controls, in focused sections; only Trainer receives these styles. */
.trainer-adaptive .adaptive-panel { width: min(1180px,100%); background: #f6f6f1; }
.trainer-adaptive .adaptive-body { gap: 20px; }
.trainer-adaptive .adaptive-panel > header { background: #f6f6f1; }
.trainer-adaptive .adaptive-panel > header h2 { letter-spacing: -.04em; }
.trainer-adaptive .adaptive-panel button { min-height: 44px; }
.trainer-adaptive .adaptive-panel nav [aria-pressed=true] { background: #d3f56e; color: #273019; }
.trainer-adaptive .adaptive-workflow { background: #eff5e4; border-color: #d6e4bf; padding: 24px; }
.trainer-adaptive .adaptive-health { background: white; padding: 22px; border: 1px solid #e0e4d8; border-radius: 14px; }
.trainer-adaptive .adaptive-panel [data-trainer-section] { background: white; border-radius: 16px; padding: 20px; }
.trainer-adaptive [data-trainer-section] > summary { min-height: 30px; font-size: 1rem; }
.trainer-adaptive [data-trainer-section] > div { display: grid; gap: 16px; margin-top: 20px; }
.trainer-adaptive .adaptive-panel fieldset { margin: 0; }
.trainer-adaptive .adaptive-panel table th { background: #f1f3ec; font-size: .75rem; }
.trainer-adaptive .adaptive-panel [data-adaptive=publish], .trainer-adaptive .adaptive-panel [data-adaptive=save-generate] { background: #c2f24c; color: #202719; border-color: #b4e83e; }
.trainer-adaptive .adaptive-card > .adaptive-actions { padding-top: 14px; border-top: 1px solid var(--line); }
@media(min-width:1440px) {
  .tp-workspace-layout { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 24px; }
  .tp-client-rail { display: flex; flex-direction: column; align-self: start; gap: 8px; position: sticky; top: 110px; max-height: calc(100dvh - 150px); overflow: auto; padding-right: 16px; border-right: 1px solid var(--line); }
  .tp-client-rail > button:not(.text-button) { display: flex; align-items: center; gap: 9px; text-align: left; background: none; border: 0; border-radius: 10px; padding: 10px 8px; font-size: .76rem; }
  .tp-client-rail > button[aria-current=true] { background: #eaf1dd; }
  .tp-client-rail .avatar { width: 30px; height: 30px; font-size: .65rem; flex-shrink: 0; }
}
@media(max-width:1000px) {
  .tp-command { grid-template-columns: 1fr; gap: 10px; }
  .tp-command-stats > :first-child { border-left: 0; padding-left: 0; }
  .tp-overview-grid, .tp-intelligence-grid, .tp-details-grid { gap: 16px; }
  .trainer-polish .workout-grid { grid-template-columns: 1fr; }
}
@media(max-width:650px) {
  .trainer-polish { --tp-gap: 16px; }
  .tp-command { padding: 22px 18px; margin-bottom: 22px; }
  .tp-command-stats { gap: 8px; }
  .tp-command-stats strong { font-size: 1.8rem; }
  .tp-command-stats span { font-size: .67rem; }
  .tp-roster-tools .ui-tabs { width: 100%; }
  .tp-roster-tools .ui-search { min-width: 150px; }
  .tp-roster-tools > .button { font-size: .7rem; padding-inline: 10px; }
  .tp-roster-footer { flex-direction: column; }
  .tp-roster-footer .text-button { align-self: flex-start; }
  .tp-client-workspace .ui-client-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; width: 100%; }
  .tp-client-workspace .ui-client-tabs button { padding: 12px 5px; font-size: .76rem; min-height: 44px; }
  .tp-overview-grid, .tp-details-grid, .tp-metric-grid, .tp-intelligence-grid, .tp-explore { grid-template-columns: 1fr; }
  .tp-overview-grid > .ui-surface, .tp-details-grid > .ui-surface, .tp-intelligence-grid > .ui-surface, .tp-program-context { padding: 20px 16px; }
  .tp-section-top { flex-wrap: wrap; }
  .tp-section-top > .button { font-size: .75rem; }
  .tp-setup { display: block; }
  .tp-setup .button { margin-top: 18px; }
  .tp-stat-row { gap: 12px; }
  .tp-stat-row > div + div { padding-left: 12px; }
  .tp-stat-row strong { font-size: 1.25rem; }
  .tp-stat-row span { font-size: .68rem; }
  .tp-timeline { grid-template-columns: 1fr; }
  .tp-timeline > button { grid-template-columns: 1fr 1fr; gap: 7px 12px; }
  .tp-timeline .tp-block-step, .tp-timeline strong { grid-column: 1 / -1; }
  .tp-subnav { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tp-subnav button { padding: 10px 6px; font-size: .73rem; }
  .tp-program-context + .tp-subnav { grid-template-columns: 1fr 1.4fr 1fr; }
  .tp-program-context + .tp-subnav button { font-size: .68rem; }
  .tp-program-context + .tp-subnav b { margin-left: 3px; }
  .trainer-polish .volume-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .trainer-polish .volume-card { padding: 15px 12px; }
  .trainer-polish .progress-panel { grid-template-columns: 1fr; }
  .trainer-polish .progress-section { padding: 18px 14px; }
  .tp-question-toolbar { display: block; }
  .tp-question-toolbar .tp-subnav { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .tp-question-toolbar select { width: 100%; margin-top: 12px; }
  .tp-conversation > summary { padding: 18px 14px; gap: 10px; flex-wrap: wrap; }
  .tp-conversation > summary .avatar { width: 34px; height: 34px; font-size: .75rem; }
  .tp-conversation .ui-badge { font-size: .6rem; }
  .tp-conversation .ask-history { padding: 0 14px 14px; }
  .trainer-adaptive .adaptive-panel { padding: 0 max(14px,env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); }
  .trainer-adaptive .adaptive-panel > header { top: 0; padding: calc(16px + env(safe-area-inset-top)) 0 16px; }
  .trainer-adaptive .adaptive-panel > header h2 { font-size: 1.4rem; }
  .trainer-adaptive .adaptive-panel > header button { min-width: 44px; }
  .trainer-adaptive .adaptive-health { padding: 16px; }
  .trainer-adaptive .adaptive-workflow, .trainer-adaptive .adaptive-panel [data-trainer-section] { padding: 18px 14px; }
}

.tp-roster-tools .workspace-picker { margin: 0; min-width: 170px; }
.trainer-polish { min-width:0; max-width:100%; overflow-wrap:anywhere; }
.trainer-polish .ui-surface, .trainer-polish .ui-page-heading > div,
.trainer-polish .tp-section-top > div, .trainer-polish .ui-client-copy { min-width:0; }
.trainer-polish select { min-width:0; max-width:100%; }
.tp-draft-entry { display:flex; flex-wrap:wrap; align-items:center; gap:20px; margin-bottom:24px; }
.tp-draft-entry > div { flex:1 1 260px; min-width:0; }
.tp-draft-entry .tp-caption { margin:10px 0 0; }
.tp-draft-entry > .button { flex:0 1 auto; }
/* A tablet has less workspace after the persistent navigation, even when its
   viewport is wider than the phone breakpoint. Let cards use that full space. */
@media(min-width:651px) and (max-width:1000px) {
  .tp-overview-grid, .tp-details-grid, .tp-intelligence-grid, .tp-metric-grid, .tp-explore { grid-template-columns:minmax(0,1fr); }
  .tp-section-top, .tp-setup { flex-wrap:wrap; }
}
.tp-conversation > .coach-question { margin: 0 22px 22px; border: 0; border-top: 1px solid var(--line); padding: 20px 0 0; background: white; }
@media(max-width:650px){.tp-roster-tools .workspace-picker{width:100%}.tp-conversation > .coach-question{margin:0 14px 14px}}
