:root {
  --ink: #172033;
  --muted: #687185;
  --paper: #f5f4ef;
  --canvas: #fffefa;
  --line: #e0e2e4;
  --accent: #f3c900;
  --accent-soft: #fff7cc;
  --green: #28724f;
  --green-soft: #e4f1e8;
  --amber: #805a16;
  --blue-soft: #edf3fb;
}
* { box-sizing: border-box; }
body { margin: 0; background: #222625; color: var(--ink); font-family: Arial, "Segoe UI", sans-serif; font-size: 16px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; border: 1px solid #d9dce0; background: #fff; color: var(--ink); border-radius: 9px; padding: 9px 14px; cursor: pointer; }
button:hover { border-color: #d2b300; background: #fff9d8; }
button:active { background: #f4eaa9; }
button:disabled { opacity: .38; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #a88700; outline-offset: 2px; }
.demo-bar { text-align: center; font-size: 11px; background: #f4f0e4; color: #605b4c; padding: 7px 12px; }
.topbar { display: flex; gap: 26px; align-items: center; padding: 15px 4%; color: #f8f7f2; background: #222625; border-bottom: 1px solid #3b403e; }
.brand { text-decoration: none; color: #fff; display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: 23px; }
.brand-icon { width: 42px; height: 42px; background: var(--accent); color: #202522; border-radius: 50%; display: grid; place-items: center; font-family: Georgia, serif; }
.brand small { display: block; font-weight: 400; font-size: 12px; margin-top: 2px; color: #c8ceca; }
nav { display: flex; gap: 5px; }
nav button { border: 0; border-radius: 0; background: transparent; color: #d5dad6; font-size: 14px; }
nav button:hover { background: #343a37; color: #fff; }
nav .active { color: var(--accent); border-bottom: 3px solid var(--accent); font-weight: 700; }
#save-status { margin-inline-start: auto; font-size: 12px; color: #e0e4e1; max-width: 260px; }
#save-status.error { color: #ffb5a8; }
main { width: min(1440px, calc(100% - 44px)); margin: 0 auto 24px; padding: 22px 24px 34px; background: var(--canvas); border: 1px solid #e2e1dc; border-radius: 14px; }
.session-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 22px; }
.eyebrow { font-size: 12px; color: var(--green); font-weight: 700; letter-spacing: .2px; }
h1 { font-size: 30px; line-height: 1.2; margin: 6px 0; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0; }
.subline { font-size: 13px; color: var(--muted); margin: 7px 0; }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.controls .demo-toggle { font-size: 12px; background: transparent; border-style: dashed; }
.workspace { display: grid; grid-template-columns: minmax(210px, 20%) minmax(0, 1fr); gap: 18px; align-items: start; }
.roster { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 16px 11px; position: sticky; top: 14px; }
.roster-header { padding: 0 7px 10px; }
.roster-header h2 { font-size: 17px; margin-bottom: 6px; }
.count { font-size: 12px; color: var(--muted); }
.roster-item { width: 100%; display: flex; text-align: start; align-items: center; gap: 10px; border: 1px solid transparent; background: #fff; padding: 11px 8px; margin: 4px 0; border-radius: 9px; min-height: 68px; }
.roster-item:hover { background: #fffbea; }
.roster-item.selected { border-color: #e2c324; background: var(--accent-soft); box-shadow: inset -3px 0 var(--accent); }
.roster-item strong { font-size: 15px; display: block; }
.roster-item small { font-size: 11px; display: block; color: var(--muted); margin-top: 4px; }
.avatar { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #eeefeb; color: #4e5b54; font-weight: 700; font-size: 15px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 82px; height: 82px; font-size: 27px; border: 3px solid var(--accent); background: #292d2b; color: #fff; }
.avatar.big img { cursor: zoom-in; }
.status-tag { display: inline-block; font-size: 11px!important; padding: 3px 7px; border-radius: 5px; background: #f0f1ef; margin-top: 5px; color: #59615b!important; }
.status-tag.done { background: var(--green-soft); color: #286143!important; }
.status-tag.pending { background: #fff3d5; color: var(--amber)!important; }
.roster-summary { margin: 15px 7px 3px; padding: 12px 10px; border-top: 1px solid var(--line); color: var(--muted); }
.roster-summary:empty { display: none; }
.roster-summary-title { font-size: 12px; }
.roster-summary-count { font-size: 17px; font-weight: 700; color: var(--ink); margin-top: 5px; }
.roster-summary small { display: block; font-size: 11px; margin-top: 6px; }
.progress-track { height: 5px; margin-top: 8px; border-radius: 4px; background: #eceeea; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--green); }
.card { border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 20px; margin-bottom: 14px; }
.profile-hero { padding: 19px; }
.person-head { display: flex; align-items: center; gap: 17px; }
.person-head .details { flex: 1; min-width: 0; }
.profile-heading-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.profile-heading-line h2 { font-size: 29px; margin: 0 0 6px; }
.identity-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pill { display: inline-block; font-size: 11px; border-radius: 6px; padding: 4px 8px; background: #e8f0ed; color: var(--green); }
.pill.historical { background: #edf0f4; color: #536371; }
.intake-state { font-size: 11px; color: var(--green); }
.intake-state.missing { color: var(--amber); }
.intake-link { min-height: 30px; padding: 4px 9px; font-size: 11px; border-radius: 7px; }
.gender-row { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.gender-label, .gender-hint { font-size: 11px; color: var(--muted); }
.gender-switch { display: inline-flex; align-items: center; gap: 4px; }
.gender-switch button { min-height: 31px; min-width: 34px; padding: 2px 6px; border-radius: 7px; font-size: 19px; line-height: 1; color: #737a7a; background: #f4f5f3; }
.gender-switch button[aria-pressed="true"] { color: #202522; background: var(--accent); border-color: #ddbb00; }
.gender-switch button svg { display: block; width: 24px; height: 24px; fill: currentColor; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.gender-other { font-size: 11px; color: var(--muted); }
.quick-facts { display: flex; align-items: flex-start; gap: 0; flex: none; margin: 2px 0 0; }
.fact { min-width: 90px; padding: 0 13px; text-align: center; border-inline-start: 1px solid var(--line); }
.fact:first-child { border-inline-start: 0; }
.fact small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.fact strong { font-size: 15px; white-space: nowrap; }
.person-actions { display: flex; align-items: center; flex-direction: column; gap: 5px; }
.person-actions button { min-height: 34px; font-size: 11px; padding: 5px 9px; }
.person-actions .subline { font-size: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-title h2 { margin: 0; }
.section-title small, .hint { color: var(--muted); font-size: 11px; line-height: 1.6; }
.profile-mode { display: flex; width: fit-content; gap: 0; margin: 0 0 14px auto; padding: 3px; border: 1px solid #dfe2e2; border-radius: 9px; background: #f3f4f2; }
.profile-mode button { min-height: 35px; min-width: 112px; border: 0; background: transparent; font-size: 13px; }
.profile-mode button[aria-pressed="true"] { background: var(--accent); border-radius: 7px; font-weight: 700; }
.profile-panels { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(260px,1fr); gap: 14px; align-items: start; }
.exercise-row { display: grid; grid-template-columns: minmax(95px,1fr) 86px minmax(105px,1fr); gap: 9px; align-items: center; padding: 8px 5px; border-bottom: 1px solid #eceeeb; }
.exercise-row:last-child { border-bottom: 0; }
.exercise-name { font-size: 13px; font-weight: 700; }
.exercise-name small { display: block; font-weight: 400; font-size: 10px; margin-top: 3px; color: var(--muted); }
label.weight { display: flex; align-items: center; gap: 4px; }
input, select, textarea { background: #fafbf9; color: var(--ink); border: 1px solid #d9dddf; border-radius: 7px; min-height: 40px; padding: 7px 8px; max-width: 100%; width: 100%; }
input[type=number] { text-align: center; direction: ltr; font-size: 16px; }
label.weight span { font-size: 10px; color: var(--muted); white-space: nowrap; }
select { font-size: 11px; }
textarea { resize: vertical; min-height: 64px; }
.skill-row, .workshop { display: flex; align-items: center; gap: 9px; padding: 8px 5px; border-bottom: 1px solid #eceeeb; }
.skill-row:last-of-type, .workshop:last-of-type { border-bottom: 0; }
.skill-row label, .workshop label { flex: 1; font-size: 13px; }
.skill-row select { width: 120px; }
.workshop select { width: 116px; }
.workshop-panel { max-width: 850px; }
.workshop-lock-note { padding: 9px 11px; background: var(--blue-soft); border-radius: 7px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 1px solid #b7beb3; }
.white { background: #fff; }
.yellow { background: #e9c54c; }
.green { background: #60966c; }
.orange { background: #df9350; }
.red { background: #c75c56; }
.callout { font-size: 11px; color: var(--amber); background: #fff8e8; border: 1px solid #efe3c5; border-radius: 7px; padding: 9px; line-height: 1.5; margin-top: 12px; }
.coach-attention { margin-top: 0; }
.alerts { display: flex; gap: 7px; flex-wrap: wrap; margin: 8px 0 10px; }
.alerts button { min-height: 37px; font-size: 11px; padding: 6px 10px; }
.alerts button[aria-pressed="true"] { background: var(--accent); border-color: #ddbb00; color: #302906; }
.alert-summary { background: #fff8e8; border-right: 3px solid #d6a746; border-radius: 7px; padding: 10px 12px; margin-top: 14px; line-height: 1.5; font-size: 13px; }
.after-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.after-actions button { min-height: 37px; font-size: 11px; padding: 6px 10px; }
.after-actions .chosen { background: var(--green-soft); border-color: #9bbda7; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.empty .empty-symbol { font-size: 34px; color: #b3bfae; margin-bottom: 12px; }
.empty h2 { color: var(--ink); }
.search { margin: 12px 0 0; font-size: 12px; }
.intake-admin { margin-top: 14px; }
.audit { margin-top: 14px; font-size: 10px; color: var(--muted); line-height: 1.7; }
.note-label { display: block; font-size: 11px; margin: 10px 0 6px; }
.read-only { opacity: .7; }
footer { max-width: 1440px; margin: 0 auto; text-align: center; font-size: 11px; color: #b6bfba; padding: 0 20px 22px; }
dialog { border: 1px solid var(--line); border-radius: 10px; max-width: 90vw; }
dialog img { max-height: 65vh; max-width: 75vw; }
dialog::backdrop { background: #172e29aa; }
/* Mockup-alignment pass: preserve the current app structure, adopt the Goldberg surface language. */
:root {
  --ink: #101827;
  --muted: #657083;
  --paper: #f8f7f3;
  --canvas: #fff;
  --line: #d9dcdf;
  --accent: #ffdc00;
  --accent-soft: #fff8d8;
  --green: #26784e;
  --green-soft: #e5f2e9;
  --amber: #a56e00;
  --blue-soft: #eef3f7;
}
body {
  background: #191a19 url("assets/goldberg-frame-texture.png") center top / cover fixed;
  color: var(--ink);
}
.topbar {
  min-height: 78px;
  padding-block: 13px;
  background: #1e2020 url("assets/goldberg-frame-texture.png") center 34% / cover;
  border-bottom: 1px solid #3c3f3d;
}
.brand-icon {
  width: 46px;
  height: 46px;
  border: 1px solid #d4d4d1;
  background: #f7f7f3;
  color: #202321;
  font-family: Georgia, serif;
  font-size: 22px;
}
.brand-name { font-family: Georgia, "Times New Roman", serif; letter-spacing: .16em; }
.brand-name small { font-family: Arial, "Segoe UI", sans-serif; letter-spacing: 0; }
main {
  width: min(1440px, calc(100% - 52px));
  margin-top: 0;
  padding: 22px 22px 24px;
  background: #fff;
  border: 1px solid #e2e3e4;
  border-radius: 13px;
  box-shadow: none;
}
.session-head { margin-bottom: 18px; }
.session-head h1 { font-size: clamp(23px, 2.15vw, 34px); letter-spacing: .005em; }
.workspace { grid-template-columns: minmax(245px, 22%) minmax(0, 1fr); gap: 16px; }
.roster { padding: 16px 14px; border-radius: 12px; background: #fff; }
.roster-header { padding-inline: 6px; }
.roster-header h2 { font-size: 23px; }
.count { font-size: 15px; }
.roster-item { min-height: 86px; padding: 10px 9px; border-radius: 9px; }
.roster-item.selected { border-color: #e6c400; background: #fff9dc; box-shadow: inset -3px 0 var(--accent); }
.roster-item strong { font-size: 19px; }
.roster-item small { font-size: 13px; }
.avatar { width: 58px; height: 58px; font-size: 20px; }
.avatar.big { width: 168px; height: 168px; font-size: 44px; border-width: 4px; background: #242625; }
.card { border-radius: 12px; box-shadow: none; }
.profile-hero { padding: 20px; }
.person-head { align-items: flex-start; gap: 22px; }
.portrait-column { flex: none; width: 176px; text-align: center; }
.portrait { position: relative; width: fit-content; margin: 0 auto; }
.photo-button {
  position: absolute;
  left: -5px;
  bottom: 0;
  min-height: 0;
  width: 48px;
  height: 48px;
  padding: 3px;
  border: 1px solid #cfd3d7;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
}
.photo-button:hover { background: #fff; border-color: #b6a200; }
.photo-button img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.photo-state { display: block; margin-top: 8px; font-size: 11px; color: var(--muted); }
.person-head .details { min-width: 0; }
.profile-heading-line { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(310px, 1.45fr); align-items: end; gap: 12px; }
.profile-heading-line h2 { font-size: clamp(32px, 3.1vw, 46px); line-height: 1.1; margin-bottom: 8px; }
.identity-line { min-height: 28px; }
.pill { padding: 5px 10px; font-size: 12px; }
.gender-row { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
.gender-switch button { min-width: 50px; min-height: 38px; border-radius: 7px; font-size: 22px; background: #f7f7f6; border-color: #d7dade; }
.gender-switch button svg { width: 25px; height: 25px; }
.gender-switch button[aria-pressed="true"] { background: var(--accent); border-color: #e1c200; }
.gender-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 74px; padding-inline: 9px; color: var(--ink); font-size: 12px; font-weight: 700; }
.gender-switch button svg { display: none; }
.gender-switch button::before { content: none; }
.gender-switch .gender-athlete-icon { display: block; flex: none; width: 32px; height: 34px; object-fit: contain; }
.gender-switch button[data-gender="female"]::after { content: "אישה"; }
.gender-switch button[data-gender="male"]::after { content: "גבר"; }
.quick-facts { align-self: end; width: 100%; justify-content: space-around; margin-bottom: 2px; }
.quick-facts .fact { min-width: 0; flex: 1; padding: 0 13px; }
.fact small { font-size: 13px; }
.fact strong { font-size: 21px; }
.intake-link { min-height: 29px; }
.profile-mode { margin-top: 4px; margin-bottom: 14px; }
.profile-mode button { min-height: 40px; min-width: 132px; font-weight: 600; }
.profile-panels { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 16px; }
.profile-panels .card { padding: 18px; }
.section-title { margin-bottom: 9px; }
.section-title h2 { font-size: 22px; }
.section-title small, .hint { font-size: 12px; }
.exercise-row { grid-template-columns: minmax(112px, 1fr) minmax(150px, 1.2fr) minmax(92px, .85fr); gap: 8px; min-height: 45px; padding: 6px 2px; }
.exercise-name { font-size: 15px; }
.exercise-name small { font-size: 11px; }
.weight-control { display: flex; align-items: center; gap: 5px; min-width: 0; }
.weight-step { min-width: 38px; width: 38px; min-height: 38px; padding: 0; border: 0; border-radius: 8px; background: #e6e8e9; color: var(--ink); font-size: 23px; font-weight: 700; }
.weight-step:hover { background: #dadddf; }
.weight-step.plus { background: var(--accent); color: #191a17; }
.weight-step.plus:hover { background: #f3d000; }
.weight-value { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; }
.weight-value input { min-height: 38px; padding: 4px; border-color: #d5d8dc; background: #fff; font-weight: 700; }
.weight-value input[readonly] { background: #fff; cursor: default; }
.weight-value span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.core-weight-control { flex-wrap: wrap; }
.weight-presets { display: inline-flex; gap: 4px; }
.weight-preset { min-height: 34px; padding: 4px 8px; border: 1px solid #d5d8dc; border-radius: 7px; background: #f1f2f2; font-size: 11px; font-weight: 600; white-space: nowrap; }
.weight-preset[aria-pressed="true"] { background: var(--accent); border-color: #e1c200; }
.core-weight-control .weight-value { flex: 1 1 72px; }
.weight-error { flex: 1 1 100%; font-size: 12px; line-height: 1.5; color: #a12b1d; }
[data-weight][aria-invalid="true"] { border-color: #a12b1d; }
.weight-step:disabled { opacity: .42; cursor: not-allowed; }
.exercise-row select { min-height: 38px; padding: 5px 7px; font-size: 11px; }
.skill-row, .workshop { min-height: 43px; gap: 8px; padding: 5px 2px; }
.skill-row label, .workshop label { font-size: 15px; font-weight: 600; }
.segmented { display: inline-flex; flex: none; border: 1px solid #d5d8dc; border-radius: 7px; overflow: hidden; background: #fff; }
.segmented button { min-height: 34px; min-width: 70px; padding: 5px 9px; border: 0; border-inline-start: 1px solid #d5d8dc; border-radius: 0; font-size: 11px; background: #f1f2f2; }
.segmented button:first-child { border-inline-start: 0; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: #191a17; font-weight: 700; }
.segmented button:disabled { background: #eceeef; color: #777d84; opacity: .72; }
.segmented button[aria-pressed="true"]:disabled { background: var(--accent-soft); color: var(--ink); opacity: 1; }
.workshop-panel { max-width: none; }
.workshop .dot { width: 11px; height: 11px; }
.coach-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  margin-top: 14px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.coach-strip-title { font-size: 20px; white-space: nowrap; }
.coach-toggle-list { display: flex; align-items: center; flex: 1; gap: 12px; }
.coach-toggle { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding-inline: 8px; border-inline-start: 1px solid var(--line); cursor: pointer; white-space: nowrap; }
.coach-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { position: relative; flex: none; width: 54px; height: 29px; border-radius: 18px; background: #d5d7d8; transition: background .15s ease; }
.switch-track::after { content: ""; position: absolute; top: 4px; right: 4px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.coach-toggle input:checked + .switch-track { background: var(--accent); }
.coach-toggle input:checked + .switch-track::after { transform: translateX(-25px); }
.coach-toggle input:focus-visible + .switch-track { outline: 3px solid #a88700; outline-offset: 2px; }
.coach-note { display: flex; align-items: center; gap: 10px; min-width: 260px; color: var(--muted); font-size: 13px; }
.coach-note input { min-height: 40px; background: transparent; border-color: transparent; border-bottom-color: #d6d9dc; border-radius: 0; }
.coach-note input:focus { background: #fff; }
.coach-attention, .after-actions, #roster-summary { display: none!important; }
footer { padding-top: 7px; }
/* A grid item's intrinsic width must not expand the page around a scrolling roster. */
.workspace > *, .profile-panels > *, .profile-heading-line > *, #roster-list { min-inline-size: 0; }
.roster-item > span:last-child { min-inline-size: 0; }
.roster-item strong, .profile-heading-line h2, .subline { overflow-wrap: anywhere; }
.weight-value input { min-inline-size: 0; }
.gender-row { flex-wrap: wrap; }
.coach-note, .coach-note input { min-inline-size: 0; }
dialog { width: max-content; max-inline-size: calc(100vw - 24px); padding: 12px; }
dialog img { display: block; max-inline-size: 100%; max-block-size: 70dvh; object-fit: contain; }

/* Qualifications stay visible in either mode; brand yellow is not a qualification. */
.qualification-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.qualification-label { color: var(--muted); font-size: 12px; }
.qualification-badges { display: flex; flex: 1; flex-wrap: wrap; gap: 8px; min-inline-size: 0; }
.qualification-badge { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; border: 1px solid #d5d8dc; border-radius: 7px; padding: 7px 10px; font-size: 12px; line-height: 1.5; }
.qualification-badge .dot { width: 14px; height: 14px; }
.qualification-yellow { background: #fff6c4; border-color: #dfc444; }
.qualification-green { background: #eaf4ec; border-color: #9dbda5; }
.qualification-orange { background: #fff0df; border-color: #e4b47e; }
.qualification-red { background: #fceceb; border-color: #dba49f; }
.qualification-help { flex: 0 1 auto; font-size: 12px; min-inline-size: 0; }
.qualification-help summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); }
.qualification-help[open] { flex: 1 1 100%; }
.qualification-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 12px; background: #f5f6f5; border-radius: 7px; }
.qualification-legend > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qualification-legend p { flex: 1 1 100%; line-height: 1.7; margin: 0; color: var(--muted); }
.benchmark-control { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 12px; line-height: 1.6; padding: 3px 0 6px; min-inline-size: 0; }
.benchmark-control > span:first-child { flex: 1 1 130px; }
.benchmark-control button { min-height: 44px; font-size: 12px; padding: 6px 10px; }
.benchmark-control button:not(:disabled):not(.benchmark-reset) { background: var(--accent-soft); border-color: #ddc242; }
.benchmark-control .benchmark-passed { color: var(--green); font-weight: 700; }
.benchmark-reset { color: var(--muted); background: #fff; }
.skill-row .exercise-name { flex: 1; min-inline-size: 0; }
.skill-row .segmented { max-inline-size: 100%; }
.workshop-info { flex: 1; min-inline-size: 0; }
.workshop-info strong { font-size: 15px; }
.workshop-info small { display: block; font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 4px; }
.workshop-info .rule-warning { color: #965323; }
.red-readiness { margin-top: 16px; border: 0; padding: 8px 0; white-space: normal; }

@media (max-width: 1280px) {
  main { width: calc(100% - 30px); padding: 18px; }
  .workspace { grid-template-columns: minmax(205px, 24%) minmax(0, 1fr); gap: 12px; }
  .topbar { gap: 16px; }
  .portrait-column { width: 152px; }
  .avatar.big { width: 144px; height: 144px; }
  .person-head { gap: 18px; }
  .profile-heading-line { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .quick-facts { margin-top: 8px; }
  .quick-facts .fact { padding-inline: 8px; }
  .fact strong { font-size: 18px; }
  .profile-panels { grid-template-columns: minmax(0, 1fr); }
  .coach-strip { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .coach-toggle-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
  .coach-toggle { border-inline-start: 0; padding-inline: 0; }
  .coach-note { width: 100%; min-width: 0; }
  .coach-note input { flex: 1; width: 0; }
}

/* Larger tablets also need touch-sized controls, regardless of their pixel width. */
@media (max-width: 1280px), (pointer: coarse) {
  .coach-toggle { min-height: 44px; }
  .gender-switch button, .profile-mode button, .segmented button, .weight-preset, .intake-link { min-height: 44px; }
  .weight-step { width: 44px; min-width: 44px; min-height: 44px; }
  .weight-value input, .exercise-row select, .search, .coach-note input { min-height: 44px; font-size: 16px; }
}

@media (max-width: 900px) {
  body { background-attachment: scroll; }
  .topbar { flex-wrap: wrap; padding: 12px 20px; gap: 10px 14px; background-size: auto 100%; }
  .brand { font-size: 20px; }
  nav { order: 3; flex: 1 0 100%; gap: 4px; }
  nav button { flex: 1; min-width: 0; padding-inline: 6px; }
  #save-status { flex: 1 1 100px; max-width: 200px; margin-inline-start: auto; text-align: end; overflow-wrap: anywhere; }
  .session-head { flex-wrap: wrap; gap: 12px; }
  #session-title { flex: 1 1 340px; min-width: 0; }
  #session-controls { min-width: 0; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .roster { position: sticky; top: 8px; z-index: 5; padding: 12px; }
  .roster-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 0 2px 10px; }
  .roster-header h2 { font-size: 20px; margin: 0; }
  .count { font-size: 13px; }
  .search { flex: 1 0 100%; margin-top: 4px; }
  #roster-list { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity; scrollbar-width: thin; scrollbar-color: #d4b800 #f2f2ee; padding: 2px 0 6px; }
  .roster-item { flex: 0 0 180px; width: 180px; min-width: 0; min-height: 76px; margin: 0; scroll-snap-align: start; }
  .roster-item strong { font-size: 16px; }
  .roster-item small { font-size: 12px; line-height: 1.4; }
  #roster-list .empty { flex: 1 0 100%; padding: 12px; }
  .avatar { width: 45px; height: 45px; font-size: 16px; }
  .portrait-column { width: 120px; }
  .avatar.big { width: 112px; height: 112px; font-size: 32px; border-width: 3px; }
  .profile-heading-line h2 { font-size: 32px; }
  .photo-button { width: 44px; height: 44px; }
  .profile-panels .card { margin-bottom: 12px; }
}

@media (max-width: 600px) {
  .topbar { padding-inline: 16px; }
  #save-status { max-width: 125px; font-size: 11px; }
  main { width: calc(100% - 16px); padding: 12px 10px 18px; }
  .session-head { display: block; margin-bottom: 16px; }
  .session-head h1 { font-size: clamp(23px, 6vw, 30px); }
  .subline { font-size: 13px; line-height: 1.7; }
  #session-controls { margin-top: 12px; }
  .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .controls button { padding-inline: 6px; font-size: 14px; }
  .controls .demo-toggle { grid-column: 1 / -1; }
  .roster { top: 4px; padding: 10px; }
  .roster-item { flex-basis: 172px; width: 172px; }
  .profile-hero { padding: 16px 14px; }
  .person-head { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: start; gap: 14px 12px; }
  .portrait-column { width: 80px; }
  .avatar.big { width: 80px; height: 80px; font-size: 24px; }
  .photo-button { left: -4px; bottom: -4px; }
  .photo-state { margin-top: 12px; font-size: 10px; line-height: 1.4; }
  .person-head .details, .profile-heading-line { display: contents; }
  .profile-heading-line h2 { font-size: clamp(24px, 6.5vw, 30px); line-height: 1.2; }
  .gender-label { display: none; }
  .gender-row { margin-top: 10px; padding-top: 8px; gap: 4px; }
  .gender-switch { max-width: 100%; }
  .gender-switch button { min-width: 0; padding-inline: 7px; }
  .gender-hint { flex-basis: 100%; }
  .quick-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
  .quick-facts .fact { padding-inline: 6px; text-align: center; }
  .fact small { font-size: 11px; }
  .fact strong { display: block; font-size: clamp(14px, 4vw, 18px); white-space: normal; overflow-wrap: anywhere; }
  .profile-mode { width: 100%; }
  .profile-mode button { flex: 1; min-width: 0; }
  .profile-panels .card, .workshop-panel { padding: 16px 14px; }
  .section-title { flex-wrap: wrap; gap: 4px 12px; }
  .section-title h2 { font-size: 21px; }
  .exercise-row { grid-template-columns: minmax(0, 1fr) 172px; gap: 8px; padding-block: 12px; }
  .exercise-name { font-size: 14px; line-height: 1.5; }
  .weight-control { width: 100%; max-width: none; }
  .exercise-row select { grid-column: 1 / -1; }
  .weight-preset { font-size: 12px; }
  .skill-row, .workshop { gap: 8px; padding-block: 10px; }
  .skill-row .exercise-name, .workshop label { flex: 1; min-width: 0; }
  .skill-row .segmented, .workshop .segmented { width: 58%; min-width: 140px; }
  .skill-row, .workshop { flex-wrap: wrap; }
  .skill-row .segmented { width: 100%; min-width: 0; }
  .workshop .segmented { width: 100%; min-width: 0; }
  .workshop-info { flex-basis: calc(100% - 30px); }
  .qualification-strip { gap: 6px 10px; margin-top: 14px; }
  .qualification-label { flex-basis: 100%; }
  .qualification-help { flex-basis: 100%; }
  .segmented button { flex: 1; min-width: 0; padding-inline: 5px; font-size: 12px; }
  .workshop label { font-size: 14px; line-height: 1.5; }
  .coach-strip { padding: 14px; }
  .coach-toggle-list { display: grid; grid-template-columns: 1fr; gap: 2px; }
  .coach-toggle { min-height: 48px; border-top: 1px solid var(--line); justify-content: space-between; }
  .coach-note { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
  .coach-note input { flex: auto; width: 100%; }
  .audit { font-size: 11px; }
}

@media (max-width: 350px) {
  .topbar { padding-inline: 12px; }
  .brand { gap: 8px; font-size: 18px; }
  .brand-icon { width: 40px; height: 40px; }
  .exercise-row { grid-template-columns: minmax(0, 1fr) 160px; }
}

@media (max-width: 900px) and (max-height: 500px) {
  .roster { position: static; }
}
