/* Workout app v0.1.7 — plan-preview swap UI only.
   Keep this file alongside styles.css so the existing design remains untouched. */

.plan-preview-list {
  display: grid;
  gap: 10px;
}

.plan-preview-exercise {
  align-items: center;
  gap: 12px;
}

.plan-preview-exercise.is-swapped {
  outline: 1px solid currentColor;
  outline-offset: -1px;
}

.plan-swap-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
}

.plan-swap-button {
  appearance: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  padding: 7px 11px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.plan-swap-button:focus-visible,
.swap-option:focus-visible,
.swap-close-button:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

.swap-state-badge,
.swap-original-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.swap-state-badge {
  background: rgba(0, 0, 0, 0.08);
}

.swap-original-badge {
  background: rgba(0, 0, 0, 0.06);
}

.swap-none {
  max-width: 86px;
  text-align: right;
  line-height: 1.2;
  opacity: 0.58;
}

.plan-swapped-from {
  display: block;
  margin-top: 5px;
  font-size: 0.72rem;
  opacity: 0.68;
}

.swap-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(2px);
}

.swap-sheet {
  position: fixed;
  z-index: 41;
  left: 50%;
  bottom: 0;
  width: min(100%, 560px);
  max-height: min(78vh, 680px);
  overflow-y: auto;
  transform: translateX(-50%);
  border-radius: 24px 24px 0 0;
  background: var(--surface, #fffdf0);
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.22);
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
}

.swap-sheet-handle {
  width: 42px;
  height: 4px;
  margin: 2px auto 14px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.18;
}

.swap-sheet-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.swap-sheet-heading h3 {
  margin: 2px 0 2px;
}

.swap-close-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  background: rgba(0, 0, 0, 0.07);
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.swap-option-list {
  display: grid;
  gap: 9px;
}

.swap-option {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  padding: 14px;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.swap-option-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.swap-option-copy strong,
.swap-option-copy small,
.swap-option-copy em {
  overflow-wrap: anywhere;
}

.swap-option-copy small {
  opacity: 0.72;
}

.swap-option-copy em {
  font-style: normal;
  font-size: 0.72rem;
  opacity: 0.56;
}

.swap-chevron {
  font-size: 1.55rem;
  opacity: 0.45;
  flex: 0 0 auto;
}

.swap-empty {
  border: 1px dashed rgba(0, 0, 0, 0.16);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  opacity: 0.72;
}

@media (max-width: 520px) {
  .plan-preview-exercise {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .plan-swap-action {
    align-self: stretch;
  }

  .swap-sheet {
    width: 100%;
  }
}
