@import url("/static/css/tokens.css");
@import url("/static/css/components.css");

html,
body,
.ps-shell {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: #090a0d;
}

body {
  overscroll-behavior-y: none;
}

.ps-page {
  width: 100%;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 0 max(96px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  color: #ffffff;
  background:
    radial-gradient(circle at 86% 4%, rgba(255, 159, 110, 0.18), transparent 24rem),
    linear-gradient(180deg, #15181d, #090a0d 48%);
}

.ps-lead {
  margin: 0 22px 8px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.45;
}

.ps-logout-btn,
.wh-pill,
.wh-small {
  display: inline-grid;
  min-height: 40px;
  padding: 0 14px;
  place-items: center;
  color: #111111;
  background: #ff9f6e;
  border: 1px solid rgba(255, 159, 110, 0.3);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 800;
  text-decoration: none;
}

.wh-small:disabled,
.ps-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.wh-page .ps-title {
  max-width: 12ch;
  color: #ffffff;
}

.wh-hero,
.wh-card,
.wh-workout-card,
.wh-current,
.wh-step-row,
.wh-player {
  margin: 12px 22px 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  box-shadow: var(--ps-shadow-paper);
}

.wh-hero,
.wh-card,
.wh-current,
.wh-player {
  padding: 18px;
}

.wh-hero p,
.wh-card p,
.wh-current p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.5;
}

.wh-error {
  color: var(--ps-red) !important;
  font-weight: 800;
}

.wh-toolbar,
.wh-actions,
.wh-controls,
.wh-targets,
.wh-fields {
  display: flex;
  gap: 10px;
}

.wh-toolbar {
  margin: 16px 22px 0;
}

.wh-list {
  display: grid;
  gap: 12px;
  padding: 10px 0 44px;
}

.wh-workout-card,
.wh-step-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.wh-workout-card h2,
.wh-current h2,
.wh-card h2,
.wh-player h2 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  letter-spacing: -0.05rem;
}

.wh-workout-card h2,
.wh-step-row strong,
.wh-history span {
  overflow-wrap: anywhere;
}

.wh-workout-card p,
.wh-step-row span {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.9rem;
}

.wh-actions,
.wh-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wh-small { cursor: pointer; }

.wh-light {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.wh-danger,
.wh-mini-danger {
  color: #ffffff;
  background: rgba(227, 52, 47, 0.9);
  border-color: rgba(227, 52, 47, 0.55);
}

.wh-mini-danger {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.wh-start {
  margin: 12px 22px 2px;
}

.wh-current {
  background: #161616;
  color: #ffffff;
  border: 0;
}

.wh-player {
  --timer-color: #ff9f6e;
  overflow: hidden;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 138, 76, 0.24), transparent 10rem),
    linear-gradient(160deg, #15181d, #090a0d 72%);
  border: 0;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.22);
}

.wh-player.has-rest {
  --timer-color: #f59e0b;
}

.wh-player.is-resting {
  --timer-color: #38bdf8;
  background:
    radial-gradient(circle at 50% 32%, rgba(56, 189, 248, 0.26), transparent 10rem),
    linear-gradient(160deg, #10233f, #090a0d 72%);
}

.wh-player.is-rest-step {
  --timer-color: #38bdf8;
  background:
    radial-gradient(circle at 50% 32%, rgba(56, 189, 248, 0.3), transparent 10rem),
    linear-gradient(160deg, #10233f, #090a0d 72%);
}

.wh-player-top,
.wh-metrics {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.wh-player .ps-label,
.wh-tip,
.wh-next {
  color: rgba(255, 255, 255, 0.62);
}

.wh-player h2 {
  color: #ffffff;
  font-size: clamp(2.1rem, 10vw, 3rem);
  line-height: 0.94;
}

.wh-round {
  display: grid;
  min-width: 54px;
  min-height: 54px;
  place-items: center;
  color: #111111;
  background: var(--timer-color);
  border-radius: 18px;
  font-weight: 900;
}

.wh-ring {
  position: relative;
  display: grid;
  width: min(72vw, 310px);
  aspect-ratio: 1;
  margin: 22px auto;
  place-items: center;
  background:
    conic-gradient(var(--timer-color) var(--progress), rgba(255, 255, 255, 0.14) 0),
    #111111;
  border-radius: 50%;
}

.wh-ring::before {
  width: 78%;
  aspect-ratio: 1;
  content: "";
  background: #0d0e12;
  border-radius: 50%;
}

.wh-ring-core {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 78%;
  aspect-ratio: 1;
  place-items: center;
  text-align: center;
  transform: translate(-50%, -50%);
}

.wh-ring-core span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
}

.wh-ring-core strong {
  margin-top: 6px;
  font-size: clamp(3.4rem, 18vw, 5.5rem);
  font-weight: 300;
  letter-spacing: -0.16rem;
}

.wh-timer-start {
  display: grid;
  width: min(100%, 260px);
  min-height: 52px;
  margin: -4px auto 18px;
  place-items: center;
  color: #111111;
  background: var(--timer-color);
  border: 0;
  border-radius: 999px;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.wh-metrics {
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
}

.wh-metrics div {
  display: grid;
  gap: 4px;
}

.wh-metrics span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.wh-metrics b {
  font-size: 1.05rem;
}

.wh-rest-metric {
  color: #111111;
  background: var(--timer-color);
  padding: 8px 10px;
  border-radius: 16px;
}

.wh-rest-metric span {
  color: rgba(0, 0, 0, 0.56);
}

.wh-current .ps-label,
.wh-current p {
  color: rgba(255, 255, 255, 0.66);
}

.wh-targets {
  flex-wrap: wrap;
  margin-top: 14px;
}

.wh-targets span,
.wh-event {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 0.85rem;
}

.wh-progress {
  margin: 0 22px 12px;
}

.wh-progress div {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.84rem;
  font-weight: 800;
}

.wh-progress > span {
  display: block;
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.wh-progress > span::before {
  display: block;
  width: var(--pct);
  height: 100%;
  content: "";
  background: #ff9f6e;
  border-radius: inherit;
}

.wh-mode-tabs {
  display: flex;
  gap: 8px;
  margin: 0 22px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.wh-mode-tabs button {
  flex: none;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 900;
}

.wh-mode-tabs .active {
  color: #ffffff;
  color: #111111;
  background: #ff9f6e;
  border-color: #ff9f6e;
}

.wh-list-head,
.wh-circuit-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.wh-list-head span,
.wh-circuit-head span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  font-weight: 800;
}

.wh-circuit {
  margin-top: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
}

.wh-circuit-head {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wh-exercise-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wh-exercise-row:last-child {
  border-bottom: 0;
}

.wh-exercise-row.current {
  margin: 8px -6px;
  padding: 12px 8px;
  background: rgba(255, 159, 110, 0.16);
  border: 0;
  border-radius: 18px;
}

.wh-exercise-row.rest {
  background: rgba(56, 189, 248, 0.08);
}

.wh-exercise-row.rest .wh-status {
  color: #0f5f7d;
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
}

.wh-status {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: rgba(255, 255, 255, 0.58);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 950;
}

.wh-exercise-row.done .wh-status {
  color: #ffffff;
  color: #111111;
  background: #ff9f6e;
  border-color: #ff9f6e;
}

.wh-exercise-row.current .wh-status {
  color: #ff9f6e;
  background: rgba(255, 255, 255, 0.1);
  border-color: #ff9f6e;
}

.wh-exercise-row h3 {
  margin: 0 0 3px;
  font-size: 0.95rem;
}

.wh-exercise-row p {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
}

.wh-move {
  min-height: 34px;
  padding: 0 11px;
  color: #111111;
  background: #ffffff;
  border: 0;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.wh-exercise-row.current .wh-move {
  color: #ffffff;
  background: #ff9f6e;
}

.wh-sticky-player {
  position: sticky;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin: 16px 22px 0;
  padding: 12px;
  color: #ffffff;
  background: #15181d;
  border-radius: 24px;
  box-shadow: 0 18px 32px rgba(16, 24, 39, 0.23);
}

.wh-sticky-player strong,
.wh-sticky-player span {
  display: block;
}

.wh-sticky-player span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
}

.wh-sticky-player b {
  font-size: 1.6rem;
  letter-spacing: -0.06em;
}

.wh-sticky-player button {
  width: 42px;
  height: 42px;
  color: #ffffff;
  color: #111111;
  background: #ff9f6e;
  border: 0;
  border-radius: 999px;
  font-weight: 950;
}

.wh-next-btn {
  min-height: 58px;
  margin-top: 8px;
  font-size: 1rem;
}

.wh-player .wh-targets span {
  background: rgba(255, 255, 255, 0.12);
}

.wh-tip,
.wh-next {
  margin: 14px 0 0;
  line-height: 1.45;
}

.wh-next {
  color: #ffbf99;
  font-weight: 800;
}

.wh-controls {
  margin: 10px 22px 0;
  justify-content: center;
}

.wh-jump {
  margin: 12px 22px 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 22px;
}

.wh-jump summary {
  cursor: pointer;
  font-weight: 800;
}

.wh-jump-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.wh-jump-grid button {
  width: 100%;
  padding: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}

.wh-page .ps-field {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.wh-page .ps-field label {
  color: rgba(255, 255, 255, 0.58);
}

.wh-page .ps-field input,
.wh-page .ps-field textarea {
  color: #ffffff;
}

.wh-page .ps-field input::placeholder,
.wh-page .ps-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.36);
}

.wh-prompt {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  font-size: 0.82rem;
  line-height: 1.45;
  resize: vertical;
}

.wh-lab-form {
  display: grid;
  gap: 14px;
}

.wh-lab-fields,
.wh-lab-grid {
  display: grid;
  gap: 10px;
}

.wh-lab-actions {
  margin: 0;
  flex-wrap: wrap;
}

.wh-lab-blocks {
  display: grid;
  gap: 14px;
}

.wh-lab-block,
.wh-lab-item {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
}

.wh-lab-block summary,
.wh-lab-item summary {
  cursor: pointer;
  list-style: none;
}

.wh-lab-block summary::-webkit-details-marker,
.wh-lab-item summary::-webkit-details-marker {
  display: none;
}

.wh-lab-block[open] summary,
.wh-lab-item[open] summary {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wh-lab-block {
  border-color: rgba(255, 159, 110, 0.28);
}

.wh-lab-item {
  background: rgba(0, 0, 0, 0.18);
}

.wh-lab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wh-lab-head span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.wh-lab-items {
  display: grid;
  gap: 10px;
}

.wh-lab select {
  width: 100%;
  color: #ffffff;
  background: transparent;
  border: 0;
  outline: 0;
}

.wh-visibility {
  display: grid;
  gap: 10px;
}

.wh-page .ps-btn-primary {
  color: #111111;
  background: #ff9f6e;
}

.wh-fields {
  flex-wrap: wrap;
}

.wh-log {
  position: sticky;
  top: 8px;
  z-index: 3;
  padding: 14px;
}

.wh-log h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.wh-fields .ps-field {
  flex: 1 1 92px;
}

.wh-compact-fields .ps-field {
  min-height: 66px;
}

.wh-compact-fields .ps-field input {
  font-size: 1.35rem;
  font-weight: 900;
}

.wh-event {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.wh-history {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wh-session-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.wh-session-row .wh-history {
  min-width: 0;
}

.wh-danger-form {
  margin: 14px 22px 0;
}

.wh-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 22px 0;
}

.wh-stat-card {
  display: grid;
  gap: 4px;
  padding: 14px 10px;
  text-align: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
}

.wh-stat-card b {
  font-size: 1.5rem;
  letter-spacing: -0.06em;
}

.wh-stat-card span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.wh-active-tab {
  position: fixed;
  right: 16px;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 14px;
  color: #ffffff;
  text-decoration: none;
  background: rgba(21, 24, 29, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
}

.wh-active-tab b,
.wh-active-tab small {
  display: block;
}

.wh-active-tab small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.75rem;
  font-weight: 800;
}

.wh-active-tab strong {
  color: #111111;
  background: #ff9f6e;
  padding: 8px 10px;
  border-radius: 999px;
}

.wh-modal {
  width: min(calc(100vw - 44px), 430px);
  padding: 0;
  color: #ffffff;
  background: #15181d;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.wh-modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(5px);
}

.wh-modal form {
  padding: 20px;
}

.wh-modal h2 {
  margin: 6px 0 8px;
  font-size: 1.8rem;
  letter-spacing: -0.05em;
}

.wh-modal p {
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  line-height: 1.45;
}

.wh-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (min-width: 760px) {
  .ps-shell {
    max-width: 520px;
    margin: 0 auto;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.38);
  }

  .wh-list {
    grid-template-columns: 1fr;
    padding-right: 0;
  }

  .wh-current,
  .wh-card,
  .wh-hero,
  .wh-start,
  .wh-toolbar,
  .wh-controls,
  .wh-jump {
    max-width: 760px;
  }

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