:root,
html.dark {
  --bg: #07150f;
  --bg-2: #0a1f17;
  --page: #040c09;
  --card: rgba(8, 28, 20, 0.92);
  --border: rgba(34, 197, 94, 0.22);
  --line: rgba(255, 255, 255, 0.14);
  --text: #e8f7ef;
  --muted: rgba(232, 247, 239, 0.72);
  --label: #b7e8cf;
  --accent: #00b36b;
  --accent-2: #14b8a6;
  --chip: #9af0c7;
  --quote: #e8f7ef;
  --surface: rgba(0, 0, 0, 0.32);
  --surface-2: rgba(0, 0, 0, 0.24);
  --answer-bg: rgba(255, 255, 255, 0.04);
  --answer-hover: rgba(0, 179, 107, 0.16);
  --answer-active: rgba(0, 179, 107, 0.28);
  --sec-tag: #7ee0b0;
  --sec-current: #c7f7df;
  --hint: rgba(232, 247, 239, 0.62);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 1rem;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --chrome-bg: rgba(7, 21, 15, 0.78);
  --screen-wash: transparent;
  --welcome-opacity: 1;
  --welcome-filter: none;
  --card-glow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html.light {
  --bg: #e6f7ee;
  --bg-2: #d4f0e0;
  --page: #dcf5e8;
  --card: #ffffff;
  --border: rgba(0, 140, 90, 0.28);
  --line: rgba(8, 70, 48, 0.16);
  --text: #06281c;
  --muted: #2f5f4a;
  --label: #0a6b45;
  --accent: #008a54;
  --accent-2: #0f9f8a;
  --chip: #007a4a;
  --quote: #06281c;
  --surface: #eefaf3;
  --surface-2: #e5f6ec;
  --answer-bg: #ffffff;
  --answer-hover: #e8f8ef;
  --answer-active: #d4f5e4;
  --sec-tag: #0a7a4e;
  --sec-current: #043d28;
  --hint: #3d6b56;
  --shadow: 0 16px 40px rgba(6, 60, 40, 0.14), 0 2px 8px rgba(6, 60, 40, 0.06);
  --chrome-bg: rgba(255, 255, 255, 0.92);
  --screen-wash: linear-gradient(165deg, #f2fcf6 0%, #d8f3e4 42%, #c8ecd9 100%);
  --welcome-opacity: 0.95;
  --welcome-filter: saturate(1.15) brightness(1.05) contrast(1.08);
  --card-glow: inset 0 1px 0 rgba(255, 255, 255, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--page);
}

body {
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

#app {
  min-height: 100vh;
}

.quiz-chrome {
  position: fixed;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chrome-home,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chrome-bg);
  color: var(--text);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.chrome-home:hover,
.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-icon {
  display: block;
  flex-shrink: 0;
}

html.dark .theme-icon-moon,
html.light .theme-icon-sun {
  display: none;
}

.theme-label {
  letter-spacing: 0.02em;
}

@media (max-width: 520px) {
  .theme-label {
    display: none;
  }
}

.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  background: var(--screen-wash);
}

.card {
  width: min(920px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  box-shadow: var(--shadow), var(--card-glow);
  backdrop-filter: blur(12px);
  padding: 1.75rem;
  animation: cardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 179, 107, 0.12);
  color: var(--chip);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0.4rem 0 0.75rem;
  line-height: 1.15;
  color: var(--text);
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

.grid-2 {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.85rem;
  color: var(--label);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 0.9rem;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 179, 107, 0.2);
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-weight: 600;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #04140d;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.audience-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
  margin-top: 1.25rem;
}

@media (min-width: 720px) {
  .audience-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.audience-card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

.audience-card:hover,
.audience-card.active {
  border-color: var(--accent);
  background: rgba(0, 179, 107, 0.12);
  transform: translateY(-2px);
}

.audience-card .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(0, 179, 107, 0.35);
  background: rgba(0, 179, 107, 0.12);
  color: var(--chip);
  font-weight: 700;
  font-size: 0.85rem;
}

.audience-card .title {
  font-weight: 700;
  margin-top: 0.55rem;
}

.audience-card .desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.quiz-layout {
  width: min(1100px, 100%);
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .quiz-layout {
    grid-template-columns: 220px 1fr;
  }
}

.sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  animation: cardIn 0.45s ease both;
}

.sidebar h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--chip);
  margin: 0 0 0.75rem;
}

.section-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.section-list li {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.45rem 0.55rem;
  border-radius: 0.55rem;
  transition: background 0.25s ease, color 0.25s ease;
}

.section-list li .sec-tag {
  display: inline-block;
  min-width: 3.4rem;
  margin-right: 0.35rem;
  color: var(--sec-tag);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-list li.current {
  background: rgba(0, 179, 107, 0.14);
  color: var(--sec-current);
  font-weight: 650;
}

.section-list li.done {
  color: var(--sec-tag);
}

.progress-rail {
  height: 8px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(0, 179, 107, 0.45);
}

.q-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.q-text {
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 700;
  color: var(--text);
  margin: 0.4rem 0 0.5rem;
  animation: fadeUp 0.35s ease both;
}

.q-hint {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--hint);
  margin-bottom: 1rem;
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mountain-wrap {
  position: relative;
  width: min(300px, 75%);
  margin: 0.5rem auto 1rem;
  overflow: visible;
}

.mountain-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: hidden;
}

.flag-pole {
  fill: #00b36b;
}

.flag-cloth {
  fill: #00b36b;
  transform-origin: 176px 116px;
}

.flag-cloth.wave {
  animation: flagSkew 0.9s ease-in-out infinite;
}

.flag-cloth.idle {
  animation: flagSkewSoft 2.4s ease-in-out infinite;
}

.flag-group {
  transform: translateY(0);
}

.flag-group.climbing {
  animation: flagClimb 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes flagClimb {
  0% {
    transform: translateY(0);
  }
  70% {
    transform: translateY(calc(var(--flag-y) - 4px));
  }
  100% {
    transform: translateY(var(--flag-y));
  }
}

@keyframes flagSkew {
  0%,
  100% {
    transform: skewX(0deg);
  }
  35% {
    transform: skewX(-6deg);
  }
  70% {
    transform: skewX(4deg);
  }
}

@keyframes flagSkewSoft {
  0%,
  100% {
    transform: skewX(0deg);
  }
  50% {
    transform: skewX(-2.5deg);
  }
}

.answers {
  display: grid;
  gap: 0.55rem;
}

.answer {
  text-align: left;
  border: 1.5px solid var(--line);
  background: var(--answer-bg);
  color: var(--text);
  font-weight: 600;
  border-radius: 0.85rem;
  padding: 0.9rem 1.05rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease,
    box-shadow 0.15s ease;
  animation: fadeUp 0.35s ease both;
}

.answer:nth-child(1) {
  animation-delay: 0.02s;
}
.answer:nth-child(2) {
  animation-delay: 0.06s;
}
.answer:nth-child(3) {
  animation-delay: 0.1s;
}
.answer:nth-child(4) {
  animation-delay: 0.14s;
}
.answer:nth-child(5) {
  animation-delay: 0.18s;
}

.answer:hover {
  border-color: var(--accent);
  background: var(--answer-hover);
}

.answer.active {
  border-color: var(--accent);
  background: var(--answer-active);
  color: var(--text);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(0, 138, 84, 0.35), 0 10px 28px rgba(0, 138, 84, 0.16);
  animation: answerPick 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.answer:disabled {
  cursor: default;
  opacity: 0.72;
}

.answer:disabled:not(.active) {
  opacity: 0.45;
}

@keyframes answerPick {
  0% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-3px) scale(1.035);
  }
  100% {
    transform: translateY(-2px) scale(1.02);
  }
}

.loading-wrap {
  text-align: center;
  padding: 3rem 1rem;
}

.spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  margin: 0 auto 1rem;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tier-hero {
  display: grid;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 760px) {
  .tier-hero {
    grid-template-columns: auto 1fr;
  }
}

.tier-mark {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 179, 107, 0.4);
  background: linear-gradient(145deg, rgba(0, 179, 107, 0.25), rgba(20, 184, 166, 0.08));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--chip);
}

.score-pill {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 179, 107, 0.14);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.bars {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.bar-row {
  display: grid;
  gap: 0.25rem;
}

.bar-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.list-card {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.list-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.list-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.list-card li {
  margin: 0.35rem 0;
}

.insight-stack {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.insight-card {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  animation: insightIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.insight-card.tone-strength,
.insight-card.tone-solid {
  border-color: rgba(0, 179, 107, 0.35);
  background: linear-gradient(145deg, rgba(0, 179, 107, 0.16), var(--surface-2));
}

.insight-card.tone-explore {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.14), var(--surface-2));
}

.insight-card.tone-priority,
.insight-card.tone-foundation {
  border-color: rgba(251, 146, 60, 0.4);
  background: linear-gradient(145deg, rgba(251, 146, 60, 0.16), var(--surface-2));
}

.insight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.insight-tone {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--chip);
}

.insight-section {
  font-size: 0.75rem;
  color: var(--muted);
}

.insight-answer {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
}

.insight-quote {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid rgba(0, 179, 107, 0.7);
  background: var(--surface);
  font-style: italic;
  color: var(--quote);
}

.insight-body {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.insight-next {
  margin: 0;
  font-size: 0.88rem;
  color: var(--chip);
}

.insight-next span {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 179, 107, 0.2);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--chip);
}

@keyframes insightIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.transcript-panel {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.transcript-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: #c8f5dc;
}

.transcript-list {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.65rem;
}

.transcript-row {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.transcript-q {
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}

.transcript-q span {
  color: var(--muted);
  margin-right: 0.25rem;
}

.transcript-a {
  font-size: 0.85rem;
  color: var(--chip);
  font-weight: 600;
}

.transcript-a em {
  font-weight: 500;
  color: var(--muted);
  font-style: normal;
}

.save-status {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.save-status.ok {
  color: #86efac;
}

.save-status.warn {
  color: #fde68a;
}

.save-status.err {
  color: #fda4a4;
}

/* Animated scenic background */
.welcome-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--welcome-opacity);
  filter: var(--welcome-filter);
}

html.light .orb,
html.light .starfield,
html.light .aurora {
  opacity: 0.35;
}

.welcome-bg svg {
  width: 100%;
  height: 100%;
}

.sky-shift {
  animation: skyShift 14s ease-in-out infinite alternate;
}

@keyframes skyShift {
  0% {
    stop-color: #0c241d;
  }
  50% {
    stop-color: #134a3a;
  }
  100% {
    stop-color: #0a1c16;
  }
}

.sky-shift-b {
  animation: skyShiftB 16s ease-in-out infinite alternate;
}

@keyframes skyShiftB {
  0% {
    stop-color: #07150f;
  }
  100% {
    stop-color: #0f3328;
  }
}

html.light .sky-shift {
  animation: skyShiftLight 14s ease-in-out infinite alternate;
}

html.light .sky-shift-b {
  animation: skyShiftLightB 16s ease-in-out infinite alternate;
}

@keyframes skyShiftLight {
  0% {
    stop-color: #eefcf5;
  }
  50% {
    stop-color: #d5f4e4;
  }
  100% {
    stop-color: #e4f9ee;
  }
}

@keyframes skyShiftLightB {
  0% {
    stop-color: #b7e5cb;
  }
  100% {
    stop-color: #9fd4b8;
  }
}

.welcome-bg .mount-far {
  color: #0c2a20;
}

.welcome-bg .mount-back {
  color: #0a2019;
}

.welcome-bg .mount-front {
  color: #081a15;
}

.mountain-svg {
  color: #07150f;
}

.mountain-svg .mountain-ground {
  color: #06102b;
}

.mountain-peak {
  stroke: none;
}

.mount-back {
  animation: driftX 30s ease-in-out infinite alternate;
}

.mount-front {
  animation: driftXReverse 24s ease-in-out infinite alternate;
}

@keyframes driftX {
  from {
    transform: translateX(-40px);
  }
  to {
    transform: translateX(40px);
  }
}

@keyframes driftXReverse {
  from {
    transform: translateX(50px);
  }
  to {
    transform: translateX(-50px);
  }
}

.snowcap {
  stroke: none;
  animation: snowPulse 16s ease-in-out infinite;
}

.snowcap.delay {
  animation-delay: 3s;
}

@keyframes snowPulse {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

.emission {
  fill: rgba(180, 220, 205, 0.45);
  animation: riseFade 8s ease-in-out infinite;
}

@keyframes riseFade {
  0% {
    opacity: 0.15;
    transform: translateY(0);
  }
  45% {
    opacity: 0.55;
    transform: translateY(-48px);
  }
  100% {
    opacity: 0;
    transform: translateY(-90px);
  }
}

.relative {
  position: relative;
  z-index: 1;
}

#pdf-sheet {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 800px;
  background: #fff;
  color: #111;
  padding: 36px;
  font-family: var(--font);
}

#pdf-sheet h1 {
  color: #0b3d2e;
  font-size: 1.6rem;
}

#pdf-sheet h2 {
  color: #134a3a;
  font-size: 1.2rem;
}

#pdf-sheet p,
#pdf-sheet li {
  color: #333;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Extra motion layer */
.badge {
  animation: badgePulse 2.8s ease-in-out infinite;
}

@keyframes badgePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 179, 107, 0);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(0, 179, 107, 0.12);
  }
}

.btn-primary {
  position: relative;
  overflow: hidden;
  animation: btnGlow 2.6s ease-in-out infinite;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(255, 255, 255, 0.35) 45%,
    transparent 70%
  );
  transform: translateX(-120%);
  animation: shineSweep 2.8s ease-in-out infinite;
}

@keyframes shineSweep {
  0%,
  40% {
    transform: translateX(-120%);
  }
  70%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes btnGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 179, 107, 0.15);
  }
  50% {
    box-shadow: 0 8px 28px rgba(0, 179, 107, 0.35);
  }
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 280px;
  height: 280px;
  background: #14b8a6;
  top: 8%;
  left: 6%;
  animation: orbFloat 11s ease-in-out infinite;
}

.orb-b {
  width: 340px;
  height: 340px;
  background: #00b36b;
  bottom: 4%;
  right: 4%;
  animation: orbFloat 14s ease-in-out infinite reverse;
}

.orb-c {
  width: 180px;
  height: 180px;
  background: #2dd4bf;
  top: 40%;
  right: 18%;
  animation: orbFloat 9s ease-in-out infinite;
}

@keyframes orbFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(24px, -28px) scale(1.08);
  }
}

.starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.starfield span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(198, 255, 230, 0.7);
  animation: twinkle 3.5s ease-in-out infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.4);
  }
}

.celebrate {
  position: absolute;
  left: 54%;
  top: 34%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 5;
}

.spark {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--spark-size, 7px);
  height: var(--spark-size, 7px);
  border-radius: 2px;
  background: #00b36b;
  box-shadow: 0 0 12px rgba(0, 179, 107, 0.85);
  animation: sparkOut 1.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sparkOut {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.35) rotate(0deg);
  }
  18% {
    opacity: 1;
    transform: translate(calc(var(--dx) * 0.25), calc(var(--dy) * 0.25)) scale(1.15) rotate(40deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.15) rotate(200deg);
  }
}

.mountain-wrap {
  animation: mountainBob 4.5s ease-in-out infinite;
}

@keyframes mountainBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.progress-fill {
  animation: progressGlow 1.8s ease-in-out infinite;
}

@keyframes progressGlow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.25);
  }
}

.audience-card {
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.audience-card:nth-child(1) {
  animation-delay: 0.05s;
}
.audience-card:nth-child(2) {
  animation-delay: 0.12s;
}
.audience-card:nth-child(3) {
  animation-delay: 0.19s;
}
.audience-card:nth-child(4) {
  animation-delay: 0.26s;
}

.tier-mark {
  animation: tierPop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both,
    badgePulse 2.8s ease-in-out 0.7s infinite;
}

@keyframes tierPop {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.resource-grid {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

@media (min-width: 720px) {
  .resource-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.resource-link {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--chip);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  animation: fadeUp 0.45s ease both;
}

.resource-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--answer-hover);
}

.resource-link strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.resource-link span {
  font-size: 0.82rem;
  color: var(--muted);
}

.aurora {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 55%;
  background: radial-gradient(
      ellipse at 30% 40%,
      rgba(20, 184, 166, 0.22),
      transparent 55%
    ),
    radial-gradient(ellipse at 70% 30%, rgba(0, 179, 107, 0.18), transparent 50%);
  filter: blur(20px);
  animation: auroraShift 10s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes auroraShift {
  from {
    transform: translateX(-4%) scale(1);
    opacity: 0.55;
  }
  to {
    transform: translateX(5%) scale(1.08);
    opacity: 0.95;
  }
}

/* ---- Light theme polish (contrast + crisp brand green) ---- */
html.light .mf-a {
  stop-color: #6bb594;
}
html.light .mf-b {
  stop-color: #45856a;
}
html.light .mb-a {
  stop-color: #4a9472;
}
html.light .mb-b {
  stop-color: #2a6d50;
}
html.light .mfr-a {
  stop-color: #357a58;
}
html.light .mfr-b {
  stop-color: #184f36;
}
html.light .sn-a {
  stop-color: #ffffff;
}
html.light .sn-b {
  stop-color: #ecf9f2;
}
html.light .sn-c {
  stop-color: #a8d9c0;
}

html.light .sky-shift {
  stop-color: #e8fbf1;
}

html.light .sky-shift-b {
  stop-color: #bfe9d2;
}

html.light .mountain-svg {
  color: #0a3d28;
}

html.light .mountain-svg .mountain-ground {
  color: #06281c;
}

html.light .mountain-peak {
  fill: url(#peakGrad);
  stroke: none;
  filter: none;
}

html.light .welcome-bg .snowcap {
  stroke: none !important;
  filter: none;
  animation: snowPulseLight 10s ease-in-out infinite;
}

@keyframes snowPulseLight {
  0%,
  100% {
    opacity: 0.9;
  }
  50% {
    opacity: 1;
  }
}

html.light .pk-a {
  stop-color: #ffffff;
}
html.light .pk-b {
  stop-color: #eaf8f1;
}
html.light .pk-c {
  stop-color: #9dcfb6;
}
html.light .bd-a {
  stop-color: #1b5a40;
}
html.light .bd-b {
  stop-color: #0a3324;
}

html.light .emission {
  fill: rgba(10, 90, 60, 0.35);
}

html.light .flag-pole,
html.light .flag-cloth {
  fill: #008a54;
}

html.light .sidebar {
  background: #ffffff;
  border-color: rgba(0, 138, 84, 0.22);
  box-shadow: 0 8px 24px rgba(6, 60, 40, 0.08);
}

html.light .section-list li.current {
  background: #d8f5e6;
  color: #043d28;
}

html.light .audience-card {
  background: #ffffff;
  border: 1.5px solid rgba(8, 70, 48, 0.14);
  box-shadow: 0 4px 14px rgba(6, 60, 40, 0.05);
}

html.light .audience-card:hover,
html.light .audience-card.active {
  background: #e8f8ef;
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(0, 138, 84, 0.12);
}

html.light .audience-card .mark {
  color: var(--chip);
  background: #d8f5e6;
  border-color: rgba(0, 138, 84, 0.35);
}

html.light .list-card,
html.light .transcript-panel,
html.light .insight-card {
  background: #f4fbf7;
  border-color: rgba(0, 138, 84, 0.18);
}

html.light .insight-card.tone-strength,
html.light .insight-card.tone-solid {
  background: linear-gradient(145deg, #dff7ea, #f4fbf7);
  border-color: rgba(0, 138, 84, 0.35);
}

html.light .insight-card.tone-explore {
  background: linear-gradient(145deg, #fff6e0, #fffdf7);
  border-color: rgba(180, 120, 20, 0.3);
}

html.light .insight-card.tone-priority,
html.light .insight-card.tone-foundation {
  background: linear-gradient(145deg, #ffefe3, #fffaf6);
  border-color: rgba(200, 100, 40, 0.3);
}

html.light .insight-quote {
  background: #ffffff;
  color: var(--text);
  border-left-color: var(--accent);
}

html.light .insight-next {
  color: #0a5c3a;
}

html.light .insight-tone,
html.light .transcript-a,
html.light .transcript-panel summary {
  color: #007a4a;
}

html.light .badge {
  background: #d8f5e6;
  color: #007a4a;
  border-color: rgba(0, 138, 84, 0.28);
}

html.light .btn-ghost {
  background: #ffffff;
  border-color: rgba(8, 70, 48, 0.2);
  color: #06281c;
}

html.light .btn-ghost:hover {
  border-color: var(--accent);
  background: #e8f8ef;
}

html.light .field input,
html.light .field select,
html.light .field textarea {
  background: #ffffff;
  border: 1.5px solid rgba(8, 70, 48, 0.18);
  color: #06281c;
}

html.light .chrome-home,
html.light .theme-toggle {
  background: #ffffff;
  border-color: rgba(0, 138, 84, 0.22);
  box-shadow: 0 6px 18px rgba(6, 60, 40, 0.1);
}

html.light .progress-rail {
  background: #d7eee3;
}

html.light .bar-track {
  background: #d7eee3;
}

html.light .orb,
html.light .starfield span {
  opacity: 0.22;
}

html.light .aurora {
  opacity: 0.45;
  filter: blur(28px) saturate(1.2);
}

/* Results: graphical insights */
.mix-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 120px;
  margin-top: 0.75rem;
  padding: 0.75rem 0.5rem 0.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.mix-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.mix-bar {
  width: 100%;
  max-width: 42px;
  border-radius: 0.45rem 0.45rem 0.2rem 0.2rem;
  min-height: 8px;
}

.mix-count,
.mix-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--chip);
}

.mix-label {
  color: var(--muted);
  font-weight: 600;
}

.mix-caption {
  margin-top: 0.45rem;
  font-size: 0.8rem;
}

.compare-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

@media (min-width: 720px) {
  .compare-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.compare-card {
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.compare-card.tone-strong {
  background: linear-gradient(145deg, rgba(0, 179, 107, 0.14), var(--surface-2));
}

.compare-card.tone-priority {
  background: linear-gradient(145deg, rgba(251, 146, 60, 0.14), var(--surface-2));
}

.compare-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.compare-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.55rem;
  margin-bottom: 0.7rem;
}

.compare-name {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  color: var(--text);
}

.compare-track {
  height: 7px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.compare-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.compare-card.tone-priority .compare-fill {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.compare-score {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--chip);
}

.snapshot-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.snapshot-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.snapshot-row.kind-high {
  background: rgba(0, 179, 107, 0.1);
}

.snapshot-row.kind-low {
  background: rgba(251, 146, 60, 0.1);
}

.score-dots {
  display: flex;
  gap: 0.28rem;
}

.score-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(120, 140, 130, 0.35);
}

.score-dot.on {
  background: var(--accent);
}

.snapshot-row.kind-low .score-dot.on {
  background: #d97706;
}

.snapshot-text {
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.35;
}

.cta-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

@media (min-width: 720px) {
  .cta-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.cta-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  border-radius: 0.85rem;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.cta-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--answer-hover);
}

.cta-card strong {
  color: var(--chip);
  font-size: 1rem;
}

.cta-card span {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
}

html.light .cta-card strong {
  color: #007a4a;
}
