:root {
  --bg: #080b12;
  --bg-2: #0d1119;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.08);
  --cyan: #22e6d2;
  --violet: #b28bff;
  --amber: #ffb454;
  --text: #e8ecf4;
  --text-dim: #8b93a7;
  --font-sans: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  overflow: hidden;
  overscroll-behavior: none;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Screens */
.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 110px;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: block; }

.screen-inner { max-width: 480px; margin: 0 auto; }

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 16px;
}
.brand {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-dim);
}
.streak-chip {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
  background: rgba(255, 180, 84, 0.1);
  border: 1px solid rgba(255, 180, 84, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Glass cards */
.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px;
  margin-bottom: 12px;
}
.neon-border { border-color: rgba(34, 230, 210, 0.35); box-shadow: 0 0 20px rgba(34, 230, 210, 0.08); }

/* Charge card */
.charge-card { border-color: rgba(178, 139, 255, 0.25); }
.charge-label, .motivation-label, .briefing-label, .council-label, .focus-label, .arena-label, .countdown-label, .checkin-label, .ladder-label, .section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.charge-mission {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}
.charge-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--violet), transparent);
  margin: 14px 0;
}
.charge-stoic { display: flex; flex-direction: column; gap: 6px; }
.stoic-source { font-family: var(--font-mono); font-size: 12px; color: var(--violet); }
.stoic-line { font-size: 15px; font-style: italic; color: var(--text); }
.stoic-app { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.charge-directive {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.5px;
}

/* Focus */
.focus-text { font-size: 18px; font-weight: 600; color: var(--amber); }

/* Motivation */
.motivation-text { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--text); }
.motivation-share {
  margin-top: 12px;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
  cursor: pointer;
  border: 1px solid rgba(34, 230, 210, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
}

/* Briefing */
.briefing-text { font-size: 14px; line-height: 1.6; color: var(--text-dim); }

/* Council */
.council-quote { font-size: 15px; font-style: italic; line-height: 1.5; color: var(--text); }
.council-source { margin-top: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--violet); }

/* Countdown */
.countdown-days {
  font-size: 48px;
  font-weight: 700;
  color: var(--cyan);
  font-family: var(--font-mono);
  line-height: 1;
}
.countdown-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* Metrics */
.metrics-row { display: flex; gap: 12px; }
.metric-card { flex: 1; text-align: center; }
.metric-value { font-size: 28px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.metric-unit { font-size: 12px; color: var(--text-dim); }

/* Section title */
.section-title {
  margin: 20px 0 10px;
  color: var(--text);
  font-size: 13px;
}

/* Workout log */
.log-list { display: flex; flex-direction: column; gap: 10px; }
.empty-state { color: var(--text-dim); font-size: 14px; text-align: center; padding: 20px 0; }
.log-item {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px;
}
.log-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.log-item-type { font-weight: 600; font-size: 15px; }
.log-item-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.log-item-detail { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* Arena */
.arena-prompt { font-size: 15px; line-height: 1.6; color: var(--text); }

/* Path list */
.path-list { display: flex; flex-direction: column; gap: 10px; }
.path-item {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.path-name { font-weight: 600; font-size: 15px; }
.path-level { font-family: var(--font-mono); font-size: 11px; color: var(--violet); }

/* Ladder */
.ladder-step {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
}
.ladder-step.done { color: var(--cyan); border-color: rgba(34, 230, 210, 0.3); }
.ladder-step.current { color: var(--amber); border-color: rgba(255, 180, 84, 0.3); font-weight: 600; }

/* Goal list */
.goal-list { display: flex; flex-direction: column; gap: 10px; }
.goal-item {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px;
}
.goal-name { font-weight: 600; font-size: 15px; }
.goal-progress { margin-top: 8px; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.goal-progress-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 3px; }

/* Pulse */
.mood-row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.mood-btn {
  flex: 1;
  font-size: 26px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 0;
  cursor: pointer;
  transition: all 0.15s;
}
.mood-btn.selected { border-color: var(--cyan); background: rgba(34, 230, 210, 0.1); transform: scale(1.05); }
.note-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  resize: none;
  min-height: 70px;
  margin-bottom: 14px;
}
.code-check { margin-bottom: 14px; }
.code-check-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 8px; }
.code-check-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; }
.toggle-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
}
.toggle-btn.on { border-color: var(--cyan); color: var(--cyan); background: rgba(34, 230, 210, 0.1); }
.primary-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  color: #080b12;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(8, 11, 18, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--panel-border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px 0;
}
.nav-btn.active { color: var(--cyan); }
.nav-icon { font-size: 20px; }
.nav-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.5px; }

/* FAB */
.fab {
  position: fixed;
  right: 18px;
  bottom: 90px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #080b12;
  font-size: 30px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(34, 230, 210, 0.3);
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-bottom: none;
}
.modal-title { font-family: var(--font-mono); font-size: 13px; letter-spacing: 2px; color: var(--text-dim); margin-bottom: 16px; }
.quicklog-options { display: flex; gap: 10px; margin-bottom: 16px; }
.quicklog-btn {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.quicklog-btn.active { border-color: var(--cyan); background: rgba(34, 230, 210, 0.1); }
.quicklog-form input, .quicklog-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  margin-bottom: 10px;
}
.close-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  margin-top: 6px;
}
