:root {
  color-scheme: light;
  --bg: #f4f8fc;
  --surface: #ffffff;
  --surface-soft: #edf4fb;
  --line: #d7e4f1;
  --text: #172033;
  --muted: #728197;
  --blue: #00a8ff;
  --cyan: #16d2c5;
  --violet: #834df5;
  --danger: #e5484d;
  --shadow: 0 20px 60px rgba(0, 44, 92, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Exo 2",
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 12px;
}

.phone {
  width: min(100%, 1120px);
  min-height: calc(100vh - 24px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 168, 255, 0.22);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar,
.dock {
  display: flex;
  align-items: center;
  background: rgba(246, 250, 255, 0.96);
  border-color: var(--line);
}

.topbar {
  height: 58px;
  padding: 0 22px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand img {
  height: 38px;
  width: auto;
  display: block;
}

.brand-title {
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.actions,
.language-tabs,
.view-tabs,
.set-row,
.exercise-actions,
.stats-grid {
  display: flex;
  align-items: center;
}

.actions {
  gap: 10px;
}

.icon-button,
.language-button,
.nav-button,
.ghost-button,
.primary-button,
.danger-button,
.small-button {
  border: 0;
  border-radius: 8px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.icon-button {
  width: 40px;
  background: transparent;
  color: #1b6fd7;
}

.language-tabs {
  gap: 4px;
  background: #e9f1fb;
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 8px;
}

.language-button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
}

.language-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 28px 86px;
}

.stepper {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: start;
  gap: 0;
  padding: 34px 8px 26px;
}

.step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #aeb9c8;
  text-align: center;
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 31px;
  left: calc(50% + 34px);
  width: calc(100% - 68px);
  height: 3px;
  background: #e5edf7;
}

.step.done:not(:last-child)::after {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.step-index {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 3px solid #e5edf7;
  font-size: 22px;
  font-weight: 900;
  z-index: 1;
}

.step.active .step-index {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #0069d9, var(--blue));
  box-shadow: 0 18px 32px rgba(0, 111, 217, 0.28);
}

.step.done .step-index {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), #007cbe);
}

.step-title {
  margin-top: 8px;
  font-size: 21px;
  font-weight: 900;
}

.step.active .step-title {
  color: #126bd0;
}

.step-caption {
  min-height: 22px;
  color: #aeb9c8;
  font-weight: 700;
}

.panel {
  min-height: 440px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.choice-card {
  position: relative;
  min-height: 178px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: #24324a;
  padding: 20px 14px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.choice-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 168, 255, 0.5);
  box-shadow: 0 12px 30px rgba(0, 71, 150, 0.12);
}

.choice-card.selected {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 16px 36px rgba(0, 168, 255, 0.18);
}

.radio-dot {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 18px;
  height: 18px;
  border: 3px solid #d4e0ee;
  border-radius: 999px;
  background: #f7fbff;
}

.choice-card.selected .radio-dot {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 4px #fff;
  background: var(--blue);
}

.choice-icon {
  width: 74px;
  height: 74px;
  color: #27344d;
}

.choice-card:nth-child(3n + 1) .choice-icon {
  color: #d9a400;
}

.choice-card:nth-child(3n + 2) .choice-icon {
  color: #5c5a92;
}

.choice-card:nth-child(3n + 3) .choice-icon {
  color: #23384a;
}

.choice-label {
  font-size: 21px;
  line-height: 1.1;
  font-weight: 900;
  text-align: center;
}

.footer-actions {
  margin-top: auto;
  padding-top: 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 58px;
  padding: 0 22px;
  font-size: 18px;
}

.primary-button {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #fff;
  box-shadow: 0 15px 36px rgba(0, 168, 255, 0.25);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: default;
  opacity: 0.45;
  box-shadow: none;
}

.ghost-button {
  color: #6d7a8f;
  background: #fff;
  border: 1px solid #b7cdf0;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  color: #126bd0;
  background: #e9f5ff;
}

.small-button.danger {
  color: #b5252a;
  background: #ffecef;
}

.workout-list {
  display: grid;
  gap: 14px;
}

.exercise-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  display: grid;
  grid-template-columns: 118px 1fr;
  min-height: 118px;
}

.exercise-card img {
  width: 118px;
  height: 100%;
  object-fit: cover;
  background: #dde7f3;
}

.exercise-content {
  padding: 13px 15px;
  min-width: 0;
}

.exercise-kicker,
.empty,
.muted {
  color: var(--muted);
}

.exercise-kicker {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.exercise-title {
  margin: 3px 0 7px;
  font-size: 17px;
  font-weight: 900;
}

.exercise-description {
  margin: 0;
  color: #5c6879;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.exercise-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.session-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 22px;
}

.timer {
  font-weight: 900;
  color: #126bd0;
}

.set-row {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.set-row input {
  width: 86px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
}

.section-title {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 900;
}

.hero-logo {
  width: min(360px, 80vw);
  display: block;
  margin: 0 auto 22px;
}

.empty {
  text-align: center;
  padding: 70px 20px;
  font-weight: 800;
}

.stats-grid {
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

.stat {
  flex: 1 1 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.stat strong {
  display: block;
  font-size: 28px;
  color: #126bd0;
}

.view-tabs {
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.dock {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 72px;
  border-top: 1px solid var(--line);
  z-index: 5;
}

.nav-button {
  flex-direction: column;
  color: #68778c;
  background: transparent;
  padding: 8px 4px;
  border-radius: 0;
  font-size: 12px;
}

.nav-button.active {
  color: #009fb2;
  background: #fff;
}

.nav-icon {
  width: 22px;
  height: 22px;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 14px;
  font-weight: 900;
  color: #126bd0;
}

.loading-screen img {
  width: min(320px, 72vw);
}

@media (max-width: 780px) {
  .app-shell {
    padding: 0;
  }

  .phone {
    min-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .topbar {
    height: 56px;
    padding: 0 12px;
  }

  .brand img {
    height: 32px;
    max-width: 178px;
  }

  .brand-title {
    display: none;
  }

  .actions {
    gap: 6px;
  }

  .language-button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
  }

  .main {
    padding: 14px 14px 82px;
  }

  .stepper {
    padding: 18px 0 20px;
  }

  .step-index {
    width: 54px;
    height: 54px;
  }

  .step:not(:last-child)::after {
    top: 26px;
    left: calc(50% + 28px);
    width: calc(100% - 56px);
  }

  .step-title {
    font-size: 15px;
  }

  .step-caption {
    display: none;
  }

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

  .choice-card {
    min-height: 136px;
    padding: 18px 10px 14px;
  }

  .choice-icon {
    width: 52px;
    height: 52px;
  }

  .choice-label {
    font-size: 16px;
  }

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

  .exercise-card {
    grid-template-columns: 92px 1fr;
  }

  .exercise-card img {
    width: 92px;
  }

  .dock {
    min-height: 68px;
  }
}
