/* Constella prototype: shell styles. System fonts only, no external assets. */

:root {
  --space: #070B1F;
  --panel: rgba(20, 26, 60, 0.72);
  --panel-line: rgba(140, 160, 255, 0.28);
  --violet: #8B6CFF;
  --magenta: #E25BC9;
  --teal: #2ED3C0;
  --gold: #F5C451;
  --sky: #6FB7FF;
  --ember: #FF8A5C;
  --text: #EEF1FF;
  --text-dim: #A9B0D6;

  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --phone-w: 390px;
  --phone-h: 844px;
  --tabbar-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--space);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 20px; line-height: 1.25; }
button { font: inherit; color: inherit; }
.dim { color: var(--text-dim); }
.small { font-size: 13px; }
.eyebrow { font-size: 13px; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }
[disabled] { cursor: not-allowed; }

/* Visible keyboard focus everywhere */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#view:focus { outline: none; }

/* ---------- page: starfield and nebula ---------- */

body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    url("bg.webp") center / cover no-repeat,
    radial-gradient(60vmax 50vmax at 12% 18%, rgba(139, 108, 255, 0.20), transparent 70%),
    radial-gradient(55vmax 45vmax at 88% 30%, rgba(226, 91, 201, 0.14), transparent 70%),
    radial-gradient(60vmax 50vmax at 55% 95%, rgba(46, 211, 192, 0.12), transparent 70%),
    var(--space);
}

.page-stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

.star {
  position: absolute; display: block;
  border-radius: 50%;
  background: #fff;
  opacity: var(--o, 0.7);
  animation: twinkle var(--d, 5s) ease-in-out infinite;
}
.star.warm { background: #FFE9B8; }

@keyframes twinkle {
  0%, 100% { opacity: var(--o, 0.7); transform: scale(1); }
  50% { opacity: calc(var(--o, 0.7) * 0.25); transform: scale(0.8); }
}

/* Motion off: reduced-motion preference or the Demo controls switch */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .ascend { display: none; }
}
body.still *, body.still *::before, body.still *::after { animation: none !important; transition-duration: 0.01ms !important; }
body.still .ascend { display: none; }

/* ---------- stage: phone frame and Demo controls ---------- */

.stage {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  gap: 32px;
  padding: 16px;
}

.phone {
  position: relative;
  width: var(--phone-w);
  height: min(var(--phone-h), calc(100dvh - 32px));
  min-height: 560px;
  flex: none;
  display: flex; flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  background: var(--space);
  border: 1px solid var(--panel-line);
  border-radius: 40px;
  box-shadow:
    0 0 0 8px #0B1030,
    0 0 0 9px var(--panel-line),
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 90px rgba(139, 108, 255, 0.18);
}

.phone-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--space); }
.phone-stars { position: absolute; inset: 0; }

.nebula { position: absolute; border-radius: 50%; filter: blur(46px); opacity: 0.32; }
.nebula.n1 { width: 320px; height: 320px; left: -120px; top: -60px; background: radial-gradient(circle, var(--violet), transparent 70%); }
.nebula.n2 { width: 300px; height: 300px; right: -140px; top: 34%; background: radial-gradient(circle, var(--magenta), transparent 70%); opacity: 0.22; }
.nebula.n3 { width: 340px; height: 340px; left: -60px; bottom: -140px; background: radial-gradient(circle, var(--teal), transparent 70%); opacity: 0.2; }

.status {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  height: 36px; padding: 6px 26px 0;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.status-right { display: flex; align-items: center; gap: 6px; }

.view {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 8px 16px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-line) transparent;
}

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

/* The header every screen shares: eyebrow, title, a line, and an optional control on the right */
.screen-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 4px; }
.screen-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.screen-head-text h1 { overflow-wrap: anywhere; }
.screen-head > :not(.screen-head-text) { flex: none; }

/* For screen readers only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 0 24px rgba(139, 108, 255, 0.12);
}
.placeholder { display: flex; flex-direction: column; gap: 8px; }

/* ---------- tab bar ---------- */

.tabbar {
  flex: none;
  height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 8px 10px;
  background: rgba(10, 14, 40, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--panel-line);
}
.phone.no-chrome .tabbar { display: none; }

.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; border-radius: 12px;
  color: var(--text-dim);
  cursor: pointer;
}
.tab-icon { display: flex; }
.tab-label { font-size: 12px; font-weight: 600; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: rgba(139, 108, 255, 0.18); box-shadow: inset 0 0 0 1px rgba(139, 108, 255, 0.45); }
.tab.active .tab-icon { color: var(--violet); filter: drop-shadow(0 0 6px rgba(139, 108, 255, 0.8)); }

/* ---------- toast, sheet ---------- */

.toast-host {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; z-index: 30;
}
.phone.no-chrome .toast-host { bottom: 20px; }
.toast {
  background: rgba(24, 31, 72, 0.96);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.2s ease-out;
  transition: opacity 0.3s;
}
.toast.out { opacity: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.overlay-host { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.scrim {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  background: rgba(3, 5, 18, 0.6);
  pointer-events: auto;
}
.sheet { width: 100%; max-height: 80%; overflow-y: auto; border-radius: 22px 22px 0 0; background: rgba(16, 21, 52, 0.96); padding-bottom: 24px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: none; border: 1px solid var(--panel-line); border-radius: 50%;
  color: var(--text); cursor: pointer;
}

/* ---------- Demo controls ---------- */

.demo {
  flex: none;
  width: 250px;
  align-self: center;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px dashed var(--panel-line);
  border-radius: var(--radius);
  scrollbar-width: thin;
  scrollbar-color: var(--panel-line) transparent;
}
.demo-note {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--gold);
}
.demo-h { font-size: 13px; font-weight: 700; color: var(--text-dim); margin-top: 4px; }
.demo-list { display: flex; flex-direction: column; gap: 3px; }
.demo-btn {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  width: 100%; min-height: 30px;
  padding: 4px 10px;
  text-align: left; font-size: 13px;
  background: rgba(139, 108, 255, 0.08);
  border: 1px solid var(--panel-line); border-radius: 10px;
  cursor: pointer;
}
.demo-btn .code { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; order: -1; min-width: 28px; }
.demo-btn.action .code { order: 0; margin-left: auto; min-width: 0; }
.demo-btn:hover:not([disabled]) { background: rgba(139, 108, 255, 0.2); }
.demo-btn.active { background: rgba(139, 108, 255, 0.28); border-color: var(--violet); }
.demo-btn[disabled] { opacity: 0.6; }
.demo-btn.danger { margin-top: 4px; justify-content: center; border-color: rgba(255, 138, 92, 0.6); color: var(--ember); }
.demo-btn.danger:hover { background: rgba(255, 138, 92, 0.14); }

.demo-switch { display: flex; align-items: center; justify-content: space-between; min-height: 30px; padding: 0 4px 0 10px; font-size: 13px; cursor: pointer; position: relative; }
.demo-switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.demo-switch .track {
  width: 40px; height: 22px; border-radius: 999px; position: relative;
  background: rgba(169, 176, 214, 0.25); border: 1px solid var(--panel-line);
  transition: background 0.15s;
}
.demo-switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text); transition: transform 0.15s;
}
.demo-switch input:checked + .track { background: var(--violet); }
.demo-switch input:checked + .track::after { transform: translateX(18px); }
.demo-switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }

.demo-hint { font-size: 12px; color: var(--text-dim); line-height: 1.4; padding: 0 2px; }

.demo-toggle { display: none; }

.noscript { padding: 16px; text-align: center; }

/* ---------- small windows ---------- */

/* Narrow desktop windows: put the Demo controls under the phone */
@media (max-width: 760px) and (min-width: 500px) {
  .stage { flex-direction: column; }
  .demo { width: var(--phone-w); max-height: none; }
}

/* Phone width: drop the frame, fill the screen, Demo controls behind a small button */
@media (max-width: 499px) {
  .stage { display: block; min-height: 0; padding: 0; }
  .phone {
    width: 100%; height: 100dvh; min-height: 0;
    border: 0; border-radius: 0; box-shadow: none;
  }
  .demo-toggle {
    display: block;
    position: fixed; top: 6px; right: 8px; z-index: 60;
    min-height: 32px; padding: 4px 12px;
    font-size: 13px; font-weight: 600;
    background: rgba(20, 26, 60, 0.92);
    border: 1px solid var(--panel-line); border-radius: 999px;
    cursor: pointer;
  }
  .demo {
    display: none;
    position: fixed; left: 12px; right: 12px; top: 44px; bottom: 12px; z-index: 55;
    width: auto; max-height: none; align-self: auto;
    background: rgba(12, 16, 44, 0.97);
  }
  .demo.open { display: flex; }
  .status { padding-right: 78px; }
}

/* ======================================================================
   M2: Welcome, Onboarding (with the Awakening) and Home
   ====================================================================== */

h3 { margin: 0; font-size: 15px; line-height: 1.3; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.teal-text { color: var(--teal); }
.sky-text { color: var(--sky); }

/* ---------- buttons, fields, switches ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px;
  font-weight: 700; font-size: 15px; line-height: 1.2;
  border: 1px solid transparent; border-radius: 999px;
  cursor: pointer;
}
.btn.primary { background: linear-gradient(135deg, #A28BFF, #8B6CFF); color: #070B1F; box-shadow: 0 0 22px rgba(139, 108, 255, 0.45); }
.btn.primary:hover:not([disabled]) { filter: brightness(1.08); }
.btn.ghost { background: rgba(139, 108, 255, 0.1); border-color: var(--panel-line); color: var(--text); }
.btn.ghost:hover:not([disabled]) { background: rgba(139, 108, 255, 0.22); }
.btn.link { background: none; color: var(--sky); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.btn.big { min-height: 52px; font-size: 16px; padding: 12px 26px; }
.btn.compact { min-height: 44px; padding: 8px 16px; flex: none; }
.btn[disabled] { opacity: 0.45; box-shadow: none; }
.btn-ic { display: inline-flex; }

.field-block { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--text-dim); }
.field {
  width: 100%; min-height: 46px;
  padding: 10px 14px;
  font: inherit; color: var(--text);
  background: rgba(7, 11, 31, 0.6);
  border: 1px solid var(--panel-line); border-radius: 12px;
}
.field::placeholder { color: #8189B3; }
.field:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.area { resize: vertical; min-height: 120px; line-height: 1.5; }

/* ---------- Lumen ---------- */

.lumen { position: relative; flex: none; display: block; }
.lumen svg { width: 100%; height: 100%; overflow: visible; display: block; }
.lumen .lm-rays { opacity: 0; }
.lumen.calm .lm-halo { opacity: 0.7; }
.lumen.bright .lm-halo { opacity: 1; transform-origin: 50px 50px; transform: scale(1.18); filter: drop-shadow(0 0 8px rgba(185, 168, 255, 0.9)); }
.lumen.bright .lm-rays { opacity: 0.9; }
.lumen.dim .lm-halo { opacity: 0.28; }
.lumen.dim .lm-orb { opacity: 0.6; }
.lumen.dim .lm-eye { transform: translateY(2px); }
.lumen .lm-halo, .lumen .lm-orb, .lumen .lm-rays, .lumen .lm-eye { transform-origin: 50px 50px; transition: opacity 1.6s ease, transform 1.6s ease; }
.lumen.float { animation: lumen-float 5s ease-in-out infinite; }
.lumen.react { animation: lumen-react 1.2s ease-out 1; }
@keyframes lumen-react {
  0% { filter: brightness(1); transform: scale(1); }
  35% { filter: brightness(1.7) drop-shadow(0 0 14px #B9A8FF); transform: scale(1.16); }
  100% { filter: brightness(1); transform: scale(1); }
}
.lumen.bright .lm-halo { animation: lumen-pulse 3s ease-in-out infinite; }
@keyframes lumen-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes lumen-pulse { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; } }

/* ---------- S0 Welcome ---------- */

.welcome { min-height: 100%; justify-content: center; align-items: center; text-align: center; gap: 26px; padding: 8px 4px 16px; }
.well { position: relative; width: 240px; height: 190px; display: flex; align-items: center; justify-content: center; }
.well .ring { position: absolute; left: 50%; border: 1px solid rgba(139, 108, 255, 0.35); border-radius: 50%; transform: translateX(-50%); }
.well .r1 { bottom: 4px;  width: 230px; height: 56px; }
.well .r2 { bottom: 14px; width: 170px; height: 40px; border-color: rgba(139, 108, 255, 0.5); }
.well .r3 { bottom: 24px; width: 110px; height: 26px; border-color: rgba(139, 108, 255, 0.7); box-shadow: 0 0 24px rgba(139, 108, 255, 0.45); }
.well .lumen { margin-bottom: 26px; }
.welcome-text { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.wordmark { font-size: 40px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; text-shadow: 0 0 28px rgba(139, 108, 255, 0.7); }
.tagline { font-size: 20px; color: var(--gold); font-weight: 600; }
.story { max-width: 290px; }
.welcome-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }

/* ---------- S1 Onboarding ---------- */

.onboarding { gap: 14px; padding-bottom: 8px; }
.steps-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.steps { display: flex; gap: 6px; }
.steps .dot { width: 22px; height: 6px; border-radius: 3px; background: rgba(169, 176, 214, 0.28); }
.steps .dot.done { background: var(--teal); }
.steps .dot.now { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.step-head { display: flex; flex-direction: column; gap: 6px; }
.step-head h1:focus, .result-head h1:focus { outline: none; }
.nav-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; }

.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice-face {
  display: flex; align-items: center; gap: 10px;
  min-height: 58px; height: 100%; padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-line); border-radius: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.choice:hover .choice-face { border-color: rgba(139, 108, 255, 0.7); }
.choice input:checked + .choice-face { border-color: var(--violet); background: rgba(139, 108, 255, 0.22); box-shadow: 0 0 18px rgba(139, 108, 255, 0.35); }
.choice input:focus-visible + .choice-face { outline: 2px solid var(--gold); outline-offset: 2px; }
.choice-ic { display: flex; flex: none; color: var(--sky); }
.choice-ic svg { width: 26px; height: 26px; }
.choice-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.choice-title { font-weight: 600; line-height: 1.25; }
.choice-line { font-size: 13px; color: var(--text-dim); line-height: 1.35; }
.choice-tick { display: none; flex: none; color: var(--teal); }
.choice input:checked + .choice-face .choice-tick { display: flex; }
.choice-tick svg { width: 20px; height: 20px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice-grid .choice-face { flex-direction: column; justify-content: center; text-align: center; gap: 6px; padding: 12px 8px; position: relative; }
.choice-grid .choice-text { flex: none; align-items: center; }
.choice-grid .choice-tick { position: absolute; top: 6px; right: 6px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice-list .choice-face { padding: 12px 14px; }
.choice-list .choice-title { font-size: 16px; }

.switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-title { font-weight: 600; }
.switch-line { font-size: 13px; color: var(--text-dim); }
.switch .track {
  flex: none; width: 46px; height: 26px; border-radius: 999px; position: relative;
  background: rgba(169, 176, 214, 0.25); border: 1px solid var(--panel-line);
  transition: background 0.15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text); transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--violet); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }

/* The Awakening */
.banner {
  padding: 10px 14px;
  font-weight: 600; text-align: center;
  color: var(--gold);
  background: rgba(245, 196, 81, 0.1);
  border: 1px solid rgba(245, 196, 81, 0.45); border-radius: 12px;
}
.task-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 8px; font-size: 13px; font-weight: 700; color: var(--c); border: 1px solid var(--c); border-radius: 999px; }
.prompt { font-size: 16px; line-height: 1.45; }
.sum-list { display: flex; flex-direction: column; gap: 8px; }
.sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.sum-q { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sum .field { width: 110px; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; }
.timer { display: flex; flex-direction: column; gap: 10px; }
.timer-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.timer-num { font-weight: 700; color: var(--ember); font-variant-numeric: tabular-nums; flex: none; }
.timer-bar .bar-fill { background: var(--ember); }
.hint { color: var(--text); }
.rate { margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rate legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; line-height: 1.4; }
.rate legend + * { clear: both; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale-opt { position: relative; display: block; cursor: pointer; }
.scale-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.scale-face {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(7, 11, 31, 0.5); border: 1px solid var(--panel-line); border-radius: 12px;
}
.scale-opt:hover .scale-face { border-color: rgba(255, 138, 92, 0.7); }
.scale-opt input:checked + .scale-face { background: var(--magenta); border-color: var(--magenta); color: #070B1F; }
.scale-opt input:focus-visible + .scale-face { outline: 2px solid var(--gold); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; margin-top: 6px; }

.result-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding-top: 6px; }
.rank-line { display: flex; align-items: center; gap: 14px; }
.panel-h { font-size: 16px; margin-bottom: 12px; }

/* ---------- bars and stats ---------- */

.bar { height: 10px; border-radius: 999px; background: rgba(169, 176, 214, 0.18); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--c, var(--violet)); box-shadow: 0 0 10px var(--c, var(--violet)); min-width: 6px; transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.stat-relating { --c: var(--magenta); }
.stat-doing { --c: var(--teal); }
.stat-thinking { --c: var(--sky); }
.stat-persevering { --c: var(--ember); }
.stat-list { display: flex; flex-direction: column; gap: 14px; }
.stat-row { display: flex; align-items: flex-start; gap: 12px; }
.stat-ic { display: inline-flex; flex: none; color: var(--c); }
.stat-row > .stat-ic { margin-top: 1px; }
.stat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.stat-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stat-name { font-weight: 700; color: var(--c); }
.stat-lv { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-lv.up { color: var(--c); }
.stat-note { margin-top: 14px; }
.stat-line { font-size: 13px; color: var(--text-dim); }

/* ---------- S2 Home ---------- */

.home-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; padding: 6px 14px 6px 10px;
  font-size: 14px; font-weight: 600;
  background: rgba(139, 108, 255, 0.12); border: 1px solid var(--panel-line); border-radius: 999px;
  cursor: pointer;
}
.pill:hover { background: rgba(139, 108, 255, 0.24); }
.pill svg { width: 20px; height: 20px; }

.rank-panel { display: flex; flex-direction: column; gap: 10px; border-color: rgba(245, 196, 81, 0.4); box-shadow: 0 0 26px rgba(245, 196, 81, 0.12); }
.rank-top { display: flex; align-items: center; gap: 14px; }
.rank-btn { background: none; border: 0; padding: 4px; border-radius: 16px; cursor: pointer; display: flex; filter: drop-shadow(0 0 10px rgba(245, 196, 81, 0.5)); }
.rank-badge svg { width: 100%; height: 100%; display: block; }
.rank-info { display: flex; flex-direction: column; gap: 2px; }
.rank-name { font-size: 24px; font-weight: 700; color: var(--gold); line-height: 1.15; }
.pips { display: flex; gap: 5px; margin-top: 4px; }
.pips i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--gold); }
.pips i.on { background: var(--gold); }
.xp-bar { --c: var(--violet); height: 12px; }
.xp-text { font-variant-numeric: tabular-nums; }

.meter { display: grid; grid-template-columns: 1fr 1.1fr 1.25fr; gap: 10px; align-items: end; }
.meter-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meter-num { font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-num.big { font-size: 34px; color: var(--gold); text-shadow: 0 0 18px rgba(245, 196, 81, 0.5); }
.meter-label { font-size: 13px; color: var(--text-dim); line-height: 1.3; }
.meter-sub { font-size: 13px; color: var(--text); }
.meter-col.together { padding-left: 10px; border-left: 1px solid var(--panel-line); }
.note { margin-top: 12px; }

.section-h { font-size: 16px; margin-top: 4px; }
.card-row { display: flex; align-items: center; gap: 12px; }
.card-ic { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; }
.card-ic svg { width: 24px; height: 24px; }
.card-ic.ember { color: var(--ember); background: rgba(255, 138, 92, 0.14); }
.card-ic.magenta { color: var(--magenta); background: rgba(226, 91, 201, 0.14); }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.streak { margin-top: 2px; }
.echo { padding: 2px 4px 6px; }

.more-list { display: flex; flex-direction: column; gap: 6px; }
.more-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 56px; padding: 8px 14px; text-align: left;
  background: rgba(139, 108, 255, 0.08); border: 1px solid var(--panel-line); border-radius: 14px;
  cursor: pointer;
}
.more-item:hover { background: rgba(139, 108, 255, 0.2); }
.more-text { display: flex; flex-direction: column; }
.more-title { font-weight: 600; }
.more-go { display: flex; color: var(--text-dim); }

@media (max-width: 380px) {
  .meter { grid-template-columns: 1fr 1fr; }
  .meter-col.together { grid-column: 1 / -1; padding-left: 0; border-left: 0; border-top: 1px solid var(--panel-line); padding-top: 10px; }
}

/* ======================================================================
   M3: Star Map, Crew, Shooting Star
   ====================================================================== */

.btn.danger { background: rgba(255, 138, 92, 0.16); border-color: var(--ember); color: var(--ember); }
.btn.danger:hover:not([disabled]) { background: rgba(255, 138, 92, 0.3); }
.center { text-align: center; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.panel-h.tight { margin: 0; }
.inline-ic { display: inline-flex; vertical-align: -3px; }
.inline-ic svg { width: 16px; height: 16px; }
.card-ic.violet { color: var(--violet); background: rgba(139, 108, 255, 0.16); }
.card-ic.big { width: 56px; height: 56px; border-radius: 18px; }
.card-ic.big svg { width: 30px; height: 30px; }
.sheet-sub { font-size: 14px; color: var(--text-dim); margin: 6px 0 2px; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sheet .stack { gap: 10px; }

.avatar {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  font-weight: 700; color: #070B1F;
  border: 2px solid rgba(7, 11, 31, 0.6);
}
.avatar.c-violet { background: var(--violet); }
.avatar.c-teal { background: var(--teal); }
.avatar.c-magenta { background: var(--magenta); }
.avatar.c-sky { background: var(--sky); }
.avatar.c-ember { background: var(--ember); }
.avatar.c-gold { background: var(--gold); }

/* ---------- chips ---------- */

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; flex: none; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 14px 6px 10px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  background: rgba(139, 108, 255, 0.1); border: 1px solid var(--panel-line); border-radius: 999px;
  cursor: pointer;
}
.chip:hover { background: rgba(139, 108, 255, 0.22); }
.chip.on { background: rgba(139, 108, 255, 0.34); border-color: var(--violet); box-shadow: 0 0 14px rgba(139, 108, 255, 0.35); }
.chip-ic { display: inline-flex; }
.chip-ic svg { width: 18px; height: 18px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.vis-line { margin-top: -4px; }

/* ---------- S3 Star Map ---------- */

.pill.shoot { border-color: rgba(245, 196, 81, 0.6); color: var(--gold); background: rgba(245, 196, 81, 0.1); }
.pill.shoot:hover { background: rgba(245, 196, 81, 0.2); }

.map-panel { padding: 6px; }
.map-svg { display: block; width: 100%; height: auto; }
.map-svg .hood { fill: rgba(139, 108, 255, 0.04); stroke: rgba(140, 160, 255, 0.22); stroke-width: 1; cursor: pointer; }
.map-svg .hood:hover, .map-svg .hood.picked { fill: rgba(139, 108, 255, 0.12); }
.map-svg .river { fill: none; stroke: rgba(46, 211, 192, 0.2); stroke-width: 7; stroke-linecap: round; pointer-events: none; }
.map-svg .hood-name { font-size: 11.5px; fill: #A9B0D6; letter-spacing: 0.04em; pointer-events: none; }
.cluster { cursor: pointer; }
.cl-glow { pointer-events: none; }
.cl-dot { opacity: 0.9; pointer-events: none; }
.cl-core { filter: drop-shadow(0 0 6px rgba(238, 241, 255, 0.8)); pointer-events: none; }
.cl-count { font-size: 12px; font-weight: 800; fill: #1B1745; font-variant-numeric: tabular-nums; pointer-events: none; }
.cl-ring { fill: none; stroke: transparent; stroke-width: 1.5; pointer-events: none; }
.cluster.mine .cl-ring { stroke: var(--gold); stroke-dasharray: 3 3; }
.cl-hit { fill: transparent; }
.cluster:hover .cl-ring { stroke: rgba(238, 241, 255, 0.7); }
.me { pointer-events: none; }
.me-ring { fill: none; stroke: #EEF1FF; stroke-width: 2; opacity: 0.9; }
.me.hidden .me-ring { stroke-dasharray: 3 3; opacity: 0.6; }
.me-text { font-size: 11px; font-weight: 700; fill: #EEF1FF; }
.map-info { min-height: 18px; color: var(--sky); }

.cl-list { display: flex; flex-direction: column; gap: 8px; }
.cl-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-align: left; cursor: pointer; width: 100%; color: var(--text); }
.cl-item:hover { border-color: rgba(139, 108, 255, 0.7); }
.cl-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-item-title { font-weight: 600; }
.cl-goal { display: inline-flex; flex: none; color: var(--sky); }
.cl-goal svg { width: 26px; height: 26px; }
.privacy-empty { display: flex; align-items: center; gap: 12px; }

.cl-sheet { display: flex; flex-direction: column; gap: 10px; }
.cl-meta { display: flex; align-items: center; gap: 12px; }
.names { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.name-row { display: flex; align-items: center; gap: 10px; }
.name-text { display: flex; flex-direction: column; min-width: 0; }
.name-first { font-weight: 600; }

/* ---------- person check (hold to confirm) ---------- */

.person-check { display: flex; flex-direction: column; gap: 8px; width: 100%; align-items: stretch; }
.hold {
  position: relative; overflow: hidden;
  min-height: 56px; padding: 12px 18px;
  font-weight: 700; font-size: 16px;
  background: rgba(139, 108, 255, 0.12); border: 2px solid var(--violet); border-radius: 999px;
  cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.hold-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(90deg, rgba(139, 108, 255, 0.55), rgba(46, 211, 192, 0.75)); }
.hold-text { position: relative; }
.hold.holding { box-shadow: 0 0 22px rgba(139, 108, 255, 0.6); }
.hold.done { border-color: var(--teal); color: var(--text); opacity: 1; }
.hold-live { min-height: 18px; text-align: center; }
.gate { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 8px 0; }

/* ---------- full-height overlay and the cluster chat ---------- */

.fullsheet { position: absolute; inset: 0; z-index: 2; pointer-events: auto; display: flex; flex-direction: column; background: #070B1F; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 8px; }
.chat-title h2 { font-size: 18px; }
.chat-strip {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 14px; padding: 8px 12px;
  font-size: 13px; font-weight: 600; color: var(--teal);
  background: rgba(46, 211, 192, 0.1); border: 1px solid rgba(46, 211, 192, 0.45); border-radius: 12px;
}
.chat-strip svg { width: 18px; height: 18px; }
.chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 14px 14px; }
.chat-body > .gate { margin: auto 0; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 2px; scrollbar-width: thin; scrollbar-color: var(--panel-line) transparent; }
.chat-list { display: flex; flex-direction: column; gap: 10px; }
.chat-day { text-align: center; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 92%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble { padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--panel); border: 1px solid var(--panel-line); min-width: 0; overflow-wrap: anywhere; }
.msg.me .msg-bubble { border-radius: 16px 16px 4px 16px; background: rgba(139, 108, 255, 0.3); border-color: var(--violet); }
.msg-who { margin-bottom: 1px; }
.chat-note { text-align: center; margin: 6px 0; }
.composer { display: flex; gap: 8px; align-items: center; }
.composer .field { flex: 1; min-width: 0; }

/* ---------- S4 Crew ---------- */

.crew-head { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: start; border-color: rgba(226, 91, 201, 0.4); box-shadow: 0 0 24px rgba(226, 91, 201, 0.12); }
.crew-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crew-title h1 { overflow-wrap: anywhere; }
.avatar-stack { grid-column: 1 / -1; display: flex; padding-left: 6px; }
.avatar-stack .avatar { margin-left: -6px; }
.meetup { display: flex; flex-direction: column; gap: 10px; }
.checkin { display: flex; gap: 14px; align-items: center; }
.code-box { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; width: 128px; }
.code-pattern { display: block; width: 128px; height: 128px; padding: 4px; border-radius: 14px; background: #EEF1FF; box-shadow: 0 0 22px rgba(238, 241, 255, 0.25); }
.code-pattern svg { display: block; width: 100%; height: 100%; }
.code-cap { text-align: center; font-size: 12px; line-height: 1.3; }
.checkin-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.lumen-slot.flash .lumen { animation: lumen-flash 1.2s ease-out 1; }
@keyframes lumen-flash { 0% { filter: brightness(1); transform: scale(1); } 40% { filter: brightness(1.6) drop-shadow(0 0 14px #B9A8FF); transform: scale(1.18); } 100% { filter: brightness(1); transform: scale(1); } }

.signal { display: flex; flex-direction: column; gap: 8px; }
.signal-top { display: flex; align-items: center; gap: 10px; }
.signal-lock { display: inline-flex; color: var(--violet); }
.signal.open .signal-lock { color: var(--teal); }
.signal-plan { font-weight: 600; }
.signal.sent { border-style: dashed; }

.members, .past { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.member.blocked { opacity: 0.65; }
.past .panel { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }

.scan { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.finder { position: relative; width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; border-radius: 20px; border: 2px solid var(--teal); background: rgba(46, 211, 192, 0.08); overflow: hidden; }
.finder .sweep { position: absolute; left: 0; right: 0; height: 3px; background: var(--teal); box-shadow: 0 0 14px var(--teal); animation: sweep 1.1s ease-in-out infinite alternate; }
@keyframes sweep { from { top: 6%; } to { top: 92%; } }
body.still .finder .sweep { animation: none; top: 50%; }
@media (prefers-reduced-motion: reduce) { .finder .sweep { animation: none; top: 50%; } }
.scan-steps { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.scan-step { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(139, 108, 255, 0.08); border: 1px solid var(--panel-line); }
.scan-step .tick { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--panel-line); }
.scan-step.ok { border-color: var(--teal); }
.scan-step.ok .tick { background: var(--teal) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23070B1F' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>") center / 14px no-repeat; border-color: var(--teal); }

/* ---------- S9 Shooting Star ---------- */

.shoot-stage { position: relative; display: flex; align-items: center; justify-content: center; height: 220px; overflow: hidden; border-radius: var(--radius); }
.shoot-btn {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 168px; height: 168px; border-radius: 50%;
  font-weight: 800; font-size: 18px; letter-spacing: 0.02em; color: var(--text);
  background: radial-gradient(circle at 35% 30%, rgba(245, 196, 81, 0.55), rgba(139, 108, 255, 0.55) 60%, rgba(20, 26, 60, 0.9));
  border: 2px solid var(--gold);
  box-shadow: 0 0 40px rgba(245, 196, 81, 0.45), inset 0 0 24px rgba(245, 196, 81, 0.25);
  cursor: pointer;
}
.shoot-btn:hover { filter: brightness(1.1); }
.shoot-ic svg { width: 54px; height: 54px; color: var(--gold); }
.streak-fx { position: absolute; z-index: 2; left: -40%; top: 18%; width: 60%; height: 3px; border-radius: 3px; opacity: 0; pointer-events: none; background: linear-gradient(90deg, transparent, #F5C451 70%, #fff); box-shadow: 0 0 14px #F5C451; transform: rotate(18deg); }
.streak-fx.go { animation: streak 0.8s ease-in forwards; }
@keyframes streak { 0% { left: -40%; top: 8%; opacity: 0; } 15% { opacity: 1; } 100% { left: 110%; top: 78%; opacity: 0; } }
.shoot-list { display: flex; flex-direction: column; gap: 10px; }
.activity { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.act-time { display: flex; flex-direction: column; flex: none; width: 66px; font-variant-numeric: tabular-nums; }
.act-time strong { color: var(--gold); line-height: 1.2; }
.activity .btn.compact { min-height: 44px; padding: 8px 12px; font-size: 14px; }

/* ---------- S5 Train and S6 Orbits and Simulators ---------- */

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(20, 26, 60, 0.72); border: 1px solid var(--panel-line); }
.seg-btn {
  min-height: 44px; padding: 6px 4px; border: 1px solid transparent; border-radius: 10px;
  background: none; font-size: 14px; font-weight: 600; color: var(--text-dim); cursor: pointer;
}
.seg-btn:hover { color: var(--text); background: rgba(139, 108, 255, 0.14); }
.seg-btn.on { color: var(--text); background: rgba(139, 108, 255, 0.28); border-color: rgba(139, 108, 255, 0.6); box-shadow: 0 0 14px rgba(139, 108, 255, 0.3); }
.tab-body { display: flex; flex-direction: column; gap: 12px; }
.tab-body:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.demo-tag {
  flex: none; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(245, 196, 81, 0.6); background: rgba(245, 196, 81, 0.1);
}
.ember-text { color: var(--ember); }
.quest { display: flex; flex-direction: column; gap: 8px; }
.done-card { display: flex; align-items: center; gap: 12px; border-color: rgba(46, 211, 192, 0.5); }
.card-ic.teal { color: var(--teal); background: rgba(46, 211, 192, 0.14); }
.timer.done { border-color: rgba(46, 211, 192, 0.6); }
.timer.done .timer-num { color: var(--teal); }
.timer.done .timer-bar .bar-fill { background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.row-btns .btn { flex: 1 1 140px; }

.link-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; color: var(--text); }
.link-card:hover, .chapter-card:hover { border-color: rgba(139, 108, 255, 0.7); }
.link-title { font-weight: 700; font-size: 16px; line-height: 1.3; }
.link-card .card-body, .chapter-card .card-body { gap: 4px; }
.chapter-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; color: var(--text); }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5;
  color: var(--text); border: 1px solid var(--panel-line); background: rgba(139, 108, 255, 0.14);
}
.badge.teal { border-color: rgba(46, 211, 192, 0.6); background: rgba(46, 211, 192, 0.12); }
.badge.sky { border-color: rgba(111, 183, 255, 0.6); background: rgba(111, 183, 255, 0.12); }

.pending-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.pending-row + .pending-row { border-top: 1px solid var(--panel-line); }

.file-pick { position: relative; width: 100%; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-pick:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.photo-preview { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 10px; }
.photo-preview img { max-width: 100%; max-height: 220px; border-radius: 12px; border: 1px solid var(--panel-line); object-fit: contain; background: rgba(0, 0, 0, 0.25); }
.photo-preview[hidden] { display: none; }

.passage { margin: 10px 0 0; padding: 12px 14px; border-left: 3px solid var(--sky); background: rgba(111, 183, 255, 0.08); border-radius: 0 12px 12px 0; line-height: 1.55; }
.hint-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.hint-list:empty { margin: 0; }
.answer-card { display: flex; flex-direction: column; gap: 4px; border-color: rgba(46, 211, 192, 0.5); }
.answer-text { font-size: 18px; font-weight: 700; color: var(--teal); }
.reveal { display: flex; flex-direction: column; gap: 10px; }
[hidden] { display: none !important; }

.orbit-card { display: flex; align-items: center; gap: 12px; }
.agents-banner { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; }
.room-time { margin-top: 8px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; text-align: center; }
.tile-name { font-size: 13px; font-weight: 600; word-break: break-word; }
.view-text { white-space: pre-wrap; }

.rubric { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.rubric-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rubric-text { display: flex; flex-direction: column; min-width: 0; }
.rubric-name { font-weight: 600; }
.rubric-score { display: flex; align-items: center; gap: 8px; flex: none; font-variant-numeric: tabular-nums; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(169, 176, 214, 0.25); }
.dots i.on { background: var(--teal); }
.note { display: flex; flex-direction: column; gap: 8px; }
.note-head { display: flex; align-items: center; gap: 10px; }
.note-text { line-height: 1.5; }

/* ======================================================================
   M5: Shield (S7), the Night Lock card and Night Watch
   ====================================================================== */

.limits-top { display: flex; align-items: center; gap: 14px; }
.limits-top.on { border-color: rgba(46, 211, 192, 0.5); }
.limits-line { font-size: 17px; font-weight: 700; line-height: 1.3; }
.limit { display: flex; flex-direction: column; gap: 14px; }
.limit.g-active, .limit.n-holding { border-color: rgba(46, 211, 192, 0.5); }
.limit.g-starting { border-color: rgba(111, 183, 255, 0.55); }
.limit.g-paused, .limit.n-paused { border-color: rgba(255, 138, 92, 0.5); }
.limit-head { display: flex; align-items: center; gap: 12px; }
.switch.flat { padding: 0; min-height: 44px; }
.limit-status { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(139, 108, 255, 0.08); border: 1px solid var(--panel-line); }
.limit-status .btn { align-self: flex-start; }
.timer-box { display: flex; flex-direction: column; gap: 8px; width: 100%; }

.range-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.range-out { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); }
.range { width: 100%; min-height: 32px; margin: 0; accent-color: var(--violet); cursor: pointer; }
.range[disabled] { opacity: 0.5; cursor: not-allowed; }
.chip[disabled] { opacity: 0.55; cursor: not-allowed; }
.chip[aria-pressed="true"]::before { content: "\2713"; font-weight: 800; color: var(--teal); }

.night-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.offer { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; border: 1px dashed var(--panel-line); }
.offer h3 { font-size: 15px; }
.offer-box { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); font-style: italic; }
.shield-foot { text-align: center; padding: 0 6px; }

.crisis { display: flex; flex-direction: column; gap: 10px; border-color: rgba(46, 211, 192, 0.45); }
.crisis.picked { border-color: var(--teal); box-shadow: 0 0 26px rgba(46, 211, 192, 0.3); }
.crisis a { color: var(--sky); font-weight: 600; text-underline-offset: 3px; }
.crisis h2:focus { outline: none; }

/* The calm full-screen Night Lock card, laid over the phone */
.nightcard {
  position: absolute; inset: 0; z-index: 3; pointer-events: auto; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 52px 22px 28px; text-align: center;
  background: radial-gradient(ellipse at 50% 18%, rgba(70, 60, 150, 0.55), transparent 62%), #050818;
}
.night-moon { width: 44px; height: 44px; border-radius: 50%; box-shadow: inset -13px -5px 0 0 #E7E3FF; background: transparent; filter: drop-shadow(0 0 14px rgba(185, 168, 255, 0.55)); }
.night-text { display: flex; flex-direction: column; gap: 8px; max-width: 320px; }
.night-text h2 { font-size: 22px; line-height: 1.3; }
.night-text h2:focus { outline: none; }
.night-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
.night-actions .btn { width: 100%; }
.night-actions .timer { width: 100%; }
.night-wait { padding: 16px; border-radius: 14px; border: 1px solid var(--panel-line); background: var(--panel); }
.night-live { max-width: 300px; min-height: 18px; }
@media (max-height: 700px) { .nightcard { justify-content: flex-start; } }

/* ======================================================================
   M6: Earth Archive, Light Exchange, Landing Missions, Constellation, Privacy
   ====================================================================== */


/* ---------- S8 Earth Archive ---------- */

.verdict {
  display: inline-flex; flex: none; align-items: center; gap: 4px;
  padding: 3px 12px 3px 8px; border-radius: 999px;
  font-size: 13px; font-weight: 800; line-height: 1.4; color: #070B1F;
}
.verdict-ic { display: inline-flex; }
.verdict-ic svg { width: 14px; height: 14px; stroke-width: 3; }
.verdict.v-keep { background: var(--teal); }
.verdict.v-adapt { background: var(--gold); }
.verdict.v-drop { background: var(--ember); }
.verdict-key { display: flex; flex-direction: column; gap: 8px; }
.verdict-key .panel-h { margin-bottom: 2px; }
.key-row { display: flex; align-items: center; gap: 10px; }
.key-row .verdict { min-width: 72px; justify-content: center; }

.entry { display: flex; flex-direction: column; gap: 10px; }
.entry-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.entry-title { font-size: 17px; }
.entry-row { display: flex; flex-direction: column; gap: 2px; }
.entry-label { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; color: var(--text-dim); }
.entry .evidence { color: var(--text); font-weight: 600; }
.entry-source { padding-top: 8px; border-top: 1px solid var(--panel-line); }
.entry-proto { font-style: italic; }

.elder { display: flex; flex-direction: column; gap: 8px; border-color: rgba(245, 196, 81, 0.4); box-shadow: 0 0 24px rgba(245, 196, 81, 0.1); }
.elder-top { display: flex; align-items: center; gap: 10px; }
.elder-quote { font-style: italic; line-height: 1.5; }
.archive-foot { font-weight: 600; margin-top: 4px; }

/* ---------- S10 Light Exchange ---------- */

.balance { display: flex; flex-direction: column; gap: 2px; border-color: rgba(245, 196, 81, 0.4); box-shadow: 0 0 24px rgba(245, 196, 81, 0.1); }
.balance-num { font-size: 40px; font-weight: 800; line-height: 1.1; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(245, 196, 81, 0.45); }
.offer-row { display: flex; align-items: center; gap: 12px; }
.panel.offer-row { padding: 12px 14px; }
.offer-btns { display: flex; align-items: center; gap: 8px; flex: none; }
.session { display: flex; flex-direction: column; gap: 8px; }
.session .offer-row { padding: 0; }
.session.s-done { border-color: rgba(46, 211, 192, 0.5); }

/* ---------- S11 Landing Missions ---------- */

.mission { display: flex; flex-direction: column; gap: 10px; scroll-margin: 12px; }
.mission:focus { outline: none; }
.mission.focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 196, 81, 0.5), 0 0 28px rgba(245, 196, 81, 0.25); }
.mission.done { border-color: rgba(46, 211, 192, 0.5); }
.mission .badges { margin: 4px 0 0; }
.mission-done { display: flex; align-items: center; gap: 4px; font-weight: 600; }

/* ---------- S12 Constellation and ranks ---------- */

.sky-panel { padding: 6px; }
.sky-svg { display: block; width: 100%; height: auto; }
.sky-dot { fill: #fff; }
.sky-line { stroke: var(--teal); stroke-linecap: round; opacity: 0.85; filter: drop-shadow(0 0 3px rgba(46, 211, 192, 0.7)); }
.sky-name { font-size: 12px; font-weight: 600; fill: var(--text); pointer-events: none; }
.sky-name.me { fill: var(--gold); font-weight: 800; }
.sky-star { cursor: pointer; outline: none; }
.sky-star .st-ring { stroke: rgba(238, 241, 255, 0.3); stroke-width: 1.5; }
.sky-star.met .st-ring { stroke: var(--teal); stroke-width: 2; }
.sky-star .st-core { filter: drop-shadow(0 0 5px rgba(238, 241, 255, 0.9)); }
.sky-star:hover .st-ring, .sky-star.picked .st-ring { stroke: var(--gold); stroke-width: 2.5; }
.sky-star:focus-visible .st-ring { stroke: var(--gold); stroke-width: 3; stroke-dasharray: 4 3; }
.star-detail { min-height: 64px; display: flex; flex-direction: column; gap: 8px; }
.did-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

.ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rung { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.rung.here { border-color: var(--gold); box-shadow: 0 0 22px rgba(245, 196, 81, 0.25); }
.rung-dot { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--panel-line); color: #070B1F; }
.rung.reached .rung-dot { background: var(--gold); border-color: var(--gold); }
.rung-dot svg { width: 16px; height: 16px; stroke-width: 3; }
.rung-state { flex: none; font-weight: 700; color: var(--text-dim); }
.rung.here .rung-state { color: var(--gold); }
.rung.reached:not(.here) .rung-state { color: var(--teal); }

/* ---------- S13 Privacy and settings ---------- */

.know-list { margin: 0 0 10px; display: flex; flex-direction: column; gap: 10px; }
.know-row { display: flex; flex-direction: column; gap: 1px; }
.know-row dt { font-size: 13px; color: var(--text-dim); }
.know-row dd { margin: 0; }
.never-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.never-list li { display: flex; align-items: center; gap: 10px; }
.never-ic { display: inline-flex; flex: none; color: var(--ember); }
.danger-zone { border-color: rgba(255, 138, 92, 0.5); display: flex; flex-direction: column; gap: 10px; }
.danger-zone .panel-h { margin-bottom: 0; }

/* ======================================================================
   M7: game layer: the Ascend moment
   ====================================================================== */

/* A short burst of light, the new rank name and the word "Ascend": 1.4 s in all, never blocks a tap.
   Skipped with reduced motion (the rank-up is then a plain message). */
.ascend {
  position: absolute; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; pointer-events: none;
  animation: ascend-veil 1.4s ease-out forwards;
}
.ascend-burst {
  position: absolute; left: 50%; top: 50%;
  width: 160px; height: 160px; margin: -80px 0 0 -80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 249, 230, 1) 0, rgba(245, 196, 81, 0.85) 22%, rgba(226, 91, 201, 0.35) 48%, rgba(139, 108, 255, 0.18) 60%, transparent 72%);
  animation: ascend-burst 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.ascend-rays {
  position: absolute; left: 50%; top: 50%;
  width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(245, 196, 81, 0.32) 0deg 3deg, transparent 3deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0, #000 18%, transparent 62%);
  mask: radial-gradient(circle, #000 0, #000 18%, transparent 62%);
  animation: ascend-rays 1.4s ease-out forwards;
}
.ascend-core {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-align: center;
  animation: ascend-core 1.4s ease-out forwards;
}
.ascend-core .rank-badge { filter: drop-shadow(0 0 18px rgba(245, 196, 81, 0.9)); margin-bottom: 6px; }
.ascend-word {
  font-size: 15px; font-weight: 800; letter-spacing: 0.5em; padding-left: 0.5em; text-transform: uppercase;
  color: var(--gold); text-shadow: 0 0 12px rgba(245, 196, 81, 0.8);
}
.ascend-rank {
  font-size: 44px; font-weight: 800; line-height: 1.1; color: #FFF9E6;
  text-shadow: 0 0 18px rgba(245, 196, 81, 0.9), 0 0 42px rgba(139, 108, 255, 0.7);
}
@keyframes ascend-veil {
  0% { background: rgba(7, 11, 31, 0); }
  15% { background: rgba(7, 11, 31, 0.6); }
  78% { opacity: 1; background: rgba(7, 11, 31, 0.6); }
  100% { opacity: 0; background: rgba(7, 11, 31, 0.6); }
}
@keyframes ascend-burst {
  0% { transform: scale(0.1); opacity: 0; }
  10% { opacity: 1; }
  40% { transform: scale(2.8); opacity: 0.95; }
  100% { transform: scale(5.5); opacity: 0; }
}
@keyframes ascend-rays {
  0% { transform: scale(0.3) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: scale(1.15) rotate(24deg); opacity: 0; }
}
@keyframes ascend-core {
  0% { transform: scale(0.6); opacity: 0; }
  22% { transform: scale(1.06); opacity: 1; }
  34% { transform: scale(1); }
  78% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-12px); }
}
