:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --bg-elev: #1C1E21;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --warn: #ffb74d;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

#app { width: 100%; height: 100%; position: relative; }

.screen {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.screen.hidden { display: none; }
.hidden { display: none !important; }

.focusable {
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  outline: none;
  background: var(--bg-elev);
  color: var(--text-primary);
  font-family: inherit;
}

.focusable:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
  background: var(--bg-tertiary);
  transform: scale(1.02);
}

/* ===================== HOME ===================== */
.app-header {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.flame {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #14141f, #1e1e2e);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,212,255,0.25);
}
.title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.home-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 20px;
}

.hero-card {
  background: linear-gradient(135deg, #14141f 0%, #1e1e2e 100%);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.hero-label {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
.hero-formula {
  margin-top: 6px;
  font-size: 16px;
  color: var(--text-secondary);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  text-align: left;
}
.menu-btn.primary {
  background: linear-gradient(135deg, #003845 0%, #1e1e2e 100%);
  border-color: rgba(0,212,255,0.3);
}
.menu-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
}
.menu-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.menu-title {
  font-size: 19px;
  font-weight: 600;
}
.menu-sub {
  font-size: 14px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint-bar {
  margin-top: 14px;
  padding: 8px 4px 0;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.key {
  background: var(--bg-secondary);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  color: var(--text-primary);
}

/* =================== SCREEN HEADERS =================== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}
.screen-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.step {
  font-size: 13px;
  color: var(--accent);
  background: rgba(0,212,255,0.08);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

/* =================== PROFILE =================== */
.profile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  min-height: 72px;
}
.row-label {
  font-size: 16px;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.seg-group {
  display: flex;
  gap: 8px;
}
.seg {
  min-height: 52px;
  min-width: 100px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--bg-elev);
  font-size: 16px;
  font-weight: 600;
}
.seg.active {
  background: var(--accent);
  color: #001a22;
  border-color: var(--accent);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}
.step-btn {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--bg-elev);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.step-value {
  min-width: 64px;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.step-unit {
  font-size: 14px;
  color: var(--text-muted);
  margin-right: 4px;
  min-width: 22px;
}

.nav-row {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  gap: 10px;
}
.nav-btn {
  flex: 1;
  min-height: 56px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  background: var(--bg-elev);
}
.nav-btn.primary {
  background: linear-gradient(135deg, #00a8cc 0%, #007799 100%);
  color: #ffffff;
}
.nav-btn.ghost {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

/* =================== ACTIVITY =================== */
.activity-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.act-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  text-align: left;
}
.act-mult {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-width: 56px;
}
.act-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.act-name {
  font-size: 17px;
  font-weight: 600;
}
.act-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* =================== RESULTS =================== */
.results-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-result {
  background: linear-gradient(135deg, #003845 0%, #1e1e2e 100%);
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  text-align: center;
}
.hero-num {
  font-size: 56px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hero-unit {
  margin-top: 4px;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
}
.hero-sub {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.hero-sub span {
  color: var(--text-primary);
  font-weight: 600;
}

.goal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.goal-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.05);
}
.goal-card.cut { border-color: rgba(255,68,102,0.25); }
.goal-card.maintain { border-color: rgba(0,212,255,0.25); }
.goal-card.bulk { border-color: rgba(0,255,136,0.25); }
.goal-label {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.goal-val {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cut .goal-val { color: var(--danger); }
.maintain .goal-val { color: var(--accent); }
.bulk .goal-val { color: var(--accent-secondary); }

.macros {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.macro-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 16px;
}
.macro-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.macro-dot.prot { background: #00d4ff; }
.macro-dot.carb { background: #ffb74d; }
.macro-dot.fat  { background: #ff4466; }
.macro-name { flex: 1; color: var(--text-secondary); }
.macro-grams {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
}
.macro-unit {
  color: var(--text-muted);
  font-size: 13px;
  min-width: 16px;
}

/* =================== ABOUT =================== */
.about-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.about-p {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.about-p b { color: var(--text-primary); }
.about-formula {
  background: var(--bg-elev);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: 8px;
  line-height: 1.7;
}
