/* clipboardEditor.css — the inline on-the-fly plan editor: row/circuit/rest editing, the
   reorder control, and the insert bar. Extracted from index.css 2026-07-27.
   Inherits design tokens, glass-card/button/flex foundations and color scheme from index.css,
   loaded first — this file adds only what clipboardEditor.js owns. */

.clipboard-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Edit-mode chrome: the session title bar is repurposed to show WHICH plan is being edited and
   its temporal mode, so the trainer always knows if they're changing the live session or a future one. */
.active-session-overlay.editing-plan .session-title-bar {
  border-bottom: 2px solid var(--primary);
}
/* While editing the plan, the live-session chrome (member tabs, running timer, injury caveat)
   steps aside so the client's goals + notes take focus. */
.active-session-overlay.editing-plan #active-session-client-tabs,
.active-session-overlay.editing-plan .session-timer-block,
.active-session-overlay.editing-plan #clipboard-client-alert {
  display: none;
}

/* Client focus panel: only visible while editing the plan. */
.client-focus-panel {
  display: none;
}
.active-session-overlay.editing-plan .client-focus-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  background: var(--primary-light);
}
.client-focus-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.client-focus-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
}
.client-focus-item p {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-main);
}
/* What the gym already said about this client. Rows, not prose: each is one signal
   about one movement, and a trainer scans them while their other hand is on a barbell. */
.gym-note-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gym-note {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-main);
}
.gym-note-movement {
  font-weight: 700;
}
.gym-note-tag {
  color: var(--text-muted);
}
/* The reason an entry is at the top: it is about a movement in the plan on screen. Said in words
   rather than by colour alone — the ordering reads as arbitrary otherwise, and on a phone the
   trainer sees the top two rows and nothing else. */
.gym-note.is-in-plan .gym-note-movement {
  color: var(--primary);
}
.gym-note-here {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--primary);
}
.gym-note-more {
  font-size: 11px;
  color: var(--text-muted);
}
/* The edit-mode title bar. `min-width: 0` on both the row and the name is what actually lets the
   name shrink — a flex item's default `min-width: auto` refuses to go below its content, which is
   how the name ended up pushed out of the bar rather than ellipsised inside it. */
.edit-mode-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  line-height: 1.2;
}
.edit-mode-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
/* Shrunk from the 22px it inherited from the bar's h3: it is a mode marker beside the name, not a
   heading of its own. */
.edit-mode-title i {
  flex: 0 0 auto;
  font-size: 12px;
  opacity: 0.72;
}
/* One line per session in a merged clipboard. A column beside the ✎, so a second
   name starts under the first rather than under the icon; the row aligns on the first line's
   baseline, which a column container takes from its first item. */
.edit-mode-row:has(.edit-mode-names) {
  align-items: baseline;
}
.edit-mode-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.edit-mode-session {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}
.editor-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}
.editor-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.editor-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px 0;
}
.editor-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border-radius: var(--border-radius-md);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}
.editor-row-dragging {
  opacity: 0.6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
/* Row fields collapse: a long plan means every row's full sets/reps/load/circuit field set all
   rendered at once is genuinely crowded, so that field row starts collapsed to a compact
   "S3 × R10 × 60kg" summary (the same shorthand the live deck's own collapsed cards use) and
   expands on tap — the name field, catalog button, reorder handle and remove button stay put
   either way, so a collapsed row is still fully actionable, not a stripped-down placeholder. */
.editor-row-fields-summary {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.editor-row-toggle {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-muted);
  cursor: pointer;
}
.editor-row-toggle:hover,
.editor-row-toggle:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}
/* The row just inserted (from the live deck's +Exercise bar, an editor insert bar, or the catalog).
   Colour alone can't carry this on a sunlit gym floor, so the row also gets a thick accent edge and
   a literal "New" badge; the pulse only draws the eye on arrival and then settles. */
/* Two-class selectors: `.editor-rest-row` declares its own dashed border/background further down
   the sheet, and equal specificity would let it win over this call-out. */
.editor-row.editor-row-added,
.editor-rest-row.editor-row-added {
  border-color: var(--primary);
  border-left: 4px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--card-bg));
  animation: editor-added-pulse 1.2s ease-out 1;
}
.editor-added-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
@keyframes editor-added-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 55%, transparent);
  }
  100% {
    box-shadow: 0 0 0 10px transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .editor-row-added {
    animation: none;
  }
}
/* Combined reorder control: tap the top half to move up / bottom half to move down; drag to
   reorder freely. Sized as a tall two-zone target so both taps and drags are easy on touch. */
.editor-reorder {
  flex: 0 0 auto;
  width: 30px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-muted);
  cursor: grab;
  touch-action: none;
  overflow: hidden;
}
.editor-reorder:active {
  cursor: grabbing;
}
.editor-reorder-up,
.editor-reorder-down {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.editor-reorder-up {
  border-bottom: 1px solid var(--border-color);
}
.editor-reorder:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.editor-row-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.editor-row-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.editor-row-name {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-main);
  font-family: var(--font-header);
  font-size: 14px;
  font-weight: 700;
}
/* Browse the taxonomy for this row. Sized as a real 34px touch target next to the name field — the
   combobox only serves a PT who already knows the movement's name; this is the route when they
   don't, so it must be tappable with a sweaty thumb, not a hover affordance. */
.editor-row-catalog {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
}
.editor-row-catalog:hover,
.editor-row-catalog:focus-visible {
  border-color: var(--primary);
  background: var(--primary-light);
}
.editor-row-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.editor-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.editor-field > span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}
.editor-field > input {
  width: 62px;
  height: 30px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
/* Reps is polymorphic — ranges ("8-12"), holds ("30s"), or "max" — so it needs more room than the
   numeric sets/load fields to show the whole token without clipping. */
.editor-field > input.editor-f-reps {
  width: 84px;
}
.editor-remove {
  flex: 0 0 auto;
  align-self: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--danger-light);
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.editor-remove:hover {
  background: var(--danger-light);
}
.clipboard-editor-actions {
  display: flex;
  gap: 8px;
}
.clipboard-editor-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}
/* Circuit membership <select> that sits in each row's field strip. */
.editor-field-circuit > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.editor-row-circuit-select {
  height: 30px;
  max-width: 130px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
/* Circuit block: members grouped in a tinted, layer-group-accented card. */
.editor-circuit {
  border: 1px solid var(--secondary, var(--primary));
  border-radius: var(--border-radius-md);
  background: color-mix(in srgb, var(--secondary, var(--primary)) 8%, var(--card-bg));
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.editor-circuit-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.editor-circuit-icon {
  color: var(--secondary, var(--primary));
  flex: 0 0 auto;
}
.editor-circuit-title {
  flex: 1 1 120px;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-main);
  font-family: var(--font-header);
  font-size: 13px;
  font-weight: 800;
}
.editor-circuit-rounds {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.editor-circuit-rounds > span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}
.editor-circuit-series {
  width: 52px;
  height: 30px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.editor-circuit-ungroup {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.editor-circuit-ungroup:hover {
  color: var(--danger);
  border-color: var(--danger-light);
  background: var(--danger-light);
}
.editor-circuit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.editor-circuit-add {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed var(--secondary, var(--primary));
  color: var(--secondary, var(--primary));
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.editor-circuit-add:hover {
  background: color-mix(in srgb, var(--secondary, var(--primary)) 14%, transparent);
}
/* Rest is a first-class, movable plan row in the editor. */
.editor-rest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--border-radius-md);
  background: color-mix(in srgb, var(--primary) 7%, var(--card-bg));
  border: 1px dashed var(--border-color);
}
.editor-rest-row .editor-reorder {
  height: 34px;
}
.editor-rest-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.editor-rest-label i {
  color: var(--primary);
}
.editor-rest-secs {
  width: 64px;
  height: 30px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.editor-rest-unit {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: -4px;
}
.editor-rest-remove {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--danger-light);
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.editor-rest-remove:hover {
  background: var(--danger-light);
}
/* Insert bar in every gap: inject an exercise / circuit / rest at that position. */
.editor-insert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.editor-insert:hover,
.editor-insert:focus-within {
  opacity: 1;
}
.editor-insert:has(.editor-library-circuit) {
  flex-wrap: wrap;
  opacity: 1;
}
.editor-library-circuit {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
}
.editor-insert-line {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}
.ins-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ins-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.ins-btn.ins-circuit:hover {
  color: var(--secondary, var(--primary));
  border-color: var(--secondary, var(--primary));
}

/* Moved from index.css — active-set-row styling belongs with the plan editor. */

.active-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 8px;
}
.active-set-row .step-btn {
  background: none;
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
}
.active-set-row .input-set-weight,
.active-set-row .input-set-reps {
  background: none;
  border: none;
  color: #fff;
  text-align: center;
  font-size: 13px;
  height: 32px;
}
.active-set-row .input-set-weight {
  width: 50px;
}
.active-set-row .input-set-reps {
  width: 40px;
}
.active-set-row .set-checkbox-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.active-set-row .set-checkbox-btn.checked {
  background: var(--primary-gradient) !important;
  color: var(--on-primary) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.45) !important;
}

/* Mobile responsive scaling */

/* How long the plan runs against its slot. Beside the plan being built, because that
   is the only moment the answer can still change. Quiet while it fits — a trainer is reading the
   plan, not the meter — and marked when it does not, since "over" is the whole message. */
/* A READING, not a control. It sat in this toolbar as a 999px pill beside a real button and was
   taken for one (reported 2026-09-01). It is now set as text with a clock beside it: no pill, no
   fill while the plan fits, and the tint kept only for the state that wants attention. */
.editor-plan-fit {
  margin-left: auto;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted);
}
.editor-plan-fit i {
  font-size: 10px;
  opacity: 0.8;
}
/* Two states worth finding at a glance. The WORD is what says which one — "tight", "over" — and
   this only makes it findable; a trainer who cannot tell the amber from the red still reads it. */
.editor-plan-fit.is-warning,
.editor-plan-fit.is-over {
  padding: 4px 8px;
  border-radius: var(--border-radius-md, 8px);
}
.editor-plan-fit.is-warning {
  color: var(--warning, #f59e0b);
  background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent);
}
.editor-plan-fit.is-over {
  color: var(--danger, #dc2626);
  background: color-mix(in srgb, var(--danger, #dc2626) 14%, transparent);
}

/* A movement that came in with an imported programme and is not in the catalogue. The
   word carries the meaning and the glyph decorates it — on a phone a tooltip is unreachable, so an
   icon alone would be a mark nobody can read. */
.editor-custom-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px dashed var(--border-color);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  white-space: nowrap;
}
