:root {
  --green: #0b4f97;
  --brand: #102d50;
  --accent: #c51d36;
  --ink: #152b43;
  --muted: #56677a;
  --line: #d8e1eb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f3f6fa;
  color: var(--ink);
  font:
    16px/1.5 system-ui,
    sans-serif;
}
header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 22px max(24px, calc((100vw - 1100px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  color: var(--green);
  text-decoration: none;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -2px;
  display: flex;
  gap: 15px;
  align-items: center;
}
.brand span {
  font-size: 11px;
  letter-spacing: 2px;
  max-width: 100px;
}
main {
  max-width: 1100px;
  margin: 38px auto;
  padding: 0 24px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 18px;
}
h1 {
  font-size: 42px;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin: 10px 0;
}
h2 {
  font-size: 23px;
  margin: 0 0 18px;
}
.muted {
  color: var(--muted);
}
#login {
  max-width: 470px;
  margin: 60px auto;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0;
}
input,
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #b7c6d8;
  background: #fff;
  border-radius: 7px;
  font: inherit;
  color: var(--ink);
  display: block;
  margin-top: 6px;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
button {
  background: var(--green);
  color: white;
  border: 1px solid var(--green);
  border-radius: 7px;
  padding: 12px 18px;
  font: 600 14px system-ui;
  cursor: pointer;
}
.secondary {
  background: #fff;
  color: var(--green);
  border-color: var(--line);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.toolbar,
.sectiontitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
nav {
  display: flex;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  margin: 25px 0;
}
nav label {
  flex: 1;
}
nav button {
  margin-top: 22px;
}
.tabs,
.actions {
  display: flex;
  gap: 10px;
  margin: 22px 0;
}
#editor,
.piece,
.resultcard {
  background: #fff;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 18px 0;
}
#pieces .piece {
  background: #f3f6fa;
}
.row {
  display: flex;
  gap: 14px;
}
.row > * {
  flex: 1;
  min-width: 0;
}
.badge {
  display: inline-block;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 5px 10px;
  background: #e7eff8;
  color: var(--green);
  border-radius: 20px;
}
pre {
  white-space: pre-wrap;
  font: inherit;
  overflow-wrap: anywhere;
}
.partlabel {
  background: var(--green);
  color: white;
  display: inline-block;
  padding: 3px 11px;
  border-radius: 6px;
  margin-right: 10px;
}
.feedback {
  border-left: 3px solid #0b4f97;
  padding-left: 14px;
  margin: 12px 0;
}
#message:not(:empty) {
  padding: 14px;
  background: #e7eff8;
  border-radius: 8px;
  margin: 15px 0;
}
#message.error {
  background: #fbe8df;
  color: #8d2813;
}
details {
  margin: 16px 0;
}
summary {
  cursor: pointer;
}
footer {
  max-width: 1100px;
  margin: 50px auto;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}
[hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  header {
    padding: 16px;
  }
  .brand {
    font-size: 29px;
  }
  main {
    padding: 0 16px;
    margin: 24px auto;
  }
  h1 {
    font-size: 32px;
  }
  nav {
    flex-wrap: wrap;
    gap: 8px;
  }
  nav label {
    min-width: 120px;
  }
  nav label:first-child {
    flex-basis: 100%;
  }
  nav button {
    padding: 10px;
    margin-top: 18px;
  }
  .toolbar {
    align-items: start;
  }
  .row {
    flex-wrap: wrap;
  }
  .row > * {
    flex-basis: 40%;
  }
  .tabs,
  .actions {
    flex-wrap: wrap;
  }
  #editor,
  .piece,
  .resultcard {
    padding: 18px;
  }
  .tabs button {
    flex: 1;
  }
  #identity {
    font-size: 12px;
  }
  #login {
    margin: 35px auto;
  }
}

.interval {
  border: 1px solid var(--line, #d9dfe7);
  border-radius: 10px;
  padding: 12px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.interval legend {
  font-weight: 600;
}

.row > .interval {
  flex: 1 1 100%;
}

/* Independent weekly programming workspace and piece-library dialog. */
body:has(#workspace:not([hidden])) main {
  max-width: 1460px;
}
.calendarbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.calendarbar h2 {
  font-size: 16px;
  margin: 0;
}
.weekgrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.calendar-day {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.calendar-day.selected {
  border: 2px solid var(--green);
  padding: 11px;
}
.day-open {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 4px;
  font-size: 13px;
  border: 0;
}
.calendar-day h3 {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.calendar-piece {
  background: #f3f6fa;
  border-radius: 6px;
  padding: 8px;
  margin-top: 10px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.calendar-piece pre {
  margin: 8px 0;
  font-size: 12px;
}
.calendar-piece small {
  color: var(--muted);
}
#dayworkspace {
  margin-top: 24px;
}
#selectedday {
  font-size: 22px;
}
#editor {
  max-width: 900px;
  margin: 18px auto;
}
dialog {
  color: var(--ink);
  background: #f3f6fa;
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(850px, calc(100vw - 32px));
  max-height: 90dvh;
  padding: 24px;
  overflow: auto;
}
dialog::backdrop {
  background: rgb(16 45 80 / 0.65);
}
dialog .piece {
  margin: 14px 0;
}
dialog .sectiontitle h2 {
  margin: 0;
}
#librarymessage:not(:empty) {
  padding: 12px;
  background: #e7eff8;
  border-radius: 8px;
  margin-top: 14px;
}
#librarymessage.error {
  background: #fbe8df;
  color: #8d2813;
}
@media (max-width: 1000px) {
  .weekgrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .calendarbar {
    flex-wrap: wrap;
  }
}
@media (max-width: 600px) {
  .weekgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar .actions {
    margin: 4px 0;
  }
  .calendarbar .actions {
    gap: 6px;
  }
  .calendarbar button {
    padding: 10px;
  }
  .sectiontitle {
    flex-wrap: wrap;
  }
  dialog {
    padding: 16px;
  }
  .row > * {
    flex-basis: 100%;
  }
}

.calendar-save {
  margin-top: 8px;
  width: 100%;
  padding: 7px;
  font-size: 11px;
}
dialog > .sectiontitle {
  position: sticky;
  top: -24px;
  background: #f3f6fa;
  padding: 12px 0;
  z-index: 2;
}
#dayworkspace {
  scroll-margin-top: 16px;
}
@media (max-width: 600px) {
  dialog > .sectiontitle {
    top: -16px;
  }
}

/* Phone screens fit the viewport; content and controls flow vertically. */
@media (max-width: 600px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  header {
    flex-wrap: wrap;
    gap: 8px;
  }
  header > * {
    min-width: 0;
    max-width: 100%;
  }
  #identity {
    overflow-wrap: anywhere;
  }
  main,
  footer,
  #workspace,
  #dayworkspace,
  #coachtools,
  #editor,
  .piece,
  .resultcard {
    min-width: 0;
    max-width: 100%;
  }
  .toolbar > *,
  .sectiontitle > *,
  .calendarbar > *,
  .actions > *,
  .tabs > *,
  nav > * {
    min-width: 0;
    max-width: 100%;
  }
  .actions,
  .tabs {
    flex-wrap: wrap;
  }
  .actions button,
  .tabs button,
  button,
  summary,
  h1,
  h2,
  h3,
  p,
  a,
  .badge {
    overflow-wrap: anywhere;
  }
  button {
    white-space: normal;
  }
  .badge {
    white-space: normal;
  }
  nav label {
    min-width: 0;
    flex: 1 1 120px;
  }
  nav label:first-child {
    flex-basis: 100%;
  }
  .weekgrid {
    grid-template-columns: minmax(0, 1fr);
  }
  .calendar-day {
    width: 100%;
  }
  input,
  textarea,
  select {
    min-width: 0;
    max-width: 100%;
    font-size: 16px;
  }
  input[type="date"] {
    min-width: 0;
    width: 100%;
  }
  dialog {
    max-width: calc(100% - 24px);
    width: calc(100% - 24px);
    margin: auto;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
  }
  dialog > .sectiontitle {
    top: -12px;
  }
  dialog .piece {
    padding: 12px;
  }
  .row {
    flex-direction: column;
  }
  .row > * {
    width: 100%;
    flex-basis: auto;
  }
  .interval legend {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  pre {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

/* 336 CrossFit identity: the existing transparent shield and North Carolina palette. */
header {
  background: var(--brand);
  color: #fff;
  border-bottom: 4px solid var(--accent);
  padding-top: 18px;
  padding-bottom: 18px;
}
.brand {
  color: #fff;
  gap: 16px;
  letter-spacing: -1px;
}
.brand-logo {
  display: block;
  width: 68px;
  height: 74px;
  object-fit: contain;
  flex: none;
}
.brand .brand-name {
  max-width: none;
  display: flex;
  flex-direction: column;
  font-size: 30px;
  line-height: 1.1;
}
.brand-name > span {
  font-size: 10px;
  letter-spacing: 2px;
  max-width: none;
  margin-top: 6px;
}
#identity {
  color: #d9e6f5;
}
#login {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 14px;
  padding: 30px;
  box-shadow: 0 8px 30px rgb(16 45 80 / 0.06);
}
#login h1 {
  color: var(--brand);
}
#loginform > button {
  width: 100%;
  margin-top: 10px;
}
button {
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
button:not(:disabled):hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.secondary {
  color: var(--brand);
  border-color: #c8d5e5;
}
.calendar-day.selected {
  border-color: var(--green);
  box-shadow: 0 3px 12px rgb(16 45 80 / 0.08);
}
.calendar-day.selected .day-open {
  color: var(--green);
}
.calendar-piece {
  border-left: 3px solid #c8d5e5;
}
.partlabel {
  background: var(--brand);
}
#publish {
  color: var(--accent);
  border-color: #d8a6af;
}
#publish:not(:disabled):hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
:focus-visible {
  outline: 3px solid #b22b43;
  outline-offset: 3px;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline-color: var(--green);
}
@media (max-width: 600px) {
  header {
    padding: 14px 16px;
  }
  .brand {
    gap: 12px;
  }
  .brand-logo {
    width: 48px;
    height: 54px;
  }
  .brand .brand-name {
    font-size: 25px;
  }
  .brand-name > span {
    font-size: 9px;
    letter-spacing: 1.5px;
  }
  #login {
    padding: 22px;
    margin: 24px auto;
  }
}

#piecehistory {
  width: min(600px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}
.trendchart {
  display: block;
  width: 100%;
  height: auto;
  font-size: 11px;
}
#piecehistory select {
  max-width: 100%;
}

/* The selected day expands in its calendar card; one workspace is moved, not duplicated. */
.calendar-day.expanded {
  grid-column: auto;
}
.inline-day-workspace {
  margin-top: 12px !important;
}
.inline-day-workspace > #selectedday {
  display: none;
}
.inline-day-workspace #editor {
  max-width: none;
  margin: 12px 0;
  padding: 18px;
}
.inline-day-workspace #pieces {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.inline-day-workspace #pieces > .piece {
  margin: 0;
  min-width: 0;
}
.piece-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}
.piece-drag {
  font-size: 24px;
  line-height: 1;
  padding: 8px 12px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.piece-moves {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.piece-moves button {
  padding: 6px 10px;
}
.piece-title-field {
  min-width: 0;
  position: relative;
}
.suffix-field {
  flex: 0 0 64px;
}
.title-matches {
  position: absolute;
  z-index: 4;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px #102d5033;
  max-height: 250px;
  overflow: auto;
}
.title-matches button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  padding: 10px;
  overflow-wrap: anywhere;
}
.title-matches small {
  display: block;
  color: var(--muted);
}
.piece-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.piece-save-status,
.piece-help {
  font-size: 12px;
}
.dragging {
  opacity: 0.6;
}
.drag-over {
  outline: 3px dashed var(--green);
  outline-offset: 2px;
}
@media (max-width: 1000px) {
  .inline-day-workspace #pieces {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .inline-day-workspace #editor {
    padding: 10px;
  }
  .inline-day-workspace #pieces > .piece {
    padding: 12px;
  }
  .suffix-field {
    flex-basis: auto;
  }
  .title-matches {
    position: static;
  }
  .piece-heading .badge {
    flex-shrink: 0;
  }
}

.weekstrip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.weekday-tab {
  min-width: 0;
  padding: 10px;
}
.weekday-tab span {
  display: block;
  font-size: 18px;
}
.weekday-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.calendar-day.expanded {
  order: 0;
}
.inline-day-workspace .tabs {
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .weekstrip {
    gap: 3px;
  }
  .weekday-tab {
    padding: 6px 2px;
    font-size: 11px;
  }
  .weekday-tab span {
    font-size: 15px;
  }
}

/* Expand downward in the original weekday column. */
#weekstrip {
  display: none;
}
.inline-day-workspace #editor {
  border: 0;
  padding: 0;
}
.inline-day-workspace .row {
  flex-direction: column;
  gap: 0;
}
.inline-day-workspace .row > * {
  width: 100%;
  flex-basis: auto;
}
.inline-day-workspace #pieces > .piece {
  padding: 10px;
}
.inline-day-workspace .tabs {
  gap: 5px;
}
.inline-day-workspace .tabs button {
  flex: 1 1 100%;
  padding: 8px;
}
.inline-day-workspace .piece-heading {
  flex-wrap: wrap;
  gap: 4px;
}
.inline-day-workspace .piece-moves {
  gap: 2px;
}
.inline-day-workspace .piece-drag {
  padding: 6px;
}
.inline-day-workspace .piece-moves button {
  padding: 5px;
}
.inline-day-workspace .badge {
  white-space: normal;
}
.inline-day-workspace .title-matches {
  position: static;
}
.inline-day-workspace button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.inline-day-workspace .suffix-field {
  flex-basis: auto;
}

.inline-day-workspace .sectiontitle {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.inline-day-workspace h2 {
  font-size: 18px;
  margin: 8px 0;
}
.inline-day-workspace #collapseeditor {
  width: 100%;
  padding: 8px;
}
.inline-day-workspace .sectiontitle .badge {
  align-self: flex-start;
}

/* Coach programming uses available desktop width instead of a centered cap. */
@media (min-width: 1001px) {
  body:has(#calendar:not([hidden])) main {
    max-width: none;
    width: 100%;
    padding: 0 24px;
    margin: 28px auto;
  }
  body:has(#calendar:not([hidden])) header {
    padding-left: 24px;
    padding-right: 24px;
  }
  body:has(#calendar:not([hidden])) .calendar-piece {
    font-size: 14px;
  }
  body:has(#calendar:not([hidden])) .calendar-piece pre {
    font-size: 14px;
    line-height: 1.55;
  }
  body:has(#calendar:not([hidden])) .day-open {
    font-size: 14px;
  }
}

.piece-reopen,
.piece-summary {
  display: none;
}
.piece-collapsed > .piece-reopen {
  display: block;
  width: 100%;
  text-align: left;
  margin: 10px 0;
  font-weight: 700;
}
.piece-collapsed > .piece-summary {
  display: block;
}
.piece-collapsed > :not(.piece-heading):not(.piece-reopen):not(.piece-summary) {
  display: none;
}
.piece-summary pre {
  margin: 8px 0;
  font-size: 14px;
}
.piece-summary small {
  color: var(--muted);
}

.member-piece-toggle {
  display: none;
}
@media (max-width: 600px) {
  .member-workout-piece {
    padding: 14px;
  }
  .member-workout-piece > .member-piece-desktop-title {
    display: none;
  }
  .member-piece-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 8px;
    border: 0;
    background: transparent;
    font-size: 18px;
  }
  .member-piece-toggle .partlabel {
    flex-shrink: 0;
    margin: 0;
  }
  .member-piece-toggle > span:nth-child(2) {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .member-piece-arrow {
    flex-shrink: 0;
  }
  .member-workout-piece:not(.member-piece-open) > .member-piece-body {
    display: none;
  }
  .member-workout-piece.member-piece-open > .member-piece-body {
    margin-top: 14px;
  }
}

/* Expandable coach navigation; future modules add items to the same menu. */
#menutoggle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 31;
  width: 22px;
  padding: 12px 0;
  border-radius: 0 8px 8px 0;
  font-size: 24px;
  box-shadow: 0 2px 8px #102d5033;
}
#sidemenu {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(260px, calc(100vw - 40px));
  z-index: 30;
  background: var(--brand);
  color: white;
  box-shadow: 4px 0 20px #102d5033;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.side-heading {
  font-size: 18px;
  font-weight: 800;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 20px;
}
#sidemenu button {
  width: 100%;
  text-align: left;
  color: white;
  background: transparent;
  border-color: #6280a2;
}
#sidemenu button[aria-current="page"] {
  background: #244d7d;
}
#sidemenu .side-display {
  margin-top: auto;
  margin-bottom: 8px;
}
.menu-open #menutoggle {
  left: min(260px, calc(100vw - 40px));
}

#displaycontroller {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 12px;
  padding: 22px;
  margin: 20px 0;
}
#displaycontroller .row {
  flex-wrap: wrap;
}
#displaycontroller .row > label {
  flex: 1 1 160px;
}
#controlstatus {
  font-size: 14px;
  color: var(--brand);
}
/* Each member prescription opens independently; measured entry has its own page. */
.member-workout-piece > .member-piece-desktop-title {
  display: none;
}
.member-piece-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #102d50;
  font-size: 18px;
}
.member-piece-toggle .partlabel {
  flex-shrink: 0;
  margin: 0;
}
.member-piece-toggle > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.member-workout-piece:not(.member-piece-open) > .member-piece-body {
  display: none;
}
.member-workout-piece.member-piece-open > .member-piece-body {
  margin-top: 14px;
}
.member-result-form,
.result-entry-heading {
  display: none;
}
.member-add-results {
  margin-top: 12px;
}
.member-saved-score {
  font-size: 14px;
  color: #0b4f97;
}
.member-result-page #workspace > nav,
.member-result-page #memberview > .sectiontitle,
.member-result-page #memberview > .piece:not(.result-piece-active) {
  display: none;
}
.member-result-page #memberview > .result-piece-active > .member-piece-toggle {
  display: none;
}
.member-result-page .result-piece-active > .member-piece-body {
  display: block;
  margin-top: 0;
}
.member-result-page .result-piece-active > .member-piece-body > pre,
.member-result-page .result-piece-active > .member-piece-body > p,
.member-result-page .result-piece-active [data-piece-history],
.member-result-page .result-piece-active > .member-piece-body > .feedback,
.member-result-page .result-piece-active .member-add-results {
  display: none;
}
.member-result-page .result-piece-active .result-entry-heading,
.member-result-page .result-piece-active .member-result-form {
  display: block;
}
.result-entry-heading h2 {
  margin: 24px 0 16px;
}
.member-result-form > button {
  width: 100%;
  margin-top: 14px;
}
.member-result-page .result-piece-active {
  margin-top: 0;
}
.member-result-page .toolbar {
  display: none;
}
#message.member-quiet-message {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  padding: 0;
  margin: 0;
  border: 0;
}
.member-optional-section > summary {
  font-size: 18px;
  font-weight: 650;
  color: #102d50;
}

/* Workout date picker mirrors the schedule week/month calendar. */
#workout-week-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 11px;
}
#workout-week-controls button {
  padding: 7px 11px;
  min-height: 36px;
}
#workout-week-label {
  flex: 1;
  text-align: right;
  font-size: 13px;
  font-weight: 650;
  color: #56677a;
}
.member-seven-days,
.member-month-weekdays,
.member-month-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
.member-schedule-day {
  border: 0;
  background: transparent;
  color: #56677a;
  padding: 7px 0;
  border-radius: 9px;
  font-size: 11px;
  min-width: 0;
}
.member-schedule-day span {
  display: block;
  margin-bottom: 5px;
}
.member-schedule-day strong {
  font-size: 20px;
  display: block;
  font-weight: 650;
}
.member-schedule-day[aria-pressed="true"],
.member-month-day[aria-pressed="true"] {
  background: #0b4f97;
  color: white;
}
.member-schedule-day.is-today:not([aria-pressed="true"]),
.member-month-day.is-today:not([aria-pressed="true"]) {
  color: #c51d36;
  box-shadow: inset 0 -2px #c51d36;
}
.member-schedule-day:not(:disabled):hover,
.member-month-day:not(:disabled):hover {
  background: #e7eff8;
  color: #102d50;
}
.member-schedule-day[aria-pressed="true"]:not(:disabled):hover,
.member-month-day[aria-pressed="true"]:not(:disabled):hover {
  background: #102d50;
  color: white;
}
#workout-month-toggle {
  display: block;
  width: 100%;
  background: transparent;
  color: #0b4f97;
  border: 0;
  font-size: 24px;
  padding: 2px;
  margin: 6px 0;
  min-height: 36px;
}
#workout-month-calendar {
  border-bottom: 1px solid #d8e1eb;
  padding-bottom: 16px;
}
.member-month-controls {
  display: flex;
  gap: 7px;
  align-items: center;
}
.member-month-controls label {
  min-width: 0;
  margin: 4px 0 14px;
  flex: 1;
  font-size: 11px;
}
.member-month-controls label:has(input) {
  flex: 0.7;
}
.member-month-controls select,
.member-month-controls input {
  padding: 8px;
  font-size: 16px;
}
.member-month-controls > button {
  padding: 7px 9px;
}
.member-month-weekdays {
  font-size: 11px;
  text-align: center;
  color: #56677a;
  margin-bottom: 8px;
}
.member-month-day {
  background: transparent;
  color: #152b43;
  border: 0;
  font-size: 14px;
  border-radius: 8px;
  min-height: 40px;
  padding: 5px 0;
}
.member-month-day.outside-month {
  color: #87929e;
}

.member-workout-calendar #workspace > nav #previous,
.member-workout-calendar #workspace > nav #next,
.member-workout-calendar #workspace > nav label:has(#date) {
  display: none;
}
.member-workout-calendar #workspace > nav {
  flex-wrap: wrap;
}
.member-workout-calendar #workspace > nav button {
  margin-top: 0;
}
.member-workout-calendar #workspace > nav label:first-child {
  flex: 1;
  min-width: 0;
}
#workout-date-section {
  margin: 18px 0;
}
#viewleaderboard {
  width: 100%;
  margin: 5px 0 8px;
}
.member-result-page #workout-date-section {
  display: none;
}
.member-leaderboard-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px 8px;
  border-bottom: 1px solid #d8e1eb;
  overflow-wrap: anywhere;
}
.member-leaderboard-row.wide-score > strong:last-child {
  grid-column: 2/-1;
}
.member-leaderboard-row .score-part {
  white-space: nowrap;
}
.member-leaderboard-row.is-you {
  background: #e7eff8;
  border-radius: 6px;
}
.member-leaderboard-row small {
  display: block;
  color: #56677a;
  font-size: 12px;
}
.leaderboard-tier {
  font-size: 15px;
  margin: 22px 0 4px;
}
.leaderboard-rules {
  font-size: 13px;
  color: #56677a;
}
#memberleaderboard > .piece {
  padding: 18px;
}
.member-workout-calendar #workspace > nav label:has(#program) {
  flex-basis: 100%;
}

.stay-signed-in {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stay-signed-in input {
  width: auto;
}
.member-photo {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 10px;
  margin: 12px 0;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
}
.roster-avatar {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
}
#startupfailed {
  max-width: 470px;
  margin: 60px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}
#startupfailed p {
  margin: 0 0 16px;
  font-weight: 600;
}
#partialfailed:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
}
#partialfailed p {
  flex: 1 1 200px;
  margin: 0;
  font-weight: 600;
}

/* Owner 2026-10-29: per-result choice to keep a score off the leaderboard. */
.leaderboard-choice {
  display: flex;
  align-items: center;
  gap: 10px;
}
.leaderboard-choice input {
  width: 22px;
  height: 22px;
  margin: 0;
  flex: 0 0 auto;
}
/* Member freeze/cancel requests (membership-requests.js) */
.request-actions,.request-buttons{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.request-form input[type=hidden]{display:none}
.request-form{display:grid;gap:10px;margin-top:12px;max-width:560px}
.request-form .row{display:flex;flex-wrap:wrap;gap:10px}
.request-form .row label{flex:1 1 150px}
.request-form textarea,.request-form input,.request-form select{width:100%;box-sizing:border-box}
.request-check.error,#requestsmessage.error,#declinecheck.error{color:#a12d17}
.request-flash{font-weight:600;color:#1d5e33;margin:6px 0}
.request-flash:empty{display:none}
.request-flash.error{color:#a12d17}
.request-row{border-top:1px solid #d8dee6;padding:10px 0;overflow-wrap:anywhere}
.request-row:first-of-type{border-top:0}
.request-row>div{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.request-row p{margin:4px 0}
.request-state{font-size:13px;font-weight:700;padding:2px 8px;border-radius:999px;background:#e8edf3;color:#102d50}
.request-pending{background:#fff3cd;color:#6b4e00}
.request-approved{background:#dcf2e3;color:#1d5e33}
.request-declined{background:#f9e0da;color:#8a2a14}
.request-buttons a.button{display:inline-block;padding:8px 14px;border-radius:8px;background:#102d50;color:#fff;text-decoration:none;font-weight:600}
.member-request-banner{border:1px solid #e0b84d;background:#fff8e5;border-radius:8px;padding:10px 12px;margin:10px 0}

/* Owner 2026-11-03 (n-prs): personal record mark on results, history and the PRs list. */
.pr-badge {
  display: inline-block;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 6px;
  background: #c51d36;
  color: #fff;
  vertical-align: middle;
}
.pr-list p {
  margin: 6px 0;
  overflow-wrap: anywhere;
}

#uploadpreview .upload-group {
  margin: 12px 0 6px;
  font-size: 1rem;
}
#uploadpreview .upload-skipped ul {
  margin: 0;
  padding-left: 20px;
  overflow-wrap: anywhere;
}
#uploadpreview .upload-skipped {
  margin-bottom: 12px;
}
#uploadpreview .upload-summary {
  font-weight: 600;
  margin: 12px 0 4px;
}
#uploadpreview .upload-skipped li {
  margin-bottom: 4px;
}

/* Exercise Index list: every saved piece first, editor opened from a row or Create new piece. */
#librarylist[hidden],
#librarypanel[hidden],
#libraryupload[hidden],
#librarydraftnotice[hidden],
#libraryversionrow[hidden] {
  display: none !important;
}
.index-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.index-upload {
  border: 1px solid #dce3ec;
  border-radius: 10px;
  padding: 14px;
  margin: 0 0 14px;
}
.index-upload h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.index-draft {
  border: 1px solid #e9c46a;
  background: #fff8e6;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 14px;
}
.index-draft p {
  margin: 0 0 8px;
}
.index-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 16px;
}
.index-search {
  flex: 1 1 260px;
  min-width: 0;
}
.index-search input {
  width: 100%;
  box-sizing: border-box;
}
.index-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.index-kinds button {
  min-height: 40px;
}
.index-kinds button[aria-pressed="true"] {
  background: #102d50;
  border-color: #102d50;
  color: #fff;
}
.index-novideo {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.index-novideo input {
  width: auto;
  margin: 0;
}
#librarycount {
  margin: 12px 0 6px;
}
.index-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #dce3ec;
}
.index-head,
.index-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 150px 90px;
  gap: 12px;
  align-items: center;
}
.index-head {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5b6b7f;
}
.index-row {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #dce3ec;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.index-row:hover,
.index-row:focus-visible {
  background: #eef4fa;
}
.index-row.is-editing {
  background: #fff8e6;
}
.index-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.index-kind,
.index-score,
.index-video {
  color: #4a5a6e;
  font-size: 14px;
}
.index-empty {
  padding: 14px 12px;
}
#librarymore {
  margin-top: 12px;
}
.index-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-bottom: 8px;
}
.index-editor-head h3 {
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
  min-width: 0;
}
.index-back {
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 40px;
  color: #1d5fa3;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  width: auto;
}
@media (max-width: 700px) {
  .index-head {
    display: none;
  }
  .index-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .index-kind,
  .index-score,
  .index-video {
    display: inline;
  }
  .index-row .index-kind::after,
  .index-row .index-score::after {
    content: " · ";
  }
  .index-row {
    display: block;
  }
  .index-row .index-name {
    display: block;
    margin-bottom: 2px;
  }
}
/* The page title already says Exercise Index; keep the dialog's own heading for screen readers only. */
body.exercise-index #librarydialog > .sectiontitle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Run 10: card and bank entry in Stripe's own fields, and the saved cards list. */
.card-entry-type {
  border: 0;
  padding: 0;
  margin: 0 0 0.5rem;
  display: grid;
  gap: 0.4rem;
}
.card-entry-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  width: 100%;
  max-width: 34rem;
  text-align: left;
}
.card-entry-option[aria-pressed="true"] {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}
.card-entry-recommended,
.saved-method-default {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #e7f4ea;
  color: #1d5e2c;
}
.card-entry-element {
  margin: 0.5rem 0;
  max-width: 34rem;
}
.card-entry-error,
.saved-methods-error {
  color: #a4161a;
}
.saved-methods {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: grid;
  gap: 0.5rem;
}
.saved-methods li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}
.saved-method-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.saved-method-confirm {
  flex-basis: 100%;
}
.card-entry label,
.saved-methods-add label,
.profile-card-present {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.card-entry input[type="radio"],
.card-entry input[type="checkbox"],
.profile-card-present input[type="checkbox"] {
  width: auto;
  min-width: 0;
  margin: 0;
  flex: none;
}
