:root {
  color-scheme: light;
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --border: #dde0e8;
  --border-strong: #c8ccd8;
  --text: #1a1e2e;
  --muted: #7a8099;
  --icon-surface: rgb(255 255 255 / 94%);
  --icon-border: #d8dde6;
  --panel-neutral-bg: rgb(255 255 255 / 88%);
  --panel-neutral-border: var(--border-strong);
  --panel-neutral-fg: var(--text);
  --panel-cta-bg: var(--text);
  --panel-cta-border: var(--text);
  --panel-cta-fg: #ffffff;
  --panel-cta-fg-soft-65: rgb(255 255 255 / 65%);
  --panel-cta-fg-soft-80: rgb(255 255 255 / 80%);
  --summary-toggle-bg: var(--text);
  --summary-toggle-fg: #ffffff;
  --summary-toggle-label: rgb(255 255 255 / 62%);
  --step-bg: var(--surface);
  --step-head-bg: var(--surface-2);
  --step-border: var(--border);
  --step-option-bg: var(--surface);
  --step-option-thumb-bg: var(--surface-2);
  --step-option-cap-bg: var(--bg);
  --step-option-badge-bg: var(--surface);
  --step-option-hover-cap-bg: #eaecf2;
  --step-option-selected-cap-bg: var(--accent-bg);
  --step-num-bg: var(--accent-bg);
  --step-num-border: var(--accent);
  --step-num-fg: var(--accent);
  --accent: #e31938;
  --accent-bg: #fdecef;
  --danger: #c0391a;
  --ews: var(--accent);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1218;
  --surface: #171c25;
  --surface-2: #1d2330;
  --border: #2f394b;
  --border-strong: #44516a;
  --text: #edf2ff;
  --muted: #9aa5bd;
  --panel-neutral-bg: var(--surface-2);
  --panel-neutral-border: var(--border-strong);
  --panel-neutral-fg: var(--text);
  --panel-cta-bg: var(--accent);
  --panel-cta-border: var(--accent);
  --panel-cta-fg: #ffffff;
  --panel-cta-fg-soft-65: rgb(255 255 255 / 65%);
  --panel-cta-fg-soft-80: rgb(255 255 255 / 80%);
  --summary-toggle-bg: var(--surface-2);
  --summary-toggle-fg: var(--text);
  --summary-toggle-label: var(--muted);
  --step-bg: #0f151e;
  --step-head-bg: #151c27;
  --step-border: var(--border);
  --step-option-bg: #141b25;
  --step-option-thumb-bg: #0b1118;
  --step-option-cap-bg: #101721;
  --step-option-badge-bg: #1a2130;
  --step-option-hover-cap-bg: #18202c;
  --step-option-selected-cap-bg: #121924;
  --step-num-bg: #121923;
  --step-num-border: var(--accent);
  --step-num-fg: var(--accent);
  --accent: #ff4b63;
  --accent-bg: rgba(255, 75, 99, 0.16);
  --danger: #ff8166;
  --ews: #ff4b63;
}

.theme-switch {
  position: fixed;
  z-index: 30;
  right: 16px;
  bottom: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.theme-switch-track {
  position: relative;
  display: grid;
  width: 156px;
  height: 30px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  padding: 2px;
  border: 1px solid #c7cdd8;
  border-radius: 999px;
  background: #e3e6ec;
  box-shadow: 0 6px 16px rgb(0 0 0 / 8%);
}

.theme-switch:hover .theme-switch-track,
.theme-switch:focus-visible .theme-switch-track {
  border-color: #b7bfcc;
}

.theme-switch:focus-visible {
  outline: none;
}

.theme-switch:focus-visible .theme-switch-track {
  box-shadow: 0 6px 16px rgb(0 0 0 / 8%), 0 0 0 2px rgb(124 132 148 / 18%);
}

.theme-switch-label {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.7px;
  line-height: 1;
  text-align: center;
  text-transform: lowercase;
  white-space: nowrap;
}

.theme-switch-label-light {
  color: #2d3443;
}

.theme-switch-label-dark {
  color: #6f7686;
}

.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 76px;
  height: 26px;
  border-radius: 999px;
  background: #cfd4dc;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 22%);
  transition: transform 0.18s ease, background 0.18s ease;
}

html[data-theme="dark"] .theme-switch-thumb {
  transform: translateX(76px);
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.legal-links a {
  color: inherit;
  text-decoration: none;
}

.legal-links a:hover,
.legal-links a:focus-visible {
  color: var(--accent);
}

.legal-copyright {
  flex: 1 1 100%;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4px;
}

.legal-disclaimer {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.legal-disclaimer-title {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

@media (max-width: 680px) {
  .theme-switch {
    right: 12px;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    transform: scale(0.82);
    transform-origin: bottom right;
  }

  .theme-switch-track {
    width: 146px;
  }

  .theme-switch-thumb {
    width: 71px;
    height: 26px;
  }

  html[data-theme="dark"] .theme-switch-thumb {
    transform: translateX(73px);
  }
}
