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

:root {
  --bg-deep: #070b14;
  --card-bg: rgba(15, 23, 42, 0.92);
  --card-border: rgba(251, 191, 36, 0.28);
  --accent-gold: #fbbf24;
  --accent-sky: #38bdf8;
  --accent-emerald: #34d399;
}

body {
  background: radial-gradient(circle at 50% 8%, rgba(245, 158, 11, 0.16), rgba(14, 116, 144, 0.1) 42%, #060913 85%);
  color: #f8fafc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  line-height: 1.55;
  transition: background 0.5s ease;
}

body[data-solar-phase="boqer"] {
  background: radial-gradient(circle at 30% 12%, rgba(251, 191, 36, 0.24), rgba(234, 88, 12, 0.12) 45%, #070b14 88%);
}

body[data-solar-phase="yom"] {
  background: radial-gradient(circle at 50% 10%, rgba(56, 189, 248, 0.24), rgba(250, 204, 21, 0.1) 48%, #071120 90%);
}

body[data-solar-phase="erev"] {
  background: radial-gradient(circle at 70% 14%, rgba(249, 115, 22, 0.24), rgba(147, 51, 234, 0.15) 48%, #090716 90%);
}

body[data-solar-phase="laylah"] {
  background: radial-gradient(circle at 50% 15%, rgba(99, 102, 241, 0.2), rgba(15, 23, 42, 0.2) 50%, #04060c 92%);
}

.hello-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.hello-card {
  width: 100%;
  max-width: 820px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1.1rem;
  padding: 1.5rem 1.75rem;
  text-align: left;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(251, 191, 36, 0.07);
  backdrop-filter: blur(12px);
}

.card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fde68a;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
}

.step-tabs {
  display: flex;
  gap: 0.45rem;
}

.step-tab {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.5rem;
  padding: 0.36rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.step-tab:hover {
  color: #ffffff;
  border-color: #fbbf24;
  transform: translateY(-1px);
}

.step-tab.active {
  background: linear-gradient(135deg, #d97706, #0284c7);
  color: #ffffff;
  border-color: #fde68a;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.35);
}

/* Interactive SVG Observatory */
.observatory-shell {
  background: #090d18;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem 1rem;
  margin-bottom: 1.25rem;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.65);
}

.observatory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.obs-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.obs-eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.obs-live-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fef08a;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.obs-action-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.obs-btn {
  border-radius: 0.5rem;
  padding: 0.38rem 0.8rem;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.obs-btn.sunrise-btn {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #090d16;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

.obs-btn.sunrise-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.obs-btn.cycle-btn {
  background: #1e293b;
  color: #e2e8f0;
  border-color: rgba(56, 189, 248, 0.4);
}

.obs-btn.cycle-btn:hover,
.obs-btn.cycle-btn[data-playing="true"] {
  background: #0284c7;
  color: #ffffff;
  border-color: #7dd3fc;
}

.svg-stage-wrap {
  width: 100%;
  border-radius: 0.65rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #050811;
}

#solar-horizon-svg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

@keyframes rotateCorona {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.25); }
}

#svg-sun-corona {
  animation: rotateCorona 18s linear infinite;
}

.svg-star {
  animation: starTwinkle 3.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.svg-hour-node,
.svg-phase-beacon,
.svg-callout {
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.svg-hour-node:hover circle,
.svg-phase-beacon:hover circle {
  stroke: #fef08a;
  stroke-width: 2.8px;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.85));
}

.svg-hour-node.active circle {
  fill: #facc15;
  stroke: #ffffff;
}

.svg-step-overlay[hidden] {
  display: none !important;
}

/* Observatory Controls & Scrubber */
.observatory-controls {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.scrubber-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.scrubber-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
}

#solar-hour-slider {
  flex: 1;
  min-width: 160px;
  accent-color: #f59e0b;
  cursor: pointer;
  height: 6px;
}

.scrubber-readout {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fde68a;
  min-width: 105px;
  text-align: right;
}

.phase-pill-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.phase-jump-btn {
  background: rgba(30, 41, 59, 0.78);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.45rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.phase-jump-btn:hover {
  border-color: #fbbf24;
  color: #ffffff;
}

.phase-jump-btn.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #fbbf24;
  color: #fef08a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.22);
}

.live-boundary-hud {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 0.45rem;
  padding: 0.48rem 0.75rem;
  font-size: 0.82rem;
  color: #e0f2fe;
}

.hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  flex-shrink: 0;
}

/* Micro-Card Panels */
.micro-card-panel[hidden] {
  display: none !important;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.hello-card h1 {
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.prov-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.18rem 0.5rem;
  border-radius: 0.35rem;
}

.prov-badge.solver {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

.section-caption {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.token-chip {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 0.55rem;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
  color: inherit;
  font-family: inherit;
}

.token-chip:hover {
  border-color: #fbbf24;
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.95);
}

.token-chip.active {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.22), rgba(15, 23, 42, 0.9));
  border-color: #fbbf24;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.25);
}

.token-surface {
  font-size: 1.18rem;
  font-weight: 700;
  color: #fde68a;
}

.token-meta {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.12rem;
}

.token-gloss {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 0.15rem;
}

.lexical-inspector {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.32);
  border-radius: 0.5rem;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.95rem;
  font-size: 0.83rem;
}

.lex-insp-badge {
  font-weight: 700;
  color: #fef08a;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.15rem 0.55rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.lex-insp-detail {
  color: #f8fafc;
}

.verse-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.verse-item {
  background: #0b1324;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-left: 3px solid #38bdf8;
  border-radius: 0.55rem;
  padding: 0.78rem 0.95rem;
  cursor: pointer;
  transition: all 0.16s ease;
}

.verse-item:hover,
.verse-item.active {
  border-color: rgba(251, 191, 36, 0.55);
  border-left-color: #fbbf24;
  background: #0f1a30;
}

.verse-ref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.verse-ref {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
}

.verse-solar-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.71rem;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.verse-orig {
  font-size: 1.1rem;
  color: #fde68a;
  margin-bottom: 0.3rem;
  line-height: 1.65;
}

.scripture-token-hl {
  background: rgba(250, 204, 21, 0.32);
  color: #ffffff;
  padding: 0.05rem 0.28rem;
  border-radius: 0.28rem;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.45);
}

.verse-eng {
  font-size: 0.93rem;
  color: #e2e8f0;
}

.solver-box {
  background: rgba(6, 78, 59, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 0.55rem;
  padding: 0.8rem 0.95rem;
  margin-bottom: 1rem;
}

.solver-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.solver-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #34d399;
}

.equation-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.83rem;
  color: #ecfdf5;
  padding: 0.2rem 0;
}

/* Interactive Boundary Verification Lab */
.challenge-box {
  background: rgba(30, 27, 75, 0.35);
  border: 1px solid rgba(129, 140, 248, 0.32);
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.1rem;
}

.challenge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.challenge-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a5b4fc;
}

.challenge-status {
  font-size: 0.73rem;
  color: #94a3b8;
}

.challenge-prompt {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.65rem;
}

.challenge-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.quiz-option-btn {
  text-align: left;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 0.45rem;
  padding: 0.55rem 0.8rem;
  color: #e2e8f0;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-option-btn:hover {
  border-color: #818cf8;
  background: rgba(30, 41, 59, 0.95);
}

.quiz-option-btn.correct {
  background: rgba(6, 95, 70, 0.45);
  border-color: #34d399;
  color: #ecfdf5;
}

.quiz-option-btn.incorrect {
  background: rgba(124, 45, 18, 0.4);
  border-color: #fb923c;
  color: #ffedd5;
}

.challenge-feedback {
  margin-top: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.45rem;
  font-size: 0.81rem;
  line-height: 1.45;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #d1fae5;
}

.card-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.step-counter {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
}

.nav-btn {
  border-radius: 0.5rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #1e293b;
  color: #f8fafc;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  border-color: #fbbf24;
}

.nav-btn.primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  color: #ffffff;
}

.nav-btn.primary:hover {
  filter: brightness(1.1);
}

.card-telemetry {
  margin-top: 0.95rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.16);
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  color: #64748b;
}

@media (max-width: 640px) {
  .hello-card {
    padding: 1.1rem;
  }
  .phase-pill-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-nav {
    flex-wrap: wrap;
  }
}
