/* Dark surfaces are shared by desktop and mobile; type colors carry identity. */
:root {
  --paper: #101018;
  --surface: #1b1927;
  --surface-raised: #252135;
  --ink: #f5f1fc;
  --muted: #c0b8cf;
  --line: #514861;
  --purple: #d6ef78;
  --deep: #29203c;
  --radius: 16px;
  color-scheme: dark;
  font-family:
    "Inter Variable", Inter, "Segoe UI", "Microsoft YaHei", "Yu Gothic",
    "Malgun Gothic", "Nirmala UI", sans-serif;
}
body {
  background: var(--paper);
  color: var(--ink);
}
::selection {
  background: #d6ef78;
  color: #171322;
}
a:hover {
  color: #d6ef78;
}
.site-header {
  border-color: var(--line);
}
.site-header .brand,
.site-footer .brand {
  color: var(--ink);
}
.brand svg {
  color: #d6ef78;
}
.beta,
.small-pill,
.chips span,
.tag {
  background: #302a40;
  color: #e5def0;
}
.site-header nav a[aria-current] {
  background: #302a40;
  color: #d6ef78;
}
.language-picker {
  padding: 0;
  border: 0;
}
.language-picker summary {
  background: var(--surface);
  border-color: var(--line);
  min-height: 44px;
}
.language-picker > div {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 16px;
  max-height: 65dvh;
  overflow-y: auto;
}
.language-picker a {
  display: flex;
  align-items: center;
  min-height: 44px;
}
.language-picker a:hover,
.language-picker a[aria-current] {
  background: #302a40;
  color: #d6ef78;
}
.button,
.cosmic-cta {
  background: #d6ef78;
  color: #171322 !important;
  border: 1px solid #d6ef78;
  border-radius: 999px;
  box-shadow: none;
  min-height: 48px;
}
.button:hover {
  background: #e4fa9d;
  box-shadow: none;
}
.button.secondary {
  background: var(--surface);
  color: var(--ink) !important;
  border-color: #80708f;
}
.button.secondary:hover {
  background: #302a40;
}
.text-button,
.text-link {
  color: #d6ef78;
}
button,
summary {
  min-height: 44px;
}
.eyebrow {
  color: #c0b8cf;
}
input,
textarea,
select {
  background: #15131f;
  border-color: #80708f;
  color: var(--ink);
  font-size: 16px;
}
input::placeholder,
textarea::placeholder {
  color: #aaa0b9;
  opacity: 1;
}
.cosmic-hero {
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 75% 20%, #3a2856, transparent 62%), #1b142b;
  box-shadow: none;
}
.cosmic-stage {
  animation: none;
}
.cosmic-copy h1 {
  letter-spacing: -0.055em;
}
.interest-ribbon a {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  min-height: 44px;
}
.interest-ribbon a span {
  color: #d6ef78;
}
.interest-ribbon a:hover {
  background: #302a40;
}
.test-card {
  border-radius: 16px;
  color: #24182f;
  box-shadow: none;
}
.test-card:hover {
  color: #24182f;
  box-shadow: none;
  transform: translateY(-3px);
}
.test-card .card-link {
  color: #24182f;
}
.connection-banner {
  background: #241d32;
  border-color: var(--line);
  border-radius: 20px;
}
.connection-art i {
  border-color: #241d32;
}
.ritual-card {
  border-radius: 16px;
}
.tarot-teaser {
  background: #251c38;
  border-color: var(--line);
}
.zodiac-teaser,
.zodiac-teaser:hover {
  color: #302039;
}
.zodiac-teaser p {
  color: #514035;
}
.universe-invite {
  background: #241d32;
  border-color: var(--line);
  border-radius: 20px;
}
.universe-invite > span {
  color: #bea0ee;
}
.quiz-intro {
  border-color: #d6ef78;
}
.quiz-panel,
.panel,
.offer,
.topic-card,
.member-card,
.chat-panel {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}
.answers label {
  background: #211d2e;
  border-color: #80708f;
  min-height: 52px;
  font-size: 16px;
}
.answers label:hover {
  background: #30283e;
  border-color: #b69bdc;
}
.answers label.selected,
.answers label:has(input:checked) {
  background: #303425;
  border-color: #d6ef78;
  box-shadow: inset 3px 0 #d6ef78;
}
.choice-dot {
  border-color: #a99fb9;
}
.answers label:focus-within {
  outline-color: #d6ef78;
}
progress,
progress::-webkit-progress-bar {
  background: #4e435c;
}
.quiz-panel progress {
  accent-color: #d6ef78;
}
.result-card {
  color: #24182f;
  border-radius: 16px;
}
.result-line {
  color: #42334f;
}
.action-card,
.pair-card,
.notice,
.empty-state,
.symbolic-focus {
  background: #272235;
  border-color: var(--line);
}
.life-report,
.evidence {
  border-color: var(--line);
}
.focus-tabs button {
  background: #211d2e;
  color: var(--ink);
  border-color: #80708f;
  border-radius: 999px;
  min-height: 44px;
}
.focus-tabs button[aria-pressed="true"] {
  background: #d6ef78;
  border-color: #d6ef78;
  color: #171322;
}
.focus-reading {
  background: #251d35;
  border-color: #77628f;
  border-radius: 16px;
}
.focus-reading blockquote,
.focus-reading .preference-line b {
  color: #e2cef8;
}
.focus-reading blockquote {
  border-color: #bca0e0;
}
.dimension-track {
  background: #655773;
}
.result-feedback button:hover {
  background: #302a40;
}
.drawn-card {
  color: #271831;
}
.drawn-card p {
  color: #49344e;
}
.site-footer {
  border-color: var(--line);
  background: #17131f;
  border-radius: 20px 20px 0 0;
}
.site-footer a,
.site-footer button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
dialog {
  background: var(--surface);
  border-radius: 20px;
  border-color: #80708f;
}
dialog::backdrop {
  background: #08060dbb;
}
.modal-close {
  width: 44px;
  height: 44px;
}
.modal-close:hover {
  background: #3b304c;
}
#consent {
  background: #252135;
  border-color: #80708f;
  z-index: 40;
}
#toast {
  background: #e3dcf0;
  color: #21172f;
}
.skip-link {
  background: #d6ef78;
  color: #171322;
  z-index: 50;
}
.poll,
.message,
th {
  background: #272235;
}
.thread-card,
.poll-option {
  background: var(--surface);
  border-color: #80708f;
}
.poll-option i,
.message.mine {
  background: #3a2d4b;
}
.hero-result {
  color: #24182f;
  border-radius: 18px;
}
.hero-result .eyebrow {
  color: #573777;
}
.noscript {
  background: #332a16;
  color: #f6e3af;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline-color: #d6ef78;
}
.share-formats {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.share-formats button {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #80708f;
  border-radius: 999px;
  font-size: 14px;
}
.share-formats [aria-pressed="true"] {
  background: #d6ef78;
  color: #171322;
  border-color: #d6ef78;
}
.share-preview {
  display: grid;
  place-items: center;
  background: #100c18;
  padding: 16px;
  border-radius: 16px;
  min-height: 180px;
}
.share-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 39dvh;
  border-radius: 10px;
}
.share-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
#modal-body .share-sheet-actions .button {
  margin: 0;
  font-size: 14px;
}
#modal-body .share-hint {
  font-size: 13px;
  margin: 8px 0 0;
}
.mobile-nav {
  display: none;
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
  main {
    padding: 0 16px 32px;
  }
  main > section {
    margin-bottom: 40px;
  }
  .site-header {
    padding: 12px 18px;
    min-height: 70px;
    gap: 10px;
  }
  .site-header nav {
    display: none;
  }
  .site-header .brand {
    font-size: 27px;
  }
  .language-picker summary {
    font-size: 13px;
    max-width: 170px;
    display: flex;
    align-items: center;
  }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed;
    z-index: 25;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #17131f;
  }
  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    gap: 2px;
    font-size: 11px;
    line-height: 1.3;
    text-decoration: none;
    min-height: 52px;
    color: #c0b8cf;
    border-radius: 12px;
    overflow-wrap: anywhere;
    text-align: center;
  }
  .mobile-nav a > span:first-child {
    font-size: 22px;
    line-height: 1;
  }
  .mobile-nav a[aria-current] {
    color: #d6ef78;
    background: #282330;
  }
  body:has(#quiz-next) .mobile-nav,
  body:has(#share-result) .mobile-nav {
    display: none;
  }
  body:has(#quiz-next) {
    padding-bottom: env(safe-area-inset-bottom);
  }
  body:has(.cosmic-hero) main {
    padding-top: 6px;
  }
  .cosmic-hero {
    border-radius: 18px;
    gap: 0;
    min-height: 0;
  }
  .cosmic-copy {
    padding: 24px 23px 0;
  }
  .cosmic-copy .eyebrow {
    font-size: 10px;
    letter-spacing: 0.7px;
  }
  .cosmic-copy h1 {
    font-size: clamp(42px, 12vw, 58px);
    line-height: 1.04;
    margin: 14px 0;
  }
  .cosmic-copy > p {
    font-size: 15px;
    line-height: 1.6;
  }
  .cosmic-cta {
    margin-top: 18px;
    width: 100%;
    min-height: 52px;
  }
  .cosmic-copy .hero-fine {
    font-size: 11px;
    margin-top: 10px;
  }
  .cosmic-stage {
    min-height: 188px;
    padding: 18px 36px 23px;
  }
  .orbit-art {
    opacity: 0.45;
  }
  .floating-persona {
    width: 100%;
    max-width: 294px;
    min-height: 0;
    margin: 0;
    padding: 17px 18px;
    border-radius: 14px;
    transform: rotate(-3deg);
    display: grid;
    grid-template-columns: 52px 1fr;
    column-gap: 12px;
  }
  .floating-persona .eyebrow {
    grid-column: 1 / -1;
    font-size: 8px;
    letter-spacing: 1px;
  }
  .persona-glyph {
    grid-row: 2 / 5;
    font-size: 51px;
    align-self: center;
  }
  .floating-persona .type-code {
    justify-self: start;
    margin: 6px 0;
    font-size: 8px;
    padding: 2px 7px;
  }
  .floating-persona h2 {
    font-size: 23px;
    margin: 0 0 5px;
  }
  .floating-persona p {
    font-size: 12px;
    min-height: 0;
    line-height: 1.4;
  }
  .floating-persona .mini-brand,
  .orbit-sticker {
    display: none;
  }
  .interest-ribbon {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 3px 1px 18px;
    margin-bottom: 8px;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }
  .interest-ribbon a {
    flex-shrink: 0;
    font-size: 12px;
    scroll-snap-align: start;
  }
  .test-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .test-card {
    min-height: 0;
    padding: 19px;
    display: grid;
    grid-template-columns: 54px 1fr;
    column-gap: 15px;
  }
  .test-card .card-number {
    grid-column: 2;
    font-size: 10px;
  }
  .test-card .card-symbol {
    grid-column: 1;
    grid-row: 1 / 5;
    align-self: start;
    font-size: 43px;
    margin: 13px 0;
  }
  .test-card h3 {
    grid-column: 2;
    margin: 7px 0;
    max-width: 100%;
    font-size: 21px;
    line-height: 1.25;
  }
  .test-card p {
    grid-column: 2;
    font-size: 13px;
    line-height: 1.6;
  }
  .test-card .card-link {
    grid-column: 2;
    margin-top: 12px;
    padding-top: 10px;
  }
  .connection-banner {
    padding: 23px;
  }
  .connection-banner h2 {
    font-size: 26px;
  }
  .tool-head {
    padding-top: 21px;
    display: block;
  }
  .quiz-intro {
    position: static;
    padding-left: 14px;
    margin-bottom: 23px;
  }
  .quiz-intro h1 {
    font-size: 29px;
    line-height: 1.25;
    margin: 8px 0 12px;
  }
  .quiz-intro p {
    font-size: 14px;
    line-height: 1.55;
  }
  body.quiz-in-progress .quiz-intro p {
    display: none;
  }
  .quiz-panel {
    padding: 20px 16px;
    border-radius: 16px;
    scroll-margin-top: 16px;
  }
  .quiz-meta {
    gap: 12px;
    font-size: 12px;
  }
  .quiz-meta > span:last-child {
    text-align: right;
    max-width: 58%;
  }
  .quiz-panel progress {
    margin: 15px 0 23px;
    height: 6px;
  }
  .quiz-panel legend {
    font-size: 22px;
    line-height: 1.45;
    margin-bottom: 20px;
  }
  .answers {
    gap: 10px;
  }
  .answers label {
    padding: 14px 12px;
    min-height: 54px;
    font-size: 16px;
  }
  .quiz-actions {
    position: sticky;
    bottom: 0;
    z-index: 12;
    margin: 22px -8px 12px;
    padding: 12px 8px calc(12px + env(safe-area-inset-bottom));
    background: #1b1927;
    border-top: 1px solid var(--line);
  }
  .quiz-actions .button {
    flex: 1;
    max-width: 78%;
    min-height: 50px;
    justify-content: center;
    font-size: 15px;
  }
  .quiz-actions .text-button {
    padding: 10px;
  }
  .result-card {
    padding: 20px 16px;
    align-items: flex-start;
    gap: 14px;
  }
  .result-card .result-emblem {
    width: 54px;
    height: 54px;
    font-size: 37px;
  }
  .result-card h2 {
    font-size: 29px;
    line-height: 1.2;
  }
  .result-detail {
    font-size: 16px;
    line-height: 1.8;
  }
  .result-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 26;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #17131f;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .result-actions .button {
    font-size: 13px;
    padding: 12px 8px;
    justify-content: center;
    line-height: 1.4;
    min-width: 0;
  }
  .focus-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .focus-tabs button {
    font-size: 12px;
    padding: 9px;
    line-height: 1.4;
  }
  .focus-reading {
    padding: 20px 17px;
  }
  .focus-reading .fine,
  .fine {
    font-size: 13px;
    line-height: 1.6;
  }
  .dimension-title {
    flex-wrap: wrap;
    gap: 3px 12px;
  }
  .dimension-ends {
    font-size: 12px;
    gap: 16px;
  }
  .result-top {
    align-items: start;
  }
  .result-top .eyebrow {
    font-size: 10px;
  }
  .result-feedback button {
    min-height: 44px;
  }
  .page-intro {
    margin-top: 30px;
  }
  .article-page {
    margin-top: 28px;
  }
  dialog {
    margin: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 18px);
    padding: 44px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    overscroll-behavior: contain;
  }
  #modal-body h2 {
    font-size: 26px;
    padding-right: 20px;
    margin: 0 0 14px;
  }
  .share-preview {
    padding: 12px;
  }
  #toast {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }
  #consent {
    bottom: calc(82px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
    max-height: 55dvh;
    overflow-y: auto;
  }
  body:has(dialog[open]) {
    overflow: hidden;
  }
  body:has(dialog[open]) .result-actions,
  body:has(dialog[open]) .mobile-nav {
    visibility: hidden;
  }
  :lang(hi) .cosmic-copy h1 {
    font-size: 36px;
  }
  :lang(zh) .cosmic-copy h1,
  :lang(ja) .cosmic-copy h1,
  :lang(ko) .cosmic-copy h1 {
    font-size: 38px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .test-card:hover,
  .button:hover {
    transform: none;
  }
}

.locale-compact {
  display: none;
}
@media (max-width: 720px) {
  .locale-full {
    display: none;
  }
  .locale-compact {
    display: inline;
  }
  .language-picker summary {
    gap: 5px;
  }
  body:has(#share-result) {
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
  }
}
