/* Operation: Attract Your Dream Client
   Studio Phy kit v11 (build/DESIGN-SYSTEM.md): cream, white, espresso, mocha, butter. No red. Poppins only.
   Every colour lives in the :root block. Below it, components use tokens only. */

:root {
  /* Brand kit */
  --cream: #F6F4F0;
  --white: #FFFFFF;
  --espresso: #241C17;
  --mocha: #6E5B4B;
  --butter: #FFFFB0;

  /* Tints of the kit: depth, lines and glass only, never text */
  --espresso-06: rgba(36, 28, 23, .06);
  --espresso-08: rgba(36, 28, 23, .08);
  --espresso-12: rgba(36, 28, 23, .12);
  --espresso-16: rgba(36, 28, 23, .16);
  --espresso-36: rgba(36, 28, 23, .36);
  --mocha-12: rgba(110, 91, 75, .12);
  --mocha-22: rgba(110, 91, 75, .22);
  --mocha-40: rgba(110, 91, 75, .40);
  --white-60: rgba(255, 255, 255, .60);
  --white-72: rgba(255, 255, 255, .72);
  --white-92: rgba(255, 255, 255, .92);
  --white-96: rgba(255, 255, 255, .96);
  /* Navbar elevation: a hairline edge plus layered soft shadow (contact, mid, ambient) */
  --shadow-nav: 0 0 0 1px var(--espresso-06), 0 1px 2px var(--espresso-06), 0 8px 24px -12px var(--espresso-12);
  --shadow-nav-raised: 0 0 0 1px var(--espresso-08), 0 2px 4px -1px var(--espresso-08), 0 12px 24px -8px var(--espresso-12), 0 28px 56px -20px var(--espresso-16);
  --cream-10: rgba(246, 244, 240, .10);
  --cream-20: rgba(246, 244, 240, .20);
  --cream-72: rgba(246, 244, 240, .72);
  --butter-70: rgba(255, 255, 176, .70);

  /* Hero glow and dot texture: the kit at lower opacity */
  --glow-mocha: rgba(110, 91, 75, .22);
  --glow-butter: rgba(255, 255, 176, .95);
  --glow-espresso: rgba(110, 91, 75, .10);
  --dot: rgba(110, 91, 75, .42);

  /* Roles (light) */
  --bg: var(--cream);
  --surface: var(--white);
  --ink: var(--espresso);
  --ink-soft: var(--mocha);
  --line: var(--mocha-22);
  --line-dash: var(--mocha-22);
  --tint: var(--mocha-12);
  --track: var(--espresso-08);
  --action-bg: var(--espresso);
  --action-ink: var(--cream);
  --action-hover: var(--mocha);
  --today: var(--butter);
  --frost: var(--white-72);
  --scrim: var(--espresso-16);

  /* Type: Poppins only, a 500 phrase with a 300 soft phrase */
  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display: 40px;
  --fs-h1: 30px;
  --fs-num: 48px;
  --fs-num-s: 40px;
  --fs-title: 17px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-caption: 12px;
  --fs-micro: 10px;
  --lh-tight: 1.1;
  --lh-title: 1.35;
  --lh-text: 1.6;

  /* Space: 4px base */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-56: 56px;
  --gutter: 20px;
  --col: 440px;

  /* Shape */
  --r-card: 28px;
  --r-sheet: 32px;
  --r-tile: 20px;
  --r-input: 18px;
  --r-pill: 999px;
  --h-control: 56px;
  --h-icon: 44px;

  /* Depth */
  --shadow-card: 0 1px 2px var(--espresso-08), 0 12px 32px -12px var(--espresso-12);
  --shadow-pill: 0 1px 2px var(--espresso-06), 0 18px 40px -18px var(--espresso-16);
  --shadow-sheet: 0 -12px 40px -12px var(--espresso-16);
  --glass: blur(20px) saturate(140%);

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --t-tap: 120ms;
  --t: 240ms;
  --t-sheet: 320ms;
}

/* Dark surfaces (the Day 30 card, toasts): butter does the accent, cream the text */
.on-dark {
  --surface: var(--espresso);
  --ink: var(--cream);
  --ink-soft: var(--cream-72);
  --line: var(--cream-20);
  --tint: var(--cream-10);
  --action-bg: var(--butter);
  --action-ink: var(--espresso);
  --action-hover: var(--cream);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--fs-body); line-height: var(--lh-text);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--espresso); outline-offset: 3px; }
.icon { flex: none; }

/* ---------- Shell ---------- */
.shell {
  position: relative; z-index: 1; width: 100%; max-width: var(--col); margin: 0 auto;
  min-height: 100dvh; display: flex; flex-direction: column;
  padding: 0 var(--gutter) calc(var(--space-32) + env(safe-area-inset-bottom));
}
.stack { display: flex; flex-direction: column; gap: var(--space-16); }

/* ---------- Hero glow + dots ---------- */
.hero { position: absolute; inset: 0 0 auto 0; height: 600px; overflow: hidden; pointer-events: none; z-index: 0; }
.hero__glow {
  position: absolute; top: -150px; left: 50%; width: 660px; height: 560px; margin-left: -330px;
  background:
    radial-gradient(52% 58% at 62% 40%, var(--glow-butter), transparent 72%),
    radial-gradient(40% 44% at 28% 50%, var(--glow-mocha), transparent 70%),
    radial-gradient(34% 36% at 52% 72%, var(--glow-espresso), transparent 70%);
  filter: blur(40px);
  animation: drift 20s var(--ease) infinite alternate;
}
.hero__dots {
  position: absolute; top: 0; left: 50%; width: 560px; margin-left: -280px; height: 400px;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 7px 7px;
  -webkit-mask-image: radial-gradient(56% 58% at 62% 34%, var(--espresso) 30%, transparent 75%);
  mask-image: radial-gradient(56% 58% at 62% 34%, var(--espresso) 30%, transparent 75%);
  opacity: .5;
}
@keyframes drift {
  from { transform: translate3d(-12px, -6px, 0); }
  to { transform: translate3d(12px, 8px, 0); }
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-12); margin: 0 calc(var(--gutter) * -1);
  padding: calc(var(--space-12) + env(safe-area-inset-top)) var(--gutter) var(--space-12);
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.topbar.is-scrolled { background: var(--frost); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); box-shadow: 0 1px 0 var(--espresso-06); }

.logo-pill {
  display: inline-flex; align-items: center; height: var(--h-icon); padding: 0 var(--space-16);
  border-radius: var(--r-pill); background: var(--frost); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
  box-shadow: 0 1px 2px var(--espresso-06);
}
.logo-pill img { width: 78px; height: auto; }

.icon-btn {
  display: inline-grid; place-items: center; width: var(--h-icon); height: var(--h-icon); flex: none;
  border: 0; border-radius: 50%; background: var(--frost); color: var(--ink); cursor: pointer;
  -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); box-shadow: 0 1px 2px var(--espresso-06);
  transition: transform var(--t-tap) var(--ease);
}
.icon-btn:active { transform: scale(.94); }

/* ---------- Type ---------- */
.display { font-size: var(--fs-display); line-height: var(--lh-tight); font-weight: 500; letter-spacing: -.02em; }
.h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); font-weight: 500; letter-spacing: -.015em; }
.soft { font-weight: 300; color: var(--ink-soft); }
.title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 500; }
.small { font-size: var(--fs-small); line-height: 1.5; color: var(--ink-soft); }
.caption { font-size: var(--fs-caption); line-height: 1.4; font-weight: 500; color: var(--ink-soft); }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-8); height: 28px; padding: 0 var(--space-12);
  border-radius: var(--r-pill); background: var(--tint); color: var(--ink-soft);
  font-size: var(--fs-caption); font-weight: 500; line-height: 1; white-space: nowrap; width: fit-content;
}
.chip--frost { background: var(--frost); -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); }
.streak {
  height: var(--h-icon); padding: 0 var(--space-16) 0 var(--space-12); background: var(--white);
  color: var(--ink); font-size: var(--fs-small); box-shadow: var(--shadow-pill);
}
.streak .icon { color: var(--mocha); }
.streak b { font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8);
  width: 100%; min-height: var(--h-control); padding: 0 var(--space-24);
  border: 0; border-radius: var(--r-pill); background: var(--action-bg); color: var(--action-ink);
  font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background var(--t) var(--ease), transform var(--t-tap) var(--ease);
}
@media (hover: hover) { .btn:hover { background: var(--action-hover); } }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.is-disabled { background: var(--tint); color: var(--ink-soft); cursor: not-allowed; transform: none; }
.btn--fit { width: auto; }
.btn .icon { width: 18px; height: 18px; }

.round-btn {
  display: grid; place-items: center; width: var(--h-control); height: var(--h-control); flex: none;
  border-radius: 50%; background: var(--espresso); color: var(--cream);
  transition: transform var(--t) var(--ease);
}

.link-quiet {
  color: var(--ink-soft); font-size: var(--fs-small); text-decoration: underline;
  text-decoration-color: var(--line); text-underline-offset: 3px; background: none; border: 0; padding: 0; cursor: pointer;
}
.link-quiet:hover { color: var(--ink); text-decoration-color: currentColor; }

/* ---------- Cards ---------- */
.card { background: var(--surface); color: var(--ink); border-radius: var(--r-card); padding: var(--space-24); box-shadow: var(--shadow-card); }
.card--soft { background: var(--tint); box-shadow: none; border-radius: var(--r-input); padding: var(--space-16) var(--space-20); }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-8); }
.field label { font-size: var(--fs-small); font-weight: 500; }
.input {
  width: 100%; height: var(--h-control); padding: 0 var(--space-20);
  background: var(--white); border: 1px solid var(--espresso-12); border-radius: var(--r-input);
  font-size: 16px; /* 16px stops iOS zooming in */ color: var(--espresso);
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.input::placeholder { color: var(--mocha); opacity: 1; }
.input:focus { outline: none; border-color: var(--espresso); box-shadow: 0 0 0 1px var(--espresso); }
.input[aria-invalid="true"] { border-color: var(--espresso); }
.error {
  display: flex; gap: var(--space-8); align-items: flex-start; padding: var(--space-12) var(--space-16);
  border-radius: var(--r-input); background: var(--tint); color: var(--espresso);
  font-size: var(--fs-small); line-height: 1.5;
}

/* ================= Welcome ================= */
.welcome { padding-top: var(--space-40); display: flex; flex-direction: column; gap: var(--space-24); }
.welcome__head { display: flex; flex-direction: column; gap: var(--space-16); }
.welcome__head .display { max-width: 11ch; }
.note-card { display: flex; flex-direction: column; gap: var(--space-12); }
.note-card__who { display: flex; align-items: center; gap: var(--space-12); }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--cream); }
.note-card p { font-size: var(--fs-body); }
.signin { display: flex; flex-direction: column; gap: var(--space-12); }
.signin__label { font-size: var(--fs-small); font-weight: 500; margin-bottom: calc(var(--space-4) * -1); }
.signin__row { display: flex; flex-direction: column; gap: var(--space-12); }
.signin .small { text-align: center; padding: 0 var(--space-12); }

/* ================= Challenge home ================= */
.home { display: flex; flex-direction: column; gap: var(--space-24); padding-top: var(--space-8); }
.greet { display: flex; flex-direction: column; gap: var(--space-12); padding-top: var(--space-8); }

/* Big split numerals: 09 | 30 */
.numerals { display: flex; align-items: center; gap: var(--space-16); }
.numerals__big { display: flex; align-items: center; gap: var(--space-12); font-size: var(--fs-num); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.numerals__big b { font-weight: 400; }
.numerals__big span { font-weight: 300; color: var(--ink-soft); }
.numerals__big i { width: 1px; height: 36px; background: var(--line); }
.numerals__label { font-size: var(--fs-small); line-height: 1.35; color: var(--ink-soft); }
.numerals__label b { display: block; font-weight: 500; color: var(--ink); }

/* Today's prompt: the butter pill */
.today {
  display: flex; align-items: center; gap: var(--space-16); min-height: 88px;
  padding: var(--space-16) var(--space-16) var(--space-16) var(--space-24);
  border-radius: var(--r-sheet); background: var(--today); color: var(--espresso);
  text-decoration: none; box-shadow: var(--shadow-pill);
  transition: transform var(--t-tap) var(--ease);
}
.today:active { transform: scale(.98); }
@media (hover: hover) { .today:hover .round-btn { transform: rotate(45deg); } }
.today__text { flex: 1; display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.today__text .caption { color: var(--mocha); }
.today__title {
  font-size: 16px; line-height: 1.4; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.today--rest { background: var(--white); padding-right: var(--space-24); }
.today--rest .round-btn { background: var(--tint); color: var(--mocha); width: var(--h-icon); height: var(--h-icon); }

/* Progress card */
.progress { display: flex; flex-direction: column; gap: var(--space-16); }
.progress__row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-16); }
.progress__pct { font-size: var(--fs-num-s); font-weight: 300; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bar { height: 4px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; }
.bar__fill {
  height: 100%; width: var(--to); border-radius: inherit; background: var(--espresso);
  animation: fill 900ms var(--spring) both;
}
@keyframes fill { from { width: var(--from, var(--to)); } to { width: var(--to); } }

/* Calendar */
.days__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-12); margin-bottom: var(--space-16); }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-8); }
.grid > li { display: block; }
.tile {
  width: 100%;
  position: relative; aspect-ratio: 1 / 1.15; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-4); border: 0; border-radius: var(--r-tile); padding: 0; cursor: pointer;
  background: var(--white); color: var(--espresso); text-decoration: none;
  font-size: var(--fs-title); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums;
  transition: transform var(--t-tap) var(--ease), box-shadow var(--t) var(--ease);
}
.tile:active { transform: scale(.95); }
.tile__mark { height: 14px; display: grid; place-items: center; color: var(--mocha); }
.tile__mark .icon { width: 14px; height: 14px; }
.tile__meta { font-size: var(--fs-micro); font-weight: 500; color: var(--mocha); }
.tile__star { position: absolute; top: 7px; right: 7px; color: var(--mocha); }
.tile__star .icon { width: 10px; height: 10px; fill: currentColor; stroke-width: 1; }

.tile--done .tile__mark { color: var(--espresso); }
.tile--today { background: var(--today); box-shadow: var(--shadow-pill); }
.tile--today .tile__mark i { width: 6px; height: 6px; border-radius: 50%; background: var(--espresso); }
.tile--today .tile__star { color: var(--espresso); }
.tile--waiting { opacity: .6; }
.tile--locked { background: transparent; border: 1px dashed var(--line-dash); }
.tile--locked .tile__mark { opacity: .7; }

/* Unlock celebration: check draws in, one soft butter pulse */
.tile.is-new { animation: settle 520ms var(--ease) both; }
.tile.is-new::after {
  content: ""; position: absolute; inset: -10px; border-radius: 28px; z-index: -1;
  background: var(--butter-70); filter: blur(12px); animation: pulse 900ms var(--ease) both;
}
.tile.is-new .tile__mark path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 400ms 180ms var(--ease) forwards; }
@keyframes settle { from { background: var(--butter); } to { background: var(--white); } }
@keyframes pulse { 0% { opacity: 0; transform: scale(.8); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.15); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.tile.is-shake { animation: shake 360ms var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* Add to Home Screen tip */
.tip { display: flex; gap: var(--space-12); align-items: flex-start; }
.tip[hidden] { display: none; }
.tip__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--tint); color: var(--mocha); flex: none; }
.tip p { flex: 1; font-size: var(--fs-small); line-height: 1.5; }
.tip .icon-btn { width: 32px; height: 32px; background: transparent; box-shadow: none; color: var(--mocha); }

/* Day 30 complete */
.finish { display: flex; flex-direction: column; gap: var(--space-16); }
.finish__title { font-size: 24px; line-height: 1.25; font-weight: 500; }
.finish__title .soft { color: var(--ink-soft); }
.finish img { border-radius: var(--r-tile); box-shadow: var(--shadow-card); }

.foot { margin-top: auto; padding-top: var(--space-40); display: flex; justify-content: center; align-items: center; gap: var(--space-24); }
.foot form { margin: 0; }

/* ================= Bottom sheet ================= */
.scrim {
  position: fixed; inset: 0; z-index: 40; background: var(--scrim);
  -webkit-backdrop-filter: blur(6px) saturate(80%); backdrop-filter: blur(6px) saturate(80%);
  opacity: 0; transition: opacity var(--t-sheet) var(--ease);
}
.sheet {
  position: fixed; z-index: 41; left: 50%; bottom: 0; width: 100%; max-width: var(--col);
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--space-12) var(--gutter) calc(var(--space-24) + env(safe-area-inset-bottom));
  background: var(--white); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow-sheet);
  transform: translate(-50%, 100%); transition: transform var(--t-sheet) var(--ease);
}
.is-open .scrim { opacity: 1; }
.is-open .sheet { transform: translate(-50%, 0); }
.sheet__grab { width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--line); margin: 0 auto var(--space-16); }
.sheet__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-16); }
.sheet__top .icon-btn { background: var(--cream); box-shadow: none; width: 40px; height: 40px; }
.sheet__body { display: flex; flex-direction: column; gap: var(--space-20); }
.sheet__img { width: 100%; border-radius: var(--r-tile); }
.sheet__form { display: flex; flex-direction: column; gap: var(--space-12); margin-top: var(--space-4); }
.sheet__form .small { text-align: center; }
.prompt-body { white-space: pre-line; }
.tip-card .caption { color: var(--ink); margin-bottom: var(--space-4); }
.tip-card p { font-size: var(--fs-small); line-height: 1.55; white-space: pre-line; }
.posted { display: flex; align-items: center; gap: var(--space-12); padding: var(--space-12) var(--space-16); border-radius: var(--r-input); background: var(--cream); text-decoration: none; }
.posted span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-small); }
.success { display: flex; flex-direction: column; align-items: center; gap: var(--space-12); text-align: center; padding: var(--space-16) 0 var(--space-8); }
.success__check {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--butter); color: var(--espresso);
}
.success__check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 400ms 120ms var(--ease) forwards; }

/* ================= Prompt detail (day sheet and large-screen card) ================= */
.sheet__chips { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.pd { display: flex; flex-direction: column; gap: var(--space-20); }
.pd__post { font-size: 16px; line-height: 1.55; }
.pd__cols { display: flex; flex-direction: column; gap: var(--space-20); }
.pd__steps { margin: 0; display: flex; flex-direction: column; gap: var(--space-16); }
.pd__steps > div { display: flex; flex-direction: column; gap: var(--space-4); padding-left: var(--space-16); box-shadow: inset 2px 0 0 var(--line); }
.pd__steps dt { font-size: var(--fs-caption); font-weight: 500; color: var(--ink-soft); }
.pd__steps dd { margin: 0; font-size: var(--fs-body); line-height: 1.55; }
.pd__side { display: flex; flex-direction: column; gap: var(--space-12); }
.pd__why { background: var(--cream); }
.pd__why .caption { color: var(--ink); margin-bottom: var(--space-4); }
.pd__why p:not(.caption) { font-size: 14px; line-height: 1.55; }
.pd__links { display: flex; flex-direction: column; gap: var(--space-8); }
.pd__link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-12);
  padding: var(--space-12) var(--space-16); border-radius: var(--r-input);
  background: var(--white); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none;
  transition: box-shadow var(--t) var(--ease);
}
a.pd__link:hover { box-shadow: inset 0 0 0 1px var(--espresso); }
.pd__link > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd__link b { font-size: 14px; font-weight: 500; line-height: 1.4; }
.pd__link .small { font-size: var(--fs-caption); }
.pd__link .icon { color: var(--mocha); }
.pd__link--plain { background: transparent; }
.rules { border-top: 1px solid var(--line); padding-top: var(--space-12); }
.rules summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; font-size: 14px; font-weight: 500; padding: var(--space-4) 0; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: "+"; font-size: 18px; font-weight: 300; color: var(--ink-soft); }
.rules[open] summary::after { content: "\2212"; }
.rules ul { margin: var(--space-8) 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }

/* ================= Milestone modal ================= */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--gutter); }
.modal .scrim { position: absolute; z-index: 0; }
.modal__card {
  position: relative; z-index: 1; width: 100%; max-width: 360px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--space-12);
  padding: var(--space-32) var(--space-24) var(--space-24);
  opacity: 0; transform: translateY(12px) scale(.98); transition: opacity var(--t-sheet) var(--ease), transform var(--t-sheet) var(--ease);
}
.is-open .modal__card { opacity: 1; transform: none; }
.star-badge { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--butter); color: var(--espresso); margin-bottom: var(--space-4); }
.star-badge .icon { fill: currentColor; stroke-width: 1; }
.modal__card .h1 { font-size: 26px; }
.modal__card .btn { margin-top: var(--space-12); }

/* ================= Error pages ================= */
.err-shell { min-height: 100dvh; }
.err { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-16); padding: var(--space-40) 0 var(--space-56); }
.err__card { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-12); padding: var(--space-40) var(--space-32) var(--space-32); }
.err__code { margin: 0 0 var(--space-4); font-size: 72px; line-height: 1; font-weight: 300; letter-spacing: -.04em; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.err__icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: var(--space-8); border-radius: 50%; background: var(--today); color: var(--espresso); }
.err__card .h1 { font-size: 28px; line-height: 1.2; }
.err__text { max-width: 40ch; color: var(--ink-soft); }
.err__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-8); margin-top: var(--space-12); }
.err__actions .btn { min-height: 48px; padding: 0 var(--space-24); font-size: 15px; }
.err__actions .btn--line { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-dash); }
.err__help { text-align: center; max-width: 44ch; }
@media (min-width: 900px) { .err__card .h1 { font-size: 32px; } .err__code { font-size: 88px; } }

/* ================= Milestone badges ================= */
.badge { display: block; flex: none; font-family: var(--font); overflow: visible; }
.badge__disc { fill: var(--white); stroke: var(--line); stroke-width: .8; }
.badge__ring { stroke: var(--espresso); opacity: .5; }
.badge__ring--in { opacity: .22; }
.badge__arc { fill: var(--espresso); }
.badge__num { fill: var(--espresso); letter-spacing: -.04em; }
.badge__sub { fill: var(--mocha); }
.badge__star, .badge__dot { fill: var(--mocha); }
.badge--d14 .badge__disc { fill: var(--butter); stroke: none; }
.badge--d14 .badge__star { fill: var(--espresso); }
.badge--d30 .badge__disc { fill: var(--espresso); stroke: none; }
.badge--d30 .badge__ring { stroke: var(--butter); opacity: .6; }
.badge--d30 .badge__ring--in { opacity: .3; }
.badge--d30 .badge__arc { fill: var(--cream); }
.badge--d30 .badge__num { fill: var(--butter); }
.badge--d30 .badge__sub { fill: var(--cream); opacity: .72; }
.badge--d30 .badge__star, .badge--d30 .badge__dot { fill: var(--butter); }
.badge.is-locked .badge__disc { fill: transparent; stroke: var(--line-dash); stroke-dasharray: 3 3; }
.badge.is-locked .badge__ring { stroke: var(--mocha); opacity: .18; }
.badge.is-locked .badge__arc, .badge.is-locked .badge__num, .badge.is-locked .badge__sub, .badge.is-locked .badge__star, .badge.is-locked .badge__dot { fill: var(--mocha); opacity: .4; }
.badge:not(.is-locked) { filter: drop-shadow(0 6px 10px var(--espresso-12)); }
.badge--d7:not(.is-locked) .badge__disc { stroke: var(--espresso-12); }

.badges { display: flex; flex-direction: column; gap: var(--space-12); padding-top: var(--space-16); border-top: 1px solid var(--line); }
.badges__row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); }
.badges__item { display: flex; flex-direction: column; align-items: center; gap: var(--space-8); text-align: center; }
.badges__item .small { font-size: var(--fs-caption); line-height: 1.3; }
.badges__item.is-earned .small { color: var(--ink); font-weight: 500; }
.modal__badge { display: block; margin: calc(var(--space-8) * -1) 0 var(--space-4); }
.modal__badge .badge { animation: badge-in 700ms var(--spring) both; }
@keyframes badge-in { from { transform: scale(.6) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__card .caption { color: var(--ink-soft); }

/* ================= Toast ================= */
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--space-24) + env(safe-area-inset-bottom));
  max-width: calc(100% - 2 * var(--gutter)); padding: var(--space-12) var(--space-20);
  border-radius: var(--r-pill); background: var(--espresso); color: var(--cream);
  font-size: var(--fs-small); box-shadow: var(--shadow-pill);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ================= Studio (Ingrid) ================= */
.studio { max-width: 1100px; margin: 0 auto; padding: var(--space-24) var(--gutter) var(--space-56); position: relative; z-index: 1; }
.studio__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-16); flex-wrap: wrap; margin-bottom: var(--space-24); }
.studio__brand { display: flex; align-items: center; gap: var(--space-16); }
.tabs { display: flex; gap: var(--space-8); margin: var(--space-16) 0 var(--space-24); }
.tab { height: 40px; display: inline-flex; align-items: center; padding: 0 var(--space-16); border-radius: var(--r-pill); text-decoration: none; font-size: var(--fs-small); font-weight: 500; color: var(--ink-soft); background: var(--tint); }
.tab[aria-current="page"] { background: var(--espresso); color: var(--cream); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-12); margin-bottom: var(--space-24); }
.stat { padding: var(--space-20); }
.stat b { display: block; font-size: 32px; font-weight: 300; line-height: 1.1; letter-spacing: -.02em; }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; margin-bottom: var(--space-16); }
.filters select, .filters .input { height: 44px; border-radius: var(--r-pill); padding: 0 var(--space-16); width: auto; font-size: var(--fs-small); background: var(--white); border: 1px solid var(--espresso-12); }
.rows { display: flex; flex-direction: column; gap: var(--space-8); }
.row { display: grid; grid-template-columns: 1fr auto; gap: var(--space-4) var(--space-16); align-items: center; padding: var(--space-16) var(--space-20); border-radius: var(--r-tile); background: var(--white); box-shadow: 0 1px 2px var(--espresso-06); }
.row__main { min-width: 0; }
.row__main .title { font-size: var(--fs-body); }
.row__meta { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-12); font-size: var(--fs-small); color: var(--ink-soft); }
.row a.link-quiet { display: inline-flex; gap: var(--space-4); align-items: center; white-space: nowrap; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--white); border-radius: var(--r-tile); overflow: hidden; box-shadow: 0 1px 2px var(--espresso-06); font-size: var(--fs-small); }
.table th, .table td { text-align: left; padding: var(--space-12) var(--space-16); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-weight: 500; color: var(--ink-soft); font-size: var(--fs-caption); }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border-radius: var(--r-tile); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-16); font-size: var(--fs-small); color: var(--ink-soft); }
.empty { padding: var(--space-40) var(--space-24); text-align: center; color: var(--ink-soft); }
@media (min-width: 900px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .studio__cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8) var(--space-16); }
}

/* Menu button: a light round button with three lines; dark with an X while open */
summary.menu-btn, .st-account > summary.menu-btn, .account > summary.menu-btn {
  display: grid; place-items: center; border-radius: 50%; cursor: pointer; list-style: none;
  background: var(--white); color: var(--espresso); box-shadow: inset 0 0 0 1px var(--line);
  transition: background var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.menu-btn::-webkit-details-marker { display: none; }
summary.menu-btn:hover { background: var(--tint); }
details[open] > summary.menu-btn, .st-account[open] > summary.menu-btn, .account[open] > summary.menu-btn { background: var(--espresso); color: var(--cream); box-shadow: none; }
.menu-btn .icon { grid-area: 1 / 1; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.menu-btn__close { opacity: 0; transform: rotate(-90deg) scale(.8); }
details[open] > .menu-btn .menu-btn__open { opacity: 0; transform: rotate(90deg) scale(.8); }
details[open] > .menu-btn .menu-btn__close { opacity: 1; transform: none; }

/* ---------- Layout wrappers: a plain stack on phones ---------- */
.home__aside, .home__main, .welcome__intro { display: flex; flex-direction: column; gap: var(--space-24); }
.on-large, .only-large, .nav-links, .account, .welcome__lede, .welcome__photo, .steps { display: none; }
.logo-tag, .nav-end.nav-end--welcome { display: none; }
.nav-end { display: flex; align-items: center; gap: var(--space-8); }
#today, #days { scroll-margin-top: 100px; }

.btn--line {
  background: transparent; color: var(--ink); min-height: var(--h-icon); font-size: var(--fs-small);
  box-shadow: inset 0 0 0 1px var(--line-dash);
}
@media (hover: hover) { .btn--line:hover { background: var(--tint); } }

/* ---------- Tablet: a roomier single column ---------- */
@media (min-width: 600px) {
  :root { --col: 560px; --gutter: 32px; }
  .shell { padding-top: var(--space-24); }
  .welcome { padding-top: var(--space-56); }
  .on-phone { display: none; }
  .on-large { display: inline; }
}

/* ---------- Large screens: pill nav, today-first dashboard, dialog ---------- */
@media (min-width: 900px) {
  :root { --col: 1200px; --gutter: 40px; --fs-display: 60px; --fs-h1: 44px; --fs-num: 64px; }
  .only-small, .foot, .tip { display: none !important; }

  .hero { height: min(760px, 100dvh); }
  .hero__glow { width: 1500px; height: 720px; margin-left: -750px; top: -220px; }
  .hero__dots { width: 1200px; margin-left: -600px; height: 520px; }

  /* The navbar: one component for the welcome page, the challenge and the Studio.
     It spans the content width (same edges as the page), with three fixed zones:
     brand on the left, section links centred, actions on the right. */
  .topbar[data-topbar], .st-bar[data-topbar] {
    position: sticky; top: var(--space-12); z-index: 30;
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: var(--space-16);
    width: auto; max-width: none; min-height: 64px; box-sizing: border-box; margin: var(--space-16) 0 0; padding: 8px;
    border-radius: var(--r-pill); background: var(--frost); box-shadow: var(--shadow-nav);
    -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
    transition: background 320ms var(--ease), box-shadow 320ms var(--ease), -webkit-backdrop-filter 320ms var(--ease), backdrop-filter 320ms var(--ease);
  }
  .topbar[data-topbar].is-scrolled, .st-bar[data-topbar].is-scrolled {
    background: var(--white-96); box-shadow: var(--shadow-nav-raised);
    -webkit-backdrop-filter: blur(28px) saturate(160%); backdrop-filter: blur(28px) saturate(160%);
  }

  /* Brand */
  .topbar[data-topbar] .logo-pill, .st-bar[data-topbar] .st-logo {
    grid-column: 1; justify-self: start; display: inline-flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 var(--space-8) 0 var(--space-16); background: transparent; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; text-decoration: none;
  }
  .topbar[data-topbar] .logo-pill img, .st-bar[data-topbar] .st-logo img { width: 78px; }
  .logo-tag, .st-bar[data-topbar] .st-logo span {
    display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
    background: var(--tint); color: var(--ink-soft); font-size: var(--fs-caption); font-weight: 500; white-space: nowrap;
  }

  /* Section links, centred */
  .topbar[data-topbar] .nav-links, .st-bar[data-topbar] .st-nav {
    grid-column: 2; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: var(--r-pill);
  }
  .topbar[data-topbar] .nav-links a, .st-bar[data-topbar] .st-nav a {
    display: inline-flex; align-items: center; gap: var(--space-4); height: 40px; padding: 0 var(--space-16);
    border-radius: var(--r-pill); color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap;
    transition: background var(--t) var(--ease), color var(--t) var(--ease);
  }
  .topbar[data-topbar] .nav-links a:hover, .st-bar[data-topbar] .st-nav a:hover { background: var(--tint); color: var(--ink); }
  .topbar[data-topbar] .nav-links a[aria-current], .st-bar[data-topbar] .st-nav a[aria-current] { background: var(--espresso); color: var(--cream); }
  .nav-links a .icon { width: 14px; height: 14px; opacity: .7; }

  /* Actions, right */
  .topbar[data-topbar] .nav-end, .st-bar[data-topbar] .st-account { grid-column: 3; justify-self: end; }
  .nav-end { display: flex; align-items: center; gap: var(--space-8); }
  .nav-end.nav-end--welcome { display: flex; }
  .nav-text { display: inline-flex; align-items: center; gap: var(--space-4); height: 44px; padding: 0 var(--space-12); color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500; border-radius: var(--r-pill); }
  .nav-text:hover { background: var(--tint); color: var(--ink); }
  .nav-text .icon { width: 14px; height: 14px; }
  /* Welcome page: a small pill with just the brand and Instagram, no actions */
  .topbar[data-topbar].topbar--compact {
    display: flex; align-items: center; gap: 0; width: fit-content; min-height: 52px; padding: 4px 6px 4px 4px; justify-self: start;
  }
  .topbar--compact .logo-pill { height: 44px; }
  .topbar--compact .nav-end--welcome { position: relative; margin-left: var(--space-8); padding-left: var(--space-8); }
  .topbar--compact .nav-end--welcome::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
  .account__btn, .st-bar[data-topbar] .st-account > summary { width: 44px !important; height: 44px !important; }

  .nav-end { gap: 6px; }
  .topbar .streak { height: 44px; box-shadow: inset 0 0 0 1px var(--line); padding: 0 var(--space-16) 0 var(--space-12); }
  .account { display: block; position: relative; }
  .account__btn {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; list-style: none; cursor: pointer;
    background: var(--espresso); color: var(--cream); font-size: 15px; font-weight: 500; user-select: none;
  }
  .account__btn::-webkit-details-marker { display: none; }
  .account__menu {
    position: absolute; right: 0; top: calc(100% + var(--space-12)); width: 260px; z-index: 30;
    display: flex; flex-direction: column; gap: 2px; padding: var(--space-20);
    background: var(--white); border-radius: var(--r-tile); box-shadow: var(--shadow-card), 0 24px 48px -24px var(--espresso-16);
  }
  .account__menu .small { overflow: hidden; text-overflow: ellipsis; margin-bottom: var(--space-8); }
  .account__menu form { margin: 0; }
  .account__menu > p { padding: 0 12px; }
  .account__menu a, .account__menu button {
    display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none;
    color: var(--ink); text-decoration: none; text-align: left; font-size: 14px; cursor: pointer;
  }
  .account__menu a:hover, .account__menu button:hover { background: var(--tint); }

  /* Home: a summary row, then today's prompt (left) beside progress and the 30 days (right) */
  .home {
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-areas: "greet numerals" "today progress" "today days";
    grid-template-rows: auto auto 1fr;
    column-gap: var(--space-32); row-gap: var(--space-24); align-items: start;
    padding-top: var(--space-56);
  }
  .home__aside, .home__main { display: contents; }
  .greet { grid-area: greet; align-self: end; padding: 0; }
  #numerals { grid-area: numerals; align-self: end; justify-self: end; }
  #today { grid-area: today; align-self: stretch; display: flex; flex-direction: column; gap: var(--space-24); }
  #progress { grid-area: progress; }
  .days {
    grid-area: days; align-self: start; position: sticky; top: 96px; display: flex; flex-direction: column;
    background: var(--white-60); border-radius: var(--r-card); padding: var(--space-32); box-shadow: var(--shadow-card);
  }
  .legend { display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-20); list-style: none; margin: 0; padding: var(--space-24) 0 0; font-size: var(--fs-caption); color: var(--ink-soft); }
  .legend li { display: inline-flex; align-items: center; gap: var(--space-8); }
  .legend__swatch { width: 14px; height: 14px; border-radius: 5px; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
  .legend__swatch--today { background: var(--today); box-shadow: none; }
  .legend__swatch--waiting { opacity: .6; }
  .legend__swatch--locked { background: transparent; box-shadow: none; border: 1px dashed var(--line-dash); }
  .numerals__big i { height: 48px; }
  .progress { padding: var(--space-24) var(--space-32); }
  .grid { grid-template-columns: repeat(6, 1fr); }

  /* Today's prompt, inline */
  .focus { display: flex; flex-direction: column; gap: var(--space-20); padding: var(--space-12) var(--space-12) var(--space-32); }
  .focus > :not(.focus__pill):not(.focus__done):not(.focus__rest) { margin: 0 var(--space-20); }
  .focus__pill { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-24) var(--space-32) var(--space-32); border-radius: var(--r-tile); background: var(--today); color: var(--espresso); }
  .focus__pill .caption { color: var(--mocha); }
  .focus__title { font-size: 30px; line-height: 1.2; font-weight: 500; letter-spacing: -.015em; }
  .focus .prompt-body { font-size: 16px; max-width: 60ch; }
  .focus .pd__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-24); align-items: start; }
  .focus__form { display: flex; flex-direction: column; gap: var(--space-12); padding-top: var(--space-8); border-top: 1px solid var(--line); margin-top: var(--space-4); }
  .focus__form .field { padding-top: var(--space-16); }
  .focus__row { display: flex; gap: var(--space-12); }
  .focus__row .input { flex: 1; min-width: 0; }
  .focus__row .btn { flex: none; }
  .focus__done { display: flex; align-items: center; gap: var(--space-12); padding: var(--space-12) var(--space-16); border-radius: var(--r-input); background: var(--cream); font-size: 14px; font-weight: 500; }
  .focus__check { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--espresso); color: var(--cream); flex: none; }
  .focus__check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 400ms 120ms var(--ease) forwards; }
  .focus:has(.focus__rest) { padding: var(--space-32); }
  .focus .focus__rest { margin: 0; display: flex; align-items: center; gap: var(--space-20); }
  .focus__rest .focus__title { font-size: 24px; margin-bottom: var(--space-4); }
  .focus__clock { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--tint); color: var(--mocha); }

  /* Recent posts: fills the left column down to the bottom of the 30 days */
  .recent { display: flex; flex-direction: column; gap: var(--space-8); flex: 1; padding: var(--space-32); }
  .recent__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-12); margin-bottom: var(--space-8); }
  .recent__list { list-style: none; margin: 0; padding: 0; }
  .recent__list li + li { border-top: 1px solid var(--line); }
  .recent__row { display: flex; align-items: center; gap: var(--space-16); padding: var(--space-12) 0; text-decoration: none; color: var(--ink); }
  .recent__day { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--cream); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
  .recent__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .recent__text b { font-size: 15px; font-weight: 500; }
  .recent__go { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--cream); color: var(--ink); transition: background var(--t) var(--ease), color var(--t) var(--ease); }
  .recent__row:hover .recent__go { background: var(--espresso); color: var(--cream); }
  .recent__empty { padding: var(--space-8) 0; }
  .finish { padding: var(--space-40); }
  .finish img { max-width: 360px; }

  /* Welcome, 900 to 1099px: one centred column */
  .welcome { padding: var(--space-56) 0; width: 100%; max-width: 600px; margin: 0 auto; gap: 28px; }
  .welcome__head { gap: var(--space-20); }
  .welcome__head .display { max-width: 12ch; }
  .welcome__lede { display: block; font-size: 18px; line-height: 1.6; color: var(--ink-soft); max-width: 52ch; }
  .note-card { padding: var(--space-24) 28px; }

  /* Email and button in one white pill */
  .signin { gap: var(--space-12); }
  .signin__label { margin-bottom: 0; }
  .signin__row {
    flex-direction: row; align-items: center; gap: var(--space-8); padding: 6px;
    background: var(--white); border-radius: var(--r-pill); box-shadow: var(--shadow-pill);
    transition: box-shadow var(--t) var(--ease);
  }
  .signin__row:focus-within { box-shadow: 0 0 0 2px var(--espresso), var(--shadow-pill); }
  .signin__row .input { flex: 1; min-width: 0; height: 52px; border: 0; background: transparent; padding: 0 var(--space-20); }
  .signin__row .input:focus { box-shadow: none; }
  .signin__row .btn { width: auto; flex: none; min-height: 52px; padding: 0 var(--space-32); }
  .signin .small { padding: 0 var(--space-20); text-align: left; }

  /* How it works: one glass card under the email pill, in the same material as the nav */
  .welcome__head .chip { display: none; }  /* the nav pill already says "30-day challenge" */
  .steps {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0; padding: 6px;
    border-radius: var(--r-card); background: var(--frost);
    -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass);
    box-shadow: 0 1px 2px var(--espresso-06), inset 0 0 0 1px var(--white-60);
  }
  .steps li { display: flex; align-items: center; gap: var(--space-12); padding: var(--space-12) var(--space-16); font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
  .steps li + li { box-shadow: inset 1px 0 0 var(--line); }
  .steps b { display: block; color: var(--ink); font-weight: 500; font-size: 14px; }
  .steps__icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--white); color: var(--espresso); box-shadow: 0 1px 2px var(--espresso-08); }

  /* Other days open in a centred dialog */
  .sheet {
    top: 50%; bottom: auto; max-width: 560px; max-height: min(86dvh, 820px);
    border-radius: var(--r-sheet); padding: var(--space-32) var(--space-40) var(--space-40);
    box-shadow: var(--shadow-card), 0 40px 80px -24px var(--espresso-36);
    transform: translate(-50%, -46%) scale(.98); opacity: 0;
    transition: transform var(--t-sheet) var(--ease), opacity var(--t-sheet) var(--ease);
  }
  .is-open .sheet { transform: translate(-50%, -50%); opacity: 1; }
  .sheet__grab { display: none; }
  .sheet .h1 { font-size: 34px; }
  .modal__card { max-width: 440px; padding: var(--space-40); }
  .toast { bottom: var(--space-32); }
}

/* Welcome, 1100px and up: story, sign-in and steps on the left; the photo, as tall as that column, on the right */
@media (min-width: 1100px) {
  .welcome {
    display: grid; max-width: none; margin: 0;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    grid-template-areas: "head media" "form media" "steps media";
    grid-template-rows: auto auto auto; align-content: center;
    column-gap: 96px; row-gap: 0;
    padding: var(--space-24) 0 var(--space-16); min-height: calc(100dvh - 140px);
  }
  .welcome__head { grid-area: head; padding-bottom: var(--space-32); }
  .signin { grid-area: form; max-width: 560px; padding-bottom: var(--space-24); }
  .steps { grid-area: steps; max-width: 560px; }
  .welcome__media { grid-area: media; position: relative; align-self: stretch; min-height: 440px; }
  .welcome__photo {
    display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
    border-radius: var(--r-sheet); box-shadow: var(--shadow-card), 0 40px 80px -40px var(--espresso-36);
  }
  .welcome__media .note-card {
    position: absolute; left: -56px; bottom: var(--space-24); width: min(360px, 88%);
    box-shadow: var(--shadow-card), 0 30px 60px -30px var(--espresso-16);
  }
  .welcome__media .note-card p { font-size: 14px; line-height: 1.6; }
  .welcome__media .avatar { width: 44px; height: 44px; }
}

/* Short laptop screens: keep the whole welcome above the fold */
@media (min-width: 900px) and (max-height: 820px) {
  :root { --fs-display: 52px; }
  .welcome__lede { font-size: 17px; }
}

@media (min-width: 1200px) {
  .home { column-gap: var(--space-40); }
  .focus__title { font-size: 34px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .hero__glow { animation: none; }
}
