:root {
  --earth-bg: #07111f;
  --earth-bg-soft: rgba(8, 20, 37, 0.74);
  --earth-panel: rgba(7, 17, 31, 0.82);
  --earth-panel-strong: rgba(10, 24, 44, 0.92);
  --earth-line: rgba(120, 190, 255, 0.18);
  --earth-line-strong: rgba(120, 190, 255, 0.34);
  --earth-text: #edf4ff;
  --earth-muted: rgba(237, 244, 255, 0.68);
  --earth-accent: #62d4ff;
  --earth-accent-strong: #89f0ff;
  --earth-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

body.earth-school-page {
  --qapp-border: rgba(237, 244, 255, 0.16);
  --qapp-border-strong: rgba(120, 190, 255, 0.34);
  --qapp-muted: rgba(237, 244, 255, 0.68);
  --qapp-text: #edf4ff;
  --qapp-gold: #89f0ff;
  background:
    linear-gradient(180deg, rgba(5, 12, 21, 0.72), rgba(5, 12, 21, 0.88)),
    url("/assets/soul.png") center center / cover no-repeat,
    radial-gradient(circle at top left, rgba(98, 212, 255, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(96, 135, 255, 0.16), transparent 32%),
    linear-gradient(180deg, #06101d 0%, #081525 48%, #09101a 100%);
  color: var(--earth-text);
  background-attachment: fixed;
}

body.earth-school-page.earth-consent-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.earth-shell {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 44px 0 72px;
}

.earth-hero {
  display: flex;
  justify-content: center;
}

.earth-hero-copy,
.earth-guide {
  border: 1px solid var(--earth-line);
  background: linear-gradient(180deg, rgba(9, 16, 28, 0.7), rgba(5, 10, 18, 0.82));
  backdrop-filter: blur(18px);
  box-shadow: var(--earth-shadow);
}

.earth-hero-copy {
  width: min(680px, 100%);
  border-radius: 24px;
  padding: 42px 34px 34px;
  text-align: center;
}

.earth-return-link {
  display: flex;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 18px;
  color: var(--earth-muted);
  text-decoration: none;
}

.earth-return-link:hover,
.earth-return-link:focus-visible {
  color: var(--earth-text);
}

.earth-eyebrow,
.earth-progress-label,
.earth-panel-kicker {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--earth-muted);
}

.earth-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.earth-subtitle {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.28rem);
  letter-spacing: 0.04em;
  color: var(--earth-accent-strong);
}

.earth-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}

.earth-primary-button,
.earth-nav-button,
.earth-chapter-link {
  appearance: none;
  border: 1px solid var(--earth-line-strong);
  background: rgba(12, 26, 45, 0.92);
  color: var(--earth-text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.earth-primary-button:hover,
.earth-nav-button:hover,
.earth-chapter-link:hover,
.earth-primary-button:focus-visible,
.earth-nav-button:focus-visible,
.earth-chapter-link:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(137, 240, 255, 0.56);
}

.earth-primary-button {
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(98, 212, 255, 0.18), rgba(137, 240, 255, 0.12));
}

.earth-guide {
  margin-top: 26px;
  border-radius: 30px;
  overflow: hidden;
}

.earth-consent-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 10, 18, 0.76);
  backdrop-filter: blur(12px);
}

.earth-experience-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 10, 18, 0.82);
  backdrop-filter: blur(14px);
}

.earth-consent-modal {
  position: relative;
  isolation: isolate;
  width: min(680px, 100%);
  padding: 34px;
  border: 1px solid var(--earth-line-strong);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(12, 27, 48, 0.9), rgba(7, 17, 31, 0.94));
  box-shadow: var(--earth-shadow);
  text-align: center;
  overflow: hidden;
}

.earth-experience-modal {
  position: relative;
  isolation: isolate;
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  padding: 34px;
  border: 1px solid var(--earth-line-strong);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(12, 27, 48, 0.9), rgba(7, 17, 31, 0.94));
  box-shadow: var(--earth-shadow);
  text-align: center;
  overflow: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.earth-experience-modal::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.earth-experience-modal::before,
.earth-consent-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(5, 12, 21, 0.46), rgba(5, 12, 21, 0.76)),
    url("/assets/soul.png") center center / cover no-repeat;
  transform: scale(1.03);
}

.earth-experience-modal::after,
.earth-consent-modal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at center, rgba(137, 240, 255, 0.08), rgba(7, 17, 31, 0.34) 62%);
}

.earth-consent-kicker {
  margin: 0 0 16px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--earth-muted);
}

.earth-experience-step {
  margin: 0 0 12px;
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--earth-accent-strong);
}

.earth-experience-modal h2,
.earth-consent-modal h2 {
  margin: 0 0 20px;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.08;
}

.earth-experience-body p,
.earth-consent-modal p {
  margin: 0 0 18px;
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--earth-text);
}

.earth-experience-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}

.earth-experience-decision {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(137, 240, 255, 0.14);
}

.earth-experience-question {
  margin: 0 0 18px;
  font-size: 1.04rem;
  line-height: 1.7;
}

.earth-experience-choice-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.earth-consent-button {
  margin-top: 10px;
}

.earth-guide-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--earth-line);
  background: rgba(6, 12, 20, 0.52);
}

.earth-chapter-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.earth-chapter-link {
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.83rem;
  color: var(--earth-muted);
  background: rgba(12, 26, 45, 0.56);
}

.earth-chapter-link.is-active {
  background: rgba(98, 212, 255, 0.12);
  border-color: rgba(137, 240, 255, 0.34);
  color: var(--earth-text);
}

.earth-progress-wrap {
  display: grid;
  gap: 10px;
  align-content: center;
  justify-items: center;
  width: min(360px, 100%);
  margin: 0 auto;
}

.earth-ai-inline-link {
  justify-self: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--earth-muted);
  font: inherit;
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.earth-ai-inline-link:hover,
.earth-ai-inline-link:focus-visible {
  color: var(--earth-text);
}

.earth-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.earth-progress-fill {
  width: 16.66%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--earth-accent), var(--earth-accent-strong));
  transition: width 220ms ease;
}

.earth-progress-text {
  color: var(--earth-muted);
  font-size: 0.94rem;
}

.earth-panels {
  padding: 24px;
}

.earth-panel {
  max-width: 760px;
  min-height: 420px;
  margin: 0 auto;
  padding: 34px;
  border: 1px solid var(--earth-line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(9, 15, 25, 0.62), rgba(5, 9, 16, 0.76));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  animation: earthFadeIn 220ms ease;
}

.earth-panel h2 {
  margin: 14px 0 8px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
}

.earth-panel-subtitle {
  margin: 0 0 26px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--earth-accent-strong);
}

.earth-panel p {
  margin: 0 0 18px;
  font-size: 1.05rem;
  line-height: 1.82;
  color: var(--earth-text);
}

.earth-guide-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 24px;
}

.earth-nav-button {
  min-width: 150px;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 0.96rem;
}

.earth-ai-backdrop {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 10, 18, 0.82);
  backdrop-filter: blur(14px);
}

.earth-ai-modal {
  width: min(760px, 100%);
  max-height: min(86vh, 900px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--earth-line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(8, 14, 24, 0.72), rgba(5, 9, 16, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.earth-ai-modal::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.earth-ai-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.earth-ai-top-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.earth-ai-kicker {
  margin: 0 0 6px;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--earth-muted);
}

.earth-ai-title {
  margin: 0;
  font-size: 1.5rem;
}

.earth-ai-clear {
  border: 1px solid var(--earth-line-strong);
  background: rgba(12, 26, 45, 0.56);
  color: var(--earth-text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.earth-ai-close {
  border: 1px solid var(--earth-line-strong);
  background: rgba(12, 26, 45, 0.56);
  color: var(--earth-text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.earth-ai-log {
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.earth-ai-bubble {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 16px;
}

.earth-ai-bubble--user {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.earth-ai-bubble--assistant {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.earth-ai-bubble-text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
}

.earth-ai-form {
  margin-top: 16px;
}

.earth-ai-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--earth-muted);
}

.earth-ai-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.earth-ai-row textarea {
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(8, 14, 24, 0.82);
  color: var(--earth-text);
  resize: vertical;
}

.earth-ai-submit {
  align-self: stretch;
  min-width: 112px;
}

.earth-ai-hint {
  margin: 10px 2px 0;
  font-size: 0.84rem;
  color: var(--earth-muted);
}

.earth-nav-button[disabled] {
  cursor: default;
  opacity: 0.42;
  transform: none;
}

.earth-nav-button-primary {
  background: linear-gradient(135deg, rgba(98, 212, 255, 0.18), rgba(137, 240, 255, 0.12));
}

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

@media (max-width: 920px) {
  .earth-shell {
    width: min(100vw - 24px, 1180px);
    padding-top: 24px;
  }

  .earth-guide-bar {
    grid-template-columns: 1fr;
  }

  .earth-panels,
  .earth-guide-actions {
    padding-left: 18px;
    padding-right: 18px;
  }

  .earth-panel,
  .earth-hero-copy {
    padding: 24px;
  }

  .earth-consent-modal {
    padding: 26px 22px;
  }

  .earth-experience-modal {
    padding: 26px 22px;
  }

  .earth-ai-modal {
    padding: 20px;
  }

  .earth-panel p {
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.72;
  }
}

@media (max-width: 640px) {
  .earth-hero h1 {
    font-size: 3.2rem;
  }

  .earth-shell {
    width: min(100vw - 16px, 1180px);
  }

  .earth-guide-actions {
    flex-direction: column;
  }

  .earth-experience-actions {
    flex-direction: column;
  }

  .earth-ai-head,
  .earth-ai-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .earth-nav-button {
    width: 100%;
  }

  .earth-ai-submit,
  .earth-ai-clear,
  .earth-ai-close {
    width: 100%;
  }

  .earth-panel {
    min-height: 0;
  }

  .earth-chapter-nav {
    gap: 8px;
  }

  .earth-chapter-link {
    font-size: 0.78rem;
    padding: 8px 10px;
  }

  .earth-panel h2 {
    font-size: 2rem;
  }

  .earth-panel p {
    margin-bottom: 14px;
    font-size: 0.98rem;
    line-height: 1.66;
  }
}
