:root {
  --theme-switch-surface: rgba(8, 8, 8, 0.72);
  --theme-switch-text: #e9ecf1;
  --install-dialog-surface: #101010;
}

body {
  isolation: isolate;
}

body::before {
  background-image: url("assets/gym-background.webp");
  opacity: 0.24;
  filter: saturate(0.8);
}

body::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.48));
}

.logo__app-mark {
  display: block;
  width: 62px;
  height: auto;
  flex-shrink: 0;
}

.hero-title__mv img {
  display: block;
  width: clamp(112px, 14vw, 176px);
  height: auto;
}

.hero-copy {
  display: contents;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-switch {
  display: inline-flex;
  flex-shrink: 0;
  gap: 3px;
  padding: 4px;
  background: var(--theme-switch-surface);
  border: 1px solid rgba(255, 138, 31, 0.3);
  border-radius: 999px;
}

.theme-switch__button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: transparent;
  color: var(--theme-switch-text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.theme-switch__button[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #111;
}

.theme-switch__button:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

html[data-theme="white"] {
  --bg: #faf8f5;
  --bg2: #f4f0eb;
  --card: #ffffff;
  --text: #211b16;
  --muted: #403730;
  --line: #ded4c8;
  --shadow: 0 12px 32px rgba(70, 45, 20, 0.10);
  --theme-switch-surface: rgba(255, 255, 255, 0.85);
  --theme-switch-text: #231d18;
  --install-dialog-surface: #faf8f5;
}

html[data-theme="white"] body {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="white"] body::before {
  background-image: url("assets/gym-background-white.webp");
  opacity: 0.18;
  filter: none;
}

html[data-theme="white"] body::after {
  background: none;
}

html[data-theme="white"] .header {
  background: rgba(250, 248, 245, 0.88);
  border-bottom-color: rgba(115, 77, 40, 0.13);
}

html[data-theme="white"] :is(.section, .home-hero, .bottom-call-section) {
  background: transparent !important;
}

html[data-theme="white"] :is(h1, h2, h3, h4, h5, h6, strong) {
  color: var(--text) !important;
}

html[data-theme="white"] :is(p, li, label, small) {
  color: var(--muted) !important;
}

html[data-theme="white"] .hero-title__text {
  background: none;
  color: var(--text);
  hyphens: none;
}

html[data-theme="white"] :is(.hero-choice, .offer-card, .package-card, .credential-card, .about-profile-card, .detail-price-card, .result-card, .referral-clean-card, .legal-card, .book-product-card, .book-shop-note, .review-box, .company-pricing-box, .company-pricing-grid > div, .contact-process, .contact-trust-box, .bottom-call-card, .card, .referral-clean-steps article, .book-shop-features article) {
  color: var(--text);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78));
  border-color: rgba(197, 99, 22, 0.26);
  box-shadow: 0 20px 50px rgba(88, 58, 28, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="white"] :is(.hero-choice, .offer-card, .package-card):hover {
  background: linear-gradient(145deg, rgba(255, 242, 226, 0.98), rgba(255, 255, 255, 0.92));
  border-color: rgba(197, 99, 22, 0.58);
}

html[data-theme="white"] :is(.price-label, .package-card__tag, .package-link, .result-card__tag, .eyebrow, .legal-card a, .book-question-link) {
  color: #a64300 !important;
}

html[data-theme="white"] :is(.detail-price, .book-product-price, .book-product-price span, .offer-finder__price, .hero-choice span) {
  color: var(--text);
}

html[data-theme="white"] :is(.detail-block, .results-note, .form-intro, .offer-finder__results) {
  border-color: var(--line);
}

html[data-theme="white"] :is(.result-stats span, .book-shop-badges span, .about-tags span, .pill, .referral-smallprint) {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--line);
}

html[data-theme="white"] .company-pricing-grid span {
  color: var(--muted);
}

html[data-theme="white"] :is(input, textarea, select) {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border-color: #d3c6b8;
}

html[data-theme="white"] :is(input, textarea)::placeholder {
  color: #71645a;
  opacity: 1;
}

html[data-theme="white"] :is(.btn, .nav-cta) {
  color: #111 !important;
}

html[data-theme="white"] .btn--ghost {
  color: var(--text) !important;
  border-color: #cbb49e;
  background: transparent;
}

html[data-theme="white"] .quick-nav a {
  background: rgba(255, 255, 255, 0.86);
  color: #a64300;
}

html[data-theme="white"] .quick-nav a:hover {
  background: #fff0df;
}

html[data-theme="white"] .back-link {
  color: #a64300;
}

html[data-theme="white"] .hero-title {
  filter: none;
}

html[data-theme="white"] .home-hero__subtitle {
  color: var(--text) !important;
}

html[data-theme="white"] body:has(#start[data-active-view])::before {
  opacity: 1;
}

html[data-theme="white"] .hero-copy {
  display: block;
  padding: clamp(20px, 3vw, 36px);
  border-radius: 24px;
  background: rgba(250, 248, 245, 0.96);
}

.app-install-dialog {
  width: 720px;
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 28px;
  overflow-y: auto;
  border: 1px solid rgba(255, 138, 31, 0.3);
  border-radius: 24px;
  background: var(--install-dialog-surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.app-install-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(3px);
}

.app-install-dialog > h2 {
  margin: 0 36px 12px 0;
  font-size: 1.75rem;
  line-height: 1.2;
}

.app-install-dialog > p {
  margin: 0 0 24px;
  color: var(--muted);
}

.app-install-dialog__close {
  position: absolute;
  top: 16px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid rgba(255, 138, 31, 0.3);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.app-install-dialog__close svg {
  display: block;
  flex: none;
}

.app-install-dialog__close:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
}

.app-install-dialog__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.app-install-dialog__scan {
  text-align: center;
}

.app-install-dialog__qr {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  background: #fff;
}

.app-install-dialog__scan p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.app-install-dialog__steps h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.app-install-dialog__steps p {
  margin: 0 0 16px;
  color: var(--muted);
}

.app-install-dialog__steps .app-install-dialog__note {
  margin: 12px 0 0;
  font-size: 0.85rem;
}

.app-access-option {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(255, 138, 31, .28);
  border-radius: 18px;
}

.app-access-option h3 { margin: 0 0 12px; font-size: 1.15rem; }
.app-access-option > p { margin: 0 0 16px; color: var(--muted); font-size: .92rem; }
.app-access-option > .btn { width: 100%; margin-top: 18px; padding: 10px 12px; text-align: center; font-size: .88rem; }
.app-access-option > .app-install-dialog__note { margin: 12px 0 0; font-size: .82rem; }
.app-install-help { margin-top: 22px; border-top: 1px solid rgba(255, 138, 31, .22); padding-top: 16px; }
.app-install-help > summary { cursor: pointer; font-size: .9rem; color: var(--muted); }
.app-install-help .app-install-dialog__steps { margin-top: 16px; }
.app-install-help > summary:focus-visible { outline: 2px solid var(--accent2); outline-offset: 4px; }

@media (max-width: 600px) {
  .app-install-dialog {
    padding: 24px;
  }
  .app-install-dialog__content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .app-install-dialog__qr {
    width: 180px;
  }
  html[data-theme="white"] .hero-title__text {
    font-size: clamp(1.75rem, 9vw, 2.4rem);
  }
  .header__inner {
    flex-wrap: wrap;
    gap: 8px 12px;
  }
  .header__actions {
    display: contents;
  }
  .header .logo {
    order: 1;
  }
  .theme-switch {
    order: 2;
    margin-left: auto;
  }
  .header .nav {
    order: 3;
    width: 100%;
  }
  .header .nav__menu {
    justify-content: flex-end;
  }
  .logo__app-mark {
    width: 54px;
  }
}
