:root {
  --bg: #1c1c1e;
  --panel: #252a2f;
  --panel-2: #20242a;
  --line: #2f3f51;
  --line-2: #274d73;
  --text: #f5f7fb;
  --muted: #8f9aab;
  --blue: #4a9eff;
  --green: #69db75;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.app-shell {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0 10px 20px;
}

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

a {
  color: inherit;
}

.stack {
  display: grid;
  gap: 12px;
}

.card,
.auth-card {
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid #2b3239;
  padding: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 2px 14px;
}

.topbar h1 {
  font-size: 25px;
  letter-spacing: -0.02em;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-btn,
button,
input,
select {
  border: 1px solid #3a434d;
  border-radius: 10px;
  font: inherit;
}

.link-btn {
  text-decoration: none;
  color: #ced5df;
  background: #2a3037;
  font-size: 13px;
  padding: 7px 10px;
}

.link-btn.active {
  background: #3a4553;
  color: #fff;
  border-color: #435162;
}

.inline-form {
  margin: 0;
}

button {
  background: #2f3640;
  color: #fff;
  padding: 10px 12px;
}

button.ghost {
  background: #21262c;
}

input,
select {
  background: #1f242b;
  color: #fff;
  width: 100%;
  padding: 10px 11px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.error {
  color: #ff9e9e;
  margin-top: 8px;
}

.row {
  display: flex;
  gap: 10px;
}

.row.between {
  justify-content: space-between;
}

.row.baseline {
  align-items: baseline;
}

.pill {
  color: #b5bfcd;
  border: 1px solid #3a434d;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
}

.exercise-preview {
  margin: 10px 0;
  padding-left: 17px;
}

.exercise-preview li {
  margin-bottom: 5px;
  color: #d3dae4;
}

.month {
  color: #9aa7b7;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
  margin: 6px 4px 2px;
}

.volume {
  margin-top: 9px;
}

.pr {
  font-size: 14px;
  font-weight: 700;
}

.auth-card {
  margin-top: 20vh;
}

.pin-form {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.phone-frame {
  background: #252c31;
  border-radius: 8px;
  overflow: hidden;
}

.statusbar {
  background: #131416;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-weight: 700;
  font-size: 16px;
}

.dynamic-island {
  width: 136px;
  height: 24px;
  border-radius: 15px;
  background: #000;
}

.status-icons {
  font-size: 12px;
  font-weight: 600;
  color: #c7ced8;
}

.workout-topbar {
  height: 62px;
  padding: 10px 14px;
  border-bottom: 1px solid #35414f;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  column-gap: 10px;
}

.history-btn {
  width: 44px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #36414d;
  background: #1f242a;
  color: #dce1ea;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
}

.top-timer {
  text-align: center;
  color: #828f9d;
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.finish-inline {
  margin: 0;
}

.finish-top {
  border: none;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  min-width: 80px;
  padding: 9px 15px;
  font-size: 17px;
  line-height: 1;
}

.workout-head {
  padding: 14px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-row h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.menu-dot {
  border: none;
  border-radius: 9px;
  color: #a6caef;
  background: #2f4b6a;
  padding: 3px 8px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}

.menu-dot.small {
  padding: 4px 8px;
  min-width: 36px;
}

.meta-row {
  color: #98a6b8;
  margin-top: 6px;
  font-size: 14px;
}

.exercise-card {
  padding: 2px 14px 16px;
}

.exercise-card + .exercise-card {
  padding-top: 20px;
}

.exercise-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.exercise-header h2 {
  color: var(--blue);
  font-size: 17px;
}

.exercise-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.volume-pill {
  background: #2f4b6a;
  color: #62a6ff;
  border-radius: 10px;
  padding: 5px 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.set-grid {
  display: grid;
  row-gap: 8px;
}

.set-grid.is-time {
  grid-template-columns: 50px 70px 1fr 36px;
}

.set-grid.is-weight {
  grid-template-columns: 50px 74px 56px 56px 36px;
}

.set-header {
  color: #f4f7fb;
  font-size: 13px;
  font-weight: 700;
  align-self: end;
}

.check-head {
  text-align: center;
}

.set-row {
  display: contents;
}

.set-box {
  background: #171b23;
  border-radius: 9px;
  text-align: center;
  padding: 8px 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.prev-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e3e7ee;
  font-size: 13px;
  font-weight: 700;
}

.set-input {
  height: 38px;
  border: none;
  border-radius: 10px;
  background: #1c2129;
  color: #f6f8fb;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  padding: 0 8px;
}

.check-btn {
  height: 38px;
  border-radius: 10px;
  border: none;
  background: #1c2129;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
}

.check-btn.done {
  background: #1c2129;
}

.rest-row {
  grid-column: 1 / -1;
  margin-top: -4px;
  margin-bottom: -3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.rest-row::before,
.rest-row::after {
  content: '';
  height: 3px;
  border-radius: 3px;
  background: #315f8c;
  flex: 1;
}

.add-set-form {
  margin-top: 10px;
}

.add-set-btn {
  width: 100%;
  border: none;
  border-radius: 9px;
  background: #1b212a;
  color: #e8edf5;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 8px;
}

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

  .set-grid.is-weight {
    grid-template-columns: 47px 70px 52px 52px 34px;
  }
}
