:root {
  color-scheme: light;
  --color-background: #f7f7f2;
  --color-surface: #ffffff;
  --color-ink: #15171a;
  --color-muted: #62666d;
  --color-border: #daddd8;
  --color-soft: #f0f2ec;
  --color-action: #2563eb;
  --color-action-ink: #ffffff;
  --color-energy: #a3e635;
  --color-rest: #14b8a6;
  --color-danger: #f9735b;
  --color-break: #f5b942;
  --shadow-panel: 0 10px 28px rgb(21 23 26 / 7%);
  --shadow-modal: 0 22px 70px rgb(21 23 26 / 22%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--color-background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--color-ink);
  background: var(--color-background);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  min-height: 100vh;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0.8rem;
  min-height: 100vh;
  padding: 1.1rem 1.4rem;
}

.start-shell {
  display: grid;
  min-height: 100vh;
  padding: 1.4rem;
  place-items: center;
}

.start-content {
  display: grid;
  gap: 1.4rem;
  justify-items: center;
}

.start-visual {
  position: relative;
  width: min(62vw, 26rem);
  aspect-ratio: 16 / 9;
  pointer-events: none;
}

.start-visual::before {
  position: absolute;
  inset: 13% 8%;
  border: 2px solid rgb(21 23 26 / 10%);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 49.5%, rgb(21 23 26 / 7%) 49.5% 50.5%, transparent 50.5%),
    linear-gradient(180deg, transparent 49.5%, rgb(21 23 26 / 7%) 49.5% 50.5%, transparent 50.5%),
    #fbfbf8;
  content: "";
}

.start-connector {
  position: absolute;
  border-radius: 999px;
  background: var(--color-action);
  opacity: 0.72;
}

.start-connector-horizontal {
  top: calc(50% - 0.18rem);
  left: 18%;
  width: 64%;
  height: 0.36rem;
}

.start-connector-vertical {
  top: 23%;
  left: calc(50% - 0.18rem);
  width: 0.36rem;
  height: 54%;
}

.start-station {
  position: absolute;
  display: grid;
  width: 4.6rem;
  height: 3.8rem;
  border: 1px solid rgb(21 23 26 / 8%);
  border-radius: 8px;
  place-items: center;
  background: var(--color-surface);
  box-shadow: 0 10px 24px rgb(21 23 26 / 8%);
}

.start-station::before,
.start-station::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: var(--color-ink);
}

.start-station::before {
  width: 2.3rem;
  height: 0.34rem;
}

.start-station::after {
  width: 0.5rem;
  height: 1.35rem;
  box-shadow: 1.8rem 0 0 var(--color-ink);
}

.start-station-a {
  top: 8%;
  left: 8%;
}

.start-station-b {
  top: 8%;
  right: 8%;
}

.start-station-c {
  bottom: 8%;
  left: 8%;
}

.start-station-d {
  right: 8%;
  bottom: 8%;
}

.start-timer-mark {
  position: absolute;
  top: calc(50% - 2.15rem);
  left: calc(50% - 2.15rem);
  width: 4.3rem;
  height: 4.3rem;
  border: 0.5rem solid var(--color-energy);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: 0 12px 28px rgb(21 23 26 / 10%);
}

.start-timer-mark::before,
.start-timer-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  border-radius: 999px;
  background: var(--color-ink);
  transform-origin: center bottom;
}

.start-timer-mark::before {
  top: 0.65rem;
  width: 0.28rem;
  height: 1.35rem;
  transform: translateX(-50%);
}

.start-timer-mark::after {
  top: 1.35rem;
  width: 0.28rem;
  height: 1.05rem;
  transform: translateX(-50%) rotate(55deg);
}

.start-content h1 {
  font-size: 5rem;
  font-weight: 950;
}

.button.start-button {
  min-width: 18rem;
  min-height: 72px;
  font-size: 1.15rem;
}

.modal-body {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-modal);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 0.2rem 0;
}

.eyebrow,
.panel-header p,
.empty,
.field span {
  color: var(--color-muted);
}

.eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

h3 {
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
}

.top-actions,
.item-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  color: var(--color-ink);
  background: var(--color-surface);
  font-weight: 800;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button.primary {
  color: var(--color-action-ink);
  background: var(--color-action);
}

.button.secondary {
  border-color: var(--color-action);
  color: var(--color-action);
}

.button.ghost {
  border-color: transparent;
  background: var(--color-soft);
}

.button.danger,
.button.icon.danger {
  color: #9f2d1f;
  background: #fff4f0;
}

.button.small {
  min-height: 48px;
  padding: 0.5rem 0.75rem;
}

.button.icon {
  width: 48px;
  min-width: 48px;
  padding: 0;
}

.button:focus-visible,
input:focus-visible,
.timer-step:focus-visible,
.selected-icon:focus-visible,
.icon-option:focus-visible,
.exercise-toggle:focus-within {
  outline: 3px solid rgb(37 99 235 / 42%);
  outline-offset: 2px;
}

.setup-stage {
  display: grid;
  align-self: stretch;
  justify-self: center;
  width: min(100%, 72rem);
  min-height: 0;
}

.panel {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  margin-bottom: 0.9rem;
}

.panel-header.compact {
  min-height: 2.5rem;
}

.panel-header p {
  margin-bottom: 0;
  font-weight: 700;
}

.setup-panel {
  width: 100%;
}

.people-panel,
.exercise-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.split-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  height: 100%;
  min-height: 0;
}

.split-list section,
.exercise-list {
  min-height: 0;
  overflow: auto;
}

.people-group {
  border-radius: 8px;
  padding: 0.6rem;
}

.people-group-active {
  background: rgb(163 230 53 / 7%);
}

.people-group-pool {
  background: rgb(20 184 166 / 7%);
}

.item-list,
.exercise-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.exercise-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
}

.person-item,
.exercise-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 4rem;
  border-radius: 8px;
  padding: 0.55rem;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px rgb(21 23 26 / 6%);
}

.exercise-item {
  min-height: 3.15rem;
  padding: 0.35rem 0.45rem;
}

.exercise-item.default-exercise {
  background: #f8f9f4;
}

.exercise-item.custom-exercise {
  background: var(--color-surface);
}

.item-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.empty {
  display: grid;
  min-height: 3.4rem;
  margin-bottom: 0;
  place-items: center;
  border-radius: 8px;
  background: var(--color-soft);
  font-weight: 700;
}

.exercise-toggle {
  display: grid;
  grid-template-columns: 1.25rem 2.1rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
  min-height: 3rem;
  border-radius: 6px;
}

.exercise-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.exercise-mark {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--color-border);
  border-radius: 5px;
  background: var(--color-surface);
}

.exercise-toggle input:checked + .exercise-mark {
  border-color: var(--color-action);
  background:
    linear-gradient(135deg, transparent 46%, var(--color-action-ink) 47% 58%, transparent 59%),
    var(--color-action);
}

.exercise-icon {
  width: 3rem;
  height: 3rem;
  color: var(--color-action);
}

.exercise-toggle .exercise-icon {
  width: 2.1rem;
  height: 2.1rem;
}

.exercise-icon.large {
  width: 3.5rem;
  height: 3.5rem;
}

.timer-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-self: stretch;
  justify-self: center;
  width: min(100%, 72rem);
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 1rem;
  height: 100%;
  min-height: 18rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field span {
  font-size: 0.86rem;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  color: var(--color-ink);
  background: var(--color-surface);
  font-weight: 800;
}

.timer-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
  border-radius: 8px;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 82%), rgb(240 242 236 / 76%)),
    var(--color-surface);
  box-shadow: inset 0 0 0 1px rgb(21 23 26 / 6%);
}

.timer-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.timer-label {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.2rem;
  font-weight: 950;
}

.timer-unit {
  color: var(--color-muted);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.timer-control {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 4rem;
  align-items: stretch;
  gap: 0.6rem;
  min-height: 8rem;
}

.timer-step,
.timer-value {
  min-width: 0;
  border: 0;
  border-radius: 8px;
  font-weight: 950;
}

.timer-step {
  min-height: 5rem;
  color: var(--color-ink);
  background: var(--color-energy);
  font-size: 2.25rem;
  line-height: 1;
}

.timer-value {
  width: 100%;
  min-height: 8rem;
  border: 1px solid var(--color-border);
  padding: 0.25rem;
  color: var(--color-ink);
  background: var(--color-surface);
  font-size: 4.4rem;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timer-value::-webkit-outer-spin-button,
.timer-value::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.timer-value {
  appearance: textfield;
}

.status {
  align-self: end;
  min-height: 4rem;
  margin-top: 1rem;
  border-left: 0.35rem solid var(--color-border);
  border-radius: 8px;
  padding: 0.8rem;
  color: var(--color-muted);
  background: #fbfbf8;
  font-weight: 800;
}

.status.success {
  border-color: var(--color-rest);
  color: #0f766e;
}

.status.danger {
  border-color: var(--color-danger);
  color: #9f2d1f;
}

.setup-feedback.status {
  align-self: auto;
  justify-self: center;
  width: min(100%, 72rem);
  min-height: 0;
  margin-top: 0;
}

.setup-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  justify-self: center;
  width: min(100%, 72rem);
}

.setup-nav .button:last-child {
  grid-column: 3;
}

.modal {
  width: min(90vw, 34rem);
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgb(21 23 26 / 42%);
}

.modal-body {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-header h2 {
  margin-bottom: 0;
}

.modal-actions {
  justify-content: end;
}

.exercise-dialog-row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  align-items: end;
  gap: 0.75rem;
}

.exercise-name-field {
  min-width: 0;
}

.selected-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0;
  color: var(--color-ink);
  background: #fbfbf8;
}

.icon-modal {
  width: min(92vw, 48rem);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.65rem;
  max-height: min(58vh, 32rem);
  overflow: auto;
}

.icon-option {
  display: grid;
  gap: 0.4rem;
  place-items: center;
  min-height: 7rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.55rem;
  color: var(--color-ink);
  background: var(--color-surface);
  font-weight: 800;
}

.icon-option svg {
  width: 3.2rem;
  height: 3.2rem;
  color: var(--color-action);
}

.icon-option.selected {
  border-color: var(--color-action);
  background: rgb(37 99 235 / 8%);
}

.workout-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(0.55rem, 1.3vh, 1rem);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: clamp(0.7rem, 1.5vh, 1.1rem) clamp(0.9rem, 2vw, 1.4rem);
  background: var(--color-background);
}

.assignment-card,
.finished-shell {
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.workout-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 0.2rem 0;
}

.phase-meta {
  min-width: 8rem;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  background: var(--color-soft);
  font-size: 1.25rem;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.workout-shell.interval_rest .phase-meta {
  background: rgb(20 184 166 / 13%);
  color: #0f766e;
}

.workout-shell.round_break .phase-meta {
  background: rgb(245 185 66 / 18%);
  color: #7c5209;
}

.workout-shell.round_start .phase-meta {
  background: rgb(245 185 66 / 18%);
  color: #7c5209;
}

.assignment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}

.assignment-count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assignment-count-3,
.assignment-count-8-plus {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.assignment-count-4-6 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assignment-count-7 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.assignment-count-7 .assignment-card {
  grid-column: span 2;
}

.assignment-count-7 .assignment-card:nth-child(n + 4) {
  grid-column: span 3;
}

.assignment-card {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 0;
  height: 100%;
  padding: 1rem;
}

.assignment-card h2 {
  margin-bottom: 0.35rem;
  font-size: 2rem;
  overflow-wrap: anywhere;
}

.assignment-card p {
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 1.2rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.assignment-icon {
  width: 7rem;
  height: 7rem;
  color: var(--color-action);
}

.workout-shell.workout-compact .workout-topbar {
  min-height: 3.5rem;
}

.workout-shell.workout-compact .phase-meta {
  min-width: 7rem;
  padding: 0.55rem 0.75rem;
  font-size: 1.05rem;
}

.workout-shell.workout-compact .assignment-card {
  grid-template-columns: minmax(4rem, 0.3fr) minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.75rem;
}

.workout-shell.workout-compact .assignment-card h2 {
  margin-bottom: 0.2rem;
  font-size: clamp(1.2rem, 2.8vh, 1.65rem);
}

.workout-shell.workout-compact .assignment-card p {
  font-size: clamp(0.9rem, 2vh, 1.05rem);
}

.workout-shell.workout-compact .assignment-icon {
  width: clamp(4rem, 8.5vh, 5.2rem);
  height: clamp(4rem, 8.5vh, 5.2rem);
}

.workout-shell.workout-compact .timer-band {
  min-height: 5.8rem;
}

.workout-shell.workout-compact .countdown {
  font-size: clamp(4.1rem, 8vh, 4.9rem);
}

.workout-shell.workout-compact .timer-actions {
  gap: 0.5rem;
}

.assignment-count-8-plus .assignment-card {
  grid-template-columns: minmax(3.4rem, 0.32fr) minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.65rem;
}

.assignment-count-8-plus .assignment-card h2 {
  margin-bottom: 0.15rem;
  font-size: clamp(1.05rem, 2.4vh, 1.45rem);
}

.assignment-count-8-plus .assignment-card p {
  font-size: clamp(0.82rem, 1.8vh, 1rem);
}

.assignment-count-8-plus .assignment-icon {
  width: clamp(3.1rem, 7.4vh, 4.4rem);
  height: clamp(3.1rem, 7.4vh, 4.4rem);
}

.workout-shell.interval_rest .assignment-icon {
  color: var(--color-rest);
}

.workout-shell.round_start .assignment-icon {
  color: var(--color-break);
}

.round-break-stack {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 1rem;
  min-height: 0;
}

.round-break-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: center;
}

.round-break-panel div {
  display: grid;
  min-height: 5rem;
  place-items: center;
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.round-break-panel span {
  font-size: clamp(2.6rem, 7vh, 4rem);
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.round-break-panel p {
  margin-bottom: 0;
  color: var(--color-muted);
  font-weight: 900;
}

.round-preview {
  min-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.4rem);
}

.round-preview.visible {
  animation: preview-fade-in 700ms ease-out both;
  pointer-events: auto;
}

@keyframes preview-fade-in {
  from {
    opacity: 0;
    transform: translateY(0.4rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timer-band {
  display: grid;
  grid-template-columns: minmax(12rem, 0.45fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  min-height: 8rem;
  padding: 0;
}

.timer-band.countdown-only {
  grid-template-columns: 1fr;
}

.countdown {
  color: var(--color-ink);
  font-size: 6rem;
  font-weight: 950;
  line-height: 0.9;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timer-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.7rem;
}

.summary-shell {
  position: relative;
  display: grid;
  gap: 0.9rem;
  place-content: center;
  justify-items: center;
  min-height: 100vh;
  padding: 1rem;
  overflow: hidden;
  text-align: center;
}

.summary-celebration {
  position: relative;
  display: grid;
  width: 5.4rem;
  height: 5.4rem;
  place-items: center;
}

.summary-celebration::before,
.summary-celebration::after {
  position: absolute;
  content: "";
}

.summary-celebration::before {
  inset: 0.55rem;
  border: 2px solid rgb(21 23 26 / 14%);
  border-radius: 999px;
  animation: summary-ring 780ms cubic-bezier(0.2, 0.9, 0.25, 1.2) both;
}

.summary-celebration::after {
  inset: -0.15rem;
  border-radius: 999px;
  background:
    conic-gradient(
      from -12deg,
      transparent 0deg 16deg,
      rgb(163 230 53 / 72%) 16deg 24deg,
      transparent 24deg 72deg,
      rgb(20 184 166 / 62%) 72deg 80deg,
      transparent 80deg 148deg,
      rgb(245 185 66 / 72%) 148deg 156deg,
      transparent 156deg 224deg,
      rgb(37 99 235 / 52%) 224deg 232deg,
      transparent 232deg 360deg
    );
  -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 59% 64%, transparent 65%);
  mask: radial-gradient(circle, transparent 0 58%, #000 59% 64%, transparent 65%);
  animation: summary-spark 900ms ease-out both;
}

.summary-check {
  position: relative;
  z-index: 1;
  width: 2rem;
  height: 3rem;
  border-right: 0.38rem solid var(--color-ink);
  border-bottom: 0.38rem solid var(--color-ink);
  transform: rotate(45deg) scale(0.88);
  transform-origin: 60% 65%;
  animation: summary-check 520ms cubic-bezier(0.2, 1.25, 0.35, 1) 160ms both;
}

.summary-shell h1 {
  margin-bottom: 0;
  font-size: clamp(3.2rem, 8vw, 6.6rem);
  line-height: 0.9;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(6.8rem, 1fr));
  gap: 0;
  width: min(100vw - 2rem, 62rem);
  margin: 0;
  padding: 0.35rem 0;
  border-top: 1px solid rgb(21 23 26 / 12%);
  border-bottom: 1px solid rgb(21 23 26 / 12%);
}

.summary-grid div {
  min-width: 0;
  padding: 0.9rem 0.75rem;
  background: transparent;
}

.summary-grid div + div {
  border-left: 1px solid rgb(21 23 26 / 9%);
}

.summary-grid .wide {
  grid-column: auto;
}

.summary-grid dt {
  margin-bottom: 0.35rem;
  color: var(--color-muted);
  font-weight: 900;
}

.summary-grid dd {
  margin: 0;
  font-size: clamp(2.25rem, 4.8vw, 3.6rem);
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.summary-actions {
  display: grid;
  grid-template-columns: 1fr;
  width: min(100vw - 2rem, 18rem);
  justify-self: center;
}

@keyframes summary-ring {
  from {
    opacity: 0;
    transform: scale(0.45);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes summary-spark {
  from {
    opacity: 0;
    transform: rotate(-24deg) scale(0.55);
  }

  72% {
    opacity: 1;
  }

  to {
    opacity: 0.76;
    transform: rotate(0deg) scale(1);
  }
}

@keyframes summary-check {
  from {
    opacity: 0;
    transform: rotate(45deg) scale(0.35);
  }

  to {
    opacity: 1;
    transform: rotate(45deg) scale(0.88);
  }
}

@media (prefers-reduced-motion: reduce) {
  .summary-celebration::before,
  .summary-celebration::after,
  .summary-check {
    animation: none;
  }
}

@media (max-width: 980px) {
  .setup-panel {
    min-height: 20rem;
  }

  .timer-grid {
    gap: 0.75rem;
  }

  .timer-card {
    padding: 0.8rem;
  }

  .timer-control {
    grid-template-columns: 4rem minmax(0, 1fr) 4rem;
  }

  .timer-value {
    font-size: 4rem;
  }

  .timer-band {
    grid-template-columns: 1fr;
  }

  .exercise-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assignment-count-3,
  .assignment-count-8-plus {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assignment-count-7 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assignment-count-7 .assignment-card,
  .assignment-count-7 .assignment-card:nth-child(n + 4) {
    grid-column: auto;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid .wide {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  .start-visual {
    width: min(92vw, 22rem);
  }

  .start-station {
    width: 3.6rem;
    height: 3rem;
  }

  .start-station::before {
    width: 1.8rem;
  }

  .start-station::after {
    height: 1.05rem;
    box-shadow: 1.35rem 0 0 var(--color-ink);
  }

  .start-timer-mark {
    top: calc(50% - 1.75rem);
    left: calc(50% - 1.75rem);
    width: 3.5rem;
    height: 3.5rem;
  }

  .start-content h1 {
    font-size: 3.4rem;
  }

  .button.start-button {
    width: min(100%, 18rem);
  }

  .app-shell {
    padding: 0.8rem;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .setup-nav {
    grid-template-columns: 1fr;
  }

  .setup-nav .button:last-child {
    grid-column: auto;
  }

  .split-list {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }

  .person-item,
  .exercise-item {
    align-items: stretch;
    flex-direction: column;
  }

  .exercise-list {
    grid-template-columns: 1fr;
  }

  .timer-panel {
    align-self: start;
  }

  .timer-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .timer-card {
    min-height: 10rem;
  }

  .exercise-item {
    min-height: 3.4rem;
  }

  .exercise-toggle {
    min-height: 2.75rem;
  }

  .item-actions {
    width: 100%;
  }

  .item-actions .button.ghost {
    flex: 1;
  }

  .workout-shell {
    padding: 0.8rem;
  }

  .workout-topbar,
  .assignment-card,
  .timer-band {
    align-items: stretch;
  }

  .workout-topbar {
    flex-direction: column;
  }

  .assignment-card {
    grid-template-columns: 1fr;
  }

  .assignment-count-2,
  .assignment-count-3,
  .assignment-count-4-6,
  .assignment-count-7,
  .assignment-count-8-plus {
    grid-template-columns: 1fr;
  }

  .assignment-icon {
    width: 5rem;
    height: 5rem;
  }

  .countdown {
    font-size: 4.5rem;
  }

  .summary-grid,
  .summary-actions {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    width: min(100vw - 2rem, 26rem);
    border-bottom: 0;
  }

  .summary-grid div {
    border-bottom: 1px solid rgb(21 23 26 / 10%);
  }

  .summary-grid div + div {
    border-left: 0;
  }

  .summary-grid .wide {
    grid-column: span 1;
  }
}
