:root {
  --color-bg: #f5f7fb;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-muted: #64748b;
  --color-primary: #0ea5e9;
  --color-primary-dark: #0284c7;
  --color-border: rgba(15, 23, 42, 0.1);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

html[data-theme='dark'] {
  --color-bg: #0f172a;
  --color-surface: #111c2f;
  --color-text: #e2e8f0;
  --color-muted: #94a3b8;
  --color-primary: #38bdf8;
  --color-primary-dark: #0ea5e9;
  --color-border: rgba(226, 232, 240, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app__header {
  padding: 24px 20px 8px;
}

.app__title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.app__main {
  flex: 1;
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.screen__title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
}

.screen__hint {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.exercise-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exercise-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
  text-align: left;
}

.exercise-item:active {
  transform: scale(0.99);
}

.exercise-item--disabled {
  cursor: default;
  opacity: 0.6;
  pointer-events: none;
}

.exercise-item--disabled:active {
  transform: none;
}

.exercise-item__name {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.exercise-item__meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0;
}

.back-button {
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 1rem;
  cursor: pointer;
}

.back-button:active {
  transform: scale(0.97);
}

.weight-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.control-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, background 120ms ease;
}

.control-btn:active {
  transform: scale(0.95);
  background: var(--color-primary-dark);
}

.control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  background: var(--color-primary);
}

.weight-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.weight-display--disabled {
  opacity: 0.6;
  pointer-events: none;
}

.weight-display__value {
  font-size: 2.4rem;
  font-weight: 700;
}

.weight-display__unit {
  font-size: 1rem;
  color: var(--color-muted);
}

.primary-btn {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.primary-btn:active {
  transform: scale(0.99);
  background: var(--color-primary-dark);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.summary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

.summary__days {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-day {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary__title {
  margin: 0 0 10px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary__label {
  font-weight: 600;
}

.summary__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.18);
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
}

html[data-theme='dark'] .summary__count {
  background: rgba(56, 189, 248, 0.22);
}

.sets-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sets-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(14, 165, 233, 0.08);
}

html[data-theme='dark'] .sets-list__item {
  background: rgba(56, 189, 248, 0.12);
}

.sets-list__weight {
  font-weight: 600;
}

.sets-list__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sets-list__time {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.sets-list__actions {
  display: flex;
  align-items: center;
}

.set-delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, background 150ms ease;
}

.set-delete-btn:active {
  transform: scale(0.95);
  background: rgba(239, 68, 68, 0.22);
}

.set-delete-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: rgba(239, 68, 68, 0.12);
}

html[data-theme='dark'] .set-delete-btn {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.18);
}

html[data-theme='dark'] .set-delete-btn:active {
  background: rgba(248, 113, 113, 0.3);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
  transition: opacity 200ms ease;
}

.toast[data-theme='dark'] {
  background: rgba(226, 232, 240, 0.9);
  color: #0f172a;
}

@media (max-width: 480px) {
  .app__header {
    padding: 20px 16px 6px;
  }

  .app__main {
    padding: 0 16px 20px;
  }
}
