/* The launch screen fills the available viewport, including when installed. */
.onboarding[data-guide-screen] .top .brand { display: none; }
.onboarding[data-guide-screen] .top-inner { justify-content: flex-end; }
:root:has(.onboarding[data-guide-screen]) { background: #140e1e; }
.onboarding[data-guide-screen] {
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 50% 37%, #39234d 0%, #241731 42%, #140e1e 76%);
  color: #f8efff;
}
.onboarding[data-guide-screen="welcome"] .top {
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
}
.onboarding[data-guide-screen="welcome"] .top-inner {
  max-width: 540px;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0 20px;
}
.onboarding[data-guide-screen] .locale {
  background: #ffffff0b;
  color: #f4e5ff;
  border-color: #d9bdfc35;
  border-radius: 999px;
  min-width: 61px;
}
.onboarding[data-guide-screen="welcome"] #setup {
  padding: 0 max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left));
  max-width: 540px;
}
.guide-welcome {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: calc(62px + env(safe-area-inset-top)) 0 max(19px, env(safe-area-inset-bottom));
  text-align: center;
}
.guide-welcome-center {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 12px clamp(22px, 6vh, 63px);
}
.guide-welcome-art {
  width: clamp(162px, 32vh, 289px);
  max-width: 78vw;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  margin-bottom: clamp(12px, 4vh, 32px);
}
.guide-welcome-art::before, .guide-welcome-art::after, .guide-welcome-art i {
  position: absolute;
  content: "";
  border-radius: 50%;
}
.guide-welcome-art::before {
  inset: 0;
  border: 1px solid #d0abff24;
  background: radial-gradient(circle, #aa6de736, transparent 67%);
  box-shadow: 0 0 60px #a06ae717;
}
.guide-welcome-art::after {
  inset: 10%;
  border: 1px solid #f0d7ff33;
}
.guide-welcome-art i {
  inset: 0;
  z-index: -1;
  background: conic-gradient(from 24deg, transparent 8%, #d5affe94 16%, transparent 24% 56%, #9d6bec73 65%, transparent 75%);
  mask-image: radial-gradient(circle, transparent 69%, black 70% 71%, transparent 72%);
}
.guide-welcome-art img {
  width: 54%;
  height: auto;
  z-index: 1;
  filter: drop-shadow(0 15px 22px #1009199c);
}
.guide-welcome h1 { font-size: clamp(35px, 10vw, 52px); letter-spacing: -.065em; }
.guide-welcome h1 span { font-weight: 430; color: #dfc7f0; }
.guide-welcome-center > p { margin-top: 10px; color: #e3d4eb; font-size: clamp(16px, 3.5vw, 19px); text-wrap: balance; }
.guide-welcome-actions { display: grid; justify-items: stretch; gap: 3px; width: min(100%, 375px); margin-inline: auto; }
.guide-welcome .solid { color: #251632; background: #d7b8fa; border-color: #e8d2ff; border-radius: 17px; min-height: 56px; font-size: 16px; }
.guide-welcome .solid:hover { background: #e7ceff; }
.onboarding[data-guide-screen] #setup, #studio-dialog:has(.guide-modal-flow) {
  color-scheme: dark;
  --ink: #f8efff;
  --muted: #e3d4eb;
  --paper: #291a3a;
  --sage: #382450;
  --line: #59416e;
  --accent: #d7b8fa;
}
.onboarding[data-guide-screen="touch"] #setup {
  text-align: center;
  min-height: calc(100dvh - 70px);
  display: grid;
  align-content: center;
}
.onboarding[data-guide-screen="touch"] .guide-flow { width: 100%; }
.onboarding[data-guide-screen="touch"] .guide-flow > .text-button { justify-self: start; }
@media (max-height: 620px) {
  .guide-welcome-art { width: clamp(130px, 33vh, 185px); margin-bottom: 12px; }
  .guide-welcome-center { padding-block: 9px 18px; }
}
.guide-flow { display: grid; gap: 14px; max-width: 570px; margin: 0 auto; }
.guide-flow h1 { font-size: clamp(30px, 7.4vw, 47px); }
.guide-flow > p { color: var(--muted); }
.guide-flow .guide-note { font-size: .9rem; text-align: center; }
.guide-modal-flow { margin-top: 12px; }
.guide-modal-flow #setup-heading { font-size: clamp(24px, 6vw, 34px); }
.guide-progress { display: flex; align-items: center; justify-content: space-between; color: var(--muted); gap: 10px; }
.guide-flow > progress { width: 100%; height: 8px; accent-color: var(--accent); border: 0; border-radius: 999px; overflow: hidden; }
.guide-flow > progress::-webkit-progress-bar { background: var(--line); }
.guide-flow > progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.guide-choices { display: grid; gap: 8px; }
.guide-option { justify-content: flex-start; min-height: 54px; padding-block: 10px; text-align: start; line-height: 1.3; }
.guide-option span { flex: 1; }
.guide-option[aria-pressed="true"] { border-color: var(--accent); background: var(--sage); }
#guide-touch { text-align: center; }
.guide-done-icon { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 19px; background: var(--sage); color: var(--accent); }
.guide-streak, .guide-dashboard-top { display: flex; align-items: center; gap: 7px; }
.guide-dashboard-top { justify-content: space-between; }
.guide-streak { font-weight: 700; color: var(--accent); font-size: .9rem; }
.guide-dashboard > p, .guide-summary > p { margin: 5px 0 12px; color: var(--muted); }
.guide-week { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 3px; }
.guide-week li { min-width: 0; text-align: center; display: grid; gap: 4px; justify-items: center; font-size: .78rem; color: var(--muted); }
.guide-week li div { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: var(--bg); }
.guide-week li:has(.icon) div { background: var(--sage); color: var(--accent); }
.guide-week li[aria-current] div { border: 1px solid var(--accent); }
.guide-week .icon { width: 15px; height: 15px; }
.guide-summary { margin-top: 10px; }
.guide-facts { margin: 0; padding: 0; display: grid; gap: 5px; list-style: none; }
.guide-facts li { display: grid; gap: 2px; border-bottom: 1px solid var(--line); padding: 7px 0; }
.guide-facts span { color: var(--muted); font-size: .85rem; }
.guide-summary .guide-facts { display: none; }
.guide-action { border-radius: 14px; padding: 12px; background: var(--sage); margin-top: 9px; }
.guide-action p { margin-top: 3px; }
.guide-data { padding-inline-start: 20px; margin: 0; }
.guide-data li + li { margin-top: 8px; }
#guide-confirm label { display: flex; gap: 11px; align-items: center; margin: 0 0 15px; min-height: 44px; }
#guide-confirm input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.guide-trends { margin-top: 10px; }
.guide-trends > summary { cursor: pointer; padding: 13px 15px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); font-weight: 700; margin-bottom: 8px; }
.guide-library-heading { margin: 20px 0 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.guide-history { margin-top: 10px; }
.guide-history h2 { margin-bottom: 9px; }
.guide-history > p { color: var(--muted); }
.guide-history-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.guide-history-chart button { min-width: 0; display: grid; grid-template-rows: 54px auto; align-items: end; justify-items: center; gap: 4px; padding: 7px 0;
  border: 0; border-radius: 9px; background: var(--bg); color: var(--ink); font-size: .78rem; }
.guide-history-chart i { height: calc(var(--guide-level) * 17px); width: 60%; border-radius: 4px 4px 0 0; background: linear-gradient(#b591ed,#8057be); }
.guide-history-chart button:disabled { color: var(--muted); }
@media (max-height: 620px) {
  .onboarding[data-guide-screen="touch"] .guide-flow { gap: 9px; }
}
#guide-touch .fingerprint-stage {
  margin: 0 auto;
  display: grid;
  place-items: center;
  width: fit-content;
}
#guide-touch #touch-hold.fingerprint-target {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 15px;
  width: auto;
  height: auto;
  padding: 12px 21px 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 16px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
#guide-touch .fingerprint-art {
  color: var(--accent);
  display: grid;
  place-items: center;
  width: clamp(126px, 27vh, 193px);
}
#guide-touch .fingerprint-art svg { width: 100%; height: auto; grid-area: 1 / 1; overflow: visible; }
#guide-touch .fingerprint-art svg:first-child { opacity: .72; }
#guide-touch .fingerprint-art svg:last-child {
  clip-path: inset(calc(100% - var(--touch-progress, 0%)) 0 0);
  filter: brightness(1.6) drop-shadow(0 0 5px #b588f3);
}
#guide-touch #touch-status { min-height: 2.4em; font-size: .9rem; }
.onboarding[data-guide-screen="touch"] #guide-touch .fingerprint-art { color: #b991e0; }
@media (max-height: 620px) {
  #guide-touch .fingerprint-art { width: 115px; }
  #guide-touch #touch-hold.fingerprint-target { gap: 7px; padding-block: 5px; }
}
#studio-dialog:has(#guide-touch) #studio-dialog-title { visibility: hidden; }
.guide-welcome-actions > p { color: #d8c5e3; font-size: .85rem; padding-block: 8px; }

/* The same surface carries the touch screen, answers and recap. */
#studio-dialog:has(.guide-modal-flow) {
  background: radial-gradient(ellipse at top, #352347, #20152c 72%);
  color: var(--ink);
  border-color: var(--line);
}
.onboarding[data-guide-screen] .guide-flow .solid, #studio-dialog:has(.guide-modal-flow) .guide-flow .solid {
  color: #251632;
  background: #d7b8fa;
  border-color: #e8d2ff;
}
.onboarding[data-guide-screen] .guide-option, #studio-dialog:has(.guide-modal-flow) .guide-option {
  background: #332341;
  border-color: #5c4671;
  color: #f8efff;
  min-height: 59px;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 15px;
}
.onboarding[data-guide-screen] .guide-option:hover, .onboarding[data-guide-screen] .guide-option[aria-pressed="true"],
#studio-dialog:has(.guide-modal-flow) .guide-option:hover, #studio-dialog:has(.guide-modal-flow) .guide-option[aria-pressed="true"] {
  background: #443056;
  border-color: #bf9ce7;
}
.guide-option .guide-option-icon {
  display: grid;
  flex: 0 0 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #e6cbff;
  background: #7955a044;
}
.guide-option > .icon:last-child { width: 16px; color: #c6a4e5; }
.guide-flow > progress::-moz-progress-bar { background: #d7b8fa; border-radius: 999px; }
.onboarding[data-guide-screen="questions"] #setup { padding-top: clamp(16px, 4.5vh, 45px); }
.onboarding[data-guide-screen="questions"] .guide-flow > h1 { margin-block: 7px 2px; }
.onboarding[data-guide-screen] .guide-flow .text-button, #studio-dialog:has(.guide-modal-flow) .guide-flow .text-button { color: #e9d3ff; }
@media (prefers-reduced-motion: no-preference) {
  .guide-choices { animation: guide-enter .19s ease-out; }
  @keyframes guide-enter { from { opacity: .45; transform: translateY(5px); } }
}
