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

:root {
  --color-primary: #9356A0;
  --color-primary-dark: #7a4688;
  --color-bg: #DCCAE9;
  --color-bg-active: #cbb8da;
  --color-bg-90: rgba(220, 202, 233, 0.9);
  --color-bg-85: rgba(220, 202, 233, 0.85);
  --color-bg-80: rgba(220, 202, 233, 0.8);
  --color-bg-60: rgba(220, 202, 233, 0.6);
  --color-bg-35: rgba(220, 202, 233, 0.35);
  --color-bg-25: rgba(220, 202, 233, 0.25);
  --color-bg-30: rgba(220, 202, 233, 0.3);
  --color-primary-30: rgba(147, 86, 160, 0.3);
  --color-primary-15: rgba(147, 86, 160, 0.15);
  --color-primary-10: rgba(147, 86, 160, 0.1);
  --color-primary-70: rgba(147, 86, 160, 0.7);
  --color-error: #ffcccc;

  --radius-btn: 30px;
  --radius-card: 16px;
  --radius-input: 12px;
}

html, body {
  height: 100%;
  overflow: hidden;
  max-width: 430px;
  margin: 0 auto;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-primary);
  min-height: 100vh;
  min-height: 100dvh;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
  position: relative;
}

/* Answer text is always selectable on mobile (long-press). The app never sets
   user-select:none, but some WebViews (e.g. the Telegram Mini App) only enable
   selection when it is requested explicitly — otherwise the long-press gesture
   is swallowed by the host. Cover every answer surface: analysis questions,
   express report, favorable dates, expert chat, compatibility and astrologer
   results. */
.sphere-answer,
.sphere-answer *,
.express-answer,
.expert-msg-bubble,
.expert-msg-bubble *,
.compat-result-desc,
.compat-interpretation-text,
.compat-interpretation-total-text,
.astrologer-event-title,
.astrologer-event-desc,
.astrologer-event-advice,
.date-entry,
.date-entry *,
.express-hero,
.express-section {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* ── Screen Back Button ── */
.screen-back-btn {
  position: absolute;
  top: max(14px, calc(env(safe-area-inset-top, 0px) + 14px));
  left: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  color: var(--color-primary);
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.screen-back-btn:active {
  opacity: 0.5;
}

.screen-back-btn img {
  width: 32px;
  height: 32px;
  pointer-events: none;
}

/* Back button on the same line as the title/tabs */
.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 10px 8px;
  padding-top: calc(10px + env(safe-area-inset-top, 0));
  flex-shrink: 0;
}

.screen-header .screen-back-btn {
  position: static;
}

.screen-header .analysis-title,
.screen-header .compat-title,
.screen-header .settings-title {
  flex: 1;
  margin: 0;
  padding: 0;
  padding-right: 48px; /* balance the back button on the left */
  text-align: center;
}

.screen-header .compat-tabs {
  flex: 1;
  margin: 0;
}

/* Keep the floating back button above the expert-active content */
.screen-back-btn ~ .expert-active-content {
  padding-top: calc(56px + env(safe-area-inset-top, 0));
}

/* Splash Screen */
.splash {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  z-index: 1000;
  transition: opacity 0.5s ease-out;
}

/* Solid backdrop ensures screens underneath (bfcache/restored DOM) are
   never visible through the semi-transparent page background during fade */
.splash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  z-index: -1;
}

.splash.fade-out {
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.8s ease-out;
}

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

.logo-container {
  margin-bottom: 2rem;
}

.logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

.welcome-text {
  text-align: center;
  margin-bottom: 3rem;
}

.welcome-sub {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.welcome-main {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.03em;
  line-height: 1.3;
}

/* Screen base */
.screen {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  transition: opacity 0.4s ease-in;
}

.screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.screen.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Onboarding Screen */
.onboarding {
  background: var(--color-bg);
}
.onboarding:not(.hidden) {
  z-index: 900;
}

.onboarding-slide {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.onboarding-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.onboarding-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  padding-top: env(safe-area-inset-top, 2rem);
  padding-bottom: env(safe-area-inset-bottom, 2rem);
  overflow-y: auto;
}

.onboarding-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  text-align: center;
  line-height: 1.4;
  margin-bottom: 2rem;
  max-width: 320px;
}

.onboarding-card {
  width: 100%;
  max-width: 340px;
  background: var(--color-primary);
  border-radius: var(--radius-card);
  padding: 2rem 1.5rem;
}

.onboarding-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.onboarding-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: brightness(1.2);
}

.onboarding-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #DCCAE9;
  text-align: center;
}

.onboarding-card-text {
  font-size: 0.9rem;
  color: rgba(220, 202, 233, 0.92);
  text-align: center;
  line-height: 1.5;
}

/* Final Onboarding Screen */
.onboarding-final {
  background: var(--color-bg);
}
.onboarding-final:not(.hidden) {
  z-index: 950;
}

.onboarding-final-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: env(safe-area-inset-top, 0);
}

.onboarding-final-img-wrap {
  width: 100%;
  height: 55%;
  overflow: hidden;
  position: relative;
}

.onboarding-final-img {
  width: 160%;
  height: auto;
  position: absolute;
  bottom: -13%;
  left: -45%;
}

.onboarding-final-text {
  text-align: center;
  padding: 1.5rem 1.5rem 0;
}

.onboarding-final-text h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.onboarding-final-text p {
  font-size: 0.9rem;
  color: var(--color-primary);
  line-height: 1.5;
}

.onboarding-final-btn {
  margin-top: auto;
  margin-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 280px;
}
/* Onboarding Footer */
.onboarding-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg-90);
}

/* Pagination Dots */
.pagination {
  display: flex;
  gap: 10px;
  margin-bottom: 2rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary-30);
  transition: background 0.3s, transform 0.3s;
}

.dot.active {
  background: var(--color-primary);
  transform: scale(1.1);
}

/* Buttons */
.btn-primary {
  width: 100%;
  max-width: 280px;
  padding: 16px 32px;
  background: var(--color-primary);
  color: #DCCAE9;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary:active {
  background: var(--color-primary-dark);
  transform: scale(0.97);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  max-width: 280px;
  padding: 16px 32px;
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary:active {
  background: var(--color-primary-10);
  transform: scale(0.97);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Auth Screens */
.auth-screen {
  background: var(--color-primary);
}
.auth-screen:not(.hidden) {
  z-index: 950;
}

.auth-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 24px;
  padding-top: env(safe-area-inset-top, 0);
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #DCCAE9;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: rgba(220, 202, 233, 0.92);
  margin-bottom: 24px;
}

.auth-input {
  width: 100%;
  padding: 16px 20px;
  background: var(--color-bg-25);
  border: none;
  border-radius: var(--radius-input);
  font-size: 1rem;
  color: #DCCAE9;
  outline: none;
  transition: background 0.2s;
}

.auth-input::placeholder {
  color: rgba(220, 202, 233, 0.78);
}

.auth-input:focus {
  background: var(--color-bg-35);
}

.auth-error {
  font-size: 0.85rem;
  color: var(--color-error);
  margin-top: 8px;
  min-height: 1.2em;
}

.auth-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.9rem;
  color: #DCCAE9;
  text-decoration: underline;
}

.auth-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg-90);
}

.auth-footer .btn-primary {
  background: var(--color-primary);
  color: var(--color-bg);
}

.auth-footer .btn-primary:active:not(:disabled) {
  background: var(--color-bg-active);
}

.auth-footer .btn-secondary {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}

/* Data Input Screen */
.data-screen {
  background: var(--color-primary);
}

.data-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0) 24px 0;
  overflow-y: auto;
}

.data-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-bg);
  text-align: center;
  line-height: 1.4;
  margin: 40px 0 32px;
}

.data-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.data-row {
  display: flex;
  gap: 12px;
}

.data-row .data-field {
  flex: 1;
}

.data-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.data-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-bg);
}

.data-field-error {
  font-size: 0.85rem;
  color: var(--color-error);
  margin-top: 4px;
}

.data-input {
  width: 100%;
  padding: 16px;
  background: var(--color-bg);
  border: none;
  border-radius: var(--radius-input);
  font-size: 1rem;
  color: #724C9D;
  caret-color: #724C9D;
  outline: none;
  transition: background 0.2s, box-shadow 0.2s;
}

.data-input::placeholder {
  color: #B09EC5;
  opacity: 1;
}

.data-input::-webkit-input-placeholder {
  color: #B09EC5;
  opacity: 1;
}

.data-input::-moz-placeholder {
  color: #B09EC5;
  opacity: 1;
}

.data-input:-ms-input-placeholder {
  color: #B09EC5;
  opacity: 1;
}

.data-input:focus {
  box-shadow: 0 0 0 2px rgba(114, 76, 157, 0.3);
}

/* Place Autocomplete */
.place-input-wrapper {
  position: relative;
  width: 100%;
}

.place-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  background: var(--color-bg);
  border-radius: var(--radius-input);
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.place-suggestion-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.place-suggestion-item:hover,
.place-suggestion-item.active {
  background: var(--color-bg-active);
}

.place-suggestion-item .suggestion-main {
  font-weight: 500;
  color: var(--color-primary);
}

.place-suggestion-item .suggestion-sub {
  font-size: 0.8rem;
  color: var(--color-primary-70);
  margin-top: 2px;
}

.data-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg-90);
}

.data-footer .btn-primary {
  background: var(--color-primary);
  color: var(--color-bg);
}

.data-footer .btn-primary:active:not(:disabled) {
  background: var(--color-bg-active);
}


/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(147, 86, 160, 0.7);
  z-index: 100;
}

.loading-overlay.hidden {
  display: none;
}

.loader-spinner {
  width: 120px;
  height: 120px;
}

.loader-spinner.spinning {
  animation: spin 1s linear infinite;
}

/* Main App */
.app {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  overflow: hidden;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0));
  background: #724C9D;
  border-radius: 0 0 16px 16px;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-cards-letters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-card-letter-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s;
}

.app-card-letter-wrap:active {
  transform: scale(0.95);
}

.app-card-letter-bg {
  width: 44px;
  height: 44px;
}

.app-card-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-bg);
  font-size: 18px;
  font-weight: 600;
  font-family: 'Roboto', sans-serif;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-menu-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.app-menu-btn:active {
  transform: scale(0.95);
}

.menu-kebab-icon {
  width: 44px;
  height: 44px;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lang-btn {
  background: #724C9D;
  border: none;
  color: var(--color-bg);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 102;
}

.lang-dropdown {
  position: absolute;
  top: 50%;
  width: 36px;
  background: var(--color-bg);
  border-radius: 0 0 18px 18px;
  z-index: 101;
  overflow: hidden;
  padding-top: 20px;
  box-shadow: 0 4px 16px rgba(114, 76, 157, 0.4);
}

.lang-dropdown.hidden {
  display: none;
}

.lang-option {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  padding: 10px 0;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}

.lang-option:hover {
  background: rgba(147, 86, 160, 0.15);
}

.app-credits {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg);
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
}

.credits-amount {
  color: var(--color-primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.credits-star {
  width: 20px;
  height: 20px;
}

.currency-star {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.app-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 16px;
  align-content: start;
  overflow-y: auto;
  min-height: 0;
}

.app-card {
  background: var(--color-primary);
  border-radius: 16px;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  aspect-ratio: 1 / 1.25;
  cursor: pointer;
  transition: transform 0.2s;
}

.app-card:active {
  transform: scale(0.97);
}

.app-card-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

svg.app-card-img {
  width: 90px;
  height: 80px;
}

.app-card--full {
  grid-column: 1 / -1;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  aspect-ratio: 5 / 3;
}

.app-card-text {
  color: #DCCAE9;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0;
}

/* Daily forecast widget (full-width home card) */
.daily-widget {
  aspect-ratio: 5 / 3;
  min-height: auto;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 18px 16px;
  gap: 12px;
  text-align: left;
  flex-direction: column;
}

.daily-widget-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.daily-widget-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}

.daily-widget-header-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.daily-widget-title {
  color: #DCCAE9;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.daily-widget-weekday {
  color: #DCCAE9;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
}

.daily-widget-tip {
  color: #DCCAE9;
  font-size: 0.85rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  width: 100%;
  padding-bottom: 2px;
}

.daily-widget-placeholder {
  visibility: hidden;
}

.app-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  background: #724C9D;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  flex-shrink: 0;
  width: 100%;
  position: relative; 
  z-index: 100;
  box-shadow: 0 0 8px 0 rgba(114, 76, 157, 1);
}

.app-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  background: none;
  border: none;
  color: var(--color-bg-60);
  font-size: 0.75rem;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  padding: 10px 8px;
  border-radius: 0;
  transition: background 0.2s, color 0.2s;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
  letter-spacing: 0;
}

.app-nav-item.active {
  background: var(--color-primary);
  color: #DCCAE9;
}

.app-nav-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.app-nav-svg {
  fill: var(--color-bg-60);
}

.app-nav-svg path {
  fill: var(--color-bg-60);
}

.app-nav-label {
  text-align: center;
  max-width: 80px;
}

/* Analysis Screen */
.analysis-screen {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.analysis-title {
  font-size: 18px;
  font-weight: 500;
  font-style: normal;
  line-height: 120%;
  letter-spacing: 0;
  color: #724C9D;
  text-align: center;
  padding: 24px 16px 16px;
}

.screen-placeholder {
  text-align: center;
  padding: 40px 16px;
  color: #724C9D;
  font-size: 14px;
  opacity: 0.6;
}

/* Date Picker */
.date-picker {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-left: 16px;
}

.date-picker-arrow {
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #724C9D;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.date-picker-arrow svg {
  width: 20px;
  height: 20px;
}

.date-picker-prev svg {
  transform: rotate(180deg);
}

.date-picker-value {
  color: #724C9D;
  font-size: 16px;
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

.date-picker-btn {
  margin-left: auto;
  background: var(--color-primary);
  color: #DCCAE9;
  border: none;
  border-radius: var(--radius-btn);
  padding: 14px 44px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.date-picker-btn:hover {
  background: var(--color-primary);
}

/* Toggle */
.date-details-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 8px 0;
  color: #DCCAE9;
  font-size: 14px;
  font-weight: 400;
}

.toggle {
  width: 78px;
  height: 42px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* Filter Bar */
.date-filter-bar {
  display: flex;
  align-items: stretch;
  background: #9356A0;
  border: 1px solid rgba(220, 202, 233, 0.35);
  border-radius: 28px;
  padding: 0;
  margin-bottom: 12px;
  min-height: 48px;
}

.date-filter-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 20px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 500;
}

.date-filter-btn.active .date-filter-icon {
  color: #9356A0;
}

.date-filter-btn.active {
  background: #DCCAE9;
}

.date-filter-btn.active-filter {
  background: #DCCAE9;
  color: #9356A0;
  flex: 0.6;
  padding: 0 18px;
}

.date-filter-btn:not(.active):not(.active-filter) .date-filter-icon {
  color: #DCCAE9;
}

.date-filter-btn:not(.active):not(.active-filter) {
  color: #DCCAE9;
}

.date-filter-icon {
  display: flex;
  width: 24px;
  height: 24px;
  color: #DCCAE9;
}

.date-filter-icon svg {
  width: 100%;
  height: 100%;
}

/* Date Entries */
.date-entry {
  display: flex;
  align-items: center;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  gap: 12px;
}

/* The favorable-dates answer sits on the purple card; each period entry keeps
   its own quality background (favorable = light, unfavorable = dark,
   neutral = none). */
.date-favorable {
  background: #DCCAE9;
  color: #724C9D;
}

.date-unfavorable {
  background: #724C9D;
  color: #DCCAE9;
}

.date-neutral {
  background: transparent;
  color: #DCCAE9;
}

.date-entry-period {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
}

.date-entry-month {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.date-entry-range {
  font-size: 16px;
  font-weight: 600;
}

.date-entry-label {
  flex: 1;
  font-size: 13px;
  font-weight: 400;
}

.date-entry-icon {
  width: 28px;
  height: 28px;
  color: #724C9D;
  flex-shrink: 0;
}

.date-entry-icon svg {
  width: 100%;
  height: 100%;
}

.date-month-header {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #DCCAE9;
  padding: 8px 0 4px;
}

.date-unfavorable .date-entry-icon {
  color: #DCCAE9;
}

.date-neutral .date-entry-icon {
  color: #DCCAE9;
}

.spheres-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px;
}

.sphere-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
  position: relative;
}

.sphere-item::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -16px;
  right: -16px;
  background: var(--color-primary);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
  pointer-events: none;
}

.sphere-item.open::before {
  opacity: 1;
}

.sphere-item.open {
  color: #DCCAE9;
}

.sphere-item.open .sphere-text {
  color: #DCCAE9;
}

.sphere-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sphere-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  color: #724C9D;
  transition: color 0.3s;
}

.sphere-item.open .sphere-icon {
  color: #DCCAE9;
}

.sphere-text {
  color: #724C9D;
  font-size: 16px;
  font-weight: 500;
  font-style: normal;
  line-height: 120%;
  letter-spacing: 0px;
}

.sphere-arrow {
  width: 20px;
  height: 20px;
  object-fit: contain;
  transition: transform 0.3s, color 0.3s;
  color: #724C9D;
}

.sphere-item.open .sphere-arrow {
  transform: rotate(90deg);
  color: #DCCAE9;
}

/* Sphere-section bell: mirrors the question bells inside the section. Shown
   only while the section contains an answer the user hasn't opened yet. */
.sphere-item-bell {
  display: none;
  margin-left: auto;
  margin-right: 4px;
  align-items: center;
  color: #9356A0;
}

.sphere-item-bell svg {
  display: block;
  width: 20px;
  height: 20px;
}

.sphere-item.has-unread .sphere-item-bell {
  display: flex;
}

.sphere-item.open .sphere-item-bell {
  color: #DCCAE9;
}

.sphere-questions {
  display: none;
  padding: 8px 16px 12px 16px;
}

.sphere-item.open + .sphere-questions {
  display: block;
}

.sphere-question {
  background: transparent;
  border: 1px solid var(--color-primary-70);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  cursor: pointer;
}

.sphere-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sphere-question[data-answered="true"] .sphere-question-count,
.sphere-question[data-answered="true"] .sphere-question-stars > img:not(.mini-loader) {
  display: none;
}

.sphere-question[data-answered="true"] .sphere-question-stars svg {
  color: #9356A0;
  width: 36px;
  height: 36px;
}

.sphere-question-arrow {
  display: none;
  width: 20px;
  height: 20px;
  color: #724C9D;
}

.mini-loader {
  width: 36px;
  height: 36px;
}

.mini-loader.spinning {
  animation: spin 1s linear infinite;
}

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

.sphere-question[data-opened="true"] .sphere-question-arrow {
  display: block;
}

.sphere-question[data-opened="true"][data-status="PENDING"] .sphere-question-arrow {
  display: none;
}

.sphere-question[data-opened="true"] .sphere-question-stars {
  display: none;
}

/* Keep stars visible during PENDING loading even when opened in analysis */
.sphere-question[data-opened="true"][data-status="PENDING"] .sphere-question-stars {
  display: flex;
}

/* Date-selection mirrors the analysis screen: opening a calculated question
   turns its bell into an arrow (the general
   `.sphere-question[data-opened="true"] .sphere-question-arrow` rule paints
   the arrow).  While the calculation is running the loader stays visible; the
   date-picker keeps its stars (price) but shows no arrow. */
#date-selection .sphere-question[data-opened="true"][data-status="COMPLETE"] .sphere-question-stars,
#date-selection .sphere-question[data-opened="true"][data-status="READ"] .sphere-question-stars {
  display: none;
}

#date-selection .sphere-question[data-opened="true"][data-status="NOT_PURCHASED"] .sphere-question-stars {
  display: flex;
}

#date-selection .sphere-question[data-opened="true"][data-status="NOT_PURCHASED"] .sphere-question-arrow {
  display: none;
}

/* Hide loader when answer is complete — bell SVG takes over */
#date-selection .sphere-question[data-status="COMPLETE"] .mini-loader,
#date-selection .sphere-question[data-status="READ"] .mini-loader {
  display: none;
}

/* In date-selection, keep the stars area visible but hide star img + count
   once answered — the bell SVG takes over */
#date-selection .sphere-question[data-answered="true"] .sphere-question-stars > img:not(.mini-loader),
#date-selection .sphere-question[data-answered="true"] .sphere-question-count {
  display: none;
}

#date-selection .sphere-question[data-answered="true"] .sphere-question-stars svg {
  color: #9356A0;
  width: 36px;
  height: 36px;
}

.sphere-question[data-opened="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.sphere-question[data-opened="true"] .sphere-question-text {
  color: #DCCAE9;
}

.sphere-question[data-opened="true"] .sphere-question-arrow {
  color: #DCCAE9;
}

/* Favorable dates: an opened question that is NOT yet calculated (still
   loading / date picker) keeps the screen's general background — no highlight.
   The answer text stays dark, matching the normal ink on the dark theme. */
#date-selection .sphere-question[data-opened="true"],
#date-selection .sphere-question[data-opened="true"].expanded {
  background: transparent;
  border: 1px solid var(--color-primary-70);
}

#date-selection .sphere-question[data-opened="true"] .sphere-question-text,
#date-selection .sphere-question[data-opened="true"] .sphere-question-arrow {
  color: #724C9D;
}

/* A CALCULATED favorable-dates question matches the calculated Analysis-of-
   spheres question: purple card with light text (the general
   `.sphere-question[data-opened="true"]` rule paints analysis this way).
   This must win over the transparent `[data-opened="true"].expanded` rule so
   the whole card stays filled to its border and rounded corners even when
   expanded.  The ready answer area keeps the same #9356A0 background. */
#date-selection .sphere-question[data-status="COMPLETE"],
#date-selection .sphere-question[data-status="READ"],
#date-selection .sphere-question[data-status="COMPLETE"].expanded,
#date-selection .sphere-question[data-status="READ"].expanded {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

#date-selection .sphere-question[data-status="COMPLETE"] .sphere-answer,
#date-selection .sphere-question[data-status="READ"] .sphere-answer {
  background: #9356A0;
}

#date-selection .sphere-question[data-status="COMPLETE"] .sphere-question-text,
#date-selection .sphere-question[data-status="READ"] .sphere-question-text,
#date-selection .sphere-question[data-status="COMPLETE"] .sphere-question-arrow,
#date-selection .sphere-question[data-status="READ"] .sphere-question-arrow {
  color: #DCCAE9;
}

/* When a question is opened its card turns the primary purple; any answer
   text shown inline must be light (#DCCAE9) to stay readable on that
   background.  Favorable dates keeps dark ink only while the card is NOT yet
   calculated (still transparent); a calculated card is purple (like the
   analysis screen), so its answer must be light too — see below. */
.sphere-question[data-opened="true"].expanded .sphere-answer,
.sphere-question[data-opened="true"].expanded .sphere-answer p,
.sphere-question[data-opened="true"].expanded .sphere-answer li,
.sphere-question[data-opened="true"].expanded .sphere-answer .express-answer-title {
  color: #DCCAE9;
}

#date-selection .sphere-question[data-opened="true"].expanded .sphere-answer,
#date-selection .sphere-question[data-opened="true"].expanded .sphere-answer p,
#date-selection .sphere-question[data-opened="true"].expanded .sphere-answer li,
#date-selection .sphere-question[data-opened="true"].expanded .sphere-answer .express-answer-title {
  color: var(--color-primary);
}

/* Calculated favorable-dates cards sit on the purple background, so their
   expanded answer keeps the light ink like the analysis screen. */
#date-selection .sphere-question[data-status="COMPLETE"].expanded .sphere-answer,
#date-selection .sphere-question[data-status="COMPLETE"].expanded .sphere-answer p,
#date-selection .sphere-question[data-status="COMPLETE"].expanded .sphere-answer li,
#date-selection .sphere-question[data-status="COMPLETE"].expanded .sphere-answer .express-answer-title,
#date-selection .sphere-question[data-status="READ"].expanded .sphere-answer,
#date-selection .sphere-question[data-status="READ"].expanded .sphere-answer p,
#date-selection .sphere-question[data-status="READ"].expanded .sphere-answer li,
#date-selection .sphere-question[data-status="READ"].expanded .sphere-answer .express-answer-title {
  color: #DCCAE9;
}

.sphere-question[data-opened="true"].expanded .sphere-question-arrow {
  transform: rotate(90deg);
}

.sphere-answer {
  display: none;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  line-height: 130%;
  letter-spacing: 0px;
  color: #724C9D;
}

.sphere-question.expanded .sphere-answer {
  display: block;
}

.sphere-answer p {
  margin-bottom: 8px;
}

.sphere-answer ul {
  margin: 0;
  padding-left: 20px;
}

.sphere-answer li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.sphere-question-text {
  color: #724C9D;
  font-size: 14px;
  font-weight: 500;
  font-style: normal;
  line-height: 130%;
  letter-spacing: 0px;
  flex: 1;
}

.app-card[role="button"]:focus-visible,
.sphere-item[role="button"]:focus-visible,
.sphere-question[role="button"]:focus-visible,
.toggle:focus-visible,
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #DCCAE9;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toggle[role="switch"] { cursor: pointer; }

.sphere-question-stars {
  display: flex;
  align-items: center;
  position: relative;
  margin-left: 8px;
  flex-shrink: 0;
}

.sphere-question-stars img {
  width: 36px;
  height: 36px;
}

.sphere-question-count {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #DCCAE9;
  font-size: 13.33px;
  font-weight: 500;
  font-style: normal;
  line-height: 130%;
  text-align: center;
}

/* Card List Screen */
.card-list-screen {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.card-list-footer {
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg-90);
  margin-top: auto;
  flex-shrink: 0;
}

/* Compatibility Screen */
.compat-screen {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.compat-tabs {
  display: flex;
  margin: 12px 16px 0;
  margin-top: calc(12px + env(safe-area-inset-top, 0));
  border: 2px solid #724C9D;
  border-radius: var(--radius-btn);
  overflow: hidden;
}

.compat-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  background: transparent;
  color: #724C9D;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.compat-tab.active {
  background: #724C9D;
  color: var(--color-bg);
  border-radius: calc(var(--radius-btn) - 2px);
}

.compat-tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: filter 0.2s;
}

.compat-tab.active .compat-tab-icon {
  filter: brightness(0) invert(0.86);
}

.compat-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

.compat-tab-content.hidden {
  display: none;
}

/* Daily forecast screen (full page, compat/express purple style) */
.daily-screen {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.daily-title {
  padding: calc(24px + env(safe-area-inset-top, 0)) 16px 16px;
}

.daily-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 20px;
}

/* Hero card: purple gradient, light lavender text (compat/express look) */
.daily-hero {
  background: linear-gradient(135deg, #9356A0, #7a4688);
  border-radius: var(--radius-card);
  padding: 20px;
  color: #DCCAE9;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.daily-hero-date {
  font-size: 16px;
  font-weight: 700;
  color: #DCCAE9;
  margin: 0;
  text-align: center;
}

.daily-hero-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.daily-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.daily-hero-label {
  font-size: 13px;
  color: #DCCAE9;
  opacity: 0.85;
  flex-shrink: 0;
}

.daily-hero-value {
  font-size: 13px;
  font-weight: 700;
  color: #DCCAE9;
  text-align: right;
}

/* Section cards: light lavender on purple-bordered surface */
.daily-section {
  background: var(--color-bg-80);
  border: 1px solid var(--color-primary-30);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.daily-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #9356A0;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.daily-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.daily-row-label {
  color: #9356A0;
  font-size: 13px;
  opacity: 0.75;
  flex-shrink: 0;
}

.daily-row-value {
  color: #7a4688;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.daily-subsection {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.daily-subsection-title {
  color: #9356A0;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.daily-list {
  margin: 0;
  padding-left: 18px;
  color: #7a4688;
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* AI narrative card: purple gradient with light text */
.daily-ai-card {
  background: linear-gradient(135deg, #9356A0, #7a4688);
  border: none;
}

.daily-ai-card .daily-section-title {
  color: #DCCAE9;
}

.daily-ai-summary {
  color: #DCCAE9;
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  white-space: pre-wrap;
}

.daily-ai-note {
  color: #7a4688;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
}

.daily-ai-card .daily-row-label {
  color: #DCCAE9;
  opacity: 0.85;
}

.daily-ai-card .daily-row-value {
  color: #DCCAE9;
}

.daily-ai-card .daily-subsection-title {
  color: #DCCAE9;
}

.daily-ai-card .daily-list {
  color: #DCCAE9;
}

/* Daily forecast — share to stories button (bottom of .daily-scroll) */
.daily-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  margin-top: 4px;
  background: linear-gradient(135deg, #9356A0, #7a4688);
  color: #DCCAE9;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.daily-share-btn:active:not(:disabled) {
  transform: scale(0.98);
  opacity: 0.9;
}

.daily-share-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.daily-share-btn--loading {
  pointer-events: none;
}

.daily-share-btn-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* Sex selection tabs (match compat-tabs design) */
.sex-tabs {
  display: flex;
  border: 2px solid #DCCAE9;
  border-radius: var(--radius-btn);
  overflow: hidden;
}

.sex-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 0;
  background: transparent;
  color: #B09EC5;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s;
  position: relative;
  min-height: 52px;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sex-tab.active {
  background: #DCCAE9;
  color: #9356A0;
  border-radius: calc(var(--radius-btn) - 2px);
}

.sex-tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: filter 0.2s;
}

.sex-tab.active .sex-tab-icon {
  filter: none;
}

.compat-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-primary);
  text-align: center;
  padding: 30px 16px 20px;
}

.compat-card-list {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.overflowing > .compat-card-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.compat-card-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--color-primary-15);
  cursor: pointer;
  transition: background 0.2s, margin 0.2s, border-radius 0.2s;
}

.compat-card-item:last-child {
  border-bottom: none;
}

.compat-card-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.compat-card-avatar-bg {
  width: 44px;
  height: 44px;
}

.compat-card-avatar-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-bg);
  font-size: 1.1rem;
  font-weight: 600;
  pointer-events: none;
}

.compat-card-info {
  flex: 1;
  min-width: 0;
}

.compat-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compat-card-date {
  font-size: 13px;
  color: var(--color-primary);
  opacity: 0.7;
  margin-top: 2px;
}

.compat-card-radio {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.compat-card-edit {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.chart-edit-feedback-hint {
  font-size: 14px;
  color: var(--color-primary);
  opacity: 0.7;
  margin: 0 0 12px;
  line-height: 1.4;
}

.compat-card-item.locked {
  opacity: 0.5;
}

.compat-card-lock {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  filter: brightness(0) saturate(100%) invert(36%) sepia(32%) saturate(1275%) hue-rotate(254deg) brightness(89%) contrast(92%);
}

.compat-card-item.selected {
  background: var(--color-primary);
  border-radius: 0;
  margin: 4px 0;
  padding: 8px 16px;
}

.compat-card-item.selected .compat-card-name,
.compat-card-item.selected .compat-card-date {
  color: var(--color-bg);
}

.compat-card-item.selected .compat-card-avatar-letter {
  color: var(--color-bg);
}

.compat-card-item.selected .compat-card-edit {
  filter: brightness(0) invert(1);
}

.compat-card-item:has(+ .compat-card-item.selected) {
  border-bottom: none;
}

.compat-add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  background: none;
  border: none;
  color: var(--color-primary);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.compat-add-card:active {
  opacity: 1;
}

.compat-add-plus {
  font-size: 22px;
  font-weight: 300;
}

.compat-footer {
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg-90);
}

.compat-calc-btn {
  width: 100%;
  padding: 16px 32px;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, transform 0.1s;
}

.compat-calc-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.compat-calc-btn:active:not(:disabled) {
  background: var(--color-primary-dark);
  transform: scale(0.97);
}

/* Compatibility Loading */
.compat-loading {
  position: fixed;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  z-index: 200;
}

.compat-loading.hidden {
  display: none;
}

.compat-loading-avatars {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compat-loading-avatar {
  position: absolute;
  width: 120px;
  height: 120px;
}

.compat-loading-avatar:first-child {
  left: 10px;
  z-index: 1;
}

.compat-loading-avatar:last-of-type {
  right: 10px;
  z-index: 2;
}

.compat-loading-avatar-bg {
  width: 100%;
  height: 100%;
}

.compat-loading-avatar-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-bg);
  font-size: 2.5rem;
  font-weight: 600;
  pointer-events: none;
}

.compat-loading-spinner {
  position: absolute;
  width: 200px;
  height: 200px;
  z-index: 3;
  animation: spin 1s linear infinite;
}

.compat-loading-names {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-primary);
}

/* Compatibility No Results */
.compat-no-results {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}

.compat-no-results-text {
  font-size: 16px;
  color: var(--color-primary);
  text-align: center;
  line-height: 1.5;
  margin-top: 160px;
  margin-bottom: 120px;
}

.compat-loading.hidden { display: none; }
.compat-tab-content.hidden { display: none; }
.compat-no-results.hidden { display: none; }
.compat-results-header.hidden { display: none; }
.compat-results-list.hidden { display: none; }
.compat-result-footer.hidden { display: none; }

.compat-no-results-img-wrap {
  width: 160%;
  margin-left: 0%;
  margin-top: auto;
  margin-bottom: -45%;
  line-height: 0;
}

.compat-no-results-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Compatibility Results */
.compat-results-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 16px 0;
}

.compat-results-sort {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--color-primary);
  transition: transform 0.2s ease;
}

.compat-results-sort img {
  display: block;
}

.compat-results-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 16px;
  overflow-y: auto;
  gap: 8px;
}

.compat-result-item {
  background: var(--color-primary);
  border-radius: var(--radius-card);
  overflow: hidden;
  flex-shrink: 0;
}

.compat-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  cursor: pointer;
}

.compat-result-avatars {
  display: flex;
  align-items: center;
}

.compat-result-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
}

.compat-result-avatar-bg {
  width: 36px;
  height: 36px;
}

.compat-result-avatar-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-bg);
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
}

.compat-result-avatar-wrap:nth-child(2) {
  margin-left: -10px;
}

.compat-result-percent {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-bg);
  margin-left: 8px;
}

.compat-result-chevron {
  width: 20px;
  height: 20px;
  color: var(--color-bg);
  margin-left: auto;
  transition: transform 0.3s;
}

.compat-result-item.open .compat-result-chevron {
  transform: rotate(90deg);
}

.compat-result-item[data-status="PENDING"] .compat-result-chevron {
  display: none;
}

.compat-result-body {
  display: none;
  padding: 0 16px 16px;
  color: var(--color-bg);
}

.compat-result-item.open .compat-result-body {
  display: block;
}

.compat-result-names {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.compat-result-desc {
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.9;
}

.compat-result-footer {
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg-90);
}

/* ── Mode Tabs (Love / Friendship) ── */
.compat-mode-tabs {
  display: flex;
  flex-shrink: 0;
  margin: 12px 16px 0;
  border: 2px solid #724C9D;
  border-radius: var(--radius-btn);
  overflow: hidden;
}

.compat-mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  background: transparent;
  color: #724C9D;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.compat-mode-tab.active {
  background: #724C9D;
  color: var(--color-bg);
  border-radius: calc(var(--radius-btn) - 2px);
}

.compat-mode-tab-icon {
  font-size: 16px;
}

/* ── Compatibility Blocks (accordion) ── */
.compat-blocks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
}

.compat-block {
  background: var(--color-bg-80);
  border: 1px solid var(--color-primary-30);
  border-radius: 12px;
  padding: 14px;
}

.compat-block-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.compat-block-desc {
  font-size: 12px;
  color: var(--color-primary-70);
  margin-bottom: 10px;
  line-height: 1.4;
}

/* Kuta Chips */
.compat-kutas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.compat-kuta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-primary);
  color: var(--color-bg);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.compat-kuta-chip strong {
  font-weight: 700;
}

/* Planetary Lines */
.compat-planet-line {
  font-size: 13px;
  color: var(--color-primary-70);
  padding: 3px 0;
  border-bottom: 1px solid var(--color-primary-15);
}

.compat-planet-line:last-child {
  border-bottom: none;
}

.compat-planet-dir {
  color: var(--color-primary);
  font-weight: 500;
}

.compat-planet-strength {
  color: var(--color-primary-70);
  font-style: italic;
}

.compat-planet-house {
  color: var(--color-primary-30);
  font-size: 12px;
}

.compat-planet-aspect {
  color: var(--color-primary);
  font-size: 12px;
}

.compat-planet-planet {
  color: var(--color-primary);
  font-weight: 500;
}

/* 11th House */
.compat-house11 {
  margin-top: 6px;
}

.compat-house11-line {
  font-size: 13px;
  color: var(--color-primary-70);
  padding: 2px 0;
}

/* Asymmetry */
.compat-asymmetry {
  margin-top: 6px;
}

.compat-asym-line {
  font-size: 13px;
  color: var(--color-primary-70);
  padding: 2px 0;
}

/* Mangala Dosha */
.compat-mangala {
  font-size: 13px;
  color: var(--color-primary-70);
  font-style: italic;
}

/* Total Score */
.compat-total-score {
  text-align: center;
  margin-top: 8px;
  padding: 12px;
  background: transparent;
}

.compat-total-score-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
}

.compat-total-score-hint {
  font-size: 11px;
  color: var(--color-primary-70);
  margin-top: 4px;
  line-height: 1.4;
}

/* Mode Label in Results */
.compat-result-mode-label {
  font-size: 13px;
  color: rgba(232, 220, 240, 0.8);
  margin-left: auto;
}

/* ── AI Interpretation Blocks ── */
.compat-interpretation-block {
  padding: 14px 0;
  margin-bottom: 8px;
}

.compat-interpretation-block:last-child {
  margin-bottom: 0;
}

.compat-interpretation-title {
  font-size: 15px;
  font-weight: 700;
  color: #DCCAE9;
  margin-bottom: 6px;
}

.compat-interpretation-text {
  font-size: 14px;
  color: #DCCAE9;
  line-height: 1.5;
}

.compat-interpretation-total {
  margin-top: 12px;
  padding: 10px 14px;
  border-top: 1px solid rgba(220, 202, 233, 0.3);
}

.compat-interpretation-total-text {
  font-size: 12px;
  color: #DCCAE9;
  line-height: 1.4;
  text-align: center;
}

/* Shop Screen */
.shop-screen {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.shop-header .analysis-title {
  padding: 24px 0 16px;
}

.shop-credits {
  cursor: default;
  border: 2px solid var(--color-primary);
}

.shop-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 16px 16px;
  overflow-y: auto;
}

/* Subscription Card */
.shop-sub-card {
  background: transparent;
  border: 2px solid var(--color-primary);
  border-radius: 20px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-sub-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-sub-icon {
  flex-shrink: 0;
}

.shop-sub-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #724C9D;
}

.shop-sub-desc {
  font-size: 0.85rem;
  color: #724C9D;
  font-weight: 400;
}

.shop-sub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-sub-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid rgba(114, 76, 157, 0.3);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #724C9D;
}

.shop-sub-tag-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  object-fit: contain;
}

.shop-sub-tag-bonus {
  font-weight: 600;
}

.shop-sub-btn {
  width: 100%;
  margin-top: 4px;
  padding: 16px 0;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.shop-sub-btn:active {
  background: var(--color-primary-dark);
  transform: scale(0.97);
}

/* Active Subscription Status Card */
.shop-sub-status-card {
  background: linear-gradient(135deg, rgba(114, 76, 157, 0.1), rgba(147, 86, 160, 0.05));
  border: 2px solid var(--color-primary);
  border-radius: 20px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Hidden until the profile confirms an active subscription. */
.shop-sub-status-card.hidden {
  display: none;
}

.shop-sub-status-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(220, 202, 233, 0.6);
  border-radius: 6px;
}

.shop-sub-status-label {
  font-size: 0.9rem;
  color: #724C9D;
  font-weight: 500;
}

.shop-sub-status-date {
  font-size: 1rem;
  color: #724C9D;
  font-weight: 600;
  margin-left: auto;
}

.shop-sub-renew-btn {
  width: 100%;
  padding: 14px 0;
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.shop-sub-renew-btn:active {
  background: rgba(114, 76, 157, 0.1);
  transform: scale(0.97);
}

/* Stars Grid */
.shop-stars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.shop-star-card {
  position: relative;
  background: var(--color-primary);
  border-radius: 20px;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  aspect-ratio: 1 / 1.1;
}

.shop-star-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.shop-star-center .shop-star-icon + .shop-star-count {
  margin-top: 6px;
}

.shop-star-img {
  width: 88%;
  max-width: 120px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(114, 76, 157, 0.4));
}

.shop-star-bonus {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--color-bg);
}

.shop-star-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-bg);
  pointer-events: none;
}

.shop-badge-popular {
  background: var(--color-bg);
  color: var(--color-primary);
  border-radius: 0 0 10px 10px;
  padding: 4px 14px;
  white-space: nowrap;
}

.shop-star-corner-icon {
  position: absolute;
  width: 24px;
  height: 24px;
  top: 10px;
}

.shop-star-corner-left {
  left: 10px;
}

.shop-star-corner-right {
  right: 10px;
}

.shop-star-count {
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--color-bg);
}

.shop-star-btn {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  color: var(--color-bg);
  border: 1.5px solid var(--color-bg-60);
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: auto;
}

.shop-star-btn:active {
  background: var(--color-bg-25);
  transform: scale(0.97);
}

.shop-star-price-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: auto;
}

.shop-original-price {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-bg-60);
  text-decoration: line-through;
}

.shop-original-price-btn {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-bg-60);
  text-decoration: line-through;
  margin-right: 6px;
}

.shop-promo-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #FF3B30;
  color: #DCCAE9;
  border-radius: 0 0 10px 10px;
  padding: 4px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

.shop-star-card--promo {
  border: 2px solid #FF3B30;
}

/* Safe area support for notch devices */
@supports (padding: env(safe-area-inset-top)) {
  .app-header {
    padding-top: calc(12px + env(safe-area-inset-top));
  }
}

/* Subscription Modal */
.sub-modal {
  position: fixed;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  /* Must sit above every screen (onboarding/auth use z-index 900–950),
     but below transient toasts (9999) and the tour overlay (10001). */
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.sub-modal.hidden {
  display: none;
}

.sub-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(147, 86, 160, 0.5);
  z-index: 0;
}

.sub-modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.sub-modal-card {
  background: #E8D5F0;
  border: 2px solid var(--color-primary);
  border-radius: 12px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.sub-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #724C9D;
  text-align: center;
  line-height: 1.3;
}

.sub-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.sub-modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid rgba(114, 76, 157, 0.3);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #724C9D;
}

.sub-modal-tag-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  object-fit: contain;
}

.sub-modal-tag-bonus {
  font-weight: 600;
}

.sub-modal-subscribe-btn {
  width: 100%;
  padding: 16px 0;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.sub-modal-subscribe-btn:active {
  background: var(--color-primary-dark);
  transform: scale(0.97);
}

.sub-modal-cancel-btn {
  width: 100%;
  padding: 14px 0;
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.sub-modal-cancel-btn:active {
  background: var(--color-primary-10);
  transform: scale(0.97);
}

.sub-modal-invite-btn {
  width: 100%;
  padding: 14px 0;
  background: transparent;
  color: var(--color-primary);
  border: 1.5px dashed var(--color-primary);
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.sub-modal-invite-btn:active {
  background: var(--color-primary-10);
  transform: scale(0.97);
}

/* Browser-only shop notice */
.shop-browser-modal-card {
  gap: 16px;
  padding: 20px 14px 24px;
  border-radius: 22px;
  box-shadow: 0 0 18px rgba(114, 76, 157, 0.55);
}

.shop-browser-modal-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}

.shop-browser-modal-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: #724C9D;
  border-radius: 10px;
}

.shop-browser-modal-icon img {
  width: 24px;
  height: 24px;
}

.shop-browser-modal-close {
  padding: 0 6px;
  color: rgba(114, 76, 157, 0.7);
  background: transparent;
  border: 0;
  font: 400 28px/1 Arial, sans-serif;
  cursor: pointer;
}

.shop-browser-modal-title {
  margin: 6px 0 0;
  color: #724C9D;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.shop-browser-modal-text {
  max-width: 360px;
  margin: 0;
  color: #724C9D;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

.shop-browser-modal-telegram,
.shop-browser-modal-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border-radius: 24px;
  font: 400 1rem/1.2 sans-serif;
  text-decoration: none;
}

.shop-browser-modal-telegram {
  gap: 8px;
  margin-top: 6px;
  color: var(--color-bg);
  background: #9855A5;
}

.shop-browser-modal-mobile {
  gap: 8px;
  color: #9855A5;
  background: transparent;
  border: 1px solid #9855A5;
  font-family: inherit;
  cursor: not-allowed;
  opacity: 0.95;
}

.shop-browser-modal-telegram img,
.shop-browser-modal-mobile img {
  width: 20px;
  height: 20px;
}

/* Congrats Modal */
.congrats-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #724C9D;
  text-align: center;
}

.congrats-text {
  font-size: 0.9rem;
  color: #724C9D;
  text-align: center;
  line-height: 1.5;
}

.congrats-action-btn {
  width: 100%;
  padding: 16px 0;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.congrats-action-btn:active {
  background: var(--color-primary-dark);
  transform: scale(0.97);
}

/* Star Success Card */
.star-success-card {
  gap: 12px;
}

.star-success-decoration {
  display: flex;
  justify-content: center;
}

.star-success-img {
  width: 80px;
  height: auto;
  opacity: 0.7;
}

/* Star Spend / Insufficient Modals */
.star-spend-card {
  gap: 12px;
}

.star-spend-label {
  font-size: 0.85rem;
  color: #724C9D;
  text-align: center;
}

.star-spend-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #724C9D;
  text-align: center;
}

.star-spend-balance {
  font-size: 0.9rem;
  color: #724C9D;
  text-align: center;
}

.star-spend-hint {
  font-size: 0.85rem;
  color: #724C9D;
  text-align: center;
  opacity: 0.8;
}

.daily-full-text {
  font-size: 0.9rem;
  color: #724C9D;
  line-height: 1.5;
  text-align: left;
  white-space: pre-line;
}

.star-spend-btns {
  display: flex;
  gap: 12px;
  width: 100%;
}

.star-spend-btn-cancel {
  flex: 1;
  padding: 14px 0;
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.star-spend-btn-cancel:active {
  background: var(--color-primary-10);
  transform: scale(0.97);
}

.star-spend-btn-confirm {
  flex: 1;
  padding: 14px 0;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.star-spend-btn-confirm:active {
  background: var(--color-primary-dark);
  transform: scale(0.97);
}

.star-spend-btn-cancel-full {
  width: 100%;
  padding: 14px 0;
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.star-spend-btn-cancel-full:active {
  background: var(--color-primary-10);
  transform: scale(0.97);
}

/* ── Expert Mode ── */

/* Expert Active Screen */
.expert-active-screen {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--color-bg);
  min-height: 100vh;
  overflow: hidden;
}

.expert-active-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-top: env(safe-area-inset-top, 0);
  overflow: visible;
}

.expert-active-img-wrap {
  position: absolute;
  left: 190%;
  bottom: -10%;
  width: 70vw;
  height: auto;
  transform: translateX(-50%) scale(1.3); /* 1.3 означает увеличение на 30% */
  z-index: 1;
}

.expert-active-text {
  text-align: left;
  padding: 3rem 1.5rem 0;
  width: 100%;
  z-index: 10;
}

.expert-active-greeting {
  margin-bottom: 1.5rem;
}

.expert-active-hello {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 0.5rem;
}

.expert-active-subtitle {
  font-size: 0.95rem;
  color: #7B4BB1;
  line-height: 1.45;
  margin: 0;
  max-width: 280px;
}

.expert-active-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  max-width: 320px;
}

.expert-active-btn:active {
  background: var(--color-primary-dark);
  transform: scale(0.97);
}

.expert-active-btn-icon {
  width: 20px;
  height: 20px;
  fill: #DCCAE9;
}

/* Expert Chat Screen */
.expert-chat-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: #E8DDF2;
}

.expert-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-bg);
  border-bottom: 1px solid rgba(147, 86, 160, 0.15);
  flex-shrink: 0;
}

.expert-chat-back {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--color-primary);
  flex-shrink: 0;
}

.expert-chat-back img {
  width: 28px;
  height: 28px;
  display: block;
}

.expert-chat-back:active {
  opacity: 0.6;
}

.expert-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.expert-chat-header-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.expert-chat-header-avatar-bg {
  width: 36px;
  height: 36px;
}

.expert-chat-header-avatar-letter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
  font-weight: 600;
  color: #DCCAE9;
}

.expert-chat-header-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* Chat Messages Area */
.expert-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.expert-msg {
  display: flex;
  max-width: 85%;
}

.expert-msg-user {
  align-self: flex-end;
}

.expert-msg-bot {
  align-self: flex-start;
}

.expert-msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
}

.expert-msg-user .expert-msg-bubble {
  background: #9A5EB5;
  color: #DCCAE9;
  border-bottom-right-radius: 6px;
}

.expert-msg-bot .expert-msg-bubble {
  background: #7B4BB1;
  color: #DCCAE9;
  border-bottom-left-radius: 6px;
}

/* Formatted text inside expert chat bubbles */
.expert-msg-bubble strong {
  font-weight: 700;
}

.expert-msg-bubble em {
  font-style: italic;
}

.expert-msg-bubble del {
  text-decoration: line-through;
  opacity: 0.7;
}

.expert-msg-bubble code {
  font-family: monospace;
  background: rgba(220, 202, 233, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.9em;
}

.expert-msg-bubble h3,
.expert-msg-bubble h2,
.expert-msg-bubble h1 {
  font-weight: 700;
  margin: 0 0 4px 0;
  line-height: 1.35;
}

.expert-msg-bubble h1 {
  font-size: 1.15rem;
}

.expert-msg-bubble h2 {
  font-size: 1.1rem;
}

.expert-msg-bubble h3 {
  font-size: 1.05rem;
}

.expert-msg-bubble h1:last-child,
.expert-msg-bubble h2:last-child,
.expert-msg-bubble h3:last-child {
  margin-bottom: 0;
}

.expert-msg-bubble p {
  margin: 0;
}

.expert-msg-bubble p + p {
  margin-top: 6px;
}

.expert-msg-bubble ol {
  margin: 0;
  padding-left: 20px;
}

.expert-msg-bubble ol li {
  margin-bottom: 4px;
}

.expert-msg-bubble ol li:last-child {
  margin-bottom: 0;
}

/* Typing indicator */
.expert-typing {
  display: flex;
  gap: 4px;
  padding: 6px 4px;
}

.expert-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #DCCAE9;
  animation: expertTyping 1.4s infinite ease-in-out both;
}

.expert-typing span:nth-child(1) {
  animation-delay: -0.32s;
}

.expert-typing span:nth-child(2) {
  animation-delay: -0.16s;
}

.expert-typing span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes expertTyping {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Chat Input Area */
.expert-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-bg);
  border-top: 2px solid rgba(147, 86, 160, 0.15);
  flex-shrink: 0;
}

.expert-chat-input-field {
  flex: 1;
  padding: 12px 18px;
  border: 1.5px solid var(--color-primary);
  border-radius: 24px;
  font-size: 1rem;
  font-family: inherit;
  background: #DCCAE9;
  color: #333;
  outline: none;
  transition: border-color 0.2s;
}

.expert-chat-input-field:focus {
  border-color: var(--color-primary-dark);
}

.expert-chat-input-field::placeholder {
  color: #A080B8;
}

.expert-chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
}

.expert-chat-send-btn:active {
  background: var(--color-primary-dark);
  transform: scale(0.92);
}

.expert-chat-send-btn:disabled {
  background: #B8A0C8;
  cursor: not-allowed;
}

.expert-chat-send-btn:disabled:active {
  transform: none;
}

.expert-chat-send-btn svg {
  transform: rotate(90deg);
}

/* Expert Chats List Screen */
.expert-chats-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  flex-shrink: 0;
}

.expert-chats-back {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--color-primary);
  flex-shrink: 0;
}

.expert-chats-back img {
  width: 28px;
  height: 28px;
  display: block;
}

.expert-chats-back:active {
  opacity: 0.6;
}

.expert-chats-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary);
  flex: 1;
  text-align: center;
  padding-right: 32px;
}

.expert-chats-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.expert-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(220, 202, 233, 0.6);
  border-radius: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.expert-chat-item:active {
  background: var(--color-bg-90);
  transform: scale(0.98);
}

.expert-chat-item-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  position: relative;
}

.expert-chat-item-avatar-bg {
  width: 44px;
  height: 44px;
}

.expert-chat-item-avatar-letter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.05rem;
  font-weight: 600;
  color: #DCCAE9;
}

.expert-chat-item-info {
  flex: 1;
  min-width: 0;
}

.expert-chat-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expert-chat-item-preview {
  font-size: 0.8rem;
  color: #8C51A8;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expert-chat-item-arrow {
  flex-shrink: 0;
  color: var(--color-primary);
  opacity: 0.5;
}

.expert-chats-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  color: #8C51A8;
}

.expert-chats-empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.expert-chats-empty-text {
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0;
  max-width: 280px;
}

.expert-chats-footer {
  padding: 16px;
  flex-shrink: 0;
  background: var(--color-bg-90);
}

.expert-chats-new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 0;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.expert-chats-new-btn:active {
  background: var(--color-primary-dark);
  transform: scale(0.98);
}

.expert-chats-new-btn svg {
  flex-shrink: 0;
}

/* ── Astrologer Screen ── */

.astrologer-screen {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.astrologer-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 20px;
}

/* ── Calculate Button ── */

.astrologer-calc-btn {
  padding: 10px 20px;
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}

.astrologer-calc-btn:active {
  background: var(--color-primary-dark);
  transform: scale(0.98);
}

/* Full-width calculate button (e.g. below list) */
.astrologer-calc-btn-full {
  width: 100%;
  max-width: 320px;
  margin: 16px auto 0;
  padding: 14px 24px;
  font-size: 1rem;
}

/* ── Results Area ── */

.astrologer-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Purple wrapper matching date-selection opened sphere-question background */
.astrologer-results-inner {
  background: var(--color-primary);
  border-radius: 12px;
  padding: 16px;
}

/* Chart details card inside results — matches compat-card-item but with light text on purple bg */
.astrologer-chart-details {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(220, 202, 233, 0.2);
}

.astrologer-chart-details .compat-card-name,
.astrologer-chart-details .compat-card-date {
  color: var(--color-bg);
}

.astrologer-chart-details .compat-card-avatar-letter {
  color: var(--color-bg);
}

/* ── Events List ── */

.astrologer-events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Event cards — full background colors matching .date-entry from dates */
.astrologer-event-card {
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}

.astrologer-event-card.positive {
  background: #DCCAE9;
  color: #724C9D;
}

.astrologer-event-card.neutral {
  background: transparent;
  color: #DCCAE9;
}

.astrologer-event-card.negative {
  background: #724C9D;
  color: #DCCAE9;
}

.astrologer-event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.astrologer-event-date-text {
  font-size: 0.85rem;
  font-weight: 500;
}

.astrologer-event-sentiment {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Icon colors — default for positive (light bg), overridden for dark/transparent bg */
.astrologer-event-sentiment {
  color: #724C9D;
}

.astrologer-event-card.negative .astrologer-event-sentiment,
.astrologer-event-card.neutral .astrologer-event-sentiment {
  color: #DCCAE9;
}

.astrologer-event-sentiment svg {
  width: 28px;
  height: 28px;
}

.astrologer-event-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.3;
}

.astrologer-event-desc {
  font-size: 0.88rem;
  margin: 0 0 10px;
  line-height: 1.5;
}

/* Advice box — adapts to card background */
.astrologer-event-advice {
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
}

.astrologer-event-card.positive .astrologer-event-advice {
  background: rgba(114, 76, 157, 0.1);
}

.astrologer-event-card.negative .astrologer-event-advice,
.astrologer-event-card.neutral .astrologer-event-advice {
  background: rgba(220, 202, 233, 0.12);
}

.astrologer-event-advice-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.astrologer-event-card.positive .astrologer-event-advice-label {
  color: #724C9D;
}

.astrologer-event-card.negative .astrologer-event-advice-label,
.astrologer-event-card.neutral .astrologer-event-advice-label {
  color: #DCCAE9;
}

.astrologer-event-advice-text {
  font-size: 0.85rem;
  margin: 4px 0 0;
  line-height: 1.45;
}

/* ── No Events Placeholder ── */

.astrologer-no-events {
  text-align: center;
  font-size: 0.9rem;
  color: #DCCAE9;
  padding: 32px 16px;
  margin: 0;
}

/* ── Astrologer Loading Overlay ── */

#astrologer-loading {
  position: fixed;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
}

#astrologer-loading.hidden {
  display: none;
}

/* Single-avatar layout: one letter centered with spinner behind it */
#astrologer-loading .compat-loading-avatars {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#astrologer-loading .compat-loading-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  /* Override the absolute positioning from compat — single avatar stays centered */
  left: auto;
  right: auto;
}

#astrologer-loading .compat-loading-avatar:first-child {
  left: auto;
  z-index: 1;
}

#astrologer-loading .compat-loading-avatar:last-of-type {
  right: auto;
  z-index: 2;
}

#astrologer-loading .compat-loading-avatar-bg {
  width: 120px;
  height: 120px;
}

#astrologer-loading .compat-loading-avatar-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-bg);
}

#astrologer-loading .compat-loading-spinner {
  position: absolute;
  width: 200px;
  height: 200px;
  z-index: 3;
  animation: spin 1s linear infinite;
  /* Reset the offset positioning from compat-loading-avatar layout */
  right: auto;
  top: auto;
  transform: none;
}

#astrologer-loading .compat-loading-names {
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  color: var(--color-primary);
}

#astrologer-loading .compat-loading-names p {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-primary);
  margin: 0;
}

/* ── Toast Error Notification ── */
.toast-error {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  max-width: 400px;
  width: calc(100% - 32px);
  padding: 14px 20px;
  background: #e74c3c;
  color: #DCCAE9;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  border-radius: 10px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.toast-error--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  max-width: 400px;
  width: calc(100% - 32px);
  padding: 14px 20px;
  background: #2ecc71;
  color: #E7F7EE;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  border-radius: 10px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.toast-success--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Express Report: My Star Code ── */

.express-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 20px;
}

.express-report {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.express-hero {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: var(--radius-card);
  padding: 24px 20px;
  color: #DCCAE9;
  text-align: center;
}

.express-hero-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}

.express-hero-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.express-hero-sign,
.express-hero-moon {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 700;
}

.express-hero-emoji {
  font-size: 18px;
}

.express-hero-divider {
  opacity: 0.7;
}

.express-hero-nak {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
}

.express-hero-note {
  font-size: 12px;
  opacity: 0.9;
}

.express-section {
  background: var(--color-bg-80);
  border: 1px solid var(--color-primary-30);
  border-radius: var(--radius-card);
  padding: 16px;
}

.express-favorable {
  background: linear-gradient(135deg, var(--color-bg-80), var(--color-primary-15));
}

.express-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.express-item-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-primary);
}

.express-item-text {
  font-size: 14px;
  color: var(--color-primary-70);
  margin-top: 4px;
}

.express-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-primary-15);
  font-size: 14px;
  color: var(--color-primary-70);
}

.express-item-row:last-of-type {
  border-bottom: none;
}

.express-item-row strong {
  color: var(--color-primary);
}

.express-item-date {
  font-size: 12px;
  color: var(--color-primary-70);
  margin-top: 10px;
}

.express-strengths {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.express-strength {
  background: var(--color-bg-60);
  border: 1px solid var(--color-primary-15);
  border-radius: 12px;
  padding: 12px;
}

.express-strength-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.express-strength-text {
  font-size: 13px;
  color: var(--color-primary-70);
  line-height: 1.45;
}

.express-cta {
  background: var(--color-bg-80);
  border: 1px dashed var(--color-primary);
  border-radius: var(--radius-card);
  padding: 18px 16px;
  text-align: center;
}

.express-cta-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
}

.express-cta-hint {
  font-size: 12px;
  color: var(--color-primary-70);
  margin-top: 4px;
}

.express-cta-btn {
  margin-top: 12px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-card);
  background: var(--color-primary);
  color: #DCCAE9;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.express-cta-btn:active {
  transform: scale(0.97);
  opacity: 0.85;
}

/* ── Express full report: unlocked collapsible row ──
   Rendered as a sphere-of-life style question: loader while the AI report
   generates, bell when ready, arrow once opened. Reuses the sphere-question
   state classes (data-answered / data-opened / expanded). */

.express-unlock {
  text-align: left;
  margin-bottom: 0;
}

.express-unlock-text {
  flex: 1;
  min-width: 0;
}

.express-unlock .express-cta-title {
  font-size: 14px;
  font-weight: 600;
}

.express-unlock .express-cta-hint {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
}

.express-unlock .sphere-question-stars {
  margin-left: 10px;
}

.express-unlock[data-opened="true"] .express-cta-title,
.express-unlock[data-opened="true"] .express-cta-hint {
  color: #DCCAE9;
}

.express-answer-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

/* ── Settings Screen ── */

.settings-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.settings-btn:active {
  transform: scale(0.9);
}

.settings-btn svg {
  width: 24px;
  height: 24px;
}

.settings-screen {
  background: var(--color-bg);
  min-height: 100vh;
}

.settings-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 100px;
}

.settings-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 20px;
}

.settings-section {
  background: var(--color-card);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
}

.settings-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.settings-section-text {
  font-size: 13px;
  color: var(--color-primary-70);
  line-height: 1.5;
  margin-bottom: 14px;
}

.settings-referral-code {
  background: rgba(147, 86, 160, 0.08);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.settings-copy-btn {
  background: var(--color-primary);
  color: var(--color-bg);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.settings-copy-btn:active {
  opacity: 0.7;
}

.settings-email-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--color-bg-25);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  color: var(--color-primary);
  outline: none;
  margin-bottom: 10px;
  box-sizing: border-box;
  transition: background 0.2s;
}

.settings-email-input::placeholder {
  color: var(--color-primary-70);
}

.settings-email-input:focus {
  background: var(--color-bg-35);
}

.settings-email-error {
  font-size: 12px;
  color: var(--color-error);
  min-height: 1.2em;
  margin-bottom: 4px;
}

.settings-email-message {
  font-size: 12px;
  color: #86cfa8;
  min-height: 1.2em;
  margin-top: 8px;
}

.settings-email-code-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.settings-email-code-row .settings-email-input {
  flex: 1;
  margin-bottom: 0;
  text-align: center;
  letter-spacing: 0.3em;
}

.settings-referral-link {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.settings-referral-link-text {
  font-size: 11px;
  color: var(--color-primary-70);
  word-break: break-all;
  flex: 1;
}

.settings-referral-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.settings-stat {
  flex: 1;
  background: rgba(147, 86, 160, 0.08);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.settings-stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.settings-stat-label {
  font-size: 11px;
  color: var(--color-primary-70);
  line-height: 1.3;
}

.settings-share-btn {
  width: 100%;
  background: linear-gradient(135deg, #9356A0, #724C9D);
  color: #DCCAE9;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.settings-share-btn:active {
  opacity: 0.8;
}

.settings-lang-tabs {
  display: flex;
  gap: 8px;
}

.settings-lang-tab {
  flex: 1;
  background: rgba(147, 86, 160, 0.08);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-primary-70);
  cursor: pointer;
  transition: all 0.2s;
}

.settings-lang-tab.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(147, 86, 160, 0.15);
}

/* ── Settings: new row layout ── */

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid rgba(147, 86, 160, 0.12);
  font-size: 15px;
  color: var(--color-primary);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row-clickable {
  cursor: pointer;
  transition: opacity 0.15s;
}

.settings-row-clickable:active {
  opacity: 0.7;
}

.settings-chevron {
  width: 20px;
  height: 20px;
  color: var(--color-primary-70);
  flex-shrink: 0;
}

.settings-danger span {
  color: #c0392b;
}

/* ── Toggle Switch ── */

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch input:focus-visible {
  outline: none;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(147, 86, 160, 0.25);
  border-radius: 28px;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: var(--color-bg);
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ── Language switch (compat-tab style with sliding oval) ── */

.settings-lang-switch {
  position: relative;
  display: flex;
  border: 2px solid #724C9D;
  border-radius: var(--radius-btn);
  padding: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.settings-lang-switch::before {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: #724C9D;
  border-radius: calc(var(--radius-btn) - 5px);
  transition: transform 0.25s ease;
  z-index: 0;
}

.settings-lang-switch[data-active="en"]::before {
  transform: translateX(100%);
}

.settings-lang-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #724C9D;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 16px;
  cursor: pointer;
  transition: color 0.2s;
}

.settings-lang-btn.active {
  color: var(--color-bg);
}

/* ── Feedback textarea ── */

.settings-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1.5px solid rgba(147, 86, 160, 0.3);
  border-radius: var(--radius-input);
  background: rgba(220, 202, 233, 0.5);
  color: var(--color-primary);
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.settings-textarea:focus {
  border-color: var(--color-primary);
}

.settings-textarea::placeholder {
  color: var(--color-primary-70);
  opacity: 0.6;
}

/* ── First-run Tour ── */

.tour-spotlight {
  /* Fixed, not absolute: the spotlight is positioned with viewport
     coordinates (getBoundingClientRect) but body is position:relative
     with max-width/margin auto, so an absolute box would drift away from
     the target on any viewport wider than 430px — leaving the described
     element dimmed and unclickable. */
  position: fixed;
  border-radius: 14px;
  box-shadow:
    0 0 0 2px #DCCAE9,
    0 0 24px 6px rgba(220, 202, 233, 0.35),
    0 0 0 9999px rgba(30, 20, 40, 0.7);
  pointer-events: none;
  transition:
    left 0.35s ease,
    top 0.35s ease,
    width 0.35s ease,
    height 0.35s ease,
    border-radius 0.35s ease;
  will-change: left, top, width, height;
}

.tour-card {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: calc(100% - 40px);
  max-width: 390px;
  background: var(--color-primary);
  color: #DCCAE9;
  border-radius: 18px;
  padding: 18px 18px 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  z-index: 10001;
}

.tour-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #DCCAE9;
}

.tour-card-text {
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0.95;
}

.tour-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.tour-btn {
  flex: 1;
  padding: 10px;
  border-radius: 24px;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #DCCAE9;
}

.tour-btn-back,
.tour-btn-skip {
  color: #DCCAE9;
  opacity: 0.85;
}

.tour-btn-next {
  background: #DCCAE9;
  color: var(--color-primary);
}

.tour-btn-skip,
.tour-btn-back,
.tour-btn-next {
  transition: opacity 0.2s;
}

.tour-btn:active {
  opacity: 0.7;
}

/* ── Demo question (first-run tour) ── */

.demo-question {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.demo-question .sphere-question-text {
  color: #DCCAE9;
}

.demo-question[data-answered="true"] .sphere-question-text {
  color: #DCCAE9;
}

.demo-question .sphere-question-stars svg,
.demo-question[data-answered="true"] .sphere-question-stars svg {
  color: #DCCAE9;
}

.demo-question.expanded .sphere-answer,
.demo-question.expanded .sphere-answer p,
.demo-question.expanded .sphere-answer li {
  color: #DCCAE9;
}

.demo-question-badge {
  display: inline-block;
  background: #DCCAE9;
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
  margin-right: 8px;
  flex-shrink: 0;
}

.demo-question .sphere-question-header {
  align-items: center;
}

/* Demo processing: dim the border while the loader spins */
.demo-question[data-status="DEMO_PENDING"] {
  border-color: rgba(220, 202, 233, 0.4);
}

/* Demo ready: brief glow to draw attention to the bell */
.demo-question[data-status="DEMO_READY"] {
  animation: demo-ready-pulse 1.2s ease-in-out 2;
}

@keyframes demo-ready-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 202, 233, 0); }
  50% { box-shadow: 0 0 0 6px rgba(220, 202, 233, 0.25); }
}

/* ── Contextual hint banners ── */

.hint-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 16px 4px;
  background: var(--color-primary);
  border-radius: 12px;
  padding: 10px 12px;
  color: #DCCAE9;
}

.hint-banner-text {
  font-size: 0.85rem;
  line-height: 1.35;
  color: #DCCAE9;
}

.hint-banner-close {
  flex-shrink: 0;
  background: #DCCAE9;
  color: var(--color-primary);
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.hint-banner-close:active {
  opacity: 0.8;
}
