:root {
  --bg: #f7f7f7;
  --main: #012ded;
  --card: #ffffff;
  --soft: rgba(1, 45, 237, 0.08);
  --border: rgba(1, 45, 237, 0.16);
  --text: #012ded;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 18px 96px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 900;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 34px; line-height: 1; font-weight: 900; }
h2 { font-size: 30px; margin-bottom: 8px; line-height: 1.05; }
h3 { font-size: 18px; margin-bottom: 14px; }

.muted { opacity: 0.72; line-height: 1.45; }
.muted-light { opacity: 0.72; line-height: 1.45; }
.hidden { display: none !important; }
.screen { display: none; }
.screen.active { display: block; }

.card, .hero-card, .exercise-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 10px 28px rgba(1, 45, 237, 0.05);
}

.hero-card {
  background: var(--main);
  color: white;
  border: none;
}

.hero-card h2 { font-size: 42px; margin-bottom: 18px; }
.hero-card p { font-size: 17px; }

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

button, .import-label {
  border: 1px solid var(--main);
  background: var(--main);
  color: white;
  border-radius: 999px;
  padding: 13px 16px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
}

.compact { padding: 10px 16px; }
.ghost-btn, .feel-btn {
  background: transparent;
  color: var(--main);
}

.feel-btn.selected {
  background: var(--main);
  color: white;
}

.primary-btn {
  width: 100%;
  margin-top: 8px;
}

.hero-action {
  width: 100%;
  background: white;
  color: var(--main);
  border-color: white;
  margin-top: 10px;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.preview-row:last-child { border-bottom: none; }
.preview-row strong { color: var(--main); }
.preview-row span { opacity: .72; text-align: right; }

.exercise-card h3 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.prescription {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 12px;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
  margin: 8px 0;
  background: var(--soft);
}

.set-row input { width: 22px; height: 22px; }

.rating-label { margin: 14px 0 8px; font-weight: 900; }
.rating-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.rating-row button {
  padding: 10px 6px;
  font-size: 13px;
  background: transparent;
  color: var(--main);
}

.rating-row button.selected {
  background: var(--main);
  color: white;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 28px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px;
  box-shadow: 0 12px 36px rgba(1, 45, 237, 0.12);
}

.nav-btn {
  background: transparent;
  color: var(--main);
  border: none;
  padding: 11px 8px;
}

.nav-btn.active {
  background: var(--main);
  color: white;
}

.big-number {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 0;
}

.import-label {
  display: block;
  margin-top: 10px;
  background: transparent;
  color: var(--main);
}

.import-label input { display: none; }
.danger-zone { opacity: 0.8; }

@media (max-width: 420px) {
  .button-grid, .button-row { grid-template-columns: 1fr; }
  .rating-row { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 31px; }
  .hero-card h2 { font-size: 36px; }
}

.goal-hero .progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
  margin: 14px 0 12px;
}

.goal-hero .progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: white;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.goal-next {
  margin-bottom: 0;
  font-weight: 900;
}

.journey-list, .skill-list, #levelsList {
  display: grid;
  gap: 10px;
}

.journey-item, .skill-row, .level-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.journey-item:last-child, .skill-row:last-child, .level-row:last-child {
  border-bottom: none;
}

.journey-item span {
  font-weight: 900;
  line-height: 1.2;
}

.journey-item p, .skill-row p, .level-row p {
  margin: 3px 0 0;
  opacity: 0.72;
  line-height: 1.35;
}

.journey-item.current strong,
.skill-row strong,
.level-row strong {
  font-weight: 900;
}

.skill-row, .level-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.skill-row span, .level-row span {
  font-weight: 900;
  background: var(--soft);
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.stat-card {
  text-align: center;
}

.stat-card .big-number {
  font-size: 54px;
  line-height: 1;
  margin: 4px 0 4px;
}

.account-panel {
  margin-top: -8px;
}

.text-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  margin: 8px 0;
  color: var(--main);
  background: white;
  font: inherit;
  font-weight: 700;
}

.text-input::placeholder { color: rgba(1, 45, 237, 0.42); }

.account-actions { margin-top: 10px; }
.sync-status { font-weight: 900; }

.account-panel {
  margin-top: 16px;
}

.account-panel h2 {
  font-size: 28px;
}

.text-input {
  width: 100%;
  border: 1px solid var(--border);
  color: var(--main);
  background: white;
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 700;
  margin: 8px 0;
  outline: none;
}

.text-input::placeholder {
  color: rgba(1, 45, 237, 0.45);
}

.account-actions {
  margin-top: 8px;
}

.auth-locked {
  display: none !important;
}

.sync-status {
  font-weight: 900;
  opacity: 0.75;
}


.password-field {
  position: relative;
}

.password-field .text-input {
  padding-right: 74px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--main);
  border-color: var(--border);
}

.auth-message {
  min-height: 20px;
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
  opacity: 0.85;
}

.auth-message[data-type="error"] {
  color: #b00020;
}

.auth-message[data-type="success"] {
  color: var(--main);
}
