.cp-body { display: flex; flex-direction: column; gap: 12px; }
.cp-editor-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cp-history { border: 1px solid var(--line); border-radius: var(--radius-l); min-width: 0; background: var(--paper); }
.cp-history > summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; min-height: 48px; cursor: pointer; font-size: var(--text-14); font-weight: 600; list-style: none; }
.cp-history > summary::-webkit-details-marker { display: none; }
.cp-history > summary svg { width: 18px; height: 18px; transform: rotate(90deg); }
.cp-history[open] > summary svg { transform: rotate(-90deg); }
.cp-history-content { padding: 0 16px 16px; font-size: var(--text-13); }
.cp-history-content select { margin: 8px 0 12px; width: 100%; max-width: 100%; }
.cp-history-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: var(--text-13); }
.cp-history-table th, .cp-history-table td { padding: 10px 5px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.cp-history-table th:first-child { width: 42px; }
.cp-history-table thead th { color: var(--muted); font-weight: 500; }
.cp-history-table small { display: block; margin-top: 5px; color: var(--muted); font-size: var(--text-10); }
.cp-history-note { margin-top: 16px; font-size: var(--text-12); }
.cp-history-note strong { color: var(--muted); font-weight: 500; }
.cp-history-note p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; line-height: 1.5; }
.cp-history-empty { margin: 0; line-height: 1.5; color: var(--muted); }
.cp-warmup-option { display: flex; align-items: center; gap: 9px; min-height: 44px; font-size: var(--text-14); }
.cp-warmup-option input { width: 19px; height: 19px; accent-color: var(--accent); }
.cp-warmup-hint { margin: -8px 0 0 28px; }
.warmup-editor { display: grid; gap: 16px; }
.warmup-editor-row { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.warmup-row-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.warmup-row-heading strong { flex: 1; min-width: 0; }
.warmup-editor-fields { display: flex; gap: 10px; margin-bottom: 12px; }
.warmup-editor-fields label { flex: 1; min-width: 0; font-size: var(--text-12); color: var(--muted); }
.warmup-editor .form-input { width: 100%; min-width: 0; margin-top: 6px; }
@media (min-width: 1000px) {
  #modal:has(.cp-with-history) { width: min(1080px, calc(100vw - 64px)); max-width: 1080px; }
  .cp-body.cp-with-history { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(300px,1fr); align-items: start; gap: 24px; }
  .cp-history { position: sticky; top: 0; }
}
@media (max-width: 999px) { .cp-history { order: -1; } }
.cp-body .cp-back { align-self: flex-start; margin: -4px 0 4px; min-height: 40px; }
.cp-body .form-label { margin-bottom: 0; }
.cp-body .form-input { min-width: 0; font-size: var(--text-16); }
.cp-body .button[data-cp="add-day"] { min-height: 48px; background: var(--tint); border-color: var(--focus, #8eaef9); color: var(--hover, #1b44af); font-weight: 600; }
.cp-body .button[data-cp="add-day"]:hover:not(:disabled) { background: #d2e0ff; }
.cp-list { display: grid; gap: 0; min-width: 0; }
.cp-picker-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 3px; border-radius: var(--radius-m); background: var(--surface, var(--surface)); }
.cp-picker-tabs button { min-height: 44px; border: 1px solid transparent; border-radius: var(--radius-m); background: transparent; color: var(--muted, var(--muted)); font: inherit; font-size: var(--text-13); cursor: pointer; }
.cp-picker-tabs button[aria-pressed="true"] { border-color: var(--line, var(--line)); background: var(--paper, var(--paper)); color: var(--ink, var(--ink)); }
.cp-picker-tabs button:focus-visible { outline: 2px solid var(--accent, #2d59ce); outline-offset: 2px; }
.cp-row { display: flex; width: 100%; min-height: 66px; align-items: center; gap: 12px; padding: 14px 2px; text-align: left; border: 0; border-bottom: 1px solid var(--line, var(--line)); background: transparent; color: inherit; cursor: pointer; }
.cp-row > span:not(.cp-number) { flex: 1; min-width: 0; }
.cp-row strong { display: block; font-size: var(--text-15); font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.cp-row small { display: block; margin-top: 4px; color: var(--muted, var(--muted)); line-height: 1.5; font-size: var(--text-12); overflow-wrap: anywhere; }
.cp-row svg { width: 18px; height: 18px; flex-shrink: 0; }
.cp-row.is-selected { background: var(--fill); }
.cp-number { width: 24px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted, var(--muted)); }
.cp-day-row { display: flex; align-items: center; border-bottom: 1px solid var(--line, var(--line)); }
.cp-day-row .cp-row { flex: 1; min-width: 0; border-bottom: 0; }
.cp-day-delete { flex: 0 0 44px; width: 44px; min-width: 44px; border: 0; background: transparent; color: var(--muted, var(--muted)); }
.cp-delete-day { align-self: flex-start; min-height: 44px; color: var(--danger, var(--danger)); }
.cp-drafts-button { margin-top: 8px; }
.cp-plan-card { padding: 4px 0 12px; border-bottom: 1px solid var(--line, var(--line)); }
.cp-plan-card .cp-row { border: 0; }
.cp-plan-links, .cp-tools, .cp-group-links { display: flex; gap: 12px; flex-wrap: wrap; }
.cp-plan-links { justify-content: space-between; }
.cp-plan-links .text-button, .cp-group-links .text-button { min-height: 44px; }
.cp-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.cp-section-head strong { font-size: var(--text-14); font-weight: 500; }
.cp-section-head .text-button { min-height: 44px; }
.cp-exercise-row { min-width: 0; }
.cp-exercise-row .cp-row { -webkit-touch-callout: none; user-select: none; touch-action: pan-y; }
.cp-grouped { border-left: 2px solid #b9cbdc; padding-left: 10px; background: var(--surface); }
.cp-row .cp-group-label { margin-top: 0; color: var(--muted); }
.cp-coach-comment { display: grid; gap: 8px; margin-top: 16px; }
.cp-coach-comment .form-label { margin: 0; }
.cp-coach-comment textarea { min-height: 86px; height: auto; padding: 11px 12px; line-height: 1.5; resize: vertical; }
.cp-coach-comment .form-help { margin: 0; }
.cp-options { margin-top: 8px; }
.cp-options summary { cursor: pointer; padding: 12px 0; min-height: 44px; font-size: var(--text-13); color: var(--muted, var(--muted)); }
.cp-options .cp-tools { padding: 8px 0; }
.cp-set-head, .cp-set-part { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.cp-set-head { font-size: var(--text-11); color: var(--muted, var(--muted)); text-align: center; margin-top: 6px; }
.cp-set { padding: 8px 0; border-bottom: 1px solid var(--line, var(--line)); }
.cp-set-part + .cp-set-part { margin-top: 8px; }
.cp-set-part .form-input { padding: 10px 6px; text-align: center; min-height: 44px; }
.cp-set-number { text-align: center; color: var(--muted, var(--muted)); font-size: var(--text-13); }
.cp-drop { min-height: 44px; margin-left: 56px; font-size: var(--text-12); }
.cp-period { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.cp-period .form-input { margin-top: 8px; width: 100%; max-width: 100%; }
.cp-actions { position: sticky; bottom: 0; background: var(--paper); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.cp-assigned-program { padding: 14px 0; border-bottom: 1px solid var(--line, var(--line)); }
.cp-assigned-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cp-assigned-heading strong { min-width: 0; overflow-wrap: anywhere; }
.cp-assigned-heading .text-button { min-height: 44px; flex-shrink: 0; font-size: var(--text-13); }
.cp-assigned-program strong { display: block; font-size: var(--text-15); font-weight: 500; }
.cp-assigned-controls { display: flex; flex-direction: column; align-items: flex-end; margin-top: 2px; }
.cp-assigned-controls .text-button { min-height: 44px; color: var(--muted, var(--muted)); font-size: var(--text-13); }
.cp-assigned-controls .cp-assigned-view { color: var(--accent, #2d59ce); }
.cp-preview-day + .cp-preview-day { margin-top: 28px; }
.cp-preview-day > h3 { margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line, var(--line)); font-size: var(--text-16); line-height: 1.5; overflow-wrap: anywhere; }
.cp-preview-exercise { padding: 18px 0; border-bottom: 1px solid var(--line, var(--line)); }
.cp-preview-exercise h4 { margin: 0; font-size: var(--text-15); font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.cp-preview-goal, .cp-preview-note { margin: 12px 0 0; font-size: var(--text-13); line-height: 1.7; overflow-wrap: anywhere; }
.cp-preview-note { color: var(--muted, var(--muted)); white-space: pre-wrap; }
.cp-create-plan { min-height: 44px; margin-top: 4px; padding-left: 0; }
.cp-body > div > .form-label { display: block; margin-bottom: 8px; }
.cp-assigned-program small { display: block; color: var(--muted, var(--muted)); margin-top: 6px; font-size: var(--text-12); line-height: 1.6; }
.cp-calendar-recommendations { margin: 20px 0; }
.cp-calendar-recommendations > summary { min-height: 44px; cursor: pointer; font-size: var(--text-14); }
.account-staff-tools { flex-wrap: wrap; margin: 0 0 24px; align-items: center; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
@media (max-width: 380px) {
  .cp-set-head, .cp-set-part { grid-template-columns: 35px minmax(0,1fr) minmax(0,1fr) 38px; gap: 5px; }
  .cp-set-part .icon-button { width: 38px; min-width: 38px; }
  .cp-drop { margin-left: 40px; }
  .cp-period { gap: 8px; }
  .cp-period .form-input { padding-left: 8px; padding-right: 8px; }
}

.cp-bulk { display: grid; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line, var(--line)); }
.cp-bulk-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cp-bulk-fields > div { min-width: 0; }
.cp-bulk-fields label { display: block; margin-bottom: 7px; color: var(--muted, var(--muted)); font-size: var(--text-12); }
.cp-bulk-fields .form-input { width: 100%; min-height: 44px; padding: 10px 8px; text-align: center; }
.cp-bulk .cp-bulk-hint { margin: 0; font-size: var(--text-12); }
.cp-bulk .account-form-error { margin: 0; }
@media (max-width: 700px), (max-width: 1200px) and (max-height: 600px) {
  #modal[data-view="coach-plans"] .cp-back { display: none; }
}
