/* ORBIT — gamified UI layer (presentation only) */

:root {
  --orbit-glow-green: rgba(124, 58, 237, 0.25);
  --orbit-glow-amber: rgba(139, 92, 246, 0.35);
  --orbit-glow-red: rgba(99, 102, 241, 0.45);
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a #0a0a0a;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: #0a0a0a; }
*::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

/* Card noise + hover */
.card, .stat-card-hud, .orbit-score-card, .vision-card, .goal-card, .week-summary-box, .chart-panel {
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card::after, .stat-card-hud::after, .orbit-score-card::after, .vision-card::after, .goal-card::after, .week-summary-box::after, .chart-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.card:hover, .stat-card-hud:hover, .goal-card:hover, .vision-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(124, 58, 237, 0.08);
  border-color: var(--border-light) !important;
}
.btn-icon:active, .pomodoro-btn:active, .add-item-btn:active, .chat-toggle-btn:active {
  transform: scale(0.96);
}

/* ========== DOOM METER TOP ========== */
.doom-meter-top {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  position: relative;
  overflow: visible;
}
.doom-meter-top .doom-meter-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px 14px;
  position: relative;
  z-index: 2;
}
.doom-meter-top .doom-glow-layer {
  position: absolute;
  inset: -20px 0 -30px;
  pointer-events: none;
  transition: background 0.6s ease, opacity 0.6s ease;
  z-index: 0;
}
.doom-meter-top.doom-tier-safe .doom-glow-layer {
  background: radial-gradient(ellipse 80% 120% at 50% 0%, var(--orbit-glow-green), transparent 65%);
}
.doom-meter-top.doom-tier-warning .doom-glow-layer {
  background: radial-gradient(ellipse 80% 120% at 50% 0%, var(--orbit-glow-amber), transparent 65%);
}
.doom-meter-top.doom-tier-danger {
  animation: doom-page-pulse 2.5s ease-in-out infinite;
}
.doom-meter-top.doom-tier-danger .doom-glow-layer {
  background: radial-gradient(ellipse 90% 140% at 50% 0%, var(--orbit-glow-red), transparent 70%);
  animation: doom-glow-breathe 2s ease-in-out infinite;
}
@keyframes doom-page-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}
@keyframes doom-glow-breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.doom-meter-top .doom-label-text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 72px;
}
.doom-meter-top .doom-bar-wrap {
  flex: 1;
  position: relative;
}
.doom-meter-top .doom-bar {
  height: 12px !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.06) !important;
}
.doom-meter-top .doom-fill {
  border-radius: 6px !important;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.4s ease !important;
}
.doom-meter-top .doom-fill.doom-fill-animate-in {
  animation: doom-fill-pop 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes doom-fill-pop {
  from { width: 0 !important; }
}
.doom-meter-top .doom-value {
  font-size: 2rem !important;
  font-weight: 700 !important;
  font-family: var(--font-mono) !important;
  line-height: 1;
  min-width: 4.5ch;
  text-align: right;
}
.doom-meter-top .doom-label { display: none; }

/* ========== SIDEBAR LOGO RING ========== */
.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.logo-ring-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}
.logo-streak-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.logo-streak-ring circle.track { fill: none; stroke: #1f1f1f; stroke-width: 3; }
.logo-streak-ring circle.fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.logo-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--accent-glow);
  animation: pulse-glow 2s ease-in-out infinite;
}
.orbit-points-today {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ========== LEVEL DISPLAY ========== */
/* ─── LEVEL DISPLAY CONTAINER ─── */
.level-display {
  padding: 10px 12px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 8px;
  margin: 6px 0;
  width: 100%;
  box-sizing: border-box;
}

/* ─── TOP ROW: hexagon badge + LEVEL label + tier name ─── */
.level-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

/* Hexagon badge — clips the span into a hex shape */
.level-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  background: linear-gradient(135deg, #4c1d95, #7c3aed);
  clip-path: polygon(50% 0%,95% 25%,95% 75%,50% 100%,5% 75%,5% 25%);
  font-size: 16px;
  font-weight: 900;
  color: #c4b5fd;
  font-family: var(--font-mono, monospace);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.5);
}

/* "LEVEL 3" — repurpose level-title as the LEVEL label */
.level-title {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a78bfa;
  line-height: 1.2;
}

/* ─── TIER NAME: "Waking Up" below the LEVEL label ─── */
.level-subtitle {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 600;
  color: #e0e0ff;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
  padding-left: 48px; /* aligns under the text, not the badge */
}

/* ─── XP BAR — taller + shimmer ─── */
.level-bar-wrap {
  height: 6px;
  background: #1e1b4b;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

@keyframes xp-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.level-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    #7c3aed 0%,
    #a78bfa 40%,
    #c4b5fd 52%,
    #a78bfa 64%,
    #7c3aed 100%
  );
  background-size: 200% auto;
  animation: xp-shimmer 2.5s linear infinite;
  transition: width 0.8s ease;
}

/* ─── XP TEXT: "100 / 300 pts" ─── */
.level-pts {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: #6d5fa6;
  letter-spacing: 0.04em;
}

/* ========== GRAVITY WIDGET ========== */
/* ── Gravity widget card ── */
.doom-sidebar,
.doom-meter-sidebar,
.gravity-widget,
[class*="doom-side"] {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 6px 0;
  width: 100%;
  box-sizing: border-box;
}

/* "GRAVITY ⓘ" header row */
.doom-sidebar-header,
.gravity-header,
.doom-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4b5563;
  margin-bottom: 8px;
}

/* Inline % text in header row */
.doom-sidebar-pct,
.doom-percentage,
.gravity-percent,
[id*="doom-pct"],
[id*="gravity-pct"] {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: #ffffff;
  border: none;
  background: none;
  padding: 0;
  box-shadow: none;
}

/* Status text: "Light Pull" */
.doom-sidebar-status,
.gravity-status,
.doom-status-text {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  margin-bottom: 10px;
  border: none;
  background: none;
  padding: 0;
  box-shadow: none;
}

/* 8 dot row */
.gravity-dots {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.gravity-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1e1b4b;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}
.gravity-dot.dot-safe {
  background: #22c55e;
  box-shadow: 0 0 5px rgba(34,197,94,0.7);
}
.gravity-dot.dot-warning {
  background: #f59e0b;
  box-shadow: 0 0 5px rgba(245,158,11,0.7);
}
.gravity-dot.dot-critical {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239,68,68,0.9);
}

@keyframes critical-pulse {
  0%,100% { box-shadow: 0 0 6px rgba(239,68,68,0.5); }
  50%      { box-shadow: 0 0 18px rgba(239,68,68,1);  }
}
.gravity-dot.dot-critical {
  animation: critical-pulse 1.2s ease-in-out infinite;
}

/* ========== HIDE TOP DOOM BANNER ========== */
.doom-meter-top {
  display: none !important;
}

/* ========== CURRENT DESTINY SIDEBAR CARD ========== */
.destiny-sidebar-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 10px 0;
  width: 100%;
  box-sizing: border-box;
}

.destiny-sidebar-card:hover {
  border-color: rgba(124,58,237,0.4);
}

.destiny-sidebar-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4b5563;
  margin-bottom: 8px;
}

.destiny-sidebar-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.destiny-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: #e0e0ff;
}

.destiny-sidebar-arrow {
  font-size: 20px;
  font-weight: 300;
  color: #7c3aed;
}

.destiny-sidebar-subject {
  font-size: 10px;
  color: #6b7280;
  font-style: italic;
  margin-top: 2px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.destiny-sidebar-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.destiny-sidebar-meta {
  font-size: 11px;
  color: #94a3b8;
}

.destiny-sidebar-days {
  font-size: 10px;
  color: #7c3aed;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
}

.destiny-sidebar-bar-track {
  height: 3px;
  background: #1e1b4b;
  border-radius: 2px;
  overflow: hidden;
}

.destiny-sidebar-bar-fill {
  height: 3px;
  width: 42%;
  background: linear-gradient(90deg,#7c3aed,#a78bfa);
  border-radius: 2px;
}

/* ========== MINI CONSTELLATION PREVIEW CARD ========== */
.mini-constellation-card {
  background: linear-gradient(160deg, rgba(10,10,20,0.95) 0%, rgba(22,10,46,0.7) 100%);
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}
.mcc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px 8px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}
.mcc-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7c3aed;
}
.mcc-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.mcc-expand-btn:hover {
  border-color: var(--accent, #7c3aed);
  color: var(--text-primary, #e0e0ff);
}
.mcc-starmap-wrap {
  position: relative;
  padding: 0 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mcc-starmap-wrap::-webkit-scrollbar { display: none; }
.mcc-starmap {
  display: block;
  width: 100%;
  min-width: 280px;
  height: 96px;
  overflow: visible;
}
.mcc-vision-label-wrap {
  padding: 0 12px 8px;
}
.mcc-vision-label-text {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
/* SVG elements */
.mcc-bg-dust circle {
  fill: rgba(167, 139, 250, 0.12);
}
.mcc-edge {
  stroke: rgba(124, 58, 237, 0.22);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  stroke-linecap: round;
}
.mcc-vision-star {
  fill: #7c3aed;
}
.mcc-empty-text {
  fill: var(--text-muted, #4b5563);
  font-size: 11px;
}
.mcc-hit-area {
  cursor: pointer;
}
/* Incomplete goal stars */
.mcc-goal--incomplete .mcc-star {
  fill: #1e1b4b;
  stroke: #4c3d8a;
  stroke-width: 1;
  transition: fill 0.25s;
}
.mcc-goal--incomplete:hover .mcc-star,
.mcc-goal--incomplete:focus-visible .mcc-star {
  fill: #2d2460;
  stroke: #7c6aaa;
}
/* Completed goal stars */
.mcc-goal--complete .mcc-star {
  fill: #c4b5fd;
  stroke: none;
  animation: mcc-star-glow 3s ease-in-out infinite;
}
.mcc-star-glow-ring {
  fill: none;
  stroke: rgba(196, 181, 253, 0.18);
  stroke-width: 1;
  animation: mcc-ring-pulse 3s ease-in-out infinite;
}
/* Selection ring */
.mcc-selected-ring {
  fill: none;
  stroke: #a78bfa;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  opacity: 0.85;
  transform-box: fill-box;
  transform-origin: center;
  animation: mcc-ring-spin 8s linear infinite;
}
/* Overflow badge */
.mcc-overflow-badge rect {
  fill: rgba(124, 58, 237, 0.2);
  stroke: rgba(124, 58, 237, 0.4);
  stroke-width: 1;
}
.mcc-overflow-badge text {
  fill: #a78bfa;
  font-size: 9px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
}
/* Task drawer */
.mcc-task-drawer {
  border-top: 1px solid rgba(124, 58, 237, 0.14);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s ease;
  opacity: 0;
}
.mcc-task-drawer.mcc-drawer--open {
  max-height: 240px;
  opacity: 1;
}
.mcc-drawer-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px 8px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
  min-width: 0;
}
.mcc-drawer-quest-icon {
  font-size: 12px;
  flex-shrink: 0;
}
.mcc-drawer-quest-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #e0e0ff);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mcc-drawer-progress {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.mcc-drawer-progress-bar {
  width: 60px;
  height: 4px;
  background: rgba(124, 58, 237, 0.18);
  border-radius: 2px;
  overflow: hidden;
}
.mcc-drawer-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  border-radius: 2px;
  transition: width 0.35s ease;
}
.mcc-drawer-progress-pct {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--text-secondary, #94a3b8);
  min-width: 26px;
  text-align: right;
}
.mcc-drawer-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted, #4b5563);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  border-radius: 3px;
  flex-shrink: 0;
  transition: color 0.2s;
  padding: 0;
}
.mcc-drawer-close:hover { color: var(--text-primary, #e0e0ff); }
.mcc-task-list {
  list-style: none;
  margin: 0;
  padding: 5px 0;
  max-height: 130px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.25) transparent;
}
.mcc-task-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-secondary, #94a3b8);
}
.mcc-task-check {
  flex-shrink: 0;
  font-size: 13px;
  color: rgba(124, 58, 237, 0.5);
}
.mcc-task--done .mcc-task-title {
  text-decoration: line-through;
  color: var(--text-muted, #4b5563);
}
.mcc-task--done .mcc-task-check { color: #22c55e; }
.mcc-no-tasks {
  padding: 7px 12px;
  font-size: 11px;
  color: var(--text-muted, #4b5563);
  font-style: italic;
  list-style: none;
}
.mcc-drawer-footer {
  padding: 6px 12px 9px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(124, 58, 237, 0.08);
}
.mcc-open-quest-btn {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #a78bfa;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.mcc-open-quest-btn:hover { color: var(--text-primary, #e0e0ff); }
/* Animations */
@keyframes mcc-star-glow {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(196,181,253,0.7)) drop-shadow(0 0 7px rgba(124,58,237,0.35)); }
  50%       { filter: drop-shadow(0 0 6px rgba(196,181,253,1.0)) drop-shadow(0 0 12px rgba(124,58,237,0.6)); }
}
@keyframes mcc-ring-pulse {
  0%, 100% { stroke-opacity: 0.15; }
  50%       { stroke-opacity: 0.38; }
}
@keyframes mcc-ring-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@media (max-width: 640px) {
  .mcc-starmap {
    width: 420px;
    min-width: 420px;
    height: 88px;
  }
  .mcc-task-drawer.mcc-drawer--open { max-height: 210px; }
}

/* ---- Constellation Widget (Onboarding States A/B/C) ---- */
.mcc-galaxy-body {
  position: relative;
  cursor: pointer; /* the mini map is a portal into the full universe */
}
/* compact secondary CTA placed below the mini map (never overlaps stars) */
.mcc-cta-compact {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 4px auto 2px; width: max-content; max-width: 92%;
  padding: 5px 12px; border-radius: 100px;
  font-size: 11px; font-weight: 500; line-height: 1; cursor: pointer;
  background: rgba(167,139,250,0.12); border: 1px solid rgba(167,139,250,0.32); color: #cdb8ff;
  transition: background 0.2s, border-color 0.2s;
}
.mcc-cta-compact:hover { background: rgba(167,139,250,0.22); border-color: rgba(167,139,250,0.5); }
.constellation-widget {
  position: relative;
  overflow: hidden;
  padding: 10px 12px 8px;
  min-height: 86px;
  display: flex;
  align-items: stretch;
  gap: 12px;
}
/* Dot-grid star-field background for widget states */
.constellation-widget::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(167,139,250,0.3) 1px, transparent 1px),
    radial-gradient(circle, rgba(196,181,253,0.15) 1px, transparent 1px);
  background-size: 30px 30px, 17px 17px;
  background-position: 0 0, 8px 8px;
  pointer-events: none;
  border-radius: 8px;
}
/* Orbit area (left column) */
.csw-orbit-area {
  position: relative;
  flex: 0 0 80px;
  height: 80px;
  align-self: center;
}
.orbit-ring {
  position: absolute;
  width: 70px; height: 70px;
  border-radius: 50%;
  border: 1px dashed rgba(124,58,237,0.4);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: csw-orbit-spin 12s linear infinite;
}
.orbit-ring.has-destiny { border-color: rgba(167,139,250,0.55); }
@keyframes csw-orbit-spin {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg); }
}
.destiny-star {
  position: absolute;
  width: 10px; height: 10px;
  background: #a78bfa;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(167,139,250,0.8);
  animation: csw-star-pulse 2.5s ease-in-out infinite;
}
.destiny-star.empty {
  background: rgba(124,58,237,0.2);
  box-shadow: none;
  animation: none;
}
@keyframes csw-star-pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(167,139,250,0.6); }
  50%       { box-shadow: 0 0 14px rgba(167,139,250,1); }
}
.quest-dot {
  position: absolute;
  width: 7px; height: 7px;
  background: #7c3aed;
  border-radius: 50%;
  top: calc(50% - 35px - 3.5px);
  left: calc(50% - 3.5px);
  box-shadow: 0 0 6px rgba(124,58,237,0.8);
}
/* Daily pulse row (State C) */
.csw-daily-area {
  position: absolute;
  top: calc(50% + 10px);
  left: calc(50% - 14px);
  display: flex;
  gap: 5px;
  align-items: center;
}
.daily-pulse-dot {
  display: inline-block;
  width: 5px; height: 5px;
  background: #22c55e;
  border-radius: 50%;
  animation: csw-daily-pulse 1.5s ease-in-out infinite;
}
.daily-pulse-dot:nth-child(2) { animation-delay: 0.3s; }
.daily-pulse-dot:nth-child(3) { animation-delay: 0.6s; }
@keyframes csw-daily-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%       { opacity: 1; transform: scale(1.2); }
}
/* Content area (right column) */
.csw-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  position: relative;
  z-index: 1;
}
.csw-vision-name {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #c4b5fd;
  letter-spacing: 0.04em;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.constellation-prompt {
  margin: 0;
  font-size: 11px;
  color: rgba(167,139,250,0.8);
  line-height: 1.5;
}
.constellation-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #a78bfa;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  align-self: flex-start;
}
.constellation-cta:hover {
  background: rgba(124,58,237,0.22);
  border-color: rgba(167,139,250,0.5);
  color: #c4b5fd;
}

/* ========== MAIN MISSION HERO CARD ========== */
.main-mission-hero {
  position: relative;
  background: linear-gradient(
    135deg,
    #0d0d1a 0%,
    #160a2e 55%,
    #1a0a3a 100%
  );
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 18px;
  overflow: hidden;
  min-height: 170px;
  display: flex;
  align-items: center;
}

.main-mission-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  max-width: 65%;
}

.main-mission-meta {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a78bfa;
  margin-bottom: 14px;
}

.main-mission-body {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.main-mission-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(
    135deg,
    #4c1d95,
    #7c3aed
  );
  clip-path: polygon(
    50% 0%,
    95% 25%,
    95% 75%,
    50% 100%,
    5% 75%,
    5% 25%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.main-mission-title {
  font-size: 28px;
  font-weight: 800;
  color: #e0e0ff;
  line-height: 1.1;
  margin-bottom: 4px;
}

.main-mission-subtitle {
  font-size: 13px;
  color: #94a3b8;
}

.main-mission-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-mission-pct {
  font-size: 24px;
  font-weight: 800;
  color: #a78bfa;
}

.main-mission-complete-word {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4b5563;
}

.main-mission-bar-track {
  flex: 1;
  min-width: 100px;
  height: 6px;
  background: #1e1b4b;
  border-radius: 3px;
  overflow: hidden;
}

.main-mission-bar-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    #7c3aed,
    #a78bfa
  );
}

.main-mission-days {
  font-size: 13px;
  font-weight: 700;
  color: #e0e0ff;
}

.main-mission-planet {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 35% 40%,
      #4c1d95 0%,
      #1e0a4a 40%,
      transparent 70%
    );
  box-shadow:
    0 0 60px rgba(124,58,237,0.4),
    inset 0 0 40px rgba(167,139,250,0.15);
}

.main-mission-planet::after {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 2px solid rgba(167,139,250,0.25);
  transform: rotate(-30deg) scaleY(0.3);
}

/* ========== LEVEL UP ANIMATION ========== */
.levelup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: levelup-in 0.4s ease,
             levelup-out 0.4s ease 2.1s forwards;
}
.levelup-content {
  text-align: center;
}
.levelup-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: levelup-pulse 0.6s ease infinite alternate;
}
.levelup-tag {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: #7A7A88;
  margin-bottom: 8px;
}
.levelup-title {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 6px;
}
.levelup-sub {
  font-family: monospace;
  font-size: 14px;
  color: #7A7A88;
  margin-bottom: 20px;
}
.levelup-pts {
  font-family: monospace;
  font-size: 11px;
  color: #34D399;
  letter-spacing: 0.1em;
}
@keyframes levelup-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes levelup-out {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}
@keyframes levelup-pulse {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}

/* ========== LEVEL CARD ========== */
.level-card-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.level-card-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.level-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.level-card-icon {
  font-size: 24px;
}
.level-card-title {
  font-family: var(--font-mono, monospace);
  font-size: 18px;
  font-weight: 700;
  flex: 1;
}
.level-card-pts {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--text-muted);
}
.level-card-sub {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: #7A7A88;
  margin-left: 34px;
}
.level-card-bar-wrap {
  height: 4px;
  background: #1a1a1f;
  border-radius: 2px;
  overflow: hidden;
  margin-left: 34px;
}
.level-card-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}
.level-card-next {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 34px;
}
.level-card-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}
.level-dot {
  font-size: 20px;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}
.level-dot.current {
  opacity: 1;
  transform: scale(1.2);
}
.level-dot.past {
  opacity: 0.6;
}

/* Compact level card — reduce height ~40% */
#level-card-panel {
  padding: 12px 16px;
}
#level-card-panel h3 {
  margin-bottom: 8px;
}
#level-card-panel .level-card-content {
  gap: 6px;
}
#level-card-panel .level-card-main {
  gap: 4px;
}
#level-card-panel .level-card-icon {
  font-size: 14px;
}
#level-card-panel .level-card-title {
  font-size: 13px;
}
#level-card-panel .level-card-sub {
  display: none;
}
#level-card-panel .level-card-dots {
  display: none;
}

/* ========== ORBIT SCORE HUD ========== */
.orbit-score-card {
  grid-column: 1 / -1;
  background: linear-gradient(145deg, #0d0d0d 0%, #121010 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 8px;
  overflow: hidden;
}
.orbit-score-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.5), rgba(124, 58, 237, 0.05), rgba(168, 85, 247, 0.2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: orbit-border-spin 8s linear infinite;
  pointer-events: none;
}
@keyframes orbit-border-spin {
  to { filter: hue-rotate(15deg); }
}
.orbit-score-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.orbit-score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.orbit-score-stat .val {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}
.orbit-score-stat .lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.orbit-score-stat.points .val {
  color: var(--accent);
  font-size: 2.85rem;
  text-shadow: 0 0 20px #a78bfa;
}

/* ========== RPG STAT CARDS ========== */
.orbit-score-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #4b5563;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.orbit-score-stat {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px 16px 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.orbit-score-stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* top accent border per card */
.orbit-score-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 10px 10px 0 0;
}

.rpg-quests::before  { background: #22c55e; }
.rpg-streak::before  { background: #f59e0b; }
.rpg-xp::before      { background: #7c3aed; }
.rpg-level::before   { background: #a78bfa; }

/* icon row */
.rpg-stat-icon {
  font-size: 18px;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
}

/* ✓ quests icon as text glyph */
.rpg-quests .rpg-stat-icon {
  font-size: 20px;
  font-weight: 700;
  color: #22c55e;
  font-family: var(--font-mono);
}

/* value typography */
.orbit-score-stat .val {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.rpg-quests .val  { color: #22c55e; }
.rpg-streak .val  { color: #f59e0b; }
.rpg-xp .val      { color: #a78bfa; text-shadow: 0 0 16px rgba(167,139,250,0.5); }
.rpg-level .val   { color: #c4b5fd; font-size: 1.2rem; font-weight: 700; }

/* label */
.orbit-score-stat .lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4b5563;
  margin-top: 0;
}

/* flame animation on streak icon */
@keyframes rpg-flame {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50%       { transform: scale(1.2) rotate(3deg); }
}

.rpg-flame {
  display: inline-block;
  animation: rpg-flame 1.4s ease-in-out infinite;
  transform-origin: bottom center;
}

/* responsive: keep 2-col on narrow screens */
@media (max-width: 900px) {
  .orbit-score-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== ACHIEVEMENTS ========== */
.ach-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 20px;
}
.ach-summary-count {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
  line-height: 1;
}
.ach-summary-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ach-group { margin-bottom: 24px; }
.ach-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.ach-badge {
  position: relative;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ach-badge--locked {
  filter: grayscale(1);
  opacity: 0.55;
}
.ach-badge--unlocked {
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.25);
}
.ach-badge--unlocked:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}
.ach-badge-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  opacity: 0.6;
}
.ach-badge-icon { font-size: 26px; line-height: 1; margin-bottom: 2px; }
.ach-badge-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.ach-badge-meta {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.ach-badge--unlocked .ach-badge-meta { color: var(--accent); }
@media (max-width: 600px) {
  .ach-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ========== MINDSET GUIDE ========== */
.mg-hero {
  position: relative;
  background: linear-gradient(145deg, #0d0d0d 0%, #121010 100%);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mg-hero:hover, .mg-hero:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.25);
  outline: none;
}
.mg-hero-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.mg-hero-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}
.mg-hero-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 6px 0 8px;
}
.mg-hero-teaser {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}
.mg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.mg-filter-btn {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mg-filter-btn:hover { border-color: rgba(167, 139, 250, 0.4); }
.mg-filter-btn.active {
  background: rgba(124, 58, 237, 0.18);
  border-color: var(--accent);
  color: var(--text-primary);
}
.mg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.mg-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mg-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.mg-card-cat {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.mg-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.mg-card-teaser {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

/* Mindset Guide detail modal */
.mg-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mg-detail-overlay[hidden] { display: none; }
.mg-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
}
.mg-detail-card {
  position: relative;
  background: linear-gradient(145deg, #0d0d0d 0%, #121010 100%);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px 28px 28px;
}
.mg-detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease;
}
.mg-detail-close:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }
.mg-detail-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(124, 58, 237, 0.14);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 12px;
}
.mg-detail-title {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 16px;
}
.mg-detail-body {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.mg-detail-body p { margin: 0 0 14px; }
.mg-detail-body p:last-child { margin-bottom: 0; }
@media (max-width: 600px) {
  .mg-grid { grid-template-columns: 1fr; }
  .mg-detail-card { padding: 24px 20px 20px; max-height: 85vh; }
}

/* ========== CHECKLIST GAMIFICATION ========== */
.checklist-item.just-completed {
  animation: checklist-flash 0.5s ease;
}
@keyframes checklist-flash {
  0% { background: rgba(34, 197, 94, 0.35); }
  100% { background: var(--bg-tertiary); }
}
.checklist-item.completed .checklist-text {
  text-decoration: line-through;
  color: var(--doom-safe) !important;
}
.alignment-thread {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  max-width: 42%;
}
.alignment-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.alignment-thread span {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.goal-vision-thread {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}
.goal-vision-thread .alignment-dot { background: #a855f7; box-shadow: 0 0 8px rgba(168, 85, 247, 0.5); }
.points-float {
  position: absolute;
  right: 12px;
  top: 50%;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--doom-safe);
  pointer-events: none;
  animation: points-rise 0.9s ease forwards;
  z-index: 5;
}
@keyframes points-rise {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-28px); }
}
.checklist-item { position: relative; }

/* ========== POMODORO ========== */
.pomodoro-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
}
.pomodoro-ring-svg {
  width: 220px;
  height: 220px;
}
.pomodoro-ring-svg circle.track { fill: none; stroke: #1a1a1a; stroke-width: 6; }
.pomodoro-ring-svg circle.progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 12px var(--accent-glow));
}
.pomodoro-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  text-align: center;
}
.pomodoro-time {
  font-size: 4.5rem !important;
  letter-spacing: -4px !important;
}
.pomodoro-label { margin-bottom: 0 !important; }

/* Session complete overlay */
.session-complete-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.session-complete-overlay.active {
  opacity: 1;
  pointer-events: auto;
  animation: session-flash 0.6s ease;
}
@keyframes session-flash {
  0% { background: rgba(124, 58, 237, 0.4); }
  100% { background: rgba(0, 0, 0, 0.85); }
}
.session-complete-overlay h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
}
.session-complete-overlay .session-pts {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--doom-safe);
  margin-top: 12px;
}

/* ========== CHAT SLIDE PANEL ========== */
.app-body { position: relative; }
.chat-panel {
  position: fixed !important;
  top: 52px;
  right: 0;
  bottom: 0;
  width: 380px !important;
  min-width: 380px !important;
  max-width: 380px !important;
  z-index: 180;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease !important;
  box-shadow: -12px 0 48px rgba(0, 0, 0, 0.5);
  opacity: 1 !important;
  pointer-events: auto !important;
  border-left: 1px solid var(--border-color) !important;
}
.chat-panel.collapsed {
  transform: translateX(100%) !important;
  pointer-events: none !important;
}
.chat-show-fab { display: none !important; }
.main-header #header-chat-toggle.active {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.main { transition: margin-right 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
body.chat-open .main { margin-right: 380px; }

/* ========== VISION CONSTELLATION ========== */
#screen-vision {
  position: relative;
}
#screen-vision::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2.5px 2.5px at 20% 30%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.35), transparent),
    radial-gradient(2.5px 2.5px at 80% 10%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,0.35), transparent),
    radial-gradient(2.5px 2.5px at 90% 50%, rgba(249,115,22,0.35), transparent),
    radial-gradient(1px 1px at 10% 60%, rgba(255,255,255,0.35), transparent);
  pointer-events: none;
  opacity: 0.35;
}
.vision-grid { position: relative; z-index: 1; }
.vision-card {
  background: linear-gradient(160deg, rgba(13,13,13,0.95), rgba(20,15,10,0.9)) !important;
  border: 1px solid rgba(124, 58, 237, 0.15) !important;
}
.vision-card .vision-emoji {
  font-size: 2.5rem;
  margin-bottom: 8px;
  line-height: 1;
}
.vision-timeline-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent);
  margin-bottom: 10px;
}
.vision-progress-ring {
  position: absolute;
  top: 16px;
  right: 48px;
  width: 44px;
  height: 44px;
}
.vision-progress-ring svg { transform: rotate(-90deg); }
.vision-empty-constellation {
  text-align: center;
  padding: 64px 24px;
  position: relative;
}
.vision-empty-constellation svg.constellation-svg {
  width: 200px;
  height: 120px;
  opacity: 0.25;
  margin-bottom: 20px;
}
.vision-empty-constellation h3 {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ========== OVERVIEW DASHBOARD ========== */
.overview-dashboard { display: flex; flex-direction: column; gap: 24px; }
.overview-stats {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
}
.stat-card-hud {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border-bottom: 3px solid var(--stat-accent, var(--accent));
}
.stat-card-hud.doom-stat {
  box-shadow: inset 0 0 40px var(--doom-glow-inset, transparent);
}
.stat-card-hud .stat-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-card-hud .stat-value {
  font-family: var(--font-mono);
  font-size: 2.25rem !important;
  font-weight: 700;
  line-height: 1;
  -webkit-text-fill-color: unset !important;
  background: none !important;
  color: var(--text-primary);
}
.stat-card-hud .stat-sparkline {
  margin-top: 8px;
  height: 26px;
  width: 100%;
}
.stat-card-hud .stat-sparkline polyline {
  stroke-width: 2;
}
.stat-card-hud .stat-change { font-size: 11px; margin-top: 4px; color: var(--text-muted); }

.chart-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.chart-panel h3 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.chart-panel svg { width: 100%; display: block; }
#doom-trend-chart .doom-trend-line {
  stroke-width: 3;
  filter: drop-shadow(0 0 4px currentColor);
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 10px);
  grid-template-rows: repeat(4, 10px);
  gap: 3px;
}
.heatmap-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  cursor: default;
  position: relative;
}
.heatmap-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 10px;
  color: var(--text-muted);
}
.heatmap-wrap { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }

.goal-progress-row {
  margin-bottom: 20px;
}
.goal-progress-row .row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}
.goal-progress-row .days-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.goal-progress-row .days-badge.ok { background: rgba(34,197,94,0.15); color: var(--doom-safe); }
.goal-progress-row .days-badge.warn { background: rgba(234,179,8,0.15); color: var(--doom-rising); }
.goal-progress-row .days-badge.bad { background: rgba(239,68,68,0.15); color: var(--doom-danger); }
.goal-progress-row .days-badge.overdue { background: rgba(220,38,38,0.25); color: #fca5a5; font-weight: 800; }
.goal-bar-track {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  position: relative;
  overflow: visible;
}
.goal-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.goal-bar-fill.animate {
  /* width set inline */
}
.goal-pace-marker {
  position: absolute;
  top: -4px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid var(--text-muted);
  transform: translateX(-50%);
}

.week-summary-box {
  background: linear-gradient(135deg, rgba(13,13,18,1), rgba(20,12,8,0.95));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.week-summary-box h3 {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.week-summary-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}
.week-summary-cols .col .k { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.week-summary-cols .col .v { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 600; margin-top: 4px; }
.week-summary-line { font-size: 14px; color: var(--text-secondary); line-height: 1.6; border-top: 1px solid var(--border-color); padding-top: 16px; }

.bar-chart-day { transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); transform-origin: bottom; }
.bar-chart-day.grow { transform: scaleY(1); }
.bar-chart-day { transform: scaleY(0); }

.empty-ash { color: #52525b; font-size: 14px; text-align: center; padding: 24px; }

@media (max-width: 900px) {
  body.chat-open .main { margin-right: 0; }
  .chat-panel { width: 100% !important; max-width: 100% !important; min-width: 0 !important; top: 48px; bottom: 72px; }
  .orbit-score-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .doom-meter-top .doom-value { font-size: 1.5rem !important; }
}
@media (max-width: 600px) {
  .overview-stats { grid-template-columns: 1fr !important; }
}

/* ========== DAY PLANNER ========== */
.day-planner-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.day-planner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0.03));
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.day-planner-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(124, 58, 237, 0.1), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.day-planner-date-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.day-planner-today-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 0;
}

.day-planner-full-date {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.day-planner-live-clock {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 15px var(--accent-glow);
  animation: clock-pulse 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes clock-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.day-planner-current-task {
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(124, 58, 237, 0.06));
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  animation: current-task-glow 3s ease-in-out infinite;
}

@keyframes current-task-glow {
  0%, 100% {
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.25), 0 0 50px rgba(124, 58, 237, 0.1);
  }
  50% {
    box-shadow: 0 0 35px rgba(124, 58, 237, 0.35), 0 0 70px rgba(124, 58, 237, 0.15);
  }
}

.day-planner-current-task::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.08), transparent);
  animation: shimmer 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.day-planner-up-next {
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(168, 85, 247, 0.04));
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.day-planner-up-next-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #a78bfa;
  margin-bottom: 8px;
}

.day-planner-up-next-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.day-planner-up-next-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.day-planner-current-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.day-planner-current-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.day-planner-current-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.day-planner-current-remaining {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* Timeline */
.day-planner-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.day-planner-timeline::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--border-color), var(--accent), var(--border-color));
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

.day-planner-task {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.day-planner-task:hover {
  border-color: var(--border-light);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.day-planner-task.completed {
  opacity: 0.4;
}

.day-planner-task.completed .day-planner-task-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.day-planner-task.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(124, 58, 237, 0.08));
  border-color: var(--accent);
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.25), 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: active-task-pulse 3s ease-in-out infinite;
}

.day-planner-task.upcoming {
  opacity: 0.7;
}

@keyframes active-task-pulse {
  0%, 100% {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.25), 0 8px 32px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.35), 0 8px 40px rgba(0, 0, 0, 0.5);
  }
}

.day-planner-task-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 60px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}

.day-planner-task-time::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 50%;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 10px var(--accent-glow);
  pointer-events: none;
  z-index: 0;
}

.day-planner-task.completed .day-planner-task-time::before {
  background: var(--text-muted);
  box-shadow: none;
}

.day-planner-task-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.day-planner-task-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.day-planner-task.active .day-planner-task-name {
  color: var(--accent);
  font-size: 17px;
}

.day-planner-task-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.day-planner-task-duration {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Bottom Actions */
.day-planner-bottom-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}

.day-planner-btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 20px var(--accent-glow);
}

.day-planner-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--accent-glow);
}

.day-planner-btn-primary svg {
  width: 18px;
  height: 18px;
}

.day-planner-btn-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-planner-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.day-planner-btn-secondary svg {
  width: 18px;
  height: 18px;
}

/* AI Generate Section */
.day-planner-ai-section {
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}

/* Override Modal */
.day-planner-form-info {
  padding: 12px 16px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.day-planner-form-info p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.day-planner-task-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.day-planner-task.active .day-planner-task-name {
  color: var(--accent);
  font-size: 18px;
}

.day-planner-task-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.day-planner-task-duration {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ========== WEEKLY TIMETABLE EDITOR ========== */
.weekly-timetable-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.weekly-timetable-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.weekly-timetable-content {
  background: linear-gradient(145deg, #0d0d0d 0%, #121212 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: min(1400px, 94vw);
  height: min(92vh, 950px);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  box-shadow: 0 0 80px rgba(124, 58, 237, 0.2), 0 0 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  position: relative;
}

.weekly-timetable-content::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(168, 85, 247, 0.1), rgba(124, 58, 237, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.weekly-timetable-modal.active .weekly-timetable-content {
  transform: scale(1);
}

/* Header Section */
.weekly-timetable-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0.03));
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.weekly-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.weekly-header-text h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin: 0 0 4px 0;
  text-shadow: 0 0 30px rgba(124, 58, 237, 0.3);
}

.weekly-header-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.weekly-timetable-close {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  pointer-events: auto;
  position: relative;
  z-index: 30;
  flex-shrink: 0;
}

.weekly-timetable-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.weekly-timetable-close svg {
  width: 22px;
  height: 22px;
}

/* Toolbar Section */
.weekly-timetable-toolbar {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.01);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 10;
}

.weekly-mode-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.weekly-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.weekly-tab svg {
  width: 16px;
  height: 16px;
}

.weekly-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.weekly-tab.active {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 0 20px var(--accent-glow);
}

.weekly-day-selector {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.weekly-day-btn {
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.weekly-day-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.weekly-day-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 0 15px var(--accent-glow);
}

/* Main Workspace Section */
.weekly-timetable-workspace {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.2);
}

.weekly-mode-panel {
  display: none;
  height: 100%;
  overflow: hidden;
}

.weekly-mode-panel.active {
  display: block;
}

/* Text Mode */
.weekly-text-workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: 100%;
}

.weekly-text-sidebar {
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.weekly-text-sidebar h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}

.weekly-syntax-examples {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.syntax-example {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.syntax-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.syntax-example code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: rgba(124, 58, 237, 0.1);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.weekly-text-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 120px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.preview-empty {
  color: var(--text-muted);
  font-style: italic;
}

.weekly-text-editor {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.weekly-text-input {
  width: 100%;
  height: 100%;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-mono);
  line-height: 1.8;
  resize: none;
  transition: all 0.2s ease;
}

.weekly-text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.weekly-text-input::placeholder {
  color: var(--text-muted);
}

/* Visual Mode */
.weekly-visual-workspace {
  height: 100%;
  padding: 24px 32px;
  overflow-y: auto;
}

.weekly-timeline-grid {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 500px;
  position: relative;
}

/* Blocks Mode */
.weekly-blocks-workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  height: 100%;
}

.weekly-blocks-library {
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.blocks-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.blocks-library-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.blocks-library-header .btn-icon {
  width: 32px;
  height: 32px;
}

.weekly-blocks-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.weekly-blocks-canvas {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.blocks-canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.blocks-canvas-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.blocks-canvas-actions {
  display: flex;
  gap: 8px;
}

.weekly-blocks-grid {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 400px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

/* Footer Section */
.weekly-timetable-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  pointer-events: auto;
}

.weekly-footer-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  position: relative;
  z-index: 30;
}

.weekly-footer-actions button {
  pointer-events: auto;
  position: relative;
  z-index: 30;
}

.weekly-btn-primary {
  padding: 12px 28px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 25px var(--accent-glow);
}

.weekly-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 35px var(--accent-glow);
}

.weekly-btn-secondary {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.weekly-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.weekly-btn-ai-generate {
  width: 100%;
  padding: 12px 20px;
  margin-top: 16px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.weekly-btn-ai-generate:hover {
  background: rgba(124, 58, 237, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

/* Timeline Tasks */
.weekly-timeline-task {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.weekly-timeline-task:hover {
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.08);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.15);
}

.weekly-task-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 600;
}

.weekly-task-name {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.day-planner-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.day-planner-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.day-planner-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.day-planner-modal-overlay.active .day-planner-modal {
  transform: scale(1);
}

.day-planner-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.day-planner-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.day-planner-modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-planner-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.day-planner-modal-close svg {
  width: 16px;
  height: 16px;
}

.day-planner-modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.day-planner-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-planner-form-row {
  display: flex;
  gap: 16px;
}

.day-planner-form-row .day-planner-form-group {
  flex: 1;
}

.day-planner-form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.day-planner-form-input,
.day-planner-form-textarea {
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.day-planner-form-input:focus,
.day-planner-form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

.day-planner-form-textarea {
  min-height: 80px;
  resize: vertical;
}

.day-planner-color-picker {
  display: flex;
  gap: 10px;
}

.day-planner-color-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-planner-color-btn:hover {
  transform: scale(1.1);
}

.day-planner-color-btn.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 10px currentColor;
}

.day-planner-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.day-planner-btn-primary,
.day-planner-btn-secondary {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.day-planner-btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 0 15px var(--accent-glow);
}

.day-planner-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.day-planner-btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.day-planner-btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--doom-danger);
  color: var(--doom-danger);
}

/* Mobile responsive for Day Planner */
@media (max-width: 768px) {
  .day-planner-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .day-planner-live-clock {
    font-size: 24px;
  }

  .day-planner-current-name {
    font-size: 18px;
  }

  .day-planner-day-selector {
    flex-wrap: wrap;
  }

  .day-planner-day-btn {
    min-width: calc(14.28% - 6px);
  }

  .day-planner-task {
    flex-direction: column;
    gap: 12px;
  }

  .day-planner-task-time {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .day-planner-task-time::before {
    display: none;
  }

  .day-planner-timeline::before {
    display: none;
  }

  .day-planner-modal {
    max-width: 95%;
    padding: 20px;
  }

  .day-planner-form-row {
    flex-direction: column;
    gap: 12px;
  }
}

/* ========== LETTER TO FUTURE SELF ========== */

.letter-reveal-overlay {
  position: fixed;
  inset: 0;
  background: #09090B;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: lr-fade 1.5s ease;
}

.lr-date {
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #3A3A45;
  margin-bottom: 32px;
  text-transform: uppercase;
}

.lr-intro {
  font-size: 13px;
  color: #7A7A88;
  margin-bottom: 24px;
  font-style: italic;
}

.lr-content {
  max-width: 560px;
  font-size: 15px;
  line-height: 1.9;
  color: #E8E4DC;
  text-align: center;
  animation: lr-lines 2s ease 0.5s both;
}

.lr-closer {
  margin-top: 48px;
  font-family: monospace;
  font-size: 11px;
  color: #7C6AFA;
  letter-spacing: 0.1em;
}

@keyframes lr-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lr-lines {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.letters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.letter-card {
  background: #0A0A0A;
  border: 1px solid #27272A;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.letter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.letter-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.letter-card-icon {
  font-size: 20px;
}

.letter-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #E8E4DC;
}

.letter-card-description {
  font-size: 14px;
  color: #7A7A88;
  margin-bottom: 16px;
}

.letter-card-reveal-date {
  font-size: 13px;
  color: #7C6AFA;
  margin-bottom: 12px;
}

.letter-card-progress {
  width: 100%;
  height: 8px;
  background: #27272A;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.letter-card-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #7C6AFA, #A78BFA);
  transition: width 0.3s ease;
}

.letter-card-days-left {
  font-size: 12px;
  color: #7A7A88;
  font-family: monospace;
}

.letter-card-locked {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #7A7A88;
  margin-top: 12px;
  font-style: italic;
}

.letter-write-card {
  background: #0A0A0A;
  border: 1px solid #27272A;
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.letter-write-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  border-color: #7C6AFA;
}

.letter-write-btn {
  width: 100%;
  padding: 12px;
  background: #7C6AFA;
  color: #E8E4DC;
}

/* Goal Type Selector Styles */
.modal-helper-text {
  font-size: 13px;
  color: #7A7A88;
  margin-bottom: 16px;
  line-height: 1.5;
}

.goal-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .goal-type-selector {
    grid-template-columns: 1fr;
  }
}

.goal-type-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: #0A0A0A;
  border: 1px solid #27272A;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.goal-type-option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(124, 58, 237, 0.08) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.goal-type-option:hover {
  transform: translateY(-2px);
  border-color: #3F3F46;
  background: #0F0F0F;
}

.goal-type-option:hover::before {
  opacity: 1;
}

.goal-type-option input[type="radio"] {
  display: none;
}

.goal-type-option:has(input[type="radio"]:checked) {
  border-color: #F97316;
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.15), 0 0 40px rgba(124, 58, 237, 0.08);
}

.goal-type-option:has(input[type="radio"]:checked)::before {
  opacity: 1;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(124, 58, 237, 0.12) 0%, transparent 60%);
}

.goal-type-icon {
  font-size: 28px;
  line-height: 1;
  transition: transform 0.3s ease;
}

.goal-type-option:hover .goal-type-icon {
  transform: scale(1.1);
}

.goal-type-option:has(input[type="radio"]:checked) .goal-type-icon {
  filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.6));
}

.goal-type-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goal-type-label {
  font-size: 15px;
  font-weight: 600;
  color: #FAFAFA;
  letter-spacing: -0.3px;
}

.goal-type-description {
  font-size: 13px;
  color: #71717A;
  line-height: 1.4;
}

.goal-type-option:has(input[type="radio"]:checked) .goal-type-label {
  color: #F97316;
}

.goal-type-option:has(input[type="radio"]:checked) .goal-type-description {
  color: #A1A1AA;
}

.field-helper-text {
  font-size: 12px;
  color: #7A7A88;
  margin-top: 4px;
  line-height: 1.4;
}

.goal-streak-display {
  font-size: 13px;
  color: #F97316;
  margin-top: 8px;
  font-weight: 500;
}

/* ========== DESTINY ONBOARDING CARD ========== */
.do-card {
  background: linear-gradient(135deg, rgba(12,9,20,0.97), rgba(20,10,35,0.93));
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.do-card[hidden] { display: none; }
/* Star-field bg */
.do-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 8% 18%, rgba(167,139,250,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 12%, rgba(167,139,250,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 42% 78%, rgba(167,139,250,0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 92% 65%, rgba(196,181,253,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 22% 92%, rgba(167,139,250,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 35%, rgba(167,139,250,0.35) 0%, transparent 100%);
  pointer-events: none;
}
.do-label {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(167,139,250,0.6);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.do-title {
  font-size: 15px;
  font-weight: 700;
  color: #e0d9ff;
  margin: 0 0 6px;
}
.do-desc {
  font-size: 12px;
  color: rgba(167,139,250,0.6);
  margin: 0 0 12px;
  line-height: 1.5;
}
.do-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.do-examples span {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: rgba(196,181,253,0.7);
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 4px;
  padding: 3px 8px;
}
.do-prompt {
  font-size: 11px;
  color: rgba(167,139,250,0.45);
  margin: 0 0 16px;
}
.do-templates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.do-template {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: rgba(124,58,237,0.07);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.do-template:hover {
  background: rgba(124,58,237,0.17);
  border-color: rgba(167,139,250,0.45);
  transform: translateY(-2px);
}
.do-template:active { transform: translateY(0); }
.do-template--wide {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-color: rgba(167,139,250,0.2);
  background: rgba(167,139,250,0.05);
}
.do-template--wide:hover {
  background: rgba(167,139,250,0.12);
  border-color: rgba(167,139,250,0.4);
}
.do-template-sub {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  color: rgba(167,139,250,0.45);
  letter-spacing: 0.06em;
  text-align: center;
  margin-top: 2px;
}
.do-template-icon { font-size: 22px; line-height: 1; }
.do-template-name {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #c4b5fd;
  letter-spacing: 0.04em;
  text-align: center;
}
.do-custom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(167,139,250,0.55);
  background: transparent;
  border: 1px dashed rgba(124,58,237,0.22);
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  position: relative;
  z-index: 1;
}
.do-custom:hover {
  color: #c4b5fd;
  border-color: rgba(124,58,237,0.4);
  background: rgba(124,58,237,0.06);
}

/* ========== DESTINY CREATED CELEBRATION MODAL ========== */
.dcm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dcm-overlay[hidden] { display: none; }
.dcm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,3,15,0.85);
  backdrop-filter: blur(4px);
}
.dcm-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(145deg, #0c0918, #140a23);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 60px rgba(124,58,237,0.2), 0 0 0 1px rgba(167,139,250,0.08);
  animation: dcm-appear 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes dcm-appear {
  from { opacity: 0; transform: scale(0.8) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.dcm-star-burst {
  display: block;
  font-size: 40px;
  color: #a78bfa;
  margin-bottom: 14px;
  animation: dcm-star-pulse 2.5s ease-in-out infinite;
}
@keyframes dcm-star-pulse {
  0%,100% { filter: drop-shadow(0 0 8px rgba(167,139,250,0.6)); }
  50%      { filter: drop-shadow(0 0 20px rgba(167,139,250,1)); }
}
.dcm-headline {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(167,139,250,0.55);
  text-transform: uppercase;
  margin: 0 0 10px;
}
.dcm-destiny-name {
  font-size: 22px;
  font-weight: 700;
  color: #e0d9ff;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}
.dcm-sub {
  font-size: 13px;
  color: rgba(167,139,250,0.6);
  margin: 0 0 26px;
  line-height: 1.5;
}
.dcm-cta {
  width: 100%;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: none;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(124,58,237,0.35);
  transition: box-shadow 0.2s, transform 0.15s;
}
.dcm-cta:hover {
  box-shadow: 0 0 32px rgba(124,58,237,0.6);
  transform: translateY(-1px);
}
@media (max-width: 480px) {
  .do-templates { grid-template-columns: 1fr 1fr; }
  .dcm-card { padding: 28px 20px; }
}

/* ========== QUEST ONBOARDING CARD ========== */
.qo-card {
  background: linear-gradient(135deg, rgba(9,12,20,0.97), rgba(10,18,35,0.93));
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.qo-card[hidden] { display: none; }
.qo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 15% 20%, rgba(167,139,250,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 15%, rgba(167,139,250,0.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(167,139,250,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 55%, rgba(167,139,250,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 85%, rgba(167,139,250,0.2) 0%, transparent 100%);
  pointer-events: none;
}
.qo-label {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(167,139,250,0.6);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.qo-chain {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.qo-chain-destiny {
  font-size: 11px;
  color: rgba(167,139,250,0.5);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.06em;
}
.qo-chain-arrow {
  font-size: 16px;
  color: rgba(124,58,237,0.5);
  line-height: 1;
}
.qo-chain-quest {
  font-size: 11px;
  color: rgba(167,139,250,0.9);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.06em;
}
.qo-title {
  font-size: 15px;
  font-weight: 700;
  color: #e0d9ff;
  margin: 0 0 12px;
  line-height: 1.4;
}
.qo-example {
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.qo-example-destiny {
  font-size: 11px;
  color: rgba(167,139,250,0.6);
  margin: 0 0 6px;
}
.qo-example-destiny strong {
  color: rgba(167,139,250,0.9);
  font-weight: 600;
}
.qo-example-quests {
  font-size: 11px;
  color: rgba(148,163,184,0.65);
  line-height: 1.8;
  margin: 0;
}
.qo-prompt {
  font-size: 11px;
  color: rgba(167,139,250,0.4);
  margin: 0 0 14px;
}
.qo-templates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.qo-template {
  background: rgba(124,58,237,0.07);
  border: 1px solid rgba(124,58,237,0.18);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 600;
  color: #c4b5fd;
  text-align: left;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  line-height: 1.4;
}
.qo-template:hover {
  background: rgba(124,58,237,0.17);
  border-color: rgba(167,139,250,0.45);
  transform: translateY(-1px);
}
.qo-template:active { transform: translateY(0); }
.qo-custom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(167,139,250,0.5);
  background: transparent;
  border: 1px dashed rgba(124,58,237,0.22);
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  position: relative;
  z-index: 1;
}
.qo-custom:hover {
  color: #c4b5fd;
  border-color: rgba(124,58,237,0.4);
  background: rgba(124,58,237,0.06);
}

/* ========== QUEST CREATED CELEBRATION MODAL ========== */
.qcm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9996;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qcm-overlay[hidden] { display: none; }
.qcm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,3,15,0.88);
  backdrop-filter: blur(4px);
}
.qcm-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(145deg, #0c0918, #140a23);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 60px rgba(124,58,237,0.2), 0 0 0 1px rgba(167,139,250,0.08);
  animation: qcm-appear 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes qcm-appear {
  from { opacity: 0; transform: scale(0.8) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.qcm-icon {
  display: block;
  font-size: 40px;
  color: #a78bfa;
  margin-bottom: 14px;
  animation: qcm-icon-pulse 2.5s ease-in-out infinite;
}
@keyframes qcm-icon-pulse {
  0%,100% { filter: drop-shadow(0 0 8px rgba(124,58,237,0.5)); }
  50%      { filter: drop-shadow(0 0 20px rgba(124,58,237,0.9)); }
}
.qcm-headline {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(167,139,250,0.55);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.qcm-quest-name {
  font-size: 20px;
  font-weight: 700;
  color: #e0d9ff;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}
.qcm-sub {
  font-size: 13px;
  color: rgba(167,139,250,0.6);
  margin: 0 0 26px;
  line-height: 1.6;
}
.qcm-cta {
  width: 100%;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: none;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(124,58,237,0.35);
  transition: box-shadow 0.2s, transform 0.15s;
}
.qcm-cta:hover {
  box-shadow: 0 0 32px rgba(124,58,237,0.6);
  transform: translateY(-1px);
}
@media (max-width: 480px) {
  .qo-templates { grid-template-columns: 1fr 1fr; }
  .qcm-card { padding: 28px 20px; }
}

/* ========== PATH CONNECTION ONBOARDING CARD ========== */
.poc-card {
  background: linear-gradient(135deg, rgba(9,12,20,0.97), rgba(10,18,35,0.93));
  border: 1px solid rgba(124,58,237,0.22);
  border-radius: 12px;
  padding: 20px 20px 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.poc-card[hidden] { display: none; }
.poc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(167,139,250,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 10%, rgba(167,139,250,0.18) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 80%, rgba(167,139,250,0.22) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 65%, rgba(167,139,250,0.14) 0%, transparent 100%);
  pointer-events: none;
}
.poc-label {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(167,139,250,0.6);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.poc-subtitle {
  font-size: 14px;
  color: rgba(224,224,255,0.88);
  line-height: 1.5;
  margin: 0 0 16px;
  font-weight: 500;
}
.poc-chain {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 18px;
  padding-left: 4px;
  position: relative;
  z-index: 1;
}
.poc-chain-node {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}
.poc-chain-icon {
  font-size: 12px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}
.poc-chain-text {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.poc-chain-line {
  width: 1px;
  height: 9px;
  background: rgba(124,58,237,0.45);
  margin-left: 8px;
  flex-shrink: 0;
}
.poc-chain-line--dim { background: rgba(124,58,237,0.15); }
.poc-chain-destiny .poc-chain-icon { color: rgba(167,139,250,0.9); }
.poc-chain-destiny .poc-chain-text { color: rgba(167,139,250,0.78); }
.poc-chain-quest .poc-chain-icon   { color: rgba(167,139,250,0.7); }
.poc-chain-quest .poc-chain-text   { color: rgba(167,139,250,0.6); }
.poc-chain-action                  { opacity: 0.38; }
.poc-chain-action .poc-chain-icon  { font-size: 9px; color: rgba(148,163,184,0.65); }
.poc-chain-action .poc-chain-text  { color: rgba(148,163,184,0.55); font-size: 9px; }
.poc-cta {
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(135deg, rgba(124,58,237,0.85), rgba(109,40,217,0.85));
  border: 1px solid rgba(167,139,250,0.28);
  border-radius: 8px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(224,224,255,0.95);
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
  box-shadow: 0 0 16px rgba(124,58,237,0.22);
}
.poc-cta:hover {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  box-shadow: 0 0 28px rgba(124,58,237,0.42);
  transform: translateY(-1px);
}
.poc-cta:active { transform: translateY(0); }

/* ========== LINK ACTION MODAL ========== */
.lam-overlay {
  position: fixed;
  inset: 0;
  z-index: 9994;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lam-overlay[hidden] { display: none; }
.lam-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,3,15,0.85);
  backdrop-filter: blur(4px);
}
.lam-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(145deg, #0c0918, #140a23);
  border: 1px solid rgba(124,58,237,0.32);
  border-radius: 14px;
  padding: 24px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 0 50px rgba(124,58,237,0.18);
  animation: lam-appear 0.3s cubic-bezier(0.34,1.4,0.64,1) both;
}
@keyframes lam-appear {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.lam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.lam-title {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(167,139,250,0.7);
  text-transform: uppercase;
}
.lam-close {
  background: none;
  border: none;
  color: rgba(167,139,250,0.35);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  transition: color 0.15s;
}
.lam-close:hover { color: rgba(167,139,250,0.8); }
.lam-hint {
  font-size: 13px;
  color: rgba(148,163,184,0.65);
  margin: 0 0 18px;
  line-height: 1.5;
}
.lam-field { margin-bottom: 14px; }
.lam-label {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(167,139,250,0.5);
  text-transform: uppercase;
  margin-bottom: 5px;
}
.lam-input,
.lam-select {
  width: 100%;
  background: rgba(12,9,20,0.9);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: rgba(224,224,255,0.9);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.lam-input:focus,
.lam-select:focus { border-color: rgba(124,58,237,0.55); }
.lam-input::placeholder { color: rgba(148,163,184,0.3); }
.lam-select option { background: #130f27; }
.lam-submit {
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: none;
  border-radius: 8px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(124,58,237,0.28);
  transition: box-shadow 0.15s, transform 0.12s;
}
.lam-submit:hover {
  box-shadow: 0 0 28px rgba(124,58,237,0.52);
  transform: translateY(-1px);
}
.lam-submit:active { transform: translateY(0); }

/* ========== PATH CONNECTED CELEBRATION MODAL ========== */
.pcm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9995;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pcm-overlay[hidden] { display: none; }
.pcm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,3,15,0.88);
  backdrop-filter: blur(4px);
}
.pcm-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(145deg, #0c0918, #140a23);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 60px rgba(124,58,237,0.22), 0 0 0 1px rgba(167,139,250,0.07);
  animation: pcm-appear 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes pcm-appear {
  from { opacity: 0; transform: scale(0.8) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.pcm-icon {
  display: block;
  font-size: 40px;
  margin-bottom: 14px;
  animation: pcm-icon-pulse 2.5s ease-in-out infinite;
}
@keyframes pcm-icon-pulse {
  0%,100% { filter: drop-shadow(0 0 6px rgba(124,58,237,0.4)); transform: scale(1); }
  50%     { filter: drop-shadow(0 0 18px rgba(124,58,237,0.85)); transform: scale(1.05); }
}
.pcm-headline {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(167,139,250,0.55);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.pcm-task-name {
  font-size: 18px;
  font-weight: 700;
  color: #e0d9ff;
  margin: 0 0 14px;
}
.pcm-body {
  font-size: 13px;
  color: rgba(148,163,184,0.7);
  line-height: 1.6;
  margin: 0 0 26px;
}
.pcm-body-em {
  display: block;
  margin-top: 6px;
  color: rgba(167,139,250,0.65);
  font-style: italic;
}
.pcm-cta {
  width: 100%;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: none;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(124,58,237,0.35);
  transition: box-shadow 0.2s, transform 0.15s;
}
.pcm-cta:hover {
  box-shadow: 0 0 32px rgba(124,58,237,0.6);
  transform: translateY(-1px);
}

/* ========== CONSTELLATION FIRST-LIGHT TRANSITION ========== */
.mcc-first-light {
  animation: mcc-first-light 0.6s ease both;
}
@keyframes mcc-first-light {
  0%   { opacity: 0.5; filter: brightness(0.5); }
  55%  { opacity: 1;   filter: brightness(1.4) drop-shadow(0 0 10px rgba(167,139,250,0.5)); }
  100% { opacity: 1;   filter: brightness(1); }
}

/* ========== FIRST STAR IGNITION MODAL ========== */
.fsm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9993;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fsm-overlay[hidden] { display: none; }
.fsm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(3px);
}
.fsm-card {
  position: relative;
  background: linear-gradient(160deg, #1a1030 0%, #0f0a20 100%);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 20px;
  padding: 36px 28px 28px;
  width: min(360px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  box-shadow: 0 0 60px rgba(124,58,237,0.25), 0 0 120px rgba(124,58,237,0.1);
  animation: fsm-appear 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
  overflow: hidden;
}
@keyframes fsm-appear {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.fsm-glow-ring {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167,139,250,0.3) 0%, rgba(124,58,237,0.08) 60%, transparent 100%);
  animation: fsm-ring-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes fsm-ring-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.7; }
  50%       { transform: translateX(-50%) scale(1.15); opacity: 1; }
}
.fsm-icon {
  font-size: 42px;
  line-height: 1;
  animation: fsm-icon-pulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(250,204,21,0.7));
}
@keyframes fsm-icon-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 12px rgba(250,204,21,0.7)); }
  50%       { transform: scale(1.12); filter: drop-shadow(0 0 24px rgba(250,204,21,0.95)); }
}
.fsm-headline {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: 0.02em;
}
.fsm-subtitle {
  font-size: 14px;
  color: rgba(167,139,250,0.9);
  margin: 0;
  line-height: 1.5;
}
.fsm-chain {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(167,139,250,0.15);
  border-radius: 12px;
  padding: 16px 24px;
  width: 100%;
}
.fsm-chain-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fsm-chain-icon { font-size: 16px; }
.fsm-chain-destiny { color: #a78bfa; }
.fsm-chain-quest   { color: #f59e0b; }
.fsm-chain-action  { color: #34d399; }
.fsm-chain-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.fsm-chain-arrow {
  font-size: 14px;
  color: rgba(167,139,250,0.5);
  line-height: 1;
}
.fsm-tagline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(167,139,250,0.55);
  margin: -6px 0 0;
}
.fsm-body {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  margin: 0;
}
.fsm-cta {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(124,58,237,0.35);
  transition: box-shadow 0.2s, transform 0.15s;
  margin-top: 4px;
}
.fsm-cta:hover {
  box-shadow: 0 0 32px rgba(124,58,237,0.6);
  transform: translateY(-1px);
}

/* ========== MCC STAR IGNITED ANIMATION ========== */
.mcc-star-ignited .mcc-star {
  animation: mcc-star-ignited-pulse 1.3s ease both;
}
.mcc-starmap-igniting .mcc-edge {
  animation: mcc-edge-brighten 1.3s ease both;
}
@keyframes mcc-star-ignited-pulse {
  0%   { filter: none; }
  35%  { filter: brightness(3) drop-shadow(0 0 12px rgba(167,139,250,1)); }
  70%  { filter: brightness(1.8) drop-shadow(0 0 6px rgba(167,139,250,0.5)); }
  100% { filter: brightness(1); }
}
@keyframes mcc-edge-brighten {
  0%   { stroke: rgba(124,58,237,0.22); }
  35%  { stroke: rgba(167,139,250,0.9); }
  100% { stroke: rgba(124,58,237,0.22); }
}

/* ========== ENERGY TOAST ========== */
.et-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(26,16,48,0.96);
  border: 1px solid rgba(167,139,250,0.35);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 24px rgba(124,58,237,0.3);
  min-width: 220px;
  animation: et-slide-in 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
  pointer-events: none;
}
.et-toast[hidden] { display: none; }
.et-toast.et-hiding {
  animation: et-slide-out 0.3s ease forwards;
}
@keyframes et-slide-in {
  from { opacity: 0; transform: translateX(24px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes et-slide-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(24px); }
}
.et-icon {
  font-size: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(250,204,21,0.6));
}
.et-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.et-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.et-sub {
  font-size: 12px;
  color: rgba(167,139,250,0.85);
  line-height: 1.3;
}

/* ========== PATH CONNECTED ONBOARDING MODAL (Phase 6) ========== */
.pco-overlay {
  position: fixed;
  inset: 0;
  z-index: 9993;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pco-overlay[hidden] { display: none; }
.pco-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(3px);
}
.pco-card {
  position: relative;
  background: linear-gradient(160deg, #0e1a2e 0%, #0a0f1e 100%);
  border: 1px solid rgba(99,179,237,0.25);
  border-radius: 20px;
  padding: 32px 28px 24px;
  width: min(340px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  box-shadow: 0 0 60px rgba(59,130,246,0.2), 0 0 120px rgba(99,179,237,0.08);
  animation: pco-appear 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes pco-appear {
  from { opacity: 0; transform: scale(0.88) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.pco-icon {
  font-size: 38px;
  line-height: 1;
  animation: pco-icon-pulse 2s ease-in-out infinite;
}
@keyframes pco-icon-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(99,179,237,0.5)); }
  50%       { filter: drop-shadow(0 0 18px rgba(99,179,237,0.9)); }
}
.pco-headline {
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: 0.02em;
}
.pco-chain {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(99,179,237,0.15);
  border-radius: 12px;
  padding: 14px 28px;
  width: 100%;
}
.pco-chain-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pco-chain-icon { font-size: 16px; }
.pco-chain-action  { color: #34d399; }
.pco-chain-quest   { color: #f59e0b; }
.pco-chain-destiny { color: #a78bfa; }
.pco-chain-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.pco-chain-arrow {
  font-size: 14px;
  color: rgba(99,179,237,0.5);
}
.pco-body {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin: 0;
  line-height: 1.55;
}
.pco-cta {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(59,130,246,0.3);
  transition: box-shadow 0.2s, transform 0.15s;
  margin-top: 4px;
}
.pco-cta:hover {
  box-shadow: 0 0 28px rgba(59,130,246,0.55);
  transform: translateY(-1px);
}

/* ========== MCC ENERGY ANIMATIONS (lighter — repeatable) ========== */
.mcc-star-energy .mcc-star {
  animation: mcc-star-energy-pulse 1s ease both;
}
.mcc-starmap-energy .mcc-edge {
  animation: mcc-edge-energy-pulse 1s ease both;
}
.mcc-drawer-progress-pulse {
  animation: mcc-progress-fill-glow 0.7s ease both;
}
@keyframes mcc-star-energy-pulse {
  0%   { filter: none; }
  30%  { filter: brightness(2) drop-shadow(0 0 8px rgba(167,139,250,0.75)); }
  100% { filter: brightness(1); }
}
@keyframes mcc-edge-energy-pulse {
  0%   { stroke: rgba(124,58,237,0.22); }
  30%  { stroke: rgba(167,139,250,0.65); }
  100% { stroke: rgba(124,58,237,0.22); }
}
@keyframes mcc-progress-fill-glow {
  0%   { filter: brightness(1); }
  40%  { filter: brightness(1.8) drop-shadow(0 0 5px rgba(167,139,250,0.6)); }
  100% { filter: brightness(1); }
}

/* ========== CONSTELLATION ONBOARDING OVERLAY (Step 0) ========== */
.co-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #0a0a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.co-overlay[hidden] { display: none; }

/* Star field — 20 individually positioned spans, stagger-revealed */
.co-star-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.co-star {
  position: absolute;
  border-radius: 50%;
  background: rgba(196, 181, 253, 0.7);
  opacity: 0;
  animation: co-star-appear 0.5s ease forwards;
}
/* 20 stars: unique position, size, and stagger delay */
.co-star:nth-child(1)  { width:2px;height:2px;top:8%;left:12%;animation-delay:0.1s; }
.co-star:nth-child(2)  { width:1px;height:1px;top:15%;left:34%;animation-delay:0.2s; }
.co-star:nth-child(3)  { width:2px;height:2px;top:6%;left:58%;animation-delay:0.3s; }
.co-star:nth-child(4)  { width:1px;height:1px;top:22%;left:80%;animation-delay:0.4s; }
.co-star:nth-child(5)  { width:3px;height:3px;top:35%;left:5%;animation-delay:0.5s;background:rgba(167,139,250,0.9); }
.co-star:nth-child(6)  { width:1px;height:1px;top:42%;left:90%;animation-delay:0.15s; }
.co-star:nth-child(7)  { width:2px;height:2px;top:55%;left:18%;animation-delay:0.35s; }
.co-star:nth-child(8)  { width:1px;height:1px;top:62%;left:45%;animation-delay:0.25s; }
.co-star:nth-child(9)  { width:2px;height:2px;top:70%;left:72%;animation-delay:0.45s; }
.co-star:nth-child(10) { width:1px;height:1px;top:80%;left:28%;animation-delay:0.55s; }
.co-star:nth-child(11) { width:2px;height:2px;top:88%;left:60%;animation-delay:0.1s; }
.co-star:nth-child(12) { width:1px;height:1px;top:93%;left:82%;animation-delay:0.3s; }
.co-star:nth-child(13) { width:3px;height:3px;top:12%;left:92%;animation-delay:0.6s;background:rgba(196,181,253,0.9); }
.co-star:nth-child(14) { width:1px;height:1px;top:29%;left:50%;animation-delay:0.4s; }
.co-star:nth-child(15) { width:2px;height:2px;top:48%;left:63%;animation-delay:0.2s; }
.co-star:nth-child(16) { width:1px;height:1px;top:75%;left:9%;animation-delay:0.5s; }
.co-star:nth-child(17) { width:2px;height:2px;top:18%;left:72%;animation-delay:0.35s; }
.co-star:nth-child(18) { width:1px;height:1px;top:85%;left:40%;animation-delay:0.15s; }
.co-star:nth-child(19) { width:3px;height:3px;top:4%;left:22%;animation-delay:0.45s;background:rgba(167,139,250,0.8); }
.co-star:nth-child(20) { width:1px;height:1px;top:96%;left:55%;animation-delay:0.25s; }

@keyframes co-star-appear {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* Central content */
.co-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  max-width: 440px;
  width: 100%;
}

/* Large orbit ring — 400px, slow rotation */
.co-orbit-ring {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 1px dashed rgba(124, 58, 237, 0.35);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: co-ring-spin 24s linear infinite;
  pointer-events: none;
}
/* Inner secondary ring for depth */
.co-orbit-ring::after {
  content: '';
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  border: 1px dashed rgba(124, 58, 237, 0.2);
  animation: co-ring-spin 18s linear infinite reverse;
}
@keyframes co-ring-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Overlay text */
.co-title {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  color: #e0d9ff;
  letter-spacing: 0.01em;
  margin: 0 0 10px;
  animation: co-fade-up 0.7s ease 0.6s both;
}
.co-subtitle {
  font-size: clamp(13px, 2vw, 16px);
  color: rgba(167, 139, 250, 0.7);
  margin: 0 0 36px;
  line-height: 1.5;
  animation: co-fade-up 0.7s ease 0.85s both;
}
@keyframes co-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.co-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: co-fade-up 0.7s ease 1.1s both;
}
.co-cta-primary {
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: none;
  border-radius: 8px;
  padding: 14px 32px;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.45);
  transition: box-shadow 0.2s, transform 0.15s;
}
.co-cta-primary:hover {
  box-shadow: 0 0 36px rgba(124, 58, 237, 0.7);
  transform: translateY(-1px);
}
.co-cta-skip {
  font-size: 12px;
  color: rgba(167, 139, 250, 0.45);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
  letter-spacing: 0.04em;
}
.co-cta-skip:hover { color: rgba(167, 139, 250, 0.75); }

@media (max-width: 480px) {
  .co-orbit-ring { width: 260px; height: 260px; }
  .co-cta-primary { padding: 12px 24px; font-size: 13px; }
}

/* ============================================================
   FULL CONSTELLATION SCREEN (Phase 7B)
   Reuses the prototype visual language: void · nebula · grain
   layered glow · cool→violet→gold state light
   ============================================================ */
#screen-constellation{ padding:0 !important; }
.cst-stage{
  position:relative;
  width:100%;
  height:calc(100vh - 130px);
  min-height:520px;
  border-radius:18px;
  overflow:hidden;
  /* Force a stacking context so composited CSS-transformed SVG children
     (e.g. #cst-camera) are clipped by this element's overflow on WebKit */
  isolation:isolate;
  -webkit-transform-style:flat; transform-style:flat;
  background:#05050A;
  --cst-ember:#8A93BE; --cst-ember-deep:#5A6488;
  --cst-violet:#A78BFA; --cst-violet-deep:#7C3AED;
  --cst-gold:#F5D98B; --cst-gold-hot:#FFF4D6; --cst-anchor:#FFF6E0;
  --cst-label:rgba(236,236,246,0.86); --cst-label-2:rgba(176,170,210,0.6); --cst-label-3:rgba(176,170,210,0.4);
}
/* Photographic nebula background (Phase 7L) — real image composited under the SVG.
   Falls back to .cst-stage's flat #05050A if the image 404s. */
.cst-nebula-bg{
  position:absolute;inset:0;z-index:0;pointer-events:none;
  background:url('/assets/nebula.jpg') center/cover no-repeat;
  filter:brightness(0.60) saturate(1.20) contrast(1.05) hue-rotate(-8deg);
}
/* Tonal grade + edge vignette — unifies the photo so white text/stars read on top */
.cst-nebula-grade{
  position:absolute;inset:0;z-index:1;pointer-events:none;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(5,5,12,0) 38%, rgba(5,5,12,0.55) 100%),
    linear-gradient(180deg, rgba(10,8,26,0.32) 0%, rgba(5,5,12,0.22) 100%);
}
/* Deep-space universe — layered cosmic painting (~40% dark / 60% color) */
/* Layer 1 — flattened to solid base; the photo now provides all color (Phase 7L) */
.cst-void{
  position:absolute;inset:0;z-index:0;
  background:#05050A;
}
/* Layer 2 — disabled (Phase 7L): photo replaces the procedural nebula fog */
.cst-nebula{ display:none; }
/* Layer 2b — bright diffuse energy cores (star nurseries / supernova clouds) */
.cst-nebula::before{
  content:'';position:absolute;inset:0;
  background:
    radial-gradient(24% 28% at 30% 34%, rgba(180,225,255,0.32) 0%, transparent 68%),
    radial-gradient(26% 30% at 75% 38%, rgba(255,168,228,0.28) 0%, transparent 70%),
    radial-gradient(28% 30% at 58% 70%, rgba(255,210,140,0.26) 0%, transparent 70%),
    radial-gradient(20% 24% at 16% 72%, rgba(150,255,238,0.20) 0%, transparent 68%);
  animation:cstCoreBreathe 19s ease-in-out infinite;
}
/* Layer 2c — luminous gas fronts / bright cloud edges (white/gold/cyan) */
.cst-nebula::after{
  content:'';position:absolute;inset:0;
  background:
    radial-gradient(circle at 28% 36%, transparent 19%, rgba(190,235,255,0.12) 26%, transparent 37%),
    radial-gradient(circle at 73% 41%, transparent 21%, rgba(255,255,255,0.10) 27%, transparent 39%),
    radial-gradient(circle at 58% 70%, transparent 23%, rgba(255,224,150,0.13) 30%, transparent 43%),
    radial-gradient(circle at 16% 74%, transparent 17%, rgba(170,255,245,0.10) 24%, transparent 36%),
    radial-gradient(circle at 88% 80%, transparent 22%, rgba(214,180,255,0.10) 29%, transparent 41%);
  filter:blur(6px);
}
@keyframes cstNebulaBreathe{0%,100%{opacity:0.86;}50%{opacity:1;}}
@keyframes cstCoreBreathe{0%,100%{opacity:0.62;}50%{opacity:1;}}
/* Layer 2d — disabled (Phase 7L): photo provides cloud structure now */
.cst-nebula-tex{ display:none; }
/* Layer 5 — very faint cosmic dust, drifting extremely slowly */
.cst-cosmic-dust{position:absolute;inset:-24px;z-index:1;pointer-events:none;overflow:hidden;filter:blur(1.5px);}
.cst-dust-mote{position:absolute;border-radius:50%;animation:cstMoteDrift 90s linear infinite alternate;}
@keyframes cstMoteDrift{from{transform:translate3d(0,0,0);}to{transform:translate3d(-20px,14px,0);}}
/* Star field depth tiers: far (sm) · mid (md) · near (glowing) + twinkle */
.cst-starfield{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden;}
.cst-stars-sm,.cst-stars-md,.cst-stars-near,.cst-stars-giant{position:absolute;top:0;left:0;border-radius:50%;background:transparent;}
.cst-stars-sm{width:1px;height:1px;opacity:0.9;}
.cst-stars-md{width:1.7px;height:1.7px;}
.cst-stars-near{width:2.3px;height:2.3px;}
.cst-stars-giant{width:2.6px;height:2.6px;}
.cst-cluster-knot{position:absolute;width:1px;height:1px;border-radius:50%;background:transparent;}
.cst-twinkle-star{position:absolute;border-radius:50%;background:#fff;animation:cstTwinkle 4s ease-in-out infinite;}
@keyframes cstTwinkle{0%,100%{opacity:0.22;}50%{opacity:1;}}
/* Occasional elegant shooting stars (GPU transform + opacity only) */
.cst-shoot{position:absolute;width:92px;height:1.6px;border-radius:1px;opacity:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,0.9));
  animation-name:cstShoot;animation-timing-function:ease-in;animation-iteration-count:infinite;will-change:transform,opacity;}
@keyframes cstShoot{
  0%,4%   {opacity:0;transform:rotate(30deg) translateX(-50px);}
  6%      {opacity:0.9;}
  11%     {opacity:0.9;transform:rotate(30deg) translateX(250px);}
  14%,100%{opacity:0;transform:rotate(30deg) translateX(320px);}
}
/* Celestial signatures + territory identity (Phase 7C-B) — purely ambient */
.cst-territory,.cst-sig{pointer-events:none;}
/* Territory auras fade in universe view and fade out in focus so the
   1.95× scale-up doesn't balloon over the nebula photo */
.cst-territory,
.cst-territory-inner { transition: opacity 0.45s ease; }
.cst-stage.focused .cst-territory,
.cst-stage.focused .cst-territory-inner { opacity: 0 !important; transition: opacity 0.45s ease; }
.cst-sig-blur{filter:blur(6px);}
.cst-grain{
  position:absolute;inset:0;z-index:6;pointer-events:none;
  opacity:0.05;mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cst-sky{position:absolute;inset:0;z-index:3;width:100%;height:100%;display:block;}
#cst-camera{ transition:transform 0.75s cubic-bezier(0.22,1,0.36,1); }

/* edges — luminous white-violet lines with an outer glow, readable over nebula */
.cst-edge{ stroke:rgba(206,198,255,0.55); stroke-width:1.6; fill:none; stroke-linecap:round;
  transition:stroke 0.6s ease; filter:drop-shadow(0 0 2.5px rgba(168,150,255,0.6)); }
.cst-edge.active{ stroke:rgba(255,255,255,0.70); stroke-width:1.9; animation:cstEdgeBreathe 3s ease-in-out infinite; }
.cst-edge.completed{ stroke:rgba(255,238,188,0.78); stroke-width:1.7; filter:drop-shadow(0 0 3px rgba(255,222,150,0.6)); }
@keyframes cstEdgeBreathe{0%,100%{stroke:rgba(255,255,255,0.55);}50%{stroke:rgba(255,255,255,0.90);}}

/* stars (layered glow via stacked circles) — the heroes of the screen */
.cst-star{cursor:pointer;outline:none;}
.cst-star:focus,.cst-star:focus-visible{outline:none;}
.cst-star .cst-hit{fill:transparent;}
.cst-star .cst-haze{filter:blur(16px);}
.cst-star .cst-bloom{filter:blur(6px);}
.cst-star .cst-ring{fill:none;opacity:0;transition:opacity 0.5s ease;}
/* thin crisp orbit outline per anchor (Phase 7L) — no glow, full inline control */
.cst-star .cst-orbit-ring{filter:none;}
/* crisp white inner core on every star */
.cst-star .cst-core-hot{fill:#ffffff;opacity:0.95;}
.cst-star.dormant .cst-core-hot{opacity:0.7;}

.cst-star.dormant .cst-core{fill:var(--cst-ember);}
.cst-star.dormant .cst-bloom{fill:var(--cst-ember-deep);opacity:0.4;}
.cst-star.dormant .cst-haze{fill:#9aa6e0;opacity:0.2;}

.cst-star.active .cst-core{fill:#F0EAFF;}
.cst-star.active .cst-bloom{fill:var(--cst-violet);opacity:0.85;animation:cstBreatheA 3s ease-in-out infinite;}
.cst-star.active .cst-haze{fill:var(--cst-violet);opacity:0.46;animation:cstBreatheA 3s ease-in-out infinite;}

/* completed stars read through glow, not a ring (Phase 7E removed halo ring) */
.cst-star.completed .cst-core{fill:var(--cst-gold-hot);}
.cst-star.completed .cst-bloom{fill:#FFE9B0;opacity:1;}
.cst-star.completed .cst-haze{fill:var(--cst-gold);opacity:0.62;}

/* anchor (Destiny) — brightest: white core, gold/white bloom, wide glow */
.cst-star.anchor .cst-core{fill:#ffffff;}
.cst-star.anchor .cst-core-hot{opacity:1;}
.cst-star.anchor .cst-bloom{fill:#FFEFC2;opacity:1;animation:cstBreatheSlow 4.6s ease-in-out infinite;}
.cst-star.anchor .cst-haze{fill:#FFE6A0;opacity:0.66;animation:cstBreatheSlow 4.6s ease-in-out infinite;}
.cst-star.anchor .cst-coreWrap{filter:drop-shadow(0 0 6px rgba(255,255,255,0.85)) drop-shadow(0 0 14px rgba(255,224,150,0.7));}
.cst-star:not(.anchor) .cst-coreWrap{filter:drop-shadow(0 0 4px rgba(255,255,255,0.6));}

@keyframes cstBreatheSlow{0%,100%{opacity:0.72;}50%{opacity:1;}}
@keyframes cstBreatheA{0%,100%{opacity:0.55;}50%{opacity:0.9;}}
/* Mobile-lite: last discovered idle-load contributor (2 per anchor, scales
   with destiny count) — disable the breathe pulse entirely, static glow
   instead. :not(.flare) so the one-shot focus flare below is unaffected.
   Desktop keeps the breathe animation fully unchanged. */
.cst-stage.cst-mobile-lite .cst-star.anchor:not(.flare) .cst-bloom,
.cst-stage.cst-mobile-lite .cst-star.anchor:not(.flare) .cst-haze{ animation:none; }
.cst-star .cst-coreWrap{transform-box:fill-box;transform-origin:center;}

/* anchor flare on focus */
.cst-star.anchor.flare .cst-core{animation:cstFlareCore 1.1s ease;}
.cst-star.anchor.flare .cst-bloom{animation:cstFlareBloom 1.1s ease;}
@keyframes cstFlareCore{0%{transform:scale(1);}35%{transform:scale(1.5);}100%{transform:scale(1);}}
@keyframes cstFlareBloom{0%{opacity:0.6;}35%{opacity:1;filter:blur(8px);}100%{opacity:0.8;}}

/* energy spark (reused by orbit:linkedTaskCompleted) */
.cst-star.energy .cst-core{animation:cstEnergyPulse 1s ease both;}
@keyframes cstEnergyPulse{0%{filter:none;}30%{filter:brightness(2) drop-shadow(0 0 8px rgba(167,139,250,0.75));}100%{filter:brightness(1);}}

/* selection / sub-dim — selection ring is CIRCULAR (never a square focus box) */
.cst-constellation.has-selection .cst-star:not(.cst-selected){opacity:0.4;transition:opacity 0.4s ease;}
.cst-star.cst-selected .cst-ring{stroke:rgba(167,139,250,0.9);stroke-width:1.4;opacity:1;animation:cstSelPulse 1.3s ease-in-out infinite;}
/* keyboard focus shows the same circular ring, not the browser's square outline */
.cst-star:focus-visible .cst-ring{stroke:rgba(206,196,255,0.9);stroke-width:1.4;opacity:1;}
#cst-sky:focus,#cst-sky:focus-visible,#cst-camera:focus,#cst-camera *:focus{outline:none;}
@keyframes cstSelPulse{0%,100%{opacity:0.6;transform:scale(1);}50%{opacity:1;transform:scale(1.18);}}

/* Depth of field on sibling constellations — opacity-only on BOTH platforms.
   Animating filter:blur forces re-rasterization every frame, and worse, the
   dimmed group sits inside #cst-camera which scales 1.95x during the zoom, so
   even a static blur would recomposite each frame of the transition. This was
   throttled to opacity-only on mobile long ago; desktop kept the animated
   blur (blur 2.5px + a 0.7s filter transition) until now — the single most
   expensive op during the focus zoom. opacity:0.16 alone gives ample depth
   separation. Scoped to .focused, so the idle universe view is unaffected. */
.cst-constellation{transition:opacity 0.7s ease;}
.cst-stage.focused .cst-constellation.cst-dimmed{opacity:0.16;}

/* labels — always readable above the bright nebula */
.cst-label{font-family:'Inter',system-ui,sans-serif;font-size:13px;font-weight:500;letter-spacing:0.03em;fill:#ffffff;text-anchor:middle;pointer-events:none;
  text-shadow:0 0 20px rgba(255,255,255,0.35), 0 1px 5px rgba(0,0,0,0.7);}
.cst-label.meta{font-size:10px;fill:var(--cst-label-3);letter-spacing:0.12em;text-transform:uppercase;}
.cst-label.anchor-label{font-size:15px;font-weight:600;fill:#ffffff;
  text-shadow:0 0 20px rgba(255,255,255,0.45), 0 1px 6px rgba(0,0,0,0.8);}
.cst-anchor-sub{font-size:10px;fill:rgba(255,255,255,0.72);letter-spacing:0.1em;
  text-shadow:0 0 14px rgba(255,255,255,0.3), 0 1px 4px rgba(0,0,0,0.75);}
/* universe: show only destiny labels; focus: reveal quest labels */
.cst-quest-label{opacity:0;transform:translateY(5px);transition:opacity 0.45s ease,transform 0.45s ease;}
.cst-stage.focused .cst-constellation:not(.cst-dimmed) .cst-quest-label{opacity:1;transform:translateY(0);}

/* hint — fixed to the viewport so the stage's overflow clip can never crop it;
   always kept 48px+ above the browser edge / mobile nav / safe area */
.cst-hint{
  position:fixed;left:50%;bottom:calc(48px + env(safe-area-inset-bottom, 0px));transform:translateX(-50%);z-index:7;
  font-size:13px;font-weight:300;letter-spacing:0.1em;color:var(--cst-label-2);
  text-align:center;max-width:90vw;padding:6px 16px;white-space:nowrap;
  text-shadow:0 1px 10px rgba(0,0,0,0.6);
  animation:cstHintBreathe 3s ease-in-out infinite;transition:opacity 0.5s ease;pointer-events:none;
}
@keyframes cstHintBreathe{0%,100%{opacity:0.5;}50%{opacity:0.85;}}
.cst-stage.focused .cst-hint{opacity:0;}
/* decorative scroll chevron under the hint (Phase 7L) — purely ornamental */
.cst-scroll-hint{
  position:fixed;left:50%;bottom:calc(28px + env(safe-area-inset-bottom, 0px));transform:translateX(-50%);z-index:7;
  font-size:18px;line-height:1;color:var(--cst-label-3);pointer-events:none;
  text-shadow:0 1px 8px rgba(0,0,0,0.6);transition:opacity 0.5s ease;
  animation:cstHintBreathe 3s ease-in-out infinite;
}
.cst-stage.focused .cst-scroll-hint{opacity:0;}

/* back button */
.cst-back{
  position:absolute;top:18px;left:18px;z-index:8;
  display:flex;align-items:center;gap:6px;
  background:rgba(20,20,30,0.5);border:1px solid rgba(167,139,250,0.18);
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
  color:var(--cst-label);font-size:13px;font-weight:500;letter-spacing:0.02em;
  padding:9px 16px;border-radius:100px;cursor:pointer;
  opacity:1;transform:translateX(0);pointer-events:auto;
  transition:opacity 0.4s ease,transform 0.4s ease,background 0.2s;
}
.cst-back:hover{background:rgba(30,30,44,0.7);}
.cst-stage.focused .cst-back{opacity:1;transform:translateX(0);pointer-events:auto;}

/* empty state */
.cst-empty{
  position:absolute;inset:0;z-index:8;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:24px;
}
.cst-empty[hidden]{display:none;}
.cst-empty-icon{font-size:38px;color:var(--cst-gold);filter:drop-shadow(0 0 14px rgba(245,217,139,0.5));}
.cst-empty-title{font-family:'Cormorant Garamond',Georgia,serif;font-size:30px;color:#fff;}
.cst-empty-sub{font-size:14px;color:var(--cst-label-2);}
.cst-empty-cta{margin-top:10px;padding:12px 24px;border-radius:100px;border:none;cursor:pointer;
  font-size:14px;font-weight:600;color:#fff;background:linear-gradient(135deg,var(--cst-violet-deep),#6d28d9);
  box-shadow:0 0 18px rgba(124,58,237,0.35);transition:transform 0.15s,box-shadow 0.2s;}
.cst-empty-cta:hover{transform:translateY(-1px);box-shadow:0 0 28px rgba(124,58,237,0.55);}

/* destiny side panel */
.cst-panel{
  position:absolute;top:0;right:0;bottom:0;z-index:9;
  width:320px;max-width:84%;
  padding:72px 30px 30px;
  display:flex;flex-direction:column;gap:18px;
  background:rgba(13,17,23,0.95);
  border-left:1px solid rgba(255,255,255,0.08);
  box-shadow:inset 1px 0 0 rgba(255,255,255,0.04);
  -webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);
  transform:translateX(110%);transition:transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.cst-panel.open{transform:translateX(0);}
.cst-panel-eyebrow{font-size:10px;letter-spacing:0.15em;text-transform:uppercase;color:#FFB830;font-weight:600;padding-bottom:8px;border-bottom:1px solid rgba(255,183,48,0.2);}
.cst-panel-title{font-family:'Cormorant Garamond',Georgia,serif;font-weight:500;font-size:36px;line-height:1.06;color:#fff;}
.cst-panel-aspiration{font-size:13.5px;font-weight:300;line-height:1.6;color:var(--cst-label-2);}
.cst-panel-written{display:flex;align-items:baseline;gap:10px;margin-top:2px;}
.cst-panel-pct{font-family:'Cormorant Garamond',Georgia,serif;font-size:50px;font-weight:400;color:var(--cst-gold);line-height:1;}
.cst-panel-written-label{font-size:11px;letter-spacing:0.2em;text-transform:uppercase;color:var(--cst-label-3);}
.cst-panel-bar{height:3px;border-radius:3px;background:rgba(255,255,255,0.08);overflow:hidden;}
.cst-panel-bar > i{display:block;height:100%;width:0%;border-radius:3px;background:linear-gradient(90deg,var(--cst-violet),var(--cst-gold));box-shadow:0 0 12px rgba(245,217,139,0.4);transition:width 0.6s ease;}
.cst-panel-meta{display:flex;gap:22px;font-size:12px;color:var(--cst-label-2);}
.cst-panel-meta b{color:var(--cst-label);font-weight:600;}
.cst-panel-energy{display:inline-flex;gap:4px;align-items:center;}
.cst-panel-energy span{width:7px;height:7px;border-radius:50%;background:var(--cst-violet);box-shadow:0 0 6px var(--cst-violet-deep);}
.cst-panel-energy span.off{background:rgba(255,255,255,0.12);box-shadow:none;}
.cst-panel-foot{margin-top:auto;font-size:11px;font-weight:300;font-style:italic;color:rgba(255,255,255,0.35);line-height:1.6;}

/* quest drawer */
.cst-drawer-backdrop{position:absolute;inset:0;z-index:10;background:rgba(4,4,9,0.42);opacity:0;pointer-events:none;transition:opacity 0.35s ease;}
.cst-drawer-backdrop.open{opacity:1;pointer-events:auto;}
.cst-drawer{
  position:absolute;top:0;right:0;bottom:0;z-index:11;
  width:360px;max-width:88%;
  padding:26px 26px 24px;
  display:flex;flex-direction:column;gap:16px;
  background:linear-gradient(200deg, rgba(22,18,38,0.94) 0%, rgba(10,10,18,0.97) 100%);
  border-left:1px solid rgba(167,139,250,0.18);
  -webkit-backdrop-filter:blur(22px);backdrop-filter:blur(22px);
  transform:translateX(110%);transition:transform 0.42s cubic-bezier(0.34,1.4,0.64,1);
  box-shadow:-30px 0 80px rgba(0,0,0,0.4);
}
.cst-drawer.open{transform:translateX(0);}
.cst-drawer-header{display:flex;flex-wrap:wrap;align-items:flex-start;gap:4px 10px;position:relative;}
.cst-drawer-eyebrow{flex-basis:100%;font-size:10px;letter-spacing:0.24em;text-transform:uppercase;color:var(--cst-violet);}
.cst-drawer-quest-title{font-family:'Cormorant Garamond',Georgia,serif;font-size:26px;font-weight:500;color:#fff;line-height:1.1;padding-right:30px;}
.cst-drawer-close{position:absolute;top:0;right:0;background:none;border:none;color:var(--cst-label-3);font-size:22px;cursor:pointer;line-height:1;}
.cst-drawer-close:hover{color:var(--cst-label);}
.cst-drawer-progress{display:flex;align-items:center;gap:10px;}
.cst-drawer-progress-bar{flex:1;height:4px;border-radius:4px;background:rgba(255,255,255,0.08);overflow:hidden;}
.cst-drawer-progress-fill{height:100%;border-radius:4px;background:linear-gradient(90deg,var(--cst-violet-deep),var(--cst-violet));box-shadow:0 0 10px rgba(167,139,250,0.5);transition:width 0.6s ease;}
.cst-drawer-progress-pct{font-size:12px;color:var(--cst-label-2);min-width:34px;text-align:right;}
.cst-drawer-section{font-size:10px;letter-spacing:0.2em;text-transform:uppercase;color:var(--cst-label-3);}
.cst-task-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;overflow-y:auto;}
.cst-task-list .mcc-task-item{display:flex;align-items:center;gap:10px;padding:11px 13px;border-radius:11px;background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.05);font-size:13.5px;color:var(--cst-label);}
.cst-task-list .mcc-task--done{color:var(--cst-label-3);text-decoration:line-through;text-decoration-color:rgba(255,255,255,0.2);}
.cst-task-list .mcc-task-check{color:var(--cst-violet);}
.cst-task-list .mcc-no-tasks{padding:14px;font-size:13px;color:var(--cst-label-3);text-align:center;}
.cst-drawer-footer{margin-top:auto;}
.cst-open-quest-btn{width:100%;padding:13px;border-radius:11px;border:none;cursor:pointer;font-size:13.5px;font-weight:600;color:#fff;background:linear-gradient(135deg,var(--cst-violet-deep),#6d28d9);box-shadow:0 0 18px rgba(124,58,237,0.35);transition:transform 0.15s,box-shadow 0.2s;}
.cst-open-quest-btn:hover{transform:translateY(-1px);box-shadow:0 0 28px rgba(124,58,237,0.55);}

@media (max-width:760px){
  .cst-stage{height:calc(100vh - 150px);}
  /* keep the helper text above the mobile bottom navigation + safe area */
  .cst-hint{bottom:calc(92px + env(safe-area-inset-bottom, 0px));white-space:normal;}
  .cst-panel{width:100%;height:auto;max-height:70vh;overflow-y:auto;top:auto;bottom:0;border-left:none;border-top:1px solid rgba(167,139,250,0.12);border-radius:16px 16px 0 0;transform:translateY(110%);padding:24px;}
  .cst-panel.open{transform:translateY(0);}
  /* drag-handle affordance — purely decorative, no interaction logic */
  .cst-panel::before{content:'';position:absolute;top:10px;left:50%;transform:translateX(-50%);width:36px;height:4px;border-radius:2px;background:rgba(255,255,255,0.25);pointer-events:none;}
  .cst-drawer{width:100%;height:72%;top:auto;bottom:0;border-left:none;border-top:1px solid rgba(167,139,250,0.18);border-radius:20px 20px 0 0;transform:translateY(110%);}
  .cst-drawer.open{transform:translateY(0);}
}

/* ===== Immersive chrome — ONLY on the Constellation screen (Phase 7G/H) =====
   Scoped with :has() so every other screen keeps its solid shell. On the
   Constellation screen the deep-space layers become a fixed, full-viewport
   backdrop at negative z-index, so the galaxy floats behind the whole UI and
   bleeds through the glass header + sidebar. The interactive constellation SVG
   stays clipped to its content-area stage, so positioning/logic is unchanged. */
.app-body:has(#screen-constellation.active) .main-content{ padding:0; overflow:hidden; background:transparent; }
.app-body:has(#screen-constellation.active) .main{ background:transparent; }
.app-body:has(#screen-constellation.active) #screen-constellation .cst-stage{
  height:calc(100vh - 64px); min-height:480px; border-radius:0; background:transparent;
}
/* deep-space layers → fixed full-viewport, behind the app chrome */
.app-body:has(#screen-constellation.active) .cst-void{ position:fixed; inset:0; z-index:-5; }
.app-body:has(#screen-constellation.active) .cst-nebula{ position:fixed; inset:-14%; z-index:-4; }
.app-body:has(#screen-constellation.active) .cst-nebula-tex{ position:fixed; inset:0; z-index:-4; }
.app-body:has(#screen-constellation.active) .cst-cosmic-dust{ position:fixed; inset:-24px; z-index:-4; }
.app-body:has(#screen-constellation.active) .cst-starfield{ position:fixed; inset:0; z-index:-3; }
/* glass header — galaxy/stars visibly bleed beneath it */
.app-body:has(#screen-constellation.active) .main-header{
  position:relative; z-index:6; border-bottom-color:transparent;
  background:linear-gradient(180deg, rgba(6,6,14,0.32) 0%, rgba(6,6,14,0.10) 60%, rgba(6,6,14,0) 100%);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
}
.app-body:has(#screen-constellation.active) .main-title,
.app-body:has(#screen-constellation.active) .main-subtitle{ text-shadow:0 1px 10px rgba(0,0,0,0.55); }
/* true cosmic glass sidebar — galaxy colours show through */
.app-body:has(#screen-constellation.active) .sidebar{
  background:rgba(8,8,20,0.22);
  -webkit-backdrop-filter:blur(22px) saturate(1.2); backdrop-filter:blur(22px) saturate(1.2);
  border-right-color:rgba(150,140,220,0.14);
}
.app-body:has(#screen-constellation.active) .sidebar-scroll-fade{ background:none; }

/* ===== Onboarding finale overlay — "destiny written" (over the focused destiny) ===== */
.dwm-overlay{position:fixed;inset:0;z-index:9990;display:flex;align-items:center;justify-content:center;}
.dwm-overlay[hidden]{display:none;}
.dwm-vignette{position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(ellipse at center, transparent 26%, rgba(3,3,10,0.5) 100%);
  animation:dwmFade 1s ease both;}
.dwm-card{position:relative;text-align:center;max-width:460px;padding:0 32px;
  display:flex;flex-direction:column;align-items:center;gap:18px;
  animation:dwmRise 1s cubic-bezier(0.22,1,0.36,1) both;}
.dwm-icon{font-size:36px;color:#F5D98B;animation:dwmIconPulse 3s ease-in-out infinite;}
.dwm-title{font-family:'Cormorant Garamond',Georgia,serif;font-weight:500;font-size:33px;line-height:1.18;color:#fff;
  text-shadow:0 0 30px rgba(255,255,255,0.3), 0 2px 14px rgba(0,0,0,0.6);}
.dwm-body{font-size:15px;font-weight:300;line-height:1.6;color:rgba(236,236,246,0.85);
  text-shadow:0 1px 10px rgba(0,0,0,0.7);}
.dwm-cta{margin-top:10px;padding:13px 30px;border-radius:100px;cursor:pointer;
  border:1px solid rgba(245,217,139,0.4);
  background:linear-gradient(135deg, rgba(124,58,237,0.55), rgba(109,40,217,0.55));
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  color:#fff;font-size:14px;font-weight:600;letter-spacing:0.04em;
  box-shadow:0 0 24px rgba(124,58,237,0.4);transition:transform 0.15s,box-shadow 0.2s;}
.dwm-cta:hover{transform:translateY(-1px);box-shadow:0 0 38px rgba(124,58,237,0.62);}
@keyframes dwmFade{from{opacity:0;}to{opacity:1;}}
@keyframes dwmRise{from{opacity:0;transform:translateY(26px);}to{opacity:1;transform:translateY(0);}}
@keyframes dwmIconPulse{0%,100%{filter:drop-shadow(0 0 14px rgba(245,217,139,0.6));}50%{filter:drop-shadow(0 0 28px rgba(245,217,139,0.95));}}

/* While the onboarding finale overlay is open, dim the constellation labels
   underneath so the overlay copy is always readable. */
.app-body:has(#destiny-written-modal:not([hidden])) .cst-label{
  opacity:0.1 !important; transition:opacity 0.4s ease;
}
