/*
 * Capacity picker: how a member gets a place in a class.
 *   assigned: the room seen from the door, one button per numbered spot;
 *             a list by row when the column is narrow or the text is large;
 *   pooled:   a count and a thin bar, no spot to pick.
 * State by shape as well as colour (design review U7, U8):
 *   open      outlined number;
 *   taken     struck number on a quiet fill, no outline;
 *   yours     solid fill in the member colour;
 *   selected  a second ring outside the spot.
 * Colours come from the studio's theme.css only.
 */
.picker { container: picker / inline-size; display: flex; flex-direction: column; gap: var(--space-l); }
.room { display: flex; flex-direction: column; align-items: center; gap: var(--space-l); }
.podium {
  width: 64%;
  text-align: center;
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-weight: var(--weight-strong);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: var(--space-s);
  border-bottom: 1px solid var(--line);
}
.spots { display: flex; flex-direction: column; gap: var(--space-m); }
.spot-row { display: grid; grid-template-columns: repeat(var(--cols, 4), 3rem); gap: var(--space-m); }
.spot-row .row-label { display: none; }
.spot {
  width: 3rem;
  height: 3rem;
  min-height: 3rem;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-spot);
  background: transparent;
  color: var(--ink);
  font-size: var(--text-m);
  line-height: 1;
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}
.spot .spot-state { display: none; }
.spot.taken, .spot.taken:disabled {
  border-color: transparent;
  background: var(--unavailable);
  color: var(--muted);
  opacity: 1;
  cursor: not-allowed;
}
.spot.taken .spot-number { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.spot.mine, .spot.mine:disabled { background: var(--mine); border-color: var(--mine); color: var(--on-mine); opacity: 1; }
.spot.selected { outline: 2px solid var(--ink); outline-offset: 3px; }
.spot:disabled:not(.taken):not(.mine) { opacity: 0.5; cursor: not-allowed; }

.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xs) var(--space-l); font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: var(--space-xs); }
.legend i { width: 0.75rem; height: 0.75rem; border-radius: 3px; border: 1.5px solid var(--ink); }
.legend i.taken { border-color: transparent; background: linear-gradient(to top right, transparent 44%, var(--muted) 44% 56%, transparent 56%), var(--unavailable); }
.legend i.mine { border-color: var(--mine); background: var(--mine); }

/* List by row: for a narrow column or large text. The thresholds are in rem, so
   larger text reaches them sooner (2 columns: 7rem, 4: 16rem, 6: 22rem). */
@container picker (max-width: 16rem) {
  .room:not(.cols-2) .spots { width: 100%; gap: 0; }
  .room:not(.cols-2) .spot-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-s);
    padding: var(--space-m) 0;
    border-top: 1px solid var(--line);
  }
  .room:not(.cols-2) .spot-row .row-label { display: block; width: 100%; font-size: var(--text-s); line-height: var(--leading-s); color: var(--muted); }
  .room:not(.cols-2) .spot { width: auto; padding: 0 var(--space-m); gap: var(--space-s); border-radius: var(--radius-control); }
  .room:not(.cols-2) .spot .spot-state { display: inline; font-size: var(--text-s); font-weight: var(--weight-regular); }
}
@container picker (max-width: 22rem) {
  .room.cols-6 .spots { width: 100%; gap: 0; }
  .room.cols-6 .spot-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-s); padding: var(--space-m) 0; border-top: 1px solid var(--line); }
  .room.cols-6 .spot-row .row-label { display: block; width: 100%; font-size: var(--text-s); line-height: var(--leading-s); color: var(--muted); }
  .room.cols-6 .spot { width: auto; padding: 0 var(--space-m); gap: var(--space-s); border-radius: var(--radius-control); }
  .room.cols-6 .spot .spot-state { display: inline; font-size: var(--text-s); font-weight: var(--weight-regular); }
}

/* Pooled: a count and a bar. */
.capacity { display: flex; flex-direction: column; gap: var(--space-s); }
.capacity-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.capacity-bar i { display: block; height: 100%; background: var(--ink); }
.capacity-count { font-weight: var(--weight-strong); }
