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

:root {
  --nebula-cyan: #7df9ff;
  --nebula-purple: #a855f7;
  --nebula-pink: #f0abfc;
  --deep-space: #03020a;
  --panel-bg: rgba(8,5,22,0.96);
  --border: rgba(168,85,247,0.25);
  --text-muted: rgba(255,255,255,0.45);
  --font-display: Georgia, 'Times New Roman', serif;
  --font-ui: system-ui, -apple-system, sans-serif;
}

html, body {
  width:100%; height:100%;
  height: 100dvh;
  background: var(--deep-space);
  color:#fff;
  font-family: var(--font-ui);
  overflow: hidden;
  /* iOS safe area */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  box-sizing: border-box;
}

/* ── LOGIN SCREEN ── */
#login-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(ellipse at 50% 60%, rgba(60,10,100,0.6) 0%, #03020a 70%);
  display: flex; align-items: center; justify-content: center;
}
#login-screen.hidden { display: none; }

#login-box {
  background: rgba(8,5,22,0.97);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 28px;
  padding: 44px 40px;
  width: 400px; max-width: 92vw;
  text-align: center;
  box-shadow: 0 0 60px rgba(168,85,247,0.15), 0 0 120px rgba(125,249,255,0.06);
  animation: loginFadeIn 0.5s ease-out;
}
@keyframes loginFadeIn {
  from { opacity:0; transform:translateY(20px) scale(0.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}

.login-nebula {
  width: 72px; height: 72px; border-radius: 50%;
  margin: 0 auto 20px;
  background: radial-gradient(circle at 40% 38%,
    rgba(255,255,255,0.9) 0%,
    rgba(125,249,255,0.7) 25%,
    rgba(168,85,247,0.5) 55%,
    transparent 100%);
  box-shadow: 0 0 30px 10px rgba(125,249,255,0.25), 0 0 60px 20px rgba(168,85,247,0.15);
  filter: blur(3px);
  animation: nebulaFloat 4s ease-in-out infinite;
}

.auth-error {
  color: #f87171;
  font-size: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 10px;
  display: none;
}

/* ── UNIVERSE SCROLL ── */
#universe-scroll {
  width:100vw; height:100dvh;
  overflow-x:auto; overflow-y:hidden;
  cursor:grab; user-select:none;
}
#universe-scroll:active { cursor:grabbing; }
#universe-scroll::-webkit-scrollbar { display:none; }

#universe-canvas {
  width:5000px; height:100dvh;
  position:relative;
}

#starfield { position:absolute; inset:0; width:100%; height:100%; }
#connections { position:absolute; inset:0; pointer-events:none; z-index:3; }

/* ── NEBULA ── */
#nebula {
  position:absolute;
  left:50px; top:50%;
  transform:translateY(-50%);
  width:200px; height:200px;
  border-radius:50%;
  background: radial-gradient(circle at 40% 38%,
    rgba(255,255,255,0.9) 0%,
    rgba(180,240,255,0.75) 8%,
    rgba(125,249,255,0.55) 22%,
    rgba(168,85,247,0.4) 45%,
    rgba(59,7,100,0.2) 68%,
    transparent 100%);
  box-shadow:
    0 0 60px 30px rgba(125,249,255,0.28),
    0 0 130px 70px rgba(168,85,247,0.18),
    0 0 260px 120px rgba(125,249,255,0.08);
  filter:blur(8px) contrast(1.1);
  animation:nebulaFloat 4s ease-in-out infinite;
  z-index:10;
}
#nebula::before {
  content:''; position:absolute;
  top:28%; left:28%; width:44%; height:44%;
  border-radius:50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(180,240,255,0.4) 60%, transparent 100%);
  filter:blur(10px);
}
#nebula::after {
  content:''; position:absolute;
  inset:-30%; border-radius:50%;
  background: radial-gradient(circle,
    transparent 35%,
    rgba(168,85,247,0.06) 55%,
    rgba(125,249,255,0.04) 70%,
    transparent 100%);
  filter:blur(18px);
}
@keyframes nebulaFloat {
  0%,100% { transform:translateY(-50%) scale(1); }
  50% { transform:translateY(calc(-50% - 14px)) scale(1.04); }
}

/* ── NEBULA SATELLITE STAR ── */
.nebula-satellite {
  position: absolute;
  left: 50px;
  top: 50%;
  width: 200px;
  height: 200px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 11;
  animation: nebulaFloat 4s ease-in-out infinite;
}
.nebula-orbit-star {
  position: absolute;
  top: 50%; left: 50%;
  transform-origin: 0 0;
  animation: orbitStar 7s linear infinite;
  filter: drop-shadow(0 0 6px rgba(125,249,255,0.9));
}
@keyframes orbitStar {
  0%   { transform: rotate(0deg)   translateX(118px) translateY(-4px); opacity: 1; }
  25%  { transform: rotate(90deg)  translateX(118px) translateY(-4px); opacity: 0.7; }
  50%  { transform: rotate(180deg) translateX(118px) translateY(-4px); opacity: 0.3; }
  75%  { transform: rotate(270deg) translateX(118px) translateY(-4px); opacity: 0.7; }
  100% { transform: rotate(360deg) translateX(118px) translateY(-4px); opacity: 1; }
}

/* ── GOAL STARS ── */
.goal-star {
  position:absolute; border-radius:50%;
  cursor:pointer;
  transition:transform 0.3s ease, box-shadow 0.3s ease;
  animation:floatStar var(--fdur,3s) ease-in-out infinite;
  animation-delay:var(--fdelay,0s);
  z-index:5;
}
.goal-star:hover { animation-play-state:paused; filter:brightness(1.4) !important; z-index:20; transform:scale(1.2); }
@keyframes floatStar {
  0%   { transform:translateY(0px) translateX(0px) scale(1); }
  25%  { transform:translateY(-14px) translateX(4px) scale(1.04); }
  50%  { transform:translateY(-8px) translateX(-5px) scale(1.02); }
  75%  { transform:translateY(-18px) translateX(3px) scale(1.05); }
  100% { transform:translateY(0px) translateX(0px) scale(1); }
}

/* ── STAR TOOLTIP ── */
.star-tooltip {
  position:absolute; bottom:calc(100% + 14px); left:50%;
  transform:translateX(-50%);
  background:rgba(8,5,22,0.95);
  border:1px solid rgba(168,85,247,0.4);
  border-radius:12px; padding:10px 16px;
  font-size:12px; white-space:nowrap;
  pointer-events:none; opacity:0;
  transition:opacity 0.2s; z-index:100;
}
.goal-star:hover .star-tooltip { opacity:0; }
.star-tooltip .tt-title { font-size:13px; font-weight:600; margin-bottom:4px; font-family:var(--font-display); }
.star-tooltip .tt-progress { color:var(--text-muted); font-size:11px; letter-spacing:0.5px; }
.star-tooltip .tt-hint { color:var(--nebula-cyan); font-size:10px; margin-top:4px; letter-spacing:0.5px; }

/* ── BOTTOM NAV ── */
#bottom-nav {
  position:fixed; bottom:24px; left:50%;
  transform:translateX(-50%);
  background:rgba(8,5,22,0.9);
  border:1px solid var(--border);
  border-radius:60px;
  padding:12px 28px;
  display:flex; gap:28px; align-items:center;
  z-index:50; backdrop-filter:blur(16px);
}
.nav-btn {
  background:none; border:none;
  color:var(--text-muted);
  font-size:10px; letter-spacing:1.5px;
  text-transform:uppercase; cursor:pointer;
  display:flex; flex-direction:column;
  align-items:center; gap:5px;
  transition:color 0.2s; font-family:var(--font-ui);
}
.nav-btn .nb-icon { font-size:18px; }
.nav-btn:hover, .nav-btn.active { color:var(--nebula-purple); }

#add-btn {
  width:52px; height:52px; border-radius:50%;
  background:linear-gradient(135deg, #7c3aed, #2563eb);
  border:none; cursor:pointer;
  font-size:26px; font-weight:300;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 0 24px rgba(124,58,237,0.55);
  transition:transform 0.2s, box-shadow 0.2s; color:#fff;
}
#add-btn:hover { transform:scale(1.1); box-shadow:0 0 36px rgba(124,58,237,0.75); }

/* ── PANELS (shared) ── */
.panel-overlay {
  position:fixed; inset:0;
  background:rgba(0,0,0,0.7);
  backdrop-filter:blur(8px);
  z-index:200; display:flex;
  align-items:center; justify-content:center;
  opacity:0; pointer-events:none;
  transition:opacity 0.3s;
}
.panel-overlay.open { opacity:1; pointer-events:all; }

.panel {
  background:var(--panel-bg);
  border:1px solid var(--border);
  border-radius:24px;
  padding:36px 32px;
  width:480px; max-width:92vw;
  max-height:88vh; overflow-y:auto;
  transform:scale(0.95); transition:transform 0.3s;
}
.panel-overlay.open .panel { transform:scale(1); }

.panel h2 {
  font-size:20px; margin-bottom:6px;
  background:linear-gradient(90deg, var(--nebula-cyan), var(--nebula-purple));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  font-family:var(--font-display);
}
.panel p.sub {
  color:var(--text-muted); font-size:13px;
  margin-bottom:20px; line-height:1.65;
}

textarea.field, input.field {
  width:100%;
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(168,85,247,0.3);
  border-radius:12px; padding:14px;
  color:#fff; font-size:14px;
  font-family:var(--font-ui); resize:none;
  line-height:1.6; outline:none;
  transition:border-color 0.2s;
  margin-bottom:12px;
}
textarea.field:focus, input.field:focus { border-color:rgba(168,85,247,0.7); }
textarea.field::placeholder, input.field::placeholder { color:rgba(255,255,255,0.2); }

.row { display:flex; gap:10px; margin-bottom:12px; }

.btn-primary {
  flex:2; padding:13px;
  background:linear-gradient(135deg, #7c3aed, #2563eb);
  border:none; border-radius:12px;
  color:#fff; font-size:14px; font-weight:500;
  cursor:pointer; transition:opacity 0.2s, transform 0.15s;
  font-family:var(--font-ui);
}
.btn-primary:hover:not(:disabled) { opacity:0.88; transform:scale(1.02); }
.btn-primary:disabled { opacity:0.35; cursor:not-allowed; }

.btn-ghost {
  flex:1; padding:13px;
  background:transparent;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px; color:var(--text-muted);
  font-size:14px; cursor:pointer;
  transition:border-color 0.2s, color 0.2s;
  font-family:var(--font-ui);
}
.btn-ghost:hover { border-color:rgba(255,255,255,0.3); color:#fff; }

.label-pill {
  display:inline-block; padding:3px 10px;
  background:rgba(168,85,247,0.15);
  border:1px solid rgba(168,85,247,0.3);
  border-radius:20px; font-size:11px;
  color:var(--nebula-purple); letter-spacing:0.5px;
  text-transform:uppercase; margin-bottom:10px;
}

/* ── CREATE GOAL MODAL ── */
#modal-thinking {
  display:none; flex-direction:column;
  align-items:center; padding:16px 0; gap:18px;
}
.thinking-orb {
  width:60px; height:60px; border-radius:50%;
  background:radial-gradient(circle, var(--nebula-cyan), var(--nebula-purple), #1e1b4b);
  animation:orbPulse 1.4s ease-in-out infinite;
}
@keyframes orbPulse {
  0%,100%{transform:scale(1);opacity:0.8;}
  50%{transform:scale(1.18);opacity:1;}
}
#modal-thinking p { color:var(--text-muted); font-size:13px; text-align:center; }

#modal-reveal {
  display:none; flex-direction:column;
  align-items:center; gap:14px;
  padding:8px 0; text-align:center;
}
#reveal-star {
  border-radius:50%;
  animation:breathe 2.5s ease-in-out infinite;
}
@keyframes breathe {
  0%,100%{transform:scale(1);} 50%{transform:scale(1.08);}
}
#reveal-title { font-family:var(--font-display); }
#reveal-desc { color:var(--text-muted); font-size:13px; line-height:1.6; }

.affirmation-box {
  background:rgba(125,249,255,0.06);
  border:1px solid rgba(125,249,255,0.2);
  border-radius:12px; padding:14px;
  font-size:14px; line-height:1.7;
  color:rgba(255,255,255,0.85);
  font-style:italic;
  font-family:var(--font-display);
  margin-bottom:12px; min-height:52px;
}
.affirmation-box.loading { color:var(--text-muted); font-style:normal; font-size:12px; }

/* ── DURATION PICKER ── */
.duration-row {
  display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap;
}
.dur-btn {
  flex:1; min-width:70px; padding:9px 4px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:10px; color:var(--text-muted);
  font-size:12px; cursor:pointer; text-align:center;
  transition:all 0.2s; font-family:var(--font-ui);
}
.dur-btn:hover { border-color:rgba(168,85,247,0.4); color:#fff; }
.dur-btn.selected {
  border-color:var(--nebula-purple);
  background:rgba(168,85,247,0.18);
  color:var(--nebula-purple);
}

/* ── PROGRESS SCREEN ── */
#progress-screen {
  position:fixed; inset:0; z-index:300;
  background:rgba(3,2,10,0.97);
  backdrop-filter:blur(20px);
  display:none; flex-direction:column;
  overflow-y:auto;
}
#progress-screen.open { display:flex; }

.ps-header {
  padding:24px 28px 0;
  display:flex; align-items:center; gap:16px;
  border-bottom:1px solid var(--border);
  padding-bottom:20px;
}
.ps-back {
  width:38px; height:38px; border-radius:50%;
  background:rgba(255,255,255,0.07);
  border:1px solid rgba(255,255,255,0.12);
  color:rgba(255,255,255,0.6); font-size:16px;
  cursor:pointer; display:flex; align-items:center;
  justify-content:center; flex-shrink:0;
  transition:background 0.2s;
}
.ps-back:hover { background:rgba(255,255,255,0.13); }

.ps-star-icon {
  width:42px; height:42px; border-radius:50%;
  flex-shrink:0;
}
.ps-title { flex:1; }
.ps-title h3 { font-size:18px; font-family:var(--font-display); line-height:1.3; }
.ps-title .ps-affirmation { font-size:12px; color:var(--nebula-cyan); font-style:italic; margin-top:2px; line-height:1.5; }

.ps-body { padding:24px 28px; flex:1; }

.prog-bar-wrap {
  background:rgba(255,255,255,0.07);
  border-radius:20px; height:8px;
  margin-bottom:6px; overflow:hidden;
}
.prog-bar-fill {
  height:100%; border-radius:20px;
  background:linear-gradient(90deg, var(--nebula-cyan), var(--nebula-purple));
  transition:width 0.6s ease;
}
.prog-label {
  display:flex; justify-content:space-between;
  font-size:11px; color:var(--text-muted);
  margin-bottom:24px; letter-spacing:0.5px;
}

.log-section {
  background:rgba(255,255,255,0.03);
  border:1px solid var(--border);
  border-radius:16px; padding:18px;
  margin-bottom:24px;
}
/* tabs removed h4 */
.log-section textarea {
  width:100%; background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:10px; padding:12px;
  color:#fff; font-size:14px;
  font-family:var(--font-ui); resize:none;
  line-height:1.6; outline:none;
  transition:border-color 0.2s;
  margin-bottom:10px;
}
.log-section textarea:focus { border-color:rgba(168,85,247,0.5); }
.log-section textarea::placeholder { color:rgba(255,255,255,0.2); }

.log-pct-row {
  display:flex; align-items:center; justify-content:space-between;
  margin:10px 0; gap:12px;
}
.log-pct-label { font-size:12px; color:rgba(255,255,255,0.45); flex:1; }
.log-pct-input-wrap { display:flex; align-items:center; gap:4px; }
.log-pct-input {
  width:72px; padding:8px 10px; border-radius:10px;
  background:rgba(255,255,255,0.06); border:1px solid rgba(125,249,255,0.2);
  color:#fff; font-size:15px; font-weight:600; text-align:center;
  outline:none; -moz-appearance:textfield;
}
.log-pct-input::-webkit-inner-spin-button,
.log-pct-input::-webkit-outer-spin-button { -webkit-appearance:none; }
.log-pct-input:focus { border-color:rgba(125,249,255,0.5); }
.log-pct-input::placeholder { color:rgba(255,255,255,0.2); font-size:13px; font-weight:400; }
.log-pct-symbol { font-size:15px; font-weight:600; color:var(--nebula-cyan); }

.tl-pct-badge {
  display:inline-block; background:rgba(125,249,255,0.12);
  border:1px solid rgba(125,249,255,0.3); border-radius:20px;
  padding:1px 8px; font-size:11px; color:var(--nebula-cyan);
  vertical-align:middle; margin-left:6px;
}
.tl-prog-bar {
  margin-top:6px; height:4px; border-radius:4px;
  background:rgba(255,255,255,0.07); overflow:hidden;
}
.tl-prog-fill {
  height:100%; border-radius:4px;
  background:linear-gradient(90deg,var(--nebula-cyan),var(--nebula-purple));
  transition:width 0.5s ease;
}

.ai-reflection {
  background:rgba(168,85,247,0.07);
  border:1px solid rgba(168,85,247,0.2);
  border-radius:12px; padding:14px;
  font-size:13px; line-height:1.7;
  color:rgba(255,255,255,0.8);
  margin-top:12px; display:none;
}
.ai-reflection .ai-badge {
  font-size:10px; letter-spacing:1px;
  text-transform:uppercase; color:var(--nebula-purple);
  margin-bottom:6px;
}

.milestones-section { margin-bottom:28px; }
.milestones-section h4 {
  font-size:13px; letter-spacing:1px;
  text-transform:uppercase; color:var(--text-muted);
  margin-bottom:16px;
}

.milestone-item {
  display:flex; gap:12px; align-items:flex-start;
  margin-bottom:0;
}
.ms-line {
  display:flex; flex-direction:column;
  align-items:center; flex-shrink:0;
}
.ms-dot {
  width:20px; height:20px; border-radius:50%;
  display:flex; align-items:center;
  justify-content:center; font-size:11px;
  flex-shrink:0;
}
.ms-dot.done { background:rgba(125,249,255,0.2); border:1.5px solid var(--nebula-cyan); color:var(--nebula-cyan); }
.ms-dot.pending { background:rgba(255,255,255,0.05); border:1.5px solid rgba(255,255,255,0.2); color:rgba(255,255,255,0.3); }
.ms-dot.active { background:rgba(168,85,247,0.2); border:1.5px solid var(--nebula-purple); color:var(--nebula-purple); box-shadow:0 0 10px rgba(168,85,247,0.3); }
.ms-connector { width:1.5px; height:28px; background:linear-gradient(to bottom, rgba(168,85,247,0.3), rgba(255,255,255,0.08)); margin:2px 0; }
.ms-content { flex:1; padding-bottom:20px; }
.ms-content .ms-label { font-size:13px; font-weight:500; margin-bottom:3px; }
.ms-content .ms-desc { font-size:12px; color:var(--text-muted); line-height:1.5; }
.ms-content .ms-date { font-size:11px; color:rgba(125,249,255,0.5); margin-top:2px; letter-spacing:0.3px; }

.btn-log-milestone {
  width:100%; padding:11px;
  background:rgba(125,249,255,0.08);
  border:1px dashed rgba(125,249,255,0.3);
  border-radius:10px; color:var(--nebula-cyan);
  font-size:13px; cursor:pointer;
  transition:background 0.2s, border-color 0.2s;
  font-family:var(--font-ui);
}
.btn-log-milestone:hover { background:rgba(125,249,255,0.14); border-color:rgba(125,249,255,0.5); }

.ai-plan-section {
  background:rgba(255,255,255,0.02);
  border:1px solid var(--border);
  border-radius:16px; padding:18px;
  margin-bottom:24px;
}
.ai-plan-section h4 {
  font-size:13px; letter-spacing:1px;
  text-transform:uppercase; color:var(--text-muted);
  margin-bottom:4px;
}
.ai-plan-section p { font-size:12px; color:var(--text-muted); margin-bottom:14px; }
.ai-plan-output {
  font-size:13px; line-height:1.8;
  color:rgba(255,255,255,0.8);
  white-space:pre-wrap; display:none;
}

/* ── LAUNCH PAD ── */
#launchpad {
  position:fixed; inset:0; z-index:400;
  background:#000;
  display:none; flex-direction:column;
  align-items:center; justify-content:flex-end;
  overflow:hidden;
}
#launchpad.open { display:flex; }

#lp-bg { position:absolute; inset:0; width:100%; height:100%; }

#lp-title {
  position:absolute; top:44px; left:0; right:0;
  text-align:center; pointer-events:none;
}
#lp-title .lp-label {
  font-size:10px; letter-spacing:3px;
  color:rgba(255,255,255,0.35);
  text-transform:uppercase; margin-bottom:8px;
}
#lp-goal-name { font-size:20px; color:#fff; font-family:var(--font-display); }
#lp-affirmation { font-size:12px; color:var(--nebula-cyan); font-style:italic; margin-top:4px; }

#draw-canvas {
  position:absolute; top:120px;
  left:50%; transform:translateX(-50%);
  border-radius:12px; cursor:crosshair;
  touch-action:none; z-index:2;
  background:rgba(255,255,255,0.04);
  border:1px dashed rgba(255,255,255,0.12);
  box-shadow: inset 0 0 40px rgba(168,85,247,0.06);
}

#draw-toolbar {
  position:absolute; top:140px; right:20px;
  display:flex; flex-direction:column;
  gap:8px; align-items:center; z-index:10;
}
.tool-btn {
  width:36px; height:36px; border-radius:9px;
  background:rgba(255,255,255,0.07);
  border:1px solid rgba(255,255,255,0.12);
  color:#fff; font-size:14px;
  cursor:pointer; display:flex;
  align-items:center; justify-content:center;
  transition:background 0.15s, border-color 0.15s;
}
.tool-btn:hover { background:rgba(255,255,255,0.14); }
.tool-btn.active-tool { background:rgba(168,85,247,0.4) !important; border-color:rgba(168,85,247,0.8) !important; }
.tool-divider { width:1px; height:14px; background:rgba(255,255,255,0.1); }

#launch-zone {
  position:absolute; bottom:0; left:0; right:0;
  height:170px;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:10px;
  background:linear-gradient(transparent, rgba(0,0,0,0.88));
  z-index:10;
}
#launch-hint { font-size:10px; letter-spacing:2px; color:rgba(255,255,255,0.3); text-transform:uppercase; }
#launch-star-btn {
  width:72px; height:72px; border-radius:50%;
  background:radial-gradient(circle at 35% 32%, #fff 0%, #b8f0ff 20%, #7df9ff 45%, #a855f7 75%, #1e0040 100%);
  box-shadow:0 0 24px 8px rgba(125,249,255,0.4), 0 0 60px 20px rgba(168,85,247,0.25);
  cursor:pointer; position:relative;
  transition:transform 0.1s; user-select:none;
}
#charge-ring { position:absolute; inset:-10px; width:calc(100% + 20px); height:calc(100% + 20px); }
#charge-pct {
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:700; color:#fff;
  opacity:0; transition:opacity 0.3s;
  text-shadow:0 0 6px rgba(0,0,0,0.8);
}
#charge-label { font-size:10px; letter-spacing:2px; color:rgba(125,249,255,0); text-transform:uppercase; transition:color 0.3s; }

#lp-back {
  position:absolute; top:18px; left:18px;
  background:rgba(255,255,255,0.07);
  border:1px solid rgba(255,255,255,0.13);
  border-radius:50%; width:38px; height:38px;
  color:rgba(255,255,255,0.6); font-size:17px;
  cursor:pointer; display:flex;
  align-items:center; justify-content:center;
  z-index:20; transition:background 0.2s;
}
#lp-back:hover { background:rgba(255,255,255,0.13); }

#rocket-canvas { position:absolute; inset:0; pointer-events:none; z-index:15; }

/* ── GOALS SCREEN ── */
#goals-screen {
  position:fixed; inset:0; z-index:300;
  background:radial-gradient(ellipse at 20% 50%,rgba(60,10,100,0.55) 0%,rgba(3,2,10,0.98) 60%);
  backdrop-filter:blur(20px);
  display:none; flex-direction:column; overflow:hidden;
}

/* ── MISC ── */
#scroll-hint {
  position:fixed; bottom:96px; right:28px;
  font-size:10px; letter-spacing:1.5px;
  text-transform:uppercase; color:var(--text-muted);
  display:flex; align-items:center; gap:6px;
  animation:fadeHint 5s ease forwards;
}
@keyframes fadeHint { 0%,60%{opacity:1;} 100%{opacity:0;} }

#toast {
  position:fixed; bottom:100px; left:50%;
  transform:translateX(-50%) translateY(20px);
  background:rgba(8,5,22,0.95);
  border:1px solid var(--border);
  border-radius:12px; padding:12px 20px;
  font-size:13px; color:#fff;
  opacity:0; transition:all 0.4s;
  z-index:1200; pointer-events:none;
  backdrop-filter:blur(12px);
}
#toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

.spin {
  display:inline-block; width:14px; height:14px;
  border:2px solid rgba(255,255,255,0.2);
  border-top-color:#fff; border-radius:50%;
  animation:spin 0.7s linear infinite;
  vertical-align:middle; margin-right:6px;
}
@keyframes spin { to { transform:rotate(360deg); } }

@keyframes cardFloat {
  0%,100% { transform:translateY(0); }
  50% { transform:translateY(-7px); }
}

/* ── SETTINGS SCREEN ── */
#settings-screen { z-index:1100; }
#settings-screen .panel { padding:28px; }

/* ── NOVA CHAT ── */
#nova-screen {
  position:fixed; inset:0;
  background:radial-gradient(ellipse at 50% 0%, rgba(40,8,80,0.7) 0%, #03020a 70%);
  display:flex; flex-direction:column;
  z-index:300; padding-bottom:90px;
  transform:translateY(100%); opacity:0; pointer-events:none;
  transition:transform 0.35s cubic-bezier(0.32,0.72,0,1), opacity 0.35s;
}
#nova-screen.open {
  transform:translateY(0); opacity:1; pointer-events:all;
}
#nova-chat-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:20px 20px 14px; border-bottom:1px solid rgba(255,255,255,0.07);
  flex-shrink:0;
}
.nova-orb {
  width:44px; height:44px; border-radius:50%;
  background:radial-gradient(circle at 35% 35%, #7df9ff, #a855f7);
  box-shadow:0 0 20px rgba(125,249,255,0.6), 0 0 40px rgba(168,85,247,0.3);
  animation:orbPulse 3s ease-in-out infinite;
  flex-shrink:0;
}
.nova-nav-orb {
  width:18px; height:18px; border-radius:50%; display:inline-block;
  background:radial-gradient(circle at 35% 35%, #7df9ff, #a855f7);
  box-shadow:0 0 8px rgba(125,249,255,0.6);
  animation:orbPulse 3s ease-in-out infinite;
  vertical-align:middle;
}
#nova-messages {
  flex:1; overflow-y:auto; padding:14px 14px 8px;
  display:flex; flex-direction:column; gap:10px;
  scrollbar-width:thin; scrollbar-color:rgba(125,249,255,0.15) transparent;
}
.nova-msg {
  max-width:82%; padding:10px 13px; border-radius:16px;
  font-size:13px; line-height:1.55; word-break:break-word;
}
.nova-msg.nova {
  background:rgba(125,249,255,0.08);
  border:1px solid rgba(125,249,255,0.15);
  color:rgba(255,255,255,0.88); align-self:flex-start;
  border-bottom-left-radius:4px;
}
.nova-msg.user {
  background:rgba(168,85,247,0.18);
  border:1px solid rgba(168,85,247,0.25);
  color:#fff; align-self:flex-end;
  border-bottom-right-radius:4px;
}
.nova-typing span {
  display:inline-block; width:6px; height:6px;
  background:rgba(125,249,255,0.6); border-radius:50%;
  margin:0 2px; animation:novaTyping 1.2s infinite;
}
.nova-typing span:nth-child(2) { animation-delay:0.2s; }
.nova-typing span:nth-child(3) { animation-delay:0.4s; }
@keyframes novaTyping {
  0%,60%,100% { transform:translateY(0); opacity:0.4; }
  30% { transform:translateY(-5px); opacity:1; }
}
#nova-input-row {
  display:flex; align-items:flex-end; gap:8px;
  padding:10px 12px; border-top:1px solid rgba(255,255,255,0.07);
  flex-shrink:0;
}
#nova-input {
  flex:1; background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.1); border-radius:12px;
  color:#fff; font-size:13px; padding:9px 12px;
  resize:none; outline:none; font-family:inherit; line-height:1.5;
  max-height:80px; overflow-y:auto;
}
#nova-input:focus { border-color:rgba(125,249,255,0.35); }
#nova-input::placeholder { color:rgba(255,255,255,0.2); }
#nova-send {
  width:36px; height:36px; border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg,#7df9ff,#a855f7);
  border:none; color:#000; font-size:16px; font-weight:700;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:transform 0.15s, opacity 0.15s;
}
#nova-send:hover { transform:scale(1.08); }

/* ── NOVA FAB ── */
#nova-fab {
  position:fixed; bottom:90px; right:20px;
  width:52px; height:52px; border-radius:50%;
  background:rgba(8,4,20,0.9);
  border:1.5px solid rgba(125,249,255,0.35);
  cursor:pointer; z-index:1040;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 0 20px rgba(125,249,255,0.2);
  transition:transform 0.2s, box-shadow 0.2s;
}
#nova-fab:hover { transform:scale(1.1); box-shadow:0 0 30px rgba(125,249,255,0.35); }
.nova-orb-sm {
  width:28px; height:28px; border-radius:50%;
  background:radial-gradient(circle at 35% 35%, #7df9ff, #a855f7);
  box-shadow:0 0 12px rgba(125,249,255,0.6);
  animation:orbPulse 3s ease-in-out infinite;
}

/* ── NOVA SPEECH BUBBLE ── */
#nova-bubble {
  position:fixed; bottom:154px; right:16px;
  max-width:220px; padding:10px 14px;
  background:rgba(8,4,20,0.95);
  border:1px solid rgba(125,249,255,0.25);
  border-radius:14px 14px 4px 14px;
  font-size:13px; color:rgba(255,255,255,0.88);
  line-height:1.5; cursor:pointer;
  z-index:1039;
  opacity:0; transform:translateY(8px);
  transition:opacity 0.4s ease, transform 0.4s ease;
  box-shadow:0 4px 20px rgba(125,249,255,0.1);
}
#nova-bubble::after {
  content:'';
  position:absolute; bottom:-8px; right:18px;
  border:4px solid transparent;
  border-top-color:rgba(125,249,255,0.25);
}

/* ── PROGRESS SCREEN TABS ── */
.ps-tabs {
  display:flex; gap:10px; margin:20px 0 16px;
}
.ps-tab {
  flex:1; padding:11px 10px;
  border-radius:12px; font-size:13px; font-weight:500;
  border:1px solid rgba(255,255,255,0.1);
  background:rgba(255,255,255,0.04);
  color:rgba(255,255,255,0.45);
  cursor:pointer; transition:all 0.2s; letter-spacing:0.3px;
}
.ps-tab.active {
  background:rgba(125,249,255,0.1);
  border-color:rgba(125,249,255,0.35);
  color:var(--nebula-cyan);
}
.ps-tab:hover:not(.active) {
  background:rgba(255,255,255,0.07);
  color:rgba(255,255,255,0.7);
}

/* ── GOAL CREATION — TERM TOGGLE ── */
.term-toggle {
  display:flex; gap:10px; margin-top:6px;
}
.term-btn {
  flex:1; padding:12px 10px; border-radius:14px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.1);
  color:rgba(255,255,255,0.45); cursor:pointer;
  display:flex; flex-direction:column; align-items:center; gap:4px;
  font-size:13px; font-weight:600; transition:all 0.2s;
}
.term-btn span { font-size:10px; font-weight:400; color:rgba(255,255,255,0.3); }
.term-btn.selected {
  background:rgba(125,249,255,0.08);
  border-color:rgba(125,249,255,0.4);
  color:var(--nebula-cyan);
}
.term-btn.selected span { color:rgba(125,249,255,0.5); }

/* ── PROGRESS — MOOD ROW ── */
.mood-row { margin-bottom:12px; }
.mood-label { font-size:11px; color:rgba(255,255,255,0.35); letter-spacing:0.5px; display:block; margin-bottom:8px; }
.mood-btns { display:flex; flex-wrap:wrap; gap:6px; }
.mood-btn {
  padding:5px 11px; border-radius:20px; font-size:11px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.1);
  color:rgba(255,255,255,0.45); cursor:pointer;
  transition:all 0.15s;
}
.mood-btn.selected {
  background:rgba(168,85,247,0.15);
  border-color:rgba(168,85,247,0.4);
  color:var(--nebula-purple);
}

/* ── PROGRESS — NOTES SPLIT ── */
.notes-split {
  display:flex; gap:12px; margin:16px 0;
}
.notes-col {
  flex:1; background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.07);
  border-radius:14px; padding:12px;
  min-height:80px;
}
.notes-col-label {
  font-size:10px; letter-spacing:1px; text-transform:uppercase;
  color:rgba(255,255,255,0.3); margin-bottom:10px;
}
.note-entry {
  font-size:12px; color:rgba(255,255,255,0.65);
  line-height:1.55; padding:6px 0;
  border-bottom:1px solid rgba(255,255,255,0.05);
}
.note-entry:last-child { border-bottom:none; }
.note-entry .note-mood {
  font-size:10px; color:rgba(168,85,247,0.7);
  margin-bottom:2px;
}
.note-entry .note-date {
  font-size:10px; color:rgba(255,255,255,0.2); margin-top:2px;
}
.notes-empty {
  font-size:12px; color:rgba(255,255,255,0.2);
  font-style:italic; text-align:center; padding:12px 0;
}

/* ── PROGRESS SCREEN REDESIGN ── */
.ps-section {
  margin-bottom:16px;
}
.ps-section-label {
  font-size:11px; letter-spacing:1.5px; text-transform:uppercase;
  color:rgba(255,255,255,0.3); margin-bottom:8px;
}
.ps-textarea {
  width:100%; background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.1); border-radius:12px;
  color:#fff; font-size:14px; padding:12px 14px;
  font-family:inherit; resize:none; outline:none; line-height:1.6;
}
.ps-textarea:focus { border-color:rgba(125,249,255,0.3); }
.ps-textarea::placeholder { color:rgba(255,255,255,0.2); }

/* Collapsible drop sections */
.ps-drop-btn {
  width:100%; display:flex; align-items:center; justify-content:space-between;
  background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.1);
  border-radius:14px; padding:13px 16px; cursor:pointer;
  color:rgba(255,255,255,0.75); font-size:14px; font-weight:500;
  transition:all 0.2s;
}
.ps-drop-btn:hover { background:rgba(255,255,255,0.07); border-color:rgba(125,249,255,0.2); }
.ps-drop-btn.open { border-color:rgba(125,249,255,0.3); color:#fff; border-radius:14px 14px 0 0; }
.ps-drop-arrow { font-size:12px; color:rgba(255,255,255,0.3); transition:transform 0.2s; }
.ps-drop-btn.open .ps-drop-arrow { transform:rotate(180deg); }

.ps-drop-panel {
  border:1px solid rgba(125,249,255,0.15); border-top:none;
  border-radius:0 0 14px 14px;
  background:rgba(8,4,20,0.6); padding:14px;
}

/* Split panels */
.split-panel {
  display:flex; gap:12px;
}
.split-col {
  flex:1; display:flex; flex-direction:column; gap:8px; min-width:0;
}
.split-col-label {
  font-size:10px; letter-spacing:1px; text-transform:uppercase;
  color:rgba(255,255,255,0.25); padding-bottom:6px;
  border-bottom:1px solid rgba(255,255,255,0.06);
}

/* Nova Planning chat */
.split-chat { min-height:200px; }
.plan-messages {
  flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:8px;
  min-height:120px; max-height:220px;
  scrollbar-width:thin; scrollbar-color:rgba(125,249,255,0.1) transparent;
}
.plan-msg {
  font-size:12px; line-height:1.5; padding:8px 10px; border-radius:12px;
  word-break:break-word;
}
.plan-msg.nova {
  background:rgba(125,249,255,0.07); border:1px solid rgba(125,249,255,0.12);
  color:rgba(255,255,255,0.85); align-self:flex-start; border-bottom-left-radius:3px;
}
.plan-msg.user {
  background:rgba(168,85,247,0.14); border:1px solid rgba(168,85,247,0.2);
  color:#fff; align-self:flex-end; border-bottom-right-radius:3px;
}
.plan-input-row {
  display:flex; gap:6px; align-items:flex-end; margin-top:6px;
}
.plan-input-row textarea {
  flex:1; background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.1); border-radius:10px;
  color:#fff; font-size:12px; padding:8px 10px;
  resize:none; outline:none; font-family:inherit; line-height:1.5;
}
.plan-input-row textarea:focus { border-color:rgba(125,249,255,0.3); }
.plan-input-row textarea::placeholder { color:rgba(255,255,255,0.2); }
.plan-send-btn {
  width:32px; height:32px; border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg,#7df9ff,#a855f7);
  border:none; color:#000; font-size:14px; font-weight:700;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
}

/* Plan bullets */
.split-bullets { overflow-y:auto; max-height:280px; }
.plan-bullet {
  display:flex; align-items:flex-start; gap:8px;
  padding:7px 0; border-bottom:1px solid rgba(255,255,255,0.05);
  font-size:12px; color:rgba(255,255,255,0.75); line-height:1.5;
}
.plan-bullet:last-child { border-bottom:none; }
.plan-bullet input[type=checkbox] { margin-top:2px; flex-shrink:0; accent-color:var(--nebula-cyan); }
.plan-bullet.done span { text-decoration:line-through; color:rgba(255,255,255,0.3); }
.plan-bullet-del {
  background:none; border:none; color:rgba(255,255,255,0.2);
  cursor:pointer; font-size:12px; margin-left:auto; flex-shrink:0;
  padding:0 2px;
}
.plan-bullet-del:hover { color:#f87171; }
.bullets-empty { font-size:12px; color:rgba(255,255,255,0.2); font-style:italic; }
.save-plan-btn {
  font-size:11px; padding:4px 10px; border-radius:8px;
  background:rgba(125,249,255,0.1); border:1px solid rgba(125,249,255,0.25);
  color:var(--nebula-cyan); cursor:pointer; margin-top:4px; align-self:flex-start;
}

/* User notes */
.user-notes-list {
  flex:1; overflow-y:auto; max-height:200px; display:flex; flex-direction:column; gap:6px;
}
.user-note {
  background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08);
  border-radius:10px; padding:8px 10px; font-size:12px;
  color:rgba(255,255,255,0.75); line-height:1.5; position:relative;
}
.note-actions {
  display:flex; gap:6px; margin-top:5px;
}
.note-action-btn {
  font-size:10px; padding:2px 8px; border-radius:6px; cursor:pointer;
  background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1);
  color:rgba(255,255,255,0.35);
}
.note-action-btn:hover { color:#fff; background:rgba(255,255,255,0.1); }
.note-action-btn.del:hover { color:#f87171; border-color:rgba(248,113,113,0.3); }
.note-add-row textarea {
  width:100%; background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.1); border-radius:10px;
  color:#fff; font-size:12px; padding:9px 10px;
  resize:none; outline:none; font-family:inherit; line-height:1.5;
}
.note-add-row textarea:focus { border-color:rgba(168,85,247,0.35); }
.note-add-row textarea::placeholder { color:rgba(255,255,255,0.2); }

/* ── DUAL DROP BUTTONS ── */
.dual-drop-btns {
  display:flex; gap:10px; margin-bottom:0;
}
.dual-btn {
  flex:1; padding:12px 14px;
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px; color:rgba(255,255,255,0.65);
  font-size:13px; font-weight:500; cursor:pointer;
  display:flex; align-items:center; justify-content:space-between;
  transition:all 0.2s;
}
.dual-btn:hover { background:rgba(255,255,255,0.08); color:#fff; }
.dual-btn.open {
  background:rgba(125,249,255,0.07);
  border-color:rgba(125,249,255,0.3);
  color:var(--nebula-cyan);
  border-radius:12px 12px 0 0;
  border-bottom-color:transparent;
}
.dual-btn.open .ps-drop-arrow { transform:rotate(180deg); }

/* Big green action buttons for Notes + Nova Planning */
.dual-btn-big {
  flex:1; padding:16px 14px;
  background:linear-gradient(135deg,rgba(34,197,94,0.25),rgba(16,185,129,0.15));
  border:1.5px solid rgba(34,197,94,0.45);
  border-radius:14px; color:#4ade80;
  font-size:14px; font-weight:600; cursor:pointer;
  display:flex; align-items:center; justify-content:space-between;
  transition:all 0.2s;
  box-shadow:0 0 18px rgba(34,197,94,0.12);
}
.dual-btn-big:hover {
  background:linear-gradient(135deg,rgba(34,197,94,0.35),rgba(16,185,129,0.25));
  box-shadow:0 0 28px rgba(34,197,94,0.25);
  color:#86efac;
}
.dual-btn-big.open {
  background:linear-gradient(135deg,rgba(34,197,94,0.3),rgba(16,185,129,0.2));
  border-color:rgba(34,197,94,0.7);
  border-radius:14px 14px 0 0;
  border-bottom-color:transparent;
  color:#86efac;
}
.dual-btn-big.open .ps-drop-arrow { transform:rotate(180deg); }

.dual-panel {
  border:1px solid rgba(125,249,255,0.2);
  border-radius:0 0 14px 14px;
  background:rgba(6,3,18,0.85);
  padding:14px; margin-top:-1px;
}

/* ════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS
   ════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* Login */
  #login-box {
    padding: 28px 20px;
    border-radius: 20px;
    width: 92vw;
  }

  /* Bottom nav — full width bar on mobile */
  #bottom-nav {
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 8px 8px calc(18px + env(safe-area-inset-bottom));
    gap: 0;
    justify-content: space-around;
    border-bottom: none;
  }
  .nav-btn { font-size: 9px; gap: 2px; }
  .nav-btn .nb-icon { font-size: 18px; }
  #add-btn { width: 44px; height: 44px; font-size: 20px; }

  /* Panels — slide up from bottom, compact height */
  .panel {
    border-radius: 20px 20px 0 0;
    max-width: 100vw;
    width: 100%;
    margin: 0;
    max-height: 72dvh;
    overflow-y: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  }
  .panel-overlay {
    align-items: flex-end;
  }

  /* Smaller fields and buttons on mobile */
  textarea.field, input.field {
    font-size: 13px;
    padding: 10px 12px;
    margin-bottom: 8px;
  }
  .btn-primary, .btn-ghost {
    font-size: 13px;
    padding: 11px;
  }
  .label-pill {
    font-size: 10px;
    margin-bottom: 6px;
  }
  .affirmation-box {
    font-size: 13px;
    padding: 10px 12px;
    margin-bottom: 8px;
  }
  .dur-btn {
    font-size: 11px;
    padding: 7px 4px;
  }

  /* Progress screen */
  #progress-screen {
    padding-bottom: 90px;
  }
  .ps-header {
    padding: 16px 16px 12px;
    gap: 10px;
  }
  .ps-body {
    padding: 16px;
  }

  /* Split panels stack on mobile */
  .split-panel {
    flex-direction: column;
    gap: 12px;
  }
  .split-col { width: 100%; }

  /* Dual buttons stay side by side on mobile */
  .dual-drop-btns {
    flex-direction: row;
    gap: 8px;
  }
  .dual-btn-big {
    flex: 1;
    font-size: 13px;
    padding: 10px 8px;
  }

  /* Goals screen */
  #goals-screen {
    padding-bottom: 80px;
  }
  #tarot-grid {
    padding: 16px;
    gap: 14px;
  }
  .tarot-card {
    width: calc(50% - 7px);
  }

  /* Nova screen */
  #nova-screen {
    padding-bottom: 80px;
  }
  #nova-chat-header {
    padding: 14px 16px;
  }
  #nova-messages {
    padding: 12px 14px;
  }
  #nova-input-row {
    padding: 10px 12px 20px;
  }

  /* Settings */
  #settings-screen .panel {
    max-height: 85vh;
    overflow-y: auto;
  }

  /* Launch pad */
  #lp-title {
    top: 24px;
    font-size: 12px;
  }
  #lp-goal-name { font-size: 16px; }
  #lp-affirmation { font-size: 11px; }

  /* Scroll hint */
  #scroll-hint {
    bottom: 80px;
  }

  /* Milestone / timeline items */
  .milestone-item {
    gap: 10px;
  }
  .ms-content { font-size: 13px; }

  /* Toast */
  #toast {
    bottom: 90px;
    font-size: 13px;
    padding: 10px 18px;
  }
}

/* ── STAR CARD ── */
@keyframes starCardIn {
  from { opacity:0; transform:translateX(-50%) translateY(12px); }
  to   { opacity:1; transform:translateX(-50%) translateY(0); }
}

/* ── STAR COLOR PICKER ── */
.star-color-swatch {
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.star-color-swatch:hover { transform: scale(1.2); }
.star-color-swatch.selected {
  border-color: #fff;
  transform: scale(1.25);
}

/* ── ONBOARDING ── */
.ob-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  cursor: pointer; transition: all 0.2s;
}
.ob-dot.active {
  background: var(--nebula-purple);
  width: 24px; border-radius: 4px;
}
