* { box-sizing: border-box; }

/* Colours, type and the Paperlogy font come from design-system.css */

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--neutral-100);
  color: var(--system-black);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

img { -webkit-user-drag: none; }

/* The Figma frame, 402 x 874. mobile.js scales it to fit and centres it. */
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 402px;
  height: 874px;
  margin: -437px 0 0 -201px;
  background: var(--neutral-100);
  overflow: hidden;
}
/* Desktop preview: the screen sits in a phone-shaped frame */
.is-preview .stage {
  border-radius: 56px;
  box-shadow: 0 0 0 10px #111, 0 20px 60px rgba(0, 0, 0, 0.25);
}
/* On a phone the page itself is the screen: full width, as tall as the
   window (mobile.js sets the height), header at the very top */
.is-phone,
.is-phone body { background: var(--neutral-100); overscroll-behavior: none; }
/* Nothing scrolls past its ends (no rubber-band showing what's behind) */
.stage, .stage * { overscroll-behavior: none; }
.is-phone .stage {
  left: 0;
  top: 0;
  margin: 0;
  transform-origin: 0 0;
}
.is-phone .head { top: 10px; }

/* Status bar (Figma 97:716), preview only */
.status {
  position: absolute;
  top: 0;
  left: 0;
  width: 402px;
  height: 44px;
  display: none;
}
.is-preview .status { display: block; }
/* As on a real iPhone: the time (17pt semibold) and the icons each centred
   in the space either side of the island, level with its middle */
.status--time {
  position: absolute;
  left: 22px;
  top: 13px;
  width: 96px;
  font: 600 17px/22px -apple-system, "SF Pro Text", Inter, sans-serif;
  letter-spacing: -0.5px;
  text-align: center;
  color: #111;
}
.status--right {
  position: absolute;
  left: 294px;
  top: 17.4px;
  width: 77.6px;
  height: 13.2px;
}
/* The Dynamic Island, as on a real iPhone: a black pill at the top centre,
   the time and icons either side of it */
.status--island {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 122px;
  height: 34px;
  margin-left: -61px;
  border-radius: 999px;
  background: #000;
}

/* Header (Figma 376:5496): the deck's name with a chevron, and a pill
   counting the luck claimed */
/* Every screen's top row is the same: 44 tall, 10 under the status bar
   (as the opened card's back arrow and title, and Daily Fortune's bar) */
.head {
  position: absolute;
  top: 54px;
  min-height: 44px;
  left: 0;
  width: 402px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-sizing: border-box;
  z-index: 20;
}
.head--title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--system-black);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.head--title h1,
.head--count span {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--tracking);
  line-height: normal;
  white-space: nowrap;
}
/* Page titles in Cooper, as 376:5463 */
.head--title h1 { font-family: var(--font-title); font-size: 27px; letter-spacing: var(--tracking-title); }
.head--title img { display: block; }
/* As tall as the header's 44px buttons */
.head--count {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 44px;
  padding: 0 18px;
  box-sizing: border-box;
  border-radius: 36px;
  background: var(--system-white);
  filter: drop-shadow(0 4px 2px rgba(168, 164, 164, 0.2));
  color: var(--system-black);
}
.head--count span { font-size: 16px; }  /* body text: 16 */
.head--count img { display: block; }

/* Cards: placed every frame by mobile.js */
.fan {
  position: absolute;
  inset: 0;
  z-index: 10;  /* cards stack inside this, under the header and dial */
  touch-action: none;
}
.m-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 271.675px;
  height: 388.182px;
  will-change: transform;
  cursor: pointer;
  /* The artwork carries its own rounded edge (85px on the 1040 x 1486 English
     cards); the shadow follows the same curve */
  border-radius: 8.2% / 5.72%;
  box-shadow: 0 4px 2px rgba(168, 164, 164, calc(0.2 * var(--focus, 0)));  /* the system shadow (shadow-float), as the card comes to the front */
}
.m-card img {
  display: block;
  width: 100%;
  height: 100%;
}

/* Dial (Figma 97:729 at rest, 97:832 open). Drawn at its rest size; opening
   it scales it up, and the ticks turn with the finger. */
.dial {
  position: absolute;
  left: 0;
  top: 0;
  width: 215px;
  height: 215px;
  border-radius: 50%;
  z-index: 30;
  touch-action: none;
  cursor: grab;
  outline: none;
  will-change: transform;
}
.dial:active { cursor: grabbing; }
/* The dial's lines: the desktop scroller's strokes, standing out from the
   dial's centre. Light grey; the centre card's is longer and darker. */
.dial--line {
  position: absolute;
  left: calc(50% - 0.75px);
  top: 50%;
  width: 1.5px;
  height: 16px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--neutral-700) 40%, transparent);  /* Neutral 700, faint */
  transform-origin: 50% 0;
  pointer-events: none;
  transition: background-color 180ms cubic-bezier(0.22, 1, 0.36, 1), height 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.dial--line.is-current { height: 20px; background: var(--neutral-700); }

/* Behind the tab bar: mostly a Neutral 100 gradient, with a light blur
   that builds up towards the bar. It reaches 24px above the bar; the blur
   stops at the bar's bottom edge so it never reaches the frame's rounded
   corners. */
.m-navfade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-bottom, 42px) + 51px + 24px);
  z-index: 35;
  pointer-events: none;
  background: linear-gradient(to bottom,
    transparent,
    color-mix(in srgb, var(--neutral-100) 55%, transparent) 50%,
    color-mix(in srgb, var(--neutral-100) 92%, transparent));
}
.m-navfade i {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: var(--nav-bottom, 42px);
}
.m-navfade i:nth-child(1) {
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 70%, transparent);
}
.m-navfade i:nth-child(2) {
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 35%, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, transparent 35%, #000 70%, transparent);
}
.m-navfade i:nth-child(n+3) { display: none; }

/* Tab bar (Figma 376:5524): a white pill of icons, the current tab on a
   grey pill of its own with its icon filled */
.m-nav {
  position: absolute;
  left: 91px;
  bottom: var(--nav-bottom, 42px);
  width: 220px;
  height: 51px;
  z-index: 40;
  display: flex;
  padding: 4px;  /* even all round, so the end tabs nest in the bar's curve */
  gap: 4px;
  box-sizing: border-box;
  background: var(--system-white);
  border-radius: 999px;
  filter: drop-shadow(0 4px 2px rgba(168, 164, 164, 0.2));  /* Figma 635:247 */
}
.m-nav--tab {
  position: relative;
  flex: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.m-nav--tab[aria-current] {
  background: var(--neutral-100);
  border-color: var(--neutral-500);
}
/* Each icon sits in a 28px square in the tab's middle, placed as in Figma */
.m-nav--tab img {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  transition: opacity 0.2s;
}
.m-nav--tab[data-tab="tree"] img { margin: -13px 0 0 -13px; }
.m-nav--tab[data-tab="home"] img { margin: -10.5px 0 0 -9px; }
.m-nav--tab[data-tab="profile"] img { margin: -8.75px 0 0 -8.54px; }
.m-nav--tab .is-on,
.m-nav--tab[aria-current] .is-off { opacity: 0; }
.m-nav--tab[aria-current] .is-on { opacity: 1; }

/* Home indicator (Figma 97:726), preview only */
.homebar {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 154px;
  height: 5px;
  margin-left: -77px;
  border-radius: 100px;
  background: #111;
  z-index: 70;
  pointer-events: none;
  display: none;
}
.is-preview .homebar { display: block; }

/* Profile (Figma 390:6966), laid out on the 874 frame; on a phone, without
   the fake status bar, everything on the hero moves up 44. A Yellow-Green
   hero with the character, then the fortune card and the luck you've earned
   in a row that scrolls sideways. */
.profile {
  --up: 0px;
  position: absolute;
  inset: 0;
  z-index: 15;
  overflow-y: auto;
  padding-bottom: 116px;  /* clear of the tab bar */
  box-sizing: border-box;
  background: var(--system-white);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.3s;
  scrollbar-width: none;
}
.is-phone .profile { --up: 44px; }
[data-view="profile"] .profile {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-view="profile"] .fan,
[data-view="profile"] .dial,
[data-view="profile"] .head--title,
[data-view="tree"] .fan,
[data-view="tree"] .dial { opacity: 0; pointer-events: none; }
.fan, .dial, .head--title { transition: opacity 0.3s; }
.profile--hero {
  position: relative;
  height: calc(355px - var(--up));
  background: url("assets/profile/hero.svg") center bottom / 402px 355px no-repeat;
}
/* Pulled past its top, the hero's yellow carries on up (no white gap) */
.profile--hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 1000px;
  background: var(--yellow-green);
}
/* Paper grain over the background, as on the card backs: multiplied, under
   the character */
.profile--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/system/paper.png") center bottom / 402px auto;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.profile p,
.profile--name,
.profile--label,
.profile--fortune span {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: var(--tracking);
  line-height: normal;
  color: var(--system-black);
}
.profile--hello { position: absolute; left: 16px; top: calc(265px - var(--up)); }
.profile--name {
  position: absolute;
  left: 16px;
  top: calc(303.91px - var(--up));
  display: flex;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--font-title);
  font-size: 40px;
  letter-spacing: var(--tracking-title);
  line-height: 0.75;  /* trimmed to the capitals, as 390:6980 */
}
/* The 14px pencil, with a 44px tap area round it */
.profile--name button { position: relative; padding: 0; border: 0; background: none; cursor: pointer; }
.profile--name button::before { content: ""; position: absolute; inset: -15px; }
.profile--name img { display: block; }
/* Changing the name: the same type, on the system's line */
.profile--name-field {
  width: 7.5em;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 1px solid var(--system-black);
  background: none;
  font: inherit;
  letter-spacing: inherit;
  line-height: 1;
  color: inherit;
  outline: none;
}
/* The character stands over the hero's edge, and grows in a touch each time
   the page opens */
.profile--avatar {
  position: absolute;
  left: 227.74px;
  top: calc(160.77px - var(--up));
  z-index: 1;
  transform-origin: 50% 100%;
}
[data-view="profile"] .profile--avatar { animation: profile-grow 0.6s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
@keyframes profile-grow { from { transform: scale(0.9); } }
.profile--body {
  display: flex;
  flex-direction: column;
  margin: 40px 16px 0;
}
/* One rhythm: 12 from a label to its cards (as between the Daily Fortune
   cards), 32 between sections */
.profile--label { margin-bottom: 12px; padding-left: 4px; color: var(--neutral-700); }  /* section titles in Neutral 700, 4px in */
.profile--fortune {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 33px;
  width: 370px;
  padding: 21px 16px 23px;
  box-sizing: border-box;
  border: 1px solid var(--neutral-500);
  border-radius: 16px;
  background: var(--neutral-100);
  box-shadow: 0 4px 2px rgba(168, 164, 164, 0.2);  /* the system shadow */
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.profile--fortune:active { transform: scale(0.98); }
.profile--clouds, .profile--dial, .profile--go { position: absolute; display: block; }
.profile--clouds { left: -1px; top: -1px; }
/* The fortune wheel (395:7995) turns slowly, cut off by the card's edge */
.profile--dial { left: 222.23px; top: -45.77px; animation: wheel-turn 90s linear infinite; }
@keyframes wheel-turn { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .profile--dial { animation: none; } }
.profile--go {
  left: 332px;
  top: 98px;
  width: 22px;
  height: 22px;
}
.profile--fortune .profile--date,
.profile--fortune .profile--find { position: relative; }
.profile--fortune .profile--date { font-size: 14px; white-space: pre; color: var(--neutral-700); }
.profile--fortune .profile--find { width: 181px; font-size: 20px; }
.profile--fortune + .profile--label { margin-top: 32px; }
/* Edge to edge, so the row runs off the screen */
.profile--recent {
  display: flex;
  gap: 10px;
  margin: 0 -16px;
  padding: 0 16px 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
  filter: drop-shadow(0 4px 2px rgba(168, 164, 164, 0.2));
}
.profile--earned {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  width: 180px;
  height: 180px;
  padding: 18px 16px;
  box-sizing: border-box;
  border: 1px solid var(--neutral-500);
  border-radius: 16px;
  background: var(--neutral-100);  /* Neutral 100; only the icon carries the card's colours */
  scroll-snap-align: start;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.profile--earned:active { transform: scale(0.97); }
/* Each card's line drawing, in the card's own colour, at one height */
.profile--earned img { display: block; flex: none; }  /* sized by mobile.js */
.profile .profile--earned p { white-space: normal; }
/* 44 x 44 tap targets (the usual minimum), touching, so the icons sit 16 apart; pulled out by the
   padding so the icons themselves still sit on the 16px margin */
.head--tools {
  display: none;
  gap: 0;
  margin-left: -8px;
}
.head--tools button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, transform 0.15s;
}
.head--tools button:active { background: color-mix(in srgb, var(--system-black) 8%, transparent); transform: scale(0.94); }
.head--tools button:focus-visible { outline: 1.5px solid var(--system-black); outline-offset: -2px; }
.head--tools img { display: block; }
[data-view="profile"] .head--tools { display: flex; }
[data-view="profile"] .head--title { display: none; }

/* Daily Fortune (Figma 395:7512, 395:7550, 397:208): slides in over the
   profile. First the clover ring fills while the fortune "loads"; the clovers
   turn Yellow-Green and the button goes System Black ("See Fortune!"). That
   opens the reading: a V2 Blue sky, the pig, and today's lucky things on UI
   White cards. Positions are the Figma frame's, less its 44px status bar. */
.fortune {
  --top: 0px;
  font-family: var(--font-display);
  letter-spacing: var(--tracking);
  color: var(--system-black);
  position: absolute;
  inset: 0;
  z-index: 65;
  overflow: hidden;
  background: var(--neutral-100);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0.45s;
}
.is-preview .fortune { --top: 44px; }
.fortune.is-open {
  transform: none;
  visibility: visible;
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}
.fortune--bar {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--top) + 10px);
  height: 44px;
  display: grid;
  place-items: center;
  z-index: 3;
}
.fortune--back {
  position: absolute;
  left: 8px;
  top: 0;
  padding: 8px;
  border: 0;
  background: none;
  cursor: pointer;
}
.fortune--back img { display: block; }
.fortune p,
.fortune h2,
.fortune button,
.fortune label {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: var(--tracking);
  line-height: normal;
  color: var(--system-black);
}
.fortune .fortune--title { font-family: var(--font-title); font-size: 20px; letter-spacing: var(--tracking-title); }  /* Cooper, as an opened card's name */
.fortune .fortune--pill {
  width: max-content;
  margin: 0 auto;
  padding: 7px 18px;
  border-radius: 36px;
  background: var(--neutral-100);
  border: 1px solid var(--system-black);
  filter: drop-shadow(0 4px 2px rgba(168, 164, 164, 0.2));
}

/* Steps 1 and 2 */
.fortune--intro {
  position: absolute;
  inset: 0;
  transition: opacity 0.35s, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fortune--intro .fortune--pill {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--top) + 111px);
  transform: translateX(-1px);
}
.fortune--ring {
  position: absolute;
  left: 71px;
  top: calc(var(--top) + 245px);
  width: 253px;
  height: 253px;
}
.fortune--ring > * { position: absolute; display: block; }
.fortune--ring-line { inset: 0; }
.fortune--arc {
  left: 2.5px;
  top: 2.5px;
  color: var(--system-black);
}
.fortune--arc path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.fortune.is-open .fortune--arc path { animation: fortune-fill 2.4s 0.35s cubic-bezier(0.45, 0, 0.25, 1) forwards; }
@keyframes fortune-fill { to { stroke-dashoffset: 0; } }
.fortune--clover img { display: block; transition: opacity 0.3s; }
.fortune--clover .is-on { position: absolute; inset: 0; opacity: 0; }
.fortune--clover-big { left: 69.9px; top: 74.9px; transform: rotate(7.82deg); }
.fortune--clover-small { left: 160.6px; top: 145.6px; transform: rotate(-10.59deg); }
/* The clovers sway while the fortune loads, and pop once it's ready */
.fortune[data-step="loading"] .fortune--clover-big { animation: fortune-sway 1.6s ease-in-out infinite; }
.fortune[data-step="loading"] .fortune--clover-small { animation: fortune-sway 1.6s 0.4s ease-in-out infinite reverse; }
@keyframes fortune-sway {
  0%, 100% { rotate: -6deg; }
  50% { rotate: 6deg; }
}
.fortune:not([data-step="loading"]) .fortune--clover .is-on { opacity: 1; }
.fortune[data-step="ready"] .fortune--clover { animation: fortune-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
.fortune[data-step="ready"] .fortune--clover-small { animation-delay: 0.08s; }
@keyframes fortune-pop { 40% { scale: 1.18; } }
/* In the tab bar's place, as on the Luck Claimed panel */
.fortune .fortune--see {
  position: absolute;
  left: 16px;
  bottom: calc(var(--nav-bottom, 42px) + 80px);
  width: 371px;
  height: 51px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--neutral-300);  /* disabled (Figma 638:287) */
  border: 1px solid transparent;
  color: var(--neutral-900);
  font-size: 16px;  /* main buttons' text */
  -webkit-tap-highlight-color: transparent;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.15s;
}
.fortune--see span { grid-area: 1 / 1; transition: opacity 0.3s; }
.fortune--see .is-on { opacity: 0; }
.fortune--see:not(:disabled) {
  background: var(--system-black);
  color: var(--system-white);
  cursor: pointer;
}
.fortune--see:not(:disabled) .is-on { opacity: 1; }
.fortune--see:not(:disabled) .is-off { opacity: 0; }
.fortune--see:not(:disabled):active { transform: scale(0.97); }
.fortune[data-step="loading"] .fortune--see .is-off { animation: fortune-blink 1.2s ease-in-out infinite; }
@keyframes fortune-blink { 50% { opacity: 0.45; } }
.fortune .fortune--birth {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-bottom, 42px) + 42px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  font-size: 14px;
  color: var(--neutral-700);
  cursor: pointer;
}
.fortune--birth span {
  text-decoration: underline;
  text-underline-position: from-font;
}
.fortune--birth input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Step 3: the reading */
.fortune--result {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: calc(var(--top) + 55px) 16px 37px;
  background: linear-gradient(to bottom, var(--v2-blue), var(--neutral-100) 93.862%) top / 100% 874px no-repeat, var(--neutral-100);
  scrollbar-width: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s, visibility 0s 0.45s;
}
.fortune[data-step="result"] .fortune--intro { opacity: 0; transform: scale(0.94); pointer-events: none; }
.fortune[data-step="result"] .fortune--result {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s;
}
.fortune--result .fortune--pill {
  border-color: var(--neutral-700);
  font-weight: 500;
  font-size: 14px;
  color: var(--neutral-700);
}
.fortune--hero {
  position: relative;
  height: 151px;  /* the pig stands 31px into the reading's card */
  margin-top: 47px;
}
.fortune--hero img { position: absolute; display: block; }
.fortune--coin { z-index: 0; }
.fortune--coin-left { left: 27.5px; top: 25.2px; transform: rotate(-13.94deg); }
.fortune--coin-right { left: 263.2px; top: 67.2px; transform: rotate(8.69deg); }
.fortune--pig { left: 90px; top: 0; z-index: 2; }
.fortune--pig-shadow { left: 111.4px; top: 178.7px; z-index: 2; transform: scaleY(-1); }
.fortune--card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  border-radius: 16px;
  background: var(--system-white);
  border: 1px solid var(--system-black);  /* a firmer line, 1 */
  text-align: center;
}
button.fortune--card {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
button.fortune--card:active { transform: scale(0.98); }
.fortune--read {
  /* as tall as the day's reading: the cards below follow it up or down */
  padding: 60px 24px 26px;
  justify-content: flex-start;
}
.fortune .fortune--headline {
  font-weight: 500;
  font-size: 20px;
}
/* The whole reading, from the start */
.fortune .fortune--body {
  margin-top: 12px;  /* the same colour as the headline above it */
}
.fortune--tiles {
  display: grid;
  grid-template-columns: 180px 180px;
  justify-content: space-between;
  margin-top: 12px;
}
.fortune--tile { height: 228px; padding: 22px 0; }
.fortune--label { }  /* the same colour as what it labels */
.fortune--ritual { gap: 26px; }
.fortune--art { display: block; height: 90px; }
.fortune--art img { display: block; width: auto; height: 87px; }
.fortune--ritual-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;  /* as the colour's name beside it */
}
.fortune--ritual-name img { width: 15px; height: 15px; }
.fortune--ritual-name img { transform: rotate(180deg); }
.fortune--ritual:hover .fortune--ritual-name img,
.fortune--ritual:focus-visible .fortune--ritual-name img { animation: fortune-nudge-r 1s ease-in-out infinite; }
@keyframes fortune-nudge-r { 50% { transform: rotate(180deg) translateX(-4px); } }
.fortune--colour { justify-content: space-between; }
.fortune--swatch {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--system-black);
}
.fortune--swatch-name { font-size: 14px; }
/* Each piece arrives in turn */
.fortune[data-step="result"] .fortune--pig { animation: fortune-hop 0.6s 0.15s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.fortune[data-step="result"] .fortune--coin { animation: fortune-float 3.2s ease-in-out infinite; }
.fortune[data-step="result"] .fortune--coin-right { animation-delay: -1.6s; }
.fortune[data-step="result"] .fortune--card { animation: fortune-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.fortune[data-step="result"] .fortune--read { animation-delay: 0.1s; }
.fortune[data-step="result"] .fortune--ritual { animation-delay: 0.18s; }
.fortune[data-step="result"] .fortune--colour { animation-delay: 0.24s; }
@keyframes fortune-hop { from { translate: 0 18px; opacity: 0; } }
@keyframes fortune-float { 50% { translate: 0 -6px; } }
@keyframes fortune-rise { from { translate: 0 24px; opacity: 0; } }

/* Filter: a dimmed screen and a sheet rising from the bottom, its options in
   the design system's button style (the Luck Claimed button), the picked one
   on Neutral 100 with a firmer line */
.head--title img { transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.head--title[aria-expanded="true"] img { transform: rotate(180deg); }
.filter {
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}
.filter.is-open { pointer-events: auto; }
.filter--scrim {
  position: absolute;
  inset: 0;
  background: rgba(39, 39, 39, 0.4);
  opacity: 0;
  transition: opacity 0.3s;
}
.filter.is-open .filter--scrim { opacity: 1; }
.filter--sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 0 48px;  /* clear of the home indicator */
  border-radius: 30px 30px 0 0;
  background: var(--system-white);
  border-top: 1px solid var(--system-black);
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
}
.filter.is-open .filter--sheet { transform: none; }
/* Top bar: close and Confirm, over a Neutral 100 rule */
.filter--bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 71px;
  padding: 6px 20px 0;
  box-sizing: border-box;
  border-bottom: 1px solid var(--neutral-100);
}
.filter--close,
.filter--confirm {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.filter--close:active,
.filter--confirm:active { transform: scale(0.92); }
.filter--close img { display: block; }
.filter--confirm {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--system-black);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;  /* body text */
  letter-spacing: var(--tracking);
  line-height: normal;
}
.filter--confirm img { display: block; }
/* Set like the rest of the app's text: Paperlogy 17, Regular */
.filter--label {
  margin: 0;
  font-family: var(--font-title);  /* Cooper, as the page titles */
  font-weight: 400;
  font-size: 20px;
  letter-spacing: var(--tracking-title);
  line-height: normal;
  color: var(--system-black);
}
.filter--label { margin: 20px 26px 14px; }
/* Tiles, three to a row: outlined in the design system's line, a deck's
   icon over its name. Picked, a tile fills with its category's colour and
   its icon colours in; the rest stay Neutral 100. */
.filter--options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px 10px;
  padding: 0 26px;
}
.filter--opt {
  --tile: var(--neutral-100);
  --ink: var(--system-black);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  border: 1px solid var(--neutral-500);
  border-radius: 15px;
  background: var(--neutral-100);
  color: var(--system-black);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s, color 0.25s, transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.filter--opt:active { transform: scale(0.95); }
.filter--opt[data-deck="all"] { --tile: var(--light-pink); }
.filter--opt[data-deck="protection"] { --tile: var(--protection); --ink: var(--system-white); }
.filter--opt[data-deck="calm"] { --tile: var(--calm); --ink: var(--system-white); }
.filter--opt[data-deck="luck"] { --tile: var(--luck); }
.filter--opt[data-deck="success"] { --tile: var(--success); }
.filter--opt[aria-pressed="true"] {
  background: var(--tile);
  color: var(--ink);
}
.filter--icon {
  position: relative;
  width: 40px;
  height: 40px;
}
/* The Calm star's thin points read small, so it's drawn bigger */
.filter--opt[data-deck="calm"] .filter--icon { width: 52px; height: 52px; margin: -6px 0; }
.filter--icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.25s;
}
.filter--opt .is-on,
.filter--opt[aria-pressed="true"] .is-off { opacity: 0; }
.filter--opt[aria-pressed="true"] .is-on { opacity: 1; }
/* Picked, the icon gives a little hop */
.filter--opt[aria-pressed="true"] .filter--icon { animation: tile-hop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes tile-hop {
  40% { transform: scale(1.15) rotate(-8deg); }
}
.filter--name {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: var(--tracking);
  line-height: normal;
  white-space: nowrap;
}
/* Whichever tile is picked, its name is set in Medium */
.filter--opt[aria-pressed="true"] .filter--name { font-weight: 500; }

/* Opened card: the screen frosted over, the card turned over on top */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
.is-flipped .overlay { opacity: 1; pointer-events: auto; }
.is-flipped .fan,
.is-flipped .dial,
.is-flipped .m-nav { pointer-events: none; }
/* The back arrow takes the header's place */
.head { transition: opacity 0.3s; }
.is-flipped .head { opacity: 0; }
/* The status bar stays over the sheet once it fills the screen */
.status { z-index: 80; }

/* Back arrow (Figma 350:4211): 28px, 16 from the left, centred in the row
   under the status bar; the button's padding widens what a finger can hit */
.m-back {
  position: absolute;
  left: 8px;
  top: 54px;
  z-index: 70;
  padding: 8px;
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.is-phone .m-back { top: 10px; }
.m-back img { display: block; }
.is-flipped .m-back { opacity: 1; pointer-events: auto; }
/* The opened card's name, centred in the back arrow's row */
.m-title {
  position: absolute;
  left: 60px;
  right: 60px;
  top: 54px;
  height: 44px;  /* the back arrow's height */
  margin: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  font-family: var(--font-title);  /* Cooper, as the page titles */
  font-size: 20px;
  letter-spacing: var(--tracking-title);
  color: var(--system-black);
  white-space: nowrap;
  visibility: hidden;
  pointer-events: none;
}
.is-phone .m-title { top: 10px; }
.is-flipped .m-title { visibility: visible; }

.m-flip {
  position: absolute;
  z-index: 60;
  perspective: 5000px;  /* shallow 3D so the card barely swells mid-flip */
}
.m-flip--inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.m-flip--face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* Front: the artwork. The box keeps the card's shape while this side shows. */
.m-flip--front img {
  display: block;
  width: 100%;
  height: 100%;
}
/* Back: the card turned over (Figma 350:3773). It's laid out at the screen's
   width and shown at --k of that (370 wide on a full-size screen). */
.m-flip--back {
  transform: rotateY(180deg);
  overflow: hidden;
  border: calc(1px * var(--k, 1)) solid var(--system-black);  /* same line as the tags */
}
.panel {
  position: absolute;
  inset: 0;
  background: var(--card-color);
  color: var(--system-black);
}
.panel--info {
  position: absolute;
  top: 0;
  left: calc(50% - 201px);
  width: 402px;
  height: var(--info-h, 580px);
  transform: scale(var(--k, 1));
  transform-origin: 50% 0;
}
/* Paper grain over everything on the back (Figma 332:1902): the photo,
   flipped, twice down the card, multiplied over whatever is beneath */
.panel--paper {
  position: absolute;
  left: calc(50% - 0.5px - 276.5px);
  top: -62px;
  width: 553px;
  height: 1548px;
  background: url("assets/system/paper.png") 0 0 / 553px 774px repeat-y;
  transform: rotate(180deg);
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* Everything on the card back is centred on it (201). The frame (Figma
   info-frame.svg) is a white band between two lines, drawn here so it
   stretches to the card's height; the tag covers its gap at the top. */
.info--frame {
  position: absolute;
  left: 23.97px;  /* (402 - 354.069) / 2 */
  right: 23.97px;
  top: 24.6px;
  bottom: 24.3px;
  border: 0.773px solid var(--system-black);
  border-radius: 24.74px;
  background: var(--neutral-100);
  pointer-events: none;
}
.info--frame::after {
  content: "";
  position: absolute;
  inset: 10.05px;  /* the band, less the outer line */
  border: 0.773px solid var(--system-black);
  border-radius: 13.53px;
  background: var(--card-color);
}
.info--tag {
  position: absolute;
  left: 50%;
  top: 15px;
  transform: translateX(-50%);
  line-height: 0;
}
.info--body {
  position: absolute;
  left: 50.5px;  /* (402 - 301) / 2 */
  /* Centred up and down in the frame, under the tag: 15 + 33.17 from the
     top, the frame's bottom line (24.6 + 531.1) from the bottom */
  top: 48.17px;
  bottom: 24.3px;
  width: 301px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 33px;
}
.info--icon { position: relative; flex: none; }
.info--text {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 16px;  /* body text */
  letter-spacing: var(--tracking);
  line-height: normal;
}

/* The ritual's sheet (Figma 350:4264 peeking, 350:4886 full). mobile.js
   slides it, sizes it up and firms it up as it comes; --p is how far. */
.sheet {
  position: absolute;
  left: 0;
  top: 0;
  width: 402px;
  z-index: 65;
  overflow: hidden;
  background: var(--card-color);
  color: var(--system-black);
  /* Carries its colour on below, for when it snaps a touch past the top */
  box-shadow: 0 60px 0 var(--card-color);
  will-change: transform;
  cursor: pointer;
}
.sheet.is-full { cursor: auto; }
/* While it peeks, its top melts from Neutral 100 into the card's colour */
.sheet--fade {
  position: absolute;
  left: -8px;
  top: 0;
  width: 417px;
  height: 404px;
  background: linear-gradient(var(--neutral-100) 31.609%, rgba(240, 240, 240, 0) 97.573%);
  opacity: calc(1 - var(--p, 0));
  pointer-events: none;
}
.sheet--chevron {
  position: absolute;
  left: 174.5px;  /* (402 - 53) / 2 */
  top: 18.5px;
  display: block;
  opacity: calc(1 - var(--p, 0));
  animation: chevron-nudge 1.6s ease-in-out infinite;
}
/* The chevron keeps nudging down: there's more below */
@keyframes chevron-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}
.sheet.is-full .sheet--chevron { animation: none; }
.sheet--howto {
  position: absolute;
  left: 62.5px;  /* (402 - 277) / 2 */
  width: 277px;
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 16.818px;
  letter-spacing: var(--tracking);
  line-height: normal;
}
/* On a dark card colour, white words; and the back arrow too, once the
   sheet fills the screen behind it */
.sheet[data-ink="light"] .sheet--howto { color: var(--neutral-100); }
.stage:has(.sheet.is-full[data-ink="light"]) .m-back img { filter: brightness(0) invert(1); }
/* Share: the back arrow's twin, on the right */
.m-share { left: auto; right: 8px; }
/* A word that something's done (the link copied), as the wish tree's */
.m-toast {
  position: absolute;
  left: 50%;
  top: calc(44px + 54px + 8px);
  z-index: 75;
  margin: 0;
  padding: 7px 18px;
  border-radius: 36px;
  background: var(--system-black);
  color: var(--neutral-100);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: var(--tracking);
  white-space: nowrap;
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.is-phone .m-toast { top: calc(54px + 8px); }
/* Share options: the filter sheet, over the open card, with a tile for each
   way to send it */
.sharesheet { z-index: 74; }
.sharesheet--icon { display: block; width: 32px; height: 32px; }
.sharesheet--icon img { display: block; width: 100%; height: 100%; }
.m-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
/* The interaction, centred under the back arrow's row; only live once full */
.sheet--ritual {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--ritual-top, 108px);
  bottom: 0;
  display: grid;
  place-items: center;
  /* Grows a touch and firms up as the sheet comes up */
  transform: scale(calc(var(--ritual-scale) + (1 - var(--ritual-scale)) * var(--p, 0)));
  opacity: calc(var(--ritual-opacity) + (1 - var(--ritual-opacity)) * var(--p, 0));
  transform-origin: 50% 0;
}
.sheet:not(.is-full) .sheet--ritual { pointer-events: none; }
.ritual--piece {
  width: 402px;
  height: 100%;
  border: 0;
  background: transparent;
}
.ritual--art {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
/* As tall as the doll plus how far below it starts (TERU_DROP), so its
   start and its hanging spot sit either side of the middle */
.ritual--teru {
  position: relative;
  width: 166.172px;
  height: calc(417.5px + 90px);
  translate: 0 -40px;  /* higher on the sheet, yet once hung its loop stays clear of the words above */
}
.ritual--teru .teru--doll {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 417.5px;
  touch-action: none;
  transform-origin: 83px 0;  /* swings from the top of its string */
}
/* Rain, in bad weather: short slanted black lines falling across the sky
   behind everything, two layers at two speeds; it stops once the doll is up.
   Each tile is 120 x 160 and moves a whole tile's worth on the slant (one
   across for four down), so it loops without a seam. */
.teru--rain {
  position: absolute;
  left: -300px;
  right: -300px;
  top: -80px;
  bottom: -300px;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 80px);
  mask-image: linear-gradient(to bottom, transparent, #000 80px);
  transition: opacity 0.9s;
}
.teru--rain i {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='160'%3E%3Cg stroke='%23272727' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M18 12l-3.5 14M80 96l-3.5 14'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.45;
  animation: rain 1.4s linear infinite;
}
.teru--rain i + i {
  background-position: 37px 61px;
  opacity: 0.18;
  animation-duration: 2s;
  scale: 0.8;
}
@keyframes rain { to { background-position: -120px 480px; } }
.teru--rain i + i { animation-name: rain-far; }
@keyframes rain-far { from { background-position: 37px 61px; } to { background-position: -83px 541px; } }
.ritual--teru:not(.is-gloomy) .teru--rain { opacity: 0; }
.ritual--teru:not(.is-gloomy) .teru--rain i { animation-play-state: paused; }
/* The cord strung across the sky, left to right, sagging a little at the
   middle where the doll's loop goes over it (in front of the loop, so it
   hangs on it) */
.teru--line {
  position: absolute;
  left: -300px;
  top: -20px;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
}
.teru--line path { fill: none; stroke: var(--system-black); stroke-width: 2.5px; stroke-linecap: round; }
/* Only the loop at the top of the string takes hold of it */
.teru--grip {
  position: absolute;
  left: 55px;
  top: -16px;
  width: 56px;
  height: 80px;
  z-index: 2;
  border-radius: 999px;
  border: 1.4px dashed var(--neutral-100);
  background: color-mix(in srgb, var(--system-white) 20%, transparent);
  cursor: grab;
  animation: grip-pulse 1.6s ease-in-out infinite;
}
.teru--hand {
  position: absolute;
  left: 69px;
  top: 30px;
  width: 48px;
  z-index: 3;
  pointer-events: none;
  animation: hand-pull 1.6s cubic-bezier(0.45, 0, 0.3, 1) infinite;
}
@keyframes grip-pulse { 50% { scale: 1.08; } }
@keyframes hand-pull {
  0%, 15% { translate: 0 10px; opacity: 0; }
  30% { opacity: 1; }
  70% { translate: 0 -14px; opacity: 1; }
  100% { translate: 0 -14px; opacity: 0; }
}
.is-held .teru--grip,
.is-held .teru--hand,
.teru--doll.is-hung .teru--grip,
.teru--doll.is-hung .teru--hand { opacity: 0; animation: none; pointer-events: none; transition: opacity 0.2s; }
.is-held .teru--doll { cursor: grabbing; }
/* Held by the loop, it dangles: a slow, slight sway from the top of the string */
.is-held .teru--doll:not(.is-hung) { animation: dangle 1.6s ease-in-out infinite alternate; }
@keyframes dangle {
  from { rotate: -3deg; }
  to { rotate: 3deg; }
}
/* Bad weather: a grey sky, the sun gone; it clears once the doll is hung */
.sheet { transition: background-color 1.2s; }
.sheet:has(.ritual--teru.is-gloomy) { background-color: var(--neutral-700); }
.teru--scene[src*="sun"] { transition: opacity 0.9s 0.3s, translate 1.2s 0.3s cubic-bezier(0.3, 1.2, 0.5, 1); }
.is-gloomy .teru--scene[src*="sun"] { opacity: 0; translate: 0 40px; }
.teru--scene {
  position: absolute;
  display: block;
  pointer-events: none;
}
/* The clouds drift slowly side to side, in bad weather and good, out of step */
.teru--scene[src*="cloud"] { animation: cloud-drift 7s ease-in-out infinite alternate; }
.teru--scene[src*="cloud-right"] { animation-duration: 9s; animation-delay: -4s; }
@keyframes cloud-drift {
  from { translate: -14px 0; }
  to { translate: 14px 0; }
}

/* Luck Claimed (Figma 350:5219): the bottom of the sheet deepens and blurs,
   with the way on */
.sheet--claimed {
  position: absolute;
  left: -8px;
  bottom: 6px;
  width: 417px;
  height: 414px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
.is-claimed .sheet--claimed { opacity: 1; pointer-events: auto; }
/* Figma 350:5220: a deep blue glow rising from the bottom edge, 557 tall */
.claimed--glow {
  position: absolute;
  left: 0;
  bottom: -14px;
  width: 100%;
  height: 557px;
  /* Each card colour has its own deep shade (GLOW_COLOR in cards.js) */
  background: radial-gradient(ellipse 100% 100% at 50% 100%,
    var(--glow-color) 18.2%,
    transparent 100%);
  -webkit-backdrop-filter: blur(3.15px);
  backdrop-filter: blur(3.15px);
  -webkit-mask-image: linear-gradient(to top, #000 60%, transparent);
  mask-image: linear-gradient(to top, #000 60%, transparent);
}
/* Figma 350:5221: clover, title and line, then the way home, which sits
   where the home screen's tab bar does (42 above the bottom edge, 51 tall) */
.claimed--body {
  position: absolute;
  left: 24px;
  top: 66px;
  bottom: calc(var(--nav-bottom, 42px) - 6px);  /* + the panel's own 6: the tab bar's height */
  width: 371px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.claimed--text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.claimed--clover {
  display: block;
  margin: 7.48px 0;  /* its 91.567 box, tilted 15° */
  transform: rotate(15deg);
}
.claimed--title,
.claimed--sub {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: var(--tracking);
  line-height: normal;
  text-align: center;
  color: #fff;
}
.claimed--title { font-weight: 600; font-size: 22px; }
.claimed--sub { font-weight: 400; font-size: 16px; }
/* Home, and under it a small Replay link: the sub line's white and size,
   underlined, its icon beside it */
.claimed--btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.claimed--replay {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: var(--tracking);
  line-height: normal;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.claimed--replay span { text-decoration: underline; text-underline-offset: 3px; }
.claimed--replay svg { display: block; flex: none; }
.claimed--replay:active { opacity: 0.7; }
.claimed--btn {
  width: 371px;
  height: 51px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--system-white);
  border: 1px solid var(--neutral-500);  /* outlined (Figma 637:282) */
  color: var(--system-black);
  font-family: var(--font-display);
  font-size: 16px;  /* main buttons' text */
  letter-spacing: var(--tracking);
  line-height: normal;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, background-color 0.15s;
}
.claimed--btn:active { transform: scale(0.97); background: var(--neutral-100); }

/* Claimed: the clover pops in with a twist, then the words and button rise
   in one after another */
.is-claimed .claimed--clover { animation: clover-pop 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.is-claimed .claimed--title { animation: claimed-rise 0.5s 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.is-claimed .claimed--sub { animation: claimed-rise 0.5s 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.is-claimed .claimed--btn { animation: claimed-rise 0.5s 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.is-claimed .claimed--replay { animation: claimed-rise 0.5s 0.48s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes clover-pop {
  from { opacity: 0; transform: scale(0.2) rotate(-90deg); }
  to { opacity: 1; transform: rotate(15deg); }
}
@keyframes claimed-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* The claimed clover on its way to the header's count */
.clover-fly {
  position: absolute;
  z-index: 90;
  pointer-events: none;
  transform-origin: 50% 50%;
}
.clover-fly img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.head--count img { transform-origin: 50% 50%; }
.head--count span { display: inline-block; }

/* Artwork standing in for a drawing: its cut edges melt into the card */
.panel--art {
  background-repeat: no-repeat;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent, #000 32px, #000 calc(100% - 32px), transparent),
    linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent, #000 32px, #000 calc(100% - 32px), transparent),
    linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-composite: intersect;
}

/* Drawings built from Figma layers: each part a box at its Figma spot, the
   SVG filling it plus its stroke spill */
.draw { position: relative; }
.draw--part,
.draw--knot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}
.draw--rot { position: relative; flex: none; }
.draw--spill { position: absolute; }
.draw--spill img { display: block; width: 100%; height: 100%; }
.draw--knot {
  border: 1px solid var(--system-black);
  border-radius: 92px;
}

/* Wish Tree (the Tree tab): the scene fills the screen, its ground on the
   bottom edge, scrolling if the screen is shorter than it. Paper grain over
   it, as on the cards. */
.head--page {
  display: none;
  margin: 0;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 27px;
  letter-spacing: var(--tracking-title);
  line-height: normal;
  color: var(--system-black);
}
[data-view="tree"] .head--title { display: none; }
[data-view="tree"] .head--page { display: block; color: var(--neutral-100); }
/* Over the dark canopy the status bar turns white */
[data-view="tree"] .status--time { color: var(--neutral-100); }
[data-view="tree"] .status--right { filter: invert(1) brightness(2); }
.tree {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  overflow: hidden;  /* never scrolls: the scene sits on its bottom edge */
  overscroll-behavior: none;
  touch-action: none;  /* (the slips still take taps) */
  background: #16313f;  /* the painting's night canopy, where the scene runs out */
  scrollbar-width: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s 0.3s;
}
[data-view="tree"] .tree {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s;
}
.tree--scene {
  position: relative;
  flex: none;
  margin-top: auto;  /* on the bottom edge, still scrollable when taller */
  width: 402px;
  height: 874px;
}
.tree--scene svg { display: block; }
/* While a wish is open, the tree zooms in a little towards it */
.tree--scene { transition: transform 0.6s cubic-bezier(0.3, 0.8, 0.2, 1), transform-origin 0.6s cubic-bezier(0.3, 0.8, 0.2, 1); }  /* going from wish to wish, it pans across */
.tree--scene.is-zoomed { transform: scale(1.45); }
/* The whole picture, as laid out in the Figma frame */
.tree--art {
  position: absolute;
  inset: 0;
}
/* The Figma frame's layers, stacked exactly: back, the slips, the front of
   the trees over them, then the light. Only the slips take taps. */
.tree--layer,
.tree--slips,
.tree--wishes {
  position: absolute;
  left: 0;
  top: 0;
  width: 402px;
  height: 874px;
}
.tree--slips { pointer-events: none; }
/* The still parts of each layer are drawn once and kept (the moving parts
   are lifted out into little svgs of their own, see tree.js) */
.tree--layer.is-still > svg:first-child { will-change: transform; }
.tree--layer[data-layer="front"],
.tree--layer[data-layer="light"] { pointer-events: none; }
/* Sun and shadow: the light comes from the top left, so everything casts
   its shadow down and to the right. The front of the tree shades the leaves
   behind it; each slip throws a small shadow that swings with it. */
.tree--layer[data-layer="front"] > svg:first-child,
.tree--layer[data-layer="front"] .tree--strand { filter: drop-shadow(7px 12px 9px rgba(6, 34, 36, 0.38)); }
.tree--wish .tree--paper { filter: drop-shadow(3px 6px 2.5px rgba(6, 34, 36, 0.35)); }
/* The light, brighter: the beams themselves a touch stronger, and a warm sun
   glowing in from the top-left corner, breathing slowly */
.tree--layer[data-layer="light"] > svg:first-child,
.tree--layer[data-layer="light"] .tree--beam { filter: brightness(1.25) saturate(1.1); }
.tree--sun {
  position: absolute;
  left: -260px;
  top: 70px;  /* in from the left edge, below the header and its title */
  width: 520px;
  height: 520px;
  border-radius: 50%;
  /* (a plain glow, not a blend: blending over the moving tree is costly) */
  background: radial-gradient(circle, rgba(255, 250, 205, 0.32), rgba(255, 244, 180, 0.12) 40%, rgba(255, 240, 170, 0) 70%);
  pointer-events: none;
  will-change: transform, opacity;
  animation: sun-breathe 7s ease-in-out infinite alternate;
}
@keyframes sun-breathe {
  from { opacity: 0.7; scale: 0.96; }
  to { opacity: 1; scale: 1.04; }
}
.tree--layer svg { overflow: visible; }
/* The moving light: each beam swings slowly from the top left, as light
   does through moving leaves, and brightens and dims as it goes */
.tree--beam,
.tree--strand {
  position: absolute;
  will-change: transform;
}
.tree--beam {
  transform-origin: var(--ox) var(--oy);  /* the frame's top left */
  animation-name: beam-swing, beam-breathe;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
@keyframes beam-swing {
  0% { rotate: -6deg; translate: -18px 0; }
  50% { rotate: 2deg; translate: 6px 8px; }
  100% { rotate: 6.5deg; translate: 20px -4px; }
}
@keyframes beam-breathe {
  0% { opacity: 0.25; }
  35% { opacity: 1; }
  60% { opacity: 0.45; }
  85% { opacity: 0.9; }
  100% { opacity: 0.35; }
}
/* Hanging strands of leaves drift slightly from their tops */
.tree--strand {
  transform-origin: 50% 0;
  animation: strand-drift 5.5s ease-in-out infinite alternate;
}
@keyframes strand-drift {
  from { rotate: -1.6deg; }
  to { rotate: 1.6deg; }
}
/* Paper grain over the whole Wish Tree screen, as on the cards: over the
   scene and the header's title, under every button (the header's pill is
   above it, as are the Write button, the tab bar and the open slip's ×) */
.m-grain {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: none;
  /* the grain's shade alone (paper-shade.png: the paper's darks as black at
     the same strength), laid plainly over: it looks as the multiplied paper
     did, without blending over the moving tree, which is costly */
  background: url("assets/system/paper-shade.png") 0 0 / 402px auto;
  pointer-events: none;
}
[data-view="tree"] .m-grain { display: block; }
/* Away from the Wish Tree, its moving parts rest */
.stage:not([data-view="tree"]) .tree * { animation-play-state: paused !important; }
/* The strips sway on their strings, each in its own time */
.tree--wish {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  outline: none;
  transform-origin: 22px 10px;  /* the top of its string */
  will-change: transform;
  animation: wish-sway 4s ease-in-out infinite alternate;
}
.tree--wish:focus-visible path:first-of-type { stroke-dasharray: 2 2; }
/* The slips swing on their strings, unevenly, as in a light breeze */
@keyframes wish-sway {
  0% { rotate: -5deg; }
  30% { rotate: 4deg; }
  55% { rotate: -2deg; }
  80% { rotate: 6deg; }
  100% { rotate: -1deg; }
}
.tree--hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 122px;
  width: max-content;
  margin: 0 auto;
  /* 460:5296: plain System White words over the canopy */
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: var(--tracking);
  color: var(--system-white);
  z-index: 1;
  pointer-events: none;
}
.is-phone .tree--hint { top: 78px; }

/* A wish up close: the strip, much bigger, over a dimmed tree */
.wish {
  position: absolute;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  transition: visibility 0s 0.52s;
}
.wish.is-open { visibility: visible; transition: none; }
.wish--scrim {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--system-black) 80%, transparent);  /* 460:2799's scrim */
  opacity: 0;
  transition: opacity 0.4s;
}
.wish.is-open .wish--scrim { opacity: 1; }
/* "Wish 1": Cooper, Neutral 100, centred where the header was */
.wish--title {
  position: absolute;
  left: 75px;
  right: 75px;
  top: 61px;
  margin: 0;
  text-align: center;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 25px;
  color: var(--neutral-100);
  opacity: 0;
  transition: opacity 0.3s;
}
.is-phone .wish--title { top: 17px; }
.wish.is-open .wish--title { opacity: 1; }
/* The header makes way for the close button while a wish is open */
.is-reading .head { opacity: 0; pointer-events: none; }
/* The ×, System White, at the header icons' 28px, in a 44px tap area, its box on the 16px margin */
.wish--close {
  position: absolute;
  right: 8px;
  top: 51px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
}
.wish--close svg { display: block; overflow: visible; }
.wish--close path { fill: none; stroke: var(--system-white); stroke-width: 1.5px; stroke-linecap: round; }
.is-phone .wish--close { top: 7px; }
.wish--close:focus-visible,
.wishform--close:focus-visible { outline: 1.5px solid var(--system-black); outline-offset: -2px; }
.wish.is-open .wish--close { opacity: 1; }
/* The slip (460:5271): 294 x 491, a little above the middle */
.wish--slip {
  --paper: var(--neutral-100);
  position: absolute;
  left: 54px;
  top: calc(50% - 235px);  /* 497:8061: the hint, 29, the slip, 29, the row */
  width: 294.89px;
  height: 490.72px;
  box-sizing: border-box;
  transform-origin: 50% 50%;
}
.wish:not(.is-open) .wish--slip { opacity: 0; }
/* Held, the slip's outline draws in white; let go before it's done and it
   fades back. Held long enough, it twists round and sends good luck. */
.wish--slip { touch-action: none; -webkit-user-select: none; user-select: none; cursor: pointer; }
/* The traced outline (460:2797), drawn by tree.js from the bottom middle
   up both sides until they meet at the top: --trace runs 0 to 1 */
.wish--trace {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.wish--trace path {
  fill: none;
  stroke: var(--system-white);
  stroke-width: 1.5px;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1 1.01;
  stroke-dashoffset: calc(1 - var(--trace, 0));
  opacity: calc(var(--trace, 0) * 40);
}
.wish--trace-glow { filter: blur(5px); }
.wish--trace-glow path { stroke-width: 3px; }
.wish--slip.is-sent { --trace: 1; }
.wish--slip.is-twist { animation: twist 0.9s cubic-bezier(0.3, 0.8, 0.3, 1); }
@keyframes twist {
  0% { rotate: y 0deg; }
  100% { rotate: y 360deg; }
}
/* Above the slip: 14px, Neutral 100; while held, "Hold..." at 16 */
.wish--hold {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(50% - 281px);  /* above the slip */
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 19px;
  letter-spacing: var(--tracking);
  color: var(--neutral-100);
  opacity: 0;
  transition: opacity 0.3s;
}
.wish.is-open .wish--hold { opacity: 1; transition-delay: 0.3s; }
.wish--hold.is-sent { animation: hold-rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes hold-rise { from { opacity: 0; translate: 0 10px; } }
.wish--hold.is-holding { font-size: 16px; }
/* Under the slip (497:8058): ‹ Wish 1 of 10 ›, 270 wide, 29 below it;
   the chevrons the header's, in #c4c4c4, each in a 44px tap area */
.wish--nav {
  position: absolute;
  left: 50%;
  top: calc(50% + 286px);
  width: 270px;
  height: 44px;
  margin: -22px 0 0 -135px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.3s;
}
.wish.is-open .wish--nav { opacity: 1; transition-delay: 0.3s; }
.wish--count {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: var(--tracking);
  color: #c4c4c4;
  white-space: nowrap;
}
.wish--step {
  width: 44px;
  height: 44px;
  margin: 0 -19px;  /* the chevron itself sits at the row's ends */
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.wish--step svg { display: block; rotate: 90deg; overflow: visible; }
.wish--step.is-next svg { rotate: -90deg; }
.wish--step path { fill: none; stroke: #c4c4c4; stroke-width: 1.33px; stroke-linecap: round; stroke-linejoin: round; }
.wish--step:disabled { opacity: 0.3; cursor: default; }
/* The open slip is paper too, the hole cut through */
.wish--slip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/system/paper.png") 0 0 / 402px auto;
  mix-blend-mode: multiply;
  opacity: 0.6;
  pointer-events: none;
  clip-path: path(evenodd, "M259.273 0.5C261.301 0.500165 263.17 1.59637 264.16 3.36621L293.677 56.1416C294.144 56.9769 294.39 57.918 294.39 58.875V484.622C294.39 487.715 291.883 490.222 288.79 490.223H6.09961C3.00685 490.223 0.500053 487.715 0.5 484.622V59.0176C0.500083 57.9595 0.799426 56.923 1.36426 56.0283L34.7773 3.10938C35.8033 1.48462 37.5911 0.500076 39.5127 0.5H259.273ZM147.907 22.4355C144.838 22.4355 142.35 24.9214 142.35 27.9873C142.35 31.0531 144.838 33.5381 147.907 33.5381C150.976 33.538 153.465 31.053 153.465 27.9873C153.465 24.9214 150.976 22.4357 147.907 22.4355Z");
}
.wish--tag {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.wish--tag path { fill: var(--paper); stroke: var(--system-black); stroke-width: 1px; stroke-linejoin: round; }
.wish--paper {
  --hole-y: 26px;
  -webkit-mask: radial-gradient(circle 6px at 50% var(--hole-y), transparent 5.4px, #000 5.9px);
  mask: radial-gradient(circle 6px at 50% var(--hole-y), transparent 5.4px, #000 5.9px);
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.wish--paper path {
  fill: var(--paper);
  stroke: var(--system-black);
  stroke-width: 1.2px;
  stroke-linejoin: round;
}
.wish--hole {
  position: absolute;
  left: calc(50% - 6px);
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: none;
  border: 1.2px solid var(--system-black);
  box-sizing: border-box;
}
.wish--text,
.wish--from {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: var(--tracking);
  line-height: 1.35;
  color: var(--system-black);
}
/* The wish at 16 from the top left; who it's from at 14, at the foot */
.wish--slip .wish--text { position: absolute; left: 25px; top: 82.7px; width: 244px; font-size: 16px; }
.wish--slip .wish--from { position: absolute; left: 25px; top: 442.7px; width: 244px; font-size: 14px; }

/* Writing a wish. The button sits over the tree, just above the tab bar, in
   the System Black of the app's main actions, its price in a small pill */
.tree--write {
  position: absolute;
  left: 50%;
  bottom: calc(var(--nav-bottom, 42px) + 51px + 14px);
  z-index: 36;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* The app's main button, as "Hang it for 3" on the wish sheet */
  width: min(371px, calc(100% - 32px));
  height: 51px;
  padding: 0;
  transform: translateX(-50%);
  border: 0;  /* main (Figma 636:272): no line */
  border-radius: 999px;
  background: var(--system-black);
  color: var(--system-white);
  font-family: var(--font-display);
  font-size: 16px;  /* main buttons' text */
  letter-spacing: var(--tracking);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
[data-view="tree"] .tree--write { display: flex; }
.tree--write:active { transform: translateX(-50%) scale(0.96); }
.is-reading .tree--write,
.is-writing .tree--write { opacity: 0; pointer-events: none; }
.tree--cost { display: flex; align-items: center; gap: 2px; }
/* Once it's up */
.tree--toast {
  position: absolute;
  left: 50%;
  top: calc(44px + 54px + 8px);
  z-index: 37;
  margin: 0;
  padding: 7px 18px;
  border-radius: 36px;
  background: var(--system-black);
  color: var(--neutral-100);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: var(--tracking);
  white-space: nowrap;
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.is-phone .tree--toast { top: calc(54px + 8px); }
.tree--toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.tree--hint { transition: opacity 0.3s; }
.stage:has(.tree--toast.is-shown) .tree--hint { opacity: 0; }
/* A new wish swings hard as it takes the weight, then settles to the sway */
.tree--wish.is-new { animation: wish-hung 1.6s cubic-bezier(0.3, 0.6, 0.4, 1), wish-sway 4s 1.6s ease-in-out infinite alternate; }
@keyframes wish-hung {
  0% { rotate: 0deg; }
  20% { rotate: 14deg; }
  45% { rotate: -9deg; }
  70% { rotate: 5deg; }
  100% { rotate: -3deg; }
}

/* The sheet: System White from the bottom, as the filter's */
/* Writing a wish (Figma 543:7897): the tree dimmed behind, as for reading
   one; the header's clover count stays over it */
.wishform {
  position: absolute;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  transition: visibility 0s 0.42s;
}
.wishform.is-open { visibility: visible; transition: none; }
.wishform--scrim {
  position: absolute;
  inset: 0;
  /* the sketch's own (543:7897): the tree's sky, darkened, with the forest's
     beams of light through it (the tree's own light layer), under the grain */
  background:
    url("assets/system/paper-shade.png") 0 0 / 402px auto,
    url("assets/wish/write-bg.png") center / cover;
  opacity: 0;
  transition: opacity 0.4s;
}
.wishform.is-open .wishform--scrim { opacity: 1; }
.wishform--scrim { filter: hue-rotate(-38deg) saturate(1.15); }  /* the sky turned greener, as the forest's */
/* The forest's light over it: the tree's beams, warmer and stronger, each
   swaying from the top left and breathing in its own time, and a sun glow */
.wishform--light {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  container-type: inline-size;
  opacity: 0;
  transition: opacity 0.6s;
}
.wishform.is-open .wishform--light { opacity: 1; }
.wishform--light img {
  /* bigger than the screen all round, so as they sway no edge of them
     ever comes into view */
  position: absolute;
  left: -111.1%;  /* the drawing's frame is wider than its beams, so none is cut */
  top: calc(-20% - 63.4cqw);
  width: 397.5%;
  height: auto;
  transform-origin: 27.7% 20.9%;
  filter: sepia(0.8) saturate(2.4) hue-rotate(-12deg) brightness(2.3);  /* yellow, and strong */
  will-change: transform, opacity;
  animation: beam-swing 9s ease-in-out infinite alternate, wish-beam 6s ease-in-out infinite alternate;
}
.wishform--light img:nth-child(2) { animation-duration: 12s, 8s; animation-delay: -5s, -3s; scale: 1.15; }
.wishform--light img:nth-child(3) { animation-duration: 10s, 7s; animation-delay: -2s, -5s; scale: 0.9; }
/* breathing, but never fading far */
@keyframes wish-beam {
  0% { opacity: 0.55; }
  40% { opacity: 1; }
  70% { opacity: 0.7; }
  100% { opacity: 0.95; }
}
.wishform--sun {
  position: absolute;
  left: -260px;
  top: 40px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 170, 0.5), rgba(255, 236, 150, 0.2) 40%, rgba(255, 230, 140, 0) 70%);
  animation: sun-breathe 7s ease-in-out infinite alternate;
}
.is-writing .head { z-index: 61; pointer-events: none; }  /* shown over it, but taps go through to the back arrow */
/* the count, writing: no pill, in white on the dark green, on the margin */
.is-writing .head--count { padding: 0; background: none; filter: none; color: var(--neutral-100); }
.is-writing .head--count img { filter: brightness(0) invert(1); }
.is-writing .head--page,
.is-writing .head--title,
.is-writing .head--tools { opacity: 0; pointer-events: none; }
.is-writing .m-nav,
.is-writing .m-navfade,
.is-writing .tree--write { opacity: 0; pointer-events: none; }
.wishform--sheet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 54px 16px 40px;
  opacity: 0;
  translate: 0 24px;
  transition: opacity 0.35s, translate 0.42s cubic-bezier(0.32, 0.72, 0, 1);
}
.wishform.is-open .wishform--sheet { opacity: 1; translate: 0 0; }
.wishform--bar {
  position: relative;
  align-self: stretch;
  display: grid;
  place-items: center;
  height: 44px;
  flex: none;
}
/* the back arrow, as the app's, in white */
.wishform--close {
  position: absolute;
  left: -8px;
  top: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.wishform--close img { filter: brightness(0) invert(1); }
.wishform--title,
.wishform--count,
.wishform--by,
.wishform--anon,
.wishform--balance,
.wishform--q,
.wishform--a,
.wishform--hang,
.wishform--choices button,
.wishform--fly-text,
.wishform--slip textarea {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--tracking);
  line-height: normal;
  color: var(--system-black);
}
/* "Write a wish": Cooper, Neutral 100, as the reader's "Wish 1" */
.wishform--title { font-family: var(--font-title); font-size: 19px; letter-spacing: var(--tracking-title); color: var(--neutral-100); }
/* The blank slip, written on directly: the open slip's own size and shape
   (294.89 x 490.72), a little bigger, as the sketch's (332 across), in the
   room left between the title and the switch; smaller if it must be
   (tree.js sets --fit) */
.wishform--room {
  position: relative;
  align-self: stretch;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 14px;
}
.wishform--slip {
  --paper: var(--neutral-100);
  position: absolute;
  left: 50%;
  top: 50%;
  width: 294.89px;
  height: 490.72px;
  margin: -245.36px 0 0 -147.45px;
  scale: var(--fit, 1);
}
.wishform--slip .wish--tag { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the words where an open slip's are, at 16 */
.wishform--slip textarea {
  position: absolute;
  left: 25px;
  top: 82.7px;
  width: 244px;
  height: 320px;
  padding: 0;
  border: 0;
  background: none;
  resize: none;
  outline: none;
  font-size: 16px;
  line-height: 1.35;
}
.wishform--slip textarea::placeholder { color: var(--neutral-700); }
/* at its foot: how much is written, and who it's from (where an open
   slip's "Anonymous" is) */
.wishform--count { position: absolute; left: 25px; top: 420px; font-size: 14px; color: var(--neutral-700); }
.wishform--by { position: absolute; left: 25px; top: 442.7px; font-size: 14px; line-height: 1.35; }
/* Anonymous or signed: a switch */
.wishform--anon {
  /* as wide as the slip, so its words and switch line up with its edges */
  width: calc(294.89px * var(--fit, 1));
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
  font-size: 16px;
  color: var(--neutral-100);
}
.wishform--switch {
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--neutral-700);  /* off */
  cursor: pointer;
  transition: background 0.2s;
}
/* the knob, centred in the track */
.wishform--switch span {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--system-white);
  transition: translate 0.25s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.wishform--switch[aria-checked="true"] { background: var(--system-black); }
.wishform--switch[aria-checked="true"] span { translate: 20px 0; }
.wishform--switch:focus-visible { box-shadow: 0 0 0 3px var(--system-black), 0 0 0 4.5px var(--system-white); outline: none; }
/* Hang it: System Black, the price in white; System White and Neutral 700 until
   there's a wish to hang (or clovers to pay with) */
.wishform--hang {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 371px;
  height: 51px;
  padding: 0;
  border-radius: 999px;
  border: 0;  /* the system's main button: no line */
  background: var(--system-black);
  color: var(--system-white);
  font-size: 16px;  /* main buttons' text */
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.wishform--hang:active { transform: scale(0.97); }
.wishform--hang-cost { display: inline-flex; align-items: center; gap: 2px; }
.wishform--hang:disabled {
  background: var(--neutral-300);  /* disabled (Figma 638:287) */
  color: var(--neutral-900);
  cursor: default;
}
.wishform--hang:disabled .wishform--hang-cost img { filter: brightness(0.34); }  /* the white clover in Neutral 900 */
.wishform--hang.is-short .wishform--hang-cost { display: none; }
.wishform--balance {
  min-height: 17px;
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
  color: var(--neutral-100);
}
/* Before the clovers go: asked over the filter's overlay (the same dim) */
.wishform--confirm {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 16px;
  background: rgba(39, 39, 39, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s 0.3s;
}
.wishform.is-confirming .wishform--confirm { opacity: 1; visibility: visible; transition: opacity 0.3s; }
.wishform--card {
  width: 100%;
  max-width: 371px;
  padding: 26px 24px 24px;  /* more room at the sides */
  box-sizing: border-box;
  border-radius: 16px;  /* radius-field, as the fields and fortune cards */
  border: 1px solid var(--system-black);
  background: var(--system-white);
  text-align: center;
  transform: scale(0.94);
  transition: transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.wishform.is-confirming .wishform--card { transform: none; }
.wishform--q { font-size: 20px; }
.wishform--a { margin-top: 8px; font-size: 16px; color: var(--neutral-700); }
.wishform--choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 22px;
}
.wishform--choices button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 51px;
  border-radius: 999px;
  border: 1px solid var(--neutral-500);  /* outlined (Figma 637:282) */
  font-size: 16px;  /* main buttons' text */
  cursor: pointer;
}
.wishform--no { background: var(--system-white); color: var(--system-black); }
/* not enough clovers: one button, to close it */
.wishform.is-short .wishform--choices { grid-template-columns: 1fr; }
.wishform.is-short .wishform--yes { display: none; }
.wishform .wishform--yes { background: var(--system-black); color: var(--system-white); border-color: transparent; }
.wishform.is-short .wishform--no { background: var(--system-black); color: var(--system-white); border-color: transparent; }  /* the one way out, so the main button */
.wishform--choices button:focus { outline: none; }
.wishform--choices button:focus-visible { box-shadow: 0 0 0 3px var(--system-white), 0 0 0 4.5px var(--system-black); }  /* the system's double line */
/* The slip on its way up to the tree */
.wishform--fly {
  position: absolute;
  z-index: 62;
  transform-origin: 50% 50%;
  pointer-events: none;
}
.wishform--fly-text {
  position: absolute;
  left: 25px;
  top: 82.7px;
  width: 244px;
  font-size: 16px;
  line-height: 1.35;
  overflow: hidden;
}

/* Splash (Figma 486:5534): Neutral 100 under the paper grain, the logo in
   the middle (363 x 163). The letters are trimmed on by splash.js; the
   sticker behind them is stuck down once they're drawn. Above everything
   but the status bar and home indicator. */
.splash {
  position: absolute;
  inset: 0;
  z-index: 69;
  background: var(--neutral-100);
  transition: opacity calc(var(--out, 0.55s) * 0.73) calc(var(--out, 0.55s) * 0.27) ease, visibility 0s var(--out, 0.55s);
}
.splash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/system/paper-shade.png") 0 0 / 402px auto;  /* no blend: smoother */
  pointer-events: none;
}
.splash--logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 364.995px;
  height: 164.805px;
  margin: -82.4px 0 0 -182.5px;
}
.splash--logo svg { display: block; overflow: visible; }
.splash--logo #letters { opacity: 0; }
.splash.is-drawing #letters { opacity: 1; }
/* Every change on the splash is a dissolve: the sticker fades in behind
   the drawn letters, then the whole splash fades to the app */
.splash--logo #sticker { opacity: 0; transition: opacity var(--stick, 0.9s) ease; }
.splash.is-stuck #sticker { opacity: 1; }
/* Leaving: the logo dips a touch, then swells as the splash dissolves */
.splash.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.splash.is-leaving .splash--logo { animation: splash-out var(--out, 0.55s) cubic-bezier(0.5, 0, 0.3, 1) forwards; }
@keyframes splash-out {
  30% { scale: var(--dip, 0.94); }
  100% { scale: var(--grow, 1.9); }
}

/* Luck sent: the clover earned from the cards on Home (the Luck Claimed
   one) pops up above the slip, then turns small and flies up out of the frame */
.wish--clover {
  position: absolute;
  left: calc(50% - 38.3px);
  top: calc(50% + 10px - 38.3px);  /* in the slip's middle, which it shrinks into */
  width: 76.6022px;
  height: 76.6022px;
  opacity: 0;
  pointer-events: none;
}
.wish--clover.is-away { animation: clover-away 1.5s forwards; }
@keyframes clover-away {
  0% { opacity: 0; scale: 0.2; animation-timing-function: cubic-bezier(0.3, 1.5, 0.5, 1); }
  25% { opacity: 1; scale: 1; translate: 0 0; animation-timing-function: ease-in-out; }
  45% { opacity: 1; scale: 1; translate: 0 0; rotate: 0deg; animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  100% { opacity: 1; scale: 0.2; translate: 0 -560px; rotate: 30deg; }
}
/* While a wish is open the tab bar steps back; the dial's lines take its place */
.m-nav, .m-navfade { transition: opacity 0.3s; }
.is-reading .m-nav,
.is-reading .m-navfade { opacity: 0; pointer-events: none; }
/* The clover by "Corner" waits out the letters' drawing, comes in, then
   flaps its wings twice, like a butterfly, folding along the line of its
   stem (from the curl to the middle). 0.3s to come in, then the flaps. */
.splash--clover {
  transform-box: view-box;
  transform-origin: 52px 118px;
  opacity: 0;
}
/* a third of the way into the sticker coming in */
.splash.is-stuck .splash--clover { opacity: 1; animation: clover-flap calc(var(--flap, 0.8s) + 0.3s) ease-in-out calc(var(--stick, 0.9s) * 0.3) both; }
@keyframes clover-flap {
  0% { opacity: 0; transform: scale(0.4) rotate(56deg) scaleX(1) rotate(-56deg); animation-timing-function: cubic-bezier(0.3, 1.5, 0.5, 1); }
  27% { opacity: 1; transform: scale(1) rotate(56deg) scaleX(1) rotate(-56deg); }
  45%, 82% { transform: scale(1) rotate(56deg) scaleX(0.25) rotate(-56deg); }
  64%, 100% { transform: scale(1) rotate(56deg) scaleX(1) rotate(-56deg); }
}
.splash.is-reset,
.splash.is-reset * { transition: none !important; animation: none !important; }

/* --- Onboarding -------------------------------------------------------------
   Over everything but the splash, the status bar and the home indicator:
   Neutral 100 under the paper grain. Every value is the design system's:
   Cooper titles (27), Paperlogy 17 / 16 / 14, the 371 x 51 buttons, the
   1px line, the rituals' progress bar. */
.ob {
  position: absolute;
  inset: 0;
  z-index: 68;
  background: var(--neutral-100);
  font-family: var(--font-display);
  letter-spacing: var(--tracking);
  color: var(--system-black);
  transition: opacity 0.5s ease, visibility 0s 0.5s;
}
.ob::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/system/paper.png") 0 0 / 402px auto;
  mix-blend-mode: multiply;
  opacity: 0.6;
  pointer-events: none;
}
.ob.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

/* The way back and the progress, level with the header's place */
.ob--top {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 54px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
}
.is-phone .ob--top { top: 10px; }
.ob--back {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: opacity 0.3s;
}
.ob--back img { display: block; }
/* How far along: the rituals' progress bar, from the back arrow to the
   screen's 16px margin */
.ob--bar {
  flex: 1;
  height: 14px;
  margin-right: 8px;
  padding: 2px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid var(--system-black);
  background: var(--system-white);
  transition: opacity 0.3s;
}
.ob--fill {
  display: block;
  width: var(--done, 0%);
  height: 100%;
  border-radius: 999px;
  background: var(--system-black);
  transition: width 0.4s cubic-bezier(0.3, 0.8, 0.2, 1);
}
.ob[data-step="login"] .ob--bar { opacity: 0; }  /* logging in: one step, nothing to count */
.ob[data-step="welcome"] .ob--top,
.ob[data-step="done"] .ob--top { opacity: 0; pointer-events: none; }

/* Each step: the words from the top, the buttons at the foot */
.ob--page {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 122px 16px calc(var(--nav-bottom, 42px) + 4px);
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  translate: 24px 0;
  transition: opacity 0.35s, translate 0.45s cubic-bezier(0.3, 0.8, 0.2, 1), visibility 0s 0.45s;
}
.is-phone .ob--page { padding-top: 78px; }
.ob--page.is-back { translate: -24px 0; }
.ob--page.is-on { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0.1s, 0.1s, 0s; }
.ob--title {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 27px;
  letter-spacing: var(--tracking-title);
  line-height: 1.15;
}
.ob--sub { margin: 10px 0 32px; font-size: 16px; line-height: 1.35; }
.ob--field { display: block; margin-bottom: 16px; transition: margin-top 0.28s ease-in-out; }
.ob--field span { display: block; margin-bottom: 8px; font-size: 14px; }
.ob--field input {
  display: block;
  width: 100%;
  height: 58px;  /* a touch taller than the buttons: room above and below the risen name */
  padding: 0 18px;
  box-sizing: border-box;
  border: 1px solid var(--neutral-500);
  border-radius: 16px;
  background: var(--system-white);
  font: inherit;
  font-size: 16px;  /* fields' text: body size */
  letter-spacing: var(--tracking);
  color: var(--system-black);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.ob--field input::placeholder { color: var(--neutral-700); }
.ob--field input:focus { border-color: var(--system-black); }  /* selected: the Neutral 500 line turns System Black, no second ring */
.ob--field input[type="date"] { line-height: 49px; }
/* the field's name sits in it as the placeholder; once you type it rises
   small to the top, and the words drop under it (as Headspace's) */
.ob--field { position: relative; }
.ob--field > span:first-child {
  position: absolute;
  left: 19px;
  top: 19px;
  margin: 0;
  font-size: 16px;
  color: var(--neutral-700);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.18s ease, color 0.18s ease;
}
.ob--field input { transition: padding-top 0.18s ease, border-color 0.15s; }
.ob--field input::placeholder { color: transparent; }
.ob--field:has(input:not(:placeholder-shown)) > span:first-child,
.ob--field:has(input[type="date"]) > span:first-child { transform: translateY(-10px) scale(0.75); }  /* 16 → 12, 9px from the top */
.ob--field:has(input:not(:placeholder-shown)) input,
.ob--field input[type="date"] { padding-top: 18px; }
.ob--field input[type="date"] { line-height: 38px; }
/* (kept apart, so a browser that doesn't know one of these keeps the rest) */
.ob--field:has(input:-webkit-autofill) > span:first-child { transform: translateY(-10px) scale(0.75); }
.ob--field:has(input:autofill) > span:first-child { transform: translateY(-10px) scale(0.75); }
.ob--field input:-webkit-autofill { padding-top: 18px; }
.ob--field input:autofill { padding-top: 18px; }
/* the browser's suggestions (hovered, or picked): shown as if typed in our
   own face, on our own white, with the name risen above them */
.ob--field input:-webkit-autofill,
.ob--field input:-webkit-autofill:hover,
.ob--field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px var(--system-white) inset;
  -webkit-text-fill-color: var(--system-black);
  caret-color: var(--system-black);
  transition: background-color 600000s 0s, padding-top 0.18s ease;
}
.ob--field input:-webkit-autofill::first-line { font-family: var(--font-display); font-size: 16px; letter-spacing: var(--tracking); }
/* a word under the password when the account doesn't check out */
.ob--note { margin: -6px 0 0; min-height: 18px; font-size: 14px; color: var(--hot-pink); }
.ob--note.is-ok { color: var(--forest-green); }  /* good news: a name that's free, a long-enough password, a code on its way */
.ob--note.is-wait { color: var(--neutral-700); }  /* still checking */
.ob--note + .ob--field { margin-top: 10px; }
.ob--note button { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.ob--actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}
/* The app's main button, as on the wish sheet; outlined for the second choice */
.ob--btn {
  width: 100%;
  max-width: 371px;
  height: 51px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid transparent;  /* main (Figma 636:272): no line showing */
  background: var(--system-black);
  color: var(--system-white);
  font: inherit;
  font-size: 16px;  /* main buttons' text */
  letter-spacing: var(--tracking);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, margin-top 0.28s ease-in-out;
}
.ob--btn:active { transform: scale(0.97); }
.ob--btn:disabled { background: var(--neutral-300); border-color: transparent; color: var(--neutral-900); cursor: default; transform: none; }  /* Figma 638:287 */
.ob--btn.is-line { background: var(--system-white); border-color: var(--neutral-500); color: var(--system-black); }  /* Figma 637:282 */
.ob--link {
  padding: 10px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  letter-spacing: var(--tracking);
  color: var(--system-black);
  cursor: pointer;
}
.ob--link u { text-underline-offset: 3px; }
.ob--muted { color: var(--neutral-700); }  /* the question in grey, the way in in black */
.ob--or {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 371px;
  margin: 2px 0;
  font-size: 14px;
}
.ob--or::before,
.ob--or::after { content: ""; flex: 1; height: 1px; background: var(--system-black); }

/* Welcome: one screen. All the cards in a ring, as Home fans them, each
   leaning out from the middle, turning slowly round (a turn a minute and a
   half); they fade into the paper under the words */
.ob--page[data-page="welcome"] { padding-top: 0; }
.ob--art { position: absolute; inset: 0; overflow: hidden; }
.ob--ring {
  position: absolute;
  left: 50%;
  top: 875px;  /* the top card's top 214px down */
  width: 0;
  height: 0;
  animation: ob-turn 90s linear infinite;
}
.is-phone .ob--ring { top: 819px; }
@keyframes ob-turn { to { rotate: 360deg; } }
.ob--ring img {
  position: absolute;
  left: -112.5px;
  top: calc(-1 * (var(--r) + 321px));
  width: 225px;
  height: 321px;
  border-radius: 18.4px;  /* the cards' corners at this size */
  transform-origin: 112.5px calc(var(--r) + 321px);
  rotate: var(--a);
  box-shadow: 0 4px 2px rgba(168, 164, 164, 0.2);  /* the system shadow, as the cards on Home */
}
.ob--art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 52%, var(--neutral-100) 74%);
}
@media (prefers-reduced-motion: reduce) { .ob--ring { animation: none; } }
.ob--logo {
  position: relative;
  align-self: center;
  width: 160px;  /* the wordmark (Figma 501:8073), well under the splash's */
  height: auto;
  margin-top: 78px;
}
.is-phone .ob--logo { margin-top: 30px; }
.ob--hero {
  position: relative;
  margin: auto 0 43px;  /* under the ring, as far from the cards as from Get started */
  text-align: center;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 40px;  /* as the profile's name */
  letter-spacing: var(--tracking-title);
  line-height: 1.1;
}
.ob--page[data-page="welcome"] .ob--actions { position: relative; margin-top: 0; }

/* All set: the clover from Luck Claimed, a swing as it lands */
.ob--done {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ob--done img { margin-bottom: 28px; filter: brightness(0.16); }
.ob--page.is-on .ob--done img { animation: ob-clover 0.8s 0.2s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
@keyframes ob-clover { from { opacity: 0; scale: 0.3; rotate: -40deg; } }
.ob--done .ob--sub { margin-bottom: 0; }

/* Reddit's shape: each step's words centred, the fields and notes as before */
.ob--page.is-centred .ob--title,
.ob--page.is-centred .ob--sub { text-align: center; }
.ob--page.is-centred .ob--btn { align-self: center; flex: none; }
/* the steps between (code, username, password, birthday): words from the left, as v1 */
.ob--page:not(.is-centred) .ob--btn { align-self: center; flex: none; }
/* the email and log-in steps open on the clover, as All set does */
.ob--page[data-page="login"] { padding-top: 150px; }
.is-phone .ob--page[data-page="login"] { padding-top: 100px; }
/* Email: laid out as Reddit's — the mark a quarter down, the field and
   Continue just past the middle, the way to log in low over its rule */
.ob--page[data-page="email"] { padding-top: 204px; }
.is-phone .ob--page[data-page="email"] { padding-top: 160px; }
.ob--page[data-page="email"] .ob--sub { margin: 23px 0 41px; }
.ob--page[data-page="email"] .ob--note + .ob--btn { margin-top: 0; }  /* Continue 28px under the field, as Reddit's */
.ob--page[data-page="email"] .ob--note:not(:empty) { margin-bottom: 16px; }  /* and clear of a word under it */
/* a title with no line under it keeps the line's room above the field */
.ob--page[data-page="password"] .ob--title { margin-bottom: 32px; }
/* the wordmark, as the welcome's (Figma 626:213: 160 × 68) */
.ob--wordmark { align-self: center; width: 160px; height: auto; margin-bottom: 18px; }
/* the terms, under the button */
.ob--legal { margin: 15px 0 0; font-size: 14px; line-height: 1.35; text-align: center; color: var(--neutral-700); }  /* secondary words in Neutral 700 */
.ob--legal u { text-underline-offset: 3px; color: var(--system-black); }  /* the links, as "Log in" after its grey question */
/* email: the terms drop to sit just over the foot's line */
.ob--page[data-page="email"] .ob--legal { margin-top: auto; padding-bottom: 20px; }
.ob--legal + .ob--foot { margin-top: 0; }
/* the other way in, at the foot over the system line */
.ob--foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--neutral-500);
  display: flex;
  justify-content: center;
}
/* a tick in the field once it's good (the filter's Confirm check), and the
   password's eye beside it */
.ob--field.has-mark { position: relative; }
.ob--field.has-mark input { padding-right: 48px; }
.ob--ok {
  position: absolute;
  right: 15px;
  bottom: 19px;
  opacity: 0;
  transition: opacity 0.2s;
}
.ob--field.is-ok .ob--ok { opacity: 1; }
/* a word under a field opens its room smoothly, and closes it the same way */
.ob--note { max-height: 2.7em; overflow: hidden; transition: max-height 0.28s ease-in-out, min-height 0.28s ease-in-out, margin 0.28s ease-in-out, opacity 0.2s ease; }  /* room for two lines */
.ob--field.is-ok + .ob--note { max-height: 0; min-height: 0; margin: 0; opacity: 0; }  /* the tick says it: no word under it */
/* no word under a field: no room kept for one either; the fields sit at
   their usual 16px, and shift down only when a word comes */
.ob--note:empty { max-height: 0; min-height: 0; margin: 0; opacity: 0; }
.ob--note:empty + .ob--field,
.ob--field.is-ok + .ob--note + .ob--field { margin-top: 0; }
.ob--note:empty + .ob--btn { margin-top: 24px; }  /* buttons keep where they stood */
.ob--page[data-page="email"] .ob--note:empty + .ob--btn { margin-top: 12px; }
/* while it's checked: a little wheel where the tick will come */
.ob--spin {
  position: absolute;
  right: 15px;
  bottom: 19px;
  width: 20px;  /* every mark in a field: 20px, as the tick */
  height: 20px;
  box-sizing: border-box;
  border: 1.5px solid var(--neutral-300);
  border-top-color: var(--system-black);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s;
}
.ob--field.is-wait .ob--spin { opacity: 1; animation: wheel-turn 0.7s linear infinite; }
.ob--page[data-page="password"] .ob--field.has-mark input { padding-right: 84px; }
.ob--page[data-page="password"] .ob--ok { right: 56px; }
.ob--peek {
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 44px;
  height: 43px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.ob--peek svg { display: block; }
.ob--peek[aria-pressed="true"] .ob--peek-off { display: none; }
.ob--note.is-hint { color: var(--system-black); }
.ob--note + .ob--btn { margin-top: 12px; }  /* a word under the field keeps clear of the button */
/* Get started: the ways in, on the filter's sheet over the welcome */
.ob--ways { z-index: 3; }
.ob--ways .filter--sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px 40px;
  touch-action: none;  /* dragged down by its grabber */
}
/* the grabber, iOS's: a 36 × 5 pill in Neutral 500, centred at the top */
.ob--grabber { display: block; width: 36px; height: 5px; margin-bottom: 18px; border-radius: 999px; background: var(--neutral-500); cursor: grab; }
.ob--ways .ob--title { margin-bottom: 24px; text-align: center; }
.ob--ways-list { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.ob--btn.has-icon { position: relative; }
.ob--btn.has-icon > svg,
.ob--btn.has-icon > img { position: absolute; left: 20px; top: 50%; translate: 0 -50%; display: block; }
.ob--ways .ob--legal { margin: 16px 0 0; }

/* Demo only: under the phone, very small, while onboarding is up */
.demo-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 14px;  /* in the room left under the phone's frame */
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: var(--tracking);
  color: var(--neutral-700);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.is-preview .demo-hint { opacity: 1; }
/* onboarding up: fill in, skip, start over; in the app: bring it back */
.demo-hint--app,
.is-onboarding .demo-hint--ob { display: inline; }
.demo-hint--ob,
.is-onboarding .demo-hint--app { display: none; }
.wish--hold { transition: opacity 0.3s; }

/* --- The iPhone keyboard, in the desktop preview (keyboard.js) --------------
   Safari's form bar over the keyboard, slid up from the bottom while a text
   field is focused. iOS's light keyboard: its grey, white keys with a
   shadow under, the darker grey for shift, delete, 123 and return. */
.kb {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 79;
  font-family: -apple-system, system-ui, sans-serif;
  letter-spacing: 0;
  color: #000;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  -webkit-user-select: none;
  user-select: none;
  display: none;
}
.is-preview .kb { display: block; }
.is-typing .kb { transform: none; }
.is-typing .homebar { z-index: 80; }
.kb button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.kb svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Safari's bar: ‹ › to hop fields, Done to put the keyboard away */
.kb--bar {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 8px;
  background: #f6f6f6;
  border-top: 0.5px solid #c8c7cc;
}
.kb--bar span { flex: 1; }
.kb--bar button { height: 44px; padding: 0 12px; color: #007aff; }
.kb--bar button svg { stroke-width: 2; }
.kb--done { font-weight: 600; font-size: 17px; }
.kb--pad { padding: 0 3px 34px; background: #d1d4d9; }
/* The suggestion strip */
.kb--suggest { display: flex; justify-content: center; align-items: center; height: 44px; }
.kb--suggest button { height: 36px; padding: 0 14px; border-radius: 8px; font-size: 16px; }
.kb--suggest button:empty { display: none; }
.kb--keys { display: flex; flex-direction: column; gap: 11px; padding: 0 0 8px; }
.kb--row { display: flex; justify-content: center; gap: 6px; padding: 0 0; }
.kb--row.is-mid { padding: 0 19px; }
.kb--key {
  flex: 1;
  max-width: 34px;
  height: 43px;
  border-radius: 5px !important;
  background: #fff !important;
  box-shadow: 0 1px 0 #898a8d;
  font-size: 22.5px !important;
  line-height: 43px;
  text-align: center;
}
.kb--key.is-mod { flex: none; max-width: none; width: 44px; background: #abb0bc !important; font-size: 16px !important; display: grid; place-items: center; }
.kb--key.is-mod.is-on { background: #fff !important; }
.kb--row:nth-child(3) .kb--key.is-mod:first-child { margin-right: 8px; }
.kb--row:nth-child(3) .kb--key.is-mod:last-child { margin-left: 8px; }
.kb--key.is-wide { width: 92px; }
.kb--key.is-space { max-width: none; flex: 1; font-size: 16px !important; }
.kb--key.is-return { width: 92px; }
.kb--key.is-down { background: #abb0bc !important; }
.kb--key.is-mod.is-down { background: #fff !important; }
.kb--foot { display: flex; justify-content: space-between; padding: 8px 22px 0; color: #4a4a4c; }
/* The steps' buttons ride up above it */
.is-typing .ob--page { padding-bottom: calc(44px + 44px + 4 * 43px + 3 * 11px + 8px + 32px + 34px + 12px); }
.ob--page { transition: opacity 0.35s, translate 0.45s cubic-bezier(0.3, 0.8, 0.2, 1), visibility 0s 0.45s, padding-bottom 0.38s cubic-bezier(0.32, 0.72, 0, 1); }
/* From onboarding's light screen the clover starts dark, as it's drawn there */
.clover-fly.is-dark img:first-child { filter: brightness(0.16); }

/* Settings (the profile's gear): slides in over the profile as Daily
   Fortune does; a grouped list, each group an outlined System White card
   (the filter tiles' line and corner), rows split by a Neutral 100 rule */
.settings {
  --top: 0px;
  position: absolute;
  inset: 0;
  z-index: 65;
  overflow: hidden;
  background: var(--neutral-100);
  font-family: var(--font-display);
  letter-spacing: var(--tracking);
  color: var(--system-black);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0.45s;
}
.is-preview .settings { --top: 44px; }
.settings.is-open { transform: none; visibility: visible; transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1); }
.settings--bar {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--top) + 10px);
  height: 44px;
  display: grid;
  place-items: center;
  z-index: 3;
}
.settings--back { position: absolute; left: 8px; top: 0; padding: 8px; border: 0; background: none; cursor: pointer; }
.settings--back img { display: block; }
.settings p { margin: 0; }
.settings--title { margin: 0; font-family: var(--font-title); font-weight: 400; font-size: 20px; letter-spacing: var(--tracking-title); }  /* Cooper, as Daily Fortune's */
.settings--body {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--top) + 64px);
  bottom: 0;
  overflow-y: auto;
  padding: 8px 16px 48px;
  scrollbar-width: none;
}
.settings--body::-webkit-scrollbar { display: none; }
/* You, at the top: your name in Cooper, your email under it */
.settings--me { padding: 6px 4px 4px; }
.settings--me-name { font-family: var(--font-title); font-size: 27px; letter-spacing: var(--tracking-title); }
.settings--me-email { margin-top: 4px !important; font-size: 14px; }
.settings--me-email:empty { display: none; }
.settings--label { margin: 26px 4px 8px !important; font-size: 14px; }
.settings--group {
  overflow: hidden;
  border: 1px solid var(--system-black);
  border-radius: 15px;
  background: var(--system-white);
}
.settings--row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  box-sizing: border-box;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: var(--tracking);
  color: var(--system-black);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s;
}
div.settings--row { cursor: default; }
.settings--row[hidden] { display: none; }
.settings--row + .settings--row { border-top: 1px solid var(--neutral-100); }
button.settings--row:active,
label.settings--row:active { background: var(--neutral-100); }
.settings--row:focus-visible { outline: 1.5px solid var(--system-black); outline-offset: -3px; }
.settings--value { margin-left: auto; }
.settings--go { width: 13.3333px; height: 7.33333px; rotate: -90deg; opacity: 0.7; }
.settings--row.is-danger { color: var(--hot-pink); }
/* Name: typed into straight from the row */
.settings--field {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-align: right;
  outline: none;
}
/* Birthday: the date shown as words, the phone's own picker over it */
.settings--date { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.settings--date::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
/* Delete account: the wish form's dialog */
.settings--confirm {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 0 16px;
  background: rgba(39, 39, 39, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s 0.3s;
}
.settings.is-confirming .settings--confirm { opacity: 1; visibility: visible; transition: opacity 0.3s; }
.settings--confirm .wishform--card { transform: scale(0.94); }
.settings.is-confirming .wishform--card { transform: none; }
.settings .wishform--yes { background: var(--system-black); color: var(--system-white); border-color: transparent; }
/* Volume: quiet and loud at the ends; the track Neutral 100 in the line,
   filled System Black to the knob (the switch's knob); faded with sound off */
.settings--volume { gap: 12px; cursor: default; }
.settings--volume img { flex: none; display: block; }
.settings--volume input {
  --v: 100%;
  flex: 1;
  min-width: 0;
  height: 31px;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.settings--volume input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  border: 1px solid var(--system-black);
  background: linear-gradient(to right, var(--system-black) var(--v), var(--neutral-100) var(--v));
}
.settings--volume input::-moz-range-track { height: 6px; border-radius: 999px; border: 1px solid var(--system-black); background: var(--neutral-100); }
.settings--volume input::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--system-black); }
.settings--volume input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 25px;
  height: 25px;
  margin-top: -10.5px;
  border-radius: 50%;
  border: 1px solid var(--system-black);
  background: var(--system-white);
}
.settings--volume input::-moz-range-thumb { width: 25px; height: 25px; border-radius: 50%; border: 1px solid var(--system-black); background: var(--system-white); }
.settings--volume input:focus { outline: none; }
.settings--volume input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--system-white), 0 0 0 4.5px var(--system-black); }
.settings--volume.is-off { opacity: 0.4; }

/* Guest mode (guest.js): the profile's header as Figma 554:18473, a grey
   sky and white clouds, the doll a Neutral 700 silhouette with a question
   mark (tapped, it asks you to sign up), the name not to be changed */
.is-guest .profile--hero { background-image: url("assets/profile/guest-hero.svg"); }
.is-guest .profile--hero::before { background: #b0b0b0; }  /* the sky's grey, carried on up */
.is-guest .profile--avatar { display: none; }
.is-guest .profile--name button { display: none; }
.profile--who { display: none; }
.is-guest .profile--who {
  position: absolute;
  left: 237.82px;
  top: calc(164.28px - var(--up));
  z-index: 2;
  display: block;
  width: 118.715px;
  height: 245.127px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: 50% 100%;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.profile--who img { position: absolute; display: block; }
.profile--who-doll { left: 0; top: 0; }
.profile--who-q { left: 47.1px; top: 106.6px; rotate: 4.27deg; }
/* the doll and its question mark bob together, as one */
.is-guest [data-view="profile"] .profile--who { animation: profile-grow 0.6s cubic-bezier(0.3, 1.4, 0.5, 1) both, who-bob 2.4s 0.6s ease-in-out infinite; }
@keyframes who-bob { 50% { translate: 0 -4px; } }
.profile--who:active { transform: scale(0.97); }
/* its nudge: the wish form's dialog, over everything */
.nudge {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 0 16px;
  background: rgba(39, 39, 39, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s 0.3s;
}
.nudge.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s; }
.nudge .wishform--card { transform: scale(0.94); }
.nudge.is-open .wishform--card { transform: none; }
.nudge .wishform--yes { background: var(--system-black); color: var(--system-white); border-color: transparent; }

/* Daily Fortune, for a guest: the birthday first, as onboarding asks it */
.fortune--ask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--top) + 86px) 16px 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0s 0.35s;
}
.fortune[data-step="ask"] .fortune--ask { opacity: 1; visibility: visible; transition: opacity 0.35s; }
.fortune[data-step="ask"] .fortune--intro { opacity: 0; pointer-events: none; }
.fortune .fortune--ask-title { margin: 0; font-family: var(--font-title); font-weight: 400; font-size: 27px; letter-spacing: var(--tracking-title); line-height: 1.15; color: var(--system-black); }
.fortune .fortune--ask-sub { margin: 10px 0 32px; font-size: 16px; line-height: 1.35; }
.fortune--ask .ob--btn { margin: auto auto 0; color: var(--system-white); }
.fortune--ask .ob--btn:disabled { color: var(--neutral-900); }

/* Settings, for a guest: what a guest is, and the way to keep it, in place
   of your details and the account */
.settings--guest { display: none; }
.is-guest .settings--guest { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 4px 0; text-align: center; }
.settings--guest p { margin: 0 0 10px !important; font-size: 16px; line-height: 1.35; }
.settings--guest .ob--link { padding: 6px 10px 0; }
.is-guest .settings--account-only,
.is-guest .settings--me { display: none; }
/* a guest's Recently Earned Luck, before any: a word, in the tiles' line */
.profile .profile--none {
  flex: 1;
  padding: 22px 16px;
  border: 1px solid var(--system-black);
  border-radius: 15px;
  font-size: 16px;
  line-height: 1.35;
  text-align: center;
}

/* Every button with words in it: at least 10px inside on each side, so the
   words never run up to its edge */
.ob--btn,
.wishform--choices button,
.wishform--hang,
.tree--write,
.filter--confirm,
.fortune--see { padding-left: 10px; padding-right: 10px; }

/* --- The calendar ---------------------------------------------------------
   Every date field's picker, on the filter's sheet: close and Confirm over
   the Neutral 100 rule, then the month (Cooper, as the sheet's label) with
   its arrows, the weekdays over a second rule, and six weeks of days. One
   day is picked at a time: filled System Black, its number in white. */
.datepick { z-index: 68; }
.datepick .filter--confirm:disabled { color: var(--neutral-500); cursor: default; transform: none; }
.datepick .filter--confirm:disabled img { opacity: 0.35; }
.datepick--head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 20px 14px 26px;
}
.datepick--title {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: var(--tracking-title);
  color: var(--system-black);
  cursor: pointer;
}
.datepick--title svg { display: block; transition: transform 0.2s; }
.datepick--title[aria-expanded="true"] svg { transform: rotate(180deg); }
.datepick--arrows { display: flex; gap: 8px; }
.datepick--arrows button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--neutral-300);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}
.datepick--arrows button:active { transform: scale(0.92); }
.datepick--arrows button:disabled { opacity: 0.35; cursor: default; transform: none; }
.datepick.is-years .datepick--arrows { visibility: hidden; }
.datepick--week,
.datepick--days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 0 16px;
}
.datepick--week {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--neutral-100);
  font-size: 14px;
  text-align: center;
  color: var(--neutral-700);
}
.datepick.is-years .datepick--week { visibility: hidden; }
.datepick--body { position: relative; padding-top: 8px; }
.datepick--days button {
  justify-self: center;
  width: 40px;
  height: 40px;
  margin: 2px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: var(--tracking);
  color: var(--system-black);
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}
.datepick--days button:active { transform: scale(0.92); }
.datepick--days .is-out { color: var(--neutral-500); }
.datepick--days .is-today { box-shadow: inset 0 0 0 1px var(--neutral-500); }
.datepick--days .is-on { background: var(--system-black); color: var(--system-white); box-shadow: none; }
.datepick--days button:disabled { color: var(--neutral-300); cursor: default; transform: none; }
/* the years, over the days in their place */
.datepick--years {
  position: absolute;
  inset: -20px 0 0;  /* over the weekdays too */
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 6px 10px;
  padding: 0 26px 8px;
  overflow-y: auto;
  background: var(--system-white);
}
.datepick.is-years .datepick--years { display: grid; }
.datepick.is-years .datepick--days { visibility: hidden; }
.datepick--years button {
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: var(--tracking);
  color: var(--system-black);
  cursor: pointer;
}
.datepick--years .is-on { background: var(--system-black); color: var(--system-white); }
