:root {
  --bg: #FFF1F6;
  --card: #FFFFFF;
  --card-soft: #FFE3EF;
  --accent: #FF2D78;
  --accent-dark: #E0185F;
  --accent-grad: linear-gradient(135deg, #FF6FA8, #FF2D78);
  --text: #2B1F26;
  --text-muted: #9A8590;
  --border: #FBD6E4;
  --success: #22C55E;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-full: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, sans-serif;
  height: 100%;
  overscroll-behavior-y: none;
}

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

.topbar {
  padding: 18px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.content {
  flex: 1;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 2px 10px rgba(255, 45, 120, 0.06);
}

.card-soft {
  background: var(--card-soft);
}

.btn {
  border: none;
  border-radius: var(--radius-full);
  padding: 15px 22px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: transform 0.08s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  width: 100%;
}

.btn-secondary {
  background: var(--card-soft);
  color: var(--accent-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--border);
}

.btn-icon {
  border-radius: 50%;
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-soft);
  color: var(--accent-dark);
  border: none;
}

.btn-icon.recording {
  background: var(--accent);
  color: #fff;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,45,120,0.5); }
  70% { box-shadow: 0 0 0 12px rgba(255,45,120,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,45,120,0); }
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.pill.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
}

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}

.exercise-item {
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1.5px solid var(--border);
  font-weight: 600;
  cursor: pointer;
}
.exercise-item:active { background: var(--card-soft); }

.set-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.set-row input {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 16px;
  width: 100%;
  background: #fff;
  color: var(--text);
}

.set-num {
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.field-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.exercise-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.exercise-card-header h3 {
  margin: 0;
  font-size: 17px;
}

.badge-done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(34,197,94,0.12);
  color: var(--success);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
}

.row-actions {
  display: flex;
  gap: 10px;
}
.row-actions .btn { flex: 1; }

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

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
}

.nav-item.active { color: var(--accent); }
.nav-item svg { width: 22px; height: 22px; }

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

.transcript-box {
  background: var(--card-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  font-style: italic;
}

.center-screen {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 20px;
}

.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 14px;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; }

input[type="password"], input[type="text"] {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 16px;
  width: 100%;
}
