:root {
  color-scheme: dark;
  --bg-deep: #08111f;
  --bg-blue: #102b4a;
  --bg-ink: #07101c;
  --card: rgba(18, 42, 72, 0.72);
  --card-strong: rgba(10, 22, 40, 0.92);
  --line: rgba(0, 212, 255, 0.32);
  --line-strong: rgba(0, 212, 255, 0.72);
  --text: #e8f4ff;
  --muted: #9ab5d6;
  --dim: #6e86a6;
  --cyan: #00d4ff;
  --blue: #4d9fff;
  --pink: #ff6b9d;
  --amber: #ffb347;
  --mint: #5fffb7;
  --violet: #a88cff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(circle at 20% 8%, rgba(77, 159, 255, 0.22), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(255, 107, 157, 0.14), transparent 26%),
    linear-gradient(135deg, var(--bg-deep), var(--bg-blue) 55%, #18213d);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

code {
  color: var(--mint);
  font-family: var(--mono);
}

#starfield,
.scanline,
.gridveil {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#starfield {
  z-index: -3;
}

.gridveil {
  z-index: -2;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 80%, transparent 100%);
}

.scanline {
  z-index: -1;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0) 2px,
    rgba(0, 212, 255, 0.035) 2px,
    rgba(0, 212, 255, 0.035) 4px
  );
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 14px 18px 8px;
  backdrop-filter: blur(16px);
}

.brandmark {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-shadow: 0 0 16px rgba(0, 212, 255, 0.65);
}

.brand-sigil {
  color: var(--cyan);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0, 212, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.72);
  color: var(--text);
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.1);
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--cyan);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 26px 18px 72px;
}

.home-view {
  display: grid;
  gap: 22px;
  width: min(100%, 520px);
  margin: 0 auto;
}

.astro-ring {
  position: relative;
  width: 152px;
  height: 152px;
  margin: 6px auto 0;
}

.astro-ring span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 212, 255, 0.58);
  border-radius: 50%;
  box-shadow: inset 0 0 26px rgba(0, 212, 255, 0.16), 0 0 34px rgba(0, 212, 255, 0.18);
  animation: spin 18s linear infinite;
}

.astro-ring span:nth-child(2) {
  inset: 18px;
  border-color: rgba(255, 107, 157, 0.42);
  animation-duration: 12s;
  animation-direction: reverse;
}

.astro-ring span:nth-child(3) {
  inset: 48px;
  border-color: rgba(255, 179, 71, 0.5);
  animation-duration: 9s;
}

.astro-ring::before,
.astro-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.7), transparent);
  transform: translate(-50%, -50%) rotate(24deg);
}

.astro-ring::after {
  transform: translate(-50%, -50%) rotate(-57deg);
  background: linear-gradient(90deg, transparent, rgba(255, 107, 157, 0.52), transparent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hero-copy {
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
}

h1 {
  font-family: var(--mono);
  font-size: clamp(42px, 10vw, 68px);
  text-shadow: 0 0 22px rgba(0, 212, 255, 0.62), 0 0 42px rgba(77, 159, 255, 0.28);
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 15px;
}

.manifesto {
  max-width: 420px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.panel,
.module-card,
.phase-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow), 0 0 24px rgba(0, 212, 255, 0.13);
  backdrop-filter: blur(16px) saturate(145%);
}

.panel {
  padding: 20px;
}

.panel-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  font-size: 20px;
}

.upload-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
}

.upload-heading .eyebrow,
.upload-heading h2 {
  grid-column: 1;
}

.help-pdf-trigger {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  padding: 8px 10px;
  border: 1px solid rgba(247, 215, 120, 0.5);
  border-radius: 5px;
  background: rgba(247, 215, 120, 0.09);
  color: #ffe8a6;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.help-pdf-trigger:hover {
  border-color: #f7d778;
  background: rgba(247, 215, 120, 0.16);
}

.upload-alt-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.direct-report-trigger {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #f7d778;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.direct-report-trigger:hover {
  color: #fff0b7;
}

.source-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.source-option {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(154, 181, 214, 0.28);
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.58);
  color: var(--text);
  text-align: left;
  transition: 0.2s ease;
}

.source-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.source-option.selected {
  border-color: var(--amber);
  background: rgba(255, 179, 71, 0.1);
  box-shadow: 0 0 20px rgba(255, 179, 71, 0.12);
}

.birth-source-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(247, 215, 120, 0.3);
  border-radius: 8px;
  background: rgba(5, 12, 26, 0.46);
}

.birth-form-grid,
.coordinate-grid {
  display: grid;
  min-width: 0;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.coordinate-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.coordinate-input {
  display: grid;
  grid-template-columns: minmax(88px, 0.75fr) minmax(0, 1.25fr);
  gap: 8px;
}

.coordinate-direction {
  cursor: pointer;
}

.birth-field {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.birth-field .text-input {
  display: block;
  max-width: 100%;
}

.birth-field input[type="date"],
.birth-field input[type="time"] {
  box-sizing: border-box;
  inline-size: 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

.birth-field input[type="date"]::-webkit-date-and-time-value,
.birth-field input[type="time"]::-webkit-date-and-time-value {
  min-width: 0;
  margin: 0;
  text-align: left;
}

.birth-field input[type="date"]::-webkit-calendar-picker-indicator,
.birth-field input[type="time"]::-webkit-calendar-picker-indicator {
  margin-left: auto;
}

/* iOS WebKit gives date/time controls a non-shrinking intrinsic width. */
@supports (-webkit-touch-callout: none) {
  .birth-form-grid {
    overflow: hidden;
  }

  .birth-form-grid > .birth-field {
    overflow: hidden;
    width: 100%;
    max-width: 100%;
  }

  .birth-field input[type="date"],
  .birth-field input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    overflow: hidden;
  }
}

.birth-place-field {
  position: relative;
}

.place-suggestions {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  overflow: auto;
  max-height: 230px;
  padding: 6px;
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 8px;
  background: rgba(6, 14, 28, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.place-suggestion {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.place-suggestion:hover,
.place-suggestion:focus-visible {
  background: rgba(0, 212, 255, 0.1);
  outline: none;
}

.place-suggestion small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.birth-source-warning {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 204, 102, 0.42);
  border-radius: 8px;
  background: rgba(255, 190, 74, 0.08);
  color: #ffe2a6;
  font-size: 13px;
  line-height: 1.7;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 9px;
  min-height: 172px;
  padding: 22px;
  border: 2px dashed rgba(0, 212, 255, 0.42);
  border-radius: 8px;
  background: rgba(3, 13, 26, 0.5);
  text-align: center;
  transition: 0.24s ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.08);
  box-shadow: inset 0 0 32px rgba(0, 212, 255, 0.12);
}

.intake-notice {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid rgba(247, 215, 120, 0.58);
  border-radius: 6px;
  background: rgba(247, 215, 120, 0.1);
  color: #fff1c8;
  font-size: 14px;
  line-height: 1.75;
  text-align: left;
}

.intake-notice.available {
  border-color: rgba(83, 218, 176, 0.45);
  background: rgba(83, 218, 176, 0.08);
  color: #c9f7e8;
}

.dropzone.paused {
  cursor: not-allowed;
  border-color: rgba(191, 197, 216, 0.2);
  background: rgba(11, 15, 34, 0.28);
  color: #8f98ae;
  opacity: 0.62;
  box-shadow: none;
}

.dropzone.paused:hover {
  border-color: rgba(191, 197, 216, 0.2);
  background: rgba(11, 15, 34, 0.28);
  box-shadow: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 50%;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 28px;
}

.dropzone small,
.microcopy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(95, 255, 183, 0.32);
  border-radius: 8px;
  background: rgba(95, 255, 183, 0.08);
  color: var(--mint);
  font-size: 13px;
}

.chip-action,
.ghost-button {
  border: 1px solid rgba(154, 181, 214, 0.34);
  border-radius: 8px;
  background: rgba(232, 244, 255, 0.06);
  color: var(--text);
}

.chip-action {
  padding: 8px 10px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gender-card {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 104px;
  border: 1px solid rgba(0, 212, 255, 0.32);
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.62);
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gender-card span {
  color: var(--cyan);
  font-size: 30px;
  text-shadow: 0 0 16px rgba(0, 212, 255, 0.7);
}

.gender-card.selected {
  transform: scale(1.03);
  border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.12);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.28);
}

.action-stack {
  display: grid;
  gap: 10px;
  text-align: center;
}

.primary-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--blue) 58%, var(--pink));
  color: #03101e;
  font-family: var(--mono);
  font-weight: 800;
  box-shadow: 0 0 28px rgba(0, 212, 255, 0.38);
  transition: transform 0.16s ease, filter 0.2s ease, opacity 0.2s ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.01);
  filter: brightness(1.08);
}

.primary-button:active:not(:disabled) {
  transform: scale(0.98);
}

.primary-button:disabled {
  cursor: not-allowed;
  background: linear-gradient(135deg, #394b61, #223143);
  color: #94a5b8;
  box-shadow: none;
  opacity: 0.78;
}

.primary-button.compact,
.ghost-button {
  width: auto;
  min-height: 42px;
  padding: 0 16px;
}

.result-layout {
  display: grid;
  gap: 22px;
}

.result-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 28px;
  border: 1px solid rgba(0, 212, 255, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(8, 17, 31, 0.9), rgba(20, 52, 88, 0.72));
  box-shadow: var(--shadow);
}

.result-hero h1,
.page-title {
  font-size: clamp(28px, 6vw, 44px);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(0, 212, 255, 0.28);
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.08);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

.badge.pink {
  border-color: rgba(255, 107, 157, 0.45);
  background: rgba(255, 107, 157, 0.12);
}

.badge.amber {
  border-color: rgba(255, 179, 71, 0.52);
  background: rgba(255, 179, 71, 0.12);
  color: #ffe3b8;
}

.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.module-card {
  min-height: 186px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow), 0 0 32px rgba(0, 212, 255, 0.32);
}

.module-card h2 {
  margin-top: 10px;
  font-size: 21px;
}

.module-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.module-card .arrow {
  margin-top: 18px;
  color: var(--cyan);
  font-family: var(--mono);
}

.result-card {
  padding: 22px;
}

.result-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.result-content {
  color: var(--text);
  font-size: 15px;
  line-height: 1.78;
}

.result-content.collapsed {
  max-height: 250px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 72%, transparent);
}

.result-content h2,
.result-content h3 {
  margin: 24px 0 10px;
  color: var(--text);
}

.result-content p {
  margin: 0 0 14px;
}

.result-content ul,
.result-content ol {
  padding-left: 22px;
}

.result-content blockquote,
.warning-block {
  margin: 16px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  background: rgba(255, 179, 71, 0.12);
}

.planet-chip {
  display: inline-flex;
  align-items: center;
  margin: 2px 4px 2px 0;
  padding: 3px 8px;
  border: 1px solid rgba(95, 255, 183, 0.34);
  border-radius: 999px;
  background: rgba(95, 255, 183, 0.09);
  color: #c7ffe5;
  font-family: var(--mono);
  font-size: 12px;
}

.inline-action {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(0, 212, 255, 0.34);
  border-radius: 8px;
  background: rgba(0, 212, 255, 0.08);
  color: var(--cyan);
}

.page-stack {
  display: grid;
  gap: 18px;
}

.phase-list {
  display: grid;
  gap: 16px;
}

.phase-card {
  padding: 20px;
}

.phase-card h2 {
  font-size: 20px;
}

.phase-card p {
  color: var(--muted);
  line-height: 1.7;
}

.skeleton {
  position: relative;
  overflow: hidden;
  min-height: 160px;
  border-radius: 8px;
  background: rgba(232, 244, 255, 0.06);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.18), transparent);
  animation: sweep 1.4s infinite;
}

@keyframes sweep {
  to {
    transform: translateX(100%);
  }
}

.timeline {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 16px currentColor;
}

.timeline-item.serious .timeline-dot {
  background: var(--violet);
}

.timeline-item.official .timeline-dot {
  background: var(--amber);
}

.vision-card {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 32px;
  border: 1px solid rgba(255, 179, 71, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 179, 71, 0.14), transparent),
    linear-gradient(160deg, rgba(8, 17, 31, 0.94), rgba(42, 28, 62, 0.84));
  text-align: center;
}

.vision-card h2 {
  color: #ffe4ba;
  font-size: clamp(24px, 6vw, 40px);
}

.hidden {
  display: none !important;
}

.settings-dialog {
  width: min(92vw, 520px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.settings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.help-pdf-dialog {
  width: min(92vw, 620px);
  max-height: 90dvh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.help-pdf-dialog::backdrop {
  background: rgba(4, 7, 18, 0.78);
  backdrop-filter: blur(8px);
}

.help-pdf-panel {
  position: relative;
  max-height: 90dvh;
  margin: 0;
  padding: 20px;
  overflow-y: auto;
  border: 1px solid rgba(247, 215, 120, 0.36);
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(37, 38, 68, 0.98), rgba(15, 24, 47, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.help-pdf-panel h2 {
  margin: 5px 44px 16px 0;
  color: #fff4d5;
  font-size: 24px;
}
.help-pdf-instructions {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-left: 2px solid rgba(247, 215, 120, 0.72);
  background: rgba(255, 255, 255, 0.045);
  color: #e8eaf3;
  line-height: 1.75;
}

.help-pdf-instructions p {
  margin: 0 0 4px;
  color: #fff4d5;
  font-weight: 700;
}

.help-pdf-instructions ol {
  margin: 0;
  padding-left: 1.5em;
}

.direct-report-note {
  margin: -4px 0 16px;
  color: #d7dced;
  font-size: 14px;
  line-height: 1.7;
}

.direct-report-note a {
  color: #ffe59a;
  overflow-wrap: anywhere;
}

.help-pdf-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(247, 215, 120, 0.35);
  border-radius: 50%;
  background: rgba(8, 13, 31, 0.66);
  color: #fff4d5;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.help-pdf-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.settings-panel {
  margin: 0;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.text-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 8px;
  background: rgba(2, 9, 18, 0.72);
  color: var(--text);
  font-size: 16px;
}

@media (max-width: 560px) {
  .source-selector,
  .birth-form-grid,
  .coordinate-grid {
    grid-template-columns: 1fr;
  }

  .coordinate-input {
    grid-template-columns: 112px minmax(0, 1fr);
  }
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (min-width: 768px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phase-list.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-content {
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .topbar {
    padding-inline: 12px;
  }

  .panel,
  .result-card,
  .phase-card,
  .module-card {
    padding: 16px;
  }

  .result-card header {
    display: grid;
  }
}

.progress-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 179, 71, 0.34);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.11), rgba(0, 212, 255, 0.08));
  box-shadow: inset 0 0 28px rgba(255, 179, 71, 0.08), 0 0 26px rgba(0, 212, 255, 0.12);
}

.progress-topline,
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.progress-topline h2 {
  font-size: 20px;
}

.progress-track {
  overflow: hidden;
  height: 12px;
  border: 1px solid rgba(0, 212, 255, 0.36);
  border-radius: 999px;
  background: rgba(3, 13, 26, 0.58);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--pink));
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.55);
  transition: width 0.45s ease;
}

.progress-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.wait-note {
  color: #c7dfff;
}

@media (max-width: 520px) {
  .progress-topline,
  .progress-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Celestial visual refresh: content remains readable above a luminous layered night sky. */
:root {
  --bg-deep: #101427;
  --bg-blue: #172646;
  --bg-ink: #0d1222;
  --card: rgba(20, 28, 51, 0.72);
  --card-strong: rgba(14, 19, 38, 0.88);
  --line: rgba(244, 221, 176, 0.26);
  --line-strong: rgba(255, 229, 166, 0.72);
  --text: #f8f2e9;
  --muted: #c0c6dd;
  --dim: #858ba8;
  --cyan: #b9deff;
  --blue: #8fa9ff;
  --pink: #ef9ed4;
  --amber: #f1cc78;
  --mint: #a7eed8;
  --violet: #c2a9f8;
  --shadow: 0 22px 58px rgba(4, 7, 21, 0.38);
}

html {
  background:
    radial-gradient(ellipse at 44% -10%, rgba(117, 111, 204, 0.35), transparent 43%),
    radial-gradient(ellipse at 100% 38%, rgba(117, 194, 213, 0.22), transparent 42%),
    radial-gradient(ellipse at 12% 76%, rgba(209, 133, 190, 0.16), transparent 42%),
    linear-gradient(145deg, #171a35 0%, #10172d 48%, #192a49 100%);
}

body::before, body::after, .nebula-glow, .stardust { position: fixed; inset: 0; pointer-events: none; }
body::before {
  z-index: -5;
  content: "";
  background-image:
    radial-gradient(circle at 7% 16%, rgba(255, 248, 220, 0.85) 0 1px, transparent 1.6px),
    radial-gradient(circle at 18% 72%, rgba(255, 238, 192, 0.8) 0 1px, transparent 1.7px),
    radial-gradient(circle at 78% 13%, rgba(230, 233, 255, 0.8) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 89% 83%, rgba(255, 244, 199, 0.7) 0 1px, transparent 1.7px),
    radial-gradient(circle at 66% 64%, rgba(225, 228, 255, 0.6) 0 1px, transparent 1.6px);
  background-size: 190px 180px, 260px 220px, 220px 210px, 300px 260px, 170px 160px;
  opacity: 0.78;
}
body::after { z-index: -4; content: ""; background: radial-gradient(ellipse at center, transparent 34%, rgba(5, 8, 24, 0.28) 100%); }
.nebula-glow { z-index: -4; filter: blur(38px); opacity: 0.62; }
.nebula-one { background: radial-gradient(ellipse 38% 26% at 8% 42%, rgba(129, 113, 224, 0.45), transparent 72%); animation: nebulaDrift 16s ease-in-out infinite alternate; }
.nebula-two { background: radial-gradient(ellipse 35% 24% at 92% 70%, rgba(240, 143, 184, 0.3), transparent 70%); animation: nebulaDrift 21s ease-in-out -7s infinite alternate-reverse; }
.stardust { z-index: -2; opacity: 0.5; background-image: radial-gradient(circle, rgba(255, 240, 198, 0.85) 0 1px, transparent 1.3px), radial-gradient(circle, rgba(214, 224, 255, 0.7) 0 0.7px, transparent 1.1px); background-size: 72px 72px, 49px 49px; background-position: 0 0, 23px 17px; mask-image: linear-gradient(to bottom, transparent, black 16%, black 86%, transparent); }
@keyframes nebulaDrift { to { transform: translate3d(3%, -2%, 0) scale(1.08); } }
#starfield { z-index: -3; opacity: 0.7; }
.gridveil { display: none; }
.scanline { z-index: -1; opacity: 0.14; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(230, 219, 255, 0.035) 3px 4px); }

.topbar { width: min(100%, 1120px); padding-top: 10px; background: linear-gradient(to bottom, rgba(16, 20, 39, 0.72), transparent); }
.brandmark { color: #fff3d7; text-shadow: 0 0 18px rgba(250, 215, 143, 0.52); }
.brand-sigil { color: var(--amber); }
.icon-button { border-color: rgba(244, 221, 176, 0.28); background: rgba(23, 27, 53, 0.62); }
.icon-button:hover { border-color: var(--amber); color: var(--amber); }
.app-shell { width: min(100%, 1120px); padding-top: 12px; padding-bottom: 44px; }
.home-view { width: min(100%, 620px); gap: 14px; }
.astro-ring { width: 96px; height: 96px; margin: 0 auto -4px; filter: drop-shadow(0 0 18px rgba(246, 208, 122, 0.4)); }
.astro-ring span { border-color: rgba(247, 222, 161, 0.52); box-shadow: inset 0 0 20px rgba(242, 205, 126, 0.14), 0 0 20px rgba(215, 181, 255, 0.16); }
.astro-ring span:nth-child(2) { inset: 13px; border-color: rgba(201, 168, 249, 0.54); }
.astro-ring span:nth-child(3) { inset: 31px; border-color: rgba(241, 204, 120, 0.78); }
.astro-ring::before { background: linear-gradient(90deg, transparent, rgba(255, 226, 156, 0.85), transparent); }
.astro-ring::after { background: linear-gradient(90deg, transparent, rgba(215, 185, 255, 0.62), transparent); }
.hero-copy .eyebrow, .eyebrow { color: #f1ce80; text-shadow: 0 0 12px rgba(241, 204, 120, 0.28); }
h1 { font-size: clamp(38px, 8vw, 56px); color: #fff8e9; text-shadow: 0 2px 18px rgba(250, 224, 160, 0.34), 0 0 38px rgba(158, 142, 240, 0.24); }
.subtitle { color: #e9d6aa; }
.manifesto { margin-top: 12px; color: #c9cde0; line-height: 1.72; }

.panel, .module-card, .phase-card, .result-card, .progress-card { border-color: rgba(242, 223, 185, 0.27); background: linear-gradient(135deg, rgba(35, 38, 69, 0.79), rgba(17, 23, 47, 0.76)); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 248, 228, 0.07); backdrop-filter: blur(18px) saturate(122%); }
.panel { padding: 17px 18px; }
.panel-heading { margin-bottom: 12px; }
.panel-heading h2 { font-size: 19px; color: #fff5df; }
.dropzone { min-height: 132px; border-color: rgba(242, 204, 112, 0.34); background: rgba(11, 15, 34, 0.42); }
.dropzone:hover, .dropzone.dragging { border-color: var(--amber); background: rgba(241, 204, 120, 0.08); box-shadow: inset 0 0 32px rgba(241, 204, 120, 0.08); }
.upload-icon { width: 42px; height: 42px; border-color: rgba(242, 204, 112, 0.5); color: #f8d77f; font-size: 25px; }
.gender-card { min-height: 84px; border-color: rgba(242, 223, 185, 0.24); background: rgba(11, 15, 35, 0.45); }
.gender-card span { color: #f1ce80; text-shadow: 0 0 16px rgba(241, 204, 120, 0.52); }
.gender-card.selected { border-color: var(--amber); background: rgba(241, 204, 120, 0.11); box-shadow: 0 0 26px rgba(241, 204, 120, 0.16); }
.primary-button { min-height: 50px; background: linear-gradient(135deg, #f7d778, #d7a95a 58%, #e6b5d5); color: #2b2030; box-shadow: 0 8px 24px rgba(241, 204, 120, 0.27); }
.microcopy, .dropzone small { color: #bfc5d8; }

.result-layout, .page-stack { gap: 16px; }
.result-hero { padding: 22px; border-color: rgba(242, 223, 185, 0.25); background: linear-gradient(135deg, rgba(45, 43, 79, 0.78), rgba(18, 31, 57, 0.74)); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 244, 211, 0.08); }
.badge { border-color: rgba(242, 223, 185, 0.3); background: rgba(255, 240, 203, 0.08); color: #f7f0e0; }
.badge.pink { border-color: rgba(239, 158, 212, 0.52); background: rgba(239, 158, 212, 0.12); }
.badge.amber { border-color: rgba(241, 204, 120, 0.6); background: rgba(241, 204, 120, 0.13); color: #ffe8b1; }
.module-card:hover { border-color: rgba(255, 224, 155, 0.78); box-shadow: var(--shadow), 0 0 36px rgba(176, 156, 243, 0.22); }
.module-card .arrow, .inline-action { color: #f5d682; }
.inline-action { border-color: rgba(242, 204, 112, 0.42); background: rgba(242, 204, 112, 0.08); }
.progress-card { background: linear-gradient(135deg, rgba(77, 56, 88, 0.74), rgba(20, 38, 67, 0.74)); }
.progress-track { border-color: rgba(242, 204, 112, 0.34); background: rgba(8, 12, 29, 0.5); }
.progress-track span { background: linear-gradient(90deg, #bfa1f5, #f2cf79, #eaa2cb); box-shadow: 0 0 18px rgba(241, 204, 120, 0.45); }
.vision-card { border-color: rgba(242, 204, 112, 0.32); background: linear-gradient(135deg, rgba(241, 204, 120, 0.13), transparent), linear-gradient(160deg, rgba(32, 27, 60, 0.9), rgba(29, 47, 80, 0.78)); }

@media (min-width: 900px) {
  .home-view { gap: 13px; }
  .home-view .panel { padding: 15px 18px; }
  .home-view .dropzone { min-height: 116px; }
  .home-view .action-stack { margin-top: 2px; }
}.astro-ring { background: url("./assets/celestial-star.png") center / contain no-repeat; }
.astro-ring span { opacity: 0.55; }
.astro-ring::before, .astro-ring::after { opacity: 0.62; }

.timeline-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 8px;
  padding: 2px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  vertical-align: middle;
}
.timeline-tag.pink { color: #ffafd9; background: rgba(239, 158, 212, 0.14); }
.timeline-tag.violet { color: #cdb5ff; background: rgba(194, 169, 248, 0.14); }
.timeline-tag.gold { color: #ffe092; background: rgba(241, 204, 120, 0.14); }
/* Paid full-text report export preview. */
.report-export-entry { display: grid; gap: 7px; justify-items: start; padding-top: 14px; border-top: 1px solid rgba(242, 204, 112, 0.22); }
.report-export-trigger { padding: 9px 13px; border: 1px solid rgba(242, 204, 112, 0.58); border-radius: 6px; background: rgba(242, 204, 112, 0.1); color: #ffe5a0; font: inherit; font-size: 13px; cursor: pointer; }
.report-export-trigger:hover { border-color: #ffe199; background: rgba(242, 204, 112, 0.17); }
.report-export-dialog { width: min(94vw, 820px); max-height: 92dvh; padding: 0; border: 0; background: transparent; color: var(--text); }
.report-export-dialog::backdrop { background: rgba(5, 7, 19, 0.82); backdrop-filter: blur(9px); }
.report-export-panel { position: relative; display: grid; gap: 16px; max-height: 92dvh; margin: 0; padding: 22px; overflow-y: auto; border: 1px solid rgba(242, 215, 159, 0.4); border-radius: 8px; background: linear-gradient(145deg, rgba(40, 38, 72, 0.98), rgba(15, 25, 49, 0.98)); box-shadow: 0 28px 80px rgba(2, 5, 17, 0.62), inset 0 1px 0 rgba(255, 247, 225, 0.08); }
.report-export-panel h2 { margin: 0 44px 0 0; color: #fff4d8; font-size: 26px; }
.report-export-intro { margin: -6px 0 0; color: #cbd0e4; line-height: 1.7; }
.pdf-preview-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.report-export-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid rgba(242, 215, 159, 0.38); border-radius: 50%; background: rgba(10, 14, 31, 0.66); color: #fff2d3; font-size: 24px; cursor: pointer; }
.export-payment-grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 16px; align-items: stretch; }
.payment-code-card, .receipt-card { min-width: 0; min-height: 330px; border: 1px solid rgba(242, 215, 159, 0.25); border-radius: 7px; background: rgba(9, 14, 31, 0.46); }
.payment-code-card { display: grid; gap: 10px; align-content: start; padding: 14px; }
.payment-card-label { color: #f7d987; font-family: var(--mono); font-size: 12px; }
.payment-code-card img { display: block; width: 100%; max-height: 330px; object-fit: contain; border-radius: 5px; background: #fff; }
.receipt-card { display: grid; padding: 14px; }
.receipt-dropzone { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 300px; padding: 24px; border: 2px dashed rgba(242, 204, 112, 0.42); border-radius: 6px; background: rgba(23, 28, 53, 0.4); text-align: center; cursor: pointer; transition: 0.2s ease; }
.receipt-dropzone:hover, .receipt-dropzone.dragging { border-color: #f1cc78; background: rgba(241, 204, 120, 0.09); }
.receipt-dropzone small { color: #aeb6cf; }
.receipt-upload-icon { color: #f4d27f; font-size: 36px; }
.receipt-preview { display: grid; gap: 12px; align-content: start; }
.receipt-preview img { width: 100%; height: 250px; object-fit: contain; border-radius: 6px; background: rgba(4, 7, 17, 0.72); }
.receipt-check { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid rgba(194, 169, 248, 0.3); border-radius: 6px; background: rgba(194, 169, 248, 0.08); }
.receipt-check.complete { border-color: rgba(167, 238, 216, 0.38); background: rgba(167, 238, 216, 0.08); }
.receipt-check-meta { display: flex; justify-content: space-between; gap: 12px; color: #d7dcf0; font-family: var(--mono); font-size: 12px; }
.receipt-check-track { overflow: hidden; height: 8px; border-radius: 999px; background: rgba(5, 8, 21, 0.66); }
.receipt-check-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #bda1f4, #f3d17e, #eca5cf); box-shadow: 0 0 16px rgba(241, 204, 120, 0.45); transition: width 0.08s linear; }
.receipt-status { margin: -4px 0 0; }
@media (max-width: 680px) {
  .report-export-panel { padding: 18px 14px; }
  .export-payment-grid { grid-template-columns: 1fr; }
  .payment-code-card, .receipt-card { min-height: 0; }
  .payment-code-card img { max-height: 300px; }
  .receipt-dropzone { min-height: 210px; }
}

/* Home FAQ */
.home-view { position: relative; }
.faq-trigger { position: absolute; top: 2px; left: 0; z-index: 2; padding: 8px 11px; border: 1px solid rgba(242, 215, 159, 0.42); border-radius: 6px; background: rgba(18, 22, 48, 0.78); color: #f6dfa7; font: inherit; font-size: 12px; cursor: pointer; box-shadow: 0 8px 24px rgba(4, 7, 20, 0.24); }
.faq-trigger:hover { border-color: rgba(242, 215, 159, 0.74); background: rgba(39, 37, 69, 0.92); }
.faq-dialog { width: min(92vw, 650px); max-height: 88dvh; padding: 0; border: 0; background: transparent; color: var(--text); }
.faq-dialog::backdrop { background: rgba(5, 7, 19, 0.8); backdrop-filter: blur(8px); }
.faq-panel { position: relative; display: grid; gap: 14px; max-height: 88dvh; margin: 0; padding: 24px; overflow-y: auto; border: 1px solid rgba(242, 215, 159, 0.4); border-radius: 8px; background: linear-gradient(145deg, rgba(40, 38, 72, 0.98), rgba(15, 25, 49, 0.98)); box-shadow: 0 28px 80px rgba(2, 5, 17, 0.62); }
.faq-panel h2 { margin: 0 44px 0 0; color: #fff4d8; font-size: 26px; }
.faq-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid rgba(242, 215, 159, 0.38); border-radius: 50%; background: rgba(10, 14, 31, 0.66); color: #fff2d3; font-size: 24px; cursor: pointer; }
.faq-intro { margin: 0; color: #cbd0e4; line-height: 1.75; }
.faq-intro a, .faq-list a { color: #f3d57e; overflow-wrap: anywhere; }
.faq-list { display: grid; gap: 10px; }
.faq-list section { padding: 14px 16px; border: 1px solid rgba(204, 179, 241, 0.22); border-radius: 6px; background: rgba(9, 15, 35, 0.36); }
.faq-list h3 { margin: 0 0 7px; color: #fff5dc; font-size: 16px; line-height: 1.55; }
.faq-list p { margin: 0; color: #cbd0e4; line-height: 1.75; }
@media (max-width: 680px) { .faq-trigger { top: 0; left: 0; font-size: 11px; } .faq-panel { padding: 20px 16px; } .faq-panel h2 { font-size: 23px; } }
